wordpresspluginsupdating

How can I disable WordPress plugin updates?


I've found a great plugin for WordPress under GPLv2 license and made a lot of changes in source code, plugin does something else now. I modified author (with original plugin author's credits), URL, version number (from xxx 1.5 to YYY 1.0).

Everything works great, but when WordPress checks for plugin updates it treats my plugin YYY 1.0 as xxx 1.0 and displays notification about available update.

My changed plugin YYY 1.0 was installed by copying files from my computer, not from WP repository.

What else do I have to change?


Solution

  • In the plugin file, there will be a function that will check for updates. The original author could have named this anything, so you will have to go through the code and check each function and what it does. I would imagine the function will be quite obvious as to what it does.

    Alternatively you can add this to your plugin file:

    add_filter( 'http_request_args', 'dm_prevent_update_check', 10, 2 );
    function dm_prevent_update_check( $r, $url ) {
        if ( 0 === strpos( $url, 'http://api.wordpress.org/plugins/update-check/' ) ) {
            $my_plugin = plugin_basename( __FILE__ );
            $plugins = unserialize( $r['body']['plugins'] );
            unset( $plugins->plugins[$my_plugin] );
            unset( $plugins->active[array_search( $my_plugin, $plugins->active )] );
            $r['body']['plugins'] = serialize( $plugins );
        }
        return $r;
    }
    

    Credits: http://developersmind.com/2010/06/12/preventing-wordpress-from-checking-for-updates-for-a-plugin/