Social Share WordPress Plugin – AccessPress Social Share - Version 4.1.1

Version Description

  • Added options to disable the cache for the url share counts.
  • Added an option to enable the social share in popup window.
Download this release

Release Info

Developer Access Keys
Plugin Icon 128x128 Social Share WordPress Plugin – AccessPress Social Share
Version 4.1.1
Comparing to
See all releases

Code changes from version 4.1.0 to 4.1.1

accesspress-social-share.php CHANGED
@@ -1,10 +1,10 @@
1
  <?php
2
  defined( 'ABSPATH' ) or die( "No script kiddies please!" );
3
  /*
4
- Plugin name: AccessPress Social Share
5
  Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-social-share/
6
  Description: A plugin to add various social media shares to a site with dynamic configuration options.
7
- Version: 4.1.0
8
  Author: AccessPress Themes
9
  Author URI: http://accesspressthemes.com
10
  Text Domain: accesspress-social-share
@@ -30,7 +30,7 @@ if ( !defined( 'APSS_LANG_DIR' ) ) {
30
  }
31
 
32
  if ( !defined( 'APSS_VERSION' ) ) {
33
- define( 'APSS_VERSION', '4.1.0' );
34
  }
35
 
36
  if ( !defined( 'APSS_TEXT_DOMAIN' ) ) {
@@ -385,26 +385,31 @@ if ( !class_exists( 'APSS_Class' ) ) {
385
  //for facebook url share count
386
  function get_fb( $url ) {
387
  $apss_settings = $this->apss_settings;
388
- $cache_period = $apss_settings['cache_period'];
389
- $fb_transient = 'fb_' . md5( $url );
390
- $fb_transient_count = get_transient( $fb_transient );
391
-
392
- //for setting the counter transient in separate options value
393
- $apss_social_counts_transients = get_option( APSS_COUNT_TRANSIENTS );
394
- if ( false === $fb_transient_count ) {
395
- // $json_string = $this->get_json_values( 'https://graph.facebook.com/?id=' . $url );
396
- // $json = json_decode( $json_string, true );
397
- // $facebook_count = isset($json['shares']) ? intval( $json['shares'] ) : 0;
 
 
 
 
 
 
 
 
 
 
 
 
398
  $json_string = $this->get_json_values( 'https://api.facebook.com/method/links.getStats?urls=' . $url . '&format=json' );
399
  $json = json_decode( $json_string, true );
400
  $facebook_count = isset( $json[0]['total_count'] ) ? intval( $json[0]['total_count'] ) : 0;
401
- set_transient( $fb_transient, $facebook_count, $cache_period * HOUR_IN_SECONDS );
402
- if ( !in_array( $fb_transient, $apss_social_counts_transients ) ) {
403
- $apss_social_counts_transients[] = $fb_transient;
404
- update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
405
- }
406
- } else {
407
- $facebook_count = $fb_transient_count;
408
  }
409
  return $facebook_count;
410
  }
@@ -412,13 +417,41 @@ if ( !class_exists( 'APSS_Class' ) ) {
412
  //for twitter url share count
413
  function get_tweets( $url ) {
414
  $apss_settings = $this->apss_settings;
415
- $cache_period = $apss_settings['cache_period'];
416
- $twitter_transient = 'twitter_' . md5( $url );
417
- $twitter_transient_count = get_transient( $twitter_transient );
 
 
 
 
 
 
 
 
 
 
 
 
418
 
419
- //for setting the counter transient in separate options value
420
- $apss_social_counts_transients = get_option( APSS_COUNT_TRANSIENTS );
421
- if ( false === $twitter_transient_count ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
422
  if(isset($apss_settings['twitter_counter_api'])){
423
  $api_selection = $apss_settings['twitter_counter_api'];
424
  }else{
@@ -438,13 +471,6 @@ if ( !class_exists( 'APSS_Class' ) ) {
438
 
439
  $json = json_decode( $json_string, true );
440
  $tweet_count = isset( $json['count'] ) ? intval( $json['count'] ) : 0;
441
- set_transient( $twitter_transient, $tweet_count, $cache_period * HOUR_IN_SECONDS );
442
- if ( !in_array( $twitter_transient, $apss_social_counts_transients ) ) {
443
- $apss_social_counts_transients[] = $twitter_transient;
444
- update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
445
- }
446
- } else {
447
- $tweet_count = $twitter_transient_count;
448
  }
449
  return $tweet_count;
450
  }
@@ -452,13 +478,35 @@ if ( !class_exists( 'APSS_Class' ) ) {
452
  //for google plus url share count
453
  function get_plusones( $url ) {
454
  $apss_settings = $this->apss_settings;
455
- $cache_period = $apss_settings['cache_period'];
456
- $googlePlus_transient = 'gp_' . md5( $url );
457
- $googlePlus_transient_count = get_transient( $googlePlus_transient );
458
-
459
- //for setting the counter transient in separate options value
460
- $apss_social_counts_transients = get_option( APSS_COUNT_TRANSIENTS );
461
- if ( false === $googlePlus_transient_count ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
462
  $curl = curl_init();
463
  curl_setopt( $curl, CURLOPT_URL, "https://clients6.google.com/rpc" );
464
  curl_setopt( $curl, CURLOPT_POST, true );
@@ -471,13 +519,6 @@ if ( !class_exists( 'APSS_Class' ) ) {
471
  unset( $curl );
472
  $json = json_decode( $curl_results, true );
473
  $plusones_count = isset( $json[0]['result']['metadata']['globalCounts']['count'] ) ? intval( $json[0]['result']['metadata']['globalCounts']['count'] ) : 0;
474
- set_transient( $googlePlus_transient, $plusones_count, $cache_period * HOUR_IN_SECONDS );
475
- if ( !in_array( $googlePlus_transient, $apss_social_counts_transients ) ) {
476
- $apss_social_counts_transients[] = $googlePlus_transient;
477
- update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
478
- }
479
- } else {
480
- $plusones_count = $googlePlus_transient_count;
481
  }
482
  return $plusones_count;
483
  }
@@ -485,24 +526,31 @@ if ( !class_exists( 'APSS_Class' ) ) {
485
  //for pinterest url share count
486
  function get_pinterest( $url ) {
487
  $apss_settings = $this->apss_settings;
488
- $cache_period = $apss_settings['cache_period'];
489
- $pinterest_transient = 'pinterest_' . md5( $url );
490
- $pinterest_transient_count = get_transient( $pinterest_transient );
491
-
492
- //for setting the counter transient in separate options value
493
- $apss_social_counts_transients = get_option( APSS_COUNT_TRANSIENTS );
494
- if ( false === $pinterest_transient_count ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
495
  $json_string = $this->get_json_values( 'http://api.pinterest.com/v1/urls/count.json?url=' . $url );
496
  $json_string = preg_replace( '/^receiveCount\((.*)\)$/', "\\1", $json_string );
497
  $json = json_decode( $json_string, true );
498
  $pinterest_count = isset( $json['count'] ) ? intval( $json['count'] ) : 0;
499
- set_transient( $pinterest_transient, $pinterest_count, $cache_period * HOUR_IN_SECONDS );
500
- if ( !in_array( $pinterest_transient, $apss_social_counts_transients ) ) {
501
- $apss_social_counts_transients[] = $pinterest_transient;
502
- update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
503
- }
504
- } else {
505
- $pinterest_count = $pinterest_transient_count;
506
  }
507
  return $pinterest_count;
508
  }
@@ -510,24 +558,30 @@ if ( !class_exists( 'APSS_Class' ) ) {
510
  //for linkedin url share count
511
  function get_linkedin( $url ) {
512
  $apss_settings = $this->apss_settings;
513
- $cache_period = $apss_settings['cache_period'];
514
- $linkedin_transient = 'linkedin_' . md5( $url );
515
- $linkedin_transient_count = get_transient( $linkedin_transient );
516
-
517
- //for setting the counter transient in separate options value
518
- $apss_social_counts_transients = get_option( APSS_COUNT_TRANSIENTS );
519
- if ( false === $linkedin_transient_count ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
520
  $json_string = $this->get_json_values( "https://www.linkedin.com/countserv/count/share?url=$url&format=json" );
521
  $json = json_decode( $json_string, true );
522
  $linkedin_count = isset( $json['count'] ) ? intval( $json['count'] ) : 0;
523
-
524
- set_transient( $linkedin_transient, $linkedin_count, $cache_period * HOUR_IN_SECONDS );
525
- if ( !in_array( $linkedin_transient, $apss_social_counts_transients ) ) {
526
- $apss_social_counts_transients[] = $linkedin_transient;
527
- update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
528
- }
529
- } else {
530
- $linkedin_count = $linkedin_transient_count;
531
  }
532
  return $linkedin_count;
533
  }
1
  <?php
2
  defined( 'ABSPATH' ) or die( "No script kiddies please!" );
3
  /*
4
+ Plugin name: Social Share WordPress Plugin - AccessPress Social Share
5
  Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-social-share/
6
  Description: A plugin to add various social media shares to a site with dynamic configuration options.
7
+ Version: 4.1.1
8
  Author: AccessPress Themes
9
  Author URI: http://accesspressthemes.com
10
  Text Domain: accesspress-social-share
30
  }
31
 
32
  if ( !defined( 'APSS_VERSION' ) ) {
33
+ define( 'APSS_VERSION', '4.1.1' );
34
  }
35
 
36
  if ( !defined( 'APSS_TEXT_DOMAIN' ) ) {
385
  //for facebook url share count
386
  function get_fb( $url ) {
387
  $apss_settings = $this->apss_settings;
388
+ if(!isset($apss_settings['enable_cache']) || $apss_settings['enable_cache'] == '1'){
389
+ ////////////////////////for transient//////////////////////////////
390
+ $cache_period = $apss_settings['cache_period'];
391
+ $fb_transient = 'fb_' . md5( $url );
392
+ $fb_transient_count = get_transient( $fb_transient );
393
+
394
+ //for setting the counter transient in separate options value
395
+ $apss_social_counts_transients = get_option( APSS_COUNT_TRANSIENTS );
396
+ if ( false === $fb_transient_count ) {
397
+ $json_string = $this->get_json_values( 'https://api.facebook.com/method/links.getStats?urls=' . $url . '&format=json' );
398
+ $json = json_decode( $json_string, true );
399
+ $facebook_count = isset( $json[0]['total_count'] ) ? intval( $json[0]['total_count'] ) : 0;
400
+ set_transient( $fb_transient, $facebook_count, $cache_period * HOUR_IN_SECONDS );
401
+ if ( !in_array( $fb_transient, $apss_social_counts_transients ) ) {
402
+ $apss_social_counts_transients[] = $fb_transient;
403
+ update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
404
+ }
405
+ } else {
406
+ $facebook_count = $fb_transient_count;
407
+ }
408
+ ////////////////////////for transient ends ///////////////////////////
409
+ }else{
410
  $json_string = $this->get_json_values( 'https://api.facebook.com/method/links.getStats?urls=' . $url . '&format=json' );
411
  $json = json_decode( $json_string, true );
412
  $facebook_count = isset( $json[0]['total_count'] ) ? intval( $json[0]['total_count'] ) : 0;
 
 
 
 
 
 
 
413
  }
414
  return $facebook_count;
415
  }
417
  //for twitter url share count
418
  function get_tweets( $url ) {
419
  $apss_settings = $this->apss_settings;
420
+ if(!isset($apss_settings['enable_cache']) || $apss_settings['enable_cache'] == '1'){
421
+ $cache_period = $apss_settings['cache_period'];
422
+ $twitter_transient = 'twitter_' . md5( $url );
423
+ $twitter_transient_count = get_transient( $twitter_transient );
424
+ //for setting the counter transient in separate options value
425
+ $apss_social_counts_transients = get_option( APSS_COUNT_TRANSIENTS );
426
+ if ( false === $twitter_transient_count ) {
427
+ if(isset($apss_settings['twitter_counter_api'])){
428
+ $api_selection = $apss_settings['twitter_counter_api'];
429
+ }else{
430
+ $api_selection = '1';
431
+ }
432
+
433
+ if($api_selection == '2'){
434
+ $json_string = $this->get_json_values( 'http://public.newsharecounts.com/count.json?url=' . $url );
435
 
436
+ }else if($api_selection == '3'){
437
+ $json_string = $this->get_json_values( 'http://opensharecount.com/count.json?url=' . $url );
438
+
439
+ }else{
440
+ // depriciated url share count. returns null
441
+ $json_string = $this->get_json_values( 'http://urls.api.twitter.com/1/urls/count.json?url=' . $url );
442
+ }
443
+
444
+ $json = json_decode( $json_string, true );
445
+ $tweet_count = isset( $json['count'] ) ? intval( $json['count'] ) : 0;
446
+ set_transient( $twitter_transient, $tweet_count, $cache_period * HOUR_IN_SECONDS );
447
+ if ( !in_array( $twitter_transient, $apss_social_counts_transients ) ) {
448
+ $apss_social_counts_transients[] = $twitter_transient;
449
+ update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
450
+ }
451
+ } else {
452
+ $tweet_count = $twitter_transient_count;
453
+ }
454
+ }else{
455
  if(isset($apss_settings['twitter_counter_api'])){
456
  $api_selection = $apss_settings['twitter_counter_api'];
457
  }else{
471
 
472
  $json = json_decode( $json_string, true );
473
  $tweet_count = isset( $json['count'] ) ? intval( $json['count'] ) : 0;
 
 
 
 
 
 
 
474
  }
475
  return $tweet_count;
476
  }
478
  //for google plus url share count
479
  function get_plusones( $url ) {
480
  $apss_settings = $this->apss_settings;
481
+ if(!isset($apss_settings['enable_cache']) || $apss_settings['enable_cache'] == '1'){
482
+ $cache_period = $apss_settings['cache_period'];
483
+ $googlePlus_transient = 'gp_' . md5( $url );
484
+ $googlePlus_transient_count = get_transient( $googlePlus_transient );
485
+
486
+ //for setting the counter transient in separate options value
487
+ $apss_social_counts_transients = get_option( APSS_COUNT_TRANSIENTS );
488
+ if ( false === $googlePlus_transient_count ) {
489
+ $curl = curl_init();
490
+ curl_setopt( $curl, CURLOPT_URL, "https://clients6.google.com/rpc" );
491
+ curl_setopt( $curl, CURLOPT_POST, true );
492
+ curl_setopt( $curl, CURLOPT_SSL_VERIFYPEER, false );
493
+ curl_setopt( $curl, CURLOPT_POSTFIELDS, '[{"method":"pos.plusones.get","id":"p","params":{"nolog":true,"id":"' . rawurldecode( $url ) . '","source":"widget","userId":"@viewer","groupId":"@self"},"jsonrpc":"2.0","key":"p","apiVersion":"v1"}]' );
494
+ curl_setopt( $curl, CURLOPT_RETURNTRANSFER, true );
495
+ curl_setopt( $curl, CURLOPT_HTTPHEADER, array( 'Content-type: application/json' ) );
496
+ $curl_results = curl_exec( $curl );
497
+ curl_close( $curl );
498
+ unset( $curl );
499
+ $json = json_decode( $curl_results, true );
500
+ $plusones_count = isset( $json[0]['result']['metadata']['globalCounts']['count'] ) ? intval( $json[0]['result']['metadata']['globalCounts']['count'] ) : 0;
501
+ set_transient( $googlePlus_transient, $plusones_count, $cache_period * HOUR_IN_SECONDS );
502
+ if ( !in_array( $googlePlus_transient, $apss_social_counts_transients ) ) {
503
+ $apss_social_counts_transients[] = $googlePlus_transient;
504
+ update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
505
+ }
506
+ } else {
507
+ $plusones_count = $googlePlus_transient_count;
508
+ }
509
+ }else{
510
  $curl = curl_init();
511
  curl_setopt( $curl, CURLOPT_URL, "https://clients6.google.com/rpc" );
512
  curl_setopt( $curl, CURLOPT_POST, true );
519
  unset( $curl );
520
  $json = json_decode( $curl_results, true );
521
  $plusones_count = isset( $json[0]['result']['metadata']['globalCounts']['count'] ) ? intval( $json[0]['result']['metadata']['globalCounts']['count'] ) : 0;
 
 
 
 
 
 
 
522
  }
523
  return $plusones_count;
524
  }
526
  //for pinterest url share count
527
  function get_pinterest( $url ) {
528
  $apss_settings = $this->apss_settings;
529
+ if(!isset($apss_settings['enable_cache']) || $apss_settings['enable_cache'] == '1'){
530
+ $cache_period = $apss_settings['cache_period'];
531
+ $pinterest_transient = 'pinterest_' . md5( $url );
532
+ $pinterest_transient_count = get_transient( $pinterest_transient );
533
+
534
+ //for setting the counter transient in separate options value
535
+ $apss_social_counts_transients = get_option( APSS_COUNT_TRANSIENTS );
536
+ if ( false === $pinterest_transient_count ) {
537
+ $json_string = $this->get_json_values( 'http://api.pinterest.com/v1/urls/count.json?url=' . $url );
538
+ $json_string = preg_replace( '/^receiveCount\((.*)\)$/', "\\1", $json_string );
539
+ $json = json_decode( $json_string, true );
540
+ $pinterest_count = isset( $json['count'] ) ? intval( $json['count'] ) : 0;
541
+ set_transient( $pinterest_transient, $pinterest_count, $cache_period * HOUR_IN_SECONDS );
542
+ if ( !in_array( $pinterest_transient, $apss_social_counts_transients ) ) {
543
+ $apss_social_counts_transients[] = $pinterest_transient;
544
+ update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
545
+ }
546
+ } else {
547
+ $pinterest_count = $pinterest_transient_count;
548
+ }
549
+ }else{
550
  $json_string = $this->get_json_values( 'http://api.pinterest.com/v1/urls/count.json?url=' . $url );
551
  $json_string = preg_replace( '/^receiveCount\((.*)\)$/', "\\1", $json_string );
552
  $json = json_decode( $json_string, true );
553
  $pinterest_count = isset( $json['count'] ) ? intval( $json['count'] ) : 0;
 
 
 
 
 
 
 
554
  }
555
  return $pinterest_count;
556
  }
558
  //for linkedin url share count
559
  function get_linkedin( $url ) {
560
  $apss_settings = $this->apss_settings;
561
+ if(!isset($apss_settings['enable_cache']) || $apss_settings['enable_cache'] == '1'){
562
+ $cache_period = $apss_settings['cache_period'];
563
+ $linkedin_transient = 'linkedin_' . md5( $url );
564
+ $linkedin_transient_count = get_transient( $linkedin_transient );
565
+
566
+ //for setting the counter transient in separate options value
567
+ $apss_social_counts_transients = get_option( APSS_COUNT_TRANSIENTS );
568
+ if ( false === $linkedin_transient_count ) {
569
+ $json_string = $this->get_json_values( "https://www.linkedin.com/countserv/count/share?url=$url&format=json" );
570
+ $json = json_decode( $json_string, true );
571
+ $linkedin_count = isset( $json['count'] ) ? intval( $json['count'] ) : 0;
572
+
573
+ set_transient( $linkedin_transient, $linkedin_count, $cache_period * HOUR_IN_SECONDS );
574
+ if ( !in_array( $linkedin_transient, $apss_social_counts_transients ) ) {
575
+ $apss_social_counts_transients[] = $linkedin_transient;
576
+ update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
577
+ }
578
+ } else {
579
+ $linkedin_count = $linkedin_transient_count;
580
+ }
581
+ }else{
582
  $json_string = $this->get_json_values( "https://www.linkedin.com/countserv/count/share?url=$url&format=json" );
583
  $json = json_decode( $json_string, true );
584
  $linkedin_count = isset( $json['count'] ) ? intval( $json['count'] ) : 0;
 
 
 
 
 
 
 
 
585
  }
586
  return $linkedin_count;
587
  }
css/frontend.css CHANGED
@@ -15,7 +15,7 @@
15
 
16
  /**{ box-sizing:border-box; -webkit-box-sizing:border-box; -moz-box-sizing:border-box;}*/
17
 
18
- a:hover, a:focus {
19
  color: #636363;
20
  }
21
 
15
 
16
  /**{ box-sizing:border-box; -webkit-box-sizing:border-box; -moz-box-sizing:border-box;}*/
17
 
18
+ .apss-social-share a:hover, .apss-social-share a:focus {
19
  color: #636363;
20
  }
21
 
inc/backend/activation.php CHANGED
@@ -25,6 +25,7 @@ $apss_share_settings['twitter_username'] = '';
25
  $apss_share_settings['counter_enable_options'] = '0';
26
  $apss_share_settings['twitter_counter_api'] = '1';
27
  $apss_share_settings['total_counter_enable_options'] = '0';
 
28
  $apss_share_settings['cache_period'] = '24';
29
  $apss_share_settings['apss_social_counts_transients'] = array();
30
  $apss_share_settings['dialog_box_options'] = '1';
25
  $apss_share_settings['counter_enable_options'] = '0';
26
  $apss_share_settings['twitter_counter_api'] = '1';
27
  $apss_share_settings['total_counter_enable_options'] = '0';
28
+ $apss_share_settings['enable_cache'] = '1';
29
  $apss_share_settings['cache_period'] = '24';
30
  $apss_share_settings['apss_social_counts_transients'] = array();
31
  $apss_share_settings['dialog_box_options'] = '1';
inc/backend/main-page.php CHANGED
@@ -219,12 +219,29 @@
219
  <div class="misc-opt"><input type="radio" id='dialog_box_options_2' name="apss_share_settings[dialog_box_options]" value="1" <?php if ( $options['dialog_box_options'] == '1' ) {
220
  echo "checked='checked'";
221
  } ?> /><label for="dialog_box_options_2"><?php _e( 'Open in new window/Tab', 'accesspress-social-share' ); ?></label></div>
 
 
 
 
222
  </div>
223
 
 
 
 
 
 
 
 
 
 
 
 
 
 
224
  <div class='cache-settings'>
225
  <h4><?php _e( 'Cache Settings: ', 'accesspress-social-share' ); ?> </h4>
226
  <label for="apss_cache_settings"><?php _e( 'Cache Period:', 'accesspress-social-share' ); ?></label>
227
- <input type='number' id="apss_cache_period" name='apss_share_settings[cache_settings]' value="<?php if ( isset( $options['cache_period'] ) ) {
228
  echo $options['cache_period'];
229
  } ?>" onkeyup="removeMe('invalid_cache_period');"/>
230
  <span class="error invalid_cache_period"></span>
219
  <div class="misc-opt"><input type="radio" id='dialog_box_options_2' name="apss_share_settings[dialog_box_options]" value="1" <?php if ( $options['dialog_box_options'] == '1' ) {
220
  echo "checked='checked'";
221
  } ?> /><label for="dialog_box_options_2"><?php _e( 'Open in new window/Tab', 'accesspress-social-share' ); ?></label></div>
222
+
223
+ <div class="misc-opt"><input type="radio" id='dialog_box_options_3' name="apss_share_settings[dialog_box_options]" value="2" <?php if ( $options['dialog_box_options'] == '2' ) {
224
+ echo "checked='checked'";
225
+ } ?> /><label for="dialog_box_options_3"><?php _e( 'Open in popup window', 'accesspress-social-share' ); ?></label></div>
226
  </div>
227
 
228
+
229
+ <div class='apss_cache_enable_opt'>
230
+ <h4><?php _e( 'Enable cache? ', 'accesspress-social-share' ); ?> </h4>
231
+ <div class='misc-opt'>
232
+ <input type="radio" id='enable_cache_yes' name="apss_share_settings[enable_cache]" value="1" <?php if ( isset($options['enable_cache']) && $options['enable_cache'] == '1' ) { echo "checked='checked'"; } ?> />
233
+ <label for='enable_cache_yes'><?php _e('Yes', 'accesspress-social-share'); ?></label>
234
+ </div>
235
+ <div class='misc-opt'>
236
+ <input type="radio" id='enable_cache_no' name="apss_share_settings[enable_cache]" value="0" <?php if ( isset($options['enable_cache']) && $options['enable_cache'] == '0' ) { echo "checked='checked'"; } ?> />
237
+ <label for='enable_cache_no'><?php _e('No', 'accesspress-social-share'); ?></label>
238
+ </div>
239
+ </div>
240
+ <br />
241
  <div class='cache-settings'>
242
  <h4><?php _e( 'Cache Settings: ', 'accesspress-social-share' ); ?> </h4>
243
  <label for="apss_cache_settings"><?php _e( 'Cache Period:', 'accesspress-social-share' ); ?></label>
244
+ <input type='text' id="apss_cache_period" name='apss_share_settings[cache_settings]' value="<?php if ( isset( $options['cache_period'] ) ) {
245
  echo $options['cache_period'];
246
  } ?>" onkeyup="removeMe('invalid_cache_period');"/>
247
  <span class="error invalid_cache_period"></span>
inc/backend/save-settings.php CHANGED
@@ -25,6 +25,7 @@ $apss_share_settings['twitter_username'] = stripslashes_deep( $_POST['apss_sh
25
  $apss_share_settings['counter_enable_options'] = $_POST['apss_share_settings']['counter_enable_options'];
26
  $apss_share_settings['twitter_counter_api'] = $_POST['apss_share_settings']['twitter_counter_api'];
27
  $apss_share_settings['total_counter_enable_options'] = $_POST['apss_share_settings']['total_counter_enable_options'];
 
28
  $apss_share_settings['cache_period'] = is_numeric( $_POST['apss_share_settings']['cache_settings'] ) ? $_POST['apss_share_settings']['cache_settings'] : '24';
29
  $apss_share_settings['dialog_box_options'] = $_POST['apss_share_settings']['dialog_box_options'];
30
  // $apss_share_settings['footer_javascript'] = $_POST['apss_share_settings']['footer_javascript'];
25
  $apss_share_settings['counter_enable_options'] = $_POST['apss_share_settings']['counter_enable_options'];
26
  $apss_share_settings['twitter_counter_api'] = $_POST['apss_share_settings']['twitter_counter_api'];
27
  $apss_share_settings['total_counter_enable_options'] = $_POST['apss_share_settings']['total_counter_enable_options'];
28
+ $apss_share_settings['enable_cache'] = $_POST['apss_share_settings']['enable_cache'];
29
  $apss_share_settings['cache_period'] = is_numeric( $_POST['apss_share_settings']['cache_settings'] ) ? $_POST['apss_share_settings']['cache_settings'] : '24';
30
  $apss_share_settings['dialog_box_options'] = $_POST['apss_share_settings']['dialog_box_options'];
31
  // $apss_share_settings['footer_javascript'] = $_POST['apss_share_settings']['footer_javascript'];
inc/frontend/content-filter.php CHANGED
@@ -1,6 +1,7 @@
1
  <?php defined( 'ABSPATH' ) or die( "No script kiddies please!" ); ?>
2
  <?php
3
  $apss_link_open_option = ($options['dialog_box_options'] == '1') ? "_blank" : "";
 
4
  $twitter_user = $options['twitter_username'];
5
  $counter_enable_options = $options['counter_enable_options'];
6
  if(isset($options['twitter_counter_api'])){
@@ -36,9 +37,10 @@ foreach ( $options['social_networks'] as $key => $value ) {
36
  case 'facebook':
37
  $link = 'https://www.facebook.com/sharer/sharer.php?u=' . $url;
38
  $count = $this->get_count( $key, $url );
 
39
  ?>
40
  <div class='apss-facebook apss-single-icon'>
41
- <a rel='nofollow' title="<?php _e( 'Share on Facebook', 'accesspress-social-share' ); ?>" target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
42
  <div class='apss-icon-block clearfix'>
43
  <i class='fa fa-facebook'></i>
44
  <span class='apss-social-text'><?php _e( 'Share on Facebook', 'accesspress-social-share' ); ?></span>
@@ -63,7 +65,7 @@ foreach ( $options['social_networks'] as $key => $value ) {
63
  $count = $this->get_count( $key, $url );
64
  ?>
65
  <div class='apss-twitter apss-single-icon'>
66
- <a rel='nofollow' title="<?php _e( 'Share on Twitter', 'accesspress-social-share' ); ?>" target='<?php echo $apss_link_open_option; ?>' href="<?php echo $link; ?>">
67
  <div class='apss-icon-block clearfix'>
68
  <i class='fa fa-twitter'></i>
69
  <span class='apss-social-text'><?php _e( 'Share on Twitter', 'accesspress-social-share' ); ?></span><span class='apss-share'><?php _e( 'Tweet', 'accesspress-social-share' ); ?></span>
@@ -82,7 +84,7 @@ foreach ( $options['social_networks'] as $key => $value ) {
82
  $count = $this->get_count( $key, $url );
83
  ?>
84
  <div class='apss-google-plus apss-single-icon'>
85
- <a rel='nofollow' title="<?php _e( 'Share on Google Plus', 'accesspress-social-share' ); ?>" target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
86
  <div class='apss-icon-block clearfix'>
87
  <i class='fa fa-google-plus'></i>
88
  <span class='apss-social-text'><?php _e( 'Share on Google Plus', 'accesspress-social-share' ); ?></span>
@@ -119,12 +121,13 @@ foreach ( $options['social_networks'] as $key => $value ) {
119
 
120
  //couter available for linkedin
121
  case 'linkedin':
 
122
  $link = "http://www.linkedin.com/shareArticle?mini=true&amp;title=" . $title . "&amp;url=" . $url . "&amp;summary=" . $excerpt;
123
  $count = $this->get_count( $key, $url );
124
  ?>
125
 
126
  <div class='apss-linkedin apss-single-icon'>
127
- <a rel='nofollow' title="<?php _e( 'Share on LinkedIn', 'accesspress-social-share' ); ?>" target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
128
  <div class='apss-icon-block clearfix'><i class='fa fa-linkedin'></i>
129
  <span class='apss-social-text'><?php _e( 'Share on LinkedIn', 'accesspress-social-share' ); ?></span>
130
  <span class='apss-share'><?php _e( 'Share', 'accesspress-social-share' ); ?></span>
@@ -142,7 +145,7 @@ foreach ( $options['social_networks'] as $key => $value ) {
142
  $link = "http://digg.com/submit?phase=2%20&amp;url=" . $url . "&amp;title=" . $title;
143
  ?>
144
  <div class='apss-digg apss-single-icon'>
145
- <a rel='nofollow' title="<?php _e( 'Share on Digg', 'accesspress-social-share' ); ?>" target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
146
  <div class='apss-icon-block clearfix'>
147
  <i class='fa fa-digg'></i>
148
  <span class='apss-social-text'><?php _e( 'Share on Digg', 'accesspress-social-share' ); ?></span>
1
  <?php defined( 'ABSPATH' ) or die( "No script kiddies please!" ); ?>
2
  <?php
3
  $apss_link_open_option = ($options['dialog_box_options'] == '1') ? "_blank" : "";
4
+ $apss_link_open_option_value = intval($options['dialog_box_options']);
5
  $twitter_user = $options['twitter_username'];
6
  $counter_enable_options = $options['counter_enable_options'];
7
  if(isset($options['twitter_counter_api'])){
37
  case 'facebook':
38
  $link = 'https://www.facebook.com/sharer/sharer.php?u=' . $url;
39
  $count = $this->get_count( $key, $url );
40
+
41
  ?>
42
  <div class='apss-facebook apss-single-icon'>
43
+ <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window('<?php echo $link; ?>');" <?php } ?> title="<?php _e( 'Share on Facebook', 'accesspress-social-share' ); ?>" target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
44
  <div class='apss-icon-block clearfix'>
45
  <i class='fa fa-facebook'></i>
46
  <span class='apss-social-text'><?php _e( 'Share on Facebook', 'accesspress-social-share' ); ?></span>
65
  $count = $this->get_count( $key, $url );
66
  ?>
67
  <div class='apss-twitter apss-single-icon'>
68
+ <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window('<?php echo $link; ?>');" <?php } ?> title="<?php _e( 'Share on Twitter', 'accesspress-social-share' ); ?>" target='<?php echo $apss_link_open_option; ?>' href="<?php echo $link; ?>">
69
  <div class='apss-icon-block clearfix'>
70
  <i class='fa fa-twitter'></i>
71
  <span class='apss-social-text'><?php _e( 'Share on Twitter', 'accesspress-social-share' ); ?></span><span class='apss-share'><?php _e( 'Tweet', 'accesspress-social-share' ); ?></span>
84
  $count = $this->get_count( $key, $url );
85
  ?>
86
  <div class='apss-google-plus apss-single-icon'>
87
+ <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window('<?php echo $link; ?>');" <?php } ?> title="<?php _e( 'Share on Google Plus', 'accesspress-social-share' ); ?>" target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
88
  <div class='apss-icon-block clearfix'>
89
  <i class='fa fa-google-plus'></i>
90
  <span class='apss-social-text'><?php _e( 'Share on Google Plus', 'accesspress-social-share' ); ?></span>
121
 
122
  //couter available for linkedin
123
  case 'linkedin':
124
+ $excerpt = strip_tags(get_the_excerpt());
125
  $link = "http://www.linkedin.com/shareArticle?mini=true&amp;title=" . $title . "&amp;url=" . $url . "&amp;summary=" . $excerpt;
126
  $count = $this->get_count( $key, $url );
127
  ?>
128
 
129
  <div class='apss-linkedin apss-single-icon'>
130
+ <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window('<?php echo $link; ?>');" <?php } ?> title="<?php _e( 'Share on LinkedIn', 'accesspress-social-share' ); ?>" target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
131
  <div class='apss-icon-block clearfix'><i class='fa fa-linkedin'></i>
132
  <span class='apss-social-text'><?php _e( 'Share on LinkedIn', 'accesspress-social-share' ); ?></span>
133
  <span class='apss-share'><?php _e( 'Share', 'accesspress-social-share' ); ?></span>
145
  $link = "http://digg.com/submit?phase=2%20&amp;url=" . $url . "&amp;title=" . $title;
146
  ?>
147
  <div class='apss-digg apss-single-icon'>
148
+ <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window('<?php echo $link; ?>');" <?php } ?> title="<?php _e( 'Share on Digg', 'accesspress-social-share' ); ?>" target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
149
  <div class='apss-icon-block clearfix'>
150
  <i class='fa fa-digg'></i>
151
  <span class='apss-social-text'><?php _e( 'Share on Digg', 'accesspress-social-share' ); ?></span>
inc/frontend/shortcode.php CHANGED
@@ -3,6 +3,7 @@
3
  global $post;
4
  $options = get_option( APSS_SETTING_NAME );
5
  $apss_link_open_option = ($options['dialog_box_options'] == '1') ? "_blank" : "";
 
6
  $twitter_user = $options['twitter_username'];
7
  $icon_set_value = $options['social_icon_set'];
8
  if(isset($options['twitter_counter_api'])){
@@ -71,7 +72,7 @@ if ( strlen( $content ) >= 100 ) {
71
  $count = $this->get_count( $key, $url );
72
  ?>
73
  <div class='apss-facebook apss-single-icon'>
74
- <a rel='nofollow' title='<?php _e( 'Share on Facebook', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
75
  <div class='apss-icon-block clearfix'>
76
  <i class='fa fa-facebook'></i>
77
  <span class='apss-social-text'><?php _e( 'Share on Facebook', 'accesspress-social-share' ); ?></span>
@@ -96,7 +97,7 @@ if ( strlen( $content ) >= 100 ) {
96
  $count = $this->get_count( $key, $url );
97
  ?>
98
  <div class='apss-twitter apss-single-icon'>
99
- <a rel='nofollow' title='<?php _e( 'Share on Twitter', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href="<?php echo $link; ?>">
100
  <div class='apss-icon-block clearfix'>
101
  <i class='fa fa-twitter'></i>
102
  <span class='apss-social-text'><?php _e( 'Share on Twitter', 'accesspress-social-share' ); ?></span><span class='apss-share'><?php _e( 'Tweet', 'accesspress-social-share' ); ?></span>
@@ -115,7 +116,7 @@ if ( strlen( $content ) >= 100 ) {
115
  $count = $this->get_count( $key, $url );
116
  ?>
117
  <div class='apss-google-plus apss-single-icon'>
118
- <a rel='nofollow' title='<?php _e( 'Share on Google Plus', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
119
  <div class='apss-icon-block clearfix'>
120
  <i class='fa fa-google-plus'></i>
121
  <span class='apss-social-text'><?php _e( 'Share on Google Plus', 'accesspress-social-share' ); ?> </span>
@@ -154,7 +155,7 @@ if ( strlen( $content ) >= 100 ) {
154
  $count = $this->get_count( $key, $url );
155
  ?>
156
  <div class='apss-linkedin apss-single-icon'>
157
- <a rel='nofollow' title='<?php _e( 'Share on LinkedIn', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
158
  <div class='apss-icon-block clearfix'><i class='fa fa-linkedin'></i>
159
  <span class='apss-social-text'><?php _e( 'Share on LinkedIn', 'accesspress-social-share' ); ?></span>
160
  <span class='apss-share'><?php _e( 'Share', 'accesspress-social-share' ); ?></span>
@@ -174,7 +175,7 @@ if ( strlen( $content ) >= 100 ) {
174
  $link = "http://digg.com/submit?phase=2%20&amp;url=" . $url . "&amp;title=" . $title;
175
  ?>
176
  <div class='apss-digg apss-single-icon'>
177
- <a rel='nofollow' title='<?php _e( 'Share on Digg', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
178
  <div class='apss-icon-block clearfix'>
179
  <i class='fa fa-digg'></i>
180
  <span class='apss-social-text'><?php _e( 'Share on Digg', 'accesspress-social-share' ); ?></span>
3
  global $post;
4
  $options = get_option( APSS_SETTING_NAME );
5
  $apss_link_open_option = ($options['dialog_box_options'] == '1') ? "_blank" : "";
6
+ $apss_link_open_option_value = intval($options['dialog_box_options']);
7
  $twitter_user = $options['twitter_username'];
8
  $icon_set_value = $options['social_icon_set'];
9
  if(isset($options['twitter_counter_api'])){
72
  $count = $this->get_count( $key, $url );
73
  ?>
74
  <div class='apss-facebook apss-single-icon'>
75
+ <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window('<?php echo $link; ?>');" <?php } ?> title='<?php _e( 'Share on Facebook', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
76
  <div class='apss-icon-block clearfix'>
77
  <i class='fa fa-facebook'></i>
78
  <span class='apss-social-text'><?php _e( 'Share on Facebook', 'accesspress-social-share' ); ?></span>
97
  $count = $this->get_count( $key, $url );
98
  ?>
99
  <div class='apss-twitter apss-single-icon'>
100
+ <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window('<?php echo $link; ?>');" <?php } ?> title='<?php _e( 'Share on Twitter', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href="<?php echo $link; ?>">
101
  <div class='apss-icon-block clearfix'>
102
  <i class='fa fa-twitter'></i>
103
  <span class='apss-social-text'><?php _e( 'Share on Twitter', 'accesspress-social-share' ); ?></span><span class='apss-share'><?php _e( 'Tweet', 'accesspress-social-share' ); ?></span>
116
  $count = $this->get_count( $key, $url );
117
  ?>
118
  <div class='apss-google-plus apss-single-icon'>
119
+ <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window('<?php echo $link; ?>');" <?php } ?> title='<?php _e( 'Share on Google Plus', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
120
  <div class='apss-icon-block clearfix'>
121
  <i class='fa fa-google-plus'></i>
122
  <span class='apss-social-text'><?php _e( 'Share on Google Plus', 'accesspress-social-share' ); ?> </span>
155
  $count = $this->get_count( $key, $url );
156
  ?>
157
  <div class='apss-linkedin apss-single-icon'>
158
+ <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window('<?php echo $link; ?>');" <?php } ?> title='<?php _e( 'Share on LinkedIn', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
159
  <div class='apss-icon-block clearfix'><i class='fa fa-linkedin'></i>
160
  <span class='apss-social-text'><?php _e( 'Share on LinkedIn', 'accesspress-social-share' ); ?></span>
161
  <span class='apss-share'><?php _e( 'Share', 'accesspress-social-share' ); ?></span>
175
  $link = "http://digg.com/submit?phase=2%20&amp;url=" . $url . "&amp;title=" . $title;
176
  ?>
177
  <div class='apss-digg apss-single-icon'>
178
+ <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window('<?php echo $link; ?>');" <?php } ?> title='<?php _e( 'Share on Digg', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
179
  <div class='apss-icon-block clearfix'>
180
  <i class='fa fa-digg'></i>
181
  <span class='apss-social-text'><?php _e( 'Share on Digg', 'accesspress-social-share' ); ?></span>
js/frontend.js CHANGED
@@ -8,8 +8,12 @@ function pinIt()
8
  document.body.appendChild(e);
9
  }
10
 
11
- jQuery(document).ready(function ($) {
 
 
 
12
 
 
13
  var shortcode_profile_array = [];
14
  $('.apss-count').each(function () {
15
  var social_detail = $(this).attr('data-social-detail');
@@ -17,24 +21,4 @@ jQuery(document).ready(function ($) {
17
  shortcode_profile_array.push(social_detail);
18
  }
19
  });
20
-
21
- // ajax call for social counter
22
- if (shortcode_profile_array.length > 0)
23
- {
24
- // $.ajax({
25
- // type: 'post',
26
- // url: frontend_ajax_object.ajax_url + '/?action=frontend_counter&_wpnonce=' + frontend_ajax_object.ajax_nonce,
27
- // data: {shortcode_data: shortcode_profile_array},
28
- // success: function (res) {
29
- // res = $.parseJSON(res);
30
- // for (var i=0;i<=shortcode_profile_array.length;i++) {
31
- // var social_detail = shortcode_profile_array[i];
32
- // var count = (res[i])?res[i]:0;
33
- // $('.apss-count[data-social-detail="' + social_detail + '"]').html(count);
34
- // }
35
- // }
36
- // });
37
- }
38
-
39
-
40
  });
8
  document.body.appendChild(e);
9
  }
10
 
11
+ function apss_open_in_popup_window(url){
12
+ event.preventDefault();
13
+ window.open(url, 'fdadas', 'toolbars=0,width=640,height=320,left=200,top=200,scrollbars=1,resizable=1');
14
+ }
15
 
16
+ jQuery(document).ready(function ($) {
17
  var shortcode_profile_array = [];
18
  $('.apss-count').each(function () {
19
  var social_detail = $(this).attr('data-social-detail');
21
  shortcode_profile_array.push(social_detail);
22
  }
23
  });
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
24
  });
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
- === AccessPress Social Share ===
2
  Contributors: Access Keys
3
  Tags: social share counter, social share, social media share, social network share, social media, social network, share counter, social share count, social url share, social icons
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
  Tested up to: 4.5
7
- Stable tag: 4.1.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -131,6 +131,10 @@ Yes. You can use the AccessPress social share by using shortcode anywhere you wa
131
  6. Backend Miscellaneous Settings Section
132
 
133
  == Changelog ==
 
 
 
 
134
  = 4.1.0 =
135
  * Done the addition of additional parameter custom_share_link in the shortcode for apss_share.
136
  * Added the note section for the available parameters in email settings.
1
+ === Social Share WordPress Plugin - AccessPress Social Share ===
2
  Contributors: Access Keys
3
  Tags: social share counter, social share, social media share, social network share, social media, social network, share counter, social share count, social url share, social icons
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
  Tested up to: 4.5
7
+ Stable tag: 4.1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
131
  6. Backend Miscellaneous Settings Section
132
 
133
  == Changelog ==
134
+ = 4.1.1 =
135
+ * Added options to disable the cache for the url share counts.
136
+ * Added an option to enable the social share in popup window.
137
+
138
  = 4.1.0 =
139
  * Done the addition of additional parameter custom_share_link in the shortcode for apss_share.
140
  * Added the note section for the available parameters in email settings.