• I was documenting the various templates I make in Wordfence Central, and got to thinking when looking at the “Scan {core|theme|plugin} files against repository versions for changes” and I’m wondering if there’s a way to include custom/private plugins? Before you say no, hear me out!

    In my custom plugins, I use the update_plugins_{$hostname} hook to ping my site where I host my custom plugins to check for updates. The hook is called based on the Update URI header field in the plugin. I built my own platform to allow automatic updates for my custom plugins, so my custom plugins’ automatic updates use only the native WP hooks.

    I’m hoping a future version of Wordfence could also send a GET request to the URL in the plugin’s defined Update URI header with params (or headers) like:

    https://example.com/automatic-update/?product=plugin&slug=my-custom-plugin&version=1.0.9

    or

    https://example.com/automatic-update/?product=theme&slug=my-custom-theme&version=2.3.1

    And then my endpoint should return the same JSON value of the requested product at the requested version that the update hook would’ve returned for $update, like this:

    {
    "id": "https://example.com/automatic-update/",
    "slug": "my-custom-plugin",
    "version": "1.0.9",
    "url": "https://example.com/plugins/my-custom-plugin/",
    "package": "https://cdn.example.com/plugins/my-custom-plugin/my-custom-plugin_1-0-9.zip",
    "tested: "7.0",
    "requires_php": "8.0",
    "autoupdate": true,
    "icons: [],
    "banners": [],
    "banners_rtl": [],
    "translations": [],
    }

    Or false, but you get my point. That way you can grab the zip file of the package from that endpoint (and from update_themes_{$hostname} for custom themes) and compare those files (if retrieved successfully) to the ones currently installed.

    Or you can add a filter like WP core does for updates, and our plugins can hook into it. Either way, thanks for considering!

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)

You must be logged in to reply to this topic.