Automatic updates

Automatic updates

Update Premium Plugins

For checking for plugin updates, we will use this plugin: wp-kitten/envato-update-plugins. This plugin extends standard Wordpress mechanism - informs about updates and enables automatic update.

For this plugin to work, you will need Envato username and API key generated on this page.

Update Premium Themes

For themes, we are using plugin Envato WordPress Toolkit: envato/envato-wordpress-toolkit

Tuning update check

By default, plugin update check will happen on 12 hours. But, if you want to force it immediately, just remove one transient value in options table.

You can force plugin checks - to demonstrate plugin update - first change version number in a header (comments) of a plugin’s main PHP, for the plugin that you want to simulate update. file.

You can also force plugin update check from database update:

mysql --host=<SAVE-UP.CH-DBHOST> --user=<SAVE-UP.CH-DBUSER> --password='<SAVE-UP.CH-DBPASS>' -e "USE <SAVE-UP.CH-DBNAME>; UPDATE wp_options set option_value='' where option_name='_site_transient_update_plugins';"

as explained in this article.

We can also install a plugin (Force Plugin Updates Check) to force plugin update check. It is a very simple plugin that adds a link to the admin-toolbar.

Note: There is an option in admin area to force update check. But, I’m not sure if it triggers update check onyl for core, or also for plugins.

Development

There is a cute way to show notifications next to the plugin before it is updated - when update is suggested.

I really need this to warn the user if we changed something in that plugin, and we must take special care after updating it.

Hook used for that is in_plugin_update_message-{folder}/{file}, where folder and file are from wp-plugins directory, for example for plugin W3TC it is w3-total-cache/w3-total-cache.php;

Update notification on plugin page Warning Message For Self Customized Plugins WordPress › in_plugin_update_message-{$file}

date 18. Dec 2015 | modified 23. Jun 2022
filename: Wordpress Plugin - Automatic Updates