Social Share WordPress Plugin – AccessPress Social Share - Version 2.0.5

Version Description

  • Removal of unnecessary code(condition checking) in saving settings.
  • Functions - frontend_counter, get_plusones code modification for security enhancement.
Download this release

Release Info

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

Code changes from version 2.0.4 to 2.0.5

accesspress-social-share.php CHANGED
@@ -4,7 +4,7 @@ defined( 'ABSPATH' ) or die( "No script kiddies please!" );
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: 2.0.4
8
  Author: AccessPress Themes
9
  Author URI: http://accesspressthemes.com
10
  Text Domain:apss-share
@@ -30,7 +30,7 @@ if( !defined( 'APSS_LANG_DIR' ) ) {
30
  }
31
 
32
  if( !defined( 'APSS_VERSION' ) ) {
33
- define( 'APSS_VERSION', '2.0.4' );
34
  }
35
 
36
  if(!defined('APSS_TEXT_DOMAIN')){
@@ -257,14 +257,15 @@ if( !class_exists( 'APSS_Class' ) ){
257
  foreach ($details as $detail) {
258
  $new_detail_array[$detail['network']] = $this->get_count($detail['network'], $detail['url']);
259
  }
260
- } else {
261
- $shortcode_data = $_POST['shortcode_data'];
262
- foreach ($shortcode_data as $detail) {
263
- $detail_array = explode('_', $detail);
264
- $url = trim($detail_array[0]);
265
- $network = $detail_array[1];
266
- $new_detail_array[] = $this->get_count($network, $url);
267
- }
 
268
  }
269
  die( json_encode( $new_detail_array ) );
270
  }
@@ -368,6 +369,7 @@ if( !class_exists( 'APSS_Class' ) ){
368
  curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
369
  $curl_results = curl_exec($curl);
370
  curl_close($curl);
 
371
  $json = json_decode($curl_results, true);
372
  $plusones_count = isset($json[0]['result']['metadata']['globalCounts']['count']) ? intval($json[0]['result']['metadata']['globalCounts']['count']) : 0;
373
  set_transient($googlePlus_transient, $plusones_count, $cache_period * HOUR_IN_SECONDS);
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: 2.0.5
8
  Author: AccessPress Themes
9
  Author URI: http://accesspressthemes.com
10
  Text Domain:apss-share
30
  }
31
 
32
  if( !defined( 'APSS_VERSION' ) ) {
33
+ define( 'APSS_VERSION', '2.0.5' );
34
  }
35
 
36
  if(!defined('APSS_TEXT_DOMAIN')){
257
  foreach ($details as $detail) {
258
  $new_detail_array[$detail['network']] = $this->get_count($detail['network'], $detail['url']);
259
  }
260
+ } else if(isset($_POST['shortcode_data'])){
261
+ $shortcode_data = $_POST['shortcode_data'];
262
+ foreach ($shortcode_data as $detail) {
263
+ $detail_array = explode('_', $detail);
264
+ $url = trim($detail_array[0]);
265
+ $network = $detail_array[1];
266
+ $new_detail_array[] = $this->get_count($network, $url);
267
+ }
268
+
269
  }
270
  die( json_encode( $new_detail_array ) );
271
  }
369
  curl_setopt($curl, CURLOPT_HTTPHEADER, array('Content-type: application/json'));
370
  $curl_results = curl_exec($curl);
371
  curl_close($curl);
372
+ unset($curl);
373
  $json = json_decode($curl_results, true);
374
  $plusones_count = isset($json[0]['result']['metadata']['globalCounts']['count']) ? intval($json[0]['result']['metadata']['globalCounts']['count']) : 0;
375
  set_transient($googlePlus_transient, $plusones_count, $cache_period * HOUR_IN_SECONDS);
inc/backend/save-settings.php CHANGED
@@ -1,10 +1,8 @@
1
  <?php defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); ?>
2
  <?php
3
  $apss_share_settings=array();
4
- if( $_POST['action']=='apss_save_options' ){
5
- $share_options = array();
6
  if(isset($_POST['apss_share_settings']['share_options'])){
7
-
8
  foreach ( $_POST['apss_share_settings']['share_options'] as $key=>$value ){
9
  $share_options[]=$value;
10
  }
@@ -40,5 +38,3 @@
40
  wp_redirect( admin_url().'admin.php?page=apss-share' );
41
  exit;
42
 
43
- }
44
-
1
  <?php defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); ?>
2
  <?php
3
  $apss_share_settings=array();
4
+ $share_options = array();
 
5
  if(isset($_POST['apss_share_settings']['share_options'])){
 
6
  foreach ( $_POST['apss_share_settings']['share_options'] as $key=>$value ){
7
  $share_options[]=$value;
8
  }
38
  wp_redirect( admin_url().'admin.php?page=apss-share' );
39
  exit;
40
 
 
 
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: 4.2
7
- Stable tag: 2.0.4
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
  = 2.0.4 =
135
  * Text changes done for the display settings tab.
136
  * Done the code optimization of plugin's shortcode.
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
  Tested up to: 4.2
7
+ Stable tag: 2.0.5
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
+ = 2.0.5 =
135
+ * Removal of unnecessary code(condition checking) in saving settings.
136
+ * Functions - frontend_counter, get_plusones code modification for security enhancement.
137
+
138
  = 2.0.4 =
139
  * Text changes done for the display settings tab.
140
  * Done the code optimization of plugin's shortcode.