Changeset 2989822
- Timestamp:
- 11/06/2023 11:41:11 AM (2 years ago)
- Location:
- object-cache-4-everyone/trunk
- Files:
-
- 2 edited
-
object-cache-4-everyone.php (modified) (3 diffs)
-
readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
object-cache-4-everyone/trunk/object-cache-4-everyone.php
r2977365 r2989822 6 6 * Plugin URI: https://wordpress.org/plugins/object-cache-4-everyone 7 7 * Author: fpuenteonline 8 * Version: 2. 1.28 * Version: 2.2 9 9 * Author URI: https://twitter.com/fpuenteonline 10 10 * License: GPLv2 or later … … 272 272 error_log('Object Cache 4 everyone::Memcached Server running'); 273 273 } 274 $links_array[count($links_array) - 1] = $links_array[count($links_array) - 1] . 274 $nonce = wp_create_nonce('flush_memcached_nonce'); 275 276 $links_array[] = '<a href="' . esc_url(admin_url('admin-post.php?action=oc4flush_memcached&nonce=' . $nonce)) . '"><strong>' . esc_html__('Flush cache') . '</strong></a>' . 275 277 '<br/><br/>' . 276 278 esc_html__('Memcached Server running:') . ' <strong><code style="background-color: inherit;">' . OC4EVERYONE_PREDEFINED_SERVER . '</code></strong>' . '<br/>' . 277 279 esc_html__('Cache Hit Ratio') . ' <strong><code style="background-color: inherit;">' . $found . '%</code></strong>' . '<br/>' . 278 280 esc_html__('Uptime:') . ' <strong><code style="background-color: inherit;">' . secondsToHumanReadable($wp_object_cache->getStats()[OC4EVERYONE_PREDEFINED_SERVER]['uptime']) . '</strong></code>' . '<br/>' . 279 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>';281 esc_html__('Current 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>' . '<br/>'; 280 282 } 281 283 … … 283 285 } 284 286 add_filter('plugin_row_meta', 'oc4everyone_add_server_info', PHP_INT_MAX, 4); 287 288 289 add_action('admin_post_oc4flush_memcached', 'oc4flush_memcached'); 290 function oc4flush_memcached() { 291 if (!class_exists('Memcached')) { 292 wp_die(esc_html__('Failed to flush Memcached server')); 293 } 294 // Verify the nonce 295 if (isset($_GET['nonce']) && wp_verify_nonce($_GET['nonce'], 'flush_memcached_nonce')) { 296 //flush cache 297 global $wp_object_cache; 298 error_log(print_r($wp_object_cache->getStats()[OC4EVERYONE_PREDEFINED_SERVER],true)); 299 $wp_object_cache->flush(); 300 301 $memcached = new Memcached(); 302 list($node, $port) = explode(':', OC4EVERYONE_PREDEFINED_SERVER); 303 $memcached->addServer($node, $port, PHP_INT_MAX); 304 305 if ($memcached->flush(0)) { 306 if (defined('WP_DEBUG') && WP_DEBUG) { 307 error_log('Object Cache 4 everyone::Memcached server flushed.'); 308 } 309 wp_redirect(admin_url('plugins.php')); 310 exit; 311 } else { 312 wp_die(esc_html__('Failed to flush Memcached server')); 313 } 314 } else { 315 wp_die(esc_html__('Nonce verification failed. Access denied.')); 316 } 317 } 285 318 286 319 -
object-cache-4-everyone/trunk/readme.txt
r2977365 r2989822 3 3 Tags: Memcached, cache, object cache, WPO 4 4 Requires at least: 5.0 5 Tested up to: 6. 36 Stable tag: 2. 1.25 Tested up to: 6.5 6 Stable tag: 2.2 7 7 Requires PHP: 7.0 8 8 License: GPLv2 or later … … 44 44 45 45 == Changelog == 46 = 2.2 - 2023-11-06 = 47 Added Memcached server flush functionality. You can now easily flush your Memcached server's cache directly from the plugin. Click the "Flush cache" link in the plugin description to clear the cache. 48 Added WordPress 6.4 compatibility. The plugin has been updated to ensure seamless compatibility with the latest version of WordPress, version 6.4. 49 46 50 = 2.1 - 2023-09-19 = 47 51 Added functionality to enable the plugin in additional staging or development environments on the same server.
Note: See TracChangeset
for help on using the changeset viewer.