Skip to content
This repository has been archived by the owner on Mar 1, 2024. It is now read-only.

Commit

Permalink
1.1.1
Browse files Browse the repository at this point in the history
git-svn-id: https://plugins.svn.wordpress.org/w3tc-auto-pilot/trunk@1207856 b8457f37-d9ea-0310-8a92-e5e31aec5664
  • Loading branch information
Cybr authored and Cybr committed Jul 27, 2015
1 parent 59dbb1a commit 8d3ed20
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 6 deletions.
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: Cybr
Tags: cache, control, w3, total, automatic, flush, update, multisite, mapping, hide
Requires at least: 3.6.0
Tested up to: 4.2.2
Stable tag: 4.2.2
Stable tag: 1.1.1
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand All @@ -29,6 +29,7 @@ It's absolutely great on MultiSite installations, especially when you allow untr
* Also denied access with a notice.
* No more admin notices in the dashboard after settings change or on error.
* No more admin script on front end.
* No more admin scripts in back end.

***On the front end:***

Expand All @@ -52,6 +53,10 @@ It's absolutely great on MultiSite installations, especially when you allow untr

== Changelog ==

= 1.1.1 =
* Made W3TC completely silent by removing the latest scripts from non-admins (single) / non-super-admins (multi) in wp-admin
* Tested on PHP7

= 1.1.0 =
* Added flush on Theme Menu change
* Added textdomain WapPilot for translating
Expand Down
34 changes: 29 additions & 5 deletions w3tc-auto-pilot.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* Plugin Name: W3TC Auto Pilot
* Plugin URI: https://wordpress.org/plugins/w3tc-auto-pilot/
* Description: Put W3 Total Cache on auto pilot. This plugin allows you to control W3 Total Cache in such a manner that no one knows you're using it, not even your admins. Either network activate it or activate it per site.
* Version: 1.1.0
* Version: 1.1.1
* Author: Sybre Waaijer
* Author URI: https://cyberwire.nl/
* License: GPLv2 or later
Expand Down Expand Up @@ -57,6 +57,9 @@ function wap_w3tc_init() {
//* Removes admin menu popup script
add_action( 'init', 'wap_w3tc_remove_script', 20);

//* Removes admin styles
add_action( 'admin_init', 'wap_w3tc_remove_styles', 20);

//* Removes "Purge From Cache" link above the "publish/save" button on posts/pages
//* Also removes the "Purge From Cache" link in post/pages lists
add_action( 'admin_init', 'wap_w3tc_remove_flush_per_post_page', 20);
Expand All @@ -77,15 +80,15 @@ function wap_w3tc_init() {
add_action( 'after_setup_theme', 'wap_w3tc_init' ); // Call very early, before init and admin_init

/**
* Plugin locale 'AutoDescription'
* Plugin locale 'WapPilot'
*
* File located in plugin folder autodescription/language/
* File located in plugin folder w3tc-auto-pilot/language/
*
* @since 1.0.0
*/
function wap_locale_init() {
$plugin_dir = basename(dirname(__FILE__));
load_plugin_textdomain( 'WapPilot', false, $plugin_dir . '/language/');
load_plugin_textdomain( 'w3tc-auto-pilot', false, $plugin_dir . '/language/');
}
add_action('plugins_loaded', 'wap_locale_init');

Expand All @@ -98,7 +101,7 @@ function wap_locale_init() {
*/
function wap_mapped_clear() {
//* Check for domain-mapping plugin
if ( is_plugin_active( 'domain-mapping/domain-mapping.php' ) ) {
if ( function_exists( 'is_plugin_active' ) && is_plugin_active( 'domain-mapping/domain-mapping.php' ) ) {
global $wpdb,$blog_id;

$ismapped = wp_cache_get('wap_mapped_clear_' . $blog_id, 'domain_mapping' );
Expand Down Expand Up @@ -429,6 +432,27 @@ function wap_w3tc_remove_script() {
}
}

/**
* Removes inline css and javascript printed by w3tc in the admin dashboard
*
* @since 1.0.4
*/
function wap_w3tc_remove_styles() {
if ( !is_super_admin() ) {

if ( function_exists( 'w3_instance' ) ) {
$w3_plugin = w3_instance('W3_Plugin_TotalCacheAdmin');
}

// Remove image styles
remove_action('admin_head', array(
$w3_plugin,
'admin_head'
), 10);
}
}


/**
* Removes the Performance admin menu
*
Expand Down

0 comments on commit 8d3ed20

Please sign in to comment.