ESSBOptionsStructureHelper::field_heading('advanced', 'optimization', 'heading4', __('Static resource optimizations', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_section_start_panels('advanced', 'optimization', __('CSS Styles Optimizations', ESSB3_TEXT_DOMAIN), __('Activate option that will optimize load of static css resources', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_switch_panel('advanced', 'optimization', 'use_minified_css', __('Use minified CSS files', ESSB3_TEXT_DOMAIN), __('Minified CSS files will improve speed of load. Activate this option to use them.', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_switch_panel('advanced', 'optimization', 'load_css_footer', __('Load plugin inline styles into footer', ESSB3_TEXT_DOMAIN), __('Activating this option will load dynamic plugin inline styles into footer.', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_section_end_panels('advanced', 'optimization');
ESSBOptionsStructureHelper::field_section_start_panels('advanced', 'optimization', __('Scripts load optimization', ESSB3_TEXT_DOMAIN), __('Activate option that will optimize load of static resources - css and javascript', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_switch_panel('advanced', 'optimization', 'use_minified_js', __('Use minified javascript files', ESSB3_TEXT_DOMAIN), __('Minified javascript files will improve speed of load. Activate this option to use them.', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_switch_panel('advanced', 'optimization', 'scripts_in_head', __('Load scripts in head element', ESSB3_TEXT_DOMAIN), __('If you are using caching plugin like W3 Total Cache you may need to activate this option if counters, send mail form or float do not work.', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_switch_panel('advanced', 'optimization', 'load_js_async', __('Load plugin javascript files asynchronous', ESSB3_TEXT_DOMAIN), __('This will load scripts during page load in non render blocking way', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_switch_panel('advanced', 'optimization', 'load_js_defer', __('Load plugin javascript files deferred', ESSB3_TEXT_DOMAIN), __('This will load scripts after page load in non render blocking way', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_switch_panel('advanced', 'optimization', 'load_js_delayed', __('Load plugin javascript files delayed', ESSB3_TEXT_DOMAIN), __('This will load scripts after 2 seconds when page is fully loaded', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_section_end_panels('advanced', 'optimization');
ESSBOptionsStructureHelper::field_section_start_panels('advanced', 'optimization', __('Global resource load optimizations', ESSB3_TEXT_DOMAIN), __('Activate option that will optimize load of static javascript resources', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_switch_panel('advanced', 'optimization', 'remove_ver_resource', __('Remove version number from static resource files', ESSB3_TEXT_DOMAIN), __('Activating this option will remove added to resources version number ?ver= which will allow these files to be cached.', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_switch_panel('advanced', 'optimization', 'precompiled_resources', __('Use plugin precompiled resources', ESSB3_TEXT_DOMAIN), __('Activating this option will precompile and cache plugin dynamic resources to save load time. Precompiled resources can be used only when you use same configuration on your entire site.', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_section_end_panels('advanced', 'optimization');
$cache_plugin_detected = "";
if (ESSBCacheDetector::is_cache_plugin_detected()) {
    $cache_plugin_detected = "<br/><br/> Cache plugin detected: <b>" . ESSBCacheDetector::cache_plugin_name() . '</b>. When you use cache plugin we recommend not to turn on the build in caching function because your cache plugin already does that.';
}
ESSBOptionsStructureHelper::field_heading('advanced', 'optimization', 'heading4', __('Build in cache', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_section_start('advanced', 'optimization', __('Build in cache', ESSB3_TEXT_DOMAIN), __('Activate build in cache functions to improve speed of load. If you use a site cache plugin activation of those options is not needed as that plugin will do the cache work.' . $cache_plugin_detected, ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_switch('advanced', 'optimization', 'essb_cache_runtime', __('Activate WordPress cache', ESSB3_TEXT_DOMAIN), __('Activating WordPress cache function usage will cache button generation via default WordPress cache or via the persistant cache plugin if you use such (like W3 Total Cache)', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_switch('advanced', 'optimization', 'essb_cache', __('Activate cache', ESSB3_TEXT_DOMAIN), __('This option is in beta and if you find any problems using it please report at our <a href="http://support.creoworx.com" target="_blank">support portal</a>. To clear cache you can simply press Update Settings button in Main Settings (cache expiration time is 1 hour)', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
$cache_mode = array("full" => "Cache button render and dynamic resources", "resource" => "Cache only dynamic resources", "buttons" => "Cache only buttons render");
ESSBOptionsStructureHelper::field_select('advanced', 'optimization', 'essb_cache_mode', __('Cache mode', ESSB3_TEXT_DOMAIN), __('Choose between caching full render of share buttons and resources or cache only dynamic resources (CSS and Javascript).', ESSB3_TEXT_DOMAIN), $cache_mode);
ESSBOptionsStructureHelper::field_switch('advanced', 'optimization', 'essb_cache_static', __('Combine into single file all plugin static CSS files', ESSB3_TEXT_DOMAIN), __('This option will combine all plugin static CSS files into single file.', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_switch('advanced', 'optimization', 'essb_cache_static_js', __('Combine into single file all plugin static javascript files', ESSB3_TEXT_DOMAIN), __('This option will combine all plugin static javacsript files into single file. This option will not work if scripts are set to load asynchronous or deferred.', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_section_end('advanced', 'optimization');
ESSBOptionsStructureHelper::field_heading('advanced', 'advanced', 'heading1', __('Advanced Options', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_textbox('advanced', 'advanced', 'priority_of_buttons', __('Change default priority of buttons', ESSB3_TEXT_DOMAIN), __('Provide custom value of priority when buttons will be included in content (default is 10). This will make code of plugin to execute before or after another plugin. Attention! Providing incorrect value may cause buttons not to display.', ESSB3_TEXT_DOMAIN));