Solved

Updating Wordpress Plugins

Posted on 2013-12-05
8
233 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
  • 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
 
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
What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

 

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Transferring a wordpress site from a host or local dev server to another host can be a pain. So I've included my steps on how I have accomplished this task. Steps include an assumption that you have Cpanel access or Ftp access.. If you do not hav…
So you have coded your own WordPress plugin and now you want to allow users to upload images to a folder in the plugin folder rather than the default media location? Follow along and this article will show you how to do just that!
The purpose of this video is to demonstrate how to create a Printer Friendly PDF on a WordPress Page. This will be demonstrated using a Windows 8 PC. Tools Used are Photoshop, Awesome Screenshot” Google Chrome Extension, and SmallPDF.com Log…
The purpose of this video is to demonstrate how to update a WordPress Site’s version. WordPress releases new versions of its software frequently and it is important to update frequently in order to keep your site secure, and to get new WordPress…

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now