Easy Updates Manager - Version 4.7.0

Version Description

Download this release

Release Info

Developer ronalfy
Plugin Icon 128x128 Easy Updates Manager
Version 4.7.0
Comparing to
See all releases

Code changes from version 4.6.0 to 4.7.0

License.txt CHANGED
@@ -48,7 +48,7 @@ that any problems introduced by others will not reflect on the original
48
  authors' reputations.
49
 
50
  Finally, any free program is threatened constantly by software
51
- patents. We wish to avoid the danger that redistributors of a free
52
  program will individually obtain patent licenses, in effect making the
53
  program proprietary. To prevent this, we have made it clear that any
54
  patent must be licensed for everyone's free use or not licensed at all.
@@ -148,7 +148,7 @@ Sections 1 and 2 above provided that you also do one of the following:
148
 
149
  c) Accompany it with the information you received as to the offer
150
  to distribute corresponding source code. (This alternative is
151
- allowed only for noncommercial distribution and only if you
152
  received the program in object code or executable form with such
153
  an offer, in accord with Subsection b above.)
154
 
@@ -169,9 +169,9 @@ access to copy the source code from the same place counts as
169
  distribution of the source code, even though third parties are not
170
  compelled to copy the source along with the object code.
171
 
172
- 4. You may not copy, modify, sublicense, or distribute the Program
173
  except as expressly provided under this License. Any attempt
174
- otherwise to copy, modify, sublicense or distribute the Program is
175
  void, and will automatically terminate your rights under this License.
176
  However, parties who have received copies, or rights, from you under
177
  this License will not have their licenses terminated so long as such
@@ -194,7 +194,7 @@ restrictions on the recipients' exercise of the rights granted herein.
194
  You are not responsible for enforcing compliance by third parties to
195
  this License.
196
 
197
- 7. If, as a consequence of a court judgment or allegation of patent
198
  infringement or for any other reason (not limited to patent issues),
199
  conditions are imposed on you (whether by court order, agreement or
200
  otherwise) that contradict the conditions of this License, they do not
@@ -290,8 +290,7 @@ to attach them to the start of each source file to most effectively
290
  convey the exclusion of warranty; and each file should have at least
291
  the "copyright" line and a pointer to where the full notice is found.
292
 
293
- {description}
294
- Copyright (C) {year} {fullname}
295
 
296
  This program is free software; you can redistribute it and/or modify
297
  it under the terms of the GNU General Public License as published by
48
  authors' reputations.
49
 
50
  Finally, any free program is threatened constantly by software
51
+ patents. We wish to avoid the danger that re-distributors of a free
52
  program will individually obtain patent licenses, in effect making the
53
  program proprietary. To prevent this, we have made it clear that any
54
  patent must be licensed for everyone's free use or not licensed at all.
148
 
149
  c) Accompany it with the information you received as to the offer
150
  to distribute corresponding source code. (This alternative is
151
+ allowed only for non-commercial distribution and only if you
152
  received the program in object code or executable form with such
153
  an offer, in accord with Subsection b above.)
154
 
169
  distribution of the source code, even though third parties are not
170
  compelled to copy the source along with the object code.
171
 
172
+ 4. You may not copy, modify, sub-license, or distribute the Program
173
  except as expressly provided under this License. Any attempt
174
+ otherwise to copy, modify, sub-license or distribute the Program is
175
  void, and will automatically terminate your rights under this License.
176
  However, parties who have received copies, or rights, from you under
177
  this License will not have their licenses terminated so long as such
194
  You are not responsible for enforcing compliance by third parties to
195
  this License.
196
 
197
+ 7. If, as a consequence of a court judgement or allegation of patent
198
  infringement or for any other reason (not limited to patent issues),
199
  conditions are imposed on you (whether by court order, agreement or
200
  otherwise) that contradict the conditions of this License, they do not
290
  convey the exclusion of warranty; and each file should have at least
291
  the "copyright" line and a pointer to where the full notice is found.
292
 
293
+ Copyright (C) {2014} {Matthew Sparrow}
 
294
 
295
  This program is free software; you can redistribute it and/or modify
296
  it under the terms of the GNU General Public License as published by
assets/admin.js CHANGED
@@ -1,8 +1,6 @@
1
  ;jQuery(document).ready( function($) {
2
 
3
- /*
4
- * Add jQuery Chosen to enhance selects.
5
- */
6
  if ( $.fn.chosen ) {
7
 
8
  $('.dum-enhanced-select').chosen( { width: '100%' } );
1
  ;jQuery(document).ready( function($) {
2
 
3
+ /* Add jQuery Chosen to enhance selects. */
 
 
4
  if ( $.fn.chosen ) {
5
 
6
  $('.dum-enhanced-select').chosen( { width: '100%' } );
assets/style - Copy.css DELETED
@@ -1,59 +0,0 @@
1
- /* Settings Page - Setting Tooltips */
2
- .showonhover {
3
- position: relative;
4
- }
5
-
6
- .showonhover .hovertext {
7
- opacity: 0;
8
- top: -99999px;
9
- position: absolute;
10
- z-index: 1000;
11
- border: 1px solid #ffd971;
12
- background-color: #fffdce;
13
- padding: 2px 8px 2px 8px;
14
- width: auto;
15
- height: auto;
16
- font-size: .85em;
17
- -webkit-transition: opacity .3s ease;
18
- -moz-transition: opacity .3s ease;
19
- -o-transition: opacity .3s ease;
20
- transition: opacity .3s ease;
21
- }
22
-
23
- .showonhover:hover .hovertext {
24
- opacity: 1;
25
- top: 0;
26
- }
27
-
28
- a.viewdescription {
29
- color: #999;
30
- }
31
-
32
- a.viewdescription:hover {
33
- background-color: #999;
34
- color: #FFF;
35
- }
36
-
37
- /* Settings Page - Tutorial Columns */
38
- #column1 {
39
- width: 40%;
40
- padding: 0 5pt 0 0;
41
- float: left;
42
- }
43
-
44
- #column2 {
45
- width: 40%;
46
- padding: 0 5pt 0 0;
47
- float: right;
48
- }
49
-
50
- /* Settings Page - Chosen Settings */
51
- select.dum-enhanced-select {
52
- width: 100%;
53
- }
54
-
55
- .chosen-container-multi .chosen-choices li.search-field input[type="text"] {
56
- -webkit-box-sizing: content-box;
57
- -moz-box-sizing: content-box;
58
- box-sizing: content-box;
59
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
assets/style.css CHANGED
@@ -1,4 +1,4 @@
1
- /* Settings Page - Setting Tooltips */
2
  .showonhover {
3
  position: relative;
4
  }
@@ -34,7 +34,7 @@ a.viewdescription:hover {
34
  color: #FFF;
35
  }
36
 
37
- /* Settings Page - Tutorial Columns */
38
  #acolumn1 {
39
  width: 40%;
40
  padding: 0 5pt 0 0;
@@ -47,7 +47,7 @@ a.viewdescription:hover {
47
  float: right;
48
  }
49
 
50
- /* Settings Page - Chosen Settings */
51
  select.dum-enhanced-select {
52
  width: 100%;
53
  }
1
+ /* Description: Setting Tooltips */
2
  .showonhover {
3
  position: relative;
4
  }
34
  color: #FFF;
35
  }
36
 
37
+ /* Description: Tutorial Columns */
38
  #acolumn1 {
39
  width: 40%;
40
  padding: 0 5pt 0 0;
47
  float: right;
48
  }
49
 
50
+ /* Description: Chosen Settings */
51
  select.dum-enhanced-select {
52
  width: 100%;
53
  }
assets/style.min - Copy.css DELETED
@@ -1,4 +0,0 @@
1
- .showonhover{position:relative}.showonhover .hovertext{opacity:0;top:-99999px;position:absolute;z-index:1000;border:1px solid #ffd971;background-color:#fffdce;padding:2px 8px 2px 8px;width:auto;height:auto;font-size:.85em;-webkit-transition:opacity .3s ease;-moz-transition:opacity .3s ease;-o-transition:opacity .3s ease;transition:opacity .3s ease}
2
- .showonhover:hover .hovertext{opacity:1;top:0}a.viewdescription{color:#999}a.viewdescription:hover{background-color:#999;color:#FFF}select.dum-enhanced-select{width:100%}
3
- .chosen-container-multi .chosen-choices li.search-field input[type="text"]{-webkit-box-sizing:content-box;-moz-box-sizing:content-box;box-sizing:content-box}
4
- #column1 {width:40%;padding:0 5pt 0 0;float:left;}#column2 {width:40%;padding:0 5pt 0 0;float:right;}
 
 
 
 
languages/disable-updates-manager.pot CHANGED
@@ -1,17 +1,29 @@
1
- # Copyright (C) 2014
2
- # This file is distributed under the same license as the package.
3
  msgid ""
4
  msgstr ""
5
- "Project-Id-Version: \n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/stops-core-theme-and-plugin-"
7
  "updates\n"
8
  "POT-Creation-Date: 2014-07-30 15:30:14+00:00\n"
 
 
 
 
 
 
9
  "MIME-Version: 1.0\n"
10
  "Content-Type: text/plain; charset=UTF-8\n"
11
  "Content-Transfer-Encoding: 8bit\n"
12
- "PO-Revision-Date: 2014-MO-DA HO:MI+ZONE\n"
13
- "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14
- "Language-Team: LANGUAGE <LL@li.org>\n"
 
 
 
 
 
 
15
 
16
  #: Function.php:80
17
  msgid "Disable Updates Globally"
1
+ # Loco Gettext template
2
+ #, fuzzy
3
  msgid ""
4
  msgstr ""
5
+ "Project-Id-Version: Disable Updates Manager\n"
6
  "Report-Msgid-Bugs-To: http://wordpress.org/tag/stops-core-theme-and-plugin-"
7
  "updates\n"
8
  "POT-Creation-Date: 2014-07-30 15:30:14+00:00\n"
9
+ "POT-Revision-Date: Wed Dec 10 2014 12:20:38 GMT-0500 (Eastern Standard Time)\n"
10
+ "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
11
+ "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
12
+ "Language-Team: LANGUAGE <LL@li.org>\n"
13
+ "Language: \n"
14
+ "Plural-Forms: nplurals=INTEGER; plural=EXPRESSION\n"
15
  "MIME-Version: 1.0\n"
16
  "Content-Type: text/plain; charset=UTF-8\n"
17
  "Content-Transfer-Encoding: 8bit\n"
18
+ "X-Poedit-SourceCharset: UTF-8\n"
19
+ "X-Poedit-Basepath: .\n"
20
+ "X-Poedit-SearchPath-0: ..\n"
21
+ "X-Poedit-KeywordsList: _:1;gettext:1;dgettext:2;ngettext:1,2;dngettext:2,3;"
22
+ "__:1;_e:1;_c:1;_n:1,2;_n_noop:1,2;_nc:1,2;__ngettext:1,2;__ngettext_noop:1,2;"
23
+ "_x:1,2c;_ex:1,2c;_nx:1,2,4c;_nx_noop:1,2,3c;_n_js:1,2;_nx_js:1,2,3c;"
24
+ "esc_attr__:1;esc_html__:1;esc_attr_e:1;esc_html_e:1;esc_attr_x:1,2c;"
25
+ "esc_html_x:1,2c;comments_number_link:2,3;t:1;st:1;trans:1;transChoice:1,2\n"
26
+ "X-Generator: Loco - https://localise.biz/"
27
 
28
  #: Function.php:80
29
  msgid "Disable Updates Globally"
main.php CHANGED
@@ -1,72 +1,72 @@
1
  <?php
2
- /*
3
- * @package Disable Updates Manager
4
- * @author MPS Plugins
5
- * @email mpsplugins@gmail.com
6
- * @version 4.6.0
7
- */
8
  /*
9
- Plugin Name: Disable Updates Manager
10
- Plugin URI: http://www.mpswp.wordpress.com
11
- Version: 4.6.0
12
- Description: A configurable plugin that disables updates for you. Easy, clean and helpful.
13
- Author: MPS Plugins
14
- Author URI: http://www.mpswp.wordpress.com
15
- Author Email: mpsplugins@gmail.com
16
- License: GPL2
17
- Text Domain: disable-updates-manager
18
- Domain Path: languages
19
-
20
- @Copyright 2013 - 2014 MPS Plugins (email: mpsplugins@gmail.com)
21
-
22
- This program is free software; you can redistribute it and/or modify
23
- it under the terms of the GNU General Public License, version 2, as
24
- published by the Free Software Foundation.
25
-
26
- This program is distributed in the hope that it will be useful,
27
- but WITHOUT ANY WARRANTY; without even the implied warranty of
28
- MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29
- GNU General Public License for more details.
30
-
31
- You should have received a copy of the GNU General Public License
32
- along with this program; if not, write to the Free Software
33
- Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34
-
35
- Go to the license.txt in the trunk for more information.
 
 
 
 
 
 
36
  */
37
 
38
  class Disable_Updates {
39
 
40
- // Define version.
41
- const VERSION = '4.6.0';
42
 
43
  private static $page_hook = '';
44
 
45
  function __construct() {
46
 
47
- // Load our textdomain
48
  add_action( 'init', array( __CLASS__ , 'load_textdomain' ) );
49
 
50
- // Add menu page.
51
  add_action( 'admin_menu', array( __CLASS__, 'add_submenu' ) );
52
 
53
- // Settings API.
54
  add_action( 'admin_init', array( __CLASS__, 'register_setting' ) );
55
 
56
- // Add action links.
57
  add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( __CLASS__, 'action_links' ) );
58
 
59
- // Add meta links.
60
  add_filter( 'plugin_row_meta', array( __CLASS__, 'meta_links' ), 10, 2 );
61
 
62
- // load the values recorded.
63
  $this->load_disable_updates();
 
64
  }
65
 
66
  static function load_textdomain() {
67
 
68
  load_plugin_textdomain( 'disable-updates-manager', FALSE, basename( dirname( __FILE__ ) ) . '/lang' );
69
-
70
  }
71
 
72
  static function page_actions() {
@@ -74,34 +74,37 @@ class Disable_Updates {
74
  do_action( 'add_meta_boxes_' . self::$page_hook, NULL );
75
  do_action( 'add_meta_boxes', self::$page_hook, NULL );
76
 
77
- // User can choose between 1 or 2 columns (default 2)
78
  add_screen_option('layout_columns', array('max' => 2, 'default' => 2) );
79
 
80
  add_meta_box( 'dum-global', __( 'Disable Updates Globally', 'disable-updates-manager' ), array( __CLASS__, 'metabox_global' ), self::$page_hook, 'left', 'core' );
81
- add_meta_box( 'dum-themes', __( 'Disable Theme Updates', 'disable-updates-manager' ), array( __CLASS__, 'metabox_themes' ), self::$page_hook, 'right', 'core' );
82
 
83
- add_meta_box( 'dum-other', __( 'Other Settings', 'disable-updates-manager' ), array( __CLASS__, 'metabox_other' ), self::$page_hook, 'left', 'core' );
84
  add_meta_box( 'dum-plugins', __( 'Disable Plugin Updates', 'disable-updates-manager' ), array( __CLASS__, 'metabox_plugins' ), self::$page_hook, 'right', 'core' );
 
85
  }
86
 
87
  static function enqueue_css() {
88
 
89
- // If SCRIPT_DEBUG is set and TRUE load the non-minified files, otherwise, load the minified files.
90
  $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
91
 
92
  wp_register_style( 'dum-chosen', plugins_url( "vendor/chosen/chosen$min.css", __FILE__ ), array(), '1.1.0' );
93
 
94
  wp_enqueue_style( 'disable-updates-manager', plugins_url( "assets/style$min.css", __FILE__ ), array( 'dum-chosen' ), self::VERSION );
 
95
  }
96
 
97
  static function enqueue_js() {
98
 
99
- // If SCRIPT_DEBUG is set and TRUE load the non-minified files, otherwise, load the minified files.
100
  $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
101
 
102
  wp_register_script( 'dum-admin-js', plugins_url( "assets/admin$min.js", __FILE__ ), array( 'postbox' ), self::VERSION );
103
 
104
  wp_enqueue_script( 'dum-chosen-js', plugins_url( "vendor/chosen/chosen.jquery$min.js", __FILE__ ), array( 'dum-admin-js' ), '1.1.0' );
 
105
  }
106
 
107
  static function footer_scripts() {
@@ -109,58 +112,56 @@ class Disable_Updates {
109
  ?>
110
  <script> postboxes.add_postbox_toggles(pagenow);</script>
111
  <?php
 
112
  }
113
 
114
- // Register settings.
115
  static function register_setting() {
116
 
117
  register_setting( '_disable_updates', '_disable_updates', array( __CLASS__, 'validate_settings' ) );
 
118
  }
119
 
120
- static function validate_settings( $value ) {
121
-
122
 
123
  if ( isset( $value['plugins'] ) ) {
124
 
125
-
126
- // Since the blocked plugins are stored in a different option, we need to update that option.
127
  $blocked_plugins = $value['plugins'];
128
 
129
-
130
- // Convert the data to match the way the options are stored.
131
  $blocked_plugins = array_fill_keys( $blocked_plugins, TRUE );
132
 
133
-
134
  } else {
135
 
136
-
137
  $blocked_plugins = array();
 
138
  }
139
 
140
-
141
- // Update the blocked plugins option.
142
  update_option( 'disable_updates_blocked', $blocked_plugins );
143
 
144
-
145
  return $value;
 
146
  }
147
 
148
  static function add_submenu() {
149
 
150
  $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' ) );
151
 
152
- // Enqueue the admin CSS for this page only..
153
  add_action( "load-$page_hook", array( __CLASS__, 'enqueue_css' ) );
154
 
155
- // Enqueue the admin JS for this page only..
156
  add_action( "load-$page_hook", array( __CLASS__, 'enqueue_js' ) );
157
 
158
- // Add callbacks for this page only.
159
  add_action( "load-$page_hook", array( __CLASS__, 'page_actions' ), 9 );
160
  add_action( "admin_footer-$page_hook" , array( __CLASS__ , 'footer_scripts' ) );
161
  add_action( "load-$page_hook", array( __CLASS__, 'help_tab' ) );
162
 
163
  self::$page_hook = $page_hook;
 
164
  }
165
 
166
  static function action_links( $links ) {
@@ -188,9 +189,10 @@ static function validate_settings( $value ) {
188
  }
189
 
190
  return $links;
 
191
  }
192
 
193
- // Functions for plugin (Change in settings)
194
  static function load_disable_updates() {
195
 
196
  $status = get_option( '_disable_updates' );
@@ -203,62 +205,67 @@ static function validate_settings( $value ) {
203
 
204
  switch ( $id ) {
205
 
206
- // Disable Plugin Updates
207
  case 'plugin' :
208
 
209
  self::disable_plugin_updates();
210
- break;
 
211
 
212
- // Disable Theme Updates
213
  case 'theme' :
214
 
215
  self::disable_theme_updates();
216
 
217
- break;
218
 
219
- // Disable WordPress Core Updates
220
  case 'core' :
221
 
222
  self::disable_core_updates();
223
 
224
- break;
225
 
226
- // Remove the Dashboard Updates Menu
227
  case 'page' :
228
 
229
- // Remove the Dashboard Updates Menu Code
230
  add_action( 'admin_init', create_function( '', 'remove_submenu_page( \'index.php\', \'update-core.php\' );' ) );
 
 
 
 
 
231
 
232
- break;
233
-
234
- // Disable All Updates
235
  case 'all' :
236
 
237
- // Disable Plugin Updates Only
238
  self::disable_plugin_updates();
239
 
240
- // Disable Theme Updates Only
241
  self::disable_theme_updates();
242
 
243
- // Disable Core Updates Only
244
  self::disable_core_updates();
245
 
246
- // Disable Debug E-mails
247
  add_filter( 'automatic_updates_send_debug_email ', '__return_false', 1 );
248
 
249
- // Disable WordPress Automatic Updates
250
  define( 'AUTOMATIC_UPDATER_DISABLED', TRUE );
251
  define( 'WP_AUTO_UPDATE_CORE', FALSE );
252
 
253
- break;
254
 
255
- // Remove WordPress Version Number
256
  case 'wpv' :
257
 
258
  add_filter( 'update_footer', '__return_empty_string', 11 );
259
 
260
- break;
261
 
 
262
  case 'ip' :
263
 
264
  if ( defined( 'disable_updates_loaded' ) ) {
@@ -271,82 +278,69 @@ static function validate_settings( $value ) {
271
  add_filter( 'site_transient_update_plugins', array( __CLASS__, 'remove_plugin_update_notification' ) );
272
  add_filter( 'plugin_action_links', array( __CLASS__, 'plugin_block_action_link' ), 10, 4 );
273
 
274
- // remove blocked plugins from being checked for updates at wordpress.org
275
  add_filter( 'http_request_args', array( __CLASS__, 'http_request_args_plugins_filter' ), 5, 2 );
276
 
277
- break;
278
 
 
279
  case 'bnag' :
280
 
281
  if ( ! function_exists( 'c2c_no_browser_nag' ) ) :
282
 
283
  function c2c_no_browser_nag() {
284
- // This is cribbed from wp_check_browser_version()
285
  $key = md5( $_SERVER['HTTP_USER_AGENT'] );
286
  add_filter( 'site_transient_browser_' . $key, '__return_null' );
287
  }
288
  endif;
289
  add_action( 'admin_init', 'c2c_no_browser_nag' );
290
 
291
- break;
292
 
 
293
  case 'it':
294
 
295
  add_filter( 'site_transient_update_themes', array( __CLASS__, 'remove_theme_update_notification' ) );
296
 
297
- // remove blocked themes from being checked for updates at wordpress.org
298
  add_filter( 'http_request_args', array( __CLASS__, 'http_request_args_themes_filter' ), 5, 2 );
299
 
300
- break;
301
 
302
- // Disable automatic background updates.
303
  case 'abup' :
304
 
305
  wp_clear_scheduled_hook( 'wp_maybe_auto_update' );
306
 
307
- break;
308
 
309
- /*
310
- Version Added: 4.4.0
311
- Last Version Edited: 4.5.0
312
- Description: Disables minor core updates in the Disable Updates Manager settings.
313
- */
314
  case 'minor-core-updates' :
315
 
316
- //TO BE ADDED
317
 
318
- break;
319
 
320
- /*
321
- Version Added: 4.4.0
322
- Last Version Edited: 4.5.0
323
- Description: Disables major core updates in the Disable Updates Manager settings.
324
- */
325
  case 'major-core-updates' :
326
 
327
- //TO BE ADDED
328
 
329
- break;
330
 
331
- /*
332
- Version Added: 4.4.0
333
- Description: Disables auto translation updates in the Disable Updates Manager settings.
334
- */
335
  case 'auto-translation-updates' :
336
 
337
  add_filter( 'auto_update_translation', '__return_false' );
338
 
339
- break;
340
 
341
- /*
342
- Version Added: 4.4.0
343
- Description: Disables auto core e-mails in the Disable Updates Manager settings.
344
- */
345
  case 'auto-core-emails' :
346
 
347
  add_filter( 'auto_core_update_send_email', '__return_false' );
348
 
349
- break;
350
 
351
  }
352
  }
@@ -358,7 +352,7 @@ static function validate_settings( $value ) {
358
  return;
359
  }
360
 
361
- // see if there are actions to process
362
  if ( ! isset( $_GET[ 'disable_updates' ] ) || ! isset( $_GET[ '_wpnonce' ] ) ) {
363
  return;
364
  }
@@ -368,13 +362,7 @@ static function validate_settings( $value ) {
368
  }
369
 
370
  $blocked = get_option( 'disable_updates_blocked' );
371
- // $plugins = get_site_transient( 'update_plugins' );
372
 
373
- // block action
374
- // if ( isset( $_GET[ 'block' ] ) && isset( $plugins->response ) && isset( $plugins->response[ $_GET[ 'block' ] ] ) ) {
375
- // $p = $plugins->response[ $_GET[ 'block' ] ];
376
- // $blocked[ $_GET[ 'block' ] ] = array( 'slug' => $p->slug, 'new_version' => $p->new_version );
377
- // }
378
  if ( isset( $_GET[ 'block' ] ) ) {
379
 
380
  $blocked[ $_GET[ 'block' ] ] = TRUE;
@@ -386,6 +374,7 @@ static function validate_settings( $value ) {
386
  }
387
 
388
  update_option( 'disable_updates_blocked', $blocked );
 
389
  }
390
 
391
  static function remove_plugin_update_notification( $plugins ) {
@@ -397,16 +386,6 @@ static function validate_settings( $value ) {
397
 
398
  $blocked = (array) get_option( 'disable_updates_blocked' );
399
 
400
- // foreach ( $blocked as $filename => $plugin ) {
401
-
402
- // if ( isset( $plugins->response[ $filename ] )
403
- // && $plugins->response[ $filename ]->new_version == $plugin[ 'new_version' ]
404
- // ) {
405
-
406
- // $plugins->disable_updates[ $filename ] = $plugins->response[ $filename ];
407
- // unset( $plugins->response[ $filename ] );
408
- // }
409
- // }
410
  foreach ( $blocked as $filename => $plugin ) {
411
 
412
  if ( isset( $plugins->response[ $filename ] ) && $plugin == TRUE ) {
@@ -417,6 +396,7 @@ static function validate_settings( $value ) {
417
  }
418
 
419
  return $plugins;
 
420
  }
421
 
422
  static function remove_theme_update_notification( $themes ) {
@@ -457,6 +437,7 @@ static function validate_settings( $value ) {
457
  }
458
 
459
  return $themes;
 
460
  }
461
 
462
  static function last_checked() {
@@ -467,88 +448,75 @@ static function validate_settings( $value ) {
467
  'updates' => array(),
468
  'version_checked' => $wp_version,
469
  );
 
470
  }
471
 
472
- // Disable Core Updates
473
  static function disable_core_updates() {
474
 
475
- # 2.3 to 2.7:
476
  add_action( 'init', create_function( '', 'remove_action( \'init\', \'wp_version_check\' );' ), 2 );
477
  add_filter( 'pre_option_update_core', '__return_null' );
478
 
479
- # 2.8 to 3.0:
480
  remove_action( 'wp_version_check', 'wp_version_check' );
481
  remove_action( 'admin_init', '_maybe_update_core' );
482
  add_filter( 'pre_transient_update_core', array( __CLASS__,'last_checked' ) );
483
 
484
- # >3.0:
485
  remove_action( 'load-update-core.php', 'wp_update_core' );
486
  add_filter( 'pre_site_transient_update_core', array( __CLASS__,'last_checked' ) );
487
 
488
- // Hide Update Notices in Admin Dashboard
489
  add_action( 'admin_menu', create_function( '', 'remove_action( \'admin_notices\', \'update_nag\', 3 );' ) );
490
 
491
  wp_clear_scheduled_hook( 'wp_version_check' );
492
-
493
- // Disable email.
494
  add_filter( 'auto_core_update_send_email', '__return_false' );
495
-
496
- // This doesn't make sense. Purpose?
497
- // apply_filters( 'automatic_core_updates_send_debug_email', TRUE, $type, $core_update, $result );
498
  }
499
 
500
- // Disable Plugin Updates
501
  static function disable_plugin_updates() {
502
 
503
- # 2.3 to 2.7:
504
- // add_action( 'admin_menu', create_function( '$a', "remove_action( 'load-plugins.php', 'wp_update_plugins' );") );
505
- // add_action( 'admin_init', create_function( '$a', "remove_action( 'admin_init', 'wp_update_plugins' );"), 2 );
506
- // add_action( 'init', create_function( '$a', "remove_action( 'init', 'wp_update_plugins' );"), 2 );
507
  add_filter( 'pre_option_update_plugins', '__return_null' );
508
 
509
- # 2.8 to 3.0:
510
  remove_action( 'load-plugins.php', 'wp_update_plugins' );
511
  remove_action( 'load-update.php', 'wp_update_plugins' );
512
  remove_action( 'admin_init', '_maybe_update_plugins' );
513
  remove_action( 'wp_update_plugins', 'wp_update_plugins' );
514
  add_filter( 'pre_transient_update_plugins', array( __CLASS__,'last_checked' ) );
515
 
516
- # >3.0:
517
  remove_action( 'load-update-core.php', 'wp_update_plugins' );
518
  add_filter( 'pre_site_transient_update_plugins', array( __CLASS__,'last_checked' ) );
519
 
520
  wp_clear_scheduled_hook( 'wp_update_plugins' );
521
-
522
- // Disable Plugin Update E-mails (only works for some plugins)
523
- // This doesn't make sense. Purpose?
524
- // apply_filters( 'auto_plugin_update_send_email', FALSE, $type, $plugin_update, $result );
525
-
526
- // This doesn't make sense. Purpose?
527
- // apply_filters( 'automatic_plugin_updates_send_debug_email', TRUE, $type, $plugin_update, $result );
528
  }
529
 
530
- // Disable Theme Updates
531
  static function disable_theme_updates() {
 
 
 
532
 
533
- # 2.8 to 3.0:
534
  remove_action( 'load-themes.php', 'wp_update_themes' );
535
  remove_action( 'load-update.php', 'wp_update_themes' );
536
  remove_action( 'admin_init', '_maybe_update_themes' );
537
  remove_action( 'wp_update_themes', 'wp_update_themes' );
538
  add_filter( 'pre_transient_update_themes', array( __CLASS__,'last_checked' ) );
539
 
540
- # >3.0:
541
  remove_action( 'load-update-core.php', 'wp_update_themes' );
542
  add_filter( 'pre_site_transient_update_themes', array( __CLASS__,'last_checked' ) );
543
 
544
  wp_clear_scheduled_hook( 'wp_update_themes' );
545
-
546
- // Disable Theme Update E-mails (only works for some plugins)
547
- // This doesn't make sense. Purpose?
548
- // apply_filters( 'auto_theme_update_send_email', FALSE, $type, $theme_update, $result );
549
-
550
- // This doesn't make sense. Purpose?
551
- // apply_filters( 'automatic_theme_updates_send_debug_email', TRUE, $type, $theme_update, $result );
552
  }
553
 
554
  static function plugin_block_action_link( $actions, $plugin_file, $plugin_data, $context ) {
@@ -565,6 +533,7 @@ static function validate_settings( $value ) {
565
  }
566
 
567
  return $actions;
 
568
  }
569
 
570
  static function http_request_args_plugins_filter( $r, $url ) {
@@ -598,6 +567,7 @@ static function validate_settings( $value ) {
598
  $r['body']['plugins'] = json_encode( $plugins );
599
 
600
  return $r;
 
601
  }
602
 
603
  static function http_request_args_themes_filter( $r, $url ) {
@@ -643,9 +613,10 @@ static function validate_settings( $value ) {
643
  $r['body']['themes'] = json_encode( $themes );
644
 
645
  return $r;
 
646
  }
647
 
648
- // Help Tab
649
  static function help_tab() {
650
  global $test_help_page;
651
 
@@ -727,7 +698,7 @@ WordPress encourages you to update your plugins, themes, and core to make sure t
727
 
728
  <h3>This plugin is tested so there are no problems.</h3>
729
  <ul>
730
- <li>Tested with WordPress 4.0.1 and 4.1beta1.</li>
731
  <li>Tested with popular plugins to ensure that there are no conflicts.</li>
732
  <li>Tested with popular themes to ensure that there are no conflicts.</li>
733
  </ul>
@@ -735,7 +706,6 @@ WordPress encourages you to update your plugins, themes, and core to make sure t
735
 
736
  CONTENT6;
737
 
738
- // Add my_help_tab if current screen is My Admin Page
739
  $screen->add_help_tab(array(
740
  'id' => 'help_tab_content_1',
741
  'title' => __('Overview'),
@@ -766,7 +736,7 @@ CONTENT6;
766
  'content' => $content3,
767
  ));
768
 
769
- $screen->set_help_sidebar($content5);
770
 
771
  }
772
 
@@ -775,57 +745,57 @@ CONTENT6;
775
  ?>
776
  <div>
777
  <p>
778
- <div class="showonhover">
779
- <label for="all_notify">
780
- <input
781
- type="checkbox" <?php checked( 1, ( isset( $status['all'] ) ? (int) $status['all'] : 0 ), TRUE ); ?>
782
- value="1" id="all_notify"
783
- name="_disable_updates[all]"> <?php _e( 'Disable All Updates', 'disable-updates-manager' ) ?>
784
- </label>
785
- <span>
786
- <a href="#" class="viewdescription">?</a>
787
- <span class="hovertext">Disables core, theme, and plugin updates.</span>
788
- </span>
789
- </div>
790
  </p>
791
  </div>
792
 
793
  <div style="padding-left: 12px;">
794
  <p>
795
- <div>
796
- <label for="plugins_notify">
797
- <input type="checkbox" <?php checked( 1, ( isset( $status['plugin'] ) && ! isset( $status['all'] ) ? (int) $status['plugin'] : 0 ), TRUE ); ?>
798
- value="1" id="plugins_notify"
799
- name="_disable_updates[plugin]"
800
- <?php disabled( 1, ( isset( $status['all'] ) ? (int) $status['all'] : 0 ) ) ?>> <?php _e( 'Disable All Plugin Updates', 'disable-updates-manager' ) ?>
801
- </label>
802
- </div>
803
- <br>
804
- <div>
805
- <label for="themes_notify">
806
- <input type="checkbox" <?php checked( 1, ( isset( $status['theme'] ) && ! isset( $status['all'] ) ? (int) $status['theme'] : 0 ), TRUE ); ?>
807
- value="1" id="themes_notify"
808
- name="_disable_updates[theme]"
809
- <?php disabled( 1, ( isset( $status['all'] ) ? (int) $status['all'] : 0 ) ) ?>> <?php _e( 'Disable All Theme Updates', 'disable-updates-manager' ) ?>
810
- </label>
811
- </div>
812
- <br>
813
- <div>
814
- <label for="core_notify">
815
- <input type="checkbox" <?php checked( 1, ( isset( $status['core'] ) && ! isset( $status['all'] ) ? (int) $status['core'] : 0 ), TRUE ); ?>
816
- value="1" id="core_notify"
817
- name="_disable_updates[core]"
818
- <?php disabled( 1, ( isset( $status['all'] ) ? (int) $status['all'] : 0 ) ) ?>> <?php _e( 'Disable All WordPress Core Update', 'disable-updates-manager' ) ?>
819
- </label>
820
- </div>
821
- <div style="padding-left:20px;">
822
- <br>
823
- <small>Disable major and minor core feature coming soon...<small>
824
- </p>
825
- </div>
826
  </div>
827
-
828
  <?php
 
829
  }
830
 
831
  static function metabox_other( $status ) {
@@ -833,80 +803,80 @@ CONTENT6;
833
  ?>
834
  <div>
835
  <p>
836
- <div class="showonhover">
837
- <label for="page_notify">
838
- <input
839
- type="checkbox" <?php checked( 1, ( isset( $status['page'] ) ? (int) $status['page'] : 0 ), TRUE ); ?>
840
- value="1" id="page_notify"
841
- name="_disable_updates[page]"> <?php _e( 'Remove the Updates Page', 'disable-updates-manager' ) ?>
842
- </label>
843
- <span>
844
- <a href="#" class="viewdescription">?</a></a>
845
- <span class="hovertext">The page under the Dashboard tab.</span>
846
- </span>
847
- </div>
848
- <br>
849
- <div class="showonhover">
850
- <label for="bnag_notify">
851
- <input type="checkbox" <?php checked( 1, ( isset( $status['bnag'] ) ? (int) $status['bnag'] : 0 ), TRUE ); ?>
852
- value="1" id="bnag_notify"
853
- name="_disable_updates[bnag]"> <?php _e( 'Disable Out of Date Browser Nag', 'disable-updates-manager' ) ?>
854
- </label>
855
- <span>
856
- <a href="#" class="viewdescription">?</a>
857
- <span class="hovertext">Removes the browsers is out of date notification in you WordPress dashboard.</span>
858
- </span>
859
- </div>
860
- <br>
861
- <div class="showonhover">
862
- <label for="wpv_notify">
863
- <input
864
- type="checkbox" <?php checked( 1, ( isset( $status['wpv'] ) ? (int) $status['wpv'] : 0 ), TRUE ); ?>
865
- value="1" id="wpv_notify"
866
- name="_disable_updates[wpv]"> <?php _e( 'Disable WordPress Core Version from Footer', 'disable-updates-manager' ) ?>
867
- </label>
868
- <span>
869
- <a href="#" class="viewdescription">?</a>
870
- <span class="hovertext">Removes it for all users.</span>
871
- </span>
872
- </div>
873
- <br>
874
- <div class="showonhover">
875
- <label for="auto-translation-updates_notify">
876
- <input type="checkbox" <?php checked( 1, ( isset( $status['auto-translation-updates'] ) ? (int) $status['auto-translation-updates'] : 0 ), TRUE ); ?>
877
- value="1" id="auto-translation-updates_notify"
878
- name="_disable_updates[auto-translation-updates]"> <?php _e( 'Disable Automatic Translation Updates', 'disable-updates-manager' ) ?>
879
- </label>
880
- <span>
881
- <a href="#" class="viewdescription">?</a>
882
- <span class="hovertext">Disables the automatic translation updates for you.</span>
883
- </span>
884
- </div>
885
- <br>
886
- <div class="showonhover">
887
- <label for="auto-core-emails_notify">
888
- <input
889
- type="checkbox" <?php checked( 1, ( isset( $status['auto-core-emails'] ) ? (int) $status['auto-core-emails'] : 0 ), TRUE ); ?>
890
- value="1" id="auto-core-emails_notify"
891
- name="_disable_updates[auto-core-emails]"> <?php _e( 'Disable Core Update E-mails', 'disable-updates-manager' ) ?>
892
- </label>
893
- <span>
894
- <a href="#" class="viewdescription">?</a>
895
- <span class="hovertext">Disables the core update e-mails so that they will not be sent to you.</span>
896
- </span>
897
- </div>
898
- <br>
899
- <div>
900
- <label for="abup_notify">
901
- <input type="checkbox" <?php checked( 1, ( isset( $status['abup'] ) ? (int) $status['abup'] : 0 ), TRUE ); ?>
902
- value="1" id="abup_notify"
903
- name="_disable_updates[abup]"> <?php _e( 'Disable Automatic Background Updates', 'disable-updates-manager' ) ?>
904
- </label>
 
905
  </p>
906
- </div>
907
  </div>
908
-
909
  <?php
 
910
  }
911
 
912
  static function metabox_themes( $status ) {
@@ -914,20 +884,20 @@ CONTENT6;
914
  ?>
915
  <div>
916
  <p>
917
- <div class="showonhover">
918
- <label for="dum-disable-themes">
919
- <input type="checkbox" <?php checked( 1, ( isset( $status['it'] ) && ! isset( $status['all'] ) ? (int) $status['it'] : 0 ), TRUE ); ?>
920
- id="dum-disable-themes"
921
- value="1"
922
- name="_disable_updates[it]"
923
- <?php disabled( 1, ( isset( $status['all'] ) ? (int) $status['all'] : 0 ) ) ?>> <?php _e( 'Disable Themes Individually', 'disable-updates-manager' ) ?>
924
- </label>
925
- <span>
926
- <a href="#" class="viewdescription">?</a>
927
- <span class="hovertext">Enabling this option will show the list of themes to disable updates.</span>
928
- </span>
 
929
  </p>
930
- </div>
931
  </div>
932
  <?php
933
 
@@ -937,16 +907,16 @@ CONTENT6;
937
 
938
  echo '<select class="dum-enhanced-select" id="dum-disable-themes-select" name="_disable_updates[themes][]" data-placeholder="' . __( 'Select theme(s) to disable...', 'disable-updates-manager' ) . '" multiple' . ( isset( $status['it'] ) && ! isset( $status['all'] ) ? '' : ' disabled' ) . '>';
939
 
940
- echo '<option value=""></option>';
941
 
942
- foreach ( $themes as $slug => $theme ) {
943
 
944
- printf( '<option value="%1$s"%2$s>%3$s</option>',
945
- esc_attr( $slug ),
946
- ! isset( $status['all'] ) && isset( $status['it'] ) && isset( $status['themes'] ) && in_array( $slug, $status['themes'] ) ? ' SELECTED' : '',
947
- esc_html( $theme->name )
948
- );
949
- }
950
 
951
  echo '</select>';
952
  }
@@ -956,22 +926,23 @@ CONTENT6;
956
  static function metabox_plugins( $status ) {
957
 
958
  ?>
 
959
  <p>
960
- <div class="showonhover">
961
- <label for="dum-disable-plugins">
962
- <input type="checkbox" <?php checked( 1, ( isset( $status['ip'] ) && ! isset( $status['all'] ) ? (int) $status['ip'] : 0 ), TRUE ); ?>
963
- id="dum-disable-plugins"
964
- value="1"
965
- name="_disable_updates[ip]"
966
- <?php disabled( 1, ( isset( $status['all'] ) ? (int) $status['all'] : 0 ) ) ?>> <?php _e( 'Disable Plugins Individually', 'disable-updates-manager' ) ?>
967
- </label>
968
- <span>
969
- <a href="#" class="viewdescription">?</a>
970
- <span class="hovertext">Enabling this option will show the list of plugins to disable updates.</span>
971
- </span>
 
972
  </p>
973
  </div>
974
-
975
  <?php
976
 
977
  $plugins = get_plugins();
@@ -981,81 +952,76 @@ CONTENT6;
981
 
982
  echo '<select class="dum-enhanced-select" id="dum-disable-plugins-select" name="_disable_updates[plugins][]" data-placeholder="' . __( 'Select plugin(s) to disable...', 'disable-updates-manager' ) . '" multiple' . ( isset( $status['ip'] ) && ! isset( $status['all'] ) ? '' : ' disabled' ) . '>';
983
 
984
- echo '<option value=""></option>';
985
 
986
- foreach ( $plugins as $slug => $plugin ) {
987
 
988
- printf( '<option value="%1$s"%2$s>%3$s</option>',
989
- esc_attr( $slug ),
990
- ! isset( $status['all'] ) && isset( $status['ip'] ) && array_key_exists( $slug, (array) $blocked ) ? ' SELECTED' : '',
991
- esc_attr( $plugin['Name'] )
992
- );
993
- }
994
 
995
  echo '</select>';
996
  }
997
 
998
  }
999
 
1000
- // Settings page (under dashboard).
1001
  static function display_page() {
1002
- ?>
1003
-
1004
- <h2><?php _e( 'Disable Updates Manager', 'disable-updates-manager' ); ?></h2>
1005
-
1006
- <?php
1007
-
1008
- if ( !current_user_can('manage_options') ) {
1009
- wp_die('You do not have sufficient permissions to access this page.');
1010
- }
1011
-
1012
- if ( current_user_can('manage_options') ) {
1013
-
1014
- $status = get_option( '_disable_updates' );
1015
-
1016
  ?>
1017
-
1018
- <div class="dashboard-widgets-wrap">
1019
-
1020
- <div id="dashboard-widgets" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
1021
-
1022
- <form name="dum-options" method="post" action="options.php">
1023
- <input type="hidden" name="action" value="dum-update-options">
1024
- <?php wp_nonce_field( 'dum-update-options-nonce' );
1025
-
1026
- /* Used to save closed metaboxes and their order */
1027
- wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', FALSE );
1028
- wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', FALSE ); ?>
1029
-
1030
- <div class="postbox-container">
1031
- <?php do_meta_boxes( self::$page_hook, 'left', $status ); ?>
1032
- </div>
1033
-
1034
- <div class="postbox-container">
1035
- <?php do_meta_boxes( self::$page_hook, 'right', $status ); ?>
1036
- <?php //do_meta_boxes( self::$page_hook, 'advanced', $status ); ?>
1037
- </div>
1038
-
1039
- <?php settings_fields( '_disable_updates' ); ?>
1040
-
1041
- <p class="submit clear">
1042
- <input type="submit" class="button-primary" value="<?php _e( 'Update Settings' ) ?>"/>
1043
- <a href="https://wordpress.org/support/view/plugin-reviews/stops-core-theme-and-plugin-updates?#postform" style="background-color:#ffff7f" class="button">Rate Plugin</a>
1044
- <a href="http://sparrowkids2.polldaddy.com/s/disable-updates-manager-feedbeck" class="button">Feedback Survey</a>
1045
- </p>
1046
-
1047
- </form>
1048
-
1049
- </div><!-- #dashboard-widgets -->
1050
-
1051
- </div><!-- .dashboard-widgets-wrap -->
1052
 
1053
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1054
  }
1055
  }
1056
 
1057
- }
1058
-
1059
  global $Disable_Updates;
1060
  $Disable_Updates = new Disable_Updates();
1061
 
1
  <?php
 
 
 
 
 
 
2
  /*
3
+ @package Disable Updates Manager
4
+ @author MPS Plugins
5
+ @email mpsplugins@gmail.com
6
+ @version 4.7.0
7
+ */
8
+ /*
9
+ Plugin Name: Disable Updates Manager
10
+ Plugin URI: http://www.mpswp.wordpress.com
11
+ Version: 4.7.0
12
+ Description: A configurable plugin that disables updates for you. Easy, clean and helpful.
13
+ Author: MPS Plugins
14
+ Author URI: http://www.mpswp.wordpress.com
15
+ Author Email: mpsplugins@gmail.com
16
+ License: GPL2
17
+ Text Domain: disable-updates-manager
18
+ Domain Path: languages
19
+
20
+ @Copyright 2013 - 2014 MPS Plugins (email: mpsplugins@gmail.com)
21
+
22
+ This program is free software; you can redistribute it and/or modify
23
+ it under the terms of the GNU General Public License, version 2, as
24
+ published by the Free Software Foundation.
25
+
26
+ This program is distributed in the hope that it will be useful,
27
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
28
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
29
+ GNU General Public License for more details.
30
+
31
+ You should have received a copy of the GNU General Public License
32
+ along with this program; if not, write to the Free Software
33
+ Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
34
+
35
+ Go to the license.txt in the trunk for more information.
36
  */
37
 
38
  class Disable_Updates {
39
 
40
+ /* Description: Define version. */
41
+ const VERSION = '4.7.0';
42
 
43
  private static $page_hook = '';
44
 
45
  function __construct() {
46
 
47
+ /* Description: load textdomain. */
48
  add_action( 'init', array( __CLASS__ , 'load_textdomain' ) );
49
 
50
+ /* Description: Add menu page. */
51
  add_action( 'admin_menu', array( __CLASS__, 'add_submenu' ) );
52
 
53
+ /* Description: Settings API. */
54
  add_action( 'admin_init', array( __CLASS__, 'register_setting' ) );
55
 
56
+ /* Description: Add action links. */
57
  add_filter( 'plugin_action_links_' . plugin_basename( __FILE__ ), array( __CLASS__, 'action_links' ) );
58
 
59
+ /* Description: Add meta links. */
60
  add_filter( 'plugin_row_meta', array( __CLASS__, 'meta_links' ), 10, 2 );
61
 
62
+ /* Description: Load the values recorded. */
63
  $this->load_disable_updates();
64
+
65
  }
66
 
67
  static function load_textdomain() {
68
 
69
  load_plugin_textdomain( 'disable-updates-manager', FALSE, basename( dirname( __FILE__ ) ) . '/lang' );
 
70
  }
71
 
72
  static function page_actions() {
74
  do_action( 'add_meta_boxes_' . self::$page_hook, NULL );
75
  do_action( 'add_meta_boxes', self::$page_hook, NULL );
76
 
77
+ /* Description: Users can choose between 1 or 2 columns (default is 2 columns). */
78
  add_screen_option('layout_columns', array('max' => 2, 'default' => 2) );
79
 
80
  add_meta_box( 'dum-global', __( 'Disable Updates Globally', 'disable-updates-manager' ), array( __CLASS__, 'metabox_global' ), self::$page_hook, 'left', 'core' );
81
+ add_meta_box( 'dum-themes', __( 'Disable Theme Updates', 'disable-updates-manager' ), array( __CLASS__, 'metabox_themes' ), self::$page_hook, 'left', 'core' );
82
 
83
+ add_meta_box( 'dum-other', __( 'Other Settings', 'disable-updates-manager' ), array( __CLASS__, 'metabox_other' ), self::$page_hook, 'right', 'core' );
84
  add_meta_box( 'dum-plugins', __( 'Disable Plugin Updates', 'disable-updates-manager' ), array( __CLASS__, 'metabox_plugins' ), self::$page_hook, 'right', 'core' );
85
+
86
  }
87
 
88
  static function enqueue_css() {
89
 
90
+ /* Description: If SCRIPT_DEBUG is set and TRUE load the non-minified files, otherwise, load the minified files. */
91
  $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
92
 
93
  wp_register_style( 'dum-chosen', plugins_url( "vendor/chosen/chosen$min.css", __FILE__ ), array(), '1.1.0' );
94
 
95
  wp_enqueue_style( 'disable-updates-manager', plugins_url( "assets/style$min.css", __FILE__ ), array( 'dum-chosen' ), self::VERSION );
96
+
97
  }
98
 
99
  static function enqueue_js() {
100
 
101
+ /* Description: If SCRIPT_DEBUG is set and TRUE load the non-minified files, otherwise, load the minified files. */
102
  $min = defined('SCRIPT_DEBUG') && SCRIPT_DEBUG ? '' : '.min';
103
 
104
  wp_register_script( 'dum-admin-js', plugins_url( "assets/admin$min.js", __FILE__ ), array( 'postbox' ), self::VERSION );
105
 
106
  wp_enqueue_script( 'dum-chosen-js', plugins_url( "vendor/chosen/chosen.jquery$min.js", __FILE__ ), array( 'dum-admin-js' ), '1.1.0' );
107
+
108
  }
109
 
110
  static function footer_scripts() {
112
  ?>
113
  <script> postboxes.add_postbox_toggles(pagenow);</script>
114
  <?php
115
+
116
  }
117
 
118
+ /* Description: Register settings. */
119
  static function register_setting() {
120
 
121
  register_setting( '_disable_updates', '_disable_updates', array( __CLASS__, 'validate_settings' ) );
122
+
123
  }
124
 
125
+ static function validate_settings( $value ) {
 
126
 
127
  if ( isset( $value['plugins'] ) ) {
128
 
129
+ /* Description: Since the blocked plugins are stored in a different option, we need to update that option. */
 
130
  $blocked_plugins = $value['plugins'];
131
 
132
+ /* Description: Convert the data to match the way the options are stored. */
 
133
  $blocked_plugins = array_fill_keys( $blocked_plugins, TRUE );
134
 
 
135
  } else {
136
 
 
137
  $blocked_plugins = array();
138
+
139
  }
140
 
141
+ /* Description: Update the blocked plugins options. */
 
142
  update_option( 'disable_updates_blocked', $blocked_plugins );
143
 
 
144
  return $value;
145
+
146
  }
147
 
148
  static function add_submenu() {
149
 
150
  $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' ) );
151
 
152
+ /* Description: Enqueue the admin CSS for this page only. */
153
  add_action( "load-$page_hook", array( __CLASS__, 'enqueue_css' ) );
154
 
155
+ /* Description: Enqueue the admin JavaScript for this page only. */
156
  add_action( "load-$page_hook", array( __CLASS__, 'enqueue_js' ) );
157
 
158
+ /* Description: Add callbacks for this page only. */
159
  add_action( "load-$page_hook", array( __CLASS__, 'page_actions' ), 9 );
160
  add_action( "admin_footer-$page_hook" , array( __CLASS__ , 'footer_scripts' ) );
161
  add_action( "load-$page_hook", array( __CLASS__, 'help_tab' ) );
162
 
163
  self::$page_hook = $page_hook;
164
+
165
  }
166
 
167
  static function action_links( $links ) {
189
  }
190
 
191
  return $links;
192
+
193
  }
194
 
195
+ /* Description: Functions for the plugins settings. */
196
  static function load_disable_updates() {
197
 
198
  $status = get_option( '_disable_updates' );
205
 
206
  switch ( $id ) {
207
 
208
+ /* Description: Disable Plugin Updates */
209
  case 'plugin' :
210
 
211
  self::disable_plugin_updates();
212
+
213
+ break;
214
 
215
+ /* Description: Disable theme updates. */
216
  case 'theme' :
217
 
218
  self::disable_theme_updates();
219
 
220
+ break;
221
 
222
+ /* Description: Disable WordPress core updates. */
223
  case 'core' :
224
 
225
  self::disable_core_updates();
226
 
227
+ break;
228
 
229
+ /* Description: Remove the updates and home submenu. */
230
  case 'page' :
231
 
232
+ /* Description: Updates submenu. */
233
  add_action( 'admin_init', create_function( '', 'remove_submenu_page( \'index.php\', \'update-core.php\' );' ) );
234
+
235
+ /* Description: Home submenu. */
236
+ add_action( 'admin_init', create_function( '', 'remove_submenu_page( \'index.php\', \'index.php\' );' ) );
237
+
238
+ break;
239
 
240
+ /* Description: Disable all updates. */
 
 
241
  case 'all' :
242
 
243
+ /* Description: Disable plugin updates only. */
244
  self::disable_plugin_updates();
245
 
246
+ /* Description: Disable theme updates only. */
247
  self::disable_theme_updates();
248
 
249
+ /* Description: Disable WordPress core updates only. */
250
  self::disable_core_updates();
251
 
252
+ /* Description: Disable debug e-mails. */
253
  add_filter( 'automatic_updates_send_debug_email ', '__return_false', 1 );
254
 
255
+ /* Description: Disable WordPress automatic updates. */
256
  define( 'AUTOMATIC_UPDATER_DISABLED', TRUE );
257
  define( 'WP_AUTO_UPDATE_CORE', FALSE );
258
 
259
+ break;
260
 
261
+ /* Description: Remove WordPress version number from footer in dashboard. */
262
  case 'wpv' :
263
 
264
  add_filter( 'update_footer', '__return_empty_string', 11 );
265
 
266
+ break;
267
 
268
+ /* Description: Disable plugins individually. */
269
  case 'ip' :
270
 
271
  if ( defined( 'disable_updates_loaded' ) ) {
278
  add_filter( 'site_transient_update_plugins', array( __CLASS__, 'remove_plugin_update_notification' ) );
279
  add_filter( 'plugin_action_links', array( __CLASS__, 'plugin_block_action_link' ), 10, 4 );
280
 
281
+ /* Description: Remove plugins from being checked for updates at wordpress.org. */
282
  add_filter( 'http_request_args', array( __CLASS__, 'http_request_args_plugins_filter' ), 5, 2 );
283
 
284
+ break;
285
 
286
+ /* Description: Remove browser nag. */
287
  case 'bnag' :
288
 
289
  if ( ! function_exists( 'c2c_no_browser_nag' ) ) :
290
 
291
  function c2c_no_browser_nag() {
 
292
  $key = md5( $_SERVER['HTTP_USER_AGENT'] );
293
  add_filter( 'site_transient_browser_' . $key, '__return_null' );
294
  }
295
  endif;
296
  add_action( 'admin_init', 'c2c_no_browser_nag' );
297
 
298
+ break;
299
 
300
+ /* Description: Disable themes individually. */
301
  case 'it':
302
 
303
  add_filter( 'site_transient_update_themes', array( __CLASS__, 'remove_theme_update_notification' ) );
304
 
305
+ /* Description: Remove blocked themes from being checked for updates at wordpress.org. */
306
  add_filter( 'http_request_args', array( __CLASS__, 'http_request_args_themes_filter' ), 5, 2 );
307
 
308
+ break;
309
 
310
+ /* Description: Disable automatic background updates. */
311
  case 'abup' :
312
 
313
  wp_clear_scheduled_hook( 'wp_maybe_auto_update' );
314
 
315
+ break;
316
 
317
+ /* Description: Disables minor core updates in the Disable Updates Manager settings. */
 
 
 
 
318
  case 'minor-core-updates' :
319
 
320
+ /* TO BE ADDED */
321
 
322
+ break;
323
 
324
+ /* Description: Disables major core updates in the Disable Updates Manager settings. */
 
 
 
 
325
  case 'major-core-updates' :
326
 
327
+ /* TO BE ADDED */
328
 
329
+ break;
330
 
331
+ /* Description: Disables auto translation updates in the Disable Updates Manager settings. */
 
 
 
332
  case 'auto-translation-updates' :
333
 
334
  add_filter( 'auto_update_translation', '__return_false' );
335
 
336
+ break;
337
 
338
+ /* Description: Disables auto core e-mails in the Disable Updates Manager settings. */
 
 
 
339
  case 'auto-core-emails' :
340
 
341
  add_filter( 'auto_core_update_send_email', '__return_false' );
342
 
343
+ break;
344
 
345
  }
346
  }
352
  return;
353
  }
354
 
355
+ /* Description: See if there are actions to process. */
356
  if ( ! isset( $_GET[ 'disable_updates' ] ) || ! isset( $_GET[ '_wpnonce' ] ) ) {
357
  return;
358
  }
362
  }
363
 
364
  $blocked = get_option( 'disable_updates_blocked' );
 
365
 
 
 
 
 
 
366
  if ( isset( $_GET[ 'block' ] ) ) {
367
 
368
  $blocked[ $_GET[ 'block' ] ] = TRUE;
374
  }
375
 
376
  update_option( 'disable_updates_blocked', $blocked );
377
+
378
  }
379
 
380
  static function remove_plugin_update_notification( $plugins ) {
386
 
387
  $blocked = (array) get_option( 'disable_updates_blocked' );
388
 
 
 
 
 
 
 
 
 
 
 
389
  foreach ( $blocked as $filename => $plugin ) {
390
 
391
  if ( isset( $plugins->response[ $filename ] ) && $plugin == TRUE ) {
396
  }
397
 
398
  return $plugins;
399
+
400
  }
401
 
402
  static function remove_theme_update_notification( $themes ) {
437
  }
438
 
439
  return $themes;
440
+
441
  }
442
 
443
  static function last_checked() {
448
  'updates' => array(),
449
  'version_checked' => $wp_version,
450
  );
451
+
452
  }
453
 
454
+ /* Description: Disable WordPress core updates. */
455
  static function disable_core_updates() {
456
 
457
+ /* Description: 2.3 to 2.7. */
458
  add_action( 'init', create_function( '', 'remove_action( \'init\', \'wp_version_check\' );' ), 2 );
459
  add_filter( 'pre_option_update_core', '__return_null' );
460
 
461
+ /* Description: 2.8 to 3.0. */
462
  remove_action( 'wp_version_check', 'wp_version_check' );
463
  remove_action( 'admin_init', '_maybe_update_core' );
464
  add_filter( 'pre_transient_update_core', array( __CLASS__,'last_checked' ) );
465
 
466
+ /* Description: >3.0. */
467
  remove_action( 'load-update-core.php', 'wp_update_core' );
468
  add_filter( 'pre_site_transient_update_core', array( __CLASS__,'last_checked' ) );
469
 
470
+ /* Description: Hide update notices in admin dashboard. */
471
  add_action( 'admin_menu', create_function( '', 'remove_action( \'admin_notices\', \'update_nag\', 3 );' ) );
472
 
473
  wp_clear_scheduled_hook( 'wp_version_check' );
474
+
475
+ /* Description: Disable e-mails. */
476
  add_filter( 'auto_core_update_send_email', '__return_false' );
477
+
 
 
478
  }
479
 
480
+ /* Description: Disable plugin updates. */
481
  static function disable_plugin_updates() {
482
 
483
+ /* Description: 2.3 to 2.7. */
 
 
 
484
  add_filter( 'pre_option_update_plugins', '__return_null' );
485
 
486
+ /* Description: 2.8 to 3.0. */
487
  remove_action( 'load-plugins.php', 'wp_update_plugins' );
488
  remove_action( 'load-update.php', 'wp_update_plugins' );
489
  remove_action( 'admin_init', '_maybe_update_plugins' );
490
  remove_action( 'wp_update_plugins', 'wp_update_plugins' );
491
  add_filter( 'pre_transient_update_plugins', array( __CLASS__,'last_checked' ) );
492
 
493
+ /* Description: >3.0. */
494
  remove_action( 'load-update-core.php', 'wp_update_plugins' );
495
  add_filter( 'pre_site_transient_update_plugins', array( __CLASS__,'last_checked' ) );
496
 
497
  wp_clear_scheduled_hook( 'wp_update_plugins' );
498
+
 
 
 
 
 
 
499
  }
500
 
501
+ /* Description: Disable theme updates. */
502
  static function disable_theme_updates() {
503
+
504
+ /* Description: 2.3 to 2.7. */
505
+ add_filter( 'pre_option_update_themes', '__return_null' );
506
 
507
+ /* Description: 2.8 to 3.0. */
508
  remove_action( 'load-themes.php', 'wp_update_themes' );
509
  remove_action( 'load-update.php', 'wp_update_themes' );
510
  remove_action( 'admin_init', '_maybe_update_themes' );
511
  remove_action( 'wp_update_themes', 'wp_update_themes' );
512
  add_filter( 'pre_transient_update_themes', array( __CLASS__,'last_checked' ) );
513
 
514
+ /* Description: >3.0. */
515
  remove_action( 'load-update-core.php', 'wp_update_themes' );
516
  add_filter( 'pre_site_transient_update_themes', array( __CLASS__,'last_checked' ) );
517
 
518
  wp_clear_scheduled_hook( 'wp_update_themes' );
519
+
 
 
 
 
 
 
520
  }
521
 
522
  static function plugin_block_action_link( $actions, $plugin_file, $plugin_data, $context ) {
533
  }
534
 
535
  return $actions;
536
+
537
  }
538
 
539
  static function http_request_args_plugins_filter( $r, $url ) {
567
  $r['body']['plugins'] = json_encode( $plugins );
568
 
569
  return $r;
570
+
571
  }
572
 
573
  static function http_request_args_themes_filter( $r, $url ) {
613
  $r['body']['themes'] = json_encode( $themes );
614
 
615
  return $r;
616
+
617
  }
618
 
619
+ /* Description: Help tab. */
620
  static function help_tab() {
621
  global $test_help_page;
622
 
698
 
699
  <h3>This plugin is tested so there are no problems.</h3>
700
  <ul>
701
+ <li>Tested with WordPress 4.1.</li>
702
  <li>Tested with popular plugins to ensure that there are no conflicts.</li>
703
  <li>Tested with popular themes to ensure that there are no conflicts.</li>
704
  </ul>
706
 
707
  CONTENT6;
708
 
 
709
  $screen->add_help_tab(array(
710
  'id' => 'help_tab_content_1',
711
  'title' => __('Overview'),
736
  'content' => $content3,
737
  ));
738
 
739
+ $screen->set_help_sidebar($content5);
740
 
741
  }
742
 
745
  ?>
746
  <div>
747
  <p>
748
+ <div class="showonhover">
749
+ <label for="all_notify">
750
+ <input
751
+ type="checkbox" <?php checked( 1, ( isset( $status['all'] ) ? (int) $status['all'] : 0 ), TRUE ); ?>
752
+ value="1" id="all_notify"
753
+ name="_disable_updates[all]"> <?php _e( 'Disable All Updates', 'disable-updates-manager' ) ?>
754
+ </label>
755
+ <span>
756
+ <a href="#" class="viewdescription">?</a>
757
+ <span class="hovertext">Disables core, theme, and plugin updates.</span>
758
+ </span>
759
+ </div>
760
  </p>
761
  </div>
762
 
763
  <div style="padding-left: 12px;">
764
  <p>
765
+ <div>
766
+ <label for="plugins_notify">
767
+ <input type="checkbox" <?php checked( 1, ( isset( $status['plugin'] ) && ! isset( $status['all'] ) ? (int) $status['plugin'] : 0 ), TRUE ); ?>
768
+ value="1" id="plugins_notify"
769
+ name="_disable_updates[plugin]"
770
+ <?php disabled( 1, ( isset( $status['all'] ) ? (int) $status['all'] : 0 ) ) ?>> <?php _e( 'Disable All Plugin Updates', 'disable-updates-manager' ) ?>
771
+ </label>
772
+ </div>
773
+ <br>
774
+ <div>
775
+ <label for="themes_notify">
776
+ <input type="checkbox" <?php checked( 1, ( isset( $status['theme'] ) && ! isset( $status['all'] ) ? (int) $status['theme'] : 0 ), TRUE ); ?>
777
+ value="1" id="themes_notify"
778
+ name="_disable_updates[theme]"
779
+ <?php disabled( 1, ( isset( $status['all'] ) ? (int) $status['all'] : 0 ) ) ?>> <?php _e( 'Disable All Theme Updates', 'disable-updates-manager' ) ?>
780
+ </label>
781
+ </div>
782
+ <br>
783
+ <div>
784
+ <label for="core_notify">
785
+ <input type="checkbox" <?php checked( 1, ( isset( $status['core'] ) && ! isset( $status['all'] ) ? (int) $status['core'] : 0 ), TRUE ); ?>
786
+ value="1" id="core_notify"
787
+ name="_disable_updates[core]"
788
+ <?php disabled( 1, ( isset( $status['all'] ) ? (int) $status['all'] : 0 ) ) ?>> <?php _e( 'Disable All WordPress Core Update', 'disable-updates-manager' ) ?>
789
+ </label>
790
+ </div>
791
+ <div style="padding-left:20px;">
792
+ <br>
793
+ <small>Disable major and minor core feature coming soon...<small>
794
+ </div>
795
+ </p>
796
  </div>
 
797
  <?php
798
+
799
  }
800
 
801
  static function metabox_other( $status ) {
803
  ?>
804
  <div>
805
  <p>
806
+ <div class="showonhover">
807
+ <label for="page_notify">
808
+ <input
809
+ type="checkbox" <?php checked( 1, ( isset( $status['page'] ) ? (int) $status['page'] : 0 ), TRUE ); ?>
810
+ value="1" id="page_notify"
811
+ name="_disable_updates[page]"> <?php _e( 'Remove the Updates Page', 'disable-updates-manager' ) ?>
812
+ </label>
813
+ <span>
814
+ <a href="#" class="viewdescription">?</a></a>
815
+ <span class="hovertext">The page under the Dashboard tab.</span>
816
+ </span>
817
+ </div>
818
+ <br>
819
+ <div class="showonhover">
820
+ <label for="bnag_notify">
821
+ <input type="checkbox" <?php checked( 1, ( isset( $status['bnag'] ) ? (int) $status['bnag'] : 0 ), TRUE ); ?>
822
+ value="1" id="bnag_notify"
823
+ name="_disable_updates[bnag]"> <?php _e( 'Disable Out of Date Browser Nag', 'disable-updates-manager' ) ?>
824
+ </label>
825
+ <span>
826
+ <a href="#" class="viewdescription">?</a>
827
+ <span class="hovertext">Removes the browsers is out of date notification in you WordPress dashboard.</span>
828
+ </span>
829
+ </div>
830
+ <br>
831
+ <div class="showonhover">
832
+ <label for="wpv_notify">
833
+ <input
834
+ type="checkbox" <?php checked( 1, ( isset( $status['wpv'] ) ? (int) $status['wpv'] : 0 ), TRUE ); ?>
835
+ value="1" id="wpv_notify"
836
+ name="_disable_updates[wpv]"> <?php _e( 'Disable WordPress Core Version from Footer', 'disable-updates-manager' ) ?>
837
+ </label>
838
+ <span>
839
+ <a href="#" class="viewdescription">?</a>
840
+ <span class="hovertext">Removes it for all users.</span>
841
+ </span>
842
+ </div>
843
+ <br>
844
+ <div class="showonhover">
845
+ <label for="auto-translation-updates_notify">
846
+ <input type="checkbox" <?php checked( 1, ( isset( $status['auto-translation-updates'] ) ? (int) $status['auto-translation-updates'] : 0 ), TRUE ); ?>
847
+ value="1" id="auto-translation-updates_notify"
848
+ name="_disable_updates[auto-translation-updates]"> <?php _e( 'Disable Automatic Translation Updates', 'disable-updates-manager' ) ?>
849
+ </label>
850
+ <span>
851
+ <a href="#" class="viewdescription">?</a>
852
+ <span class="hovertext">Disables the automatic translation updates for you.</span>
853
+ </span>
854
+ </div>
855
+ <br>
856
+ <div class="showonhover">
857
+ <label for="auto-core-emails_notify">
858
+ <input
859
+ type="checkbox" <?php checked( 1, ( isset( $status['auto-core-emails'] ) ? (int) $status['auto-core-emails'] : 0 ), TRUE ); ?>
860
+ value="1" id="auto-core-emails_notify"
861
+ name="_disable_updates[auto-core-emails]"> <?php _e( 'Disable Core Update E-mails', 'disable-updates-manager' ) ?>
862
+ </label>
863
+ <span>
864
+ <a href="#" class="viewdescription">?</a>
865
+ <span class="hovertext">Disables the core update e-mails so that they will not be sent to you.</span>
866
+ </span>
867
+ </div>
868
+ <br>
869
+ <div>
870
+ <label for="abup_notify">
871
+ <input type="checkbox" <?php checked( 1, ( isset( $status['abup'] ) ? (int) $status['abup'] : 0 ), TRUE ); ?>
872
+ value="1" id="abup_notify"
873
+ name="_disable_updates[abup]"> <?php _e( 'Disable Automatic Background Updates', 'disable-updates-manager' ) ?>
874
+ </label>
875
+ </div>
876
  </p>
 
877
  </div>
 
878
  <?php
879
+
880
  }
881
 
882
  static function metabox_themes( $status ) {
884
  ?>
885
  <div>
886
  <p>
887
+ <div class="showonhover">
888
+ <label for="dum-disable-themes">
889
+ <input type="checkbox" <?php checked( 1, ( isset( $status['it'] ) && ! isset( $status['all'] ) ? (int) $status['it'] : 0 ), TRUE ); ?>
890
+ id="dum-disable-themes"
891
+ value="1"
892
+ name="_disable_updates[it]"
893
+ <?php disabled( 1, ( isset( $status['all'] ) ? (int) $status['all'] : 0 ) ) ?>> <?php _e( 'Disable Themes Individually', 'disable-updates-manager' ) ?>
894
+ </label>
895
+ <span>
896
+ <a href="#" class="viewdescription">?</a>
897
+ <span class="hovertext">Enabling this option will show the list of themes to disable updates.</span>
898
+ </span>
899
+ </div>
900
  </p>
 
901
  </div>
902
  <?php
903
 
907
 
908
  echo '<select class="dum-enhanced-select" id="dum-disable-themes-select" name="_disable_updates[themes][]" data-placeholder="' . __( 'Select theme(s) to disable...', 'disable-updates-manager' ) . '" multiple' . ( isset( $status['it'] ) && ! isset( $status['all'] ) ? '' : ' disabled' ) . '>';
909
 
910
+ echo '<option value=""></option>';
911
 
912
+ foreach ( $themes as $slug => $theme ) {
913
 
914
+ printf( '<option value="%1$s"%2$s>%3$s</option>',
915
+ esc_attr( $slug ),
916
+ ! isset( $status['all'] ) && isset( $status['it'] ) && isset( $status['themes'] ) && in_array( $slug, $status['themes'] ) ? ' SELECTED' : '',
917
+ esc_html( $theme->name )
918
+ );
919
+ }
920
 
921
  echo '</select>';
922
  }
926
  static function metabox_plugins( $status ) {
927
 
928
  ?>
929
+ <div>
930
  <p>
931
+ <div class="showonhover">
932
+ <label for="dum-disable-plugins">
933
+ <input type="checkbox" <?php checked( 1, ( isset( $status['ip'] ) && ! isset( $status['all'] ) ? (int) $status['ip'] : 0 ), TRUE ); ?>
934
+ id="dum-disable-plugins"
935
+ value="1"
936
+ name="_disable_updates[ip]"
937
+ <?php disabled( 1, ( isset( $status['all'] ) ? (int) $status['all'] : 0 ) ) ?>> <?php _e( 'Disable Plugins Individually', 'disable-updates-manager' ) ?>
938
+ </label>
939
+ <span>
940
+ <a href="#" class="viewdescription">?</a>
941
+ <span class="hovertext">Enabling this option will show the list of plugins to disable updates.</span>
942
+ </span>
943
+ </div>
944
  </p>
945
  </div>
 
946
  <?php
947
 
948
  $plugins = get_plugins();
952
 
953
  echo '<select class="dum-enhanced-select" id="dum-disable-plugins-select" name="_disable_updates[plugins][]" data-placeholder="' . __( 'Select plugin(s) to disable...', 'disable-updates-manager' ) . '" multiple' . ( isset( $status['ip'] ) && ! isset( $status['all'] ) ? '' : ' disabled' ) . '>';
954
 
955
+ echo '<option value=""></option>';
956
 
957
+ foreach ( $plugins as $slug => $plugin ) {
958
 
959
+ printf( '<option value="%1$s"%2$s>%3$s</option>',
960
+ esc_attr( $slug ),
961
+ ! isset( $status['all'] ) && isset( $status['ip'] ) && array_key_exists( $slug, (array) $blocked ) ? ' SELECTED' : '',
962
+ esc_attr( $plugin['Name'] )
963
+ );
964
+ }
965
 
966
  echo '</select>';
967
  }
968
 
969
  }
970
 
 
971
  static function display_page() {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
972
  ?>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
973
 
974
+ <h2><?php _e( 'Disable Updates Manager', 'disable-updates-manager' ); ?></h2>
975
+
976
+ <?php
977
+
978
+ if ( !current_user_can('manage_options') ) {
979
+ wp_die('You do not have sufficient permissions to access this page.');
980
+ }
981
+
982
+ if ( current_user_can('manage_options') ) {
983
+
984
+ $status = get_option( '_disable_updates' );
985
+
986
+ ?>
987
+ <div class="dashboard-widgets-wrap">
988
+
989
+ <div id="dashboard-widgets" class="metabox-holder columns-<?php echo 1 == get_current_screen()->get_columns() ? '1' : '2'; ?>">
990
+
991
+ <form name="dum-options" method="post" action="options.php">
992
+ <input type="hidden" name="action" value="dum-update-options">
993
+ <?php wp_nonce_field( 'dum-update-options-nonce' );
994
+
995
+ /* Description: Used to save closed metaboxes and their order */
996
+ wp_nonce_field( 'meta-box-order', 'meta-box-order-nonce', FALSE );
997
+ wp_nonce_field( 'closedpostboxes', 'closedpostboxesnonce', FALSE ); ?>
998
+
999
+ <div class="postbox-container">
1000
+ <?php do_meta_boxes( self::$page_hook, 'left', $status ); ?>
1001
+ </div>
1002
+
1003
+ <div class="postbox-container">
1004
+ <?php do_meta_boxes( self::$page_hook, 'right', $status ); ?>
1005
+ </div>
1006
+
1007
+ <?php settings_fields( '_disable_updates' ); ?>
1008
+
1009
+ <p class="submit clear">
1010
+ <input type="submit" class="button-primary" value="<?php _e( 'Update Settings' ) ?>"/>
1011
+ <a href="https://wordpress.org/support/view/plugin-reviews/stops-core-theme-and-plugin-updates?#postform" style="background-color:#ffff7f" class="button">Rate Plugin</a>
1012
+ <a href="http://sparrowkids2.polldaddy.com/s/disable-updates-manager-feedbeck" class="button">Feedback Survey</a>
1013
+ </p>
1014
+
1015
+ </form>
1016
+
1017
+ </div>
1018
+
1019
+ </div>
1020
+ <?php
1021
+ }
1022
  }
1023
  }
1024
 
 
 
1025
  global $Disable_Updates;
1026
  $Disable_Updates = new Disable_Updates();
1027
 
readme.txt CHANGED
@@ -1,8 +1,8 @@
1
  === Disable Updates Manager ===
2
  Contributors: MPS Plugins, kidsguide, shazahm1@hotmail.com, szepe.viktor
3
  Tags: Disable All Updates, Disable Plugin Updates, Disable Theme Updates, Disable WordPress Core Updates, Disable Core Updates, Disable Updates Settings, Disable Updates, Disable All WordPress Updates, Disable All WordPress Updates Settings, Disable Updates Manager, Disable All Updates Manager, Disable Updates Manager Settings, Update Check, No Browser Nag, MPS Plugins, Manager, Disable, Updates
4
- Requires at least: 3.0
5
- Tested up to: 4.0.1 and 4.1beta1
6
  Stable tag: trunk
7
 
8
  A configurable plugin that disables updates for you. Easy, clean and helpful + Great Support.
@@ -11,21 +11,23 @@ A configurable plugin that disables updates for you. Easy, clean and helpful + G
11
  This plugin is configurable! Check the type of update(s) you would like to disable in the settings page along with other helpful settings. Watch the video tutorial below for more information.
12
 
13
  = Features Include =
14
- <ol>
15
- <li>Disables plugins and themes individually.</li>
16
- <li>Disables WordPress core updates.</li>
17
- <li>Disable automatic background updates.</li>
18
- <li>And lots of other settings.</li>
19
- </ol>
20
 
21
  = Blog =
22
  <a href="http://www.mpswp.wordpress.com">Check our blog for more information about Disable Updates Manager</a>.
23
 
 
 
 
24
  = There are several ways you can get involved to help make Disable Updates Manager better =
25
  <ol>
26
- <li>Report Bugs: If you find a bug, error or other problem, please report it on <a href="https://github.com/Websiteguy/disable-updates-manager/issues/new">GitHub</a> or in the <a href="https://wordpress.org/support/plugin/stops-core-theme-and-plugin-updates">WordPress Support Forum</a>!</li>
27
- <li>Suggest New Features: Have an awesome new feature that you would like to be added? Please share it on <a href="https://github.com/Websiteguy/disable-updates-manager/issues/new">GitHub</a> or the <a href="https://wordpress.org/support/plugin/stops-core-theme-and-plugin-updates">WordPress Support Forum</a>!</li>
28
- <li>Issue Pull Requests: The easiest way to get involved is to help out on issues already reported in <a href="https://github.com/Websiteguy/disable-updates-manager/compare">GitHub</a> or the <a href="https://wordpress.org/support/plugin/stops-core-theme-and-plugin-updates">WordPress Support Forum</a>.</li>
29
  </ol>
30
 
31
  = Video Tutorials =
@@ -42,6 +44,13 @@ This plugin is configurable! Check the type of update(s) you would like to disab
42
  5. Screen Options
43
  6. Help Tab
44
 
 
 
 
 
 
 
 
45
  == Installation ==
46
  <strong>Installing Disable Updates Manager</strong>
47
 
@@ -52,6 +61,20 @@ This plugin is configurable! Check the type of update(s) you would like to disab
52
  3. Click on the configure button next to the plugin or go to the plugin settings page under the settings section in your dashboard.
53
 
54
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
55
  = 4.6.0 =
56
  * Removed unknown character to fix debug error.
57
  * Updated screenshots.
1
  === Disable Updates Manager ===
2
  Contributors: MPS Plugins, kidsguide, shazahm1@hotmail.com, szepe.viktor
3
  Tags: Disable All Updates, Disable Plugin Updates, Disable Theme Updates, Disable WordPress Core Updates, Disable Core Updates, Disable Updates Settings, Disable Updates, Disable All WordPress Updates, Disable All WordPress Updates Settings, Disable Updates Manager, Disable All Updates Manager, Disable Updates Manager Settings, Update Check, No Browser Nag, MPS Plugins, Manager, Disable, Updates
4
+ Requires at least: 2.3
5
+ Tested up to: 4.1
6
  Stable tag: trunk
7
 
8
  A configurable plugin that disables updates for you. Easy, clean and helpful + Great Support.
11
  This plugin is configurable! Check the type of update(s) you would like to disable in the settings page along with other helpful settings. Watch the video tutorial below for more information.
12
 
13
  = Features Include =
14
+ <ul>
15
+ <ol>Disable Update Manager is the first plugin to offer a feature to both disable plugins and themes individually.</ol>
16
+ <ol>Disable Updates Manager makes disabling all core, theme, and/or plugin updates easy. Just check the checkboxes and save the settings.</ol>
17
+ <ol>Disable Updates Manager includes lots of other settings to disable background updates and lots of other things.</ol>
18
+ </ul>
 
19
 
20
  = Blog =
21
  <a href="http://www.mpswp.wordpress.com">Check our blog for more information about Disable Updates Manager</a>.
22
 
23
+ = Survey =
24
+ Take the feedback survey to give your feedback on this plugin. <a href="http://sparrowkids2.polldaddy.com/s/disable-updates-manager-feedbeck">http://sparrowkids2.polldaddy.com/s/disable-updates-manager-feedbeck</a>
25
+
26
  = There are several ways you can get involved to help make Disable Updates Manager better =
27
  <ol>
28
+ <li>=Report Bugs:= If you find a bug, error or other problem, please report it on <a href="https://github.com/Websiteguy/disable-updates-manager/issues/new">GitHub</a> or in the <a href="https://wordpress.org/support/plugin/stops-core-theme-and-plugin-updates">WordPress Support Forum</a>!</li>
29
+ <li>=Suggest New Features:= Have an awesome new feature that you would like to be added? Please share it on <a href="https://github.com/Websiteguy/disable-updates-manager/issues/new">GitHub</a> or the <a href="https://wordpress.org/support/plugin/stops-core-theme-and-plugin-updates">WordPress Support Forum</a>!</li>
30
+ <li>=Reply to Support:= The easiest way to get involved is to help out on issues already reported in <a href="https://github.com/Websiteguy/disable-updates-manager/compare">GitHub</a> or the <a href="https://wordpress.org/support/plugin/stops-core-theme-and-plugin-updates">WordPress Support Forum</a>.</li>
31
  </ol>
32
 
33
  = Video Tutorials =
44
  5. Screen Options
45
  6. Help Tab
46
 
47
+ == FAQ ==
48
+ <strong>Q: What is a safe way to update the WordPress Core if I ever need to?</strong>
49
+ A: Check out this post on our blog. http://mpswp.wordpress.com/2014/11/26/great-steps-to-follow-before-updating-your-wordpress-core/
50
+
51
+ <strong>Q: If I have an automatic plugin updating plugin installed at the same time as disabling plugin updates, what will happen?</strong>
52
+ A: Disable Updates Manager disables the parts of the update system depending on which settings update have checked. If you have the Disable All Plugin Updates setting checked at the same time as having a automatic plugin update plugin installed, then Disable Updates Manager overrides it to disable updates no matter what.
53
+
54
  == Installation ==
55
  <strong>Installing Disable Updates Manager</strong>
56
 
61
  3. Click on the configure button next to the plugin or go to the plugin settings page under the settings section in your dashboard.
62
 
63
  == Changelog ==
64
+ = <a href="https://github.com/Websiteguy/disable-updates-manager/pull/37">4.7.0</a> =
65
+ * Slight change in metabox order. https://github.com/Websiteguy/disable-updates-manager/issues/47
66
+ * Change description in the readme.txt. https://github.com/Websiteguy/disable-updates-manager/issues/41
67
+ * Works with WordPress Version 4.1. https://github.com/Websiteguy/disable-updates-manager/issues/35 , https://github.com/Websiteguy/disable-updates-manager/issues/38
68
+ * Added back the FAQ in the readme.txt. https://github.com/Websiteguy/disable-updates-manager/issues/45
69
+ * Fixed small typo in license.txt. https://github.com/Websiteguy/disable-updates-manager/issues/46
70
+ * Redid translation files. https://github.com/Websiteguy/disable-updates-manager/issues/40
71
+ * Remove home submenu when removing update submenu. https://github.com/Websiteguy/disable-updates-manager/issues/42
72
+ * Changed some stuff in the help tab. https://github.com/Websiteguy/disable-updates-manager/issues/43
73
+ * Combine video tutorials into one. https://github.com/Websiteguy/disable-updates-manager/issues/39
74
+ * Added proper file spacing in all files. https://github.com/Websiteguy/disable-updates-manager/issues/44
75
+ * Added proper file notes. https://github.com/Websiteguy/disable-updates-manager/issues/48
76
+ * Add 2.3 to 2.7 disable updates to themes. https://github.com/Websiteguy/disable-updates-manager/issues/50
77
+
78
  = 4.6.0 =
79
  * Removed unknown character to fix debug error.
80
  * Updated screenshots.
uninstall.php CHANGED
@@ -1,9 +1,7 @@
1
  <?php
2
 
3
- // Code to remove files. No data will be left behind!
4
- if ( !defined( 'WP_UNINSTALL_PLUGIN' ) ) {
5
  exit ();
6
  }
7
-
8
- // it was defined, now delete
9
  delete_option('_disable_updates');
1
  <?php
2
 
3
+ /* Description: Removes all data when deleted. */
4
+ if (!defined( 'WP_UNINSTALL_PLUGIN' )) {
5
  exit ();
6
  }
 
 
7
  delete_option('_disable_updates');