first commit
This commit is contained in:
52
wp-content/mu-plugins/local-dev-performance.php
Normal file
52
wp-content/mu-plugins/local-dev-performance.php
Normal file
@@ -0,0 +1,52 @@
|
||||
<?php
|
||||
/**
|
||||
* Reduce wp-admin latency in local Docker environments without outbound internet.
|
||||
*/
|
||||
|
||||
if (!defined('ABSPATH')) {
|
||||
exit;
|
||||
}
|
||||
|
||||
if (function_exists('wp_get_environment_type') && wp_get_environment_type() !== 'local') {
|
||||
return;
|
||||
}
|
||||
|
||||
add_action('init', function () {
|
||||
remove_action('admin_init', '_maybe_update_core');
|
||||
remove_action('admin_init', '_maybe_update_plugins');
|
||||
remove_action('admin_init', '_maybe_update_themes');
|
||||
|
||||
wp_clear_scheduled_hook('wp_version_check');
|
||||
wp_clear_scheduled_hook('wp_update_plugins');
|
||||
wp_clear_scheduled_hook('wp_update_themes');
|
||||
}, 1);
|
||||
|
||||
add_filter('pre_site_transient_update_core', function () {
|
||||
return (object) [
|
||||
'updates' => [],
|
||||
'last_checked' => time(),
|
||||
'version_checked' => get_bloginfo('version'),
|
||||
];
|
||||
});
|
||||
|
||||
add_filter('pre_site_transient_update_plugins', function () {
|
||||
return (object) [
|
||||
'last_checked' => time(),
|
||||
'checked' => [],
|
||||
'response' => [],
|
||||
'no_update' => [],
|
||||
'translations' => [],
|
||||
];
|
||||
});
|
||||
|
||||
add_filter('pre_site_transient_update_themes', function () {
|
||||
return (object) [
|
||||
'last_checked' => time(),
|
||||
'checked' => [],
|
||||
'response' => [],
|
||||
'no_update' => [],
|
||||
'translations' => [],
|
||||
];
|
||||
});
|
||||
|
||||
add_filter('automatic_updater_disabled', '__return_true');
|
||||
Reference in New Issue
Block a user