1010Plugin Name: Disable All WordPress Updates
1111Description: Disables the theme, plugin and core update checking, the related cronjobs and notification system.
1212Plugin URI: https://wordpress.org/plugins/disable-wordpress-updates/
13- Version: 1.7.1
13+ Version: 1.8.0
1414Author: Oliver Schlöbe
1515Author URI: https://www.schloebe.de/
1616Text Domain: disable-wordpress-updates
1717Domain Path: /languages
1818License: GPL2
1919
20- Copyright 2013-2021 Oliver Schlöbe (email : [email protected] ) 20+ Copyright 2013-2024 Oliver Schlöbe (email : [email protected] ) 2121
2222This program is free software; you can redistribute it and/or modify
2323it under the terms of the GNU General Public License as published by
3939/**
4040 * Define the plugin version
4141 */
42- define ( " OSDWPUVERSION " , "1.7.1 " ) ;
42+ const OSDWPUVERSION = "1.8.0 " ;
4343
4444
4545/**
4848 * @package WordPress_Plugins
4949 * @subpackage OS_Disable_WordPress_Updates
5050 * @since 1.3
51- * @author scripts @schloebe.de
51+ * @author wordpress @schloebe.de
5252 */
5353class OS_Disable_WordPress_Updates {
5454 /**
@@ -58,7 +58,7 @@ class OS_Disable_WordPress_Updates {
5858 * PHP 5 Constructor
5959 *
6060 * @since 1.3
61- * @author scripts @schloebe.de
61+ * @author wordpress @schloebe.de
6262 */
6363 function __construct () {
6464 add_action ( 'admin_init ' , array (&$ this , 'admin_init ' ) );
@@ -67,44 +67,44 @@ function __construct() {
6767 * Disable Theme Updates
6868 * 2.8 to 3.0
6969 */
70- add_filter ( 'pre_transient_update_themes ' , array ( $ this , 'last_checked_atm ' ) );
70+ add_filter ( 'pre_transient_update_themes ' , [ $ this , 'last_checked_atm ' ] );
7171 /*
7272 * 3.0
7373 */
74- add_filter ( 'pre_site_transient_update_themes ' , array ( $ this , 'last_checked_atm ' ) );
74+ add_filter ( 'pre_site_transient_update_themes ' , [ $ this , 'last_checked_atm ' ] );
7575
7676
7777 /*
7878 * Disable Plugin Updates
7979 * 2.8 to 3.0
8080 */
81- add_action ( 'pre_transient_update_plugins ' , array ( $ this , 'last_checked_atm ' ) );
81+ add_action ( 'pre_transient_update_plugins ' , [ $ this , 'last_checked_atm ' ] );
8282 /*
8383 * 3.0
8484 */
85- add_filter ( 'pre_site_transient_update_plugins ' , array ( $ this , 'last_checked_atm ' ) );
85+ add_filter ( 'pre_site_transient_update_plugins ' , [ $ this , 'last_checked_atm ' ] );
8686
8787
8888 /*
8989 * Disable Core Updates
9090 * 2.8 to 3.0
9191 */
92- add_filter ( 'pre_transient_update_core ' , array ( $ this , 'last_checked_atm ' ) );
92+ add_filter ( 'pre_transient_update_core ' , [ $ this , 'last_checked_atm ' ] );
9393 /*
9494 * 3.0
9595 */
96- add_filter ( 'pre_site_transient_update_core ' , array ( $ this , 'last_checked_atm ' ) );
96+ add_filter ( 'pre_site_transient_update_core ' , [ $ this , 'last_checked_atm ' ] );
9797
9898
9999 /*
100100 * Filter schedule checks
101101 *
102102 * @link https://wordpress.org/support/topic/possible-performance-improvement/#post-8970451
103103 */
104- add_action ('schedule_event ' , array ( $ this , 'filter_cron_events ' ) );
104+ add_action ('schedule_event ' , [ $ this , 'filter_cron_events ' ] );
105105
106- add_action ( 'pre_set_site_transient_update_plugins ' , array ( $ this , 'last_checked_atm ' ) , 21 , 1 );
107- add_action ( 'pre_set_site_transient_update_themes ' , array ( $ this , 'last_checked_atm ' ) , 21 , 1 );
106+ add_action ( 'pre_set_site_transient_update_plugins ' , [ $ this , 'last_checked_atm ' ] , 21 , 1 );
107+ add_action ( 'pre_set_site_transient_update_themes ' , [ $ this , 'last_checked_atm ' ] , 21 , 1 );
108108
109109 /*
110110 * Disable All Automatic Updates
@@ -133,22 +133,22 @@ function __construct() {
133133 if ( !defined ( 'AUTOMATIC_UPDATER_DISABLED ' ) ) define ( 'AUTOMATIC_UPDATER_DISABLED ' , true );
134134 if ( !defined ( 'WP_AUTO_UPDATE_CORE ' ) ) define ( 'WP_AUTO_UPDATE_CORE ' , false );
135135
136- add_filter ( 'pre_http_request ' , array ( $ this , 'block_request ' ) , 10 , 3 );
136+ add_filter ( 'pre_http_request ' , [ $ this , 'block_request ' ] , 10 , 3 );
137137 }
138138
139139
140140 /**
141141 * Initialize and load the plugin stuff
142142 *
143143 * @since 1.3
144- * @author scripts @schloebe.de
144+ * @author wordpress @schloebe.de
145145 */
146146 function admin_init () {
147147 if ( !function_exists ("remove_action " ) ) return ;
148148
149149 if ( current_user_can ( 'update_core ' ) ) {
150- add_action ( 'admin_bar_menu ' , array ( $ this , 'add_adminbar_items ' ) , 100 );
151- add_action ( 'admin_enqueue_scripts ' , array ( $ this , 'admin_css_overrides ' ) );
150+ add_action ( 'admin_bar_menu ' , [ $ this , 'add_adminbar_items ' ] , 100 );
151+ add_action ( 'admin_enqueue_scripts ' , [ $ this , 'admin_css_overrides ' ] );
152152 }
153153
154154 /*
@@ -160,7 +160,7 @@ function admin_init() {
160160 /*
161161 * Hide maintenance and update nag
162162 */
163- add_filter ( 'site_status_tests ' , array ( $ this , 'site_status_tests ' ) );
163+ add_filter ( 'site_status_tests ' , [ $ this , 'site_status_tests ' ] );
164164 remove_action ( 'admin_notices ' , 'update_nag ' , 3 );
165165 remove_action ( 'network_admin_notices ' , 'update_nag ' , 3 );
166166 remove_action ( 'admin_notices ' , 'maintenance_nag ' );
@@ -253,19 +253,19 @@ public function site_status_tests($tests) {
253253 public function add_adminbar_items ($ admin_bar ) {
254254 $ plugin_data = get_plugin_data ( __FILE__ );
255255
256- $ admin_bar ->add_menu ( array (
257- 'id ' => 'dwuos-notice ' ,
256+ $ admin_bar ->add_menu ([
257+ 'id ' => 'dwuos-notice ' ,
258258 'title ' => '<span class="dashicons dashicons-info" aria-hidden="true"></span> ' ,
259- 'href ' => network_admin_url ('plugins.php ' ),
260- 'meta ' => array (
259+ 'href ' => network_admin_url ('plugins.php ' ),
260+ 'meta ' => [
261261 'class ' => 'wp-admin-bar-dwuos-notice ' ,
262262 'title ' => sprintf (
263263 /* translators: %s: Name of the plugin */
264- __ ( '"%s" plugin is enabled! ' , 'disable-wordpress-updates ' ),
264+ __ ('"%s" plugin is enabled! ' , 'disable-wordpress-updates ' ),
265265 $ plugin_data ['Name ' ]
266266 )
267- ) ,
268- ) );
267+ ] ,
268+ ] );
269269 }
270270
271271
@@ -336,10 +336,10 @@ public function filter_cron_events($event) {
336336 * @since 1.6.0
337337 */
338338 public function last_checked_atm ( $ t ) {
339- include ( ABSPATH . WPINC . '/version.php ' ) ;
339+ include ABSPATH . WPINC . '/version.php ' ;
340340
341341 $ current = new stdClass ;
342- $ current ->updates = array () ;
342+ $ current ->updates = [] ;
343343 $ current ->version_checked = $ wp_version ;
344344 $ current ->last_checked = time ();
345345
0 commit comments