Site icon CleanTalk's blog

Automating CleanTalk Anti-Spam Updates for WordPress

If you serve a couple of sites, then updating the plugins does not cause any difficulties. Difficulties appear if you serve a few dozen, or even hundreds of sites.

CleanTalk Anti-spam requires frequent updates (we have to release a new version every 1-2 weeks), there are many reasons for this.

WordPress, as a designer, has a huge number of plugins, themes, widgets, etc. which are not always designed with WordPress Codex, have different architecture and event handling. Therefore, CleanTalk integration errors can occur with different components, especially rare ones.

Each complex service that uses a large amount of data, changes backend, changes in logic and a lot of the rest, require changes in the plugin.

At our update rates for the plugin, the auto-update option is required. If this option is done in the plugin’s settings, then the user will still need to go to each site in the plugin’s settings and install it. But what to do in a situation where the user does not want to include auto-update, but you need to update the plug-in immediately on one hundred sites?

For the convenience of service management, the auto-update option was implemented in the Service Control Panel.

Auto-update allows you to update the plugin one time at a single site, a group of sites, or enable auto-update on all sites.

How it works

Historically, we are monitoring the client version of the plugin, and when clients are contacted and feedback analysis, we need to know the version of the plugin that is being used. Each anti-spam plugin, with each request, sends its version in the parameters. The version number is compared with the number in the repository, and if the versions are different, then in the Control Panel we show a warning about the need for an update.

Next, when clicking on a link, a modal window opens with options for updates.

When the option is selected, the server makes a special request to the plugin on the client’s site.

The plugin, having received the call, checks the parameters of the call for authenticity and starts work. Auto-update is implemented through a modified class of auto-update plugins WordPress. After the class is finished, the plugin checks the version of the updated files and makes a request to the site (itself). If the HTTP response code is 200, it reports this to the server by displaying it on the “OK” page and makes a special API call, reporting on the new version. If the response code is different from 200, the plugin does a rollback of the files to the previous version and responds north with a string with an error code and technical parameters.

After a successful update, the status in the Service Control Panel changes to “App has been updated”.

How to set up an auto-update

Please, go to your CleanTalk Dashboard.

Automating CleanTalk Anti-Spam Updates for WordPress
Exit mobile version