ID );
// custom post data sharing details
$post_address = get_permalink ( $post->ID );
$essb_post_share_message = isset ( $custom ["essb_post_share_message"] ) ? $custom ["essb_post_share_message"] [0] : "";
$essb_post_share_url = isset ( $custom ["essb_post_share_url"] ) ? $custom ["essb_post_share_url"] [0] : "";
$essb_post_share_image = isset ( $custom ["essb_post_share_image"] ) ? $custom ["essb_post_share_image"] [0] : "";
$essb_post_share_text = isset ( $custom ["essb_post_share_text"] ) ? $custom ["essb_post_share_text"] [0] : "";
$essb_post_fb_url = isset ( $custom ["essb_post_fb_url"] ) ? $custom ["essb_post_fb_url"] [0] : "";
$essb_post_plusone_url = isset ( $custom ["essb_post_plusone_url"] ) ? $custom ["essb_post_plusone_url"] [0] : "";
$essb_post_share_message = stripslashes ( $essb_post_share_message );
$essb_post_share_text = stripslashes ( $essb_post_share_text );
$essb_post_twitter_hashtags = isset ( $custom ['essb_post_twitter_hashtags'] ) ? $custom ['essb_post_twitter_hashtags'] [0] : "";
$essb_post_twitter_username = isset ( $custom ['essb_post_twitter_username'] ) ? $custom ['essb_post_twitter_username'] [0] : "";
$essb_post_twitter_tweet = isset ( $custom ['essb_post_twitter_tweet'] ) ? $custom ['essb_post_twitter_tweet'] [0] : "";
$essb_activate_ga_campaign_tracking = isset($custom['essb_activate_ga_campaign_tracking']) ? $custom['essb_activate_ga_campaign_tracking'][0] : "";
$essb_post_pin_image = isset ( $custom ["essb_post_pin_image"] ) ? $custom ["essb_post_pin_image"] [0] : "";
$essb_post_pin_desc = isset ( $custom ["essb_post_pin_desc"] ) ? $custom ["essb_post_pin_desc"] [0] : "";
$essb_activate_sharerecovery = isset($custom['essb_activate_sharerecovery']) ? $custom['essb_activate_sharerecovery'][0] : '';
// post share optimizations
$essb_post_og_desc = isset ( $custom ["essb_post_og_desc"] ) ? $custom ["essb_post_og_desc"] [0] : "";
$essb_post_og_title = isset ( $custom ["essb_post_og_title"] ) ? $custom ["essb_post_og_title"] [0] : "";
$essb_post_og_image = isset ( $custom ["essb_post_og_image"] ) ? $custom ["essb_post_og_image"] [0] : "";
$essb_post_og_image1 = isset ( $custom ["essb_post_og_image1"] ) ? $custom ["essb_post_og_image1"] [0] : "";
$essb_post_og_image2 = isset ( $custom ["essb_post_og_image2"] ) ? $custom ["essb_post_og_image2"] [0] : "";
$essb_post_og_image3 = isset ( $custom ["essb_post_og_image3"] ) ? $custom ["essb_post_og_image3"] [0] : "";
$essb_post_og_image4 = isset ( $custom ["essb_post_og_image4"] ) ? $custom ["essb_post_og_image4"] [0] : "";
$essb_post_og_url = isset ( $custom ["essb_post_og_url"] ) ? $custom ["essb_post_og_url"] [0] : "";
$essb_post_og_desc = stripslashes ( $essb_post_og_desc );
$essb_post_og_title = stripslashes ( $essb_post_og_title );
$essb_post_og_video = isset ( $custom ["essb_post_og_video"] ) ? $custom ["essb_post_og_video"] [0] : "";
$essb_post_og_video_w = isset ( $custom ["essb_post_og_video_w"] ) ? $custom ["essb_post_og_video_w"] [0] : "";
$essb_post_og_video_h = isset ( $custom ["essb_post_og_video_h"] ) ? $custom ["essb_post_og_video_h"] [0] : "";
$essb_post_twitter_desc = isset ( $custom ["essb_post_twitter_desc"] ) ? $custom ["essb_post_twitter_desc"] [0] : "";
$essb_post_twitter_title = isset ( $custom ["essb_post_twitter_title"] ) ? $custom ["essb_post_twitter_title"] [0] : "";
$essb_post_twitter_image = isset ( $custom ["essb_post_twitter_image"] ) ? $custom ["essb_post_twitter_image"] [0] : "";
$essb_post_twitter_desc = stripslashes ( $essb_post_twitter_desc );
$essb_post_twitter_title = stripslashes ( $essb_post_twitter_title );
$essb_post_og_author = isset($custom['essb_post_og_author']) ? $custom['essb_post_og_author'][0] : '';
$essb_post_og_author = stripslashes($essb_post_og_author);
// Metabox draw start
ESSBMetaboxInterface::draw_form_start ( 'essb_social_share_optimize' );
$sidebar_options = array();
if (essb_options_bool_value('opengraph_tags') || essb_options_bool_value('twitter_card')) {
$sidebar_options[] = array(
'field_id' => 'opengraph',
'title' => __('Sharing Optimization', 'essb'),
'icon' => 'share-alt',
'type' => 'menu_item',
'action' => 'default',
'default_child' => ''
);
}
$sidebar_options[] = array(
'field_id' => 'twittertag',
'title' => __('Customize Tweet', 'essb'),
'icon' => 'twitter',
'type' => 'menu_item',
'action' => 'default',
'default_child' => ''
);
if (essb_option_bool_value('pinterest_sniff_disable')) {
$sidebar_options[] = array(
'field_id' => 'pinterest',
'title' => __('Pinterest Image', 'essb'),
'icon' => 'pinterest-p',
'type' => 'menu_item',
'action' => 'default',
'default_child' => ''
);
}
$sidebar_options[] = array(
'field_id' => 'share',
'title' => __('Share Message (Advanced)', 'essb'),
'icon' => 'default',
'type' => 'menu_item',
'action' => 'default',
'default_child' => ''
);
$sidebar_options[] = array(
'field_id' => 'ga',
'title' => __('GA Campaign Tracking Options', 'essb'),
'icon' => 'pie-chart',
'type' => 'menu_item',
'action' => 'default',
'default_child' => ''
);
if (defined('ESSB3_SHARED_COUNTER_RECOVERY')) {
$sidebar_options[] = array(
'field_id' => 'sharerecover',
'title' => __('Share Recovery', 'essb'),
'icon' => 'refresh',
'type' => 'menu_item',
'action' => 'default',
'default_child' => ''
);
}
if (defined('ESSB3_CACHED_COUNTERS')) {
$sidebar_options[] = array(
'field_id' => 'sharecounter',
'title' => __('Social Shares', 'essb'),
'icon' => 'sort-numeric-asc',
'type' => 'menu_item',
'action' => 'default',
'default_child' => ''
);
}
if (essb_option_bool_value('activate_fake')) {
$sidebar_options[] = array(
'field_id' => 'fakecounter',
'title' => __('Fake/Dummy Share Counter', 'essb'),
'icon' => 'magic',
'type' => 'menu_item',
'action' => 'default',
'default_child' => ''
);
}
ESSBMetaboxInterface::draw_first_menu_activate('sso');
ESSBMetaboxInterface::draw_sidebar($sidebar_options, 'sso');
ESSBMetaboxInterface::draw_content_start('300', 'sso');
if (essb_options_bool_value('opengraph_tags') || essb_options_bool_value('twitter_card')) {
ESSBMetaboxInterface::draw_content_section_start('opengraph');
if (essb_options_bool_value('opengraph_tags')) {
ESSBOptionsFramework::draw_panel_start(__('SOCIAL MEDIA MESSAGE', 'essb'), __('Customize default generate social sharing message that is filled from post data to grab your social media audience', 'essb'), 'fa21 ti-sharethis', array("mode" => "toggle", "state" => "closed", "css_class" => "essb-auto-open"), 'essb_metabox');
ESSBOptionsFramework::draw_title(__('Social Media Image', 'essb'), __('Add an image that is optimized for maximum exposure on most social networks. We recommend 1200px by 628px', 'essb'), 'inner-row');
ESSBOptionsFramework::draw_options_row_start_full('inner-row-small');
ESSBOptionsFramework::draw_fileselect_image_field('essb_post_og_image', 'essb_metabox', $essb_post_og_image);
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_title(__('Social Media Title', 'essb'), __('Add a title that will populate the open graph meta tag which will be used when users share your content onto most social networks. If nothing is provided here, we will use the post title as a backup. We recommend usage of titles that does not exceed 60 characters', 'essb'), 'inner-row');
ESSBOptionsFramework::draw_options_row_start_full('inner-row-small');
ESSBOptionsFramework::draw_input_field('essb_post_og_title', true, 'essb_metabox', $essb_post_og_title);
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_title(__('Social Media Description', 'essb'), __('Add a description that will populate the open graph meta tag which will be used when users share your content onto most social networks.We recommend usage of description that does not exceed 160 characters', 'essb'), 'inner-row');
ESSBOptionsFramework::draw_options_row_start_full('inner-row-small');
ESSBOptionsFramework::draw_textarea_field('essb_post_og_desc', 'essb_metabox', $essb_post_og_desc);
ESSBOptionsFramework::draw_options_row_end();
//$essb_post_og_url
ESSBOptionsFramework::draw_options_row_start_full('inner-row-small');
//ESSBOptionsFramework::draw_hint(__('Did you know that Facebook has share data cache?', 'essb'), __('All changes that you made on site will not appear immediately unless you clear cache and make Facebook bot revisit your site. The quick way to do this is to use Easy Social Share Buttons top menu in WordPress bar where in Validation you will find link to test and update Facebook information. You can read more about this tool in this article http://appscreo.com/facebook-debugger-tool/ in our blog. ', 'essb'), 'fa21 ti-info-alt');
ESSBOptionsFramework::draw_help(__('Optimize your social share message on all social networks', 'essb'), __('Social Sharing Optimization is important for each site. Without using it you have no control over shared information on social networks. We highly recommend to activate it (Facebook sharing tags are used on almost all social networks so they are the minimal required).', 'essb'), '', array('buttons' => array('How to customize shared information' => 'https://docs.socialsharingplugin.com/knowledgebase/how-to-customize-personalize-shared-information-on-social-networks/', 'I see wrong share information' => 'https://docs.socialsharingplugin.com/knowledgebase/facebook-is-showing-the-wrong-image-title-or-description/', 'Test & Fix Facebook Showing Wrong Information' => 'https://docs.socialsharingplugin.com/knowledgebase/how-to-test-and-fix-facebook-sharing-wrong-information-using-facebook-open-graph-debugger/')));
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_title(__('Customize Open Graph URL', 'essb'), __('Important! This field is needed only if you made a change in your URL structure and you need to customize og:url tag to preserve shares you have. Do not fill here anything unless you are completely sure you need it - not proper usage will lead to loose of your current social shares and comments.', 'essb'), 'inner-row');
ESSBOptionsFramework::draw_options_row_start_full('inner-row-small');
ESSBOptionsFramework::draw_input_field('essb_post_og_url', true, 'essb_metabox', $essb_post_og_url);
ESSBOptionsFramework::draw_options_row_end();
if (essb_option_bool_value('sso_multipleimages')) {
ESSBOptionsFramework::draw_heading(__('Additional Facebook Images', 'essb'), '5');
ESSBOptionsFramework::draw_title(__('Additional Social Media Image #1', 'essb'), __('Add an image that is optimized for maximum exposure on most social networks.We recommend 1200px by 628px', 'essb'), 'inner-row');
ESSBOptionsFramework::draw_options_row_start_full('inner-row-small');
ESSBOptionsFramework::draw_fileselect_field('essb_post_og_image1', 'essb_metabox', $essb_post_og_image1);
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_title(__('Additional Social Media Image #2', 'essb'), __('Add an image that is optimized for maximum exposure on most social networks.We recommend 1200px by 628px', 'essb'), 'inner-row');
ESSBOptionsFramework::draw_options_row_start_full('inner-row-small');
ESSBOptionsFramework::draw_fileselect_field('essb_post_og_image2', 'essb_metabox', $essb_post_og_image2);
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_title(__('Additional Social Media Image #3', 'essb'), __('Add an image that is optimized for maximum exposure on most social networks.We recommend 1200px by 628px', 'essb'), 'inner-row');
ESSBOptionsFramework::draw_options_row_start_full('inner-row-small');
ESSBOptionsFramework::draw_fileselect_field('essb_post_og_image3', 'essb_metabox', $essb_post_og_image3);
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_title(__('Additional Social Media Image #4', 'essb'), __('Add an image that is optimized for maximum exposure on most social networks.We recommend 1200px by 628px', 'essb'), 'inner-row');
ESSBOptionsFramework::draw_options_row_start_full('inner-row-small');
ESSBOptionsFramework::draw_fileselect_field('essb_post_og_image4', 'essb_metabox', $essb_post_og_image4);
ESSBOptionsFramework::draw_options_row_end();
}
ESSBOptionsFramework::draw_title(__('Article Author Profile', 'essb'), __('Add link to Facebook profile page of article author if you wish it to appear in shared information. Example: https://facebook.com/author', 'essb'), 'inner-row');
ESSBOptionsFramework::draw_options_row_start_full('inner-row-small');
ESSBOptionsFramework::draw_input_field('essb_post_og_author', true, 'essb_metabox', $essb_post_og_author);
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_panel_end();
}
if (essb_options_bool_value('twitter_card')) {
ESSBOptionsFramework::draw_panel_start(__('Personalize Twitter card data', 'essb'), __('Twitter card data will be filled with default social share message or with data from Social Share Optimization tags. Use this box in case you need special customizations that will work only for Twitter', 'essb'), 'fa21 ti-twitter', array("mode" => "toggle", "state" => "closed", "css_class" => "essb-auto-open"), 'essb_metabox');
ESSBOptionsFramework::draw_options_row_start(__('Image', 'essb'), __('If an image is provided it will be used in share data', 'essb'));
ESSBOptionsFramework::draw_fileselect_image_field('essb_post_twitter_image', 'essb_metabox', $essb_post_twitter_image);
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_options_row_start(__('Title', 'essb'), __('Add a custom title for your post. This will be used to post on an user\'s wall when they like/share your post.', 'essb'));
ESSBOptionsFramework::draw_input_field('essb_post_twitter_title', true, 'essb_metabox', $essb_post_twitter_title);
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_options_row_start(__('Description', 'essb'), __('Add a custom description for your post. This will be used to post on an user\'s wall when they like/share your post.', 'essb'));
ESSBOptionsFramework::draw_textarea_field('essb_post_twitter_desc', 'essb_metabox', $essb_post_twitter_desc);
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_panel_end();
}
ESSBMetaboxInterface::draw_content_section_end();
}
ESSBMetaboxInterface::draw_content_section_start('twittertag');
ESSBOptionsFramework::reset_row_status();
ESSBOptionsFramework::draw_heading(__('Customize Tweet Message for this post', 'essb'), '5');
ESSBOptionsFramework::draw_options_row_start(__('Hashtags', 'essb'), __('Set custom own tags for post or leave blank to use site defined', 'essb'));
ESSBOptionsFramework::draw_input_field('essb_post_twitter_hashtags', true, 'essb_metabox', $essb_post_twitter_hashtags);
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_options_row_start(__('Username', 'essb'), __('Change default user that will be mentioned into Tweet.', 'essb'));
ESSBOptionsFramework::draw_input_field('essb_post_twitter_username', true, 'essb_metabox', $essb_post_twitter_username);
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_options_row_start(__('Tweet', 'essb'), __('Default Tweet is generated from post title. In this field you can easy define own personalized Tweet for better social network reach.', 'essb'));
ESSBOptionsFramework::draw_textarea_field('essb_post_twitter_tweet', 'essb_metabox', $essb_post_twitter_tweet);
ESSBOptionsFramework::draw_options_row_end();
ESSBMetaboxInterface::draw_content_section_end();
if (essb_option_bool_value('pinterest_sniff_disable')) {
ESSBMetaboxInterface::draw_content_section_start('pinterest');
ESSBOptionsFramework::reset_row_status();
ESSBOptionsFramework::draw_options_row_start(__('Change default Pinterest image', 'essb'), __('Choose personalized image that will be used to when you press Pinterest share button We recommend using an image that is formatted in a 2:3 aspect ratio like 735 x 1102.', 'essb'));
ESSBOptionsFramework::draw_fileselect_image_field('essb_post_pin_image', 'essb_metabox', $essb_post_pin_image);
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_options_row_start(__('Description', 'essb'), __('Add a custom description to your Pin.', 'essb'));
ESSBOptionsFramework::draw_textarea_field('essb_post_pin_desc', 'essb_metabox', $essb_post_pin_desc);
ESSBOptionsFramework::draw_options_row_end();
ESSBMetaboxInterface::draw_content_section_end();
}
ESSBMetaboxInterface::draw_content_section_start('share');
ESSBOptionsFramework::reset_row_status();
ESSBOptionsFramework::draw_heading(__('Customize Share Message (Advanced)', 'essb'), '5');
ESSBOptionsFramework::draw_hint('', __('Customize share message is an easy way to change the default shared information that is used by share buttons. Almost all social networks that plugin support uses URL as leading sharing parameter. This in brief means for you that when you setup custom share data you need to ensure that information is also available into social share optimization tags on the destination URL that plugin will share.
Please do not foget to fill all parameters for better results because few of social networks support almost all parameters and data for them will be taken from that screen if filled or from post default data if they are empty.', 'essb'));
ESSBOptionsFramework::draw_options_row_start(__('URL', 'essb'), __('Provide custom URL to be shared.', 'essb'));
ESSBOptionsFramework::draw_input_field('essb_post_share_url', true, 'essb_metabox', $essb_post_share_url);
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_options_row_start(__('Message', 'essb'), __('Provide custom message to be shared (not all social networks support that option)', 'essb'));
ESSBOptionsFramework::draw_input_field('essb_post_share_message', true, 'essb_metabox', $essb_post_share_message);
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_options_row_start(__('Image', 'essb'), __('Custom image is support by Facebook when advanced sharing is enabled and Pinterest when sniff for images is disabled', 'essb'));
ESSBOptionsFramework::draw_fileselect_field('essb_post_share_image', 'essb_metabox', $essb_post_share_image);
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_options_row_start(__('Description', 'essb'), __('Custom description is support by Facebook when advanced sharing is enabled and Pinterest when sniff for images is disabled', 'essb'));
ESSBOptionsFramework::draw_textarea_field('essb_post_share_text', 'essb_metabox', $essb_post_share_text);
ESSBOptionsFramework::draw_options_row_end();
ESSBMetaboxInterface::draw_content_section_end();
ESSBMetaboxInterface::draw_content_section_start('ga');
ESSBOptionsFramework::reset_row_status();
ESSBOptionsFramework::draw_heading(__('Customize Google Analytics Campaign Tracking Options', 'essb'), '5');
ESSBOptionsFramework::draw_options_row_start(__('Add Custom Google Analytics Campaign parameters to your URLs', 'essb'), __('Paste your custom campaign parameters in this field and they will be automatically added to shared addresses on social networks. Please note as social networks count shares via URL as unique key this option is not compatible with active social share counters as it will make the start from zero.', 'essb'));
ESSBOptionsFramework::draw_input_field('essb_activate_ga_campaign_tracking', true, 'essb_metabox', $essb_activate_ga_campaign_tracking);
ESSBOptionsFramework::draw_options_row_end();
ESSBOptionsFramework::draw_options_row_start(__('', 'essb'), __('', 'essb'), '', '2', false);
print "You can visit this page for more information on how to use and generate these parameters.
To include the social network into parameters use the following code {network}. When that code is reached it will be replaced with the network name (example: facebook). An example campaign trakcing code include network will look like this utm_source=essb_settings&utm_medium=needhelp&utm_campaign={network} - in this configuration when you press Facebook button {network} will be replaced with facebook, if you press Twitter button it will be replaced with twitter.";
ESSBOptionsFramework::draw_options_row_end();
ESSBMetaboxInterface::draw_content_section_end();
if (defined('ESSB3_SHARED_COUNTER_RECOVERY')) {
ESSBMetaboxInterface::draw_content_section_start('sharerecover');
ESSBOptionsFramework::reset_row_status();
ESSBOptionsFramework::draw_heading(__('Share Counter Recovery', 'essb'), '5');
ESSBOptionsFramework::draw_options_row_start(__('Previous post url address', 'essb'), __('Provide custom previous url address of post if the automatic share counter recovery is not possible to guess the previous post address.', 'essb'));
ESSBOptionsFramework::draw_input_field('essb_activate_sharerecovery', true, 'essb_metabox', $essb_activate_sharerecovery);
ESSBOptionsFramework::draw_options_row_end();
ESSBMetaboxInterface::draw_content_section_end();
}
if (defined('ESSB3_CACHED_COUNTERS')) {
ESSBMetaboxInterface::draw_content_section_start('sharecounter');
ESSBOptionsFramework::reset_row_status();
print '