Social Share WordPress Plugin – AccessPress Social Share - Version 3.0.1

Version Description

  • Code modification of the total share count for the facebook share count.
  • Done the addition of the option in the miscelleneous settings to disable the plugin's frontend assets.
Download this release

Release Info

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

Code changes from version 3.0.0 to 3.0.1

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: 3.0.0
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', '3.0.0' );
34
  }
35
 
36
  if( !defined('APSS_TEXT_DOMAIN')){
@@ -58,8 +58,12 @@ if( !class_exists( 'APSS_Class' ) ){
58
  add_action('init',array( $this,'session_init')); //start the session if not started yet.
59
  add_action('admin_enqueue_scripts', array($this, 'register_admin_assets')); //registers all the assets required for wp-admin
60
  add_filter( 'the_content', array($this, 'apss_the_content_filter' )); // add the filter function for display of social share icons in frontend
61
- add_action( 'wp_enqueue_scripts', array( $this, 'register_frontend_assets' ) ); //registers all the assets required for the frontend
62
- add_action( 'admin_menu', array( $this, 'add_apss_menu' ) ); //register the plugin menu in backend
 
 
 
 
63
  add_action('admin_post_apss_save_options', array( $this, 'apss_save_options')); //save the options in the wordpress options table.
64
  add_action('admin_post_apss_restore_default_settings',array($this,'apss_restore_default_settings'));//restores default settings.
65
  add_action('admin_post_apss_clear_cache',array($this,'apss_clear_cache'));//clear the cache of the social share counter.
@@ -104,7 +108,7 @@ if( !class_exists( 'APSS_Class' ) ){
104
  * */
105
  if( isset($_GET['page']) && $_GET['page']=='apss-share' ){
106
  wp_enqueue_style( 'aps-admin-css', APSS_CSS_DIR . '/backend.css', false, APSS_VERSION ); //registering plugin admin css
107
- wp_enqueue_style( 'fontawesome-css', APSS_CSS_DIR . '/font-awesome.min.css', false, APSS_VERSION );
108
 
109
  /**
110
  * Backend JS
@@ -185,7 +189,7 @@ if( !class_exists( 'APSS_Class' ) ){
185
  * Registers Frontend Assets
186
  * */
187
  function register_frontend_assets() {
188
- wp_enqueue_style( 'apss-font-awesome', APSS_CSS_DIR.'/font-awesome.min.css',array(),APSS_VERSION );
189
  wp_enqueue_style( 'apss-font-opensans', '//fonts.googleapis.com/css?family=Open+Sans',array(),false );
190
  wp_enqueue_style( 'apss-frontend-css', APSS_CSS_DIR . '/frontend.css', array( 'apss-font-awesome' ), APSS_VERSION );
191
  wp_enqueue_script( 'apss-frontend-mainjs', APSS_JS_DIR . '/frontend.js', array('jquery'), APSS_VERSION, true );
@@ -397,7 +401,7 @@ if( !class_exists( 'APSS_Class' ) ){
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]['share_count'] ) ? intval( $json[0]['share_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;
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: 3.0.1
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', '3.0.1' );
34
  }
35
 
36
  if( !defined('APSS_TEXT_DOMAIN')){
58
  add_action('init',array( $this,'session_init')); //start the session if not started yet.
59
  add_action('admin_enqueue_scripts', array($this, 'register_admin_assets')); //registers all the assets required for wp-admin
60
  add_filter( 'the_content', array($this, 'apss_the_content_filter' )); // add the filter function for display of social share icons in frontend
61
+
62
+ if(isset($this->apss_settings['disable_frontend_assets']) && $this->apss_settings['disable_frontend_assets'] != '1'){
63
+ add_action( 'wp_enqueue_scripts', array( $this, 'register_frontend_assets' ) ); //registers all the assets required for the frontend
64
+ }
65
+
66
+ add_action( 'admin_menu', array( $this, 'add_apss_menu' ) ); //register the plugin menu in backend
67
  add_action('admin_post_apss_save_options', array( $this, 'apss_save_options')); //save the options in the wordpress options table.
68
  add_action('admin_post_apss_restore_default_settings',array($this,'apss_restore_default_settings'));//restores default settings.
69
  add_action('admin_post_apss_clear_cache',array($this,'apss_clear_cache'));//clear the cache of the social share counter.
108
  * */
109
  if( isset($_GET['page']) && $_GET['page']=='apss-share' ){
110
  wp_enqueue_style( 'aps-admin-css', APSS_CSS_DIR . '/backend.css', false, APSS_VERSION ); //registering plugin admin css
111
+ wp_enqueue_style( 'fontawesome-css', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css', false, APSS_VERSION );
112
 
113
  /**
114
  * Backend JS
189
  * Registers Frontend Assets
190
  * */
191
  function register_frontend_assets() {
192
+ wp_enqueue_style( 'apss-font-awesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css', array(), APSS_VERSION );
193
  wp_enqueue_style( 'apss-font-opensans', '//fonts.googleapis.com/css?family=Open+Sans',array(),false );
194
  wp_enqueue_style( 'apss-frontend-css', APSS_CSS_DIR . '/frontend.css', array( 'apss-font-awesome' ), APSS_VERSION );
195
  wp_enqueue_script( 'apss-frontend-mainjs', APSS_JS_DIR . '/frontend.js', array('jquery'), APSS_VERSION, true );
401
  // $facebook_count = isset($json['shares']) ? intval( $json['shares'] ) : 0;
402
  $json_string = $this->get_json_values( 'https://api.facebook.com/method/links.getStats?urls=' . $url.'&format=json' );
403
  $json = json_decode( $json_string, true );
404
+ $facebook_count = isset( $json[0]['total_count'] ) ? intval( $json[0]['total_count'] ) : 0;
405
  set_transient($fb_transient, $facebook_count, $cache_period * HOUR_IN_SECONDS );
406
  if( !in_array( $fb_transient, $apss_social_counts_transients) ){
407
  $apss_social_counts_transients[] = $fb_transient;
inc/backend/activation.php CHANGED
@@ -15,6 +15,7 @@ $social_networks=array('facebook'=>'1',
15
  'print'=>'0',
16
  );
17
  $apss_share_settings['social_networks']=$social_networks;
 
18
  $apss_share_settings['share_text'] = '';
19
  $apss_share_settings['twitter_username'] = '';
20
  $apss_share_settings['counter_enable_options']='0';
15
  'print'=>'0',
16
  );
17
  $apss_share_settings['social_networks']=$social_networks;
18
+ $apss_share_settings['disable_frontend_assets'] = '0';
19
  $apss_share_settings['share_text'] = '';
20
  $apss_share_settings['twitter_username'] = '';
21
  $apss_share_settings['counter_enable_options']='0';
inc/backend/how-to-use.php CHANGED
@@ -39,7 +39,9 @@
39
  <dd>
40
  <p>You can use shortcode [apss-count] for the display of the social share count only in the contents. You need to enter network name you want to display.
41
  <ul class="how-list">
42
- <li><i class="fa fa-check"></i>Example 1: <code>[apss-count network='facebook']</code></li>
 
 
43
  <li><i class="fa fa-check"></i>Available network parameters are: facebook, twitter, google-plus, pinterest, linkedin</li>
44
  </ul>
45
  </p>
39
  <dd>
40
  <p>You can use shortcode [apss-count] for the display of the social share count only in the contents. You need to enter network name you want to display.
41
  <ul class="how-list">
42
+ <li><i class="fa fa-check"></i>Example 1: <code>[apss-count network='facebook']</code>
43
+ Please note that this shortcode takes only one network value at a time. So if you want to fetch the share count for facebook and twitter you need to use <code>[apss-count network='facebook']</code> and <code>[apss-count network='twitter']</code> respectively.
44
+ </li>
45
  <li><i class="fa fa-check"></i>Available network parameters are: facebook, twitter, google-plus, pinterest, linkedin</li>
46
  </ul>
47
  </p>
inc/backend/main-page.php CHANGED
@@ -119,14 +119,24 @@ if(isset($_SESSION['apss_message'])){ ?>
119
  <h2><?php _e( 'Miscellaneous settings: ', APSS_TEXT_DOMAIN ); ?> </h2>
120
  <h4><?php _e('Please setup these additional settings:', APSS_TEXT_DOMAIN ); ?></h4>
121
 
122
- <div class="apss-share-text-settings">
 
 
 
 
 
 
 
 
 
 
123
  <?php _e( 'Share text:', APSS_TEXT_DOMAIN ); ?> <input type="text" name="apss_share_settings[share_text]" value="<?php if(isset($options['share_text'])){echo $options['share_text']; } ?>" />
124
  <div class="apss_notes_cache_settings">
125
  <?php _e( 'Please enter the share text to make it appear above social share icons. Leave blank if you don\'t want to use share text.', APSS_TEXT_DOMAIN ); ?>
126
  </div>
127
  </div>
128
  <br />
129
- <div class="apss-twitter-settings">
130
  <?php _e( 'Twitter username:', APSS_TEXT_DOMAIN ); ?> <input type="text" name="apss_share_settings[twitter_username]" value="<?php echo $options['twitter_username']; ?>" />
131
  </div>
132
 
119
  <h2><?php _e( 'Miscellaneous settings: ', APSS_TEXT_DOMAIN ); ?> </h2>
120
  <h4><?php _e('Please setup these additional settings:', APSS_TEXT_DOMAIN ); ?></h4>
121
 
122
+ <div class="apss-share-text-settings clearfix">
123
+ <h4><?php _e( 'Disable the plugins frontend assets?', APSS_TEXT_DOMAIN ); ?> </h4>
124
+ <div class="misc-opt"><input type="radio" id='disable_frontend_assets_n' name="apss_share_settings[disable_frontend_assets]" value="0" <?php if(isset($options['disable_frontend_assets']) && $options['disable_frontend_assets'] =='0'){ echo "checked='checked'"; } ?> /><label for="disable_frontend_assets_n"><?php _e( 'No', APSS_TEXT_DOMAIN ); ?></label></div>
125
+ <div class="misc-opt"><input type="radio" id='disable_frontend_assets_y' name="apss_share_settings[disable_frontend_assets]" value="1" <?php if(isset($options['disable_frontend_assets']) && $options['disable_frontend_assets'] =='1'){ echo "checked='checked'"; } ?> /><label for="disable_frontend_assets_y"><?php _e( 'Yes', APSS_TEXT_DOMAIN ); ?></label></div>
126
+ <br />
127
+ <div class="apss_notes_cache_settings">
128
+ <?php _e( 'Please set this value if you don\'t want to use plguins frontend assets(js and css files).', APSS_TEXT_DOMAIN ); ?>
129
+ </div>
130
+ </div>
131
+ <br />
132
+ <div class="apss-share-text-settings clearfix">
133
  <?php _e( 'Share text:', APSS_TEXT_DOMAIN ); ?> <input type="text" name="apss_share_settings[share_text]" value="<?php if(isset($options['share_text'])){echo $options['share_text']; } ?>" />
134
  <div class="apss_notes_cache_settings">
135
  <?php _e( 'Please enter the share text to make it appear above social share icons. Leave blank if you don\'t want to use share text.', APSS_TEXT_DOMAIN ); ?>
136
  </div>
137
  </div>
138
  <br />
139
+ <div class="apss-twitter-settings clearfix">
140
  <?php _e( 'Twitter username:', APSS_TEXT_DOMAIN ); ?> <input type="text" name="apss_share_settings[twitter_username]" value="<?php echo $options['twitter_username']; ?>" />
141
  </div>
142
 
inc/backend/save-settings.php CHANGED
@@ -20,6 +20,7 @@
20
  }
21
 
22
  $apss_share_settings['social_networks']=$social_network_array;
 
23
  $apss_share_settings['share_text'] = $_POST['apss_share_settings']['share_text'];
24
  $apss_share_settings['twitter_username'] = stripslashes_deep($_POST['apss_share_settings']['twitter_username']);
25
  $apss_share_settings['counter_enable_options'] = $_POST['apss_share_settings']['counter_enable_options'];
20
  }
21
 
22
  $apss_share_settings['social_networks']=$social_network_array;
23
+ $apss_share_settings['disable_frontend_assets'] = isset($_POST['apss_share_settings']['disable_frontend_assets']) ? $_POST['apss_share_settings']['disable_frontend_assets'] : '0';
24
  $apss_share_settings['share_text'] = $_POST['apss_share_settings']['share_text'];
25
  $apss_share_settings['twitter_username'] = stripslashes_deep($_POST['apss_share_settings']['twitter_username']);
26
  $apss_share_settings['counter_enable_options'] = $_POST['apss_share_settings']['counter_enable_options'];
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: 3.0.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
  = 3.0.0 =
135
  * Addition of the options of meta box for posts and pages to enable and disable the social share for it's content.
136
  * Removal of the loading text instead used the previous share counters.
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
  Tested up to: 4.2
7
+ Stable tag: 3.0.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
+ = 3.0.1 =
135
+ * Code modification of the total share count for the facebook share count.
136
+ * Done the addition of the option in the miscelleneous settings to disable the plugin's frontend assets.
137
+
138
  = 3.0.0 =
139
  * Addition of the options of meta box for posts and pages to enable and disable the social share for it's content.
140
  * Removal of the loading text instead used the previous share counters.