first commit
This commit is contained in:
BIN
wp-content/plugins/disable-updates/assets/icon-128x128.png
Normal file
BIN
wp-content/plugins/disable-updates/assets/icon-128x128.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 4.8 KiB |
BIN
wp-content/plugins/disable-updates/assets/icon-256x256.png
Normal file
BIN
wp-content/plugins/disable-updates/assets/icon-256x256.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 9.2 KiB |
14
wp-content/plugins/disable-updates/assets/icon.svg
Normal file
14
wp-content/plugins/disable-updates/assets/icon.svg
Normal file
@@ -0,0 +1,14 @@
|
||||
<svg width="256" height="256" viewBox="0 0 256 256" fill="none" xmlns="http://www.w3.org/2000/svg">
|
||||
<title>Disable Updates plugin icon</title>
|
||||
<desc>Icon for the Disable Updates WordPress plugin. See https://wordpress.org/plugins/disable-updates/</desc>
|
||||
<mask id="mask" x="0" y="0" width="256" height="256">
|
||||
<circle cx="128" cy="128" r="128" fill="white" />
|
||||
</mask>
|
||||
<g mask="url(#mask)">
|
||||
<circle cx="128" cy="128" r="113" fill="white" stroke="#D60000" stroke-width="30" />
|
||||
<path d="M129.424 63C163.381 63 191.278 88.0513 195.991 120.589H216L182.331 158.982L148.663 120.589H170.98C168.828 111.194 163.547 102.804 155.999 96.7892C148.452 90.7749 139.083 87.4916 129.424 87.4755C115.476 87.4755 103.162 94.2902 95.3706 104.56L78.9212 85.8438C85.2173 78.66 92.9819 72.9046 101.693 68.9644C110.404 65.0241 119.86 62.9904 129.424 63ZM125.576 192C91.7152 192 63.7223 166.949 59.0087 134.411H39L72.6685 96.0178C83.9234 108.783 95.0821 121.645 106.337 134.411H84.0196C86.1716 143.806 91.4527 152.196 99.0005 158.211C106.548 164.225 115.917 167.508 125.576 167.524C139.524 167.524 151.837 160.71 159.629 150.44L176.079 169.156C169.789 176.347 162.025 182.108 153.313 186.048C144.6 189.989 135.142 192.019 125.576 192Z" fill="#282525">
|
||||
<animateTransform attributeType="xml" attributeName="transform" type="rotate" from="0 128 128" to="360 128 128" dur="8s" repeatCount="indefinite" />
|
||||
</path>
|
||||
<line x1="0" y1="0" x2="256" y2="256" stroke="#D60000" stroke-width="20" />
|
||||
</g>
|
||||
</svg>
|
||||
|
After Width: | Height: | Size: 1.5 KiB |
88
wp-content/plugins/disable-updates/disable-updates.php
Normal file
88
wp-content/plugins/disable-updates/disable-updates.php
Normal file
@@ -0,0 +1,88 @@
|
||||
<?php
|
||||
/*
|
||||
|
||||
Plugin Name: Disable Updates
|
||||
Plugin URI: https://wordpress.org/plugins/disable-updates/
|
||||
Description: A simple plugin that prevents updating the WordPress core, plugins and themes.
|
||||
Version: 1.4.2
|
||||
Author: Johan van der Wijk
|
||||
Author URI: https://vanderwijk.com/
|
||||
License: GPL-2.0+
|
||||
License URI: http://www.gnu.org/licenses/gpl-2.0.txt
|
||||
Text Domain: disable-updates
|
||||
Domain Path: /languages
|
||||
|
||||
*/
|
||||
|
||||
// add donation and review links to plugin description
|
||||
function du_plugin_links ( $links, $file ) {
|
||||
$base = plugin_basename( __FILE__ );
|
||||
if ( $file == $base ) {
|
||||
$links[] = '<a href="https://wordpress.org/support/plugin/disable-updates/reviews/#new-post" target="_blank">' . __( 'Review', 'disable-updates' ) . ' <span class="dashicons dashicons-thumbs-up"></span></a> | <a href="https://paypal.me/vanderwijk">' . __( 'Donate', 'disable-updates' ) . ' <span class="dashicons dashicons-money"></span></a>';
|
||||
}
|
||||
return $links;
|
||||
}
|
||||
add_filter ( 'plugin_row_meta', 'du_plugin_links', 10, 2 );
|
||||
|
||||
// remove cron events for core, themes and plugins
|
||||
function filter_cron_events ( $event ) {
|
||||
|
||||
$ignore = array (
|
||||
'wp_version_check',
|
||||
'wp_update_plugins',
|
||||
'wp_update_themes',
|
||||
'wp_maybe_auto_update',
|
||||
);
|
||||
|
||||
if ( in_array ( $event -> hook, $ignore ) ) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return $event;
|
||||
|
||||
}
|
||||
add_action ( 'schedule_event', 'filter_cron_events' );
|
||||
|
||||
// hide all upgrade notices
|
||||
function du_hide_admin_notices () {
|
||||
remove_action ( 'admin_notices', 'update_nag', 3 );
|
||||
}
|
||||
add_action ( 'admin_menu', 'du_hide_admin_notices' );
|
||||
|
||||
// remove the 'Updates' menu item from the admin interface
|
||||
function du_remove_menus () {
|
||||
global $submenu;
|
||||
remove_submenu_page ( 'index.php', 'update-core.php' );
|
||||
}
|
||||
add_action ( 'admin_menu', 'du_remove_menus', 102 );
|
||||
|
||||
// disable core, theme and plugin updates
|
||||
function du_disable_updates () {
|
||||
remove_action ( 'load-update-core.php', 'wp_update_core' );
|
||||
remove_action ( 'load-update-core.php', 'wp_update_themes' );
|
||||
remove_action ( 'load-update-core.php', 'wp_update_plugins' );
|
||||
}
|
||||
add_action ( 'init', 'du_disable_updates', 1 );
|
||||
|
||||
// fake last checked time (using __return_null makes the dashboard slow)
|
||||
function du_last_checked () {
|
||||
global $wp_version;
|
||||
return ( object ) array (
|
||||
'last_checked' => time (),
|
||||
'version_checked' => $wp_version,
|
||||
'updates' => array ()
|
||||
);
|
||||
}
|
||||
add_filter ( 'pre_site_transient_update_core', 'du_last_checked' );
|
||||
add_filter ( 'pre_site_transient_update_plugins', 'du_last_checked' ) ;
|
||||
add_filter ( 'pre_site_transient_update_themes', 'du_last_checked' );
|
||||
|
||||
// disable automatic updates
|
||||
add_filter ( 'automatic_updater_disabled', '__return_true' );
|
||||
|
||||
// disable update health check
|
||||
add_filter ( 'site_status_tests', function ( $tests ) {
|
||||
unset ( $tests['async']['background_updates'] );
|
||||
unset ( $tests['direct']['plugin_theme_auto_updates'] );
|
||||
return $tests;
|
||||
});
|
||||
Binary file not shown.
@@ -0,0 +1,53 @@
|
||||
msgid ""
|
||||
msgstr ""
|
||||
"Project-Id-Version: Disable Updates\n"
|
||||
"POT-Creation-Date: 2023-07-27 16:08+0200\n"
|
||||
"PO-Revision-Date: 2023-07-27 16:08+0200\n"
|
||||
"Last-Translator: \n"
|
||||
"Language-Team: \n"
|
||||
"Language: nl_NL\n"
|
||||
"MIME-Version: 1.0\n"
|
||||
"Content-Type: text/plain; charset=UTF-8\n"
|
||||
"Content-Transfer-Encoding: 8bit\n"
|
||||
"X-Generator: Poedit 3.3.2\n"
|
||||
"X-Poedit-Basepath: ..\n"
|
||||
"X-Poedit-Flags-xgettext: --add-comments=translators:\n"
|
||||
"X-Poedit-WPHeader: disable-updates.php\n"
|
||||
"X-Poedit-SourceCharset: UTF-8\n"
|
||||
"X-Poedit-KeywordsList: __;_e;_n:1,2;_x:1,2c;_ex:1,2c;_nx:4c,1,2;esc_attr__;"
|
||||
"esc_attr_e;esc_attr_x:1,2c;esc_html__;esc_html_e;esc_html_x:1,2c;"
|
||||
"_n_noop:1,2;_nx_noop:3c,1,2;__ngettext_noop:1,2\n"
|
||||
"X-Poedit-SearchPath-0: .\n"
|
||||
"X-Poedit-SearchPathExcluded-0: *.min.js\n"
|
||||
|
||||
#: disable-updates.php:31
|
||||
msgid "Review"
|
||||
msgstr "Schrijf een beoordeling"
|
||||
|
||||
#: disable-updates.php:31
|
||||
msgid "Donate"
|
||||
msgstr "Doneer"
|
||||
|
||||
#. Plugin Name of the plugin/theme
|
||||
msgid "Disable Updates"
|
||||
msgstr "Disable Updates"
|
||||
|
||||
#. Plugin URI of the plugin/theme
|
||||
msgid "https://wordpress.org/plugins/disable-updates/"
|
||||
msgstr "https://wordpress.org/plugins/disable-updates/"
|
||||
|
||||
#. Description of the plugin/theme
|
||||
msgid ""
|
||||
"A simple plugin that prevents updating the WordPress core, plugins and "
|
||||
"themes."
|
||||
msgstr ""
|
||||
"Een eenvoudige plugin waarmee de WordPress core, plugin en thema-updates "
|
||||
"worden uitgeschakeld."
|
||||
|
||||
#. Author of the plugin/theme
|
||||
msgid "Johan van der Wijk"
|
||||
msgstr "Johan van der Wijk"
|
||||
|
||||
#. Author URI of the plugin/theme
|
||||
msgid "https://vanderwijk.com/"
|
||||
msgstr "https://vanderwijk.com"
|
||||
93
wp-content/plugins/disable-updates/readme.txt
Normal file
93
wp-content/plugins/disable-updates/readme.txt
Normal file
@@ -0,0 +1,93 @@
|
||||
=== Disable Updates for WordPress Core, Plugins and Themes ===
|
||||
Contributors: vanderwijk
|
||||
Donate link: https://www.paypal.me/vanderwijk
|
||||
Tags: disable updates, updates, plugin update, theme update, core update
|
||||
Requires PHP: 5.6
|
||||
Requires at least: 4.6
|
||||
Tested up to: 6.9
|
||||
Stable tag: 1.4.2
|
||||
License: GPLv2 or later
|
||||
License URI: https://www.gnu.org/licenses/gpl-2.0.html
|
||||
|
||||
Disables the WordPress update checking and notification system for all core, plugin and theme updates.
|
||||
|
||||
== Description ==
|
||||
|
||||
This plugin disables all WordPress updates (core, plugins and themes). This can be useful if you have multiple environments such as a live and staging server and you don't want your users to use the update functionality.
|
||||
|
||||
This plugin not only disables the update mechanism for the core, plugins and themes, but it also removes the update menu item from the left navigation menu in the admin dashboard.
|
||||
|
||||
== Screenshots ==
|
||||
|
||||
1. WordPress dashboard before activating the plugin.
|
||||
2. After activating the plugin all update notices are disabled.
|
||||
|
||||
== Installation ==
|
||||
|
||||
1. Unzip the zip file and upload the folder to the `wp-content/plugins/` directory.
|
||||
2. Activate the plugin through the 'Plugins' menu in WordPress.
|
||||
|
||||
== Frequently Asked Questions ==
|
||||
|
||||
= I am not sure what this plugin does, should I be using it? =
|
||||
|
||||
No, keeping WordPress up-to-date is very important for security reasons. You should only disable WordPress updates if you keep your system up to date using another mechanism such as a staging server or svn.
|
||||
|
||||
= Can I submit a feature request or bug report? =
|
||||
|
||||
Yes, please use the [support forum](https://wordpress.org/support/plugin/disable-updates/) to report any issues you may have. You can submit code suggestions in the [GitHub repository](https://github.com/vanderwijk/disable-updates).
|
||||
|
||||
== Changelog ==
|
||||
|
||||
= 1.4.2 =
|
||||
WP 6.9 compatibility tested
|
||||
|
||||
= 1.4.1 =
|
||||
WP 6.8 compatibility tested
|
||||
|
||||
= 1.4.0 =
|
||||
WP 6.7 compatibility tested
|
||||
|
||||
= 1.3.9 =
|
||||
WP 6.6 compatibility tested
|
||||
|
||||
= 1.3.8 =
|
||||
WP 6.5 compatibility tested
|
||||
|
||||
= 1.3.7 =
|
||||
WP 6.4 compatibility tested
|
||||
|
||||
= 1.3.6 =
|
||||
Using `add_filter ( 'pre_site_transient_update_core', '__return_null' );` slowed down the admin dashboard because it invalidated the transient. Added `du_last_checked` function to fake last update check which tricks WordPress into thinking the check has happened and nothing needs to be updated.
|
||||
|
||||
= 1.3.5 =
|
||||
Changed minimum WordPress version to 4.6
|
||||
|
||||
= 1.3.4 =
|
||||
Corrected translation filenames
|
||||
|
||||
= 1.3.2 =
|
||||
Disable update health check
|
||||
|
||||
= 1.3.0 =
|
||||
Added translation support
|
||||
|
||||
= 1.2.9 =
|
||||
WordPress 6.3 compatibility tested
|
||||
|
||||
= 1.2.5 =
|
||||
WordPress 5.8 compatibility tested
|
||||
|
||||
= 1.2 =
|
||||
PHP 7.2 compatibility update
|
||||
|
||||
= 1.1 =
|
||||
Added `automatic_updater_disabled` filter
|
||||
|
||||
= 1.0 =
|
||||
Initial release
|
||||
|
||||
== Upgrade Notice ==
|
||||
|
||||
= 1.3.6 =
|
||||
Massive dashboard speed improvement by faking last update check
|
||||
BIN
wp-content/plugins/disable-updates/screenshot-1.png
Normal file
BIN
wp-content/plugins/disable-updates/screenshot-1.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 584 KiB |
BIN
wp-content/plugins/disable-updates/screenshot-2.png
Normal file
BIN
wp-content/plugins/disable-updates/screenshot-2.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 554 KiB |
Reference in New Issue
Block a user