Ticket #7372: plugins-only.diff
| File plugins-only.diff, 1.9 KB (added by Otto42, 4 years ago) |
|---|
-
wp-includes/update.php
101 101 require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); 102 102 } 103 103 104 $plugins = get_plugins();105 $active = get_option( 'active_plugins' );106 107 $new_option = '';108 $new_option->last_checked = time();109 110 104 $plugin_changed = false; 111 foreach ( $plugins as $file => $p ) { 112 $new_option->checked[ $file ] = $p['Version']; 105 if ( strpos( $_SERVER['PHP_SELF'], 'plugins.php' ) !== false ) { 106 $plugins = get_plugins(); 107 $active = get_option( 'active_plugins' ); 113 108 114 if ( !isset( $current->checked[ $file ] ) ) { 115 $plugin_changed = true; 116 continue; 117 } 109 $new_option = ''; 110 $new_option->last_checked = time(); 118 111 119 if ( strval($current->checked[ $file ]) !== strval($p['Version']) ) 120 $plugin_changed = true; 121 } 122 123 foreach ( (array) $current->response as $plugin_file => $update_details ) { 124 if ( ! isset($plugins[ $plugin_file ]) ) { 125 $plugin_changed = true; 112 $plugin_changed = false; 113 foreach ( $plugins as $file => $p ) { 114 $new_option->checked[ $file ] = $p['Version']; 115 116 if ( !isset( $current->checked[ $file ] ) ) { 117 $plugin_changed = true; 118 continue; 119 } 120 121 if ( strval($current->checked[ $file ]) !== strval($p['Version']) ) 122 $plugin_changed = true; 126 123 } 124 125 foreach ( (array) $current->response as $plugin_file => $update_details ) { 126 if ( ! isset($plugins[ $plugin_file ]) ) { 127 $plugin_changed = true; 128 } 129 } 127 130 } 128 131 129 132 // Bail if we've checked in the last 12 hours and if nothing has changed 130 133 if ( $time_not_changed && !$plugin_changed ) 131 134 return false; 132 135 136 // get the plugins if we have not already 137 if (!$plugins) $plugins = get_plugins(); 138 133 139 $to_send->plugins = $plugins; 134 140 $to_send->active = $active; 135 141 $send = serialize( $to_send );
