Plugin Directory

Changeset 3449611


Ignore:
Timestamp:
01/29/2026 12:31:53 PM (2 months ago)
Author:
apasionados
Message:

Solved warning translation loading was triggered too early.

Location:
wp-super-cache-clear-cache-menu/tags/2.2
Files:
1 edited
2 copied

Legend:

Unmodified
Added
Removed
  • wp-super-cache-clear-cache-menu/tags/2.2/readme.txt

    r2831750 r3449611  
    44Tags: empty cache, emtpy wp super cache, cache, caching, performance, wp-cache, wp-super-cache, web performance optimization, WPO, YUI, yslow, google speed
    55Requires at least: 3.0.1
    6 Tested up to: 6.1
    7 Stable tag: 2.0
     6Tested up to: 6.9
     7Stable tag: 2.2
    88License: GPLv2 or later
    99License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    9292== Changelog ==
    9393
     94= 2.2 (29JAN2026) =
     95* Solved warning translation loading was triggered too early.
     96
    9497= 2.0 (19/SEP/2019) =
    9598* Updated name from "WP Super Cache - Clear all cache" to "Clear All Cache for WP Super Cache" in order to comply with the WordPress plugin repository trademark guidelines.
     
    119122== Upgrade Notice ==
    120123
    121 = 2.0 =
    122 UPDATED: Changed plugin name to "Clear All Cache for WP Super Cache"
     124= 2.2 =
     125UPDATED: Solved warning translation loading was triggered too early.
    123126
    124127== Contact ==
  • wp-super-cache-clear-cache-menu/tags/2.2/wp-super-cache-clear-cache-menu.php

    r2158965 r3449611  
    44Plugin URI: https://apasionados.es/blog/vaciar-cache-wp-super-cache-plugin-wordpress-1933/
    55Description: Clear all cached files of the WP Super Cache plugin directly from the admin menu (option only available to super admins).
    6 Version: 2.0
     6Version: 2.1
    77Author: Apasionados.es
    88Author URI: https://apasionados.es/
     
    1010*/
    1111
    12 $plugin_header_translate = array( __('Clear all cached files of the WP Super Cache plugin directly from the admin menu (option only available to super admins).', 'wp-super-cache-clear-cache-menu') );
     12if ( ! defined( 'ABSPATH' ) ) {
     13    exit;
     14}
    1315
    14 function only_show_option_if_wp_super_cache_is_active() {
    15     if ( is_plugin_active( 'wp-super-cache/wp-cache.php' ) ) {
    16         load_plugin_textdomain( 'wp-super-cache-clear-cache-menu', WPCACHEHOME . 'languages', basename( dirname( __FILE__ ) ) . '/languages' );
    17         function clear_all_cached_files_wpsupercache() {
    18             global $wp_admin_bar;
    19             if ( !is_super_admin() || !is_admin_bar_showing() )
    20                 return;
    21             $wp_admin_bar->add_menu( array(
    22                         'parent' => '',
    23                         'id' => 'delete-cache-completly',
    24                         'title' => __( 'Clear all cached files', 'wp-super-cache-clear-cache-menu' ),
    25                         'meta' => array( 'title' => __( 'Clear all cached files of WP Super Cache', 'wp-super-cache-clear-cache-menu' ) ),
    26                         'href' => wp_nonce_url( admin_url('options-general.php?page=wpsupercache&wp_delete_cache=1&tab=contents'), 'wp-cache' )
    27                         ) );
    28         }
    29         add_action( 'wp_before_admin_bar_render', 'clear_all_cached_files_wpsupercache', 999 );
    30     }
     16/**
     17 * Load translations at the right time.
     18 */
     19function wpsccc_load_textdomain() {
     20    load_plugin_textdomain(
     21        'wp-super-cache-clear-cache-menu',
     22        false,
     23        dirname( plugin_basename( __FILE__ ) ) . '/languages'
     24    );
    3125}
    32 add_action( 'admin_init', 'only_show_option_if_wp_super_cache_is_active' );
     26add_action( 'init', 'wpsccc_load_textdomain' );
    3327
    34 ?>
     28/**
     29 * Add admin bar menu item if WP Super Cache is active.
     30 */
     31function wpsccc_admin_bar_menu( $wp_admin_bar ) {
     32    if ( ! function_exists( 'is_plugin_active' ) ) {
     33        require_once ABSPATH . 'wp-admin/includes/plugin.php';
     34    }
     35
     36    if ( ! is_plugin_active( 'wp-super-cache/wp-cache.php' ) ) {
     37        return;
     38    }
     39
     40    if ( ! is_super_admin() || ! is_admin_bar_showing() ) {
     41        return;
     42    }
     43
     44    $wp_admin_bar->add_menu( array(
     45        'id'    => 'delete-cache-completly',
     46        'title' => __( 'Clear all cached files', 'wp-super-cache-clear-cache-menu' ),
     47        'meta'  => array(
     48            'title' => __( 'Clear all cached files of WP Super Cache', 'wp-super-cache-clear-cache-menu' ),
     49        ),
     50        'href'  => wp_nonce_url(
     51            admin_url( 'options-general.php?page=wpsupercache&wp_delete_cache=1&tab=contents' ),
     52            'wp-cache'
     53        ),
     54    ) );
     55}
     56add_action( 'admin_bar_menu', 'wpsccc_admin_bar_menu', 999 );
Note: See TracChangeset for help on using the changeset viewer.