Version Description
Released 2016-08-21
- Bug fix: options setting on plugins screen disappeared
Download this release
Release Info
Developer | ronalfy |
Plugin | Easy Updates Manager |
Version | 6.2.3 |
Comparing to | |
See all releases |
Code changes from version 6.2.0 to 6.2.3
- easy-updates-manager.php +0 -383
- includes/MPSUM_Admin.php +1 -1
- includes/MPSUM_Admin_Core.php +32 -32
- includes/MPSUM_Logs.php +11 -10
- main.php +384 -2
- readme.txt +22 -4
easy-updates-manager.php
DELETED
@@ -1,383 +0,0 @@
|
|
1 |
-
<?php
|
2 |
-
/**
|
3 |
-
* Main plugin class
|
4 |
-
*
|
5 |
-
* Initializes auto-loader, internationalization, and plugin dependencies.
|
6 |
-
*
|
7 |
-
* @since 5.0.0
|
8 |
-
*
|
9 |
-
* @package WordPress
|
10 |
-
*/
|
11 |
-
class MPSUM_Updates_Manager {
|
12 |
-
|
13 |
-
/**
|
14 |
-
* Holds the class instance.
|
15 |
-
*
|
16 |
-
* @since 5.0.0
|
17 |
-
* @access static
|
18 |
-
* @var MPSUM_Updates_Manager $instance
|
19 |
-
*/
|
20 |
-
private static $instance = null;
|
21 |
-
|
22 |
-
/**
|
23 |
-
* Stores the plugin's options
|
24 |
-
*
|
25 |
-
* @since 5.0.0
|
26 |
-
* @access static
|
27 |
-
* @var array $options
|
28 |
-
*/
|
29 |
-
private static $options = false;
|
30 |
-
|
31 |
-
/**
|
32 |
-
* Retrieve a class instance.
|
33 |
-
*
|
34 |
-
* Retrieve a class instance.
|
35 |
-
*
|
36 |
-
* @since 5.0.0
|
37 |
-
* @access static
|
38 |
-
*
|
39 |
-
* @return MPSUM_Updates_Manager Instance of the class.
|
40 |
-
*/
|
41 |
-
public static function get_instance() {
|
42 |
-
if ( null == self::$instance ) {
|
43 |
-
self::$instance = new self;
|
44 |
-
}
|
45 |
-
return self::$instance;
|
46 |
-
} //end get_instance
|
47 |
-
|
48 |
-
/**
|
49 |
-
* Retrieve the plugin basename.
|
50 |
-
*
|
51 |
-
* Retrieve the plugin basename.
|
52 |
-
*
|
53 |
-
* @since 5.0.0
|
54 |
-
* @access static
|
55 |
-
*
|
56 |
-
* @return string plugin basename
|
57 |
-
*/
|
58 |
-
public static function get_plugin_basename() {
|
59 |
-
return plugin_basename( __FILE__ );
|
60 |
-
}
|
61 |
-
|
62 |
-
/**
|
63 |
-
* Class constructor.
|
64 |
-
*
|
65 |
-
* Set up internationalization, auto-loader, and plugin initialization.
|
66 |
-
*
|
67 |
-
* @since 5.0.0
|
68 |
-
* @access private
|
69 |
-
*
|
70 |
-
*/
|
71 |
-
private function __construct() {
|
72 |
-
/* Localization Code */
|
73 |
-
load_plugin_textdomain( 'stops-core-theme-and-plugin-updates', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
74 |
-
|
75 |
-
spl_autoload_register( array( $this, 'loader' ) );
|
76 |
-
|
77 |
-
add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );
|
78 |
-
} //end constructor
|
79 |
-
|
80 |
-
/**
|
81 |
-
* Return the absolute path to an asset.
|
82 |
-
*
|
83 |
-
* Return the absolute path to an asset based on a relative argument.
|
84 |
-
*
|
85 |
-
* @since 5.0.0
|
86 |
-
* @access static
|
87 |
-
*
|
88 |
-
* @param string $path Relative path to the asset.
|
89 |
-
* @return string Absolute path to the relative asset.
|
90 |
-
*/
|
91 |
-
public static function get_plugin_dir( $path = '' ) {
|
92 |
-
$dir = rtrim( plugin_dir_path(__FILE__), '/' );
|
93 |
-
if ( !empty( $path ) && is_string( $path) )
|
94 |
-
$dir .= '/' . ltrim( $path, '/' );
|
95 |
-
return $dir;
|
96 |
-
}
|
97 |
-
|
98 |
-
/**
|
99 |
-
* Return the web path to an asset.
|
100 |
-
*
|
101 |
-
* Return the web path to an asset based on a relative argument.
|
102 |
-
*
|
103 |
-
* @since 5.0.0
|
104 |
-
* @access static
|
105 |
-
*
|
106 |
-
* @param string $path Relative path to the asset.
|
107 |
-
* @return string Web path to the relative asset.
|
108 |
-
*/
|
109 |
-
public static function get_plugin_url( $path = '' ) {
|
110 |
-
$dir = rtrim( plugin_dir_url(__FILE__), '/' );
|
111 |
-
if ( !empty( $path ) && is_string( $path) )
|
112 |
-
$dir .= '/' . ltrim( $path, '/' );
|
113 |
-
return $dir;
|
114 |
-
}
|
115 |
-
|
116 |
-
/**
|
117 |
-
* Retrieve the plugin's options
|
118 |
-
*
|
119 |
-
* Retrieve the plugin's options based on context
|
120 |
-
*
|
121 |
-
* @since 5.0.0
|
122 |
-
* @access static
|
123 |
-
*
|
124 |
-
* @param string $context Context to retrieve options for. This is used as an array key.
|
125 |
-
* @param bool $force_reload Whether to retrieve cached options or forcefully retrieve from the database.
|
126 |
-
* @return array All options if no context, or associative array if context is set. Empty array if no options.
|
127 |
-
*/
|
128 |
-
public static function get_options( $context = '', $force_reload = false ) {
|
129 |
-
//Try to get cached options
|
130 |
-
$options = self::$options;
|
131 |
-
if ( false === $options || true === $force_reload ) {
|
132 |
-
$options = get_site_option( 'MPSUM', false, false );
|
133 |
-
}
|
134 |
-
|
135 |
-
if ( false === $options ) {
|
136 |
-
$options = self::maybe_migrate_options();
|
137 |
-
}
|
138 |
-
|
139 |
-
//Store options
|
140 |
-
if ( !is_array( $options ) ) {
|
141 |
-
$options = array();
|
142 |
-
}
|
143 |
-
self::$options = $options;
|
144 |
-
|
145 |
-
//Attempt to get context
|
146 |
-
if ( !empty( $context ) && is_string( $context ) ) {
|
147 |
-
if ( array_key_exists( $context, $options ) ) {
|
148 |
-
return (array)$options[ $context ];
|
149 |
-
} else {
|
150 |
-
return array();
|
151 |
-
}
|
152 |
-
}
|
153 |
-
|
154 |
-
|
155 |
-
return $options;
|
156 |
-
} //get_options
|
157 |
-
|
158 |
-
/**
|
159 |
-
* Auto-loads classes.
|
160 |
-
*
|
161 |
-
* Auto-load classes that belong to this plugin.
|
162 |
-
*
|
163 |
-
* @since 5.0.0
|
164 |
-
* @access private
|
165 |
-
*
|
166 |
-
* @param string $class_name The name of the class.
|
167 |
-
*/
|
168 |
-
private function loader( $class_name ) {
|
169 |
-
if ( class_exists( $class_name, false ) || false === strpos( $class_name, 'MPSUM' ) ) {
|
170 |
-
return;
|
171 |
-
}
|
172 |
-
$file = MPSUM_Updates_Manager::get_plugin_dir( "includes/{$class_name}.php" );
|
173 |
-
if ( file_exists( $file ) ) {
|
174 |
-
include_once( $file );
|
175 |
-
}
|
176 |
-
}
|
177 |
-
|
178 |
-
/**
|
179 |
-
* Determine whether to migrate options from an older version of the plugin.
|
180 |
-
*
|
181 |
-
* Migrate old options to new plugin format.
|
182 |
-
*
|
183 |
-
* @since 5.0.0
|
184 |
-
* @access private
|
185 |
-
*
|
186 |
-
* @return bool|array false if no migration, associative array of options if migration successful
|
187 |
-
*/
|
188 |
-
public static function maybe_migrate_options() {
|
189 |
-
$options = false;
|
190 |
-
$original_options = get_option( '_disable_updates', false );
|
191 |
-
|
192 |
-
if ( false !== $original_options && is_array( $original_options ) ) {
|
193 |
-
$options = array(
|
194 |
-
'core' => array(),
|
195 |
-
'plugins' => array(),
|
196 |
-
'themes' => array()
|
197 |
-
);
|
198 |
-
//Global WP Updates
|
199 |
-
if ( isset( $original_options[ 'all' ] ) && "1" === $original_options[ 'all' ] ) {
|
200 |
-
$options[ 'core' ][ 'all_updates' ] = 'off';
|
201 |
-
}
|
202 |
-
//Global Plugin Updates
|
203 |
-
if ( isset( $original_options[ 'plugin' ] ) && "1" === $original_options[ 'plugin' ] ) {
|
204 |
-
$options[ 'core' ][ 'plugin_updates' ] = 'off';
|
205 |
-
}
|
206 |
-
//Global Theme Updates
|
207 |
-
if ( isset( $original_options[ 'theme' ] ) && "1" === $original_options[ 'theme' ] ) {
|
208 |
-
$options[ 'core' ][ 'theme_updates' ] = 'off';
|
209 |
-
}
|
210 |
-
//Global Core Updates
|
211 |
-
if ( isset( $original_options[ 'core' ] ) && "1" === $original_options[ 'core' ] ) {
|
212 |
-
$options[ 'core' ][ 'core_updates' ] = 'off';
|
213 |
-
}
|
214 |
-
//Global Individual Theme Updates
|
215 |
-
if ( isset( $original_options[ 'it' ] ) && "1" === $original_options[ 'it' ] ) {
|
216 |
-
if ( isset( $original_options[ 'themes' ] ) && is_array( $original_options[ 'themes' ] ) ) {
|
217 |
-
$options[ 'themes' ] = $original_options[ 'themes' ];
|
218 |
-
}
|
219 |
-
}
|
220 |
-
//Global Individual Plugin Updates
|
221 |
-
if ( isset( $original_options[ 'ip' ] ) && "1" === $original_options[ 'ip' ] ) {
|
222 |
-
if ( isset( $original_options[ 'plugins' ] ) && is_array( $original_options[ 'plugins' ] ) ) {
|
223 |
-
$options[ 'plugins' ] = $original_options[ 'plugins' ];
|
224 |
-
}
|
225 |
-
}
|
226 |
-
//Browser Nag
|
227 |
-
if ( isset( $original_options[ 'bnag' ] ) && "1" === $original_options[ 'bnag' ] ) {
|
228 |
-
$options[ 'core' ][ 'misc_browser_nag' ] = 'off';
|
229 |
-
}
|
230 |
-
//WordPress Version
|
231 |
-
if ( isset( $original_options[ 'wpv' ] ) && "1" === $original_options[ 'wpv' ] ) {
|
232 |
-
$options[ 'core' ][ 'misc_wp_footer' ] = 'off';
|
233 |
-
}
|
234 |
-
//Translation Updates
|
235 |
-
if ( isset( $original_options[ 'auto-translation-updates' ] ) && "1" === $original_options[ 'auto-translation-updates' ] ) {
|
236 |
-
$options[ 'core' ][ 'automatic_translation_updates' ] = 'off';
|
237 |
-
}
|
238 |
-
//Translation Updates
|
239 |
-
if ( isset( $original_options[ 'auto-core-emails' ] ) && "1" === $original_options[ 'auto-core-emails' ] ) {
|
240 |
-
$options[ 'core' ][ 'notification_core_update_emails' ] = 'off';
|
241 |
-
}
|
242 |
-
//Automatic Updates
|
243 |
-
if ( isset( $original_options[ 'abup' ] ) && "1" === $original_options[ 'abup' ] ) {
|
244 |
-
$options[ 'core' ][ 'automatic_major_updates' ] = 'off';
|
245 |
-
$options[ 'core' ][ 'automatic_minor_updates' ] = 'off';
|
246 |
-
$options[ 'core' ][ 'automatic_plugin_updates' ] = 'off';
|
247 |
-
$options[ 'core' ][ 'automatic_theme_updates' ] = 'off';
|
248 |
-
}
|
249 |
-
|
250 |
-
delete_option( '_disable_updates' );
|
251 |
-
delete_site_option( '_disable_updates' );
|
252 |
-
update_site_option( 'MPSUM', $options );
|
253 |
-
|
254 |
-
}
|
255 |
-
return $options;
|
256 |
-
}
|
257 |
-
|
258 |
-
/**
|
259 |
-
* Initialize the plugin and its dependencies.
|
260 |
-
*
|
261 |
-
* Initialize the plugin and its dependencies.
|
262 |
-
*
|
263 |
-
* @since 5.0.0
|
264 |
-
* @access public
|
265 |
-
* @see __construct
|
266 |
-
* @internal Uses plugins_loaded action
|
267 |
-
*
|
268 |
-
*/
|
269 |
-
public function plugins_loaded() {
|
270 |
-
//Skip disable updates if a user is excluded
|
271 |
-
$disable_updates_skip = false;
|
272 |
-
if ( current_user_can( 'install_plugins' ) ) {
|
273 |
-
$current_user = wp_get_current_user();
|
274 |
-
$current_user_id = $current_user->ID;
|
275 |
-
$excluded_users = MPSUM_Updates_Manager::get_options( 'excluded_users' );
|
276 |
-
if ( in_array( $current_user_id, $excluded_users ) ) {
|
277 |
-
$disable_updates_skip = true;
|
278 |
-
}
|
279 |
-
}
|
280 |
-
if ( false === $disable_updates_skip ) {
|
281 |
-
MPSUM_Disable_Updates::run();
|
282 |
-
}
|
283 |
-
|
284 |
-
// Logging
|
285 |
-
$options = MPSUM_Updates_Manager::get_options( 'core' );
|
286 |
-
if ( isset( $options[ 'logs' ] ) && 'on' == $options[ 'logs' ] ) {
|
287 |
-
MPSUM_Logs::run();
|
288 |
-
}
|
289 |
-
|
290 |
-
add_action( 'wp_ajax_mpsum_ajax_action', array( $this, 'ajax_update_option' ) );
|
291 |
-
|
292 |
-
|
293 |
-
$not_doing_ajax = ( !defined( 'DOING_AJAX' ) || !DOING_AJAX );
|
294 |
-
$not_admin_disabled = ( !defined( 'MPSUM_DISABLE_ADMIN' ) || !MPSUM_DISABLE_ADMIN );
|
295 |
-
if ( is_admin() && $not_doing_ajax && $not_admin_disabled ) {
|
296 |
-
MPSUM_Admin::run();
|
297 |
-
}
|
298 |
-
}
|
299 |
-
|
300 |
-
public function ajax_update_option() {
|
301 |
-
if ( !wp_verify_nonce( $_POST[ '_ajax_nonce' ], 'mpsum_options_save' ) ) {
|
302 |
-
die( 'Cheating, huh' );
|
303 |
-
}
|
304 |
-
if ( !isset( $_POST[ 'context' ] ) || !isset( $_POST[ 'data_action' ] ) ) {
|
305 |
-
die('');
|
306 |
-
}
|
307 |
-
/* Get Ajax Options */
|
308 |
-
$context = sanitize_text_field( $_POST[ 'context' ] );
|
309 |
-
$option = sanitize_text_field( $_POST[ 'data_action' ] );
|
310 |
-
$option_value = sanitize_text_field( $_POST[ 'checked' ] );
|
311 |
-
$val = sanitize_text_field( $_POST[ 'val' ] );
|
312 |
-
|
313 |
-
|
314 |
-
$options = MPSUM_Updates_Manager::get_options( $context );
|
315 |
-
$options = wp_parse_args( $options, MPSUM_Admin_Core::get_defaults() );
|
316 |
-
if ( 'core' == $context ) {
|
317 |
-
$options[ $option ] = $option_value;
|
318 |
-
if ( $option == 'automatic_theme_updates' || $option == 'automatic_plugin_updates' ) {
|
319 |
-
$options[ $option ] = $val;
|
320 |
-
}
|
321 |
-
MPSUM_Updates_Manager::update_options( $options, $context );
|
322 |
-
} else if ( 'plugins' == $context || 'themes' == $context ) {
|
323 |
-
$plugin_options = MPSUM_Updates_Manager::get_options( $context );
|
324 |
-
if ( 'on' == $option_value ) {
|
325 |
-
foreach( $plugin_options as $plugin ) {
|
326 |
-
if ( ( $key = array_search( $option, $plugin_options ) ) !== false ) {
|
327 |
-
unset( $plugin_options[ $key ] );
|
328 |
-
}
|
329 |
-
}
|
330 |
-
} else {
|
331 |
-
$plugin_options[] = $option;
|
332 |
-
$plugin_options = array_values( array_unique( $plugin_options ) );
|
333 |
-
}
|
334 |
-
|
335 |
-
MPSUM_Updates_Manager::update_options( $plugin_options, $context );
|
336 |
-
} elseif( 'plugins_automatic' == $context || 'themes_automatic' == $context ) {
|
337 |
-
$plugin_options = MPSUM_Updates_Manager::get_options( $context );
|
338 |
-
if ( 'off' == $option_value ) {
|
339 |
-
foreach( $plugin_options as $plugin ) {
|
340 |
-
if ( ( $key = array_search( $option, $plugin_options ) ) !== false ) {
|
341 |
-
unset( $plugin_options[ $key ] );
|
342 |
-
}
|
343 |
-
}
|
344 |
-
} else {
|
345 |
-
$options = MPSUM_Updates_Manager::get_options( $context );
|
346 |
-
$options[] = $option;
|
347 |
-
$plugin_options = array_values( array_unique( $options ) );
|
348 |
-
}
|
349 |
-
|
350 |
-
MPSUM_Updates_Manager::update_options( $plugin_options, $context );
|
351 |
-
}
|
352 |
-
|
353 |
-
die( $context );
|
354 |
-
|
355 |
-
}
|
356 |
-
|
357 |
-
/**
|
358 |
-
* Save plugin options.
|
359 |
-
*
|
360 |
-
* Saves the plugin options based on context. If no context is provided, updates all options.
|
361 |
-
*
|
362 |
-
* @since 5.0.0
|
363 |
-
* @access static
|
364 |
-
*
|
365 |
-
* @param array $options Associative array of plugin options.
|
366 |
-
* @param string $context Array key of which options to update
|
367 |
-
*/
|
368 |
-
public static function update_options( $options = array(), $context = '' ) {
|
369 |
-
$options_to_save = self::get_options();
|
370 |
-
|
371 |
-
if ( !empty( $context ) && is_string( $context ) ) {
|
372 |
-
$options_to_save[ $context ] = $options;
|
373 |
-
} else {
|
374 |
-
$options_to_save = $options;
|
375 |
-
}
|
376 |
-
|
377 |
-
self::$options = $options_to_save;
|
378 |
-
update_site_option( 'MPSUM', $options_to_save );
|
379 |
-
}
|
380 |
-
|
381 |
-
} //end class MPSUM_Updates_Manager
|
382 |
-
|
383 |
-
MPSUM_Updates_Manager::get_instance();
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
includes/MPSUM_Admin.php
CHANGED
@@ -208,7 +208,7 @@ class MPSUM_Admin {
|
|
208 |
'dashboard' => _x( 'Show Dashboard', 'Show or hide the dashboard', 'stops-core-theme-and-plugin-updates' ),
|
209 |
'dashboard_showing' => $dashboard_showing,
|
210 |
) );
|
211 |
-
wp_enqueue_style( 'mpsum_dashboard', MPSUM_Updates_Manager::get_plugin_url( '/css/style.css' ), array(), '
|
212 |
}
|
213 |
|
214 |
/**
|
208 |
'dashboard' => _x( 'Show Dashboard', 'Show or hide the dashboard', 'stops-core-theme-and-plugin-updates' ),
|
209 |
'dashboard_showing' => $dashboard_showing,
|
210 |
) );
|
211 |
+
wp_enqueue_style( 'mpsum_dashboard', MPSUM_Updates_Manager::get_plugin_url( '/css/style.css' ), array(), '20160819' );
|
212 |
}
|
213 |
|
214 |
/**
|
includes/MPSUM_Admin_Core.php
CHANGED
@@ -189,38 +189,38 @@ class MPSUM_Admin_Core {
|
|
189 |
<tr>
|
190 |
<th scope="row"><?php esc_html_e( 'All Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
191 |
<td>
|
192 |
-
<input type="radio" name="options[all_updates]" value="on" id="all_updates_on" <?php checked( 'on', $options[ 'all_updates' ] ); ?> /> <label for="all_updates_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label
|
193 |
-
<input type="radio" name="options[all_updates]" value="off" id="all_updates_off" <?php checked( 'off', $options[ 'all_updates' ] ); ?> /> <label for="all_updates_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
194 |
<p class="description"><?php esc_html_e( 'If this option is disabled, this will override all settings.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
195 |
</td>
|
196 |
</tr>
|
197 |
<tr>
|
198 |
<th scope="row"><?php esc_html_e( 'WordPress Core Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
199 |
<td>
|
200 |
-
<input type="radio" name="options[core_updates]" value="on" id="core_updates_on" <?php checked( 'on', $options[ 'core_updates' ] ); ?> /> <label for="core_updates_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label
|
201 |
-
<input type="radio" name="options[core_updates]" value="off" id="core_updates_off" <?php checked( 'off', $options[ 'core_updates' ] ); ?> /> <label for="core_updates_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
202 |
<p class="description"><?php esc_html_e( 'Prevents WordPress from showing it needs to be updated.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
203 |
</td>
|
204 |
</tr>
|
205 |
<tr>
|
206 |
<th scope="row"><?php esc_html_e( 'All Plugin Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
207 |
<td>
|
208 |
-
<input type="radio" name="options[plugin_updates]" value="on" id="plugin_updates_on" <?php checked( 'on', $options[ 'plugin_updates' ] ); ?> /> <label for="plugin_updates_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label><br />
|
209 |
-
<input type="radio" name="options[plugin_updates]" value="off" id="plugin_updates_off" <?php checked( 'off', $options[ 'plugin_updates' ] ); ?> /> <label for="plugin_updates_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
210 |
</td>
|
211 |
</tr>
|
212 |
<tr>
|
213 |
<th scope="row"><?php esc_html_e( 'All Theme Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
214 |
<td>
|
215 |
-
<input type="radio" name="options[theme_updates]" value="on" id="theme_updates_on" <?php checked( 'on', $options[ 'theme_updates' ] ); ?> /> <label for="theme_updates_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label
|
216 |
-
<input type="radio" name="options[theme_updates]" value="off" id="theme_updates_off" <?php checked( 'off', $options[ 'theme_updates' ] ); ?> /> <label for="theme_updates_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
217 |
</td>
|
218 |
</tr>
|
219 |
<tr>
|
220 |
<th scope="row"><?php esc_html_e( 'All Translation Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
221 |
<td>
|
222 |
-
<input type="radio" name="options[translation_updates]" value="on" id="translation_updates_on" <?php checked( 'on', $options[ 'translation_updates' ] ); ?> /> <label for="translation_updates_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label
|
223 |
-
<input type="radio" name="options[translation_updates]" value="off" id="translation_updates_off" <?php checked( 'off', $options[ 'translation_updates' ] ); ?> /> <label for="translation_updates_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
224 |
</td>
|
225 |
</tr>
|
226 |
</table>
|
@@ -230,52 +230,52 @@ class MPSUM_Admin_Core {
|
|
230 |
<tr>
|
231 |
<th scope="row"><?php esc_html_e( 'Major Releases', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
232 |
<td>
|
233 |
-
<input type="radio" name="options[automatic_major_updates]" value="on" id="automatic_major_on" <?php checked( 'on', $options[ 'automatic_major_updates' ] ); ?> /> <label for="automatic_major_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label
|
234 |
-
<input type="radio" name="options[automatic_major_updates]" value="off" id="automatic_major_off" <?php checked( 'off', $options[ 'automatic_major_updates' ] ); ?> /> <label for="automatic_major_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
235 |
<p class="description"><?php esc_html_e( 'Automatically update to major releases (e.g., 4.1, 4.2, 4.3).', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
236 |
</td>
|
237 |
</tr>
|
238 |
<tr>
|
239 |
<th scope="row"><?php esc_html_e( 'Minor Releases', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
240 |
<td>
|
241 |
-
<input type="radio" name="options[automatic_minor_updates]" value="on" id="automatic_minor_on" <?php checked( 'on', $options[ 'automatic_minor_updates' ] ); ?> /> <label for="automatic_minor_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label><br />
|
242 |
-
<input type="radio" name="options[automatic_minor_updates]" value="off" id="automatic_minor_off" <?php checked( 'off', $options[ 'automatic_minor_updates' ] ); ?> /> <label for="automatic_minor_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
243 |
<p class="description"><?php esc_html_e( 'Automatically update to minor releases (e.g., 4.1.1, 4.1.2, 4.1.3).', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
244 |
</td>
|
245 |
</tr>
|
246 |
<tr>
|
247 |
<th scope="row"><?php esc_html_e( 'Development Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
248 |
<td>
|
249 |
-
<input type="radio" name="options[automatic_development_updates]" value="on" id="automatic_dev_on" <?php checked( 'on', $options[ 'automatic_development_updates' ] ); ?> /> <label for="automatic_dev_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label
|
250 |
-
<input type="radio" name="options[automatic_development_updates]" value="off" id="automatic_dev_off" <?php checked( 'off', $options[ 'automatic_development_updates' ] ); ?> /> <label for="automatic_dev_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
251 |
<p class="description"><?php esc_html_e( 'Update automatically to Bleeding Edge releases.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
252 |
</td>
|
253 |
</tr>
|
254 |
<tr>
|
255 |
<th scope="row"><?php esc_html_e( 'Automatic Plugin Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
256 |
<td>
|
257 |
-
<input type="radio" name="options[automatic_plugin_updates]" value="on" id="automatic_plugin_on" <?php checked( 'on', $options[ 'automatic_plugin_updates' ] ); ?> /> <label for="automatic_plugin_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label
|
258 |
-
<input type="radio" name="options[automatic_plugin_updates]" value="off" id="automatic_plugin_off" <?php checked( 'off', $options[ 'automatic_plugin_updates' ] ); ?> /> <label for="automatic_plugin_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label
|
259 |
-
<input type="radio" name="options[automatic_plugin_updates]" value="default" id="automatic_plugin_default" <?php checked( 'default', $options[ 'automatic_plugin_updates' ] ); ?> /> <label for="automatic_plugin_default"><?php esc_html_e( 'Default', 'stops-core-theme-and-plugin-updates' ); ?></label
|
260 |
-
<input type="radio" name="options[automatic_plugin_updates]" value="individual" id="automatic_plugin_individual" <?php checked( 'individual', $options[ 'automatic_plugin_updates' ] ); ?> /> <label for="automatic_plugin_individual"><?php esc_html_e( 'Select Individually', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
261 |
<p class="description"><?php esc_html_e( 'Automatically update your plugins. Select always on, always off, the WordPress default, or select plugins individually.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
262 |
</td>
|
263 |
</tr>
|
264 |
<tr>
|
265 |
<th scope="row"><?php esc_html_e( 'Automatic Theme Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
266 |
<td>
|
267 |
-
<input type="radio" name="options[automatic_theme_updates]" value="on" id="automatic_theme_on" <?php checked( 'on', $options[ 'automatic_theme_updates' ] ); ?> /> <label for="automatic_theme_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label
|
268 |
-
<input type="radio" name="options[automatic_theme_updates]" value="off" id="automatic_theme_off" <?php checked( 'off', $options[ 'automatic_theme_updates' ] ); ?> /> <label for="automatic_theme_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label
|
269 |
-
<input type="radio" name="options[automatic_theme_updates]" value="default" id="automatic_theme_default" <?php checked( 'default', $options[ 'automatic_theme_updates' ] ); ?> /> <label for="automatic_theme_default"><?php esc_html_e( 'Default', 'stops-core-theme-and-plugin-updates' ); ?></label
|
270 |
-
<input type="radio" name="options[automatic_theme_updates]" value="individual" id="automatic_theme_individual" <?php checked( 'individual', $options[ 'automatic_theme_updates' ] ); ?> /> <label for="automatic_theme_individual"><?php esc_html_e( 'Select Individually', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
271 |
<p class="description"><?php esc_html_e( 'Automatically update your themes. Select always on, always off, the WordPress default, or select themes individually.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
272 |
</td>
|
273 |
</tr>
|
274 |
<tr>
|
275 |
<th scope="row"><?php esc_html_e( 'Translation Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
276 |
<td>
|
277 |
-
<input type="radio" name="options[automatic_translation_updates]" value="on" id="automatic_translation_on" <?php checked( 'on', $options[ 'automatic_translation_updates' ] ); ?> /> <label for="automatic_translation_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label
|
278 |
-
<input type="radio" name="options[automatic_translation_updates]" value="off" id="automatic_translation_off" <?php checked( 'off', $options[ 'automatic_translation_updates' ] ); ?> /> <label for="automatic_translation_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
279 |
<p class="description"><?php esc_html_e( 'Automatically update your translations.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
280 |
</td>
|
281 |
</tr>
|
@@ -286,7 +286,7 @@ class MPSUM_Admin_Core {
|
|
286 |
<th scope="row"><?php esc_html_e( 'Core E-mails', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
287 |
<td>
|
288 |
<input type="hidden" name="options[notification_core_update_emails]" value="off" />
|
289 |
-
<input type="checkbox" name="options[notification_core_update_emails]" value="on" id="notification_core_update_emails_on" <?php checked( 'on', $options[ 'notification_core_update_emails' ] ); ?> /> <label for="notification_core_update_emails_on"><?php esc_html_e( 'Core Update Emails', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
290 |
<?php /* Hidden checkboxes until changes make into core. Shooting for WordPress 4.5 */ ?>
|
291 |
<input type="hidden" name="options[notification_core_update_emails_plugins]" value="on" />
|
292 |
<input type="hidden" name="options[notification_core_update_emails_themes]" value="on" />
|
@@ -322,7 +322,7 @@ class MPSUM_Admin_Core {
|
|
322 |
}
|
323 |
?>
|
324 |
<input type="text" name="options[email_addresses]" value="<?php echo esc_attr( $email_addresses ); ?>" style="width: 50%" /><br />
|
325 |
-
<
|
326 |
</td>
|
327 |
</tr>
|
328 |
</table>
|
@@ -331,16 +331,16 @@ class MPSUM_Admin_Core {
|
|
331 |
<tr>
|
332 |
<th scope="row"><?php esc_html_e( 'Browser Nag', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
333 |
<td>
|
334 |
-
<input type="radio" name="options[misc_browser_nag]" value="on" id="misc_browser_nag_on" <?php checked( 'on', $options[ 'misc_browser_nag' ] ); ?> /> <label for="misc_browser_nag_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label
|
335 |
-
<input type="radio" name="options[misc_browser_nag]" value="off" id="misc_browser_nag_off" <?php checked( 'off', $options[ 'misc_browser_nag' ] ); ?> /> <label for="misc_browser_nag_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
336 |
<p class="description"><?php esc_html_e( 'Removes the browser nag for people using older browsers.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
337 |
</td>
|
338 |
</tr>
|
339 |
<tr>
|
340 |
<th scope="row"><?php esc_html_e( 'WordPress Version in Footer', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
341 |
<td>
|
342 |
-
<input type="radio" name="options[misc_wp_footer]" value="on" id="misc_wp_footer_on" <?php checked( 'on', $options[ 'misc_wp_footer' ] ); ?> /> <label for="misc_wp_footer_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label
|
343 |
-
<input type="radio" name="options[misc_wp_footer]" value="off" id="misc_wp_footer_off" <?php checked( 'off', $options[ 'misc_wp_footer' ] ); ?> /> <label for="misc_wp_footer_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
344 |
<p class="description"><?php esc_html_e( 'Removes the WordPress version in the footer.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
345 |
</td>
|
346 |
</tr>
|
189 |
<tr>
|
190 |
<th scope="row"><?php esc_html_e( 'All Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
191 |
<td>
|
192 |
+
<p><input type="radio" name="options[all_updates]" value="on" id="all_updates_on" <?php checked( 'on', $options[ 'all_updates' ] ); ?> /> <label for="all_updates_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
193 |
+
<p><input type="radio" name="options[all_updates]" value="off" id="all_updates_off" <?php checked( 'off', $options[ 'all_updates' ] ); ?> /> <label for="all_updates_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
194 |
<p class="description"><?php esc_html_e( 'If this option is disabled, this will override all settings.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
195 |
</td>
|
196 |
</tr>
|
197 |
<tr>
|
198 |
<th scope="row"><?php esc_html_e( 'WordPress Core Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
199 |
<td>
|
200 |
+
<p><input type="radio" name="options[core_updates]" value="on" id="core_updates_on" <?php checked( 'on', $options[ 'core_updates' ] ); ?> /> <label for="core_updates_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
201 |
+
<p><input type="radio" name="options[core_updates]" value="off" id="core_updates_off" <?php checked( 'off', $options[ 'core_updates' ] ); ?> /> <label for="core_updates_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
202 |
<p class="description"><?php esc_html_e( 'Prevents WordPress from showing it needs to be updated.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
203 |
</td>
|
204 |
</tr>
|
205 |
<tr>
|
206 |
<th scope="row"><?php esc_html_e( 'All Plugin Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
207 |
<td>
|
208 |
+
<p><input type="radio" name="options[plugin_updates]" value="on" id="plugin_updates_on" <?php checked( 'on', $options[ 'plugin_updates' ] ); ?> /> <label for="plugin_updates_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label><br />
|
209 |
+
<p><input type="radio" name="options[plugin_updates]" value="off" id="plugin_updates_off" <?php checked( 'off', $options[ 'plugin_updates' ] ); ?> /> <label for="plugin_updates_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
210 |
</td>
|
211 |
</tr>
|
212 |
<tr>
|
213 |
<th scope="row"><?php esc_html_e( 'All Theme Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
214 |
<td>
|
215 |
+
<p><input type="radio" name="options[theme_updates]" value="on" id="theme_updates_on" <?php checked( 'on', $options[ 'theme_updates' ] ); ?> /> <label for="theme_updates_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
216 |
+
<p><input type="radio" name="options[theme_updates]" value="off" id="theme_updates_off" <?php checked( 'off', $options[ 'theme_updates' ] ); ?> /> <label for="theme_updates_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
217 |
</td>
|
218 |
</tr>
|
219 |
<tr>
|
220 |
<th scope="row"><?php esc_html_e( 'All Translation Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
221 |
<td>
|
222 |
+
<p><input type="radio" name="options[translation_updates]" value="on" id="translation_updates_on" <?php checked( 'on', $options[ 'translation_updates' ] ); ?> /> <label for="translation_updates_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
223 |
+
<p><input type="radio" name="options[translation_updates]" value="off" id="translation_updates_off" <?php checked( 'off', $options[ 'translation_updates' ] ); ?> /> <label for="translation_updates_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
224 |
</td>
|
225 |
</tr>
|
226 |
</table>
|
230 |
<tr>
|
231 |
<th scope="row"><?php esc_html_e( 'Major Releases', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
232 |
<td>
|
233 |
+
<p><input type="radio" name="options[automatic_major_updates]" value="on" id="automatic_major_on" <?php checked( 'on', $options[ 'automatic_major_updates' ] ); ?> /> <label for="automatic_major_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
234 |
+
<p><input type="radio" name="options[automatic_major_updates]" value="off" id="automatic_major_off" <?php checked( 'off', $options[ 'automatic_major_updates' ] ); ?> /> <label for="automatic_major_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
235 |
<p class="description"><?php esc_html_e( 'Automatically update to major releases (e.g., 4.1, 4.2, 4.3).', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
236 |
</td>
|
237 |
</tr>
|
238 |
<tr>
|
239 |
<th scope="row"><?php esc_html_e( 'Minor Releases', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
240 |
<td>
|
241 |
+
<p><input type="radio" name="options[automatic_minor_updates]" value="on" id="automatic_minor_on" <?php checked( 'on', $options[ 'automatic_minor_updates' ] ); ?> /> <label for="automatic_minor_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label><br />
|
242 |
+
<p><input type="radio" name="options[automatic_minor_updates]" value="off" id="automatic_minor_off" <?php checked( 'off', $options[ 'automatic_minor_updates' ] ); ?> /> <label for="automatic_minor_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label>
|
243 |
<p class="description"><?php esc_html_e( 'Automatically update to minor releases (e.g., 4.1.1, 4.1.2, 4.1.3).', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
244 |
</td>
|
245 |
</tr>
|
246 |
<tr>
|
247 |
<th scope="row"><?php esc_html_e( 'Development Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
248 |
<td>
|
249 |
+
<p><input type="radio" name="options[automatic_development_updates]" value="on" id="automatic_dev_on" <?php checked( 'on', $options[ 'automatic_development_updates' ] ); ?> /> <label for="automatic_dev_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
250 |
+
<p><input type="radio" name="options[automatic_development_updates]" value="off" id="automatic_dev_off" <?php checked( 'off', $options[ 'automatic_development_updates' ] ); ?> /> <label for="automatic_dev_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
251 |
<p class="description"><?php esc_html_e( 'Update automatically to Bleeding Edge releases.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
252 |
</td>
|
253 |
</tr>
|
254 |
<tr>
|
255 |
<th scope="row"><?php esc_html_e( 'Automatic Plugin Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
256 |
<td>
|
257 |
+
<p><input type="radio" name="options[automatic_plugin_updates]" value="on" id="automatic_plugin_on" <?php checked( 'on', $options[ 'automatic_plugin_updates' ] ); ?> /> <label for="automatic_plugin_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
258 |
+
<p><input type="radio" name="options[automatic_plugin_updates]" value="off" id="automatic_plugin_off" <?php checked( 'off', $options[ 'automatic_plugin_updates' ] ); ?> /> <label for="automatic_plugin_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
259 |
+
<p><input type="radio" name="options[automatic_plugin_updates]" value="default" id="automatic_plugin_default" <?php checked( 'default', $options[ 'automatic_plugin_updates' ] ); ?> /> <label for="automatic_plugin_default"><?php esc_html_e( 'Default', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
260 |
+
<p><input type="radio" name="options[automatic_plugin_updates]" value="individual" id="automatic_plugin_individual" <?php checked( 'individual', $options[ 'automatic_plugin_updates' ] ); ?> /> <label for="automatic_plugin_individual"><?php esc_html_e( 'Select Individually', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
261 |
<p class="description"><?php esc_html_e( 'Automatically update your plugins. Select always on, always off, the WordPress default, or select plugins individually.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
262 |
</td>
|
263 |
</tr>
|
264 |
<tr>
|
265 |
<th scope="row"><?php esc_html_e( 'Automatic Theme Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
266 |
<td>
|
267 |
+
<p><input type="radio" name="options[automatic_theme_updates]" value="on" id="automatic_theme_on" <?php checked( 'on', $options[ 'automatic_theme_updates' ] ); ?> /> <label for="automatic_theme_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
268 |
+
<p><input type="radio" name="options[automatic_theme_updates]" value="off" id="automatic_theme_off" <?php checked( 'off', $options[ 'automatic_theme_updates' ] ); ?> /> <label for="automatic_theme_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
269 |
+
<p><input type="radio" name="options[automatic_theme_updates]" value="default" id="automatic_theme_default" <?php checked( 'default', $options[ 'automatic_theme_updates' ] ); ?> /> <label for="automatic_theme_default"><?php esc_html_e( 'Default', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
270 |
+
<p><input type="radio" name="options[automatic_theme_updates]" value="individual" id="automatic_theme_individual" <?php checked( 'individual', $options[ 'automatic_theme_updates' ] ); ?> /> <label for="automatic_theme_individual"><?php esc_html_e( 'Select Individually', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
271 |
<p class="description"><?php esc_html_e( 'Automatically update your themes. Select always on, always off, the WordPress default, or select themes individually.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
272 |
</td>
|
273 |
</tr>
|
274 |
<tr>
|
275 |
<th scope="row"><?php esc_html_e( 'Translation Updates', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
276 |
<td>
|
277 |
+
<p><input type="radio" name="options[automatic_translation_updates]" value="on" id="automatic_translation_on" <?php checked( 'on', $options[ 'automatic_translation_updates' ] ); ?> /> <label for="automatic_translation_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
278 |
+
<p><input type="radio" name="options[automatic_translation_updates]" value="off" id="automatic_translation_off" <?php checked( 'off', $options[ 'automatic_translation_updates' ] ); ?> /> <label for="automatic_translation_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
279 |
<p class="description"><?php esc_html_e( 'Automatically update your translations.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
280 |
</td>
|
281 |
</tr>
|
286 |
<th scope="row"><?php esc_html_e( 'Core E-mails', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
287 |
<td>
|
288 |
<input type="hidden" name="options[notification_core_update_emails]" value="off" />
|
289 |
+
<p><input type="checkbox" name="options[notification_core_update_emails]" value="on" id="notification_core_update_emails_on" <?php checked( 'on', $options[ 'notification_core_update_emails' ] ); ?> /> <label for="notification_core_update_emails_on"><?php esc_html_e( 'Core Update Emails', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
290 |
<?php /* Hidden checkboxes until changes make into core. Shooting for WordPress 4.5 */ ?>
|
291 |
<input type="hidden" name="options[notification_core_update_emails_plugins]" value="on" />
|
292 |
<input type="hidden" name="options[notification_core_update_emails_themes]" value="on" />
|
322 |
}
|
323 |
?>
|
324 |
<input type="text" name="options[email_addresses]" value="<?php echo esc_attr( $email_addresses ); ?>" style="width: 50%" /><br />
|
325 |
+
<p class="description"><?php echo esc_html_e( 'Emails can be comma separated', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
326 |
</td>
|
327 |
</tr>
|
328 |
</table>
|
331 |
<tr>
|
332 |
<th scope="row"><?php esc_html_e( 'Browser Nag', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
333 |
<td>
|
334 |
+
<p><input type="radio" name="options[misc_browser_nag]" value="on" id="misc_browser_nag_on" <?php checked( 'on', $options[ 'misc_browser_nag' ] ); ?> /> <label for="misc_browser_nag_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
335 |
+
<p><input type="radio" name="options[misc_browser_nag]" value="off" id="misc_browser_nag_off" <?php checked( 'off', $options[ 'misc_browser_nag' ] ); ?> /> <label for="misc_browser_nag_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
336 |
<p class="description"><?php esc_html_e( 'Removes the browser nag for people using older browsers.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
337 |
</td>
|
338 |
</tr>
|
339 |
<tr>
|
340 |
<th scope="row"><?php esc_html_e( 'WordPress Version in Footer', 'stops-core-theme-and-plugin-updates' ); ?></th>
|
341 |
<td>
|
342 |
+
<p><input type="radio" name="options[misc_wp_footer]" value="on" id="misc_wp_footer_on" <?php checked( 'on', $options[ 'misc_wp_footer' ] ); ?> /> <label for="misc_wp_footer_on"><?php esc_html_e( 'Enabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
343 |
+
<p><input type="radio" name="options[misc_wp_footer]" value="off" id="misc_wp_footer_off" <?php checked( 'off', $options[ 'misc_wp_footer' ] ); ?> /> <label for="misc_wp_footer_off"><?php esc_html_e( 'Disabled', 'stops-core-theme-and-plugin-updates' ); ?></label></p>
|
344 |
<p class="description"><?php esc_html_e( 'Removes the WordPress version in the footer.', 'stops-core-theme-and-plugin-updates' ); ?></p>
|
345 |
</td>
|
346 |
</tr>
|
includes/MPSUM_Logs.php
CHANGED
@@ -60,7 +60,7 @@ class MPSUM_Logs {
|
|
60 |
}
|
61 |
|
62 |
add_action( 'automatic_updates_complete', array( $this, 'automatic_updates' ) );
|
63 |
-
add_action( 'upgrader_process_complete', array( $this, 'manual_updates' ),
|
64 |
|
65 |
} //end constructor
|
66 |
|
@@ -233,7 +233,6 @@ class MPSUM_Logs {
|
|
233 |
$user_id = get_current_user_id();
|
234 |
if ( 0 == $user_id ) return; // If there is no user, this is not a manual update
|
235 |
|
236 |
-
|
237 |
switch( $options[ 'type' ] ) {
|
238 |
case 'core':
|
239 |
include( ABSPATH . WPINC . '/version.php' );
|
@@ -264,15 +263,15 @@ class MPSUM_Logs {
|
|
264 |
if ( ! function_exists( 'get_plugins' ) ) {
|
265 |
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
266 |
}
|
267 |
-
$plugins_from_cache =
|
268 |
wp_clean_plugins_cache();
|
269 |
$plugins = get_plugins();
|
270 |
if ( !empty( $plugins ) && isset( $options[ 'plugins' ] ) && !empty( $options[ 'plugins' ] ) ) {
|
271 |
foreach( $options[ 'plugins' ] as $plugin ) {
|
272 |
$plugin_data = isset( $plugins[ $plugin ] ) ? $plugins[ $plugin ] : false;
|
273 |
-
$
|
274 |
-
if ( false !== $plugin_data && false !== $
|
275 |
-
$status = ( $plugin_data[ 'Version' ] == $
|
276 |
$wpdb->insert(
|
277 |
$tablename,
|
278 |
array(
|
@@ -300,13 +299,15 @@ class MPSUM_Logs {
|
|
300 |
break;
|
301 |
case 'theme':
|
302 |
if ( isset( $options[ 'themes' ] ) && !empty( $options[ 'themes' ] ) ) {
|
303 |
-
$theme_data_from_cache =
|
304 |
wp_clean_themes_cache();
|
305 |
foreach( $options[ 'themes' ] as $theme ) {
|
306 |
$theme_data = wp_get_theme( $theme );
|
307 |
-
$
|
308 |
-
|
309 |
-
|
|
|
|
|
310 |
$wpdb->insert(
|
311 |
$tablename,
|
312 |
array(
|
60 |
}
|
61 |
|
62 |
add_action( 'automatic_updates_complete', array( $this, 'automatic_updates' ) );
|
63 |
+
add_action( 'upgrader_process_complete', array( $this, 'manual_updates' ), 5, 2 );
|
64 |
|
65 |
} //end constructor
|
66 |
|
233 |
$user_id = get_current_user_id();
|
234 |
if ( 0 == $user_id ) return; // If there is no user, this is not a manual update
|
235 |
|
|
|
236 |
switch( $options[ 'type' ] ) {
|
237 |
case 'core':
|
238 |
include( ABSPATH . WPINC . '/version.php' );
|
263 |
if ( ! function_exists( 'get_plugins' ) ) {
|
264 |
require_once ABSPATH . 'wp-admin/includes/plugin.php';
|
265 |
}
|
266 |
+
$plugins_from_cache = get_site_transient( 'update_plugins' );
|
267 |
wp_clean_plugins_cache();
|
268 |
$plugins = get_plugins();
|
269 |
if ( !empty( $plugins ) && isset( $options[ 'plugins' ] ) && !empty( $options[ 'plugins' ] ) ) {
|
270 |
foreach( $options[ 'plugins' ] as $plugin ) {
|
271 |
$plugin_data = isset( $plugins[ $plugin ] ) ? $plugins[ $plugin ] : false;
|
272 |
+
$plugins_from_cache = isset( $plugins_from_cache->checked[ $plugin ] ) ? $plugins_from_cache->checked[ $plugin ] : false;
|
273 |
+
if ( false !== $plugin_data && false !== $plugins_from_cache ) {
|
274 |
+
$status = ( $plugin_data[ 'Version' ] == $plugins_from_cache ) ? 0 : 1;
|
275 |
$wpdb->insert(
|
276 |
$tablename,
|
277 |
array(
|
299 |
break;
|
300 |
case 'theme':
|
301 |
if ( isset( $options[ 'themes' ] ) && !empty( $options[ 'themes' ] ) ) {
|
302 |
+
$theme_data_from_cache = get_site_transient( 'update_themes' );
|
303 |
wp_clean_themes_cache();
|
304 |
foreach( $options[ 'themes' ] as $theme ) {
|
305 |
$theme_data = wp_get_theme( $theme );
|
306 |
+
$theme_from_cache_version = isset( $theme_data_from_cache->checked[ $theme ] ) ? $theme_data_from_cache->checked[ $theme ] : false;
|
307 |
+
error_log( $theme_from_cache_version );
|
308 |
+
error_log( $theme_data->get( 'Version' ) );
|
309 |
+
if ( $theme_data->exists() && false !== $theme_from_cache_version ) {
|
310 |
+
$status = ( $theme_from_cache_version == $theme_data->get( 'Version' ) ) ? 0 : 1;
|
311 |
$wpdb->insert(
|
312 |
$tablename,
|
313 |
array(
|
main.php
CHANGED
@@ -4,7 +4,7 @@ Plugin Name: Easy Updates Manager
|
|
4 |
Plugin URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
|
5 |
Description: Manage and disable WordPress updates, including core, plugin, theme, and automatic updates - Works with Multisite and has built-in logging features.
|
6 |
Author: Easy Updates Manager Team
|
7 |
-
Version: 6.2.
|
8 |
Requires at least: 4.4
|
9 |
Author URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
|
10 |
Contributors: kidsguide, ronalfy
|
@@ -13,4 +13,386 @@ Domain Path: /languages
|
|
13 |
Updates: true
|
14 |
Network: true
|
15 |
*/
|
16 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
4 |
Plugin URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
|
5 |
Description: Manage and disable WordPress updates, including core, plugin, theme, and automatic updates - Works with Multisite and has built-in logging features.
|
6 |
Author: Easy Updates Manager Team
|
7 |
+
Version: 6.2.3
|
8 |
Requires at least: 4.4
|
9 |
Author URI: https://wordpress.org/plugins/stops-core-theme-and-plugin-updates/
|
10 |
Contributors: kidsguide, ronalfy
|
13 |
Updates: true
|
14 |
Network: true
|
15 |
*/
|
16 |
+
|
17 |
+
/**
|
18 |
+
* Main plugin class
|
19 |
+
*
|
20 |
+
* Initializes auto-loader, internationalization, and plugin dependencies.
|
21 |
+
*
|
22 |
+
* @since 5.0.0
|
23 |
+
*
|
24 |
+
* @package WordPress
|
25 |
+
*/
|
26 |
+
class MPSUM_Updates_Manager {
|
27 |
+
|
28 |
+
/**
|
29 |
+
* Holds the class instance.
|
30 |
+
*
|
31 |
+
* @since 5.0.0
|
32 |
+
* @access static
|
33 |
+
* @var MPSUM_Updates_Manager $instance
|
34 |
+
*/
|
35 |
+
private static $instance = null;
|
36 |
+
|
37 |
+
/**
|
38 |
+
* Stores the plugin's options
|
39 |
+
*
|
40 |
+
* @since 5.0.0
|
41 |
+
* @access static
|
42 |
+
* @var array $options
|
43 |
+
*/
|
44 |
+
private static $options = false;
|
45 |
+
|
46 |
+
/**
|
47 |
+
* Retrieve a class instance.
|
48 |
+
*
|
49 |
+
* Retrieve a class instance.
|
50 |
+
*
|
51 |
+
* @since 5.0.0
|
52 |
+
* @access static
|
53 |
+
*
|
54 |
+
* @return MPSUM_Updates_Manager Instance of the class.
|
55 |
+
*/
|
56 |
+
public static function get_instance() {
|
57 |
+
if ( null == self::$instance ) {
|
58 |
+
self::$instance = new self;
|
59 |
+
}
|
60 |
+
return self::$instance;
|
61 |
+
} //end get_instance
|
62 |
+
|
63 |
+
/**
|
64 |
+
* Retrieve the plugin basename.
|
65 |
+
*
|
66 |
+
* Retrieve the plugin basename.
|
67 |
+
*
|
68 |
+
* @since 5.0.0
|
69 |
+
* @access static
|
70 |
+
*
|
71 |
+
* @return string plugin basename
|
72 |
+
*/
|
73 |
+
public static function get_plugin_basename() {
|
74 |
+
return plugin_basename( __FILE__ );
|
75 |
+
}
|
76 |
+
|
77 |
+
/**
|
78 |
+
* Class constructor.
|
79 |
+
*
|
80 |
+
* Set up internationalization, auto-loader, and plugin initialization.
|
81 |
+
*
|
82 |
+
* @since 5.0.0
|
83 |
+
* @access private
|
84 |
+
*
|
85 |
+
*/
|
86 |
+
private function __construct() {
|
87 |
+
/* Localization Code */
|
88 |
+
load_plugin_textdomain( 'stops-core-theme-and-plugin-updates', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' );
|
89 |
+
|
90 |
+
spl_autoload_register( array( $this, 'loader' ) );
|
91 |
+
|
92 |
+
// Logging
|
93 |
+
$options = MPSUM_Updates_Manager::get_options( 'core' );
|
94 |
+
if ( isset( $options[ 'logs' ] ) && 'on' == $options[ 'logs' ] ) {
|
95 |
+
MPSUM_Logs::run();
|
96 |
+
}
|
97 |
+
|
98 |
+
add_action( 'plugins_loaded', array( $this, 'plugins_loaded' ) );
|
99 |
+
} //end constructor
|
100 |
+
|
101 |
+
/**
|
102 |
+
* Return the absolute path to an asset.
|
103 |
+
*
|
104 |
+
* Return the absolute path to an asset based on a relative argument.
|
105 |
+
*
|
106 |
+
* @since 5.0.0
|
107 |
+
* @access static
|
108 |
+
*
|
109 |
+
* @param string $path Relative path to the asset.
|
110 |
+
* @return string Absolute path to the relative asset.
|
111 |
+
*/
|
112 |
+
public static function get_plugin_dir( $path = '' ) {
|
113 |
+
$dir = rtrim( plugin_dir_path(__FILE__), '/' );
|
114 |
+
if ( !empty( $path ) && is_string( $path) )
|
115 |
+
$dir .= '/' . ltrim( $path, '/' );
|
116 |
+
return $dir;
|
117 |
+
}
|
118 |
+
|
119 |
+
/**
|
120 |
+
* Return the web path to an asset.
|
121 |
+
*
|
122 |
+
* Return the web path to an asset based on a relative argument.
|
123 |
+
*
|
124 |
+
* @since 5.0.0
|
125 |
+
* @access static
|
126 |
+
*
|
127 |
+
* @param string $path Relative path to the asset.
|
128 |
+
* @return string Web path to the relative asset.
|
129 |
+
*/
|
130 |
+
public static function get_plugin_url( $path = '' ) {
|
131 |
+
$dir = rtrim( plugin_dir_url(__FILE__), '/' );
|
132 |
+
if ( !empty( $path ) && is_string( $path) )
|
133 |
+
$dir .= '/' . ltrim( $path, '/' );
|
134 |
+
return $dir;
|
135 |
+
}
|
136 |
+
|
137 |
+
/**
|
138 |
+
* Retrieve the plugin's options
|
139 |
+
*
|
140 |
+
* Retrieve the plugin's options based on context
|
141 |
+
*
|
142 |
+
* @since 5.0.0
|
143 |
+
* @access static
|
144 |
+
*
|
145 |
+
* @param string $context Context to retrieve options for. This is used as an array key.
|
146 |
+
* @param bool $force_reload Whether to retrieve cached options or forcefully retrieve from the database.
|
147 |
+
* @return array All options if no context, or associative array if context is set. Empty array if no options.
|
148 |
+
*/
|
149 |
+
public static function get_options( $context = '', $force_reload = false ) {
|
150 |
+
//Try to get cached options
|
151 |
+
$options = self::$options;
|
152 |
+
if ( false === $options || true === $force_reload ) {
|
153 |
+
$options = get_site_option( 'MPSUM', false, false );
|
154 |
+
}
|
155 |
+
|
156 |
+
if ( false === $options ) {
|
157 |
+
$options = self::maybe_migrate_options();
|
158 |
+
}
|
159 |
+
|
160 |
+
//Store options
|
161 |
+
if ( !is_array( $options ) ) {
|
162 |
+
$options = array();
|
163 |
+
}
|
164 |
+
self::$options = $options;
|
165 |
+
|
166 |
+
//Attempt to get context
|
167 |
+
if ( !empty( $context ) && is_string( $context ) ) {
|
168 |
+
if ( array_key_exists( $context, $options ) ) {
|
169 |
+
return (array)$options[ $context ];
|
170 |
+
} else {
|
171 |
+
return array();
|
172 |
+
}
|
173 |
+
}
|
174 |
+
|
175 |
+
|
176 |
+
return $options;
|
177 |
+
} //get_options
|
178 |
+
|
179 |
+
/**
|
180 |
+
* Auto-loads classes.
|
181 |
+
*
|
182 |
+
* Auto-load classes that belong to this plugin.
|
183 |
+
*
|
184 |
+
* @since 5.0.0
|
185 |
+
* @access private
|
186 |
+
*
|
187 |
+
* @param string $class_name The name of the class.
|
188 |
+
*/
|
189 |
+
private function loader( $class_name ) {
|
190 |
+
if ( class_exists( $class_name, false ) || false === strpos( $class_name, 'MPSUM' ) ) {
|
191 |
+
return;
|
192 |
+
}
|
193 |
+
$file = MPSUM_Updates_Manager::get_plugin_dir( "includes/{$class_name}.php" );
|
194 |
+
if ( file_exists( $file ) ) {
|
195 |
+
include_once( $file );
|
196 |
+
}
|
197 |
+
}
|
198 |
+
|
199 |
+
/**
|
200 |
+
* Determine whether to migrate options from an older version of the plugin.
|
201 |
+
*
|
202 |
+
* Migrate old options to new plugin format.
|
203 |
+
*
|
204 |
+
* @since 5.0.0
|
205 |
+
* @access private
|
206 |
+
*
|
207 |
+
* @return bool|array false if no migration, associative array of options if migration successful
|
208 |
+
*/
|
209 |
+
public static function maybe_migrate_options() {
|
210 |
+
$options = false;
|
211 |
+
$original_options = get_option( '_disable_updates', false );
|
212 |
+
|
213 |
+
if ( false !== $original_options && is_array( $original_options ) ) {
|
214 |
+
$options = array(
|
215 |
+
'core' => array(),
|
216 |
+
'plugins' => array(),
|
217 |
+
'themes' => array()
|
218 |
+
);
|
219 |
+
//Global WP Updates
|
220 |
+
if ( isset( $original_options[ 'all' ] ) && "1" === $original_options[ 'all' ] ) {
|
221 |
+
$options[ 'core' ][ 'all_updates' ] = 'off';
|
222 |
+
}
|
223 |
+
//Global Plugin Updates
|
224 |
+
if ( isset( $original_options[ 'plugin' ] ) && "1" === $original_options[ 'plugin' ] ) {
|
225 |
+
$options[ 'core' ][ 'plugin_updates' ] = 'off';
|
226 |
+
}
|
227 |
+
//Global Theme Updates
|
228 |
+
if ( isset( $original_options[ 'theme' ] ) && "1" === $original_options[ 'theme' ] ) {
|
229 |
+
$options[ 'core' ][ 'theme_updates' ] = 'off';
|
230 |
+
}
|
231 |
+
//Global Core Updates
|
232 |
+
if ( isset( $original_options[ 'core' ] ) && "1" === $original_options[ 'core' ] ) {
|
233 |
+
$options[ 'core' ][ 'core_updates' ] = 'off';
|
234 |
+
}
|
235 |
+
//Global Individual Theme Updates
|
236 |
+
if ( isset( $original_options[ 'it' ] ) && "1" === $original_options[ 'it' ] ) {
|
237 |
+
if ( isset( $original_options[ 'themes' ] ) && is_array( $original_options[ 'themes' ] ) ) {
|
238 |
+
$options[ 'themes' ] = $original_options[ 'themes' ];
|
239 |
+
}
|
240 |
+
}
|
241 |
+
//Global Individual Plugin Updates
|
242 |
+
if ( isset( $original_options[ 'ip' ] ) && "1" === $original_options[ 'ip' ] ) {
|
243 |
+
if ( isset( $original_options[ 'plugins' ] ) && is_array( $original_options[ 'plugins' ] ) ) {
|
244 |
+
$options[ 'plugins' ] = $original_options[ 'plugins' ];
|
245 |
+
}
|
246 |
+
}
|
247 |
+
//Browser Nag
|
248 |
+
if ( isset( $original_options[ 'bnag' ] ) && "1" === $original_options[ 'bnag' ] ) {
|
249 |
+
$options[ 'core' ][ 'misc_browser_nag' ] = 'off';
|
250 |
+
}
|
251 |
+
//WordPress Version
|
252 |
+
if ( isset( $original_options[ 'wpv' ] ) && "1" === $original_options[ 'wpv' ] ) {
|
253 |
+
$options[ 'core' ][ 'misc_wp_footer' ] = 'off';
|
254 |
+
}
|
255 |
+
//Translation Updates
|
256 |
+
if ( isset( $original_options[ 'auto-translation-updates' ] ) && "1" === $original_options[ 'auto-translation-updates' ] ) {
|
257 |
+
$options[ 'core' ][ 'automatic_translation_updates' ] = 'off';
|
258 |
+
}
|
259 |
+
//Translation Updates
|
260 |
+
if ( isset( $original_options[ 'auto-core-emails' ] ) && "1" === $original_options[ 'auto-core-emails' ] ) {
|
261 |
+
$options[ 'core' ][ 'notification_core_update_emails' ] = 'off';
|
262 |
+
}
|
263 |
+
//Automatic Updates
|
264 |
+
if ( isset( $original_options[ 'abup' ] ) && "1" === $original_options[ 'abup' ] ) {
|
265 |
+
$options[ 'core' ][ 'automatic_major_updates' ] = 'off';
|
266 |
+
$options[ 'core' ][ 'automatic_minor_updates' ] = 'off';
|
267 |
+
$options[ 'core' ][ 'automatic_plugin_updates' ] = 'off';
|
268 |
+
$options[ 'core' ][ 'automatic_theme_updates' ] = 'off';
|
269 |
+
}
|
270 |
+
|
271 |
+
delete_option( '_disable_updates' );
|
272 |
+
delete_site_option( '_disable_updates' );
|
273 |
+
update_site_option( 'MPSUM', $options );
|
274 |
+
|
275 |
+
}
|
276 |
+
return $options;
|
277 |
+
}
|
278 |
+
|
279 |
+
/**
|
280 |
+
* Initialize the plugin and its dependencies.
|
281 |
+
*
|
282 |
+
* Initialize the plugin and its dependencies.
|
283 |
+
*
|
284 |
+
* @since 5.0.0
|
285 |
+
* @access public
|
286 |
+
* @see __construct
|
287 |
+
* @internal Uses plugins_loaded action
|
288 |
+
*
|
289 |
+
*/
|
290 |
+
public function plugins_loaded() {
|
291 |
+
//Skip disable updates if a user is excluded
|
292 |
+
$disable_updates_skip = false;
|
293 |
+
if ( current_user_can( 'install_plugins' ) ) {
|
294 |
+
$current_user = wp_get_current_user();
|
295 |
+
$current_user_id = $current_user->ID;
|
296 |
+
$excluded_users = MPSUM_Updates_Manager::get_options( 'excluded_users' );
|
297 |
+
if ( in_array( $current_user_id, $excluded_users ) ) {
|
298 |
+
$disable_updates_skip = true;
|
299 |
+
}
|
300 |
+
}
|
301 |
+
if ( false === $disable_updates_skip ) {
|
302 |
+
MPSUM_Disable_Updates::run();
|
303 |
+
}
|
304 |
+
|
305 |
+
add_action( 'wp_ajax_mpsum_ajax_action', array( $this, 'ajax_update_option' ) );
|
306 |
+
|
307 |
+
|
308 |
+
$not_doing_ajax = ( !defined( 'DOING_AJAX' ) || !DOING_AJAX );
|
309 |
+
$not_admin_disabled = ( !defined( 'MPSUM_DISABLE_ADMIN' ) || !MPSUM_DISABLE_ADMIN );
|
310 |
+
if ( is_admin() && $not_doing_ajax && $not_admin_disabled ) {
|
311 |
+
MPSUM_Admin::run();
|
312 |
+
}
|
313 |
+
}
|
314 |
+
|
315 |
+
public function ajax_update_option() {
|
316 |
+
if ( !wp_verify_nonce( $_POST[ '_ajax_nonce' ], 'mpsum_options_save' ) ) {
|
317 |
+
die( 'Cheating, huh' );
|
318 |
+
}
|
319 |
+
if ( !isset( $_POST[ 'context' ] ) || !isset( $_POST[ 'data_action' ] ) ) {
|
320 |
+
die('');
|
321 |
+
}
|
322 |
+
/* Get Ajax Options */
|
323 |
+
$context = sanitize_text_field( $_POST[ 'context' ] );
|
324 |
+
$option = sanitize_text_field( $_POST[ 'data_action' ] );
|
325 |
+
$option_value = sanitize_text_field( $_POST[ 'checked' ] );
|
326 |
+
$val = sanitize_text_field( $_POST[ 'val' ] );
|
327 |
+
|
328 |
+
|
329 |
+
$options = MPSUM_Updates_Manager::get_options( $context );
|
330 |
+
$options = wp_parse_args( $options, MPSUM_Admin_Core::get_defaults() );
|
331 |
+
if ( 'core' == $context ) {
|
332 |
+
$options[ $option ] = $option_value;
|
333 |
+
if ( $option == 'automatic_theme_updates' || $option == 'automatic_plugin_updates' ) {
|
334 |
+
$options[ $option ] = $val;
|
335 |
+
}
|
336 |
+
MPSUM_Updates_Manager::update_options( $options, $context );
|
337 |
+
} else if ( 'plugins' == $context || 'themes' == $context ) {
|
338 |
+
$plugin_options = MPSUM_Updates_Manager::get_options( $context );
|
339 |
+
if ( 'on' == $option_value ) {
|
340 |
+
foreach( $plugin_options as $plugin ) {
|
341 |
+
if ( ( $key = array_search( $option, $plugin_options ) ) !== false ) {
|
342 |
+
unset( $plugin_options[ $key ] );
|
343 |
+
}
|
344 |
+
}
|
345 |
+
} else {
|
346 |
+
$plugin_options[] = $option;
|
347 |
+
$plugin_options = array_values( array_unique( $plugin_options ) );
|
348 |
+
}
|
349 |
+
|
350 |
+
MPSUM_Updates_Manager::update_options( $plugin_options, $context );
|
351 |
+
} elseif( 'plugins_automatic' == $context || 'themes_automatic' == $context ) {
|
352 |
+
$plugin_options = MPSUM_Updates_Manager::get_options( $context );
|
353 |
+
if ( 'off' == $option_value ) {
|
354 |
+
foreach( $plugin_options as $plugin ) {
|
355 |
+
if ( ( $key = array_search( $option, $plugin_options ) ) !== false ) {
|
356 |
+
unset( $plugin_options[ $key ] );
|
357 |
+
}
|
358 |
+
}
|
359 |
+
} else {
|
360 |
+
$options = MPSUM_Updates_Manager::get_options( $context );
|
361 |
+
$options[] = $option;
|
362 |
+
$plugin_options = array_values( array_unique( $options ) );
|
363 |
+
}
|
364 |
+
|
365 |
+
MPSUM_Updates_Manager::update_options( $plugin_options, $context );
|
366 |
+
}
|
367 |
+
|
368 |
+
die( $context );
|
369 |
+
|
370 |
+
}
|
371 |
+
|
372 |
+
/**
|
373 |
+
* Save plugin options.
|
374 |
+
*
|
375 |
+
* Saves the plugin options based on context. If no context is provided, updates all options.
|
376 |
+
*
|
377 |
+
* @since 5.0.0
|
378 |
+
* @access static
|
379 |
+
*
|
380 |
+
* @param array $options Associative array of plugin options.
|
381 |
+
* @param string $context Array key of which options to update
|
382 |
+
*/
|
383 |
+
public static function update_options( $options = array(), $context = '' ) {
|
384 |
+
$options_to_save = self::get_options();
|
385 |
+
|
386 |
+
if ( !empty( $context ) && is_string( $context ) ) {
|
387 |
+
$options_to_save[ $context ] = $options;
|
388 |
+
} else {
|
389 |
+
$options_to_save = $options;
|
390 |
+
}
|
391 |
+
|
392 |
+
self::$options = $options_to_save;
|
393 |
+
update_site_option( 'MPSUM', $options_to_save );
|
394 |
+
}
|
395 |
+
|
396 |
+
} //end class MPSUM_Updates_Manager
|
397 |
+
|
398 |
+
MPSUM_Updates_Manager::get_instance();
|
readme.txt
CHANGED
@@ -3,7 +3,7 @@ Contributors: kidsguide, ronalfy, roary86, bigwing
|
|
3 |
Tags: updates manager, easy updates manager, disable updates manager, disable updates, update control, plugin updates, theme updates, core updates, automatic updates, multisite, logs
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 4.6
|
6 |
-
Stable tag: 6.2.
|
7 |
License: GPLv2 or later
|
8 |
Donate link: https://mediaron.com/contribute/
|
9 |
|
@@ -53,9 +53,10 @@ If you want to contribute to the translation, please go to https://translate.wor
|
|
53 |
9. Enable/Disable updates and automatic updates individually for themes
|
54 |
10. Advanced options tab
|
55 |
11. Help tab
|
56 |
-
12.
|
57 |
-
13.
|
58 |
-
14.
|
|
|
59 |
|
60 |
== Installation ==
|
61 |
<strong>Installing Easy Updates Manager in your WordPress Dashboard</strong> (recommended)
|
@@ -103,6 +104,17 @@ For additional information and FAQs for Easy Updates Manager check out our <a hr
|
|
103 |
|
104 |
== Changelog ==
|
105 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
106 |
= 6.2.0 =
|
107 |
Released 2016-08-17
|
108 |
|
@@ -241,6 +253,12 @@ In version 5.0.0 we completely re-wrote the plugin to offer a faster and more se
|
|
241 |
|
242 |
== Upgrade Notice ==
|
243 |
|
|
|
|
|
|
|
|
|
|
|
|
|
244 |
= 6.2.0 =
|
245 |
Added screen options for items per page and disabling the dashboard.
|
246 |
|
3 |
Tags: updates manager, easy updates manager, disable updates manager, disable updates, update control, plugin updates, theme updates, core updates, automatic updates, multisite, logs
|
4 |
Requires at least: 4.4
|
5 |
Tested up to: 4.6
|
6 |
+
Stable tag: 6.2.3
|
7 |
License: GPLv2 or later
|
8 |
Donate link: https://mediaron.com/contribute/
|
9 |
|
53 |
9. Enable/Disable updates and automatic updates individually for themes
|
54 |
10. Advanced options tab
|
55 |
11. Help tab
|
56 |
+
12. Screen Options
|
57 |
+
13. Enable Logs in Advanced options tab
|
58 |
+
14. Disable or Clear logs
|
59 |
+
15. Logs tab
|
60 |
|
61 |
== Installation ==
|
62 |
<strong>Installing Easy Updates Manager in your WordPress Dashboard</strong> (recommended)
|
104 |
|
105 |
== Changelog ==
|
106 |
|
107 |
+
= 6.2.3 =
|
108 |
+
Released 2016-08-21
|
109 |
+
|
110 |
+
* Bug fix: options setting on plugins screen disappeared
|
111 |
+
|
112 |
+
= 6.2.2 =
|
113 |
+
Released 2016-08-19
|
114 |
+
|
115 |
+
* Bug fix: manual updates of plugins and themes were showing as failures
|
116 |
+
* Bug fix: radio boxes on mobile were squished
|
117 |
+
|
118 |
= 6.2.0 =
|
119 |
Released 2016-08-17
|
120 |
|
253 |
|
254 |
== Upgrade Notice ==
|
255 |
|
256 |
+
= 6.2.3 =
|
257 |
+
Bug fix: options setting on plugins screen disappeared
|
258 |
+
|
259 |
+
= 6.2.2 =
|
260 |
+
Fixing issue with manual updates for logs. Fixing CSS issue for mobile.
|
261 |
+
|
262 |
= 6.2.0 =
|
263 |
Added screen options for items per page and disabling the dashboard.
|
264 |
|