0

I followed this tutorial to provide update to my plugins on my server:

https://rudrastyh.com/wordpress/self-hosted-plugin-update.html

This uses filter hooks plugins_api and site_transient_update_plugins to retrieve plugin info from custom server (my server in this case) :

            "name" => "My Update Checker",
            "slug" => "my-update-checker",
            "author" => "",
            "author_profile" => "",
            "version" => "1.0.91",
            "download_url" => "https://my-domain/some-folder/my-plugin.zip",
            "requires" => "4.5",
            "tested" => "6.62",
            "requires_php" => "5.3",
            "last_updated" => "2024-09-13 00:00:00",
            "sections" => array(
                "description" => "The new version of the This plugin",
            )

Is there a way to make dynamic download_url, so the download_url doesnt really show actual plugin location on server ? ( https://my-domain/some-folder/my-plugin.zip )

I know users who already own the plugin can share the plugin anywhere (without permission), but thats not the point here.

I just dont want plugin link to be publicly visible ( https://my-domain/some-folder/my-plugin.zip )

I can put plugins zip anywhere on my server, but is there a way generate one time usable random link like:

https://my-domain/th45Z5ewrt346f5sdd23g5hr324wtz4twetew/my-plugin.zip

5
  • 1
    you can use a unique key in the url to identify that the download is allowed. and then on the provider domain, you test if the key is valid, you start the download (look here) and you deny all further download with this key.
    – mmm
    Commented Sep 15 at 19:51
  • But will this work as this is no initiated with click? Wordpress core will use this download_url to download a plugin (on clients side) when its time to make an update.
    – Toniq
    Commented Sep 16 at 7:54
  • of which click do you think ? about the use of the hook site_transient_update_plugins, there is a new hook you can use since version 5.8 : wordpress.stackexchange.com/questions/426518/…
    – mmm
    Commented Sep 16 at 11:36
  • Actually my code from above linked tutorial is working now. I dont quite get this new hook. What is $hostname? my server url? because the code for update need to be present in my plugin and the plugin is installed on user computer(s) on any address.
    – Toniq
    Commented Sep 16 at 14:38
  • the part "my_domain.com" in the hook is the domain of the url in the header "Update URI".
    – mmm
    Commented Sep 16 at 16:14

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.