diff --git a/Extension_FragmentCache_GeneralPage_View.php b/Extension_FragmentCache_GeneralPage_View.php index a296ca0d9..894cbe2b6 100644 --- a/Extension_FragmentCache_GeneralPage_View.php +++ b/Extension_FragmentCache_GeneralPage_View.php @@ -19,12 +19,25 @@ ), '', 'fragmentcache', - Util_UI::admin_url( 'admin.php?page=w3tc_fragmentcache' ) + Util_Environment::is_w3tc_pro( $config ) ? Util_UI::admin_url( 'admin.php?page=w3tc_fragmentcache' ) : '' ); ?> +
+

+

+

  • +
  • +

    +

    + + + +

    +
    array( 'fragmentcache', 'engine' ), diff --git a/Extension_FragmentCache_Page_View.php b/Extension_FragmentCache_Page_View.php index 510b20558..bbdc0fa73 100644 --- a/Extension_FragmentCache_Page_View.php +++ b/Extension_FragmentCache_Page_View.php @@ -29,8 +29,32 @@ } ?> - - + +

    + ', + '' + ), + array( + 'a' => array( + 'href' => array(), + ), + ) + ); + ?> +

    +

    diff --git a/Extension_FragmentCache_Plugin_Admin.php b/Extension_FragmentCache_Plugin_Admin.php index 06f5f341c..701b2f9ee 100644 --- a/Extension_FragmentCache_Plugin_Admin.php +++ b/Extension_FragmentCache_Plugin_Admin.php @@ -90,7 +90,7 @@ public function w3tc_objectcache_addin_required( $addin_required ) { public function w3tc_extension_plugin_links( $links ) { $links = array(); - if ( $this->_config->is_extension_active_frontend( 'fragmentcache' ) && Util_Environment::is_w3tc_pro( $this->_config ) ) { + if ( $this->_config->is_extension_active( 'fragmentcache' ) && Util_Environment::is_w3tc_pro( $this->_config ) ) { $links[] = '' . __( 'Settings', 'w3-total-cache' ) . ''; } @@ -102,7 +102,7 @@ public function w3tc_extension_plugin_links( $links ) { public function w3tc_admin_menu( $menu ) { - if ( $this->_config->is_extension_active_frontend( 'fragmentcache' ) && Util_Environment::is_w3tc_pro( $this->_config ) ) { + if ( $this->_config->is_extension_active( 'fragmentcache' ) && Util_Environment::is_w3tc_pro( $this->_config ) ) { $menu['w3tc_fragmentcache'] = array( 'page_title' => __( 'Fragment Cache', 'w3-total-cache' ), 'menu_text' => '' . __( 'Fragment Cache', 'w3-total-cache' ) . '', @@ -117,7 +117,7 @@ public function w3tc_admin_menu( $menu ) { public function w3tc_admin_bar_menu( $menu_items ) { - if ( $this->_config->is_extension_active_frontend( 'fragmentcache' ) && Util_Environment::is_w3tc_pro( $this->_config ) ) { + if ( $this->_config->is_extension_active( 'fragmentcache' ) && Util_Environment::is_w3tc_pro( $this->_config ) ) { $menu_items['20510.fragmentcache'] = array( 'id' => 'w3tc_flush_fragmentcache', 'parent' => 'w3tc_flush', @@ -139,12 +139,12 @@ public function w3tc_settings_page_w3tc_fragmentcache() { public function w3tc_config_save( $config ) { + // frontend activity. $is_frontend_active = ( $config->is_extension_active( 'fragmentcache' ) && ! empty( $config->get_string( array( 'fragmentcache', 'engine' ) ) ) && Util_Environment::is_w3tc_pro( $config ) ); - $config->set_extension_active_frontend( 'fragmentcache', $is_frontend_active ); } diff --git a/Generic_WidgetSettings_View.php b/Generic_WidgetSettings_View.php index e05403cef..298b1141c 100644 --- a/Generic_WidgetSettings_View.php +++ b/Generic_WidgetSettings_View.php @@ -57,7 +57,7 @@ ), 'fragmentcache' => array( 'label' => esc_html__( 'Fragment Cache', 'w3-total-cache' ), - 'enabled' => $config->is_extension_active_frontend( 'fragmentcache' ) && Util_Environment::is_w3tc_pro( $config ), + 'enabled' => $config->is_extension_active_frontend( 'fragmentcache' ), ), 'debug' => array( 'label' => esc_html__( 'Debug', 'w3-total-cache' ), diff --git a/pub/css/options.css b/pub/css/options.css index 4029f1c65..5ad08e6f4 100644 --- a/pub/css/options.css +++ b/pub/css/options.css @@ -1712,6 +1712,7 @@ td .w3tc-control-after span { margin-left: 5px; } +.fragmentcache_disk_notice, .objectcache_disk_notice, .dbcache_disk_notice { display: none; diff --git a/pub/js/options.js b/pub/js/options.js index 7f9b26227..85d8974ce 100644 --- a/pub/js/options.js +++ b/pub/js/options.js @@ -488,11 +488,7 @@ function cdn_cf_bucket_location() { * @since 2.8.0 */ function toggle_dbcache_notice() { - if ( jQuery('#dbcache__engine').val() === 'file' && jQuery('#dbcache__enabled').is(':checked') ) { - jQuery('.dbcache_disk_notice').show(); - } else { - jQuery('.dbcache_disk_notice').hide(); - } + jQuery('.dbcache_disk_notice').toggle(jQuery('#dbcache__engine').val() === 'file' && jQuery('#dbcache__enabled').is(':checked')); } /** @@ -501,11 +497,16 @@ function toggle_dbcache_notice() { * @since 2.8.0 */ function toggle_objectcache_notice() { - if ( jQuery('#objectcache__engine').val() === 'file' && jQuery('#objectcache__enabled').is(':checked') ) { - jQuery('.objectcache_disk_notice').show(); - } else { - jQuery('.objectcache_disk_notice').hide(); - } + jQuery('.objectcache_disk_notice').toggle(jQuery('#objectcache__engine').val() === 'file' && jQuery('#objectcache__enabled').is(':checked')); +} + +/** + * Toggle the disk notice for fragmentcache. + * + * @since 2.8.0 + */ +function toggle_fragmentcache_notice() { + jQuery('.fragmentcache_disk_notice').toggle(jQuery('#fragmentcache___engine').val() === 'file'); } // On document ready. @@ -524,6 +525,10 @@ jQuery(function() { jQuery('#objectcache__enabled').change(toggle_objectcache_notice); jQuery('#objectcache__engine').change(toggle_objectcache_notice); + // Fragment cache disk usage warning. + toggle_fragmentcache_notice(); + jQuery('#fragmentcache___engine').change(toggle_fragmentcache_notice); + // General page. jQuery('.w3tc_read_technical_info').on('click', function() { jQuery('.w3tc_technical_info').toggle();