I use Easy Digital Downloads Software Licensing to manage and distribute the plugins I sell. Without going into detail, you get a handy class and code snippet that you add to your plugin files that allows your plugin to check for available updates after it’s been installed on your clients’ websites. There are full instructions here if that’s what you’re after.

In my ongoing quest to make plugin files as neat as possible, I added the updater code snippet in one of the plugin files, not in the main plugin file. Testing this out, I found that available updates weren’t being picked up by sites that had my plugin installed. Moving the constants and the code snippet to the bottom of my main plugin file fixed the problem.

All this is implicit (I think) in the guidance but it took me a while to figure out that it’s crucial. The code snippet makes use of __FILE__ which should be pointing to the main plugin file. If you wanted to move the code snippet to another page within the plugin, you’d need to set a constant that pointed back to the main plugin file.

Published by Catapult Themes

    Leave a Reply

    Your email address will not be published. Required fields are marked *