Social Share WordPress Plugin – AccessPress Social Share - Version 2.0.3

Version Description

  • Removal of the unnecesary commented codes from the plugin main file.
  • Help text change for the social share counter.
Download this release

Release Info

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

Code changes from version 2.0.2 to 2.0.3

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.2
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.2' );
34
  }
35
 
36
  if(!defined('APSS_TEXT_DOMAIN')){
@@ -58,14 +58,14 @@ 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.
66
  add_shortcode('apss-share', array($this, 'apss_shortcode')); //adds a shortcode
67
- add_action('wp_ajax_nopriv_frontend_counter', array($this, 'frontend_counter'));
68
- add_action('wp_ajax_frontend_counter', array($this, 'frontend_counter')); // action for ajax counter
69
  }
70
 
71
  //called when plugin is activated
@@ -469,7 +469,7 @@ if( !class_exists( 'APSS_Class' ) ){
469
  return $count;
470
  }
471
 
472
- }//APSS_Class termination
473
 
474
  $apss_object = new APSS_Class();
475
  }
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.3
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.3' );
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
+ 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.
66
  add_shortcode('apss-share', array($this, 'apss_shortcode')); //adds a shortcode
67
+ add_action('wp_ajax_nopriv_frontend_counter', array($this, 'frontend_counter')); //fetching of the social share count.
68
+ add_action('wp_ajax_frontend_counter', array($this, 'frontend_counter')); // action for ajax counter.
69
  }
70
 
71
  //called when plugin is activated
469
  return $count;
470
  }
471
 
472
+ } //APSS_Class termination
473
 
474
  $apss_object = new APSS_Class();
475
  }
inc/backend/how-to-use.php CHANGED
@@ -16,7 +16,7 @@
16
  <li><i class="fa fa-check"></i>You can setup the twitter username.</li>
17
  <li><i class="fa fa-check"></i>You can enable/disable the social counter.</li>
18
  <li><i class="fa fa-check"></i>Share link - You can enable the share options either in new tab/window or in same widow.</li>
19
- <li><i class="fa fa-check"></i>Cache settings - Here you can set the cache settings in hour format.</li>
20
  <li><i class="fa fa-check"></i>Email settings - If you have enabled the email settings you can setup the email header and body part.</li>
21
  </ul>
22
  </p></dd>
@@ -24,8 +24,8 @@
24
  <dt><strong>Shortcode</strong></dt>
25
  <dd><p>You can use shortcode for the display of the social share in the contents. Optionally You can enter the name of the networks you want to display. The networks will be displayed in the order of entered networks.
26
  <ul class="how-list">
27
- <li><i class="fa fa-check"></i>Example 1: [apss-share]</li>
28
- <li><i class="fa fa-check"></i>Example 2: [apss-share networks='facebook, twitter, pinterest']</li>
29
  <li><i class="fa fa-check"></i>Available network parameters are: facebook, twitter, google-plus, pinterest, linkedin, digg, email, print</li>
30
  </ul>
31
  </p></dd>
16
  <li><i class="fa fa-check"></i>You can setup the twitter username.</li>
17
  <li><i class="fa fa-check"></i>You can enable/disable the social counter.</li>
18
  <li><i class="fa fa-check"></i>Share link - You can enable the share options either in new tab/window or in same widow.</li>
19
+ <li><i class="fa fa-check"></i>Cache settings - Here you can set the cache settings of the social share counter in hour format.</li>
20
  <li><i class="fa fa-check"></i>Email settings - If you have enabled the email settings you can setup the email header and body part.</li>
21
  </ul>
22
  </p></dd>
24
  <dt><strong>Shortcode</strong></dt>
25
  <dd><p>You can use shortcode for the display of the social share in the contents. Optionally You can enter the name of the networks you want to display. The networks will be displayed in the order of entered networks.
26
  <ul class="how-list">
27
+ <li><i class="fa fa-check"></i>Example 1: <code>[apss-share]</code></li>
28
+ <li><i class="fa fa-check"></i>Example 2: <code>[apss-share networks='facebook, twitter, pinterest']</code></li>
29
  <li><i class="fa fa-check"></i>Available network parameters are: facebook, twitter, google-plus, pinterest, linkedin, digg, email, print</li>
30
  </ul>
31
  </p></dd>
inc/backend/main-page.php CHANGED
@@ -29,18 +29,17 @@
29
  </div>
30
  <?php $options = get_option( APSS_SETTING_NAME );
31
  if(isset($_SESSION['apss_message'])){ ?>
32
-
33
- <div class="apss-message">
34
- <p><?php
35
- echo $_SESSION['apss_message'];
36
- unset($_SESSION['apss_message']);
37
- ?></p>
38
- </div>
39
  <?php } ?>
40
 
41
  <div class="apps-wrap">
42
  <form method="post" action="<?php echo admin_url() . 'admin-post.php' ?>">
43
- <input type="hidden" name="action" value="apss_save_options"/>
44
 
45
  <ul class="apss-setting-tabs clearfix">
46
  <li><a href="javascript:void(0)" id="apss-social-networks" class="apss-tabs-trigger apss-active-tab "><?php _e( 'Social Networks', APSS_TEXT_DOMAIN );?></a></li>
@@ -49,7 +48,7 @@ if(isset($_SESSION['apss_message'])){ ?>
49
  <li><a href="javascript:void(0)" id="apss-miscellaneous" class="apss-tabs-trigger"><?php _e( 'Miscellaneous', APSS_TEXT_DOMAIN );?></a></li>
50
  <li><a href="javascript:void(0)" id="apss-how-to-use" class="apss-tabs-trigger"><?php _e( 'How To Use', APSS_TEXT_DOMAIN );?></a></li>
51
  <li><a href="javascript:void(0)" id="apss-about" class="apss-tabs-trigger"><?php _e( 'About', APSS_TEXT_DOMAIN );?></a></li>
52
- </ul>
53
  <div class="apss-wrapper">
54
  <div class="apss-tab-contents apss-social-networks" id="tab-apss-social-networks" style='display:block'>
55
  <h2><?php _e('Social Media chooser:', APSS_TEXT_DOMAIN); ?> </h2>
@@ -95,8 +94,6 @@ if(isset($_SESSION['apss_message'])){ ?>
95
  </div>
96
 
97
  <div class="apss-tab-contents apss-display-settings" id="tab-apss-display-settings" style='display:none'>
98
-
99
-
100
  <div class=' apss-display-positions'>
101
  <h2><?php _e('Display positions:', APSS_TEXT_DOMAIN); ?></h2>
102
  <span class='social-text'><?php _e( 'Please choose the option where you want to display the social share:', APSS_TEXT_DOMAIN ); ?></span>
@@ -104,7 +101,6 @@ if(isset($_SESSION['apss_message'])){ ?>
104
  <p><input type="radio" id="apss_above_content" name="apss_share_settings[social_share_position_options]"/ value="above_content" <?php if($options['share_positions']=='above_content'){ echo "checked='checked'"; } ?> /><label for='apss_above_content'><?php _e( 'Above content', APSS_TEXT_DOMAIN ); ?></label></p>
105
  <p><input type="radio" id="apss_below_above_content" id="below_above_content" name="apss_share_settings[social_share_position_options]" value="on_both" <?php if($options['share_positions']=='on_both'){ echo "checked='checked'"; } ?> /><label for='apss_below_above_content'><?php _e( 'Both(Below content and Above content)', APSS_TEXT_DOMAIN ); ?></label></p>
106
  </div>
107
-
108
  <div class=" apss-icon-sets">
109
  <h2><?php _e( 'Social icons sets: ', APSS_TEXT_DOMAIN ); ?> </h2>
110
  <?php _e('Please choose any one out of available icon themes:', APSS_TEXT_DOMAIN ); ?>
@@ -114,7 +110,6 @@ if(isset($_SESSION['apss_message'])){ ?>
114
  <p><input id="apss_icon_set_4" value="4" name="apss_share_settings[social_icon_set]" type="radio" <?php if($options['social_icon_set'] =='4'){ echo "checked='checked'"; } ?> ><label for="apss_icon_set_4"><span class="apss_demo_icon apss_demo_icons_4"></span><?php _e('Theme 4', APSS_TEXT_DOMAIN ); ?><div class="apss-theme-image"><img src="<?php echo APSS_IMAGE_DIR.'/theme/theme4.jpg';?>"/></div></label></p>
115
  <p><input id="apss_icon_set_5" value="5" name="apss_share_settings[social_icon_set]" type="radio" <?php if($options['social_icon_set'] =='5'){ echo "checked='checked'"; } ?> ><label for="apss_icon_set_5"><span class="apss_demo_icon apss_demo_icons_5"></span><?php _e('Theme 5', APSS_TEXT_DOMAIN ); ?><div class="apss-theme-image"><img src="<?php echo APSS_IMAGE_DIR.'/theme/theme5.jpg';?>"/></div></label></p>
116
  </div>
117
-
118
  </div>
119
 
120
  <div class="apss-tab-contents apss-miscellaneous" id="tab-apss-miscellaneous" style='display:none'>
@@ -124,7 +119,7 @@ if(isset($_SESSION['apss_message'])){ ?>
124
  <div class="apss-share-text-settings">
125
  <?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']; } ?>" />
126
  <div class="apss_notes_cache_settings">
127
- <?php _e( 'Please enter the share text to make it appear above social share icons. Leave blank if you dont want to use share text.', APSS_TEXT_DOMAIN ); ?>
128
  </div>
129
  </div>
130
  <br />
@@ -150,7 +145,7 @@ if(isset($_SESSION['apss_message'])){ ?>
150
  <input type='text' id="apss_cache_period" name='apss_share_settings[cache_settings]' value="<?php if(isset($options['cache_period'])){ echo $options['cache_period']; } ?>" onkeyup="removeMe('invalid_cache_period');"/>
151
  <span class="error invalid_cache_period"></span>
152
  <div class="apss_notes_cache_settings">
153
- <?php _e( 'Please enter the time in hours in which the social share counter should be updated. Default is 24 hours.', APSS_TEXT_DOMAIN ); ?>
154
  </div>
155
  </div>
156
 
@@ -161,7 +156,7 @@ if(isset($_SESSION['apss_message'])){ ?>
161
  <input type='text' name="apss_share_settings[apss_email_subject]" value="<?php echo $options['apss_email_subject'] ?>" />
162
  </div>
163
  <div class="app-email-body email-setg">
164
- <label for='apss-email-body'><?php _e( 'Email body:', APSS_TEXT_DOMAIN ); ?></label>
165
  <textarea rows='30' cols='30' name="apss_share_settings[apss_email_body]"><?php echo $options['apss_email_body'] ?></textarea>
166
  </div>
167
  </div>
@@ -186,7 +181,6 @@ if(isset($_SESSION['apss_message'])){ ?>
186
  <?php $nonce_clear = wp_create_nonce( 'apss-clear-cache-nonce' ); ?>
187
  <a href="<?php echo admin_url().'admin-post.php?action=apss_restore_default_settings&_wpnonce='.$nonce;?>" onclick="return confirm('<?php _e( 'Are you sure you want to restore default settings?',APSS_TEXT_DOMAIN ); ?>')"><input type="button" value="Restore Default Settings" class="apss-reset-button button primary-button"/></a>
188
  <a href="<?php echo admin_url().'admin-post.php?action=apss_clear_cache&_wpnonce='.$nonce_clear;?>" onclick="return confirm('<?php _e( 'Are you sure you want to clear cache share counter?',APSS_TEXT_DOMAIN ); ?>')"><input type="button" value="Clear Cache" class="apss-reset-button button primary-button"/></a>
189
-
190
  </div>
191
  </form>
192
  </div>
29
  </div>
30
  <?php $options = get_option( APSS_SETTING_NAME );
31
  if(isset($_SESSION['apss_message'])){ ?>
32
+ <div class="apss-message">
33
+ <p><?php
34
+ echo $_SESSION['apss_message'];
35
+ unset($_SESSION['apss_message']);
36
+ ?></p>
37
+ </div>
 
38
  <?php } ?>
39
 
40
  <div class="apps-wrap">
41
  <form method="post" action="<?php echo admin_url() . 'admin-post.php' ?>">
42
+ <input type="hidden" name="action" value="apss_save_options"/>
43
 
44
  <ul class="apss-setting-tabs clearfix">
45
  <li><a href="javascript:void(0)" id="apss-social-networks" class="apss-tabs-trigger apss-active-tab "><?php _e( 'Social Networks', APSS_TEXT_DOMAIN );?></a></li>
48
  <li><a href="javascript:void(0)" id="apss-miscellaneous" class="apss-tabs-trigger"><?php _e( 'Miscellaneous', APSS_TEXT_DOMAIN );?></a></li>
49
  <li><a href="javascript:void(0)" id="apss-how-to-use" class="apss-tabs-trigger"><?php _e( 'How To Use', APSS_TEXT_DOMAIN );?></a></li>
50
  <li><a href="javascript:void(0)" id="apss-about" class="apss-tabs-trigger"><?php _e( 'About', APSS_TEXT_DOMAIN );?></a></li>
51
+ </ul>
52
  <div class="apss-wrapper">
53
  <div class="apss-tab-contents apss-social-networks" id="tab-apss-social-networks" style='display:block'>
54
  <h2><?php _e('Social Media chooser:', APSS_TEXT_DOMAIN); ?> </h2>
94
  </div>
95
 
96
  <div class="apss-tab-contents apss-display-settings" id="tab-apss-display-settings" style='display:none'>
 
 
97
  <div class=' apss-display-positions'>
98
  <h2><?php _e('Display positions:', APSS_TEXT_DOMAIN); ?></h2>
99
  <span class='social-text'><?php _e( 'Please choose the option where you want to display the social share:', APSS_TEXT_DOMAIN ); ?></span>
101
  <p><input type="radio" id="apss_above_content" name="apss_share_settings[social_share_position_options]"/ value="above_content" <?php if($options['share_positions']=='above_content'){ echo "checked='checked'"; } ?> /><label for='apss_above_content'><?php _e( 'Above content', APSS_TEXT_DOMAIN ); ?></label></p>
102
  <p><input type="radio" id="apss_below_above_content" id="below_above_content" name="apss_share_settings[social_share_position_options]" value="on_both" <?php if($options['share_positions']=='on_both'){ echo "checked='checked'"; } ?> /><label for='apss_below_above_content'><?php _e( 'Both(Below content and Above content)', APSS_TEXT_DOMAIN ); ?></label></p>
103
  </div>
 
104
  <div class=" apss-icon-sets">
105
  <h2><?php _e( 'Social icons sets: ', APSS_TEXT_DOMAIN ); ?> </h2>
106
  <?php _e('Please choose any one out of available icon themes:', APSS_TEXT_DOMAIN ); ?>
110
  <p><input id="apss_icon_set_4" value="4" name="apss_share_settings[social_icon_set]" type="radio" <?php if($options['social_icon_set'] =='4'){ echo "checked='checked'"; } ?> ><label for="apss_icon_set_4"><span class="apss_demo_icon apss_demo_icons_4"></span><?php _e('Theme 4', APSS_TEXT_DOMAIN ); ?><div class="apss-theme-image"><img src="<?php echo APSS_IMAGE_DIR.'/theme/theme4.jpg';?>"/></div></label></p>
111
  <p><input id="apss_icon_set_5" value="5" name="apss_share_settings[social_icon_set]" type="radio" <?php if($options['social_icon_set'] =='5'){ echo "checked='checked'"; } ?> ><label for="apss_icon_set_5"><span class="apss_demo_icon apss_demo_icons_5"></span><?php _e('Theme 5', APSS_TEXT_DOMAIN ); ?><div class="apss-theme-image"><img src="<?php echo APSS_IMAGE_DIR.'/theme/theme5.jpg';?>"/></div></label></p>
112
  </div>
 
113
  </div>
114
 
115
  <div class="apss-tab-contents apss-miscellaneous" id="tab-apss-miscellaneous" style='display:none'>
119
  <div class="apss-share-text-settings">
120
  <?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']; } ?>" />
121
  <div class="apss_notes_cache_settings">
122
+ <?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 ); ?>
123
  </div>
124
  </div>
125
  <br />
145
  <input type='text' id="apss_cache_period" name='apss_share_settings[cache_settings]' value="<?php if(isset($options['cache_period'])){ echo $options['cache_period']; } ?>" onkeyup="removeMe('invalid_cache_period');"/>
146
  <span class="error invalid_cache_period"></span>
147
  <div class="apss_notes_cache_settings">
148
+ <?php _e( 'Please enter the time in hours in which the social share counter should be updated from social networks. Default is 24 hours.', APSS_TEXT_DOMAIN ); ?>
149
  </div>
150
  </div>
151
 
156
  <input type='text' name="apss_share_settings[apss_email_subject]" value="<?php echo $options['apss_email_subject'] ?>" />
157
  </div>
158
  <div class="app-email-body email-setg">
159
+ <label for='apss-email-body'><?php _e( 'Email body:', APSS_TEXT_DOMAIN ); ?></label>
160
  <textarea rows='30' cols='30' name="apss_share_settings[apss_email_body]"><?php echo $options['apss_email_body'] ?></textarea>
161
  </div>
162
  </div>
181
  <?php $nonce_clear = wp_create_nonce( 'apss-clear-cache-nonce' ); ?>
182
  <a href="<?php echo admin_url().'admin-post.php?action=apss_restore_default_settings&_wpnonce='.$nonce;?>" onclick="return confirm('<?php _e( 'Are you sure you want to restore default settings?',APSS_TEXT_DOMAIN ); ?>')"><input type="button" value="Restore Default Settings" class="apss-reset-button button primary-button"/></a>
183
  <a href="<?php echo admin_url().'admin-post.php?action=apss_clear_cache&_wpnonce='.$nonce_clear;?>" onclick="return confirm('<?php _e( 'Are you sure you want to clear cache share counter?',APSS_TEXT_DOMAIN ); ?>')"><input type="button" value="Clear Cache" class="apss-reset-button button primary-button"/></a>
 
184
  </div>
185
  </form>
186
  </div>
inc/frontend/shortcode.php CHANGED
@@ -183,7 +183,7 @@ foreach( $options['social_networks'] as $key=>$value ){
183
  </div>
184
  </a>
185
  </div>
186
- <?php
187
  break;
188
  }
189
  }
183
  </div>
184
  </a>
185
  </div>
186
+ <?php
187
  break;
188
  }
189
  }
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.2
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.2 =
135
  * Removal of the unnecessary codes for the fetching of the share count using cache period.
136
 
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
  Tested up to: 4.2
7
+ Stable tag: 2.0.3
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.3 =
135
+ * Removal of the unnecesary commented codes from the plugin main file.
136
+ * Help text change for the social share counter.
137
+
138
  = 2.0.2 =
139
  * Removal of the unnecessary codes for the fetching of the share count using cache period.
140