YahnisElsts / plugin-update-checker

A custom update checker for WordPress plugins. Useful if you don't want to host your project in the official WP repository, but would still like it to support automatic updates. Despite the name, it also works with themes.
MIT License
2.22k stars 403 forks source link

Filter to Disable All Functionality for Specific Plugin #390

Closed claytoncollie closed 4 years ago

claytoncollie commented 4 years ago

I have a WP install where my team tests all of my plugins before releasing a new version. I setup a GitHub Action that deploys the repository code automatically when pushing to the develop branch. I would like to disable the plugin-update-checker package for plugins that are deployed with this action. I am writing a small mu-plugin to drop into this site and have an array of plugins I am targeting.

Is there a filter I can access to disable all functionality on a per plugin basis?

YahnisElsts commented 4 years ago

There is no "disable everything" filter, but there is a number of filters that you can use to disable certain features or change how the update checker works.

For example, you can prevent it from checking for updates by using the puc_check_now-$slug filter. Return false to disable automatic update checks. However, this won't disable the "check for updates" link that's under the plugin description on the "Plugins" page, and any cached updates will still show up.

claytoncollie commented 4 years ago

I was thinking about a filter like that for disabling remote checks. I originally was going to filter http_request_args to disable checks to the wordpress.org server but also need something for GitHub/BitBucket. I will try the filter you suggested.

I also saw how you used plugin_row_meta links. I will try to unset those from the array.

Thanks for the guidance.