Skip to content
Snippets Groups Projects
Commit 4e502b24 authored by lucha's avatar lucha
Browse files

added disable-wordpress-updates as a mu-plugin, with patch

parent f7c13600
Branches
No related tags found
No related merge requests found
...@@ -20,29 +20,27 @@ ...@@ -20,29 +20,27 @@
"php": ">=7.1", "php": ">=7.1",
"composer/installers": "^1.8", "composer/installers": "^1.8",
"cweagans/composer-patches": "^1.6", "cweagans/composer-patches": "^1.6",
"koodimonni/composer-dropin-installer": "^1.2",
"johnpbloch/wordpress": "^5.4", "johnpbloch/wordpress": "^5.4",
"bjornjohansen/wplang": "^0.1.1", "bjornjohansen/wplang": "^0.1.1",
"lkwdwrd/wp-muplugin-loader": "^1.0",
"wpackagist-theme/minimalism": "1.0.3", "wpackagist-theme/minimalism": "1.0.3",
"koodimonni/composer-dropin-installer": "^1.2", "wpackagist-plugin/hyperdb": "^1.6",
"wpackagist-plugin/hyperdb": "^1.6" "wpackagist-plugin/disable-wordpress-updates": "^1.6"
}, },
"extra": { "extra": {
"wordpress-install-dir": "web/wp", "wordpress-install-dir": "web/wp",
"installer-paths": { "installer-paths": {
"vendor/{$name}": ["wpackagist-plugin/hyperdb"], "web/vendor/{$name}": ["wpackagist-plugin/hyperdb"],
"web/app/mu-plugins/{$name}/": ["type:wordpress-muplugin"], "web/vendor/{$name}/": ["type:wordpress-muplugin"],
"web/app/plugins/{$name}/": ["type:wordpress-plugin"], "web/app/plugins/{$name}/": ["type:wordpress-plugin"],
"web/app/themes/{$name}/": ["type:wordpress-theme"] "web/app/themes/{$name}/": ["type:wordpress-theme"]
}, },
"wordpress-language-dir": "web/app/languages", "wordpress-language-dir": "web/app/languages",
"wordpress-languages": [ "en_GB", "it_IT" ], "wordpress-languages": [ "en_GB", "it_IT" ],
"patches-file": "composer.patches.json", "patches-file": "composer.patches.json",
"force-mu": [
"disable-wordpress-updates"
],
"dropin-paths": { "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"]
} }
} }
} }
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "7857809a1c2b51ea4d9581f6e2bcc2c3", "content-hash": "d57c53958c37d8c03057c125316c013b",
"packages": [ "packages": [
{ {
"name": "bjornjohansen/wplang", "name": "bjornjohansen/wplang",
...@@ -388,53 +388,29 @@ ...@@ -388,53 +388,29 @@
"time": "2018-02-04T10:52:01+00:00" "time": "2018-02-04T10:52:01+00:00"
}, },
{ {
"name": "lkwdwrd/wp-muplugin-loader", "name": "wpackagist-plugin/disable-wordpress-updates",
"version": "1.0.5", "version": "1.6.6",
"source": { "source": {
"type": "git", "type": "svn",
"url": "https://github.com/lkwdwrd/wp-muplugin-loader.git", "url": "https://plugins.svn.wordpress.org/disable-wordpress-updates/",
"reference": "aed228e0037fc243c116a0d2d69076db5ed7d96b" "reference": "tags/1.6.6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/lkwdwrd/wp-muplugin-loader/zipball/aed228e0037fc243c116a0d2d69076db5ed7d96b", "url": "https://downloads.wordpress.org/plugin/disable-wordpress-updates.1.6.6.zip",
"reference": "aed228e0037fc243c116a0d2d69076db5ed7d96b", "reference": null,
"shasum": "" "shasum": null
}, },
"require": { "require": {
"composer-plugin-api": "^1.0" "composer/installers": "~1.0"
},
"require-dev": {
"10up/wp_mock": "dev-dev",
"codeclimate/php-test-reporter": "^0.4.4",
"phpunit/phpunit": "^7.1.4"
}, },
"type": "composer-plugin", "type": "wordpress-plugin",
"extra": { "extra": {
"class": "LkWdwrd\\Composer\\MULoaderPlugin" "patches_applied": {
}, "Disable automatic updates": "patches/0001-Patched-Disable-Updates-to-run-checks-during-cron-jo.patch"
"autoload": {
"psr-4": {
"LkWdwrd\\Composer\\": "src/lkwdwrd/Composer"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "homepage": "https://wordpress.org/plugins/disable-wordpress-updates/"
"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"
}, },
{ {
"name": "wpackagist-plugin/hyperdb", "name": "wpackagist-plugin/hyperdb",
......
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 index e3139547..dd58cca5 100644
--- a/wp-content/mu-plugins/disable-updates.php --- a/disable-updates.php
+++ b/wp-content/mu-plugins/disable-updates.php +++ b/disable-updates.php
@@ -59,6 +59,8 @@ class OS_Disable_WordPress_Updates { @@ -59,6 +59,8 @@ class OS_Disable_WordPress_Updates {
* @author scripts@schloebe.de * @author scripts@schloebe.de
*/ */
...@@ -11,17 +11,6 @@ index e3139547..dd58cca5 100644 ...@@ -11,17 +11,6 @@ index e3139547..dd58cca5 100644
add_action( 'admin_init', array(&$this, 'admin_init') ); 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 { @@ -129,6 +131,7 @@ class OS_Disable_WordPress_Updates {
if( !defined( 'WP_AUTO_UPDATE_CORE') ) define( 'WP_AUTO_UPDATE_CORE', false ); if( !defined( 'WP_AUTO_UPDATE_CORE') ) define( 'WP_AUTO_UPDATE_CORE', false );
...@@ -30,57 +19,3 @@ index e3139547..dd58cca5 100644 ...@@ -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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment