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

Version Description

Introduces a brand-new unified Shareaholic Admin UI (in beta) and massive page speed gains

Download this release

Release Info

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

Code changes from version 8.12.0 to 8.12.1

admin.php CHANGED
@@ -184,6 +184,7 @@ JQUERY;
184
  */
185
  public static function admin_header() {
186
  ShareaholicUtilities::draw_meta_xua();
 
187
  }
188
 
189
  /**
@@ -341,7 +342,7 @@ JQUERY;
341
  }
342
 
343
  /**
344
- * Enqueing styles and scripts for the admin panel
345
  *
346
  * @since 7.0.2.0
347
  */
@@ -350,13 +351,23 @@ JQUERY;
350
  wp_enqueue_style('shareaholic_bootstrap_css', plugins_url('assets/css/bootstrap.css', __FILE__), false, ShareaholicUtilities::get_version());
351
  wp_enqueue_style('shareaholic_reveal_css', plugins_url('assets/css/reveal.css', __FILE__), false, ShareaholicUtilities::get_version());
352
  wp_enqueue_style('shareaholic_main_css', plugins_url('assets/css/main.css', __FILE__), false, ShareaholicUtilities::get_version());
353
- wp_enqueue_script('shareholic_utilities_js', ShareaholicUtilities::asset_url_admin('assets/pub/utilities.js'), false, ShareaholicUtilities::get_version());
354
  wp_enqueue_script('shareholic_bootstrap_js', plugins_url('assets/js/bootstrap.min.js', __FILE__), false, ShareaholicUtilities::get_version());
355
  wp_enqueue_script('shareholic_jquery_custom_js', plugins_url('assets/js/jquery_custom.js', __FILE__), false, ShareaholicUtilities::get_version());
356
  wp_enqueue_script('shareholic_jquery_ui_custom_js', plugins_url('assets/js/jquery_ui_custom.js', __FILE__), array('shareholic_jquery_custom_js'), ShareaholicUtilities::get_version());
357
  wp_enqueue_script('shareholic_modified_reveal_js', plugins_url('assets/js/jquery.reveal.modified.js', __FILE__), array('shareholic_jquery_custom_js', 'shareholic_jquery_ui_custom_js'), ShareaholicUtilities::get_version());
358
  wp_enqueue_script('shareholic_main_js', plugins_url('assets/js/main.js', __FILE__), false, ShareaholicUtilities::get_version());
359
- wp_enqueue_script('shareholic_admin_js', ShareaholicUtilities::asset_url_admin('media/js/platforms/wordpress/wordpress-admin.js'), false, ShareaholicUtilities::get_version(), true);
 
 
 
 
 
 
 
 
 
 
 
360
  }
361
  }
362
 
@@ -491,9 +502,9 @@ JQUERY;
491
  }
492
 
493
  if (ShareaholicUtilities::has_accepted_terms_of_service()) {
494
- $api_key = ShareaholicUtilities::get_or_create_api_key();
495
  $jwt = ShareaholicAdmin::get_publisher_token();
496
-
497
  if ($jwt) {
498
  ShareaholicUtilities::load_template('admin_beta', array(
499
  'jwt' => $jwt,
@@ -501,6 +512,7 @@ JQUERY;
501
  ));
502
  } else {
503
  ShareaholicUtilities::load_template('failed_to_create_api_key_modal');
 
504
  }
505
  }
506
  }
@@ -508,13 +520,13 @@ JQUERY;
508
  /**
509
  * Gets the JWT auth for React UI
510
  */
511
- private static function get_publisher_token() {
512
- $settings = ShareaholicUtilities::get_settings();
513
- $verificationKey = $settings['verification_key'];
 
 
514
 
515
- $response = ShareaholicCurl::post(Shareaholic::API_URL . "/api/v3/sessions",
516
- array('verification_key' => $verificationKey)
517
- ,'json');
518
 
519
  if ($response && preg_match('/20*/', $response['response']['code'])) {
520
  return $response['body']['publisher_token'];
184
  */
185
  public static function admin_header() {
186
  ShareaholicUtilities::draw_meta_xua();
187
+ ShareaholicAdmin::include_remote_js();
188
  }
189
 
190
  /**
342
  }
343
 
344
  /**
345
+ * Enqueue local styles and scripts for the admin panel
346
  *
347
  * @since 7.0.2.0
348
  */
351
  wp_enqueue_style('shareaholic_bootstrap_css', plugins_url('assets/css/bootstrap.css', __FILE__), false, ShareaholicUtilities::get_version());
352
  wp_enqueue_style('shareaholic_reveal_css', plugins_url('assets/css/reveal.css', __FILE__), false, ShareaholicUtilities::get_version());
353
  wp_enqueue_style('shareaholic_main_css', plugins_url('assets/css/main.css', __FILE__), false, ShareaholicUtilities::get_version());
 
354
  wp_enqueue_script('shareholic_bootstrap_js', plugins_url('assets/js/bootstrap.min.js', __FILE__), false, ShareaholicUtilities::get_version());
355
  wp_enqueue_script('shareholic_jquery_custom_js', plugins_url('assets/js/jquery_custom.js', __FILE__), false, ShareaholicUtilities::get_version());
356
  wp_enqueue_script('shareholic_jquery_ui_custom_js', plugins_url('assets/js/jquery_ui_custom.js', __FILE__), array('shareholic_jquery_custom_js'), ShareaholicUtilities::get_version());
357
  wp_enqueue_script('shareholic_modified_reveal_js', plugins_url('assets/js/jquery.reveal.modified.js', __FILE__), array('shareholic_jquery_custom_js', 'shareholic_jquery_ui_custom_js'), ShareaholicUtilities::get_version());
358
  wp_enqueue_script('shareholic_main_js', plugins_url('assets/js/main.js', __FILE__), false, ShareaholicUtilities::get_version());
359
+ }
360
+ }
361
+
362
+ /**
363
+ * Include remote styles and scripts for the admin panel.
364
+ * This addresses a conflict with 3rd party plugins that force modify the paths of scripts that are passed through to wp_enqueue_script
365
+ *
366
+ * @since 8.12.1
367
+ */
368
+ public static function include_remote_js() {
369
+ if (isset($_GET['page']) && preg_match('/shareaholic/', $_GET['page'])) {
370
+ echo "\n<script src='" . ShareaholicUtilities::asset_url_admin('assets/pub/utilities.js') . '?' . ShareaholicUtilities::get_version() . "'></script>\n";
371
  }
372
  }
373
 
502
  }
503
 
504
  if (ShareaholicUtilities::has_accepted_terms_of_service()) {
505
+ $api_key = ShareaholicUtilities::get_or_create_api_key();
506
  $jwt = ShareaholicAdmin::get_publisher_token();
507
+
508
  if ($jwt) {
509
  ShareaholicUtilities::load_template('admin_beta', array(
510
  'jwt' => $jwt,
512
  ));
513
  } else {
514
  ShareaholicUtilities::load_template('failed_to_create_api_key_modal');
515
+ ShareaholicUtilities::load_template('script_chat');
516
  }
517
  }
518
  }
520
  /**
521
  * Gets the JWT auth for React UI
522
  */
523
+ private static function get_publisher_token() {
524
+ $payload = array(
525
+ 'site_id' => ShareaholicUtilities::get_option('api_key'),
526
+ 'verification_key' => ShareaholicUtilities::get_option('verification_key'),
527
+ );
528
 
529
+ $response = ShareaholicCurl::post(Shareaholic::API_URL . "/api/v3/sessions", $payload, 'json');
 
 
530
 
531
  if ($response && preg_match('/20*/', $response['response']['code'])) {
532
  return $response['body']['publisher_token'];
assets/css/main.css CHANGED
@@ -231,14 +231,14 @@ table h1,table h2,table h3, table h4, table h5, table h6, table p, table ul, tab
231
  text-align: center;
232
  color: #414042;
233
  font-size: 14px;
234
- line-height: 16pt;
235
  box-shadow: 0px 0px 52px rgba(0,0,0,0.32);
236
  padding: 0;
237
  height: 495px;
238
  }
239
 
240
  .api-key-modal {
241
- height: 320px;
242
  }
243
 
244
  h4 {
@@ -271,7 +271,7 @@ h4 {
271
  margin: 10px;
272
  font-size: 12px;
273
  line-height: 1.6em;
274
- padding: 0px 20px 0px 20px;
275
  }
276
 
277
  .blocking-modal img {
231
  text-align: center;
232
  color: #414042;
233
  font-size: 14px;
234
+ line-height: 1.6em;
235
  box-shadow: 0px 0px 52px rgba(0,0,0,0.32);
236
  padding: 0;
237
  height: 495px;
238
  }
239
 
240
  .api-key-modal {
241
+ height: auto;
242
  }
243
 
244
  h4 {
271
  margin: 10px;
272
  font-size: 12px;
273
  line-height: 1.6em;
274
+ padding: 0px 10px 0px 10px;
275
  }
276
 
277
  .blocking-modal img {
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: buttons, related posts, google analytics, share buttons, social sharing,
4
  Requires at least: 3.3
5
  Tested up to: 5.1
6
  Requires PHP: 5.2
7
- Stable tag: 8.12.0
8
 
9
 
10
  Improve Audience Engagement with Award Winning Site-Speed Optimized Social Tools: Share Buttons, Related Posts, Monetization & Google Analytics.
@@ -267,6 +267,10 @@ The default Shareaholic thumbnail width is 640px with dynamic height and no crop
267
  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.
268
 
269
  == Changelog ==
 
 
 
 
270
  = 8.12.0 (2019-03-21) =
271
  * Enhancement: Representing months of hardwork, this release introduces a brand-new unified Shareaholic Admin UI (in beta)! In addition to the regular App Manager tab, you will notice a brand new secondary App Manager tab in your sidebar labed _beta_. For the first time, all Shareaholic Cloud settings are now available to view and configure right from your WordPress Admin Dashboard. Please do try it out and let us know if it works well for you. This is in beta, so please do send us any and all feedback either via Live Chat or via our [helpdesk contact](https://www.shareaholic.com/help/message).
272
  * Bugfix: Fixes edge cases where Facebook tried to cache preview meta data before a post was live
@@ -875,7 +879,7 @@ Each time you change Shareaholic's thumbnail dimensions like this, you will prob
875
  * Show Related Posts data status
876
 
877
  == Upgrade Notice ==
878
- = 8.12.0 =
879
  Introduces a brand-new unified Shareaholic Admin UI (in beta) and massive page speed gains = 50% faster load times on your site! This update also fixes issue with some themes rendering Shareaholic Apps multiple times. This one is a must upgrade!
880
 
881
  = 8.10.7 =
4
  Requires at least: 3.3
5
  Tested up to: 5.1
6
  Requires PHP: 5.2
7
+ Stable tag: 8.12.1
8
 
9
 
10
  Improve Audience Engagement with Award Winning Site-Speed Optimized Social Tools: Share Buttons, Related Posts, Monetization & Google Analytics.
267
  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.
268
 
269
  == Changelog ==
270
+ = 8.12.1 (2019-03-23) =
271
+ * Bugfix: Fixes broken links to helpdesk
272
+ * Enhancement: Improves auth with Shareaholic Cloud
273
+
274
  = 8.12.0 (2019-03-21) =
275
  * Enhancement: Representing months of hardwork, this release introduces a brand-new unified Shareaholic Admin UI (in beta)! In addition to the regular App Manager tab, you will notice a brand new secondary App Manager tab in your sidebar labed _beta_. For the first time, all Shareaholic Cloud settings are now available to view and configure right from your WordPress Admin Dashboard. Please do try it out and let us know if it works well for you. This is in beta, so please do send us any and all feedback either via Live Chat or via our [helpdesk contact](https://www.shareaholic.com/help/message).
276
  * Bugfix: Fixes edge cases where Facebook tried to cache preview meta data before a post was live
879
  * Show Related Posts data status
880
 
881
  == Upgrade Notice ==
882
+ = 8.12.1 =
883
  Introduces a brand-new unified Shareaholic Admin UI (in beta) and massive page speed gains = 50% faster load times on your site! This update also fixes issue with some themes rendering Shareaholic Apps multiple times. This one is a must upgrade!
884
 
885
  = 8.10.7 =
shareaholic.php CHANGED
@@ -3,14 +3,14 @@
3
  * The main file!
4
  *
5
  * @package shareaholic
6
- * @version 8.12.0
7
  */
8
 
9
  /*
10
  Plugin Name: Fast Share Buttons, Analytics, Related Posts and More - Shareaholic
11
  Plugin URI: https://www.shareaholic.com/website-tools/
12
  Description: The award winning all-in-one Social Media and Related Posts solution for WordPress. Get found on social and grow your following. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for settings.
13
- Version: 8.12.0
14
  Author: Shareaholic
15
  Author URI: https://www.shareaholic.com
16
  Text Domain: shareaholic
@@ -61,7 +61,7 @@ if (!class_exists('Shareaholic')) {
61
  const API_URL = 'https://web.shareaholic.com'; // uses static IPs for firewall whitelisting
62
  const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
63
 
64
- const VERSION = '8.12.0';
65
 
66
  /**
67
  * Starts off as false so that ::get_instance() returns
3
  * The main file!
4
  *
5
  * @package shareaholic
6
+ * @version 8.12.1
7
  */
8
 
9
  /*
10
  Plugin Name: Fast Share Buttons, Analytics, Related Posts and More - Shareaholic
11
  Plugin URI: https://www.shareaholic.com/website-tools/
12
  Description: The award winning all-in-one Social Media and Related Posts solution for WordPress. Get found on social and grow your following. See <a href="admin.php?page=shareaholic-settings">configuration panel</a> for settings.
13
+ Version: 8.12.1
14
  Author: Shareaholic
15
  Author URI: https://www.shareaholic.com
16
  Text Domain: shareaholic
61
  const API_URL = 'https://web.shareaholic.com'; // uses static IPs for firewall whitelisting
62
  const CM_API_URL = 'https://cm-web.shareaholic.com'; // uses static IPs for firewall whitelisting
63
 
64
+ const VERSION = '8.12.1';
65
 
66
  /**
67
  * Starts off as false so that ::get_instance() returns
templates/advanced_settings.php CHANGED
@@ -62,7 +62,7 @@
62
  <p class="key-description"><?php _e('Shareaholic should be working correctly.', 'shareaholic'); ?> <?php _e('All Shareaholic servers are accessible.', 'shareaholic'); ?></p>
63
  <?php } else { // can't connect to any server ?>
64
  <span class="key-status failed"><i class="fa fa-circle" aria-hidden="true" class="red"></i> <?php _e('Unable to reach any Shareaholic server', 'shareaholic'); ?></span> <a href="#" onClick="window.location.reload(); this.innerHTML='<?php _e('Checking...', 'shareaholic'); ?>';"><?php _e('Re-check', 'shareaholic'); ?></a>
65
- <p class="key-description"><?php echo sprintf( __('A network problem or firewall is blocking all connections from your web server to Shareaholic.com. <strong>Shareaholic cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Shareaholic and firewalls</a>. Let us <a href="#" onclick="%s">know</a> too, so we can follow up!'), 'http://blog.shareaholic.com/shareaholic-hosting-faq/', 'SnapEngage.startLink();','</a>'); ?></p>
66
  <?php } ?>
67
  </p>
68
  <p>
@@ -72,7 +72,7 @@
72
  <p class="key-description"><?php _e('The server-side Share Counts API should be working correctly.', 'shareaholic'); ?> <?php _e('All servers and services needed by the API are accessible.', 'shareaholic'); ?></p>
73
  <?php } else { // can't connect to any server ?>
74
  <span class="key-status failed"><i class="fa fa-circle" aria-hidden="true" class="red"></i> <?php _e('Unable to reach the server-side Share Count API', 'shareaholic'); ?></span> <a href="#" onClick="window.location.reload(); this.innerHTML='<?php _e('Checking...', 'shareaholic'); ?>';"><?php _e('Re-check', 'shareaholic'); ?></a>
75
- <p class="key-description"><?php echo sprintf( __('A network problem or firewall is blocking connections from your web server to various Share Count APIs. <strong>The API cannot work correctly until this is fixed.</strong> If you continue to face this issue, please contact <a href="#" onclick="%s">us</a> and we will follow up! In the meantime, if you disable the server-side Share Counts API from the Advanced options above, Shareaholic will default to using client-side APIs for share counts successfully -- so nothing to worry about!'), 'SnapEngage.startLink();'); ?></p>
76
  <?php } ?>
77
  <?php } ?>
78
  </p>
62
  <p class="key-description"><?php _e('Shareaholic should be working correctly.', 'shareaholic'); ?> <?php _e('All Shareaholic servers are accessible.', 'shareaholic'); ?></p>
63
  <?php } else { // can't connect to any server ?>
64
  <span class="key-status failed"><i class="fa fa-circle" aria-hidden="true" class="red"></i> <?php _e('Unable to reach any Shareaholic server', 'shareaholic'); ?></span> <a href="#" onClick="window.location.reload(); this.innerHTML='<?php _e('Checking...', 'shareaholic'); ?>';"><?php _e('Re-check', 'shareaholic'); ?></a>
65
+ <p class="key-description"><?php echo sprintf( __('A network problem or firewall is blocking all connections from your web server to Shareaholic.com. <strong>Shareaholic cannot work correctly until this is fixed.</strong> Please contact your web host or firewall administrator and give them <a href="%s" target="_blank">this information about Shareaholic and firewalls</a>. <a href="#" class="%s">Let us know too</a>, so we can follow up!'), 'https://www.shareaholic.com/blog/shareaholic-hosting-faq/', 'drift-open-chat','</a>'); ?></p>
66
  <?php } ?>
67
  </p>
68
  <p>
72
  <p class="key-description"><?php _e('The server-side Share Counts API should be working correctly.', 'shareaholic'); ?> <?php _e('All servers and services needed by the API are accessible.', 'shareaholic'); ?></p>
73
  <?php } else { // can't connect to any server ?>
74
  <span class="key-status failed"><i class="fa fa-circle" aria-hidden="true" class="red"></i> <?php _e('Unable to reach the server-side Share Count API', 'shareaholic'); ?></span> <a href="#" onClick="window.location.reload(); this.innerHTML='<?php _e('Checking...', 'shareaholic'); ?>';"><?php _e('Re-check', 'shareaholic'); ?></a>
75
+ <p class="key-description"><?php echo sprintf( __('A network problem or firewall is blocking connections from your web server to various Share Count APIs. <strong>The API cannot work correctly until this is fixed.</strong> If you continue to face this issue, please <a href="#" class="%s">contact us</a> and we will follow up! In the meantime, if you disable the server-side Share Counts API from the Advanced options above, Shareaholic will default to using client-side APIs for share counts successfully -- so nothing to worry about!'), 'drift-open-chat'); ?></p>
76
  <?php } ?>
77
  <?php } ?>
78
  </p>
templates/failed_to_create_api_key_modal.php CHANGED
@@ -1,7 +1,7 @@
1
  <div class='reveal-modal blocking-modal api-key-modal' id='failed_to_create_api_key'>
2
  <h4><?php echo sprintf(__('Setup Shareaholic', 'shareaholic')); ?></h4>
3
- <div class="content pal" style="padding:10px;">
4
- <p>
5
  <?php _e('It appears that we are having some trouble setting up Shareaholic for WordPress 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>
@@ -10,9 +10,9 @@
10
  <a href='<?php echo admin_url() ?>'><?php _e('or, try again later.', 'shareaholic'); ?></a>
11
  </span>
12
  <br /><br />
13
- <span style="font-size:11px; font-weight:normal;">
14
- <?php echo sprintf(__('If you continue to get this prompt for more than a few minutes, try to check Shareaholic server connectivity or reset the plugin. Both are available under %sadvanced settings%s.', 'shareaholic'), '<a href="admin.php?page=shareaholic-advanced">', '</a>'); ?> <?php echo sprintf(__('Also, if you have a question or have a bug to report, please %slet us know%s.', 'shareaholic'), '<a href="#" onclick="SnapEngage.startLink();">','</a>'); ?>
15
- </span>
16
  </div>
17
  </div>
18
 
1
  <div class='reveal-modal blocking-modal api-key-modal' id='failed_to_create_api_key'>
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 setting up Shareaholic for WordPress 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>
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 %sAdvanced Settings%s.', 'shareaholic'), '<a href="admin.php?page=shareaholic-advanced">', '</a>'); ?> <?php echo sprintf(__('Also, if you have a question or have a bug to report, please %slet us know%s.', 'shareaholic'), '<a href="https://www.shareaholic.com/help/message" target="_blank">','</a>'); ?>
15
+ </p>
16
  </div>
17
  </div>
18
 
templates/footer.php CHANGED
@@ -24,4 +24,5 @@ _hsq.push(["setContentType", "standard-page"]);
24
  </script>
25
  <!-- End of Async HubSpot Analytics Code -->
26
 
27
- <script src="https://dsms0mj1bbhn4.cloudfront.net/assets/pub/loader-reachable.js" async></script>
 
24
  </script>
25
  <!-- End of Async HubSpot Analytics Code -->
26
 
27
+ <script src="<?php echo ShareaholicUtilities::asset_url_admin('media/js/platforms/wordpress/wordpress-admin.js') ?>"></script>
28
+ <script src="<?php echo ShareaholicUtilities::asset_url_admin('assets/pub/loader-reachable.js') ?>" async></script>
templates/script_chat.php CHANGED
@@ -1,2 +1,2 @@
1
 
2
- <script src="https://dsms0mj1bbhn4.cloudfront.net/assets/pub/shareaholic-chat.js" async></script>
1
 
2
+ <script src="<?php echo ShareaholicUtilities::asset_url_admin('assets/pub/shareaholic-chat.js') ?>" async></script>