Social Share WordPress Plugin – AccessPress Social Share - Version 4.4.2

Version Description

*Updated the Facebook Api.

Download this release

Release Info

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

Code changes from version 4.4.1 to 4.4.2

accesspress-social-share.php CHANGED
@@ -1,10 +1,10 @@
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.4.1
8
  Author: AccessPress Themes
9
  Author URI: http://accesspressthemes.com
10
  Text Domain: accesspress-social-share
@@ -123,7 +123,6 @@ if ( ! class_exists( 'APSS_Class' ) ) {
123
  if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'accesspress-social-share' ) {
124
  wp_enqueue_style( 'aps-admin-css', APSS_CSS_DIR . '/backend.css', false, APSS_VERSION ); //registering plugin admin css
125
  wp_enqueue_style( 'fontawesome-css', APSS_CSS_DIR . '/font-awesome/font-awesome.min.css', false, APSS_VERSION );
126
-
127
  /**
128
  * Backend JS
129
  * */
@@ -421,6 +420,10 @@ if ( ! class_exists( 'APSS_Class' ) ) {
421
  } else {
422
  $json_string = $this -> get_json_values( 'https://graph.facebook.com/?id=' . $url );
423
  $json = json_decode( $json_string, true );
 
 
 
 
424
  $facebook_count = isset( $json[ 'share' ][ 'share_count' ] ) ? intval( $json[ 'share' ][ 'share_count' ] ) : 0;
425
  }
426
  return $facebook_count;
@@ -431,20 +434,29 @@ if ( ! class_exists( 'APSS_Class' ) ) {
431
  * */
432
  function get_fb_access_token(){
433
  $apss_settings = $this -> apss_settings;
 
 
 
 
 
434
  $app_id = $apss_settings[ 'api_configuration' ][ 'facebook' ][ 'app_id' ];
435
  $app_secret = $apss_settings[ 'api_configuration' ][ 'facebook' ][ 'app_secret' ];
436
  $api_url = 'https://graph.facebook.com/';
437
- $app_id = $apss_settings[ 'api_configuration' ][ 'facebook' ][ 'app_id' ];
438
- $app_secret = $apss_settings[ 'api_configuration' ][ 'facebook' ][ 'app_secret' ];
439
  $url = sprintf(
440
  '%soauth/access_token?client_id=%s&client_secret=%s&grant_type=client_credentials', $api_url, $app_id, $app_secret
441
  );
442
 
443
  $access_token = wp_remote_get( $url, array( 'timeout' => 60 ) );
 
 
 
 
444
  if ( is_wp_error( $access_token ) || ( isset( $access_token[ 'response' ][ 'code' ] ) && 200 != $access_token[ 'response' ][ 'code' ] ) ) {
 
445
  return '';
446
  } else {
447
  $json_decode = json_decode( $access_token[ 'body' ] );
 
448
  return sanitize_text_field( $json_decode -> access_token );
449
  }
450
  }
@@ -465,10 +477,13 @@ if ( ! class_exists( 'APSS_Class' ) ) {
465
  return $facebook_count;
466
  } else {
467
  $access_token = self:: get_fb_access_token();
 
468
  $api_url = 'https://graph.facebook.com/';
469
  $facebook_count = sprintf(
470
  '%s?access_token=%s&id=%s', $api_url, $access_token, $url
471
  );
 
 
472
  $apss_settings = $this -> apss_settings;
473
  if ( isset( $apss_settings[ 'enable_cache' ] ) && $apss_settings[ 'enable_cache' ] == '1' ) {
474
  ////////////////////////for transient//////////////////////////////
@@ -494,7 +509,10 @@ if ( ! class_exists( 'APSS_Class' ) ) {
494
  } else {
495
  $json_string = $this -> get_json_values( $facebook_count );
496
  $json = json_decode( $json_string, true );
497
- $facebook_count = isset( $json[ 'share' ][ 'share_count' ] ) ? intval( $json[ 'share' ][ 'share_count' ] ) : 0;
 
 
 
498
  }
499
  return $facebook_count;
500
  die();
1
  <?php
2
  defined( 'ABSPATH' ) or die( "No script kiddies please!" );
3
  /*
4
+ Plugin name: Social Share WordPress Plugin - AccessPress Social Share (Tester)
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.4.2
8
  Author: AccessPress Themes
9
  Author URI: http://accesspressthemes.com
10
  Text Domain: accesspress-social-share
123
  if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'accesspress-social-share' ) {
124
  wp_enqueue_style( 'aps-admin-css', APSS_CSS_DIR . '/backend.css', false, APSS_VERSION ); //registering plugin admin css
125
  wp_enqueue_style( 'fontawesome-css', APSS_CSS_DIR . '/font-awesome/font-awesome.min.css', false, APSS_VERSION );
 
126
  /**
127
  * Backend JS
128
  * */
420
  } else {
421
  $json_string = $this -> get_json_values( 'https://graph.facebook.com/?id=' . $url );
422
  $json = json_decode( $json_string, true );
423
+
424
+ // echo"<pre>";
425
+ // print_r($json);
426
+ // echo"</pre>";
427
  $facebook_count = isset( $json[ 'share' ][ 'share_count' ] ) ? intval( $json[ 'share' ][ 'share_count' ] ) : 0;
428
  }
429
  return $facebook_count;
434
  * */
435
  function get_fb_access_token(){
436
  $apss_settings = $this -> apss_settings;
437
+
438
+ // echo"<pre>";
439
+ // print_r($apss_settings);
440
+ // echo"</pre>";
441
+
442
  $app_id = $apss_settings[ 'api_configuration' ][ 'facebook' ][ 'app_id' ];
443
  $app_secret = $apss_settings[ 'api_configuration' ][ 'facebook' ][ 'app_secret' ];
444
  $api_url = 'https://graph.facebook.com/';
 
 
445
  $url = sprintf(
446
  '%soauth/access_token?client_id=%s&client_secret=%s&grant_type=client_credentials', $api_url, $app_id, $app_secret
447
  );
448
 
449
  $access_token = wp_remote_get( $url, array( 'timeout' => 60 ) );
450
+ // echo "Access Token:"
451
+ // echo"<pre>";
452
+ // print_r($access_token);
453
+ // echo"</pre>";
454
  if ( is_wp_error( $access_token ) || ( isset( $access_token[ 'response' ][ 'code' ] ) && 200 != $access_token[ 'response' ][ 'code' ] ) ) {
455
+ //echo 1;
456
  return '';
457
  } else {
458
  $json_decode = json_decode( $access_token[ 'body' ] );
459
+ //echo 2;
460
  return sanitize_text_field( $json_decode -> access_token );
461
  }
462
  }
477
  return $facebook_count;
478
  } else {
479
  $access_token = self:: get_fb_access_token();
480
+
481
  $api_url = 'https://graph.facebook.com/';
482
  $facebook_count = sprintf(
483
  '%s?access_token=%s&id=%s', $api_url, $access_token, $url
484
  );
485
+ //$facebook_count = 'https://graph.facebook.com/?fields=og_object%7Blikes.summary(true).limit(0)%7D,share&id=' . $url;
486
+
487
  $apss_settings = $this -> apss_settings;
488
  if ( isset( $apss_settings[ 'enable_cache' ] ) && $apss_settings[ 'enable_cache' ] == '1' ) {
489
  ////////////////////////for transient//////////////////////////////
509
  } else {
510
  $json_string = $this -> get_json_values( $facebook_count );
511
  $json = json_decode( $json_string, true );
512
+ // echo"<pre>";
513
+ // print_r($json);
514
+ // echo"</pre>";
515
+ $facebook_count = isset( $json[ 'share' ][ 'share_count' ] ) ? intval( $json[ 'share' ][ 'share_count' ] ) : 0 ;
516
  }
517
  return $facebook_count;
518
  die();
inc/backend/main-page.php CHANGED
@@ -93,7 +93,12 @@
93
  'print' => '<span class="media-icon"><i class="fa fa-print"></i> </span>Print',
94
  );
95
  ?>
96
- <?php foreach ( $options[ 'social_networks' ] as $key => $val ) {
 
 
 
 
 
97
  ?>
98
  <div class="apss-option-wrapper">
99
  <div class="apss-option-field">
@@ -150,7 +155,6 @@
150
  echo "checked='checked'";
151
  }
152
  ?> ><label for="apss_all"><?php _e( 'Other (search results, etc)', 'accesspress-social-share' ); ?></label></p>
153
-
154
  </div>
155
 
156
  <div class="apss-tab-contents apss-display-settings" id="tab-apss-display-settings" style='display:none'>
93
  'print' => '<span class="media-icon"><i class="fa fa-print"></i> </span>Print',
94
  );
95
  ?>
96
+ <?php
97
+ // echo"<pre>";
98
+ // print_r($options);
99
+ // echo "</pre>";
100
+
101
+ foreach ( $options[ 'social_networks' ] as $key => $val ) {
102
  ?>
103
  <div class="apss-option-wrapper">
104
  <div class="apss-option-field">
155
  echo "checked='checked'";
156
  }
157
  ?> ><label for="apss_all"><?php _e( 'Other (search results, etc)', 'accesspress-social-share' ); ?></label></p>
 
158
  </div>
159
 
160
  <div class="apss-tab-contents apss-display-settings" id="tab-apss-display-settings" style='display:none'>
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: social share counter, social share, social media share, social network sha
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
  Tested up to: 5.0
7
- Stable tag: 4.4.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -157,8 +157,12 @@ Yes. You can use the AccessPress social share by using shortcode anywhere you wa
157
 
158
  == Changelog ==
159
 
 
 
 
 
160
  = 4.4.1 =
161
- *Refinement in the JS script
162
 
163
  = 4.4.0 =
164
  * updated informational details in the plugin.
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
  Tested up to: 5.0
7
+ Stable tag: 4.4.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
157
 
158
  == Changelog ==
159
 
160
+
161
+ = 4.4.2 =
162
+ *Updated the Facebook Api.
163
+
164
  = 4.4.1 =
165
+ *Refinement in the JS script.
166
 
167
  = 4.4.0 =
168
  * updated informational details in the plugin.