ESSBOptionsStructureHelper::field_editor('display', 'message-3', 'message_like_buttons', __('Message above like buttons', ESSB3_TEXT_DOMAIN), __('You can use following variables to create personalized message: %%title%% - displays current post title, %%permalink%% - displays current post address.', ESSB3_TEXT_DOMAIN), 'htmlmixed');
//'advanced', 'optimization'
ESSBOptionsStructureHelper::field_heading('advanced', 'optimization', 'heading1', __('Optimization Options', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_section_start('advanced', 'optimization', __('Resource load optimization', ESSB3_TEXT_DOMAIN), __('Activate option that will optimize load of static resources - css and javascript', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_switch('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('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('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('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('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('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_switch('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('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('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_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', __('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', 'administrative', 'heading1', __('Administrative Options', ESSB3_TEXT_DOMAIN));
$admin_style = array("" => "Dark", "light" => "Light");
ESSBOptionsStructureHelper::field_select('advanced', 'administrative', 'admin_template', __('Plugin Settings Style', ESSB3_TEXT_DOMAIN), __('Change plugin default options style', ESSB3_TEXT_DOMAIN), $admin_style);
ESSBOptionsStructureHelper::field_section_start('advanced', 'administrative', __('Advanced Display Options', ESSB3_TEXT_DOMAIN), __('Activate additional advanced options for customization and sharing', ESSB3_TEXT_DOMAIN));
//ESSBOptionsStructureHelper::field_switch('advanced', 'administrative', 'advanced_by_post_category', __('Activate custom style settings for post category', ESSB3_TEXT_DOMAIN), __('Activation of this option will add additional menu settings for each post category that you have which will allow to change style of buttons.', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_switch('advanced', 'administrative', 'advanced_custom_share', __('Activate custom share by social network', ESSB3_TEXT_DOMAIN), __('Activation of this option will add additional menu settings for message share customization by social network.', ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
//float_onsingle_only
if (ESSBTwitterCounterRecovery::recovery_called()) {
    ESSBTwitterCounterRecovery::recovery_start();
}
if (ESSB3_ADDONS_ACTIVE && class_exists('ESSBAddonsHelper')) {
    $addons = ESSBAddonsHelper::get_instance();
    $new_addons = $addons->get_new_addons();
    foreach ($new_addons as $key => $data) {
        $all_addons_button = '<a href="' . admin_url("admin.php?page=essb_addons") . '"  text="' . __('Add-ons', ESSB3_TEXT_DOMAIN) . '" class="button button-orange float_right" style="margin-right: 5px;"><i class="fa fa-gear"></i>&nbsp;' . __('View list of all add-ons', ESSB3_TEXT_DOMAIN) . '</a>';
        $dismiss_url = esc_url_raw(add_query_arg(array('dismiss' => 'true', 'addon' => $key), admin_url("admin.php?page=essb_options")));
        $dismiss_addons_button = '<a href="' . $dismiss_url . '"  text="' . __('Add-ons', ESSB3_TEXT_DOMAIN) . '" class="button button-orange float_right" style="margin-right: 5px;"><i class="fa fa-close"></i>&nbsp;' . __('Dismiss', ESSB3_TEXT_DOMAIN) . '</a>';
        printf('<div class="essb-information-box fade"><div class="icon orange"><i class="fa fa-cube"></i></div><div class="inner">New add-on for Easy Social Share Buttons for WordPress is available: <a href="%2$s" target="_blank"><b>%1$s</b></a> %4$s%3$s</div></div>', $data['title'], $data['url'], $all_addons_button, $dismiss_addons_button);
    }
}
$cache_plugin_message = "";
if (ESSBCacheDetector::is_cache_plugin_detected()) {
    $cache_plugin_message = " It is highly recommeded after change in settings to clear cache of plugin you use: " . ESSBCacheDetector::cache_plugin_name();
}
$backup = isset($_REQUEST['backup']) ? $_REQUEST['backup'] : '';
$settings_update = isset($_REQUEST['settings-updated']) ? $_REQUEST['settings-updated'] : '';
if ($settings_update == "true") {
    // printf('<div class="updated" style="padding: 10px;">%1$s</div>', __('Easy
    // Social Share Buttons options are saved!', ESSB3_TEXT_DOMAIN));
    printf('<div class="essb-information-box"><div class="icon"><i class="fa fa-info-circle"></i></div><div class="inner">%1$s</div></div>', __('Easy Social Share Buttons options are saved!' . $cache_plugin_message, ESSB3_TEXT_DOMAIN));
}
$settings_imported = isset($_REQUEST['settings-imported']) ? $_REQUEST['settings-imported'] : '';
if ($settings_imported == "true") {
    // printf('<div class="updated" style="padding: 10px;">%1$s</div>', __('Easy
    // Social Share Buttons options are saved!', ESSB3_TEXT_DOMAIN));
    printf('<div class="essb-information-box"><div class="icon"><i class="fa fa-info-circle"></i></div><div class="inner">%1$s</div></div>', __('Easy Social Share Buttons options are imported!' . $cache_plugin_message, ESSB3_TEXT_DOMAIN));
}
if ($reset_settings == 'true') {
$listOfTemplates = array("flat-small" => "Small", "flat" => "Regular", "box" => "Boxed", "round" => "Round");
ESSBOptionsStructureHelper::field_select('social', 'settings-13', 'sis_style', __('Template', ESSB3_TEXT_DOMAIN), '', $listOfTemplates);
$listOfOptions = array("left" => "Left", "right" => "Right", "center-x" => "Center");
ESSBOptionsStructureHelper::field_select('social', 'settings-13', 'sis_align_x', __('Horizontal Align', ESSB3_TEXT_DOMAIN), '', $listOfOptions);
$listOfOptions = array("top" => "Top", "bottom" => "Bottom", "center-y" => "Center");
//ESSBOptionsStructureHelper::field_select('social', 'positions-30', 'sis_align_y', __('Vertical Align', ESSB3_TEXT_DOMAIN), '', $listOfOptions);
$listOfOptions = array("horizontal" => "Horizontal", "vertical" => "Vertical");
ESSBOptionsStructureHelper::field_select('social', 'settings-13', 'sis_orientation', __('Orientation', ESSB3_TEXT_DOMAIN), '', $listOfOptions);
ESSBOptionsStructureHelper::field_textbox('social', 'settings-13', 'sis_offset_x', __('Move buttons horizontally', ESSB3_TEXT_DOMAIN), __('Provide custom value if you wish to move buttons horizontally from the edge of image', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_textbox('social', 'settings-13', 'sis_offset_y', __('Move buttons vertically', ESSB3_TEXT_DOMAIN), __('Provide custom value if you wish to move buttons vertically from the edge of image.', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_section_end('social', 'settings-13');
ESSBOptionsStructureHelper::field_heading('social', 'settings-15', 'heading1', __('Display Position Settings: Excerpt', ESSB3_TEXT_DOMAIN));
essb_prepare_location_advanced_customization('social', 'settings-15', 'excerpt');
$mobile_cache_plugin_detected = "";
if (ESSBCacheDetector::is_cache_plugin_detected()) {
    $mobile_cache_plugin_detected = __(' Cache plugin detected: ', ESSB3_TEXT_DOMAIN) . '<b>' . ESSBCacheDetector::cache_plugin_name() . '</b>';
}
$mobile_instuctions_open = '&nbsp;<a
				href="#TB_inline?width=auto&min-height=550&inlineId=essb3-cache-instuctions"
				class="thickbox" title="Configuring cache plugins for Easy Social Share Buttons"><span><b>If you use a cache plugin click here to see how to configure it for proper work with mobile display methods.</b></span></a>';
ESSBOptionsStructureHelper::field_heading('social', 'mobile-1', 'heading1', __('Mobile: Display Options', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_switch('social', 'mobile-1', 'mobile_positions', __('Change display positions on mobile', ESSB3_TEXT_DOMAIN), __('Activate this option to personalize display positions on mobile.' . $mobile_instuctions_open . $mobile_cache_plugin_detected, ESSB3_TEXT_DOMAIN), '', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_image_radio('social', 'mobile-1', 'content_position_mobile', __('Primary content display position', ESSB3_TEXT_DOMAIN), __('Choose default method that will be used to render buttons inside content', ESSB3_TEXT_DOMAIN), essb_avaliable_content_positions_mobile());
ESSBOptionsStructureHelper::field_image_checkbox('social', 'mobile-1', 'button_position_mobile', __('Additional button display positions', ESSB3_TEXT_DOMAIN), __('Choose additional display methods that can be used to display buttons.', ESSB3_TEXT_DOMAIN), essb_available_button_positions_mobile());
ESSBOptionsStructureHelper::field_switch('social', 'mobile-1', 'mobile_exclude_tablet', __('Do not apply mobile settings for tablets', ESSB3_TEXT_DOMAIN), __('You can avoid mobile rules for settings for tablet devices.', ESSB3_TEXT_DOMAIN), 'recommeded', __('Yes', ESSB3_TEXT_DOMAIN), __('No', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_heading('social', 'mobile-1', 'heading4', __('Share bar customizations', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_textbox_stretched('social', 'mobile-1', 'mobile_sharebar_text', __('Text on share bar', ESSB3_TEXT_DOMAIN), __('Customize the default share bar text (default is Share).', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_heading('social', 'mobile-1', 'heading4', __('Share buttons bar customizations', ESSB3_TEXT_DOMAIN));
ESSBOptionsStructureHelper::field_section_start_full_panels('social', 'mobile-1', __('Share buttons bar customization', ESSB3_TEXT_DOMAIN), '');
$listOfOptions = array("1" => "1 Button", "2" => "2 Buttons", "3" => "3 Buttons", "4" => "4 Buttons", "5" => "5 Buttons", "6" => "6 Buttons");
ESSBOptionsStructureHelper::field_select_panel('social', 'mobile-1', 'mobile_sharebuttonsbar_count', __('Number of buttons in share buttons bar', ESSB3_TEXT_DOMAIN), __('Provide number of buttons you wish to see in buttons bar. If the number of activated buttons is greater than selected here the last button will be more button which will open pop up with all active buttons.', ESSB3_TEXT_DOMAIN), $listOfOptions);