WordPress Social Tools, Related Posts, Monetization – Shareaholic - Version 9.6.1

Version Description

We update this plugin regularly so we can make it better for you. Update to the latest version for all of the available features and improvements. Thanks for using Shareaholic!

Download this release

Release Info

Developer shareaholic
Plugin Icon 128x128 WordPress Social Tools, Related Posts, Monetization – Shareaholic
Version 9.6.1
Comparing to
See all releases

Code changes from version 9.6.0 to 9.6.1

admin.php CHANGED
@@ -191,7 +191,7 @@ class ShareaholicAdmin {
191
  public static function go_premium() {
192
  $api_key = ShareaholicUtilities::get_option( 'api_key' );
193
  echo <<<JQUERY
194
- <script type="text/javascript">
195
  window.location = "https://www.shareaholic.com/plans?siteID=$api_key&brand=shareaholic";
196
  </script>
197
  JQUERY;
@@ -474,38 +474,38 @@ JQUERY;
474
  __( 'Shareaholic', 'shareaholic' ) . $notification_icon,
475
  'manage_options',
476
  'shareaholic-settings',
477
- array( 'ShareaholicAdmin', 'admin' ),
478
  $icon_svg
479
  );
480
  add_submenu_page(
481
  'shareaholic-settings',
482
- __( 'Dashboard', 'shareaholic' ),
483
- __( 'Dashboard', 'shareaholic' ),
484
  'manage_options',
485
  'shareaholic-settings',
486
- array( 'ShareaholicAdmin', 'admin' )
487
  );
488
  add_submenu_page(
489
  'shareaholic-settings',
490
- __( 'Dashboard [legacy]', 'shareaholic' ),
491
- __( 'Dashboard [legacy]', 'shareaholic' ),
492
  'manage_options',
493
- 'shareaholic-settings-legacy',
494
- array( 'ShareaholicAdmin', 'admin_legacy' )
495
  );
496
  add_submenu_page(
497
  'shareaholic-settings',
498
- __( 'Settings', 'shareaholic' ),
499
- __( 'Settings', 'shareaholic' ),
500
  'manage_options',
501
- 'shareaholic-advanced',
502
- array( 'ShareaholicAdmin', 'advanced_admin' )
503
  );
504
  if (ShareaholicUtilities::get_option( 'api_key' )) {
505
  add_submenu_page(
506
  'shareaholic-settings',
507
  __( 'Upgrade', 'shareaholic' ),
508
- __( '<span style="color: #FCB214;">Upgrade</span>', 'shareaholic' ),
509
  'activate_plugins',
510
  'shareaholic-premium',
511
  array( 'ShareaholicAdmin', 'go_premium' )
@@ -516,7 +516,8 @@ JQUERY;
516
  /**
517
  * Updates the information if passed in and sets save message.
518
  */
519
- public static function admin_legacy() {
 
520
  // Fetch and save location status from cloud
521
  ShareaholicUtilities::location_sync_update_plugin();
522
 
@@ -592,9 +593,9 @@ JQUERY;
592
  }
593
 
594
  /**
595
- * The function for the App Manager Tab
596
  */
597
- public static function admin() {
598
 
599
  // Fetch and save location status from cloud
600
  ShareaholicUtilities::location_sync_update_plugin();
@@ -647,7 +648,7 @@ JQUERY;
647
  /**
648
  * The function for the advanced admin section
649
  */
650
- public static function advanced_admin() {
651
 
652
  // Fetch and save location status from cloud
653
  ShareaholicUtilities::location_sync_update_plugin();
@@ -909,42 +910,42 @@ JQUERY;
909
  'domain' => site_url(),
910
  'language' => strtolower( get_bloginfo( 'language' ) ),
911
  ),
912
- 'reasons' => array(
913
- 'error' => esc_html__( 'I think I found a bug', 'shareaholic' ),
914
- 'feature-missing' => esc_html__( 'It\'s missing a feature I need', 'shareaholic' ),
915
- 'too-hard' => esc_html__( 'I couldn\'t figure out how to do something', 'shareaholic' ),
916
- 'inefficient' => esc_html__( 'It\'s too slow or inefficient', 'shareaholic' ),
917
- 'no-signup' => esc_html__( 'I don\'t want to signup', 'shareaholic' ),
918
- 'temporary-deactivation' => esc_html__( 'Temporarily deactivating or troubleshooting', 'shareaholic' ),
919
- 'other' => esc_html__( 'Other', 'shareaholic' )
920
- ),
921
- 'reasons_needing_comment' => array(
922
- 'error',
923
- 'feature-missing',
924
- 'too-hard',
925
- 'other'
926
- ),
927
- 'translations' => array(
928
- 'quick_feedback' => esc_html__( 'Quick Feedback', 'shareaholic' ),
929
- 'foreword' => esc_html__( 'If you would be kind enough, please tell us why you are deactivating the plugin:',
930
- 'shareaholic' ),
931
- 'please_tell_us' => esc_html__( 'Please share anything you think might be helpful. The more we know about your problem, the faster we\'ll be able to fix it.',
932
- 'shareaholic' ),
933
- 'cancel' => esc_html__( 'Cancel', 'shareaholic' ),
934
- 'skip_and_deactivate' => esc_html__( 'Skip &amp; Deactivate', 'shareaholic' ),
935
- 'submit_and_deactivate' => esc_html__( 'Submit &amp; Deactivate', 'shareaholic' ),
936
- 'please_wait' => esc_html__( 'Please wait...', 'shareaholic' ),
937
- 'thank_you' => esc_html__( 'Thank you!', 'shareaholic' ),
938
- 'ask_for_support' => sprintf(
939
- esc_html__( 'Have you visited %1$sthe support forum%2$s and %3$sread the FAQs%2$s for help?',
940
- 'shareaholic' ),
941
- '<a href="https://support.shareaholic.com/" target="_blank" >',
942
- '</a>',
943
- '<a href="https://support.shareaholic.com/hc/categories/200101476-Shareaholic-WordPress-Plugin" target="_blank" >'
944
- ),
945
- 'email_request' => esc_html__( 'If you would like to tell us more, please leave your email here. We will be in touch (only for product feedback, nothing else).',
946
- 'shareaholic' ),
947
- )
948
 
949
  );
950
 
191
  public static function go_premium() {
192
  $api_key = ShareaholicUtilities::get_option( 'api_key' );
193
  echo <<<JQUERY
194
+ <script>
195
  window.location = "https://www.shareaholic.com/plans?siteID=$api_key&brand=shareaholic";
196
  </script>
197
  JQUERY;
474
  __( 'Shareaholic', 'shareaholic' ) . $notification_icon,
475
  'manage_options',
476
  'shareaholic-settings',
477
+ array( 'ShareaholicAdmin', 'cloud_settings' ),
478
  $icon_svg
479
  );
480
  add_submenu_page(
481
  'shareaholic-settings',
482
+ __( 'Cloud Settings', 'shareaholic' ),
483
+ __( 'Cloud Settings', 'shareaholic' ),
484
  'manage_options',
485
  'shareaholic-settings',
486
+ array( 'ShareaholicAdmin', 'cloud_settings' )
487
  );
488
  add_submenu_page(
489
  'shareaholic-settings',
490
+ __( 'In-Page Code Blocks', 'shareaholic' ),
491
+ __( 'In-Page Code Blocks', 'shareaholic' ),
492
  'manage_options',
493
+ 'shareaholic-settings-code-blocks',
494
+ array( 'ShareaholicAdmin', 'admin_code_blocks' )
495
  );
496
  add_submenu_page(
497
  'shareaholic-settings',
498
+ __( 'Plugin Settings', 'shareaholic' ),
499
+ __( 'Plugin Settings', 'shareaholic' ),
500
  'manage_options',
501
+ 'shareaholic-settings-plugin',
502
+ array( 'ShareaholicAdmin', 'plugin_settings' )
503
  );
504
  if (ShareaholicUtilities::get_option( 'api_key' )) {
505
  add_submenu_page(
506
  'shareaholic-settings',
507
  __( 'Upgrade', 'shareaholic' ),
508
+ __( '<span style="color: #FCB214;">Upgrade to Premium</span>', 'shareaholic' ),
509
  'activate_plugins',
510
  'shareaholic-premium',
511
  array( 'ShareaholicAdmin', 'go_premium' )
516
  /**
517
  * Updates the information if passed in and sets save message.
518
  */
519
+ public static function admin_code_blocks() {
520
+
521
  // Fetch and save location status from cloud
522
  ShareaholicUtilities::location_sync_update_plugin();
523
 
593
  }
594
 
595
  /**
596
+ * The function for the Cloud Settings Tab
597
  */
598
+ public static function cloud_settings() {
599
 
600
  // Fetch and save location status from cloud
601
  ShareaholicUtilities::location_sync_update_plugin();
648
  /**
649
  * The function for the advanced admin section
650
  */
651
+ public static function plugin_settings() {
652
 
653
  // Fetch and save location status from cloud
654
  ShareaholicUtilities::location_sync_update_plugin();
910
  'domain' => site_url(),
911
  'language' => strtolower( get_bloginfo( 'language' ) ),
912
  ),
913
+ 'reasons' => array(
914
+ 'error' => esc_html__( 'I think I found a bug', 'shareaholic' ),
915
+ 'feature-missing' => esc_html__( 'It\'s missing a feature I need', 'shareaholic' ),
916
+ 'too-hard' => esc_html__( 'I couldn\'t figure out how to do something', 'shareaholic' ),
917
+ 'inefficient' => esc_html__( 'It\'s too slow or inefficient', 'shareaholic' ),
918
+ 'no-signup' => esc_html__( 'I don\'t want to signup', 'shareaholic' ),
919
+ 'temporary-deactivation' => esc_html__( 'Temporarily deactivating or troubleshooting', 'shareaholic' ),
920
+ 'other' => esc_html__( 'Other', 'shareaholic' )
921
+ ),
922
+ 'reasons_needing_comment' => array(
923
+ 'error',
924
+ 'feature-missing',
925
+ 'too-hard',
926
+ 'other'
927
+ ),
928
+ 'translations' => array(
929
+ 'quick_feedback' => esc_html__( 'Quick Feedback', 'shareaholic' ),
930
+ 'foreword' => esc_html__( 'If you would be kind enough, please tell us why you are deactivating the plugin:',
931
+ 'shareaholic' ),
932
+ 'please_tell_us' => esc_html__( 'Please share anything you think might be helpful. The more we know about your problem, the faster we\'ll be able to fix it.',
933
+ 'shareaholic' ),
934
+ 'cancel' => esc_html__( 'Cancel', 'shareaholic' ),
935
+ 'skip_and_deactivate' => esc_html__( 'Skip &amp; Deactivate', 'shareaholic' ),
936
+ 'submit_and_deactivate' => esc_html__( 'Submit &amp; Deactivate', 'shareaholic' ),
937
+ 'please_wait' => esc_html__( 'Please wait...', 'shareaholic' ),
938
+ 'thank_you' => esc_html__( 'Thank you!', 'shareaholic' ),
939
+ 'ask_for_support' => sprintf(
940
+ esc_html__( 'Have you visited %1$sthe support forum%2$s and %3$sread the FAQs%2$s for help?',
941
+ 'shareaholic' ),
942
+ '<a href="https://support.shareaholic.com/" target="_blank" >',
943
+ '</a>',
944
+ '<a href="https://support.shareaholic.com/hc/categories/200101476-Shareaholic-WordPress-Plugin" target="_blank" >'
945
+ ),
946
+ 'email_request' => esc_html__( 'If you would like to tell us more, please leave your email here. We will be in touch (only for product feedback, nothing else).',
947
+ 'shareaholic' ),
948
+ )
949
 
950
  );
951
 
assets/css/main.css CHANGED
@@ -203,6 +203,10 @@ ul {
203
  color: #f44336;
204
  }
205
 
 
 
 
 
206
  /**
207
  * Spacing classes
208
  * Should be used to modify the default spacing between objects (not between nodes of the same object)
@@ -230,17 +234,17 @@ table h1,table h2,table h3, table h4, table h5, table h6, table p, table ul, tab
230
  height: 495px;
231
  }
232
 
233
- .api-key-modal {
234
  height: auto;
235
  }
236
 
237
  h4 {
238
- background: #424142;
239
  color: #e6e6e6;
240
- font-size: 24px;
241
  line-height: 1.8em;
242
  height: auto;
243
- font-weight: 300;
244
  margin: 0;
245
  }
246
 
@@ -276,17 +280,31 @@ h4 {
276
  cursor: pointer;
277
  display: inline-block;
278
  background: #FF9800;
279
- color: white;
280
  text-transform: uppercase;
281
  text-decoration: none;
282
  padding: 25px 80px;
283
  font-size: 20px;
 
284
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
285
  border-radius: 5px;
286
  -webkit-box-shadow: inset 0 -3px #14947b;
287
  box-shadow: inset 0 -3px #14947b;
288
  }
289
 
 
 
 
 
 
 
 
 
 
 
 
 
 
290
  .blocking-modal .btn_main:active {
291
  top: 1px;
292
  color: white;
@@ -296,7 +314,7 @@ h4 {
296
  }
297
 
298
  .blocking-modal .btn_main:hover {
299
- background: #f79300;
300
  color: white;
301
  border: none;
302
  }
@@ -390,7 +408,7 @@ input[type='text'] {
390
  }
391
 
392
  .key-status.failed {
393
- color: #EB5353;
394
  }
395
 
396
  .key-status.passed {
@@ -398,16 +416,12 @@ input[type='text'] {
398
  }
399
 
400
  .key-status.unknown {
401
- color: #9e9e9e;
402
  }
403
 
404
  .blink {
405
- text-decoration: blink;
406
- -webkit-animation-name: blinker;
407
- -webkit-animation-duration: 2s;
408
- -webkit-animation-iteration-count:infinite;
409
- -webkit-animation-timing-function:ease-in-out;
410
- -webkit-animation-direction: alternate;
411
  }
412
 
413
  @keyframes blinker {
203
  color: #f44336;
204
  }
205
 
206
+ .grey {
207
+ color: #666666;
208
+ }
209
+
210
  /**
211
  * Spacing classes
212
  * Should be used to modify the default spacing between objects (not between nodes of the same object)
234
  height: 495px;
235
  }
236
 
237
+ .api-key-modal, .welcome-modal {
238
  height: auto;
239
  }
240
 
241
  h4 {
242
+ background: #00aa63;
243
  color: #e6e6e6;
244
+ font-size: 22px;
245
  line-height: 1.8em;
246
  height: auto;
247
+ font-weight: 400;
248
  margin: 0;
249
  }
250
 
280
  cursor: pointer;
281
  display: inline-block;
282
  background: #FF9800;
283
+ color: #fff !important;
284
  text-transform: uppercase;
285
  text-decoration: none;
286
  padding: 25px 80px;
287
  font-size: 20px;
288
+ font-weight: 600;
289
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
290
  border-radius: 5px;
291
  -webkit-box-shadow: inset 0 -3px #14947b;
292
  box-shadow: inset 0 -3px #14947b;
293
  }
294
 
295
+ .blocking-modal .btn_main_busy {
296
+ background-image: linear-gradient(-45deg, #ff9800 28%, #b76e03 28%, #b76e03 72%, #ff9800 72%) !important;
297
+ animation: shr-button__busy-animation 2000ms infinite linear;
298
+ background-size: 200px 100%;
299
+ transition: none;
300
+ }
301
+
302
+ @keyframes shr-button__busy-animation {
303
+ 0% {
304
+ background-position: 400px 0;
305
+ }
306
+ }
307
+
308
  .blocking-modal .btn_main:active {
309
  top: 1px;
310
  color: white;
314
  }
315
 
316
  .blocking-modal .btn_main:hover {
317
+ filter: brightness(1.1);
318
  color: white;
319
  border: none;
320
  }
408
  }
409
 
410
  .key-status.failed {
411
+ color: #f44336;
412
  }
413
 
414
  .key-status.passed {
416
  }
417
 
418
  .key-status.unknown {
419
+ color: #666666;
420
  }
421
 
422
  .blink {
423
+ -webkit-animation: blinker 1.5s alternate infinite ease-in-out;
424
+ animation: blinker 1.5s alternate infinite ease-in-out;
 
 
 
 
425
  }
426
 
427
  @keyframes blinker {
lib/plugin-deactivation-survey/deactivate-feedback-form.php CHANGED
@@ -67,12 +67,12 @@ if ( ! function_exists( 'shareaholic_deactivate_feedback' ) ) {
67
  }
68
  } else {
69
  $email = '';
70
- $role = '';
71
  }
72
 
73
  foreach ( $plugins as $plugin ) {
74
  $plugin->email = $email;
75
- $plugin->role = $role;
76
  }
77
 
78
  // Send plugin data.
67
  }
68
  } else {
69
  $email = '';
70
+ $role = '';
71
  }
72
 
73
  foreach ( $plugins as $plugin ) {
74
  $plugin->email = $email;
75
+ $plugin->role = $role;
76
  }
77
 
78
  // Send plugin data.
public.php CHANGED
@@ -350,7 +350,7 @@ class ShareaholicPublic {
350
  $thumbnail_src = wp_get_attachment_thumb_url();
351
  }
352
  if ( function_exists( 'has_post_thumbnail' ) && has_post_thumbnail( $post->ID ) ) {
353
- $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' );
354
  if ( is_array( $thumbnail ) ) {
355
  $thumbnail_src = esc_attr( $thumbnail[0] );
356
  }
@@ -406,9 +406,13 @@ class ShareaholicPublic {
406
  // Return early
407
  return $content;
408
  }
 
 
 
 
409
 
410
  // check individual post prefs
411
- if ( ! get_post_meta( get_the_ID(), "shareaholic_disable_{$app}", true ) ) {
412
  // check if ABOVE location is turned on
413
  if ( isset( $settings[ $app ][ "{$page_type}_above_content" ] ) ) {
414
  $content = self::canvas( null, $app, "{$page_type}_above_content" ) . $content;
350
  $thumbnail_src = wp_get_attachment_thumb_url();
351
  }
352
  if ( function_exists( 'has_post_thumbnail' ) && has_post_thumbnail( $post->ID ) ) {
353
+ $thumbnail = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'large' );
354
  if ( is_array( $thumbnail ) ) {
355
  $thumbnail_src = esc_attr( $thumbnail[0] );
356
  }
406
  // Return early
407
  return $content;
408
  }
409
+
410
+ // In-Page App disabled for this singular post?
411
+ $disabled = get_post_meta( get_the_ID(), "shareaholic_disable_{$app}", true );
412
+ $disabled = apply_filters( "shareaholic_disable_{$app}", $disabled );
413
 
414
  // check individual post prefs
415
+ if ( ! $disabled ) {
416
  // check if ABOVE location is turned on
417
  if ( isset( $settings[ $app ][ "{$page_type}_above_content" ] ) ) {
418
  $content = self::canvas( null, $app, "{$page_type}_above_content" ) . $content;
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: social, social sharing, google analytics, pinterest, twitter, share butto
4
  Requires at least: 3.7
5
  Tested up to: 5.6
6
  Requires PHP: 5.3
7
- Stable tag: 9.6.0
8
 
9
  Boost Audience Engagement with Award Winning Speed Optimized Social Tools: Share Buttons, Related Posts, Monetization & Google Analytics.
10
 
@@ -301,6 +301,33 @@ function shareaholic_disable_review_notice() {
301
  add_action('admin_init', 'shareaholic_disable_review_notice', 11);
302
  `
303
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
304
  = How can I change the thumbnail image size for Shareaholic Related Posts? =
305
 
306
  The default Shareaholic thumbnail width is 640px with dynamic height and no cropping. The thumbnail size can be specified programmatically by adding `add_image_size('shareaholic-thumbnail', $width, $height, true);` to your theme's `functions.php` file with [appropriate width and height variables](https://developer.wordpress.org/reference/functions/add_image_size/).
@@ -308,6 +335,20 @@ The default Shareaholic thumbnail width is 640px with dynamic height and no crop
308
  Each time you change Shareaholic's thumbnail dimensions like this, you will probably want to have WordPress regenerate appropriate sized thumbnails for all of your images. We highly recommend the [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) plugin for this purpose.
309
 
310
  == Changelog ==
 
 
 
 
 
 
 
 
 
 
 
 
 
 
311
  = 9.6.0 (30-December-2020) =
312
  * [Enhancement](https://wordpress.org/support/topic/google-analytics-cookies/): Google Analytics tracker is now only set if you have [Google Analytics Social Interaction tracking](https://support.shareaholic.com/hc/en-us/articles/205181045-Official-Google-Analytics-Integration-for-Share-Buttons) enabled in your Shareaholic Share Button settings. This means less code on page and speed boost for those that do not use Google Analytics.
313
  * Enhancement: Mobile improvements for Share Buttons for Images. They now appear on touch, in addition to tap = more shares.
@@ -315,10 +356,6 @@ Each time you change Shareaholic's thumbnail dimensions like this, you will prob
315
  * Bugfix: Fixes whitespace added by code indentation when entering Facebook App credentials
316
  * Bugfix: Account for when `wp_get_attachment_image_src` returns false if no image is available
317
 
318
- **Are you missing your Facebook Share Counts?** *Facebook recently decided to drop support for unauthenticated Share Count lookups. No need to worry. Shareaholic offers two options to get back your Facebook Share Counts:*
319
- * [Self-hosted (free option)](https://support.shareaholic.com/hc/en-us/articles/202809466-WordPress-Plugin-Share-Count-Proxy-API-Local-)
320
- * [Hosted by Shareaholic (premium option)](https://support.shareaholic.com/hc/en-us/articles/360029500132-Share-Count-Proxy-API-Hosted-) - We recommend this option as self hosting Share Counts yourself can be a resource hog. A dedicated service to keep Shareaholic light on site resources is your simplest and fastest option. Our servers do all the heavy lifting such as storage, rate limiting, caching, and more behind the scenes work while keeping your website fast. An added advantage of the premium version are higher API lookup limits.
321
-
322
  = 9.5.0 (19-October-2020) =
323
  * New Follow Buttons
324
  * TikTok
@@ -1079,7 +1116,7 @@ Each time you change Shareaholic's thumbnail dimensions like this, you will prob
1079
  * Show Related Posts data status
1080
 
1081
  == Upgrade Notice ==
1082
- = 9.6.0 =
1083
  We update this plugin regularly so we can make it better for you. Update to the latest version for all of the available features and improvements. Thanks for using Shareaholic!
1084
 
1085
  = 8.12.1 =
4
  Requires at least: 3.7
5
  Tested up to: 5.6
6
  Requires PHP: 5.3
7
+ Stable tag: 9.6.1
8
 
9
  Boost Audience Engagement with Award Winning Speed Optimized Social Tools: Share Buttons, Related Posts, Monetization & Google Analytics.
10
 
301
  add_action('admin_init', 'shareaholic_disable_review_notice', 11);
302
  `
303
 
304
+ = How can I programmatically disable Shareaholic In-Page Apps? =
305
+
306
+ You can disable Shareaholic In-Page Apps using a [filter](https://developer.wordpress.org/plugins/hooks/filters/) (PHP code) that you can add to a "functionality" plugin such as the [Code Snippets](https://wordpress.org/plugins/code-snippets/) plugin.
307
+
308
+ Disable Shareaholic In-Page Apps in specific categories, for example:
309
+
310
+ `function shareaholic_disable_categories() {
311
+ // Examples of in_category usage: https://codex.wordpress.org/Function_Reference/in_category
312
+ if ( in_category( array( 'my_category_1_slug', 'my_category_2_slug' ) ) ) {
313
+ return true;
314
+ }
315
+ }
316
+ add_filter( 'shareaholic_disable_share_buttons', 'shareaholic_disable_categories' );
317
+ add_filter( 'shareaholic_disable_recommendations', 'shareaholic_disable_categories' );`
318
+
319
+ Disable Shareaholic In-Page Apps on a custom post type, for example:
320
+
321
+ `function shareaholic_disable_customposts() {
322
+ if ( 'my_custom_post_type' == get_post_type() ) {
323
+ return true;
324
+ }
325
+ }
326
+ add_filter( 'shareaholic_disable_share_buttons', 'shareaholic_disable_customposts' );
327
+ add_filter( 'shareaholic_disable_recommendations', 'shareaholic_disable_customposts' );`
328
+
329
+ For all other apps, use ["Targeting Rules"](https://support.shareaholic.com/hc/en-us/articles/204887575-How-to-enable-or-disable-Floated-Share-Buttons-from-specific-pages) to disable apps from specific sections of your website.
330
+
331
  = How can I change the thumbnail image size for Shareaholic Related Posts? =
332
 
333
  The default Shareaholic thumbnail width is 640px with dynamic height and no cropping. The thumbnail size can be specified programmatically by adding `add_image_size('shareaholic-thumbnail', $width, $height, true);` to your theme's `functions.php` file with [appropriate width and height variables](https://developer.wordpress.org/reference/functions/add_image_size/).
335
  Each time you change Shareaholic's thumbnail dimensions like this, you will probably want to have WordPress regenerate appropriate sized thumbnails for all of your images. We highly recommend the [Regenerate Thumbnails](https://wordpress.org/plugins/regenerate-thumbnails/) plugin for this purpose.
336
 
337
  == Changelog ==
338
+ = 9.6.1 (01-January-2021) =
339
+ Wishing you a very Happy New Year from our family to yours! 🎉
340
+
341
+ * Critical Bugfix: Fixes issue with blank settings page
342
+ * Enhancements: More helpful error messages (with instructions on how to fix the error)
343
+ * Enhancement: Hook to programmatically remove Shareaholic In-Page Apps such as Share Buttons and Related Posts. [See FAQs for instructions](https://wordpress.org/plugins/shareaholic/).
344
+
345
+ **Are you missing your Facebook Share Counts?** *Facebook recently decided to drop support for unauthenticated Share Count lookups. Shareaholic offers two options to get back your Facebook Share Counts:*
346
+
347
+ * [Self-hosted by you (free option)](https://support.shareaholic.com/hc/en-us/articles/202809466-WordPress-Plugin-Share-Count-Proxy-API-Local-)
348
+ * [Cloud Hosted on our servers (premium option)](https://support.shareaholic.com/hc/en-us/articles/360029500132-Share-Count-Proxy-API-Hosted-) Recommended
349
+
350
+ We recommend the Cloud Hosted option as self-hosting Share Counts infrastructure yourself can be a resource hog. A dedicated service to keep Shareaholic light on site resources is your simplest and fastest option. Our servers do all the heavy lifting such as storage, rate limiting, caching, and more behind the scenes work while keeping your website fast. An added advantage of the premium version are higher API lookup limits.
351
+
352
  = 9.6.0 (30-December-2020) =
353
  * [Enhancement](https://wordpress.org/support/topic/google-analytics-cookies/): Google Analytics tracker is now only set if you have [Google Analytics Social Interaction tracking](https://support.shareaholic.com/hc/en-us/articles/205181045-Official-Google-Analytics-Integration-for-Share-Buttons) enabled in your Shareaholic Share Button settings. This means less code on page and speed boost for those that do not use Google Analytics.
354
  * Enhancement: Mobile improvements for Share Buttons for Images. They now appear on touch, in addition to tap = more shares.
356
  * Bugfix: Fixes whitespace added by code indentation when entering Facebook App credentials
357
  * Bugfix: Account for when `wp_get_attachment_image_src` returns false if no image is available
358
 
 
 
 
 
359
  = 9.5.0 (19-October-2020) =
360
  * New Follow Buttons
361
  * TikTok
1116
  * Show Related Posts data status
1117
 
1118
  == Upgrade Notice ==
1119
+ = 9.6.1 =
1120
  We update this plugin regularly so we can make it better for you. Update to the latest version for all of the available features and improvements. Thanks for using Shareaholic!
1121
 
1122
  = 8.12.1 =
shareaholic.php CHANGED
@@ -3,7 +3,7 @@
3
  Plugin Name: Shareaholic - Grow and Engage Your Audience
4
  Plugin URI: https://www.shareaholic.com/website-tools/
5
  Description: Shareaholic’s official WordPress plugin allows you to add Award-Winning Social Share Buttons, Related Posts, Content Analytics, Ad Monetization, and more to your website.
6
- Version: 9.6.0
7
  Author: Shareaholic
8
  Author URI: https://www.shareaholic.com
9
  Text Domain: shareaholic
@@ -14,7 +14,7 @@ Domain Path: /languages
14
  * The main file!
15
  *
16
  * @package shareaholic
17
- * @version 9.6.0
18
  */
19
 
20
  /**
@@ -67,7 +67,7 @@ if ( ! class_exists( 'Shareaholic' ) ) {
67
  const API_URL = 'https://web.shareaholic.com'; // uses static IPs for firewall whitelisting
68
  const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
69
 
70
- const VERSION = '9.6.0';
71
 
72
  /**
73
  * Starts off as false so that ::get_instance() returns
3
  Plugin Name: Shareaholic - Grow and Engage Your Audience
4
  Plugin URI: https://www.shareaholic.com/website-tools/
5
  Description: Shareaholic’s official WordPress plugin allows you to add Award-Winning Social Share Buttons, Related Posts, Content Analytics, Ad Monetization, and more to your website.
6
+ Version: 9.6.1
7
  Author: Shareaholic
8
  Author URI: https://www.shareaholic.com
9
  Text Domain: shareaholic
14
  * The main file!
15
  *
16
  * @package shareaholic
17
+ * @version 9.6.1
18
  */
19
 
20
  /**
67
  const API_URL = 'https://web.shareaholic.com'; // uses static IPs for firewall whitelisting
68
  const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
69
 
70
+ const VERSION = '9.6.1';
71
 
72
  /**
73
  * Starts off as false so that ::get_instance() returns
templates/advanced_settings.php CHANGED
@@ -26,21 +26,6 @@ window.ShareaholicConfig = {
26
  </p>
27
  </div>
28
 
29
- <div class='clear'></div>
30
-
31
- <div class="app">
32
- <h2><?php _e( 'Shareaholic Site Profile ID', 'shareaholic' ); ?></h2>
33
- <div class="app-content">
34
- <?php
35
- if ( ShareaholicUtilities::get_option( 'api_key' ) ) {
36
- echo '<code style="font-size: 16px;">' . ShareaholicUtilities::get_option( 'api_key' ) . '</code>';
37
- } else {
38
- _e( 'Not set.', 'shareaholic' );
39
- }
40
- ?>
41
- </div>
42
- </div>
43
-
44
  <div class='clear'></div>
45
 
46
  <div class="app">
@@ -67,7 +52,31 @@ window.ShareaholicConfig = {
67
  </div>
68
 
69
  <div class='clear'></div>
70
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
71
  <div class="app">
72
  <h2><?php _e( 'Connect Shareaholic Account', 'shareaholic' ); ?></h2>
73
  <div class="app-content">
@@ -77,6 +86,9 @@ window.ShareaholicConfig = {
77
  </div>
78
  </div>
79
  </div>
 
 
 
80
 
81
  <div class='clear'></div>
82
 
@@ -87,11 +99,11 @@ window.ShareaholicConfig = {
87
  $sync_status = ShareaholicUtilities::location_sync_status();
88
  if ( $sync_status == 200 ) {
89
  ?>
90
- <span class="key-status passed"><?php _e( 'Plugin In-Page Block settings are in-sync with Shareaholic Cloud', 'shareaholic' ); ?></span>
91
  <?php } elseif ( $sync_status == 409 ) { ?>
92
- <span class="key-status failed"><?php _e( 'Plugin In-Page Block settings are NOT in-sync with Shareaholic Cloud', 'shareaholic' ); ?></span>
93
  <?php } else { ?>
94
- <span class="key-status unknown"><?php _e( 'Sync Status Unknown', 'shareaholic' ); ?></span>
95
  <?php } ?>
96
  </div>
97
  </div>
@@ -208,14 +220,17 @@ window.ShareaholicConfig = {
208
  </div>
209
  </div>
210
  </form>
211
-
 
 
 
212
  <div class='clear'></div>
213
-
214
  <form name='reset_settings' method='post' action='<?php echo $action; ?>'>
215
  <?php wp_nonce_field( $action, 'nonce_field' ); ?>
216
  <input type='hidden' name='reset_settings' value='Y'>
217
  <div class="app">
218
- <h2><?php _e( 'Reset Plugin', 'shareaholic' ); ?></h2>
219
  <div class="app-content">
220
  <?php _e( 'This will reset all of your settings and start you from scratch. This can not be undone.', 'shareaholic' ); ?>
221
  <div class="button-wrapper">
@@ -223,6 +238,10 @@ window.ShareaholicConfig = {
223
  </div>
224
  </div>
225
  </div>
 
 
 
 
226
 
227
  <div class='clear' style="padding-bottom:10px;"></div>
228
 
26
  </p>
27
  </div>
28
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
29
  <div class='clear'></div>
30
 
31
  <div class="app">
52
  </div>
53
 
54
  <div class='clear'></div>
55
+
56
+ <div class="app">
57
+ <h2><?php _e( 'Shareaholic Site Profile ID', 'shareaholic' ); ?></h2>
58
+ <div class="app-content">
59
+ <?php
60
+ if ( ShareaholicUtilities::get_option( 'api_key' ) ) {
61
+ echo '<code style="font-size: 16px;">' . ShareaholicUtilities::get_option( 'api_key' ) . '</code>';
62
+ if (ShareaholicUtilities::site_id_is404() == '404') {
63
+ echo '<p style="margin-left:0;"> <span class="key-status failed"><i class="fa fa-circle red blink" aria-hidden="true"></i> ';
64
+ echo sprintf( __( 'This Site Profile ID is invalid. Try <a href="%1$s"">resetting the plugin to fix this issue</a>.', 'shareaholic' ), '#reset' );
65
+ echo '</span></p>';
66
+ }
67
+ } else {
68
+ _e( 'Not set.', 'shareaholic' );
69
+ }
70
+ ?>
71
+ </div>
72
+ </div>
73
+
74
+ <div class='clear'></div>
75
+
76
+ <?php
77
+ // Show this section only if we have a valid Site ID
78
+ if (ShareaholicUtilities::site_id_is200() == '200') {
79
+ ?>
80
  <div class="app">
81
  <h2><?php _e( 'Connect Shareaholic Account', 'shareaholic' ); ?></h2>
82
  <div class="app-content">
86
  </div>
87
  </div>
88
  </div>
89
+ <?php
90
+ }
91
+ ?>
92
 
93
  <div class='clear'></div>
94
 
99
  $sync_status = ShareaholicUtilities::location_sync_status();
100
  if ( $sync_status == 200 ) {
101
  ?>
102
+ <span class="key-status passed"><i class="fa fa-circle green" aria-hidden="true"></i> <?php _e( 'Plugin In-Page Block settings are in-sync with Shareaholic Cloud', 'shareaholic' ); ?></span>
103
  <?php } elseif ( $sync_status == 409 ) { ?>
104
+ <span class="key-status failed"><i class="fa fa-circle red blink" aria-hidden="true"></i> <?php _e( 'Plugin In-Page Block settings are NOT in-sync with Shareaholic Cloud.', 'shareaholic' ); ?> <a href="https://www.shareaholic.com/help/message" target="_blank"><?php _e( 'Please contact Shareaholic support for help.', 'shareaholic' ); ?></a></span>
105
  <?php } else { ?>
106
+ <span class="key-status unknown"><i class="fa fa-circle grey" aria-hidden="true"></i> <?php _e( 'Cloud Sync status is unknown.', 'shareaholic' ); ?></span> <a href="https://www.shareaholic.com/help/message" target="_blank"><?php _e( 'Please contact Shareaholic support for help.', 'shareaholic' ); ?></a>
107
  <?php } ?>
108
  </div>
109
  </div>
220
  </div>
221
  </div>
222
  </form>
223
+
224
+ <?php
225
+ if ( ShareaholicUtilities::get_option( 'api_key' ) ) {
226
+ ?>
227
  <div class='clear'></div>
228
+
229
  <form name='reset_settings' method='post' action='<?php echo $action; ?>'>
230
  <?php wp_nonce_field( $action, 'nonce_field' ); ?>
231
  <input type='hidden' name='reset_settings' value='Y'>
232
  <div class="app">
233
+ <h2 id="reset"><?php _e( 'Reset Plugin', 'shareaholic' ); ?></h2>
234
  <div class="app-content">
235
  <?php _e( 'This will reset all of your settings and start you from scratch. This can not be undone.', 'shareaholic' ); ?>
236
  <div class="button-wrapper">
238
  </div>
239
  </div>
240
  </div>
241
+
242
+ <?php
243
+ }
244
+ ?>
245
 
246
  <div class='clear' style="padding-bottom:10px;"></div>
247
 
templates/failed_to_create_api_key_modal.php CHANGED
@@ -2,17 +2,23 @@
2
  <h4><?php echo sprintf( __( 'Setup Shareaholic', 'shareaholic' ) ); ?></h4>
3
  <div class="content pal" style="padding:20px;">
4
  <p style="font-size:14px;">
5
- <?php _e( 'It appears that we are having some trouble communicating with Shareaholic Cloud servers right now. This is usually temporary. Please revisit this section after a few minutes or click "retry" now.', 'shareaholic' ); ?>
6
- </p>
7
- <a id='get_started' class="btn_main" style="margin-top: 15px;" href=''><?php echo _e( 'Retry', 'shareaholic' ); ?></a>
8
- <br />
9
- <span style="font-size:12px; font-weight:normal;">
10
- <a href='<?php echo admin_url(); ?>'><?php _e( 'or, try again later.', 'shareaholic' ); ?></a>
11
- </span>
12
- <br /><br />
13
- <p style="font-size:12px; font-weight:normal;">
14
- <?php echo sprintf( __( 'If you continue to get this prompt for more than a few minutes, ensure that you have the latest version of the plugin installed. If you still continue to get this prompt, then check "Shareaholic Server Connectivity Status" or reset the plugin. Both are available under %1$sAdvanced Settings%2$s.', 'shareaholic' ), '<a href="admin.php?page=shareaholic-advanced">', '</a>' ); ?> <?php echo sprintf( __( 'If you are stuck, have a question or have a bug to report, please %1$slet us know%2$s.', 'shareaholic' ), '<a href="https://www.shareaholic.com/help/message" target="_blank">', '</a>' ); ?>
15
  </p>
 
 
 
 
 
 
 
 
 
 
 
16
  </div>
17
  </div>
18
 
2
  <h4><?php echo sprintf( __( 'Setup Shareaholic', 'shareaholic' ) ); ?></h4>
3
  <div class="content pal" style="padding:20px;">
4
  <p style="font-size:14px;">
5
+ <?php if (ShareaholicUtilities::site_id_is404() == '404') { ?>
6
+ <?php echo sprintf( __( 'There is a syncing issue between the plugin and Shareaholic Cloud servers that requires a plugin reset to fix. To reset the plugin, please visit %1$sPlugin Settings%2$s.', 'shareaholic' ), '<a href="admin.php?page=shareaholic-settings-plugin#reset">', '</a>'); ?>
7
+ <?php } else { ?>
8
+
9
+ <?php _e( 'It appears that we are having some trouble communicating with Shareaholic Cloud servers right now. This is usually temporary. Please revisit this section after a few minutes or click "retry" now.', 'shareaholic' ); ?>
 
 
 
 
 
10
  </p>
11
+ <a id='get_started' class="btn_main" onclick="document.getElementById('get_started').innerHTML='<?php echo sprintf( __( 'Retrying...', 'shareaholic' ) ); ?>';document.getElementById('get_started').classList.add('btn_main_busy');" style="margin-top: 15px;" href=''><?php echo _e( 'Retry', 'shareaholic' ); ?></a>
12
+
13
+ <br />
14
+ <span style="font-size:12px; font-weight:normal;">
15
+ <a href='<?php echo admin_url(); ?>'><?php _e( 'or, try again later.', 'shareaholic' ); ?></a>
16
+ </span>
17
+ <br /><br />
18
+ <p style="font-size:13px; font-weight:normal;">
19
+ <?php echo sprintf( __( 'If you continue to get this prompt for more than a few minutes, ensure that you have the latest version of the plugin installed. If you still continue to get this prompt, then check "Shareaholic Server Connectivity Status" or reset the plugin. Both are available under %1$sPlugin Settings%2$s.', 'shareaholic' ), '<a href="admin.php?page=shareaholic-settings-plugin">', '</a>' ); ?> <?php echo sprintf( __( 'If you are stuck, have a question or have a bug to report, please %1$slet us know%2$s.', 'shareaholic' ), '<a href="https://www.shareaholic.com/help/message" target="_blank">', '</a>' ); ?>
20
+ </p>
21
+ <?php } ?>
22
  </div>
23
  </div>
24
 
templates/settings.php CHANGED
@@ -12,7 +12,7 @@ window.ShareaholicConfig = {
12
  </script>
13
 
14
  <div class='wrap'>
15
- <h2><?php echo sprintf( __( 'Dashboard - Legacy', 'shareaholic' ) ); ?></h2>
16
 
17
  <div class='reveal-modal' id='editing_modal'>
18
  <div id='iframe_container' class='bg-loading-img' allowtransparency='true'></div>
12
  </script>
13
 
14
  <div class='wrap'>
15
+ <h2></h2>
16
 
17
  <div class='reveal-modal' id='editing_modal'>
18
  <div id='iframe_container' class='bg-loading-img' allowtransparency='true'></div>
templates/terms_of_service_modal.php CHANGED
@@ -1,11 +1,11 @@
1
- <div class='reveal-modal blocking-modal' id='terms_of_service_modal'>
2
- <h4><?php echo sprintf( __( 'Welcome to Shareaholic!', 'shareaholic' ) ); ?></h4>
3
  <div class="content pal">
4
  <p style="font-size: 18px; color: #323648; line-height: 1.4em; padding-top: 24px; margin: 0;">
5
- <?php echo sprintf( __( '%1$sA Suite of Essential Tools to Grow Your Website%2$s', 'shareaholic' ), '<strong>', '</strong>' ); ?>
6
  </p>
7
- <p style="font-size: 12px; color: #666; line-height: 1.8em; padding-bottom: 0;">
8
- <?php echo sprintf( __( 'Shareaholic provides you with a comprehensive set of marketing tools to engage with your audience, get found on social, and grow your following. The toolkit includes Award-Winning Social Share Buttons, Related Posts, Analytics, Ad Monetization, and more. Customize what is right for your website from the App Manager.', 'shareaholic' ) ); ?>
9
  </p>
10
 
11
  <div class="shr-people"></div>
@@ -41,8 +41,8 @@
41
  -->
42
 
43
  <div class="pvl">
44
- <a id="get_started" class="btn_main" style="margin-top: -20px;"><?php echo sprintf( __( 'Get Started »', 'shareaholic' ) ); ?></a>
45
- <p><small style="font-size:12px; color: rgb(136, 136, 136);"><?php echo sprintf( __( 'By clicking "Get Started" you agree to Shareholic\'s %1$sTerms of Service%2$s and %3$sPrivacy Policy%4$s.', 'shareaholic' ), '<a href="https://www.shareaholic.com/terms/?src=wp_admin" target="_new">', '</a>', '<a href="https://www.shareaholic.com/privacy/?src=wp_admin" target="_new">', '</a>' ); ?></small>
46
  </p>
47
  </div>
48
 
1
+ <div class='reveal-modal blocking-modal welcome-modal' id='terms_of_service_modal'>
2
+ <h4><?php echo sprintf( __( 'Welcome to Shareaholic', 'shareaholic' ) ); ?></h4>
3
  <div class="content pal">
4
  <p style="font-size: 18px; color: #323648; line-height: 1.4em; padding-top: 24px; margin: 0;">
5
+ <?php echo sprintf( __( '%1$sThe Most Powerful WordPress Social Plugin & Toolkit%2$s', 'shareaholic' ), '<strong>', '</strong>' ); ?>
6
  </p>
7
+ <p style="font-size: 13px; color: #666; line-height: 1.8em; padding-bottom: 0;">
8
+ <?php echo sprintf( __( 'Shareaholic provides you with a comprehensive set of marketing tools to engage with your audience, get found on social, and grow your following. The toolkit includes Award-Winning Social Share Buttons, Related Posts, Analytics, Ad Monetization, and more. Customize what is right for your website from the Shareaholic App Manager.', 'shareaholic' ) ); ?>
9
  </p>
10
 
11
  <div class="shr-people"></div>
41
  -->
42
 
43
  <div class="pvl">
44
+ <a id="get_started" onclick="document.getElementById('get_started').innerHTML='<?php echo sprintf( __( 'Setting up...', 'shareaholic' ) ); ?>';document.getElementById('get_started').classList.add('btn_main_busy');" class="btn_main" style="margin-top: -20px;"><?php echo sprintf( __( 'Get Started ', 'shareaholic' ) ); ?></a>
45
+ <p style="margin-bottom: 20px;"><small style="font-size:12px; color: rgb(136, 136, 136);"><?php echo sprintf( __( 'By clicking "Get Started" you agree to Shareholic\'s %1$sTerms of Service%2$s and %3$sPrivacy Policy%4$s.', 'shareaholic' ), '<a href="https://www.shareaholic.com/terms/?src=wp_admin" target="_new">', '</a>', '<a href="https://www.shareaholic.com/privacy/?src=wp_admin" target="_new">', '</a>' ); ?></small>
46
  </p>
47
  </div>
48
 
utilities.php CHANGED
@@ -107,15 +107,15 @@ class ShareaholicUtilities {
107
  public static function admin_plugin_action_links( $links ) {
108
  if ( is_array( $links ) ) {
109
  $settings_link = '<a href="' . esc_url( admin_url( 'admin.php?page=shareaholic-settings' ) ) . '">' . __( 'Settings', 'shareaholic' ) . '</a>';
110
- if (ShareaholicUtilities::get_option( 'api_key' )) {
111
- $premium_link = '<a href="https://www.shareaholic.com/plans?siteID='. ShareaholicUtilities::get_option( 'api_key' ) .'&brand=shareaholic" target="_blank" rel="noopener noreferrer">' . __( 'Upgrade', 'shareaholic' ) . '</a>';
112
  }
113
  $helpdesk_link = '<a href="https://support.shareaholic.com/" target="_blank" rel="noopener noreferrer">' . __( 'Support & Documentation', 'shareaholic' ) . '</a>';
114
 
115
  array_unshift( $links, $settings_link );
116
  $links[] = $helpdesk_link;
117
 
118
- if (ShareaholicUtilities::get_option( 'api_key' )) {
119
  $links[] = $premium_link;
120
  }
121
  }
@@ -169,7 +169,7 @@ class ShareaholicUtilities {
169
  array(
170
  'parent' => 'wp_shareaholic_adminbar_menu',
171
  'id' => 'wp_shareaholic_adminbar_submenu-settings',
172
- 'title' => __( 'Dashboard', 'shareaholic' ),
173
  'href' => admin_url( 'admin.php?page=shareaholic-settings' ),
174
  )
175
  );
@@ -537,19 +537,21 @@ class ShareaholicUtilities {
537
  * @param string $api_key
538
  */
539
  public static function get_new_location_name_ids( $api_key ) {
 
540
  $response = ShareaholicCurl::get( Shareaholic::API_URL . "/publisher_tools/{$api_key}.json" );
541
 
542
  if ( is_array( $response ) && array_key_exists( 'body', $response ) ) {
543
  $response_code = wp_remote_retrieve_response_code( $response );
544
  if ( $response_code == '404' ) {
545
- delete_option( 'shareaholic_settings' );
546
- self::get_or_create_api_key();
 
547
  }
 
 
 
548
  }
549
 
550
- $publisher_configuration = $response['body'];
551
- $result = array();
552
-
553
  if ( $publisher_configuration && is_array( $publisher_configuration ) ) {
554
  foreach ( array( 'share_buttons', 'recommendations' ) as $app ) {
555
  foreach ( $publisher_configuration['apps'][ $app ]['locations'] as $id => $location ) {
@@ -1391,7 +1393,7 @@ class ShareaholicUtilities {
1391
  $thumbnail_shareaholic = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'shareaholic-thumbnail' );
1392
  $thumbnail_full = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); // Original image resolution (unmodified)
1393
 
1394
- if ( ( $size == 'shareaholic-thumbnail' ) && (! empty( $thumbnail_shareaholic[0]) && ! empty( $thumbnail_full[0])) && ( $thumbnail_shareaholic[0] !== $thumbnail_full[0] ) ) {
1395
  $featured_img = esc_attr( $thumbnail_shareaholic[0] );
1396
  } else {
1397
  if ( $size == 'shareaholic-thumbnail' ) {
@@ -1415,7 +1417,7 @@ class ShareaholicUtilities {
1415
  */
1416
  public static function fetch_fb_access_token() {
1417
  if ( self::get_option( 'facebook_app_id' ) && self::get_option( 'facebook_app_secret' ) ) {
1418
- return self::get_option( 'facebook_app_id' ) . '|' . self::get_option( 'facebook_app_secret' );
1419
  }
1420
  return false;
1421
  }
@@ -1596,6 +1598,56 @@ class ShareaholicUtilities {
1596
  }
1597
  }
1598
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1599
  /**
1600
  * Manages V8 => V9 upgrade
1601
  */
@@ -1608,7 +1660,7 @@ class ShareaholicUtilities {
1608
  $response_code = wp_remote_retrieve_response_code( $response );
1609
  if ( $response_code == '404' ) {
1610
  // Site ID is not active in Shareaholic Cloud.
1611
- exit;
1612
  }
1613
  }
1614
 
@@ -1665,7 +1717,7 @@ class ShareaholicUtilities {
1665
  $response_code = wp_remote_retrieve_response_code( $response );
1666
  if ( $response_code == '404' ) {
1667
  // Site ID is not active in Shareaholic Cloud
1668
- exit;
1669
  }
1670
  }
1671
 
107
  public static function admin_plugin_action_links( $links ) {
108
  if ( is_array( $links ) ) {
109
  $settings_link = '<a href="' . esc_url( admin_url( 'admin.php?page=shareaholic-settings' ) ) . '">' . __( 'Settings', 'shareaholic' ) . '</a>';
110
+ if (self::get_option( 'api_key' )) {
111
+ $premium_link = '<a href="https://www.shareaholic.com/plans?siteID=' . self::get_option( 'api_key' ) . '&brand=shareaholic" target="_blank" rel="noopener noreferrer">' . __( 'Upgrade', 'shareaholic' ) . '</a>';
112
  }
113
  $helpdesk_link = '<a href="https://support.shareaholic.com/" target="_blank" rel="noopener noreferrer">' . __( 'Support & Documentation', 'shareaholic' ) . '</a>';
114
 
115
  array_unshift( $links, $settings_link );
116
  $links[] = $helpdesk_link;
117
 
118
+ if (self::get_option( 'api_key' )) {
119
  $links[] = $premium_link;
120
  }
121
  }
169
  array(
170
  'parent' => 'wp_shareaholic_adminbar_menu',
171
  'id' => 'wp_shareaholic_adminbar_submenu-settings',
172
+ 'title' => __( 'Cloud Settings', 'shareaholic' ),
173
  'href' => admin_url( 'admin.php?page=shareaholic-settings' ),
174
  )
175
  );
537
  * @param string $api_key
538
  */
539
  public static function get_new_location_name_ids( $api_key ) {
540
+
541
  $response = ShareaholicCurl::get( Shareaholic::API_URL . "/publisher_tools/{$api_key}.json" );
542
 
543
  if ( is_array( $response ) && array_key_exists( 'body', $response ) ) {
544
  $response_code = wp_remote_retrieve_response_code( $response );
545
  if ( $response_code == '404' ) {
546
+ self::load_template( 'failed_to_create_api_key_modal' );
547
+ self::log_bad_response( 'FailedToFetchPubConfig_404', $response );
548
+ return;
549
  }
550
+
551
+ $publisher_configuration = $response['body'];
552
+ $result = array();
553
  }
554
 
 
 
 
555
  if ( $publisher_configuration && is_array( $publisher_configuration ) ) {
556
  foreach ( array( 'share_buttons', 'recommendations' ) as $app ) {
557
  foreach ( $publisher_configuration['apps'][ $app ]['locations'] as $id => $location ) {
1393
  $thumbnail_shareaholic = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'shareaholic-thumbnail' );
1394
  $thumbnail_full = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'full' ); // Original image resolution (unmodified)
1395
 
1396
+ if ( ( $size == 'shareaholic-thumbnail' ) && ( ! empty( $thumbnail_shareaholic[0]) && ! empty( $thumbnail_full[0]) ) && ( $thumbnail_shareaholic[0] !== $thumbnail_full[0] ) ) {
1397
  $featured_img = esc_attr( $thumbnail_shareaholic[0] );
1398
  } else {
1399
  if ( $size == 'shareaholic-thumbnail' ) {
1417
  */
1418
  public static function fetch_fb_access_token() {
1419
  if ( self::get_option( 'facebook_app_id' ) && self::get_option( 'facebook_app_secret' ) ) {
1420
+ return self::get_option( 'facebook_app_id' ) . '%7C' . self::get_option( 'facebook_app_secret' );
1421
  }
1422
  return false;
1423
  }
1598
  }
1599
  }
1600
 
1601
+ /**
1602
+ * Site ID 200 check
1603
+ */
1604
+ public static function site_id_is200() {
1605
+ $api_key = self::get_option( 'api_key' );
1606
+ if ( $api_key ) {
1607
+ if (strlen( $api_key ) < 30 ) {
1608
+ return 'invalid_apikey';
1609
+ }
1610
+ $response = ShareaholicCurl::get( Shareaholic::API_URL . "/publisher_tools/{$api_key}.json" );
1611
+ if ( is_array( $response ) && array_key_exists( 'body', $response ) ) {
1612
+ $response_code = wp_remote_retrieve_response_code( $response );
1613
+ if ( $response_code == '200' ) {
1614
+ return '200';
1615
+ } else {
1616
+ return 'not_200';
1617
+ }
1618
+ } else {
1619
+ return 'no_connection';
1620
+ }
1621
+ } else {
1622
+ return 'no_apikey';
1623
+ }
1624
+ }
1625
+
1626
+ /**
1627
+ * Site ID 404 check
1628
+ */
1629
+ public static function site_id_is404() {
1630
+ $api_key = self::get_option( 'api_key' );
1631
+ if ( $api_key ) {
1632
+ if (strlen( $api_key ) < 30 ) {
1633
+ return 'invalid_apikey';
1634
+ }
1635
+ $response = ShareaholicCurl::get( Shareaholic::API_URL . "/publisher_tools/{$api_key}.json" );
1636
+ if ( is_array( $response ) && array_key_exists( 'body', $response ) ) {
1637
+ $response_code = wp_remote_retrieve_response_code( $response );
1638
+ if ( $response_code == '404' ) {
1639
+ return '404';
1640
+ } else {
1641
+ return 'not_404';
1642
+ }
1643
+ } else {
1644
+ return 'no_connection';
1645
+ }
1646
+ } else {
1647
+ return 'no_apikey';
1648
+ }
1649
+ }
1650
+
1651
  /**
1652
  * Manages V8 => V9 upgrade
1653
  */
1660
  $response_code = wp_remote_retrieve_response_code( $response );
1661
  if ( $response_code == '404' ) {
1662
  // Site ID is not active in Shareaholic Cloud.
1663
+ return;
1664
  }
1665
  }
1666
 
1717
  $response_code = wp_remote_retrieve_response_code( $response );
1718
  if ( $response_code == '404' ) {
1719
  // Site ID is not active in Shareaholic Cloud
1720
+ return;
1721
  }
1722
  }
1723