From 4e502b24aed162e8ffce424c16916e43c02729ff Mon Sep 17 00:00:00 2001 From: lucha <lucha@paranoici.org> Date: Sat, 23 May 2020 11:37:42 -0700 Subject: [PATCH] added disable-wordpress-updates as a mu-plugin, with patch --- composer.json | 22 +++--- composer.lock | 52 ++++---------- ...Updates-to-run-checks-during-cron-jo.patch | 71 +------------------ 3 files changed, 27 insertions(+), 118 deletions(-) diff --git a/composer.json b/composer.json index 0530a085..02600989 100644 --- a/composer.json +++ b/composer.json @@ -20,29 +20,27 @@ "php": ">=7.1", "composer/installers": "^1.8", "cweagans/composer-patches": "^1.6", - "johnpbloch/wordpress": "^5.4", - "bjornjohansen/wplang": "^0.1.1", - "lkwdwrd/wp-muplugin-loader": "^1.0", - "wpackagist-theme/minimalism": "1.0.3", "koodimonni/composer-dropin-installer": "^1.2", - "wpackagist-plugin/hyperdb": "^1.6" + "johnpbloch/wordpress": "^5.4", + "bjornjohansen/wplang": "^0.1.1", + "wpackagist-theme/minimalism": "1.0.3", + "wpackagist-plugin/hyperdb": "^1.6", + "wpackagist-plugin/disable-wordpress-updates": "^1.6" }, "extra": { "wordpress-install-dir": "web/wp", "installer-paths": { - "vendor/{$name}": ["wpackagist-plugin/hyperdb"], - "web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"], + "web/vendor/{$name}": ["wpackagist-plugin/hyperdb"], + "web/vendor/{$name}/": ["type:wordpress-muplugin"], "web/app/plugins/{$name}/": ["type:wordpress-plugin"], "web/app/themes/{$name}/": ["type:wordpress-theme"] }, "wordpress-language-dir": "web/app/languages", "wordpress-languages": [ "en_GB", "it_IT" ], - "patches-file": "composer.patches.json", - "force-mu": [ - "disable-wordpress-updates" - ], + "patches-file": "composer.patches.json", "dropin-paths": { - "web/app": ["package:wpackagist-plugin/hyperdb:db.php"] + "web/app": ["package:wpackagist-plugin/hyperdb:db.php"], + "web/app/mu-plugins" : ["package:wpackagist-plugin/disable-wordpress-updates:disable-updates.php"] } } } diff --git a/composer.lock b/composer.lock index c8767f34..07714b15 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "7857809a1c2b51ea4d9581f6e2bcc2c3", + "content-hash": "d57c53958c37d8c03057c125316c013b", "packages": [ { "name": "bjornjohansen/wplang", @@ -388,53 +388,29 @@ "time": "2018-02-04T10:52:01+00:00" }, { - "name": "lkwdwrd/wp-muplugin-loader", - "version": "1.0.5", + "name": "wpackagist-plugin/disable-wordpress-updates", + "version": "1.6.6", "source": { - "type": "git", - "url": "https://github.com/lkwdwrd/wp-muplugin-loader.git", - "reference": "aed228e0037fc243c116a0d2d69076db5ed7d96b" + "type": "svn", + "url": "https://plugins.svn.wordpress.org/disable-wordpress-updates/", + "reference": "tags/1.6.6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/lkwdwrd/wp-muplugin-loader/zipball/aed228e0037fc243c116a0d2d69076db5ed7d96b", - "reference": "aed228e0037fc243c116a0d2d69076db5ed7d96b", - "shasum": "" + "url": "https://downloads.wordpress.org/plugin/disable-wordpress-updates.1.6.6.zip", + "reference": null, + "shasum": null }, "require": { - "composer-plugin-api": "^1.0" - }, - "require-dev": { - "10up/wp_mock": "dev-dev", - "codeclimate/php-test-reporter": "^0.4.4", - "phpunit/phpunit": "^7.1.4" + "composer/installers": "~1.0" }, - "type": "composer-plugin", + "type": "wordpress-plugin", "extra": { - "class": "LkWdwrd\\Composer\\MULoaderPlugin" - }, - "autoload": { - "psr-4": { - "LkWdwrd\\Composer\\": "src/lkwdwrd/Composer" + "patches_applied": { + "Disable automatic updates": "patches/0001-Patched-Disable-Updates-to-run-checks-during-cron-jo.patch" } }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Luke Woodward", - "email": "woodward.lucas@gmail.com" - } - ], - "description": "A drop-in MU Plugin loader for WordPress", - "keywords": [ - "loader", - "muplugin", - "wordpress" - ], - "time": "2018-04-20T22:09:51+00:00" + "homepage": "https://wordpress.org/plugins/disable-wordpress-updates/" }, { "name": "wpackagist-plugin/hyperdb", diff --git a/patches/0001-Patched-Disable-Updates-to-run-checks-during-cron-jo.patch b/patches/0001-Patched-Disable-Updates-to-run-checks-during-cron-jo.patch index 1ec7f9cd..dc01bcfb 100644 --- a/patches/0001-Patched-Disable-Updates-to-run-checks-during-cron-jo.patch +++ b/patches/0001-Patched-Disable-Updates-to-run-checks-during-cron-jo.patch @@ -1,7 +1,7 @@ -diff --git a/wp-content/mu-plugins/disable-updates.php b/wp-content/mu-plugins/disable-updates.php +diff --git a/disable-updates.php b/disable-updates.php index e3139547..dd58cca5 100644 ---- a/wp-content/mu-plugins/disable-updates.php -+++ b/wp-content/mu-plugins/disable-updates.php +--- a/disable-updates.php ++++ b/disable-updates.php @@ -59,6 +59,8 @@ class OS_Disable_WordPress_Updates { * @author scripts@schloebe.de */ @@ -11,17 +11,6 @@ index e3139547..dd58cca5 100644 add_action( 'admin_init', array(&$this, 'admin_init') ); /* -@@ -92,8 +94,8 @@ class OS_Disable_WordPress_Updates { - * 3.0 - */ - add_filter( 'pre_site_transient_update_core', array($this, 'last_checked_atm') ); -- -- -+ -+ - /* - * Filter schedule checks - * @@ -129,6 +131,7 @@ class OS_Disable_WordPress_Updates { if( !defined( 'WP_AUTO_UPDATE_CORE') ) define( 'WP_AUTO_UPDATE_CORE', false ); @@ -30,57 +19,3 @@ index e3139547..dd58cca5 100644 } -@@ -140,13 +143,13 @@ class OS_Disable_WordPress_Updates { - */ - function admin_init() { - if ( !function_exists("remove_action") ) return; -- -+ - /* - * Remove 'update plugins' option from bulk operations select list - */ - global $current_user; - $current_user->allcaps['update_plugins'] = 0; -- -+ - /* - * Hide maintenance and update nag - */ -@@ -154,7 +157,7 @@ class OS_Disable_WordPress_Updates { - remove_action( 'network_admin_notices', 'update_nag', 3 ); - remove_action( 'admin_notices', 'maintenance_nag' ); - remove_action( 'network_admin_notices', 'maintenance_nag' ); -- -+ - - /* - * Disable Theme Updates -@@ -263,8 +266,8 @@ class OS_Disable_WordPress_Updates { - } - return $event; - } -- -- -+ -+ - /** - * Override version check info - * -@@ -272,12 +275,12 @@ class OS_Disable_WordPress_Updates { - */ - public function last_checked_atm( $t ) { - include( ABSPATH . WPINC . '/version.php' ); -- -+ - $current = new stdClass; - $current->updates = array(); - $current->version_checked = $wp_version; - $current->last_checked = time(); -- -+ - return $current; - } - } --- -2.17.1 - -- GitLab