Plugin Directory

Changeset 2967960


Ignore:
Timestamp:
09/17/2023 10:17:39 AM (3 years ago)
Author:
fpuenteonline
Message:

2.0.1

Location:
object-cache-4-everyone/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • object-cache-4-everyone/trunk/object-cache-4-everyone.php

    r2967546 r2967960  
    66 * Plugin URI: https://wordpress.org/plugins/object-cache-4-everyone
    77 * Author: fpuenteonline
    8  * Version: 2.0
     8 * Version: 2.0.1
    99 * Author URI: https://twitter.com/fpuenteonline
    1010 * License:     GPLv2 or later
     
    2020    exit; // Exit if accessed directly.
    2121}
     22
     23//Delete object-cache.php
     24include_once('oc4-deactivation.php');
     25register_deactivation_hook(__FILE__, 'oc4everyone_deactivation');
    2226
    2327//First install
     
    9599        if (defined('WP_DEBUG') && WP_DEBUG) {
    96100            error_log('Object Cache 4 everyone::oc4everyone_admin_init_deactivate_itself');
     101        }
     102        if (isset($_GET['activate'])) {
     103            unset($_GET['activate']);
    97104        }
    98105        deactivate_plugins(plugin_basename(__FILE__), true);
     
    201208                //Memcached - Memcached Server not running
    202209                add_action('admin_notices', 'oc4everyone_admin_notices_no_server_running', PHP_INT_MAX);
    203             }
     210            }       
     211        //class_exists('Memcached')
    204212        } else {
    205213            add_action('admin_notices', 'oc4everyone_admin_notices_no_class_exists', PHP_INT_MAX);
     
    241249add_action('plugins_loaded', 'oc4everyone_plugins_loaded_activation');
    242250
    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
     252function 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')) {
    251257
    252258        $hits = $wp_object_cache->getStats()[OC4EVERYONE_PREDEFINED_SERVER]['get_hits'];
     
    258264            error_log('Object Cache 4 everyone::Memcached Server running');
    259265        }
    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}
     276add_filter('plugin_row_meta', 'oc4everyone_add_server_info', PHP_INT_MAX, 4);
    272277
    273278
  • object-cache-4-everyone/trunk/readme.txt

    r2967546 r2967960  
    44Requires at least: 5.0
    55Tested up to: 6.3
    6 Stable tag: 2.0
     6Stable tag: 2.0.1
    77Requires PHP: 7.0
    88License: GPLv2 or later
  • object-cache-4-everyone/trunk/uninstall.php

    r2306156 r2967960  
    99defined('WP_UNINSTALL_PLUGIN') || exit;
    1010
     11if (defined('WP_DEBUG') && WP_DEBUG) {
     12    error_log('uninstall.php');
     13}
     14
    1115//Delete object-cache.php
    1216include_once('oc4-deactivation.php');
Note: See TracChangeset for help on using the changeset viewer.