Version Description
- BIG: code clean-up (moved code, fixed code, etc.). - Thanks GitHub Pull Request and other help!!!
- Added: version 4.1.0 on GitHub (including the lang file).
- Added: website! http://webguywp.wordpress.com/
- New Contributor: shazahm1!
- New: video tutroial.
- New: disable themes individually.
- New: wp-cli compatiblity. - Thanks GitHub Issue!
- Fixed: changelog footnote star error.
- Updated: disable plugin updates.
- Updated: installation section.
- Updated: screenshots.
- Renamed: files. - Thanks GitHub Issue!
Download this release
Release Info
| Developer | kidsguide |
| Plugin | |
| Version | 4.1.0 |
| Comparing to | |
| See all releases | |
Code changes from version 4.0.3 to 4.1.0
- Function.php +689 -506
- License.txt +1 -1
- readme.txt +25 -23
- uninstall.php +1 -3
Function.php
CHANGED
|
@@ -2,27 +2,26 @@
|
|
| 2 |
/**
|
| 3 |
* @package Disable Updates Manager
|
| 4 |
* @author Websiteguy
|
| 5 |
-
* @
|
| 6 |
-
|
|
|
|
| 7 |
/*
|
| 8 |
Plugin Name: Disable Updates Manager
|
| 9 |
Plugin URI: http://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
|
| 10 |
-
Version: 4.0
|
| 11 |
-
Description: A configurable plugin that disables updates for you. Easy, clean and helpful.
|
| 12 |
Author: Websiteguy
|
| 13 |
-
Author URI: http://
|
|
|
|
| 14 |
License: GPL2
|
| 15 |
-
Text Domain:
|
| 16 |
-
Domain Path:
|
| 17 |
Tested up to WordPress: 3.9.1
|
| 18 |
-
*/
|
| 19 |
-
/*
|
| 20 |
-
License:
|
| 21 |
|
| 22 |
-
@Copyright 2013 - 2014 Websiteguy (email:
|
| 23 |
|
| 24 |
This program is free software; you can redistribute it and/or modify
|
| 25 |
-
it under the terms of the GNU General Public License, version 2, as
|
| 26 |
published by the Free Software Foundation.
|
| 27 |
|
| 28 |
This program is distributed in the hope that it will be useful,
|
|
@@ -37,587 +36,771 @@ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
|
| 37 |
Go to the license.txt in the trunk for more information.
|
| 38 |
*/
|
| 39 |
|
| 40 |
-
|
| 41 |
-
|
| 42 |
-
|
| 43 |
-
|
| 44 |
-
|
| 45 |
-
|
| 46 |
-
|
| 47 |
-
|
| 48 |
-
|
| 49 |
-
|
| 50 |
-
|
| 51 |
-
|
| 52 |
-
|
| 53 |
-
//
|
| 54 |
-
|
| 55 |
-
|
| 56 |
-
//
|
| 57 |
-
|
| 58 |
-
|
| 59 |
-
|
| 60 |
-
|
| 61 |
-
|
| 62 |
-
|
| 63 |
-
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 68 |
|
| 69 |
-
function validate_settings( $input ) {
|
| 70 |
$options = get_option( '_disable_updates' );
|
| 71 |
-
|
| 72 |
-
|
| 73 |
-
|
| 74 |
-
|
| 75 |
}
|
| 76 |
-
|
| 77 |
-
return $input;
|
| 78 |
-
}
|
| 79 |
|
| 80 |
-
|
| 81 |
-
|
| 82 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 83 |
}
|
| 84 |
|
| 85 |
-
|
| 86 |
-
function load_disable_updates() {
|
| 87 |
-
$this->status = get_option('_disable_updates');
|
| 88 |
-
|
| 89 |
-
if( !$this->status ) return;
|
| 90 |
|
| 91 |
-
|
|
|
|
| 92 |
|
| 93 |
-
|
| 94 |
|
| 95 |
-
|
| 96 |
-
case 'plugin' :
|
| 97 |
-
|
| 98 |
-
// Disable Plugin Updates Code
|
| 99 |
-
remove_action( 'load-update-core.php', 'wp_update_plugins' );
|
| 100 |
-
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );
|
| 101 |
-
|
| 102 |
-
// Disable Plugin Update E-mails (only works for some plugins)
|
| 103 |
-
apply_filters( 'auto_plugin_update_send_email', false, $type, $plugin_update, $result );
|
| 104 |
-
|
| 105 |
-
apply_filters('automatic_plugin_updates_send_debug_email', true, $type, $plugin_update, $result );
|
| 106 |
-
|
| 107 |
-
break;
|
| 108 |
-
|
| 109 |
-
// Disable Theme Updates
|
| 110 |
-
case 'theme' :
|
| 111 |
-
|
| 112 |
-
// Disable Theme Updates Code
|
| 113 |
-
remove_action( 'load-update-core.php', 'wp_update_themes' );
|
| 114 |
-
add_filter( 'pre_site_transient_update_themes', create_function( '$a', "return null;" ) );
|
| 115 |
-
|
| 116 |
-
// Disable Theme Update E-mails (only works for some plugins)
|
| 117 |
-
apply_filters( 'auto_theme_update_send_email', false, $type, $theme_update, $result );
|
| 118 |
-
|
| 119 |
-
apply_filters('automatic_theme_updates_send_debug_email', true, $type, $theme_update, $result );
|
| 120 |
-
|
| 121 |
-
break;
|
| 122 |
-
|
| 123 |
-
// Disable WordPress Core Updates
|
| 124 |
-
case 'core' :
|
| 125 |
-
|
| 126 |
-
// Disable WordPress Core Updates Code
|
| 127 |
-
remove_action( 'load-update-core.php', 'wp_update_core' );
|
| 128 |
-
add_filter( 'pre_site_transient_update_core', create_function( '$a', "return null;" ) );
|
| 129 |
-
|
| 130 |
-
// Disable WordPress Core Update E-mails (only works for some plugins)
|
| 131 |
-
apply_filters( 'auto_core_update_send_email', false, $type, $core_update, $result );
|
| 132 |
-
|
| 133 |
-
apply_filters('automatic_core_updates_send_debug_email', true, $type, $core_update, $result );
|
| 134 |
-
|
| 135 |
-
break;
|
| 136 |
-
|
| 137 |
-
// Remove the Dashboard Updates Menu
|
| 138 |
-
case 'page' :
|
| 139 |
-
|
| 140 |
-
// Remove the Dashboard Updates Menu Code
|
| 141 |
-
add_action( 'admin_init', 'wpse_38111' );
|
| 142 |
-
function wpse_38111() {
|
| 143 |
-
remove_submenu_page( 'index.php', 'update-core.php' );
|
| 144 |
}
|
| 145 |
-
|
| 146 |
-
break;
|
| 147 |
|
| 148 |
-
|
| 149 |
-
case 'all' :
|
| 150 |
|
| 151 |
-
|
| 152 |
|
| 153 |
-
|
|
|
|
|
|
|
|
|
|
| 154 |
|
| 155 |
-
|
| 156 |
-
|
| 157 |
|
| 158 |
-
|
|
|
|
| 159 |
|
| 160 |
-
|
| 161 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 162 |
|
| 163 |
-
|
|
|
|
| 164 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 165 |
remove_action( 'load-update-core.php', 'wp_update_core' );
|
| 166 |
-
add_filter( 'pre_site_transient_update_core',
|
| 167 |
|
| 168 |
-
|
|
|
|
| 169 |
|
| 170 |
-
|
| 171 |
-
|
| 172 |
-
|
| 173 |
-
|
| 174 |
|
| 175 |
-
|
|
|
|
|
|
|
| 176 |
|
| 177 |
-
|
| 178 |
-
|
| 179 |
|
| 180 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 181 |
|
|
|
|
| 182 |
remove_action( 'load-plugins.php', 'wp_update_plugins' );
|
| 183 |
remove_action( 'load-update.php', 'wp_update_plugins' );
|
| 184 |
remove_action( 'admin_init', '_maybe_update_plugins' );
|
| 185 |
remove_action( 'wp_update_plugins', 'wp_update_plugins' );
|
| 186 |
-
|
| 187 |
-
|
|
|
|
| 188 |
remove_action( 'load-update-core.php', 'wp_update_plugins' );
|
| 189 |
-
|
|
|
|
|
|
|
| 190 |
|
| 191 |
-
|
|
|
|
|
|
|
| 192 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 193 |
remove_action( 'load-themes.php', 'wp_update_themes' );
|
| 194 |
remove_action( 'load-update.php', 'wp_update_themes' );
|
| 195 |
remove_action( 'admin_init', '_maybe_update_themes' );
|
| 196 |
remove_action( 'wp_update_themes', 'wp_update_themes' );
|
| 197 |
-
|
| 198 |
-
|
|
|
|
| 199 |
remove_action( 'load-update-core.php', 'wp_update_themes' );
|
|
|
|
|
|
|
| 200 |
wp_clear_scheduled_hook( 'wp_update_themes' );
|
| 201 |
|
| 202 |
-
|
|
|
|
|
|
|
| 203 |
|
| 204 |
-
|
| 205 |
-
|
| 206 |
-
|
| 207 |
-
|
| 208 |
-
|
|
|
|
|
|
|
|
|
|
| 209 |
}
|
| 210 |
|
| 211 |
-
|
|
|
|
| 212 |
|
| 213 |
-
|
| 214 |
|
| 215 |
-
|
| 216 |
-
|
| 217 |
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
|
|
|
| 221 |
|
| 222 |
-
|
| 223 |
|
| 224 |
-
|
| 225 |
-
remove_action( 'load-update.php', 'wp_update_themes' );
|
| 226 |
-
remove_action( 'admin_init', '_maybe_update_themes' );
|
| 227 |
-
remove_action( 'wp_update_themes', 'wp_update_themes' );
|
| 228 |
-
add_filter( 'pre_transient_update_themes', create_function( '$a', "return null;" ) );
|
| 229 |
|
| 230 |
-
|
| 231 |
-
|
|
|
|
|
|
|
|
|
|
| 232 |
|
| 233 |
-
|
| 234 |
-
|
| 235 |
-
add_action( 'admin_init', create_function( '$a', "remove_action( 'admin_init', 'wp_update_plugins' );"), 2 );
|
| 236 |
-
add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_update_plugins' );"), 2 );
|
| 237 |
-
add_filter( 'pre_option_update_plugins', create_function( '$a', "return null;" ) );
|
| 238 |
|
| 239 |
-
|
| 240 |
-
remove_action( 'load-update.php', 'wp_update_plugins' );
|
| 241 |
-
remove_action( 'admin_init', '_maybe_update_plugins' );
|
| 242 |
-
remove_action( 'wp_update_plugins', 'wp_update_plugins' );
|
| 243 |
-
add_filter( 'pre_transient_update_plugins', create_function( '$a', "return null;" ) );
|
| 244 |
|
| 245 |
-
|
| 246 |
-
add_filter( 'pre_site_transient_update_plugins', create_function( '$a', "return null;" ) );
|
| 247 |
-
|
| 248 |
-
|
| 249 |
-
// Disable Debug E-mails
|
| 250 |
-
add_filter( 'automatic_updates_send_debug_email ', '__return_true', 1 );
|
| 251 |
-
|
| 252 |
-
// Disable WordPress Automatic Updates
|
| 253 |
-
define( 'Automatic_Updater_Disabled', true );
|
| 254 |
-
define('WP_AUTO_UPDATE_CORE', false);
|
| 255 |
-
|
| 256 |
-
// Disable Updates E-mails
|
| 257 |
-
|
| 258 |
-
// Core E-mails Only
|
| 259 |
-
apply_filters( 'auto_core_update_send_email', false, $type, $core_update, $result );
|
| 260 |
-
|
| 261 |
-
apply_filters('automatic_core_updates_send_debug_email', true, $type, $core_update, $result );
|
| 262 |
-
|
| 263 |
-
// Plugin E-mails Only
|
| 264 |
-
apply_filters( 'auto_plugin_update_send_email', false, $type, $plugin_update, $result );
|
| 265 |
-
|
| 266 |
-
apply_filters('automatic_plugin_updates_send_debug_email', true, $type, $plugin_update, $result );
|
| 267 |
-
|
| 268 |
-
// Theme E-mails Only
|
| 269 |
-
apply_filters( 'auto_theme_update_send_email', false, $type, $theme_update, $result );
|
| 270 |
-
|
| 271 |
-
apply_filters('automatic_theme_updates_send_debug_email', true, $type, $theme_update, $result );
|
| 272 |
-
|
| 273 |
-
break;
|
| 274 |
-
|
| 275 |
-
// Remove WordPress Version Number
|
| 276 |
-
case 'wpv' :
|
| 277 |
-
|
| 278 |
-
add_filter( 'update_footer', 'my_footer_version', 11 );
|
| 279 |
-
|
| 280 |
-
function my_footer_version() {
|
| 281 |
-
return '';
|
| 282 |
-
}
|
| 283 |
|
| 284 |
-
|
| 285 |
|
| 286 |
-
|
| 287 |
-
|
| 288 |
-
|
| 289 |
-
}
|
| 290 |
-
define('disable_updates_loaded', 1);
|
| 291 |
-
|
| 292 |
-
add_action('init','disable_updates_get');
|
| 293 |
-
add_action('init','disable_updates_addFilters');
|
| 294 |
-
|
| 295 |
-
add_filter("plugin_row_meta", 'disable_updates_pluginLinks', 10, 2);
|
| 296 |
-
add_filter('site_transient_update_plugins', 'disable_updates_blockUpdateNotifications');
|
| 297 |
-
|
| 298 |
-
function disable_updates_addFilters() {
|
| 299 |
-
if(!current_user_can('update_plugins')) {
|
| 300 |
-
return;
|
| 301 |
-
}
|
| 302 |
-
|
| 303 |
-
$plugins = get_site_transient('update_plugins');
|
| 304 |
-
$to_block = get_option('disable_updates_blocked');
|
| 305 |
-
|
| 306 |
-
if(isset($plugins->response)) {
|
| 307 |
-
// loop through all of the plugins with updates available and attach the appropriate filter
|
| 308 |
-
foreach($plugins->response as $filename => $plugin) {
|
| 309 |
-
// check that the version is the version we want to block updates to
|
| 310 |
-
$s = 'after_plugin_row_' . $filename;
|
| 311 |
-
//in_plugin_update_message-
|
| 312 |
-
add_action($s, 'disable_updates_blockLink', -1, 1);
|
| 313 |
-
}
|
| 314 |
-
}
|
| 315 |
-
if(isset($plugins->disable_updates)) {
|
| 316 |
-
foreach($plugins->disable_updates as $filename => $plugin) {
|
| 317 |
-
// check that the version is the version we want to block updates to
|
| 318 |
-
$s = 'after_plugin_row_' . $filename;
|
| 319 |
-
add_action($s, 'disable_updates_unblockLink', 2, 1);
|
| 320 |
}
|
| 321 |
-
}
|
| 322 |
-
}
|
| 323 |
|
| 324 |
-
|
|
|
|
|
|
|
|
|
|
| 325 |
|
| 326 |
-
|
| 327 |
-
return;
|
| 328 |
-
}
|
| 329 |
|
| 330 |
-
|
| 331 |
-
|
| 332 |
-
return;
|
| 333 |
-
}
|
| 334 |
|
| 335 |
-
|
| 336 |
-
|
| 337 |
-
}
|
| 338 |
|
| 339 |
-
|
| 340 |
-
$plugins = get_site_transient('update_plugins');
|
| 341 |
|
| 342 |
-
|
| 343 |
-
|
| 344 |
-
$p = $plugins->response[$_GET['block']];
|
| 345 |
-
$blocked[$_GET['block']] = array('slug' => $p->slug, 'new_version' => $p->new_version);
|
| 346 |
-
}
|
| 347 |
|
| 348 |
-
|
| 349 |
-
unset($blocked[$_GET['unblock']]);
|
| 350 |
|
| 351 |
-
|
|
|
|
| 352 |
|
| 353 |
-
|
| 354 |
|
| 355 |
-
|
| 356 |
|
| 357 |
-
|
|
|
|
|
|
|
| 358 |
|
| 359 |
-
|
| 360 |
-
|
|
|
|
| 361 |
}
|
| 362 |
|
| 363 |
-
|
| 364 |
|
| 365 |
-
|
| 366 |
|
| 367 |
-
|
| 368 |
-
|
| 369 |
|
| 370 |
-
|
| 371 |
-
unset($plugins->response[$filename]);
|
| 372 |
-
}
|
| 373 |
-
}
|
| 374 |
-
return $plugins;
|
| 375 |
-
}
|
| 376 |
|
| 377 |
-
|
| 378 |
-
disable_updates_linkStart();
|
| 379 |
-
echo 'Updates for this plugin are blocked. <a href="plugins.php?_wpnonce=' . wp_create_nonce('disable_updates') . '&disable_updates&unblock=' . $filename . '">Unblock updates</a>.</div></td></tr>';
|
| 380 |
-
}
|
| 381 |
|
| 382 |
-
|
| 383 |
-
|
| 384 |
-
echo ' <a href="plugins.php?_wpnonce=' . wp_create_nonce('disable_updates') . '&disable_updates&block=' . $filename . '">Block updates for this plugin</a>.</div></td></tr>';
|
| 385 |
-
}
|
| 386 |
|
| 387 |
-
|
| 388 |
|
| 389 |
-
|
| 390 |
-
// wp-admin/includes/update.php
|
| 391 |
|
| 392 |
-
|
| 393 |
-
echo '<tr class="plugin-update-tr"><td colspan="' . $wp_list_table->get_column_count() . '" class="plugin-update colspanchange"><div class="update-message">';
|
| 394 |
-
}
|
| 395 |
|
| 396 |
-
|
| 397 |
-
|
| 398 |
-
if($file == $plugin) {
|
| 399 |
-
$links[] = '<a target="_BLANK" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LC5UR6667DLXU"></a>';
|
| 400 |
-
}
|
| 401 |
-
return $links;
|
| 402 |
-
}
|
| 403 |
|
| 404 |
-
if(
|
| 405 |
-
function printr($txt) {
|
| 406 |
-
echo '<pre>'; print_r($txt); echo '</pre>';
|
| 407 |
-
}
|
| 408 |
-
}
|
| 409 |
-
break;
|
| 410 |
-
|
| 411 |
-
// Disable automatic background updates.
|
| 412 |
-
case 'abup' :
|
| 413 |
-
wp_clear_scheduled_hook( 'wp_maybe_auto_update' );
|
| 414 |
-
break;
|
| 415 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 416 |
}
|
| 417 |
-
|
| 418 |
-
}
|
| 419 |
-
|
| 420 |
// Settings page (under dashboard).
|
| 421 |
-
|
| 422 |
-
|
| 423 |
-
|
| 424 |
-
|
| 425 |
-
|
| 426 |
-
|
|
|
|
|
|
|
| 427 |
?>
|
| 428 |
|
| 429 |
-
<div class="wrap">
|
| 430 |
-
|
| 431 |
-
|
| 432 |
-
|
| 433 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 434 |
<form method="post" action="options.php">
|
| 435 |
-
|
| 436 |
-
|
| 437 |
-
|
| 438 |
-
<table class="
|
| 439 |
-
<
|
| 440 |
-
|
| 441 |
-
</
|
| 442 |
-
|
| 443 |
-
|
| 444 |
-
<
|
| 445 |
-
|
| 446 |
-
|
| 447 |
-
|
| 448 |
-
<
|
| 449 |
-
<
|
| 450 |
-
<
|
| 451 |
-
|
| 452 |
-
|
| 453 |
-
|
| 454 |
-
|
| 455 |
-
|
| 456 |
-
|
| 457 |
-
|
| 458 |
-
|
| 459 |
-
|
| 460 |
-
|
| 461 |
-
|
| 462 |
-
|
| 463 |
-
|
| 464 |
-
|
| 465 |
-
|
| 466 |
-
|
| 467 |
-
|
| 468 |
-
<
|
| 469 |
-
|
| 470 |
-
|
| 471 |
-
|
| 472 |
-
|
| 473 |
-
|
| 474 |
-
|
| 475 |
-
|
| 476 |
-
|
| 477 |
-
|
| 478 |
-
</
|
| 479 |
-
|
| 480 |
-
|
| 481 |
-
|
| 482 |
-
|
| 483 |
-
|
| 484 |
-
|
| 485 |
-
|
| 486 |
-
|
| 487 |
-
<
|
| 488 |
-
<tr>
|
| 489 |
-
<
|
| 490 |
-
|
| 491 |
-
|
| 492 |
-
|
| 493 |
-
|
| 494 |
-
|
| 495 |
-
|
| 496 |
-
|
| 497 |
-
|
| 498 |
-
|
| 499 |
-
|
| 500 |
-
|
| 501 |
-
|
| 502 |
-
|
| 503 |
-
|
| 504 |
-
|
| 505 |
-
|
| 506 |
-
|
| 507 |
-
|
| 508 |
-
|
| 509 |
-
|
| 510 |
-
</
|
| 511 |
-
</
|
| 512 |
-
<
|
| 513 |
-
|
| 514 |
-
<
|
| 515 |
-
|
| 516 |
-
|
| 517 |
-
|
| 518 |
-
|
| 519 |
-
|
| 520 |
-
|
| 521 |
-
|
| 522 |
-
|
| 523 |
-
|
| 524 |
-
|
| 525 |
-
|
| 526 |
-
|
| 527 |
-
|
| 528 |
-
|
| 529 |
-
|
| 530 |
-
|
| 531 |
-
|
| 532 |
-
|
| 533 |
-
|
| 534 |
-
</
|
| 535 |
-
|
| 536 |
-
|
| 537 |
-
|
| 538 |
-
|
| 539 |
-
|
| 540 |
-
|
| 541 |
-
|
| 542 |
-
|
| 543 |
-
|
| 544 |
-
|
| 545 |
-
|
| 546 |
-
|
| 547 |
-
|
| 548 |
-
|
| 549 |
-
|
| 550 |
-
|
| 551 |
-
|
| 552 |
-
|
| 553 |
-
|
| 554 |
-
|
| 555 |
-
|
| 556 |
-
|
| 557 |
-
|
| 558 |
-
<
|
| 559 |
-
<
|
| 560 |
-
|
| 561 |
-
|
| 562 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 563 |
</form>
|
| 564 |
</div>
|
| 565 |
-
|
| 566 |
-
<?php
|
| 567 |
-
}
|
| 568 |
-
}
|
| 569 |
|
| 570 |
-
|
| 571 |
-
global $Disable_Updates; $Disable_Updates = new Disable_Updates();
|
| 572 |
-
|
| 573 |
-
// Plugin page link.
|
| 574 |
-
add_filter( 'plugin_row_meta', 'thsp_plugin_meta_links', 10, 2 );
|
| 575 |
-
|
| 576 |
-
function thsp_plugin_meta_links( $links, $file ) {
|
| 577 |
-
$plugin = plugin_basename(__FILE__);
|
| 578 |
-
|
| 579 |
-
// Create links.
|
| 580 |
-
if ( $file == $plugin ) {
|
| 581 |
-
return array_merge(
|
| 582 |
-
$links,
|
| 583 |
-
array( '<a href="http://www.wordpress.org/support/plugin/stops-core-theme-and-plugin-updates">Support</a>' ),
|
| 584 |
-
array( '<a href="http://www.wordpress.org/plugins/stops-core-theme-and-plugin-updates/faq/">FAQ</a>' ),
|
| 585 |
-
array( '<a href="http://www.youtube.com/watch?v=7sMEBGNxhwA">Tutorial</a>' ),
|
| 586 |
-
array( '<a href="https://github.com/Websiteguy/disable-updates-manager">GitHub</a>' )
|
| 587 |
-
);
|
| 588 |
-
}
|
| 589 |
-
return $links;
|
| 590 |
}
|
|
|
|
| 591 |
|
| 592 |
-
|
| 593 |
-
|
| 594 |
-
|
| 595 |
-
function thsp_plugin_action_links( $links ) {
|
| 596 |
|
| 597 |
-
|
| 598 |
-
|
| 599 |
-
|
| 600 |
-
|
| 601 |
-
|
| 602 |
-
|
| 603 |
-
|
| 604 |
-
// Style.css
|
| 605 |
-
function css() {
|
| 606 |
-
wp_register_style('css', plugins_url('style.css',__FILE__ ));
|
| 607 |
-
wp_enqueue_style('css');
|
| 608 |
-
}
|
| 609 |
-
add_action( 'admin_init','css');
|
| 610 |
-
|
| 611 |
-
// uninstall.php
|
| 612 |
-
function php() {
|
| 613 |
-
wp_register_style('php', plugins_url('uninstall.php',__FILE__ ));
|
| 614 |
-
wp_enqueue_style('php');
|
| 615 |
-
}
|
| 616 |
-
add_action( 'admin_init','php');
|
| 617 |
-
|
| 618 |
-
// lang folder
|
| 619 |
-
function action_init() {
|
| 620 |
-
// Load our textdomain
|
| 621 |
-
load_plugin_textdomain('stops-core-theme-and-plugin-updates', false , basename(dirname(__FILE__)).'/lang');
|
| 622 |
-
}
|
| 623 |
-
?>
|
| 2 |
/**
|
| 3 |
* @package Disable Updates Manager
|
| 4 |
* @author Websiteguy
|
| 5 |
+
* @email webguywp@gmail.com
|
| 6 |
+
* @version 4.1.0
|
| 7 |
+
*/
|
| 8 |
/*
|
| 9 |
Plugin Name: Disable Updates Manager
|
| 10 |
Plugin URI: http://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
|
| 11 |
+
Version: 4.1.0
|
| 12 |
+
Description: A configurable plugin that disables updates for you. Easy, clean and helpful.
|
| 13 |
Author: Websiteguy
|
| 14 |
+
Author URI: http://www.webguywp.wordpress.com
|
| 15 |
+
Author Email: webguywp@gmail.com
|
| 16 |
License: GPL2
|
| 17 |
+
Text Domain: disable-updates-manager
|
| 18 |
+
Domain Path: lang
|
| 19 |
Tested up to WordPress: 3.9.1
|
|
|
|
|
|
|
|
|
|
| 20 |
|
| 21 |
+
@Copyright 2013 - 2014 Websiteguy (email: webguywp@gmail.com)
|
| 22 |
|
| 23 |
This program is free software; you can redistribute it and/or modify
|
| 24 |
+
it under the terms of the GNU General Public License, version 2, as
|
| 25 |
published by the Free Software Foundation.
|
| 26 |
|
| 27 |
This program is distributed in the hope that it will be useful,
|
| 36 |
Go to the license.txt in the trunk for more information.
|
| 37 |
*/
|
| 38 |
|
| 39 |
+
class Disable_Updates {
|
| 40 |
+
|
| 41 |
+
// Define version.
|
| 42 |
+
const VERSION = '4.1.0';
|
| 43 |
+
|
| 44 |
+
function __construct() {
|
| 45 |
+
|
| 46 |
+
// Load our textdomain
|
| 47 |
+
add_action( 'init', array( __CLASS__ , 'load_textdomain' ) );
|
| 48 |
+
|
| 49 |
+
// Add menu page.
|
| 50 |
+
add_action( 'admin_menu', array( __CLASS__, 'add_submenu' ) );
|
| 51 |
+
|
| 52 |
+
// Settings API.
|
| 53 |
+
add_action( 'admin_init', array( __CLASS__, 'register_setting' ) );
|
| 54 |
+
|
| 55 |
+
// Add action links.
|
| 56 |
+
add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( __CLASS__, 'action_links' ) );
|
| 57 |
+
|
| 58 |
+
// Add meta links.
|
| 59 |
+
add_filter( 'plugin_row_meta', array( __CLASS__, 'meta_links' ), 10, 2 );
|
| 60 |
+
|
| 61 |
+
// load the values recorded.
|
| 62 |
+
$this->load_disable_updates();
|
| 63 |
+
}
|
| 64 |
+
|
| 65 |
+
static function load_textdomain() {
|
| 66 |
+
|
| 67 |
+
load_plugin_textdomain( 'disable-updates-manager', FALSE, basename( dirname( __FILE__ ) ) . '/lang' );
|
| 68 |
+
}
|
| 69 |
+
|
| 70 |
+
static function enqueue_css() {
|
| 71 |
+
|
| 72 |
+
wp_enqueue_style( 'disable-updates-manager-css', plugins_url( 'style.css', __FILE__ ), array(), self::VERSION );
|
| 73 |
+
}
|
| 74 |
+
|
| 75 |
+
// Register settings.
|
| 76 |
+
static function register_setting() {
|
| 77 |
+
|
| 78 |
+
register_setting( '_disable_updates', '_disable_updates', array( __CLASS__, 'validate_settings' ) );
|
| 79 |
+
}
|
| 80 |
+
|
| 81 |
+
static function validate_settings( $value ) {
|
| 82 |
+
|
| 83 |
+
return $value;
|
| 84 |
+
}
|
| 85 |
+
|
| 86 |
+
static function add_submenu() {
|
| 87 |
+
|
| 88 |
+
$page_hook = add_submenu_page( 'options-general.php', 'Disable Updates Manager', __( 'Disable Updates Manager', 'disable-updates-manager' ), 'manage_options', 'disable-updates-manager', array( __CLASS__, 'display_page' ) );
|
| 89 |
+
|
| 90 |
+
// Enqueue the admin CSS.
|
| 91 |
+
add_action( "load-$page_hook", array( __CLASS__, 'enqueue_css' ) );
|
| 92 |
+
}
|
| 93 |
+
|
| 94 |
+
static function action_links( $links ) {
|
| 95 |
+
|
| 96 |
+
return array_merge(
|
| 97 |
+
array(
|
| 98 |
+
'settings' => '<a href="' . add_query_arg( array( 'page' => 'disable-updates-manager' ), admin_url( 'options-general.php' ) ) . '">' . __( 'Configure', 'disable-updates-manager' ) . '</a>',
|
| 99 |
+
),
|
| 100 |
+
$links
|
| 101 |
+
);
|
| 102 |
+
|
| 103 |
+
}
|
| 104 |
+
|
| 105 |
+
static function meta_links( $links, $file ) {
|
| 106 |
+
|
| 107 |
+
$plugin = plugin_basename( __FILE__ );
|
| 108 |
+
|
| 109 |
+
if ( $file == $plugin ) {
|
| 110 |
+
|
| 111 |
+
return array_merge(
|
| 112 |
+
$links,
|
| 113 |
+
array( '<a target="_BLANK" href="https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=LC5UR6667DLXU">Donate</a>' ),
|
| 114 |
+
array( '<a href="http://www.wordpress.org/support/plugin/stops-core-theme-and-plugin-updates">Support</a>' ),
|
| 115 |
+
array( '<a href="http://www.wordpress.org/plugins/stops-core-theme-and-plugin-updates/faq/">FAQ</a>' ),
|
| 116 |
+
array( '<a href="https://www.youtube.com/watch?v=ppCxjREhF9g">Tutorial</a>' ),
|
| 117 |
+
array( '<a href="https://github.com/Websiteguy/disable-updates-manager">GitHub</a>' )
|
| 118 |
+
);
|
| 119 |
+
}
|
| 120 |
+
|
| 121 |
+
return $links;
|
| 122 |
+
}
|
| 123 |
+
|
| 124 |
+
// Functions for plugin (Change in settings)
|
| 125 |
+
static function load_disable_updates() {
|
| 126 |
+
|
| 127 |
+
$status = get_option( '_disable_updates' );
|
| 128 |
+
|
| 129 |
+
if ( ! $status ) {
|
| 130 |
+
return;
|
| 131 |
+
}
|
| 132 |
+
|
| 133 |
+
foreach ( $status as $id => $value ) {
|
| 134 |
+
|
| 135 |
+
switch ( $id ) {
|
| 136 |
+
|
| 137 |
+
// Disable Plugin Updates
|
| 138 |
+
case 'plugin' :
|
| 139 |
+
|
| 140 |
+
self::disable_plugin_updates();
|
| 141 |
+
break;
|
| 142 |
+
|
| 143 |
+
// Disable Theme Updates
|
| 144 |
+
case 'theme' :
|
| 145 |
+
|
| 146 |
+
self::disable_theme_updates();
|
| 147 |
+
|
| 148 |
+
break;
|
| 149 |
+
|
| 150 |
+
// Disable WordPress Core Updates
|
| 151 |
+
case 'core' :
|
| 152 |
+
|
| 153 |
+
self::disable_core_updates();
|
| 154 |
+
|
| 155 |
+
break;
|
| 156 |
+
|
| 157 |
+
// Remove the Dashboard Updates Menu
|
| 158 |
+
case 'page' :
|
| 159 |
+
|
| 160 |
+
// Remove the Dashboard Updates Menu Code
|
| 161 |
+
add_action( 'admin_init', create_function( '', 'remove_submenu_page( \'index.php\', \'update-core.php\' );' ) );
|
| 162 |
+
|
| 163 |
+
break;
|
| 164 |
+
|
| 165 |
+
// Disable All Updates
|
| 166 |
+
case 'all' :
|
| 167 |
+
|
| 168 |
+
// Disable Plugin Updates Only
|
| 169 |
+
self::disable_plugin_updates();
|
| 170 |
+
|
| 171 |
+
// Disable Theme Updates Only
|
| 172 |
+
self::disable_theme_updates();
|
| 173 |
+
|
| 174 |
+
// Disable Core Updates Only
|
| 175 |
+
self::disable_core_updates();
|
| 176 |
+
|
| 177 |
+
// Disable Debug E-mails
|
| 178 |
+
add_filter( 'automatic_updates_send_debug_email ', '__return_false', 1 );
|
| 179 |
+
|
| 180 |
+
// Disable WordPress Automatic Updates
|
| 181 |
+
define( 'AUTOMATIC_UPDATER_DISABLED', TRUE );
|
| 182 |
+
define( 'WP_AUTO_UPDATE_CORE', FALSE );
|
| 183 |
+
|
| 184 |
+
break;
|
| 185 |
+
|
| 186 |
+
// Remove WordPress Version Number
|
| 187 |
+
case 'wpv' :
|
| 188 |
+
|
| 189 |
+
add_filter( 'update_footer', '__return_empty_string', 11 );
|
| 190 |
+
|
| 191 |
+
break;
|
| 192 |
+
|
| 193 |
+
case 'ip' :
|
| 194 |
+
|
| 195 |
+
if ( defined( 'disable_updates_loaded' ) ) {
|
| 196 |
+
return;
|
| 197 |
+
}
|
| 198 |
+
|
| 199 |
+
define( 'disable_updates_loaded', 1 );
|
| 200 |
+
|
| 201 |
+
add_action( 'init', array( __CLASS__, 'update_plugin_block_status' ) );
|
| 202 |
+
add_action( 'init', array( __CLASS__, 'plugin_action_links' ) );
|
| 203 |
+
add_filter( 'site_transient_update_plugins', array( __CLASS__, 'remove_plugin_update_notification' ) );
|
| 204 |
+
add_filter( 'plugin_action_links', array( __CLASS__, 'plugin_block_action_link' ), 10, 4 );
|
| 205 |
+
|
| 206 |
+
// remove blocked plugins from being checked for updates at wordpress.org
|
| 207 |
+
add_filter( 'http_request_args', array( __CLASS__, 'http_request_args_plugins_filter' ), 5, 2 );
|
| 208 |
+
|
| 209 |
+
break;
|
| 210 |
+
|
| 211 |
+
case 'it':
|
| 212 |
+
|
| 213 |
+
add_filter( 'site_transient_update_themes', array( __CLASS__, 'remove_theme_update_notification' ) );
|
| 214 |
+
|
| 215 |
+
// remove blocked themes from being checked for updates at wordpress.org
|
| 216 |
+
add_filter( 'http_request_args', array( __CLASS__, 'http_request_args_themes_filter' ), 5, 2 );
|
| 217 |
+
|
| 218 |
+
break;
|
| 219 |
+
|
| 220 |
+
// Disable automatic background updates.
|
| 221 |
+
case 'abup' :
|
| 222 |
+
|
| 223 |
+
wp_clear_scheduled_hook( 'wp_maybe_auto_update' );
|
| 224 |
+
break;
|
| 225 |
+
|
| 226 |
+
}
|
| 227 |
+
}
|
| 228 |
+
}
|
| 229 |
+
|
| 230 |
+
static function update_plugin_block_status() {
|
| 231 |
+
|
| 232 |
+
if ( ! current_user_can( 'update_plugins' ) ) {
|
| 233 |
+
return;
|
| 234 |
+
}
|
| 235 |
+
|
| 236 |
+
// see if there are actions to process
|
| 237 |
+
if ( ! isset( $_GET[ 'disable_updates' ] ) || ! isset( $_GET[ '_wpnonce' ] ) ) {
|
| 238 |
+
return;
|
| 239 |
+
}
|
| 240 |
+
|
| 241 |
+
if ( ! wp_verify_nonce( $_GET[ '_wpnonce' ], 'disable_updates' ) ) {
|
| 242 |
+
return;
|
| 243 |
+
}
|
| 244 |
+
|
| 245 |
+
$blocked = get_option( 'disable_updates_blocked' );
|
| 246 |
+
// $plugins = get_site_transient( 'update_plugins' );
|
| 247 |
+
|
| 248 |
+
// block action
|
| 249 |
+
// if ( isset( $_GET[ 'block' ] ) && isset( $plugins->response ) && isset( $plugins->response[ $_GET[ 'block' ] ] ) ) {
|
| 250 |
+
// $p = $plugins->response[ $_GET[ 'block' ] ];
|
| 251 |
+
// $blocked[ $_GET[ 'block' ] ] = array( 'slug' => $p->slug, 'new_version' => $p->new_version );
|
| 252 |
+
// }
|
| 253 |
+
if ( isset( $_GET[ 'block' ] ) ) {
|
| 254 |
+
|
| 255 |
+
$blocked[ $_GET[ 'block' ] ] = TRUE;
|
| 256 |
+
}
|
| 257 |
+
|
| 258 |
+
if ( isset( $_GET[ 'unblock' ] ) ) {
|
| 259 |
+
|
| 260 |
+
unset( $blocked[ $_GET[ 'unblock' ] ] );
|
| 261 |
+
}
|
| 262 |
+
|
| 263 |
+
update_option( 'disable_updates_blocked', $blocked );
|
| 264 |
+
}
|
| 265 |
+
|
| 266 |
+
static function remove_plugin_update_notification( $plugins ) {
|
| 267 |
+
|
| 268 |
+
if ( ! isset( $plugins->response ) || count( $plugins->response ) == 0 ) {
|
| 269 |
+
|
| 270 |
+
return $plugins;
|
| 271 |
+
}
|
| 272 |
+
|
| 273 |
+
$blocked = (array) get_option( 'disable_updates_blocked' );
|
| 274 |
+
|
| 275 |
+
// foreach ( $blocked as $filename => $plugin ) {
|
| 276 |
+
|
| 277 |
+
// if ( isset( $plugins->response[ $filename ] )
|
| 278 |
+
// && $plugins->response[ $filename ]->new_version == $plugin[ 'new_version' ]
|
| 279 |
+
// ) {
|
| 280 |
+
|
| 281 |
+
// $plugins->disable_updates[ $filename ] = $plugins->response[ $filename ];
|
| 282 |
+
// unset( $plugins->response[ $filename ] );
|
| 283 |
+
// }
|
| 284 |
+
// }
|
| 285 |
+
foreach ( $blocked as $filename => $plugin ) {
|
| 286 |
+
|
| 287 |
+
if ( isset( $plugins->response[ $filename ] ) && $plugin == TRUE ) {
|
| 288 |
+
|
| 289 |
+
$plugins->disable_updates[ $filename ] = $plugins->response[ $filename ];
|
| 290 |
+
unset( $plugins->response[ $filename ] );
|
| 291 |
+
}
|
| 292 |
+
}
|
| 293 |
+
|
| 294 |
+
return $plugins;
|
| 295 |
+
}
|
| 296 |
+
|
| 297 |
+
static function remove_theme_update_notification( $themes ) {
|
| 298 |
|
|
|
|
| 299 |
$options = get_option( '_disable_updates' );
|
| 300 |
+
|
| 301 |
+
if ( FALSE === $options ) {
|
| 302 |
+
|
| 303 |
+
return $themes;
|
| 304 |
}
|
|
|
|
|
|
|
|
|
|
| 305 |
|
| 306 |
+
if ( isset( $options['themes'] ) ) {
|
| 307 |
+
|
| 308 |
+
$blocked = $options['themes'];
|
| 309 |
+
|
| 310 |
+
} else {
|
| 311 |
+
|
| 312 |
+
return $themes;
|
| 313 |
}
|
| 314 |
|
| 315 |
+
if ( 0 === (int) count( $blocked ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 316 |
|
| 317 |
+
return $themes;
|
| 318 |
+
}
|
| 319 |
|
| 320 |
+
if ( ! isset( $themes->response ) || count( $themes->response ) == 0 ) {
|
| 321 |
|
| 322 |
+
return $themes;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 323 |
}
|
|
|
|
|
|
|
| 324 |
|
| 325 |
+
foreach ( $blocked as $theme ) {
|
|
|
|
| 326 |
|
| 327 |
+
if ( isset( $themes->response[ $theme ] ) ) {
|
| 328 |
|
| 329 |
+
$themes->disable_updates[ $theme ] = $themes->response[ $theme ];
|
| 330 |
+
unset( $themes->response[ $theme ] );
|
| 331 |
+
}
|
| 332 |
+
}
|
| 333 |
|
| 334 |
+
return $themes;
|
| 335 |
+
}
|
| 336 |
|
| 337 |
+
static function last_checked() {
|
| 338 |
+
global $wp_version;
|
| 339 |
|
| 340 |
+
return (object) array(
|
| 341 |
+
'last_checked' => time(),
|
| 342 |
+
'updates' => array(),
|
| 343 |
+
'version_checked' => $wp_version,
|
| 344 |
+
);
|
| 345 |
+
}
|
| 346 |
|
| 347 |
+
// Disable Core Updates
|
| 348 |
+
static function disable_core_updates() {
|
| 349 |
|
| 350 |
+
# 2.3 to 2.7:
|
| 351 |
+
add_action( 'init', create_function( '', 'remove_action( \'init\', \'wp_version_check\' );' ), 2 );
|
| 352 |
+
add_filter( 'pre_option_update_core', '__return_null' );
|
| 353 |
+
|
| 354 |
+
# 2.8 to 3.0:
|
| 355 |
+
remove_action( 'wp_version_check', 'wp_version_check' );
|
| 356 |
+
remove_action( 'admin_init', '_maybe_update_core' );
|
| 357 |
+
add_filter( 'pre_transient_update_core', array( __CLASS__,'last_checked' ) );
|
| 358 |
+
|
| 359 |
+
# >3.0:
|
| 360 |
remove_action( 'load-update-core.php', 'wp_update_core' );
|
| 361 |
+
add_filter( 'pre_site_transient_update_core', array( __CLASS__,'last_checked' ) );
|
| 362 |
|
| 363 |
+
// Hide Update Notices in Admin Dashboard
|
| 364 |
+
add_action( 'admin_menu', create_function( '', 'remove_action( \'admin_notices\', \'update_nag\', 3 );' ) );
|
| 365 |
|
| 366 |
+
wp_clear_scheduled_hook( 'wp_version_check' );
|
| 367 |
+
|
| 368 |
+
// Disable email.
|
| 369 |
+
add_filter( 'auto_core_update_send_email', '__return_false' );
|
| 370 |
|
| 371 |
+
// This doesn't make sense. Purpose?
|
| 372 |
+
// apply_filters( 'automatic_core_updates_send_debug_email', TRUE, $type, $core_update, $result );
|
| 373 |
+
}
|
| 374 |
|
| 375 |
+
// Disable Plugin Updates
|
| 376 |
+
static function disable_plugin_updates() {
|
| 377 |
|
| 378 |
+
# 2.3 to 2.7:
|
| 379 |
+
// add_action( 'admin_menu', create_function( '$a', "remove_action( 'load-plugins.php', 'wp_update_plugins' );") );
|
| 380 |
+
// add_action( 'admin_init', create_function( '$a', "remove_action( 'admin_init', 'wp_update_plugins' );"), 2 );
|
| 381 |
+
// add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_update_plugins' );"), 2 );
|
| 382 |
+
add_filter( 'pre_option_update_plugins', '__return_null' );
|
| 383 |
|
| 384 |
+
# 2.8 to 3.0:
|
| 385 |
remove_action( 'load-plugins.php', 'wp_update_plugins' );
|
| 386 |
remove_action( 'load-update.php', 'wp_update_plugins' );
|
| 387 |
remove_action( 'admin_init', '_maybe_update_plugins' );
|
| 388 |
remove_action( 'wp_update_plugins', 'wp_update_plugins' );
|
| 389 |
+
add_filter( 'pre_transient_update_plugins', array( __CLASS__,'last_checked' ) );
|
| 390 |
+
|
| 391 |
+
# >3.0:
|
| 392 |
remove_action( 'load-update-core.php', 'wp_update_plugins' );
|
| 393 |
+
add_filter( 'pre_site_transient_update_plugins', array( __CLASS__,'last_checked' ) );
|
| 394 |
+
|
| 395 |
+
wp_clear_scheduled_hook( 'wp_update_plugins' );
|
| 396 |
|
| 397 |
+
// Disable Plugin Update E-mails (only works for some plugins)
|
| 398 |
+
// This doesn't make sense. Purpose?
|
| 399 |
+
// apply_filters( 'auto_plugin_update_send_email', FALSE, $type, $plugin_update, $result );
|
| 400 |
|
| 401 |
+
// This doesn't make sense. Purpose?
|
| 402 |
+
// apply_filters( 'automatic_plugin_updates_send_debug_email', TRUE, $type, $plugin_update, $result );
|
| 403 |
+
}
|
| 404 |
+
|
| 405 |
+
// Disable Theme Updates
|
| 406 |
+
static function disable_theme_updates() {
|
| 407 |
+
|
| 408 |
+
# 2.8 to 3.0:
|
| 409 |
remove_action( 'load-themes.php', 'wp_update_themes' );
|
| 410 |
remove_action( 'load-update.php', 'wp_update_themes' );
|
| 411 |
remove_action( 'admin_init', '_maybe_update_themes' );
|
| 412 |
remove_action( 'wp_update_themes', 'wp_update_themes' );
|
| 413 |
+
add_filter( 'pre_transient_update_themes', array( __CLASS__,'last_checked' ) );
|
| 414 |
+
|
| 415 |
+
# >3.0:
|
| 416 |
remove_action( 'load-update-core.php', 'wp_update_themes' );
|
| 417 |
+
add_filter( 'pre_site_transient_update_themes', array( __CLASS__,'last_checked' ) );
|
| 418 |
+
|
| 419 |
wp_clear_scheduled_hook( 'wp_update_themes' );
|
| 420 |
|
| 421 |
+
// Disable Theme Update E-mails (only works for some plugins)
|
| 422 |
+
// This doesn't make sense. Purpose?
|
| 423 |
+
// apply_filters( 'auto_theme_update_send_email', FALSE, $type, $theme_update, $result );
|
| 424 |
|
| 425 |
+
// This doesn't make sense. Purpose?
|
| 426 |
+
// apply_filters( 'automatic_theme_updates_send_debug_email', TRUE, $type, $theme_update, $result );
|
| 427 |
+
}
|
| 428 |
+
|
| 429 |
+
static function plugin_action_links() {
|
| 430 |
+
|
| 431 |
+
if ( ! current_user_can( 'update_plugins' ) ) {
|
| 432 |
+
return;
|
| 433 |
}
|
| 434 |
|
| 435 |
+
$plugins = get_site_transient( 'update_plugins' );
|
| 436 |
+
// $to_block = get_option( 'disable_updates_blocked' );
|
| 437 |
|
| 438 |
+
if ( isset( $plugins->response ) ) {
|
| 439 |
|
| 440 |
+
// loop through all of the plugins with updates available and attach the appropriate filter
|
| 441 |
+
foreach ( $plugins->response as $filename => $plugin ) {
|
| 442 |
|
| 443 |
+
// check that the version is the version we want to block updates to
|
| 444 |
+
add_action( "in_plugin_update_message-$filename", array( __CLASS__, 'plugin_block_link' ), 99, 2 );
|
| 445 |
+
}
|
| 446 |
+
}
|
| 447 |
|
| 448 |
+
if ( isset( $plugins->disable_updates ) ) {
|
| 449 |
|
| 450 |
+
foreach ( $plugins->disable_updates as $filename => $plugin ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 451 |
|
| 452 |
+
// check that the version is the version we want to block updates to
|
| 453 |
+
add_action( "after_plugin_row_$filename", array( __CLASS__, 'plugin_unblock_link'), -1, 1 );
|
| 454 |
+
}
|
| 455 |
+
}
|
| 456 |
+
}
|
| 457 |
|
| 458 |
+
static function plugin_block_action_link( $actions, $plugin_file, $plugin_data, $context ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
| 459 |
|
| 460 |
+
$blocked = get_option( 'disable_updates_blocked' );
|
|
|
|
|
|
|
|
|
|
|
|
|
| 461 |
|
| 462 |
+
if ( array_key_exists( $plugin_file, $blocked ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 463 |
|
| 464 |
+
$actions[] = '<a class="delete" href="plugins.php?_wpnonce=' . wp_create_nonce( 'disable_updates' ) . '&disable_updates&unblock=' . $plugin_file . '">Unblock Updates</a>';
|
| 465 |
|
| 466 |
+
} else {
|
| 467 |
+
|
| 468 |
+
$actions[] = '<a class="delete" href="plugins.php?_wpnonce=' . wp_create_nonce( 'disable_updates' ) . '&disable_updates&block=' . $plugin_file . '">Block Updates</a>';
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 469 |
}
|
|
|
|
|
|
|
| 470 |
|
| 471 |
+
return $actions;
|
| 472 |
+
}
|
| 473 |
+
|
| 474 |
+
static function http_request_args_plugins_filter( $r, $url ) {
|
| 475 |
|
| 476 |
+
if ( 0 !== strpos( $url, 'https://api.wordpress.org/plugins/update-check/1.1/' ) ) {
|
|
|
|
|
|
|
| 477 |
|
| 478 |
+
return $r;
|
| 479 |
+
}
|
|
|
|
|
|
|
| 480 |
|
| 481 |
+
$blocked = get_option( 'disable_updates_blocked' );
|
| 482 |
+
$blocked = (array) array_keys( $blocked );
|
|
|
|
| 483 |
|
| 484 |
+
if ( 0 === (int) count( $blocked ) ) {
|
|
|
|
| 485 |
|
| 486 |
+
return $r;
|
| 487 |
+
}
|
|
|
|
|
|
|
|
|
|
| 488 |
|
| 489 |
+
if ( ! isset( $r['body']['plugins'] ) ) {
|
|
|
|
| 490 |
|
| 491 |
+
return $r;
|
| 492 |
+
}
|
| 493 |
|
| 494 |
+
$plugins = json_decode( $r['body']['plugins'], TRUE );
|
| 495 |
|
| 496 |
+
foreach ( $blocked as $p ) {
|
| 497 |
|
| 498 |
+
if ( isset( $plugins['plugins'][ $p ] ) ) unset( $plugins['plugins'][ $p ] );
|
| 499 |
+
if ( FALSE !== $key = array_search( $p, $plugins['active'] ) ) unset( $plugins['active'][ $key ] );
|
| 500 |
+
}
|
| 501 |
|
| 502 |
+
$r['body']['plugins'] = json_encode( $plugins );
|
| 503 |
+
|
| 504 |
+
return $r;
|
| 505 |
}
|
| 506 |
|
| 507 |
+
static function http_request_args_themes_filter( $r, $url ) {
|
| 508 |
|
| 509 |
+
if ( 0 !== strpos( $url, 'https://api.wordpress.org/themes/update-check/1.1/' ) ) {
|
| 510 |
|
| 511 |
+
return $r;
|
| 512 |
+
}
|
| 513 |
|
| 514 |
+
$options = get_option( '_disable_updates' );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 515 |
|
| 516 |
+
if ( FALSE === $options ) {
|
|
|
|
|
|
|
|
|
|
| 517 |
|
| 518 |
+
return $r;
|
| 519 |
+
}
|
|
|
|
|
|
|
| 520 |
|
| 521 |
+
if ( isset( $options['themes'] ) ) {
|
| 522 |
|
| 523 |
+
$blocked = $options['themes'];
|
|
|
|
| 524 |
|
| 525 |
+
} else {
|
|
|
|
|
|
|
| 526 |
|
| 527 |
+
return $r;
|
| 528 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 529 |
|
| 530 |
+
if ( 0 === (int) count( $blocked ) ) {
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 531 |
|
| 532 |
+
return $r;
|
| 533 |
+
}
|
| 534 |
+
|
| 535 |
+
if ( ! isset( $r['body']['themes'] ) ) {
|
| 536 |
+
|
| 537 |
+
return $r;
|
| 538 |
+
}
|
| 539 |
+
|
| 540 |
+
$themes = json_decode( $r['body']['themes'], TRUE );
|
| 541 |
+
|
| 542 |
+
foreach ( $blocked as $t ) {
|
| 543 |
+
|
| 544 |
+
if ( isset( $themes['themes'][ $t ] ) ) unset( $themes['themes'][ $t ] );
|
| 545 |
+
}
|
| 546 |
+
|
| 547 |
+
$r['body']['themes'] = json_encode( $themes );
|
| 548 |
+
|
| 549 |
+
return $r;
|
| 550 |
}
|
| 551 |
+
|
|
|
|
|
|
|
| 552 |
// Settings page (under dashboard).
|
| 553 |
+
static function display_page() {
|
| 554 |
+
|
| 555 |
+
$status = get_option( '_disable_updates' );
|
| 556 |
+
|
| 557 |
+
// Don't Allow Users to View Settings
|
| 558 |
+
if ( ! current_user_can( 'update_core' ) ) {
|
| 559 |
+
wp_die( __( 'You do not have permissions to access this page.' ) );
|
| 560 |
+
}
|
| 561 |
?>
|
| 562 |
|
| 563 |
+
<div class="wrap">
|
| 564 |
+
|
| 565 |
+
<h2><?php _e( 'Disable Updates Manager Settings', 'disable-updates-manager' ); ?></h2>
|
| 566 |
+
|
| 567 |
+
<div class="error" style="width: 780px;">
|
| 568 |
+
<p>
|
| 569 |
+
<strong>Please Note! - </strong>If either your WordPress core, theme, or plugins get too out
|
| 570 |
+
of date, you may run into compatibility problems.
|
| 571 |
+
</p>
|
| 572 |
+
</div>
|
| 573 |
+
|
| 574 |
<form method="post" action="options.php">
|
| 575 |
+
|
| 576 |
+
<?php settings_fields( '_disable_updates' ); ?>
|
| 577 |
+
|
| 578 |
+
<table class="wp-list-table widefat fixed bookmarks" style="width: 590px; border-radius: 4px;">
|
| 579 |
+
<thead>
|
| 580 |
+
<tr>
|
| 581 |
+
<th>Disable Updates</th>
|
| 582 |
+
</tr>
|
| 583 |
+
</thead>
|
| 584 |
+
<tbody>
|
| 585 |
+
<tr>
|
| 586 |
+
<td>
|
| 587 |
+
|
| 588 |
+
<div class="showonhover">
|
| 589 |
+
<label for="all_notify">
|
| 590 |
+
<input
|
| 591 |
+
type="checkbox" <?php checked( 1, ( isset( $status['all'] ) ? (int) $status['all'] : 0 ), TRUE ); ?>
|
| 592 |
+
value="1" id="all_notify"
|
| 593 |
+
name="_disable_updates[all]"> <?php _e( 'Disable All Updates', 'disable-updates-manager' ) ?>
|
| 594 |
+
</label>
|
| 595 |
+
<span>
|
| 596 |
+
<a href="#" class="viewdescription">?</a>
|
| 597 |
+
<span class="hovertext">Just disables core, theme, and plugin updates.</span>
|
| 598 |
+
</span>
|
| 599 |
+
</div>
|
| 600 |
+
|
| 601 |
+
<span style="padding-left: 12px; display:block">
|
| 602 |
+
<label for="plugins_notify">
|
| 603 |
+
<input type="checkbox" <?php checked( 1, ( isset( $status['plugin'] ) ? (int) $status['plugin'] : 0 ), TRUE ); ?>
|
| 604 |
+
value="1" id="plugins_notify"
|
| 605 |
+
name="_disable_updates[plugin]"> <?php _e( 'Disable Plugin Updates', 'disable-updates-manager' ) ?>
|
| 606 |
+
</label>
|
| 607 |
+
<br>
|
| 608 |
+
<label for="themes_notify">
|
| 609 |
+
<input type="checkbox" <?php checked( 1, ( isset( $status['theme'] ) ? (int) $status['theme'] : 0 ), TRUE ); ?>
|
| 610 |
+
value="1" id="themes_notify"
|
| 611 |
+
name="_disable_updates[theme]"> <?php _e( 'Disable Theme Updates', 'disable-updates-manager' ) ?>
|
| 612 |
+
</label>
|
| 613 |
+
<br>
|
| 614 |
+
<label for="core_notify">
|
| 615 |
+
<input type="checkbox" <?php checked( 1, ( isset( $status['core'] ) ? (int) $status['core'] : 0 ), TRUE ); ?>
|
| 616 |
+
value="1" id="core_notify"
|
| 617 |
+
name="_disable_updates[core]"> <?php _e( 'Disable WordPress Core Update', 'disable-updates-manager' ) ?>
|
| 618 |
+
</label>
|
| 619 |
+
</span>
|
| 620 |
+
</td>
|
| 621 |
+
</tr>
|
| 622 |
+
</tbody>
|
| 623 |
+
</table>
|
| 624 |
+
<br>
|
| 625 |
+
|
| 626 |
+
<table class="wp-list-table widefat fixed bookmarks" style="width: 590px; border-radius: 4px;">
|
| 627 |
+
<thead>
|
| 628 |
+
<tr>
|
| 629 |
+
<th>Disable Plugins Individually</th>
|
| 630 |
+
</tr>
|
| 631 |
+
</thead>
|
| 632 |
+
<tbody>
|
| 633 |
+
<tr>
|
| 634 |
+
<td>
|
| 635 |
+
<div class="showonhover">
|
| 636 |
+
<label for="ip_notify">
|
| 637 |
+
<input type="checkbox" <?php checked( 1, ( isset( $status['ip'] ) ? (int) $status['ip'] : 0 ), TRUE ); ?>
|
| 638 |
+
value="1" id="ip_notify"
|
| 639 |
+
name="_disable_updates[ip]"> <?php _e( 'Disable Plugins Individually', 'disable-updates-manager' ) ?>
|
| 640 |
+
</label>
|
| 641 |
+
|
| 642 |
+
<span>
|
| 643 |
+
<a href="#" class="viewdescription">?</a>
|
| 644 |
+
<span class="hovertext">Go to the "Plugins" section in your dashboard to disable.</span>
|
| 645 |
+
</span>
|
| 646 |
+
</div>
|
| 647 |
+
|
| 648 |
+
</td>
|
| 649 |
+
</tr>
|
| 650 |
+
</tbody>
|
| 651 |
+
</table>
|
| 652 |
+
<br>
|
| 653 |
+
|
| 654 |
+
<table class="wp-list-table widefat fixed bookmarks" style="width: 590px; border-radius: 4px;">
|
| 655 |
+
<thead>
|
| 656 |
+
<tr>
|
| 657 |
+
<th>Disable Themes Individually</th>
|
| 658 |
+
</tr>
|
| 659 |
+
</thead>
|
| 660 |
+
<tbody>
|
| 661 |
+
<tr>
|
| 662 |
+
<td>
|
| 663 |
+
<div class="showonhover">
|
| 664 |
+
<label for="it_notify">
|
| 665 |
+
<input type="checkbox" <?php checked( 1, ( isset( $status['it'] ) ? (int) $status['it'] : 0 ), TRUE ); ?>
|
| 666 |
+
value="1" id="it_notify"
|
| 667 |
+
name="_disable_updates[it]"> <?php _e( 'Disable Themes Individually', 'disable-updates-manager' ) ?>
|
| 668 |
+
</label>
|
| 669 |
+
|
| 670 |
+
<span>
|
| 671 |
+
<a href="#" class="viewdescription">?</a>
|
| 672 |
+
<span class="hovertext">Enabling this option will show the list of themes to block updates.</span>
|
| 673 |
+
</span>
|
| 674 |
+
</div>
|
| 675 |
+
</td>
|
| 676 |
+
</tr>
|
| 677 |
+
|
| 678 |
+
<?php
|
| 679 |
+
|
| 680 |
+
if ( isset( $status['it'] ) ) {
|
| 681 |
+
|
| 682 |
+
?>
|
| 683 |
+
|
| 684 |
+
<tr>
|
| 685 |
+
<th>Select themes to disable:</th>
|
| 686 |
+
</tr>
|
| 687 |
+
|
| 688 |
+
<?php
|
| 689 |
+
|
| 690 |
+
$themes = wp_get_themes( array( 'allowed' => TRUE ) );
|
| 691 |
+
|
| 692 |
+
foreach ( $themes as $slug => $theme ) {
|
| 693 |
+
|
| 694 |
+
$key = sanitize_key( $slug );
|
| 695 |
+
|
| 696 |
+
?>
|
| 697 |
+
|
| 698 |
+
<tr>
|
| 699 |
+
<td>
|
| 700 |
+
|
| 701 |
+
<?php
|
| 702 |
+
|
| 703 |
+
printf( '<label for="%1$s"><input type="checkbox" value="%3$s" id="%1$s" name="_disable_updates[themes][%1$s]"%2$s> %4$s</label>',
|
| 704 |
+
$key,
|
| 705 |
+
( isset( $status['themes'][ $key ] ) && $status['themes'][ $key ] === $slug ) ? ' checked="checked"' : '',
|
| 706 |
+
$slug,
|
| 707 |
+
esc_html( $theme->name )
|
| 708 |
+
);
|
| 709 |
+
|
| 710 |
+
?>
|
| 711 |
+
|
| 712 |
+
</td>
|
| 713 |
+
</tr>
|
| 714 |
+
|
| 715 |
+
<?php
|
| 716 |
+
}
|
| 717 |
+
|
| 718 |
+
}
|
| 719 |
+
?>
|
| 720 |
+
|
| 721 |
+
</tbody>
|
| 722 |
+
</table>
|
| 723 |
+
<br>
|
| 724 |
+
|
| 725 |
+
<table class="wp-list-table widefat fixed bookmarks" style="width: 590px; border-radius: 4px;">
|
| 726 |
+
<thead>
|
| 727 |
+
<tr>
|
| 728 |
+
<th>Other Settings</th>
|
| 729 |
+
</tr>
|
| 730 |
+
</thead>
|
| 731 |
+
<tbody>
|
| 732 |
+
<tr>
|
| 733 |
+
<td>
|
| 734 |
+
<div class="showonhover">
|
| 735 |
+
<label for="page_notify">
|
| 736 |
+
<input
|
| 737 |
+
type="checkbox" <?php checked( 1, ( isset( $status['page'] ) ? (int) $status['page'] : 0 ), TRUE ); ?>
|
| 738 |
+
value="1" id="page_notify"
|
| 739 |
+
name="_disable_updates[page]"> <?php _e( 'Remove Updates Page', 'disable-updates-manager' ) ?>
|
| 740 |
+
</label>
|
| 741 |
+
<span>
|
| 742 |
+
<a href="#" class="viewdescription">?</a>
|
| 743 |
+
<span class="hovertext">The one in the dashboard tab.</span>
|
| 744 |
+
</span>
|
| 745 |
+
</div>
|
| 746 |
+
|
| 747 |
+
<div class="showonhover">
|
| 748 |
+
<label for="wpv_notify">
|
| 749 |
+
<input
|
| 750 |
+
type="checkbox" <?php checked( 1, ( isset( $status['wpv'] ) ? (int) $status['wpv'] : 0 ), TRUE ); ?>
|
| 751 |
+
value="1" id="wpv_notify"
|
| 752 |
+
name="_disable_updates[wpv]"> <?php _e( 'Remove WordPress Core Version from Footer', 'disable-updates-manager' ) ?>
|
| 753 |
+
</label>
|
| 754 |
+
<span>
|
| 755 |
+
<a href="#" class="viewdescription">?</a>
|
| 756 |
+
<span class="hovertext">Removes it for all users.</span>
|
| 757 |
+
</span>
|
| 758 |
+
</div>
|
| 759 |
+
|
| 760 |
+
<label for="abup_notify">
|
| 761 |
+
<input type="checkbox" <?php checked( 1, ( isset( $status['abup'] ) ? (int) $status['abup'] : 0 ), TRUE ); ?>
|
| 762 |
+
value="1" id="abup_notify"
|
| 763 |
+
name="_disable_updates[abup]"> <?php _e( 'Disable Automatic Background Updates', 'disable-updates-manager' ) ?>
|
| 764 |
+
</label>
|
| 765 |
+
<br>
|
| 766 |
+
</td>
|
| 767 |
+
</tr>
|
| 768 |
+
</tbody>
|
| 769 |
+
</table>
|
| 770 |
+
<p class="submit">
|
| 771 |
+
<input type="submit" class="button-primary" value="<?php _e( 'Update Settings' ) ?>"/>
|
| 772 |
+
</p>
|
| 773 |
+
|
| 774 |
+
<table class="wp-list-table widefat fixed bookmarks"
|
| 775 |
+
style="width: auto; padding: 5px; border-radius: 4px;">
|
| 776 |
+
<tbody>
|
| 777 |
+
<tr>
|
| 778 |
+
<td>
|
| 779 |
+
<p align="center">
|
| 780 |
+
<a href="http://wordpress.org/support/plugin/stops-core-theme-and-plugin-updates">Support</a> |
|
| 781 |
+
<a href="https://www.youtube.com/watch?v=ppCxjREhF9g">Tutorial</a> |
|
| 782 |
+
<a href="http://wordpress.org/plugins/stops-core-theme-and-plugin-updates/faq/">FAQ</a> |
|
| 783 |
+
<a href="https://github.com/Websiteguy/disable-updates-manager">GitHub</a>
|
| 784 |
+
</p>
|
| 785 |
+
</td>
|
| 786 |
+
</tr>
|
| 787 |
+
</tbody>
|
| 788 |
+
</table>
|
| 789 |
+
|
| 790 |
</form>
|
| 791 |
</div>
|
|
|
|
|
|
|
|
|
|
|
|
|
| 792 |
|
| 793 |
+
<?php
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 794 |
}
|
| 795 |
+
}
|
| 796 |
|
| 797 |
+
global $Disable_Updates;
|
| 798 |
+
$Disable_Updates = new Disable_Updates();
|
|
|
|
|
|
|
| 799 |
|
| 800 |
+
if ( ! function_exists( 'printr' ) ) {
|
| 801 |
+
function printr( $txt ) {
|
| 802 |
+
echo '<pre>';
|
| 803 |
+
print_r( $txt );
|
| 804 |
+
echo '</pre>';
|
| 805 |
+
}
|
| 806 |
+
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
License.txt
CHANGED
|
@@ -204,4 +204,4 @@
|
|
| 204 |
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
| 205 |
SUCH DAMAGES.
|
| 206 |
|
| 207 |
-
Matthew Sparrow (Websiteguy)
|
| 204 |
EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF
|
| 205 |
SUCH DAMAGES.
|
| 206 |
|
| 207 |
+
Matthew Sparrow (Websiteguy) webguywp@gmail.com
|
readme.txt
CHANGED
|
@@ -14,7 +14,7 @@ This plugin is configurable! Check the updates you would like to disable in the
|
|
| 14 |
|
| 15 |
= Features =
|
| 16 |
<ol>
|
| 17 |
-
<li>Disables plugins individually.</li>
|
| 18 |
<li>Disables plugin updates.</li>
|
| 19 |
<li>Disables theme updates.</li>
|
| 20 |
<li>Disable WordPress core updates.</li>
|
|
@@ -29,7 +29,7 @@ To see more features view the <a href="http://wordpress.org/plugins/stops-core-t
|
|
| 29 |
= Video Tutorials =
|
| 30 |
[youtube http://www.youtube.com/watch?v=ppCxjREhF9g]
|
| 31 |
|
| 32 |
-
[youtube http://www.youtube.com/watch?v=
|
| 33 |
|
| 34 |
|
| 35 |
== Frequently Asked Questions ==
|
|
@@ -39,16 +39,16 @@ A: Their are a couple of differences.
|
|
| 39 |
<li>They do not disable WordPress automatic updates.</li>
|
| 40 |
<li>They do not have video tutorials and screenshots.</li>
|
| 41 |
<li>They do not have settings to make it configurable.</li>
|
| 42 |
-
<li>They do not disable plugins individually.</li>
|
| 43 |
</ol>
|
| 44 |
|
| 45 |
= Q: If I remove this plugin from my website will I be able to update my plugins, themes, and WordPress core again? =
|
| 46 |
A: Yes, this plugin just disables the update. We has also recently made an uninstall.php for this plugin.
|
| 47 |
|
| 48 |
-
= Q: Is it possible to disable one plugin? =
|
| 49 |
-
A: This plugin can disable plugins individually. Watch the tutorial below for help on how to do it.
|
| 50 |
|
| 51 |
-
[youtube http://www.youtube.com/watch?v=
|
| 52 |
|
| 53 |
= Q: Does this plugin work with WordPress Multisite? =
|
| 54 |
A: This plugin doesn't yet, but we are working on this.
|
|
@@ -59,25 +59,27 @@ A: This plugin doesn't yet, but we are working on this.
|
|
| 59 |
3. Disable Plugins Individually
|
| 60 |
|
| 61 |
== Installation ==
|
| 62 |
-
|
| 63 |
|
| 64 |
-
|
| 65 |
-
|
| 66 |
-
|
| 67 |
-
<li>Go in your websites admin to the Plugins> Add New> page and push Upload.</li>
|
| 68 |
-
|
| 69 |
-
<li>Upload the zip file and push install.</li>
|
| 70 |
-
<li>Go to the Plugins section in your admin dashboard and activate.</li>
|
| 71 |
-
</ol>
|
| 72 |
-
|
| 73 |
-
<strong>2)</strong> <u><strong>Recommended</strong></u>
|
| 74 |
-
<ol>
|
| 75 |
-
<li>Go in your websites admin to the Plugins> Add New> page and push on the search bar.</li>
|
| 76 |
-
<li>Search Disable Updates Manager and push install.</li>
|
| 77 |
-
<li>Go to the Plugins section in your admin dashboard and activate.</li>
|
| 78 |
-
</ol>
|
| 79 |
|
| 80 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 81 |
= 4.0.3 =
|
| 82 |
* Fixed: FAQ spelling mistakes.
|
| 83 |
* Fixed: changelog star error.
|
|
@@ -327,4 +329,4 @@ Their are two way to install Disable Updates Manager.
|
|
| 327 |
= Note =
|
| 328 |
Versions 0.2 to 0.9 are not listed in this changelog.
|
| 329 |
|
| 330 |
-
= *
|
| 14 |
|
| 15 |
= Features =
|
| 16 |
<ol>
|
| 17 |
+
<li>Disables plugins and themes individually.</li>
|
| 18 |
<li>Disables plugin updates.</li>
|
| 19 |
<li>Disables theme updates.</li>
|
| 20 |
<li>Disable WordPress core updates.</li>
|
| 29 |
= Video Tutorials =
|
| 30 |
[youtube http://www.youtube.com/watch?v=ppCxjREhF9g]
|
| 31 |
|
| 32 |
+
[youtube http://www.youtube.com/watch?v=jPHyG2YYeo4]
|
| 33 |
|
| 34 |
|
| 35 |
== Frequently Asked Questions ==
|
| 39 |
<li>They do not disable WordPress automatic updates.</li>
|
| 40 |
<li>They do not have video tutorials and screenshots.</li>
|
| 41 |
<li>They do not have settings to make it configurable.</li>
|
| 42 |
+
<li>They do not disable plugins and themes individually.</li>
|
| 43 |
</ol>
|
| 44 |
|
| 45 |
= Q: If I remove this plugin from my website will I be able to update my plugins, themes, and WordPress core again? =
|
| 46 |
A: Yes, this plugin just disables the update. We has also recently made an uninstall.php for this plugin.
|
| 47 |
|
| 48 |
+
= Q: Is it possible to disable one plugin or theme? =
|
| 49 |
+
A: This plugin can disable plugins and themes individually. Watch the tutorial below for help on how to do it.
|
| 50 |
|
| 51 |
+
[youtube http://www.youtube.com/watch?v=jPHyG2YYeo4]
|
| 52 |
|
| 53 |
= Q: Does this plugin work with WordPress Multisite? =
|
| 54 |
A: This plugin doesn't yet, but we are working on this.
|
| 59 |
3. Disable Plugins Individually
|
| 60 |
|
| 61 |
== Installation ==
|
| 62 |
+
Installing Disable Updates Manager.
|
| 63 |
|
| 64 |
+
1.Install Disable Updates Manager either via the WordPress.org plugin directory, or by uploading the files to your server
|
| 65 |
+
2.After activating Disable Updates Manager by Websiteguy, you will be able to go to the Disable Updates Manager page under the settings.
|
| 66 |
+
3.That's it. You're ready to go!
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 67 |
|
| 68 |
== Changelog ==
|
| 69 |
+
= 4.1.0 =
|
| 70 |
+
* <strong>BIG:</strong> code clean-up (moved code, fixed code, etc.). - Thanks <a href="https://github.com/Websiteguy/disable-updates-manager/pull/4">GitHub Pull Request</a> and other help!!!
|
| 71 |
+
* Added: version 4.1.0 on GitHub (including the lang file).
|
| 72 |
+
* Added: website! http://webguywp.wordpress.com/
|
| 73 |
+
* New Contributor: shazahm1!
|
| 74 |
+
* New: video tutroial.
|
| 75 |
+
* New: disable themes individually.
|
| 76 |
+
* New: wp-cli compatiblity. - Thanks <a href="https://github.com/Websiteguy/disable-updates-manager/issues/2">GitHub Issue</a>!
|
| 77 |
+
* Fixed: changelog footnote star error.
|
| 78 |
+
* Updated: disable plugin updates.
|
| 79 |
+
* Updated: installation section.
|
| 80 |
+
* Updated: screenshots.
|
| 81 |
+
* Renamed: files. - Thanks <a href="https://github.com/Websiteguy/disable-updates-manager/issues/11">GitHub Issue</a>!
|
| 82 |
+
|
| 83 |
= 4.0.3 =
|
| 84 |
* Fixed: FAQ spelling mistakes.
|
| 85 |
* Fixed: changelog star error.
|
| 329 |
= Note =
|
| 330 |
Versions 0.2 to 0.9 are not listed in this changelog.
|
| 331 |
|
| 332 |
+
= * versions not available for download. =
|
uninstall.php
CHANGED
|
@@ -6,6 +6,4 @@ if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
|
|
| 6 |
}
|
| 7 |
|
| 8 |
// it was defined, now delete
|
| 9 |
-
delete_option('_disable_updates');
|
| 10 |
-
|
| 11 |
-
?>
|
| 6 |
}
|
| 7 |
|
| 8 |
// it was defined, now delete
|
| 9 |
+
delete_option('_disable_updates');
|
|
|
|
|
|
