Skip to content

Commit 61764e1

Browse files
1.8.0
* WordPress 6.7 compatibility
1 parent 94893b8 commit 61764e1

File tree

2 files changed

+35
-32
lines changed

2 files changed

+35
-32
lines changed

disable-updates.php

Lines changed: 28 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@
1010
Plugin Name: Disable All WordPress Updates
1111
Description: Disables the theme, plugin and core update checking, the related cronjobs and notification system.
1212
Plugin URI: https://wordpress.org/plugins/disable-wordpress-updates/
13-
Version: 1.7.1
13+
Version: 1.8.0
1414
Author: Oliver Schlöbe
1515
Author URI: https://www.schloebe.de/
1616
Text Domain: disable-wordpress-updates
1717
Domain Path: /languages
1818
License: GPL2
1919
20-
Copyright 2013-2021 Oliver Schlöbe (email : [email protected])
20+
Copyright 2013-2024 Oliver Schlöbe (email : [email protected])
2121
2222
This program is free software; you can redistribute it and/or modify
2323
it under the terms of the GNU General Public License as published by
@@ -39,7 +39,7 @@
3939
/**
4040
* Define the plugin version
4141
*/
42-
define("OSDWPUVERSION", "1.7.1");
42+
const OSDWPUVERSION = "1.8.0";
4343

4444

4545
/**
@@ -48,7 +48,7 @@
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
*/
5353
class 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

readme.txt

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,10 @@
11
=== Disable All WordPress Updates ===
22
Contributors: Alphawolf
33
Donate link: https://www.schloebe.de/donate/
4-
Tags: disable, updates, theme, core, auto-update, update-check, version-check, browse-happy, serve-happy
4+
Tags: disable updates, update, theme, update control
55
Requires at least: 3.8
6-
Tested up to: 6.4.99
7-
Requires PHP: 5.6
6+
Tested up to: 6.7.99
7+
Requires PHP: 7.4
88
Stable tag: trunk
99
License: GPLv2 or later
1010
License URI: https://www.gnu.org/licenses/gpl-2.0.html
@@ -22,7 +22,7 @@ be **susceptible to security vulnerabilities** or performance issues.
2222
If you use this plugin, make sure you keep yourself up to date with new releases of your active WordPress version, plugins
2323
and themes and update them as new versions are released (simply by deactivating this plugin for a short time).
2424

25-
[Developer on Twitter](https://twitter.com/wpseek "Developer on Twitter")
25+
[Developer on X](https://twitter.com/wpseek "Developer on X")
2626

2727
**Looking for more WordPress plugins? Visit [www.schloebe.de/portfolio/](https://www.schloebe.de/portfolio/)**
2828

@@ -52,6 +52,9 @@ None. :)
5252

5353
== Changelog ==
5454

55+
= 1.8.0 =
56+
* WordPress 6.7 compatibility
57+
5558
= 1.7.1 =
5659
* Fixed PHP warnings (thanks TetsuyaXD!)
5760

0 commit comments

Comments
 (0)