Solved

Updating Wordpress Plugins

Posted on 2013-12-05
8
239 Views
Last Modified: 2013-12-09
Hi, i often customise several plugins that i downloaded for various clients, however when a new update comes out for the plugin, some of my clients update the plugin and this often overwrites my changes.

Is there a way to stop / disable plugins from showing 'Update Available' so that they don't update it?

Thanks in advance...
0
Comment
Question by:oo7ml
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
  • 3
  • 2
8 Comments
 
LVL 17

Accepted Solution

by:
OmniUnlimited earned 450 total points
ID: 39698164
There are a number of ways you can disable plugins in WordPress.  Probably the one you are interested in using is the auto_update_plugin filter.  An example of how to disable plugin updates would be:

add_filter( 'auto_update_plugin', '__return_false' );

Open in new window


You can find more examples, descriptions and expanations on the WordPress Codex.  This article points to a marvellous writeup on the subject found at http://make.wordpress.org/core/2013/10/25/the-definitive-guide-to-disabling-auto-updates-in-wordpress-3-7/.

Hope this helps.
0
 

Author Comment

by:oo7ml
ID: 39698826
Thanks, just two quick questions:

01 - where do i add / edit that line of code
02 - is it possible to hide a plugin from showing in the plugins list
0
 
LVL 17

Assisted Solution

by:OmniUnlimited
OmniUnlimited earned 450 total points
ID: 39698991
The filter would be added to your wp_config.php file.

You can use the following function to hide plugins from the plugin list (taken from http://wordpress.org/support/topic/how-to-a-hide-plugin-from-username):

function mytest() {
  global $wp_list_table;
  $hidearr = array('hello.php');  // substitute the main plugin file that you want blocked for hello.php
  $myplugins = $wp_list_table->items;
  foreach ($myplugins as $key => $val) {
    if (in_array($key,$hidearr) {
      unset($wp_list_table->items[$key]);
    }
  }
}
add_action( 'pre_current_active_plugins', 'mytest' )

Open in new window


This code would go in your theme's functions.php file.
0
Why Off-Site Backups Are The Only Way To Go

You are probably backing up your data—but how and where? Ransomware is on the rise and there are variants that specifically target backups. Read on to discover why off-site is the way to go.

 
LVL 70

Assisted Solution

by:Jason C. Levine
Jason C. Levine earned 50 total points
ID: 39699321
I have a different opinion on Omni's solution.  Disabling auto-updating globally for all plugins is probably not the best idea.  Frankly, you modifying someone else's plugin is also not that swift.  Plugins are updated to remove vulnerabilities more often than not so your proposed workflow makes your site less secure and disabling the ability of all plugins to be updated REALLY makes the site less secure.

What I think you should be doing is forking the plugin and creating something new and no longer tied to the original.  This will allow you to break away from the updating of the original while still retaining update capability for all other aspects of the site.
0
 

Author Comment

by:oo7ml
ID: 39699789
Thanks guys...

@Jason - does forking it not contradict what you are saying about updates... as forking will mean that no updates are made too
0
 
LVL 70

Expert Comment

by:Jason C. Levine
ID: 39699945
It contradicts that part of the objection but forking a single plugin and never updating it is vastly better than preventing updates to ALL plugins.  

Ideally you would find a way to modify the plugin using a hook or something else that can be placed in functions.php.
0
 

Author Comment

by:oo7ml
ID: 39701123
Ok cool, sorry i misunderstood what you were saying... i only want to disable the plugin for some plugins... what would you suggest is the best way for that, apart from forking... surprised that there is not a plugin for this :-)
0
 
LVL 17

Expert Comment

by:OmniUnlimited
ID: 39701352
Yeah, but if there were a plugin for that, your users would see that plugin (since they appear to have administrative rights) and be able to manipulate that plugin which kind of defeats what it is you were trying to do in the first place.  The advantage to using my coding is that you never need to modify the existing plugins, and they maintain their updatability.  You would simply have to set $hidearr = array(); and all the plugins would appear in the list again where you could update at will.  After updating, just put all the plugin file names back in the array.  Plus your users would need to edit theme files in order to gain access to this function.  Something few, if any, users do.
0

Featured Post

Don't Cry: How Liquid Web is Ensuring Security

WannaCry is just the start. Read how Liquid Web is protecting itself and its customers against new threats.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Now that you've installed WordPress 2.9 (http://www.experts-exchange.com/articles/Web_Development/Blogs/WordPress/WordPress-2-9-What-to-Expect-When-Upgrading-to-WordPress-2-9.html?) on your site, you need to install some plugins to get the most out …
WordPress has made it easy to create scalable sites based on their powerful CMS, but as great as WordPress is, there are some SEO issues that haven’t been addressed out of the box.  Fortunately these problems can be solved with a few plugins.  The f…
The purpose of this video is to demonstrate how to exclude a particular blog category from the main blog page. This is can be used when a category already has its own tab, or you simply want certain types of posts not to show up on the main blog. …
The purpose of this video is to demonstrate how to add AdSense Ads to a WordPress Website, and how to set up WordPress to automatically place Ads in Sidebars. This will be demonstrated using a Windows 8 PC. Log into your AdSense account. : Cli…

695 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question