Changeset 2967960
- Timestamp:
- 09/17/2023 10:17:39 AM (3 years ago)
- Location:
- object-cache-4-everyone/trunk
- Files:
-
- 3 edited
-
object-cache-4-everyone.php (modified) (6 diffs)
-
readme.txt (modified) (1 diff)
-
uninstall.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
object-cache-4-everyone/trunk/object-cache-4-everyone.php
r2967546 r2967960 6 6 * Plugin URI: https://wordpress.org/plugins/object-cache-4-everyone 7 7 * Author: fpuenteonline 8 * Version: 2.0 8 * Version: 2.0.1 9 9 * Author URI: https://twitter.com/fpuenteonline 10 10 * License: GPLv2 or later … … 20 20 exit; // Exit if accessed directly. 21 21 } 22 23 //Delete object-cache.php 24 include_once('oc4-deactivation.php'); 25 register_deactivation_hook(__FILE__, 'oc4everyone_deactivation'); 22 26 23 27 //First install … … 95 99 if (defined('WP_DEBUG') && WP_DEBUG) { 96 100 error_log('Object Cache 4 everyone::oc4everyone_admin_init_deactivate_itself'); 101 } 102 if (isset($_GET['activate'])) { 103 unset($_GET['activate']); 97 104 } 98 105 deactivate_plugins(plugin_basename(__FILE__), true); … … 201 208 //Memcached - Memcached Server not running 202 209 add_action('admin_notices', 'oc4everyone_admin_notices_no_server_running', PHP_INT_MAX); 203 } 210 } 211 //class_exists('Memcached') 204 212 } else { 205 213 add_action('admin_notices', 'oc4everyone_admin_notices_no_class_exists', PHP_INT_MAX); … … 241 249 add_action('plugins_loaded', 'oc4everyone_plugins_loaded_activation'); 242 250 243 //Delete object-cache.php 244 include_once('oc4-deactivation.php'); 245 register_deactivation_hook(__FILE__, 'oc4everyone_deactivation'); 246 247 248 function oc4everyone_add_server_info( $links_array, $plugin_file_name, $plugin_data, $status ) { 249 if ( strpos( $plugin_file_name, basename(__FILE__) ) ) { 250 global $wp_object_cache; 251 252 function oc4everyone_add_server_info($links_array, $plugin_file_name, $plugin_data, $status) 253 { 254 global $wp_object_cache; 255 256 if (strpos($plugin_file_name, basename(__FILE__)) && class_exists('Memcached') && method_exists($wp_object_cache, 'getStats') && file_exists(WP_CONTENT_DIR . DIRECTORY_SEPARATOR . 'object-cache.php')) { 251 257 252 258 $hits = $wp_object_cache->getStats()[OC4EVERYONE_PREDEFINED_SERVER]['get_hits']; … … 258 264 error_log('Object Cache 4 everyone::Memcached Server running'); 259 265 } 260 $links_array[count($links_array) - 1] = $links_array[count($links_array) - 1] . 261 '<br/><br/>' . 262 esc_html__('Memcached Server running:') . ' <strong><code style="background-color: inherit;">' . OC4EVERYONE_PREDEFINED_SERVER . '</code></strong>' . '<br/>' . 263 esc_html__('Cache Hit Ratio') . ' <strong><code style="background-color: inherit;">' . $found . '%</code></strong>' . '<br/>' . 264 esc_html__('Uptime:') . ' <strong><code style="background-color: inherit;">' . secondsToHumanReadable($wp_object_cache->getStats()[OC4EVERYONE_PREDEFINED_SERVER]['uptime']) . '</strong></code>' . '<br/>' . 265 esc_html__('Unique Items / Total Items:') . ' <strong><code style="background-color: inherit;">' . $wp_object_cache->getStats()[OC4EVERYONE_PREDEFINED_SERVER]['curr_items'] . ' / ' . $wp_object_cache->getStats()[OC4EVERYONE_PREDEFINED_SERVER]['total_items'] . '</strong></code>'; 266 } 267 268 return $links_array; 269 } 270 271 add_filter( 'plugin_row_meta', 'oc4everyone_add_server_info', PHP_INT_MAX, 4 ); 266 $links_array[count($links_array) - 1] = $links_array[count($links_array) - 1] . 267 '<br/><br/>' . 268 esc_html__('Memcached Server running:') . ' <strong><code style="background-color: inherit;">' . OC4EVERYONE_PREDEFINED_SERVER . '</code></strong>' . '<br/>' . 269 esc_html__('Cache Hit Ratio') . ' <strong><code style="background-color: inherit;">' . $found . '%</code></strong>' . '<br/>' . 270 esc_html__('Uptime:') . ' <strong><code style="background-color: inherit;">' . secondsToHumanReadable($wp_object_cache->getStats()[OC4EVERYONE_PREDEFINED_SERVER]['uptime']) . '</strong></code>' . '<br/>' . 271 esc_html__('Unique Items / Total Items:') . ' <strong><code style="background-color: inherit;">' . $wp_object_cache->getStats()[OC4EVERYONE_PREDEFINED_SERVER]['curr_items'] . ' / ' . $wp_object_cache->getStats()[OC4EVERYONE_PREDEFINED_SERVER]['total_items'] . '</strong></code>'; 272 } 273 274 return $links_array; 275 } 276 add_filter('plugin_row_meta', 'oc4everyone_add_server_info', PHP_INT_MAX, 4); 272 277 273 278 -
object-cache-4-everyone/trunk/readme.txt
r2967546 r2967960 4 4 Requires at least: 5.0 5 5 Tested up to: 6.3 6 Stable tag: 2.0 6 Stable tag: 2.0.1 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later -
object-cache-4-everyone/trunk/uninstall.php
r2306156 r2967960 9 9 defined('WP_UNINSTALL_PLUGIN') || exit; 10 10 11 if (defined('WP_DEBUG') && WP_DEBUG) { 12 error_log('uninstall.php'); 13 } 14 11 15 //Delete object-cache.php 12 16 include_once('oc4-deactivation.php');
Note: See TracChangeset
for help on using the changeset viewer.