PluginProbe ʕ •ᴥ•ʔ
Easy Updates Manager / 8.0.5
Easy Updates Manager v8.0.5
trunk 2.0.0 2.1.0 2.2.0 2.2.1 2.3.0 2.4.0 2.5.0 2.5.1 2.6.0 2.7.0 3.0.0 3.1.0 3.2.0 3.3.0 3.4.0 3.5.0 3.6.0 4.0 4.0.2 4.0.3 4.1.0 4.1.10 4.1.12 4.2.21 4.2.24 4.3.0 4.3.10 4.3.12 4.3.13 4.6.0 4.7.0 5.0.0 5.1.0 5.1.1 5.2.0 5.3.0 5.3.1 5.3.2 5.4.0 5.4.1 5.4.2 5.4.3 5.4.5 6.0.0 6.0.1 6.0.3 6.0.5 6.1.0 6.1.1 6.1.3 6.1.5 6.1.8 6.2.0 6.2.11 6.2.2 6.2.3 6.2.5 6.2.7 6.2.9 6.3.0 6.3.1 6.3.3 6.4.0 6.4.4 6.4.6 6.4.7 6.4.8 7.0.0 7.0.1 7.0.2 7.0.3 8.0.1 8.0.2 8.0.3 8.0.5 8.1.0 8.1.1 8.2.0 9.0.0 9.0.1 9.0.10 9.0.11 9.0.12 9.0.13 9.0.14 9.0.15 9.0.16 9.0.17 9.0.18 9.0.19 9.0.20 9.0.21 9.0.3 9.0.5 9.0.6 9.0.7 9.0.8 9.0.9
stops-core-theme-and-plugin-updates / includes / MPSUM_Disable_Updates_Plugins.php
stops-core-theme-and-plugin-updates / includes Last commit date
MPSUM_Admin.php 7 years ago MPSUM_Admin_Advanced.php 7 years ago MPSUM_Admin_Advanced_Preview.php 7 years ago MPSUM_Admin_Ajax.php 7 years ago MPSUM_Admin_Bar.php 7 years ago MPSUM_Admin_Core.php 7 years ago MPSUM_Admin_Dashboard.php 7 years ago MPSUM_Admin_Help.php 7 years ago MPSUM_Admin_Logs.php 7 years ago MPSUM_Admin_Plugins.php 7 years ago MPSUM_Admin_Screen_Options.php 7 years ago MPSUM_Admin_Themes.php 7 years ago MPSUM_Advanced_Premium.php 7 years ago MPSUM_Check_Plugin_Install_Status.php 7 years ago MPSUM_Check_Theme_Install_Status.php 7 years ago MPSUM_Commands.php 7 years ago MPSUM_Disable_Updates.php 7 years ago MPSUM_Disable_Updates_All.php 7 years ago MPSUM_Disable_Updates_Plugins.php 7 years ago MPSUM_Disable_Updates_Themes.php 7 years ago MPSUM_Disable_Updates_Translations.php 7 years ago MPSUM_Disable_Updates_WordPress.php 7 years ago MPSUM_Exclude_Users.php 7 years ago MPSUM_Force_Updates.php 7 years ago MPSUM_List_Table.php 7 years ago MPSUM_Logs.php 7 years ago MPSUM_Logs_List_Table.php 7 years ago MPSUM_Plugins_List_Table.php 7 years ago MPSUM_Reset_Options.php 7 years ago MPSUM_Themes_List_Table.php 7 years ago MPSUM_UpdraftCentral.php 7 years ago MPSUM_UpdraftCentral_EUM_Commands.php 7 years ago MPSUM_Utils.php 7 years ago easy-updates-manager-notices.php 7 years ago updraft-notices.php 7 years ago
MPSUM_Disable_Updates_Plugins.php
109 lines
1 <?php
2 /**
3 * Disables all WordPress plugin updates.
4 *
5 * Disables all WordPress plugin updates.
6 *
7 * @package WordPress
8 * @since 5.0.0
9 */
10
11 /**
12 * Disable plugin updates
13 * Credit - From https://wordpress.org/plugins/disable-wordpress-updates/
14 */
15 class MPSUM_Disable_Updates_Plugins {
16
17 /**
18 * Constructor
19 */
20 public function __construct() {
21 add_action('admin_init', array($this, 'admin_init'));
22
23 /*
24 * Disable Plugin Updates
25 * 2.8 to 3.0
26 */
27 add_action('pre_transient_update_plugins', array($this, 'last_checked_now'), 10, 2);
28
29 /*
30 * 3.0
31 */
32 add_filter('pre_site_transient_update_plugins', array($this, 'last_checked_now'), 10, 2);
33
34 /*
35 * Disable All Automatic Updates (3.7+)
36 */
37 add_filter('auto_update_plugin', '__return_false');
38
39 } //end constructor
40
41 /**
42 * Initialize and load the plugin stuff
43 *
44 * @since 1.3
45 * @author scripts@schloebe.de
46 */
47 function admin_init() {
48 /*
49 * Disable Plugin Updates
50 * 2.8 to 3.0
51 */
52 remove_action('load-plugins.php', 'wp_update_plugins');
53 remove_action('load-update.php', 'wp_update_plugins');
54 remove_action('admin_init', '_maybe_update_plugins');
55 remove_action('wp_update_plugins', 'wp_update_plugins');
56 wp_clear_scheduled_hook('wp_update_plugins');
57
58 /*
59 * 3.0
60 */
61 remove_action('load-update-core.php', 'wp_update_plugins');
62 wp_clear_scheduled_hook('wp_update_plugins');
63
64 add_action('upgrader_process_complete', array($this, 'maybe_clear_transient'), 10, 2);
65
66 }
67
68 /**
69 * Fires when the auto updater is complete
70 *
71 * @param WP_Upgrader $wp_upgrader WP Upgrder Instance
72 * @param array $update_type Type of upgrade it's doing
73 */
74 public function maybe_clear_transient($wp_upgrader, $update_type) {
75 if (isset($update_type['type']) && 'translation' === $update_type['type']) {
76 delete_site_transient('eum_plugins_checked');
77 }
78 }
79
80 /**
81 * Last checked core updates
82 *
83 * @param string $transient Specify transients
84 * @param string $key Name of the transient
85 * @return object
86 */
87 public function last_checked_now($transient, $key) {
88 $checked = get_site_transient('eum_plugins_checked');
89 if ($checked) return $checked;
90 remove_action('pre_transient_update_plugins', array($this, 'last_checked_now'), 10, 2);
91 remove_filter('pre_site_transient_update_plugins', array($this, 'last_checked_now'), 10, 2);
92 delete_site_transient($key);
93 wp_update_plugins();
94 $option = get_site_transient($key);
95 include ABSPATH . WPINC . '/version.php';
96 $current = new stdClass;
97 $current->updates = array();
98 $current->version_checked = $wp_version;
99 $current->last_checked = time();
100 if (isset($option->translations)) {
101 $current->translations = $option->translations;
102 }
103 add_action('pre_transient_update_plugins', array($this, 'last_checked_now'), 10, 2);
104 add_filter('pre_site_transient_update_plugins', array($this, 'last_checked_now'), 10, 2);
105 set_site_transient('eum_plugins_checked', $current, 6 * 60 * 60);
106 return $current;
107 }
108 }
109