Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

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).

share|improve this question

2 Answers 2

up vote 15 down vote accepted

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 Answer (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 Answer:

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


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

share|improve this answer
    
Awesome answer! Perhaps I'll change the plugin name, version number, and directory name, and then install the original plugin but leave it deactivated so I can see when it updates. –  Zach L Jun 29 '12 at 19:45
1  
@ZachL - Brilliant! That should work just fine! –  SickHippie Jun 29 '12 at 19:47
2  
You can also modify the original plugin header Description and add some notice, like: Description: ONLY FOR REFERENCE, DON'T ACTIVATE!...[rest of the description] –  brasofilo Jun 29 '12 at 19:52
1  
@ZachL - Added a full second alternative based on this Comments :) –  brasofilo Jul 14 '12 at 17:56

You can't disable updates but not update notifications - they're tied together.

To disable notifications altogether, change the folder name the plugin sits in.

My personal method is prepend 3 a's to the title of the plugin in the main plugin.php file, so in my plugin list I see AAA/Plugin Name. This puts it up at the top of the list for reference, and will show in the plugin list and in the update list. It's basically a personal flag so I know to not autoupdate those specific plugins.

share|improve this answer
    
Thanks for the response. Just to clarify, are you saying that renaming a plugin does NOT stop its update notifications? –  Zach L Jun 29 '12 at 19:12
    
As for your first sentence... I'm sure I could find some way to achieve this effect, perhaps with some sneaky js to just remove the link from the notification. –  Zach L Jun 29 '12 at 19:14
    
AFAIK, renaming a plugin's main file or title in that main file does not stop update notifications. I'm fairly sure that the Plugin Repository pulls based on folder name (the zip downloaded from the Repo should have the same name plus version number). For the update disabling, there's the plugin list and the updates list, so make sure your JS is firing in both places (also, share that JS - could be useful). –  SickHippie Jun 29 '12 at 19:32

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.