WP Super Cache – Clear all cache - Version 1.4

Version Description

Updated the code to fix a possible problem with checking if WP SUPER CACHE is active.

=

Download this release

Release Info

Developer apasionados
Plugin Icon 128x128 WP Super Cache – Clear all cache
Version 1.4
Comparing to
See all releases

Code changes from version 1.3.1 to 1.4

Files changed (2) hide show
  1. readme.txt +21 -4
  2. wp-super-cache-clear-cache-menu.php +19 -25
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: apasionados, netconsulting
3
  Donate link: http://apasionados.es/
4
  Tags: empty cache, emtpy wp super cache, cache, caching, performance, wp-cache, wp-super-cache, web performance optimization, WPO, YUI, yslow, google speed
5
  Requires at least: 3.0.1
6
- Tested up to: 4.5
7
- Stable tag: 1.3.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -21,6 +21,11 @@ Nevertheless in the majority of the sites that have WP Super Cache installed it
21
 
22
  Please note that this menu option is only visible for WordPress ADMINISTRATORS.
23
 
 
 
 
 
 
24
  = What can I do with this plugin? =
25
  The plugin clears completely the cache from WP Super Cache, directly from the admin menu.
26
 
@@ -49,12 +54,21 @@ It empties completely the WP SUPER CACHE cache without having to navigate to the
49
  = Why should I make use of the WP Super Cache - Clear all cache Plugin? =
50
  If you use WP Super Cache and want to be able to empty completely the cache without having to navigate to the CONTENTS tab in WP Super Cache Settings, this plugin is for you.
51
 
 
 
 
 
 
 
52
  = Does WP Super Cache - Clear all cache make changes to the database? =
53
  No.
54
 
55
  = How can I check out if the plugin works for me? =
56
  Install and activate. You will see a new menu entry in the administration area to empty the cache. Access this menu entry and your cache will be emptied and you are taken to the CONTENTS tab in WP Super Cache Settings.
57
 
 
 
 
58
  = Can every registered user use this plugin? =
59
  No. This menu option is only available for WordPress ADMINISTRATORS.
60
 
@@ -77,6 +91,9 @@ Of course we do. ;-)
77
 
78
  == Changelog ==
79
 
 
 
 
80
  = 1.3.1 =
81
  * Minor update to fix a problem with automatic update from WordPress plugin repository.
82
  * Corrected two typos. Thanks to Kevin W. McCarthy.
@@ -98,8 +115,8 @@ Of course we do. ;-)
98
 
99
  == Upgrade Notice ==
100
 
101
- = 1.3.1 =
102
- Updated the code to fix the bug inspirationdate found: "The link added is relative so it doesn't work when the toolbar is displayed on the frontend". Thanks.
103
 
104
  == Contact ==
105
 
3
  Donate link: http://apasionados.es/
4
  Tags: empty cache, emtpy wp super cache, cache, caching, performance, wp-cache, wp-super-cache, web performance optimization, WPO, YUI, yslow, google speed
5
  Requires at least: 3.0.1
6
+ Tested up to: 4.8
7
+ Stable tag: 1.4
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
21
 
22
  Please note that this menu option is only visible for WordPress ADMINISTRATORS.
23
 
24
+ > <strong>This is an add-on to WP SUPER CACHE:</strong><br>
25
+ > Please keep in mind that this plugin is an add-on to the [WP SUPER CACHE](https://wordpress.org/plugins/wp-super-cache/) plugin. You need to install and activate WP SUPER CACHE so that this add-on works.
26
+ >
27
+ > If you are having trouble with this plugin, feel free to use the [WP Super Cache - Clear all cache Support](https://wordpress.org/support/plugin/wp-super-cache-clear-cache-menu). If you are having problems with the WP SUPER CACHE plugin, you should ask for support at [WP Super Cache Support](https://wordpress.org/support/plugin/wp-super-cache).
28
+
29
  = What can I do with this plugin? =
30
  The plugin clears completely the cache from WP Super Cache, directly from the admin menu.
31
 
54
  = Why should I make use of the WP Super Cache - Clear all cache Plugin? =
55
  If you use WP Super Cache and want to be able to empty completely the cache without having to navigate to the CONTENTS tab in WP Super Cache Settings, this plugin is for you.
56
 
57
+ = Do I need to install the WP Super Cache plugin to make this one work? =
58
+ Yes. This is an add-on of the [WP SUPER CACHE](https://wordpress.org/plugins/wp-super-cache/) plugin. You need to install and activate this plugin before you can use our plugin.
59
+
60
+ = Are you the developers of the WP SUPER CACHE plugin? =
61
+ No we are not. We have only developed this add-on to make life with WP Super Cache easier for everybody that uses it.
62
+
63
  = Does WP Super Cache - Clear all cache make changes to the database? =
64
  No.
65
 
66
  = How can I check out if the plugin works for me? =
67
  Install and activate. You will see a new menu entry in the administration area to empty the cache. Access this menu entry and your cache will be emptied and you are taken to the CONTENTS tab in WP Super Cache Settings.
68
 
69
+ = What can I do if I need support? =
70
+ If you are having trouble with this plugin, feel free to use the [WP Super Cache - Clear all cache Support](https://wordpress.org/support/plugin/wp-super-cache-clear-cache-menu). If you are having problems with the WP SUPER CACHE plugin, you should ask for support at [WP Super Cache Support](https://wordpress.org/support/plugin/wp-super-cache) because they will be able to help you better.
71
+
72
  = Can every registered user use this plugin? =
73
  No. This menu option is only available for WordPress ADMINISTRATORS.
74
 
91
 
92
  == Changelog ==
93
 
94
+ = 1.4.0 =
95
+ * Changed function_exists('is_plugin_active') handling so that it doesn't load when outside of the WordPress administration.
96
+
97
  = 1.3.1 =
98
  * Minor update to fix a problem with automatic update from WordPress plugin repository.
99
  * Corrected two typos. Thanks to Kevin W. McCarthy.
115
 
116
  == Upgrade Notice ==
117
 
118
+ = 1.4 =
119
+ Updated the code to fix a possible problem with checking if WP SUPER CACHE is active.
120
 
121
  == Contact ==
122
 
wp-super-cache-clear-cache-menu.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: WP Super Cache - Clear all cache
4
  Plugin URI: http://ocaoimh.ie/wp-super-cache/
5
  Description: Clear all cached files of the WP Super Cache plugin directly from the admin menu (option only available to super admins).
6
- Version: 1.3.1
7
  Author: Apasionados.es
8
  Author URI: http://apasionados.es/
9
  Text Domain: wp-super-cache-clear-cache-menu
@@ -11,31 +11,25 @@ Text Domain: wp-super-cache-clear-cache-menu
11
 
12
  $plugin_header_translate = array( __('WP Super Cache - Clear all cache', 'wp-super-cache-clear-cache-menu'), __('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') );
13
 
14
- if ( ! function_exists('is_plugin_active')) {
15
- require_once( ABSPATH . '/wp-admin/includes/plugin.php' );
16
- }
17
-
18
- if ( is_plugin_active( 'wp-super-cache/wp-cache.php' ) ) {
19
 
20
- function wpsupercache_clear_cache_text_domain() {
 
21
  load_plugin_textdomain( 'wp-super-cache-clear-cache-menu', WPCACHEHOME . 'languages', basename( dirname( __FILE__ ) ) . '/languages' );
22
- }
23
- add_action( 'init', 'wpsupercache_clear_cache_text_domain' );
24
-
25
- function clear_all_cached_files_wpsupercache() {
26
- global $wp_admin_bar;
27
- if ( !is_super_admin() || !is_admin_bar_showing() )
28
- return;
29
- $wp_admin_bar->add_menu( array(
30
- 'parent' => '',
31
- 'id' => 'delete-cache-completly',
32
- 'title' => __( 'Clear all cached files', 'wp-super-cache-clear-cache-menu' ),
33
- 'meta' => array( 'title' => __( 'Clear all cached files of WP Super Cache', 'wp-super-cache-clear-cache-menu' ) ),
34
- 'href' => wp_nonce_url( admin_url('options-general.php?page=wpsupercache&wp_delete_cache=1&tab=contents'), 'wp-cache' )
35
- ) );
36
- }
37
- add_action( 'wp_before_admin_bar_render', 'clear_all_cached_files_wpsupercache', 999 );
38
-
39
- }
40
 
41
  ?>
3
  Plugin Name: WP Super Cache - Clear all cache
4
  Plugin URI: http://ocaoimh.ie/wp-super-cache/
5
  Description: Clear all cached files of the WP Super Cache plugin directly from the admin menu (option only available to super admins).
6
+ Version: 1.4
7
  Author: Apasionados.es
8
  Author URI: http://apasionados.es/
9
  Text Domain: wp-super-cache-clear-cache-menu
11
 
12
  $plugin_header_translate = array( __('WP Super Cache - Clear all cache', 'wp-super-cache-clear-cache-menu'), __('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') );
13
 
 
 
 
 
 
14
 
15
+ function only_show_option_if_wp_super_cache_is_active() {
16
+ if ( is_plugin_active( 'wp-super-cache/wp-cache.php' ) ) {
17
  load_plugin_textdomain( 'wp-super-cache-clear-cache-menu', WPCACHEHOME . 'languages', basename( dirname( __FILE__ ) ) . '/languages' );
18
+ function clear_all_cached_files_wpsupercache() {
19
+ global $wp_admin_bar;
20
+ if ( !is_super_admin() || !is_admin_bar_showing() )
21
+ return;
22
+ $wp_admin_bar->add_menu( array(
23
+ 'parent' => '',
24
+ 'id' => 'delete-cache-completly',
25
+ 'title' => __( 'Clear all cached files', 'wp-super-cache-clear-cache-menu' ),
26
+ 'meta' => array( 'title' => __( 'Clear all cached files of WP Super Cache', 'wp-super-cache-clear-cache-menu' ) ),
27
+ 'href' => wp_nonce_url( admin_url('options-general.php?page=wpsupercache&wp_delete_cache=1&tab=contents'), 'wp-cache' )
28
+ ) );
29
+ }
30
+ add_action( 'wp_before_admin_bar_render', 'clear_all_cached_files_wpsupercache', 999 );
31
+ }
32
+ }
33
+ add_action( 'admin_init', 'only_show_option_if_wp_super_cache_is_active' );
 
 
34
 
35
  ?>