If I rename a plugin (in its main php file) do I still get update notifications?

I’ve recently been forced to edit the core files of a plugin. I’ve updated the title of said plugin to indicate that its been edited.

My question is will the plugin still get update notifications? If so, I’ll likely disable the updates for this plugin, to prevent someone forgetting about my updates and overwriting.

Ideally, I would like to see if the plugin gets updates, but not allow them to happen just by clicking update. (it would have to be uninstalled and reinstalled, or similar).

2

As SickHippie says and AFAIK, you can’t have both. I’m adding an answer with the info I collected in this Stack.


Disable update notification for individual plugins

Bainternet in a Comment:

Simply open up the plugin file and change the version number to something like 9.9.9

Hameedullah Khan’s (removing Akismet update notice):

function filter_plugin_updates( $value ) {
    unset( $value->response['akismet/akismet.php'] );
    return $value;
}
add_filter( 'site_transient_update_plugins', 'filter_plugin_updates' );

What Triggers a Plugin Update Alert

Otto’s :

The API uses a rather elaborate mechanism to match plugins against
plugins it knows about, but these are the main things checked for:
Plugin URI, Plugin Name, and Plugin slug (the directory name the
plugin is in)

Change any of those and you reduce the chances of it finding a match,
but it might still get it if two of them match, for example.

Info in the readme.txt is not used for this. The header of the
plugin’s PHP file itself is used.


Alternative approach 1

  • Modify the plugin to check updates in your own custom Repository.
  • You will have to follow the original plugin updates, either visiting the official Repo regularly or having the original installed in some other WordPress installation.
  • When you decide your modified plugin must be updated, commit it to your Repo and you’ll get the notification
  • Tutorial: http://wp.tutsplus.com/tutorials/plugins/a-guide-to-the-wordpress-http-api-automatic-plugin-updates/
  • The book Professional WordPress Plugin Development, by Brad Williams, Ozh Richard and Justin Tadlock, has a chapter on this matter
    enter image description here

Alternative approach 2 pulled from the Comments

  • change the plugin name, version number, and directory name
  • install the original plugin but leave it deactivated to receive update notices
  • add a custom message to the plugin description (or replace the original)
  • remove the plugin actions (Activate|Edit|Delete) and the checkbox for Bulk Actions

enter image description here

add_filter( 'all_plugins', 'wpse_56968_on_list_plugins' );
add_filter( 'plugin_action_links_akismet/akismet.php', 'wpse_56968_remove_plugin_actions', 10, 4 );
add_action( 'admin_head-plugins.php', 'wpse_56968_remove_plugin_checkbox' );

function wpse_56968_on_list_plugins( $plugins )
{
    $plugins['akismet/akismet.php']['Description'] = '<strong>*** NOTICE: PLUGIN ONLY TO CHECK UPDATES IN THE ORIGINAL ONE! ***</strong> ';// . $plugins['akismet/akismet.php']['Description'];
    return $plugins;
}

function wpse_56968_remove_plugin_actions( $actions, $plugin_file, $plugin_data, $context ) 
{
    unset( $actions['activate'], $actions['edit'], $actions['delete'] );
    return $actions; 
}

function wpse_56968_remove_plugin_checkbox()
{
    ?>
        <script type="text/javascript">
            jQuery(document).ready( function($) {
                $('tr#akismet th.check-column').html('&nbsp;')
            });     
        </script>
    <?php
}

Related Core Tickets

  • #10814 Plugin GUIDs

  • #8964 Allow adding headers to get_plugin_data

Leave a Comment