';
}
$pwa_install = '';
if(function_exists('pwaforwp_add_plugin_meta_links')){
$pwa_install = ''.esc_html__('Go to PWA settings','accelerated-mobile-pages').'
';
}else{
$pwa_install = '';
}
if(file_exists(AMPFORWP_MAIN_PLUGIN_DIR."pwa-for-wp/pwa-for-wp.php") && !function_exists('pwaforwp_add_plugin_meta_links')){
$activation_url = wp_nonce_url( 'plugins.php?action=activate&plugin=pwa-for-wp/pwa-for-wp.php&plugin_status=all&paged=1&s', 'activate-plugin_pwa-for-wp/pwa-for-wp.php' );
$pwa_install = ''.esc_html__('Activate Plugin','accelerated-mobile-pages').'
';
}
// Performance SECTION
Redux::setSection( $opt_name, array(
'title' => esc_html__( 'Performance', 'accelerated-mobile-pages' ),
'id' => 'amp-performance',
'desc' => $cache_desc,
'subsection' => true,
'fields' => array(
array(
'id' => 'ampforwp-pwa-for-wp',
'type' => 'section',
'title' => esc_html__('Progressive Web App (PWA)', 'accelerated-mobile-pages'),
'indent' => true,
'layout_type' => 'accordion',
'accordion-open'=> 1,
),
array(
'id' => 'ampforwp_pwa_module',
'type' => 'raw',
'title' => esc_html__('PWA Support', 'accelerated-mobile-pages'),
'content' => (!is_plugin_active('pwa-for-wp/pwa-for-wp.php')?
$pwa_install
: '
').'Learn more'
),
array(
'id' => 'ampforwp-performance',
'type' => 'section',
'title' => __('Performance Enhancement', 'accelerated-mobile-pages'),
'indent' => true,
'layout_type' => 'accordion',
'accordion-open'=> 1,
),
array(
'id' => 'ampforwp_cache_minimize_mode',
'type' => 'switch',
'title' => esc_html__('Minify', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Improve the Page Speed and Loading time with Minification option', 'accelerated-mobile-pages'),
'default' => 1
),
array(
'id' => 'ampforwp_leverage_browser_caching_mode',
'type' => 'switch',
'title' => esc_html__('Leverage Browser Caching', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Improve the Page Speed and Loading time with Leverage Browser Caching option', 'accelerated-mobile-pages'),
'default' => 0
),
array(
'id' => 'ampforwp_leverage_browser_caching_expires',
'class' => 'child_opt child_opt_arrow',
'type' => 'text',
'default' => '90',
'title' => esc_html__('Days to Expiration', 'accelerated-mobile-pages'),
'required' => array('ampforwp_leverage_browser_caching_mode', '=' , '1'),
),
array(
'id' => 'ampforwp_css_tree_shaking',
'type' => 'switch',
'title' => esc_html__('Optimize CSS (beta)', 'accelerated-mobile-pages'),
'tooltip-subtitle' => esc_html__('Improve size of the CSS and Page Speed with Tree Shaking Feature.', 'accelerated-mobile-pages'),
'default' => 0
),
array(
'id' => 'ampforwp_css_tree_shaking_clear_cache',
'type' => 'raw',
'class' => 'child_opt child_opt_arrow',
'title' => esc_html__('Want to clear the Cache?', 'accelerated-mobile-pages'),
'content' => " Clear Cache",
'tooltip-subtitle' => esc_html__( 'This will remove all the generated cache.', 'accelerated-mobile-pages' ),
'full_width' => false,
'section_id'=>'amp-content-builder',
'required'=>array('ampforwp_css_tree_shaking','=','1')
)
)
)
);
}