Social Share WordPress Plugin – AccessPress Social Share - Version 4.3.3

Version Description

  • Done the bug fixings for the AMP version removed the share icons from the amp version pages.
  • Updated the fontawesome icons version to 4.7.0
Download this release

Release Info

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

Code changes from version 4.3.2 to 4.3.3

Files changed (3) hide show
  1. accesspress-social-share.php +30 -25
  2. inc/frontend/shortcode.php +293 -285
  3. readme.txt +5 -1
accesspress-social-share.php CHANGED
@@ -4,7 +4,7 @@ defined( 'ABSPATH' ) or die( "No script kiddies please!" );
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.3.2
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.3.2' );
34
  }
35
 
36
  if ( !defined( 'APSS_TEXT_DOMAIN' ) ) {
@@ -134,7 +134,7 @@ if ( !class_exists( 'APSS_Class' ) ) {
134
  * */
135
  if ( isset( $_GET['page'] ) && $_GET['page'] == 'accesspress-social-share' ) {
136
  wp_enqueue_style( 'aps-admin-css', APSS_CSS_DIR . '/backend.css', false, APSS_VERSION ); //registering plugin admin css
137
- wp_enqueue_style( 'fontawesome-css', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css', false, APSS_VERSION );
138
 
139
  /**
140
  * Backend JS
@@ -188,10 +188,15 @@ if ( !class_exists( 'APSS_Class' ) ) {
188
 
189
  $is_default_archive = in_array( 'archives', $options['share_options'] );
190
  $default_archives = ( ( is_archive() && !is_tax() ) && !is_category() ) && $is_default_archive ? true : false;
 
 
 
 
 
191
 
192
  if ( empty( $options['share_options'] ) ) {
193
  return $post_content;
194
- } else if ( $is_lists_authorized || $is_attachement || $is_singular || $is_tax || $is_front_page || $default_category || $default_archives ) {
195
  if ( $options['share_positions'] == 'below_content' ) {
196
  return $post_content . "<div class='apss-social-share apss-theme-$icon_set_value clearfix' >" . $html_content . "</div>";
197
  }
@@ -212,7 +217,7 @@ if ( !class_exists( 'APSS_Class' ) ) {
212
  * Registers Frontend Assets
213
  * */
214
  function register_frontend_assets() {
215
- wp_enqueue_style( 'apss-font-awesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.4.0/css/font-awesome.min.css', array(), APSS_VERSION );
216
  wp_enqueue_style( 'apss-font-opensans', '//fonts.googleapis.com/css?family=Open+Sans', array(), false );
217
  wp_enqueue_style( 'apss-frontend-css', APSS_CSS_DIR . '/frontend.css', array( 'apss-font-awesome' ), APSS_VERSION );
218
  wp_enqueue_script( 'apss-frontend-mainjs', APSS_JS_DIR . '/frontend.js', array( 'jquery' ), APSS_VERSION, true );
@@ -437,26 +442,26 @@ if ( !class_exists( 'APSS_Class' ) ) {
437
  * Get Facebook Access Token
438
  * */
439
  function get_fb_access_token(){
440
- $apss_settings = $this->apss_settings;
441
- $app_id = $apss_settings['api_configuration']['facebook']['app_id'];
442
- $app_secret = $apss_settings['api_configuration']['facebook']['app_secret'];
443
- $api_url = 'https://graph.facebook.com/';
444
- $app_id= $apss_settings['api_configuration']['facebook']['app_id'];
445
- $app_secret = $apss_settings['api_configuration']['facebook']['app_secret'];
446
- $url = sprintf(
447
- '%soauth/access_token?client_id=%s&client_secret=%s&grant_type=client_credentials',
448
- $api_url,
449
- $app_id ,
450
- $app_secret
451
- );
452
-
453
- $access_token = wp_remote_get( $url, array( 'timeout' => 60 ) );
454
- if ( is_wp_error( $access_token ) || ( isset( $access_token['response']['code'] ) && 200 != $access_token['response']['code'] ) ) {
455
- return '';
456
- } else {
457
- $json_decode = json_decode($access_token['body']);
458
- return sanitize_text_field( $json_decode->access_token );
459
- }
460
  }
461
 
462
  function new_get_fb($url){
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.3.3
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.3.3' );
34
  }
35
 
36
  if ( !defined( 'APSS_TEXT_DOMAIN' ) ) {
134
  * */
135
  if ( isset( $_GET['page'] ) && $_GET['page'] == 'accesspress-social-share' ) {
136
  wp_enqueue_style( 'aps-admin-css', APSS_CSS_DIR . '/backend.css', false, APSS_VERSION ); //registering plugin admin css
137
+ wp_enqueue_style( 'fontawesome-css', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', false, APSS_VERSION );
138
 
139
  /**
140
  * Backend JS
188
 
189
  $is_default_archive = in_array( 'archives', $options['share_options'] );
190
  $default_archives = ( ( is_archive() && !is_tax() ) && !is_category() ) && $is_default_archive ? true : false;
191
+ if(function_exists( 'is_amp_endpoint' ) && is_amp_endpoint()){
192
+ $show_icons = false;
193
+ }else {
194
+ $show_icons = true;
195
+ }
196
 
197
  if ( empty( $options['share_options'] ) ) {
198
  return $post_content;
199
+ } else if ( ($is_lists_authorized || $is_attachement || $is_singular || $is_tax || $is_front_page || $default_category || $default_archives) && $show_icons) {
200
  if ( $options['share_positions'] == 'below_content' ) {
201
  return $post_content . "<div class='apss-social-share apss-theme-$icon_set_value clearfix' >" . $html_content . "</div>";
202
  }
217
  * Registers Frontend Assets
218
  * */
219
  function register_frontend_assets() {
220
+ wp_enqueue_style( 'apss-font-awesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', array(), APSS_VERSION );
221
  wp_enqueue_style( 'apss-font-opensans', '//fonts.googleapis.com/css?family=Open+Sans', array(), false );
222
  wp_enqueue_style( 'apss-frontend-css', APSS_CSS_DIR . '/frontend.css', array( 'apss-font-awesome' ), APSS_VERSION );
223
  wp_enqueue_script( 'apss-frontend-mainjs', APSS_JS_DIR . '/frontend.js', array( 'jquery' ), APSS_VERSION, true );
442
  * Get Facebook Access Token
443
  * */
444
  function get_fb_access_token(){
445
+ $apss_settings = $this->apss_settings;
446
+ $app_id = $apss_settings['api_configuration']['facebook']['app_id'];
447
+ $app_secret = $apss_settings['api_configuration']['facebook']['app_secret'];
448
+ $api_url = 'https://graph.facebook.com/';
449
+ $app_id= $apss_settings['api_configuration']['facebook']['app_id'];
450
+ $app_secret = $apss_settings['api_configuration']['facebook']['app_secret'];
451
+ $url = sprintf(
452
+ '%soauth/access_token?client_id=%s&client_secret=%s&grant_type=client_credentials',
453
+ $api_url,
454
+ $app_id ,
455
+ $app_secret
456
+ );
457
+
458
+ $access_token = wp_remote_get( $url, array( 'timeout' => 60 ) );
459
+ if ( is_wp_error( $access_token ) || ( isset( $access_token['response']['code'] ) && 200 != $access_token['response']['code'] ) ) {
460
+ return '';
461
+ } else {
462
+ $json_decode = json_decode($access_token['body']);
463
+ return sanitize_text_field( $json_decode->access_token );
464
+ }
465
  }
466
 
467
  function new_get_fb($url){
inc/frontend/shortcode.php CHANGED
@@ -52,325 +52,333 @@ if ( isset( $attr['counter'] ) ) {
52
  $counter_enable_options = 0;
53
  }
54
 
 
 
 
 
 
 
55
  ?>
 
 
 
 
 
 
 
 
 
56
 
57
- <div class='apss-social-share apss-theme-<?php echo $icon_set_value; ?> clearfix'>
58
- <?php
59
- $title = trim(str_replace( '+', '%20', urlencode( $post->post_title ) ));
60
- $content = trim(strip_shortcodes( strip_tags( $post->post_content ) ));
61
- if ( strlen( $content ) >= 100 ) {
62
- $excerpt = urlencode(substr( $content, 0, 100 ) . '...');
63
- } else {
64
- $excerpt = urlencode($content);
65
- }
66
-
67
- if ( isset( $attr['share_text'] ) && $attr['share_text'] != '' ) { ?> <div class='apss-share-text'><?php echo $attr['share_text']; ?></div> <?php } ?>
68
- <?php
69
- $total_count = 0;
70
- foreach ( $options['social_networks'] as $key => $value ) {
71
- if ( intval( $value ) == '1' ) {
72
- $count = $this->get_count( $key, $url );
73
 
74
- ///////////////////////////////////////////
75
- if(isset($http_url_checked) && $http_url_checked=='1'){
76
- $url_check = parse_url($url);
77
- if($url_check['scheme'] == 'https'){
78
- $flag=TRUE;
79
- }else{
80
- $flag=FALSE;
81
- }
82
 
83
- if($flag == TRUE){
84
- $url1 = APSS_Class:: get_http_url($url);
85
- $http_count = APSS_Class:: get_count($key, $url1);
86
- if($count != $http_count){
87
- $count += $http_count;
88
- }else{
89
- $count = $count;
90
- }
 
91
  }
92
- }
93
- ///////////////////////////////////////////
94
 
95
- $total_count += $count;
96
- switch ( $key ) {
97
- //counter available for facebook
98
- case 'facebook':
99
- $link = 'https://www.facebook.com/sharer/sharer.php?u=' . $url;
100
- $count = $this->get_count( $key, $url );
101
 
102
- ////////////////////////////////////////
103
- if(isset($http_url_checked) && $http_url_checked=='1'){
104
- $url_check = parse_url($url);
105
- if($url_check['scheme'] == 'https'){
106
- $flag=TRUE;
107
- }else{
108
- $flag=FALSE;
109
- }
110
 
111
- if($flag == TRUE){
112
- $url1 = APSS_Class:: get_http_url($url);
113
- $http_count = APSS_Class:: get_count($key, $url1);
114
- if($count != $http_count){
115
- $count += $http_count;
116
- }else{
117
- $count = $count;
118
- }
 
119
  }
120
- }
121
- ///////////////////////////////////////////
122
- ?>
123
- <div class='apss-facebook apss-single-icon'>
124
- <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window(event, '<?php echo $link; ?>');" <?php } ?> title='<?php _e( 'Share on Facebook', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
125
- <div class='apss-icon-block clearfix'>
126
- <i class='fa fa-facebook'></i>
127
- <span class='apss-social-text'><?php _e( 'Share on Facebook', 'accesspress-social-share' ); ?></span>
128
- <span class='apss-share'><?php _e( 'Share', 'accesspress-social-share' ); ?></span>
129
- </div>
130
- <?php
131
- if ( isset( $counter_enable_options ) && $counter_enable_options == '1' ) { ?>
132
- <div class='count apss-count' data-url='<?php echo $url; ?>' data-social-network='<?php echo $key; ?>' data-social-detail="<?php echo $url . '_' . $key; ?>"><?php echo $count; ?></div>
133
  <?php
134
- } ?>
135
- </a>
136
- </div>
137
- <?php
138
- break;
139
-
140
- //counter available for twitter
141
- case 'twitter':
142
- $url_twitter = $url;
143
- $url_twitter = urlencode( $url_twitter );
144
- if ( isset( $twitter_user ) && $twitter_user != '' ) {
145
- $twitter_user = 'via=' . $twitter_user;
146
- }
147
- $link = "https://twitter.com/intent/tweet?text=$title&amp;url=$url_twitter&amp;$twitter_user";
148
- $count = $this->get_count( $key, $url );
149
 
150
- ////////////////////////////////////////
151
- if(isset($http_url_checked) && $http_url_checked=='1'){
152
- $url_check = parse_url($url);
153
- if($url_check['scheme'] == 'https'){
154
- $flag=TRUE;
155
- }else{
156
- $flag=FALSE;
157
  }
 
 
158
 
159
- if($flag == TRUE){
160
- $url1 = APSS_Class:: get_http_url($url);
161
- $http_count = APSS_Class:: get_count($key, $url1);
162
- if($count != $http_count){
163
- $count += $http_count;
164
- }else{
165
- $count = $count;
166
- }
 
 
 
 
 
 
 
 
 
 
167
  }
168
- }
169
- ///////////////////////////////////////////
170
- ?>
171
- <div class='apss-twitter apss-single-icon'>
172
- <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window(event, '<?php echo $link; ?>');" href='javascript:void(0);' <?php }else{ ?> href="<?php echo $link; ?>" <?php } ?> title='<?php _e( 'Share on Twitter', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>'>
173
- <div class='apss-icon-block clearfix'>
174
- <i class='fa fa-twitter'></i>
175
- <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>
176
- </div>
177
- <?php if ( isset( $counter_enable_options ) && $counter_enable_options == '1' && $twitter_api_use !='1' ) { ?>
178
- <div class='count apss-count' data-url='<?php echo $url; ?>' data-social-network='<?php echo $key; ?>' data-social-detail="<?php echo $url . '_' . $key; ?>"><?php echo $count; ?></div>
179
- <?php } ?>
180
- </a>
181
- </div>
182
- <?php
183
- break;
184
 
185
- //counter available for google plus
186
- case 'google-plus':
187
- $link = 'https://plus.google.com/share?url=' . $url;
188
- $count = $this->get_count( $key, $url );
189
 
190
- ////////////////////////////////////////
191
- if(isset($http_url_checked) && $http_url_checked=='1'){
192
- $url_check = parse_url($url);
193
- if($url_check['scheme'] == 'https'){
194
- $flag=TRUE;
195
- }else{
196
- $flag=FALSE;
197
- }
198
 
199
- if($flag == TRUE){
200
- $url1 = APSS_Class:: get_http_url($url);
201
- $http_count = APSS_Class:: get_count($key, $url1);
202
- if($count != $http_count){
203
- $count += $http_count;
204
- }else{
205
- $count = $count;
206
- }
 
207
  }
208
- }
209
- ///////////////////////////////////////////
210
 
211
- ?>
212
- <div class='apss-google-plus apss-single-icon'>
213
- <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window(event, '<?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; ?>'>
214
- <div class='apss-icon-block clearfix'>
215
- <i class='fa fa-google-plus'></i>
216
- <span class='apss-social-text'><?php _e( 'Share on Google Plus', 'accesspress-social-share' ); ?> </span>
217
- <span class='apss-share'><?php _e( 'Share', 'accesspress-social-share' ); ?></span>
218
- </div>
219
- <?php
220
- if ( isset( $counter_enable_options ) && $counter_enable_options == '1' ) { ?>
221
- <div class='count apss-count' data-url='<?php echo $url; ?>' data-social-network='<?php echo $key; ?>' data-social-detail="<?php echo $url . '_' . $key; ?>"><?php echo $count; ?></div>
222
  <?php
223
- } ?>
224
- </a>
225
- </div>
226
- <?php
227
- break;
 
 
 
228
 
229
- //counter available for pinterest
230
- case 'pinterest':
231
- $count = $this->get_count( $key, $url );
232
- ////////////////////////////////////////
233
- if(isset($http_url_checked) && $http_url_checked=='1'){
234
- $url_check = parse_url($url);
235
- if($url_check['scheme'] == 'https'){
236
- $flag=TRUE;
237
- }else{
238
- $flag=FALSE;
239
- }
240
 
241
- if($flag == TRUE){
242
- $url1 = APSS_Class:: get_http_url($url);
243
- $http_count = APSS_Class:: get_count($key, $url1);
244
- if($count != $http_count){
245
- $count += $http_count;
246
- }else{
247
- $count = $count;
248
- }
 
249
  }
250
- }
251
- ///////////////////////////////////////////
252
- ?>
253
- <div class='apss-pinterest apss-single-icon'>
254
- <a rel='nofollow' title='<?php _e( 'Share on Pinterest', 'accesspress-social-share' ); ?>' href='javascript:pinIt();'>
255
- <div class='apss-icon-block clearfix'>
256
- <i class='fa fa-pinterest'></i>
257
- <span class='apss-social-text'><?php _e( 'Share on Pinterest', 'accesspress-social-share' ); ?></span>
258
- <span class='apss-share'><?php _e( 'Share', 'accesspress-social-share' ); ?></span>
259
- </div>
260
- <?php
261
- if ( isset( $counter_enable_options ) && $counter_enable_options == '1' ) { ?>
262
- <div class='count apss-count' data-url='<?php echo $url; ?>' data-social-network='<?php echo $key; ?>' data-social-detail="<?php echo $url . '_' . $key; ?>"><?php echo $count; ?></div>
263
  <?php
264
- } ?>
265
- </a>
266
- </div>
267
- <?php
268
- break;
 
 
 
269
 
270
- //couter available for linkedin
271
- case 'linkedin':
272
- $link = "http://www.linkedin.com/shareArticle?mini=true&amp;title=" . $title . "&amp;url=" . $url . "&amp;summary=" . $excerpt;
273
- $count = $this->get_count( $key, $url );
274
- ////////////////////////////////////////
275
- if(isset($http_url_checked) && $http_url_checked=='1'){
276
- $url_check = parse_url($url);
277
- if($url_check['scheme'] == 'https'){
278
- $flag=TRUE;
279
- }else{
280
- $flag=FALSE;
281
- }
282
 
283
- if($flag == TRUE){
284
- $url1 = APSS_Class:: get_http_url($url);
285
- $http_count = APSS_Class:: get_count($key, $url1);
286
- if($count != $http_count){
287
- $count += $http_count;
288
- }else{
289
- $count = $count;
290
- }
 
291
  }
292
- }
293
- ///////////////////////////////////////////
294
- ?>
295
- <div class='apss-linkedin apss-single-icon'>
296
- <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window(event, '<?php echo $link; ?>');" <?php } ?> title='<?php _e( 'Share on LinkedIn', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
297
- <div class='apss-icon-block clearfix'><i class='fa fa-linkedin'></i>
298
- <span class='apss-social-text'><?php _e( 'Share on LinkedIn', 'accesspress-social-share' ); ?></span>
299
- <span class='apss-share'><?php _e( 'Share', 'accesspress-social-share' ); ?></span>
300
- </div>
301
 
302
- <?php
303
- if ( isset( $counter_enable_options ) && $counter_enable_options == '1' ) { ?>
304
- <div class='count apss-count' data-url='<?php echo $url; ?>' data-social-network='<?php echo $key; ?>' data-social-detail="<?php echo $url . '_' . $key; ?>"><?php echo $count; ?></div>
305
  <?php
306
- } ?>
 
 
 
307
 
308
- </a>
309
- </div>
310
- <?php
311
- break;
312
 
313
- //there is no counter available for digg
314
- case 'digg':
315
- $link = "http://digg.com/submit?phase=2%20&amp;url=" . $url . "&amp;title=" . $title;
316
- ?>
317
- <div class='apss-digg apss-single-icon'>
318
- <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window(event, '<?php echo $link; ?>');" <?php } ?> title='<?php _e( 'Share on Digg', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
319
- <div class='apss-icon-block clearfix'>
320
- <i class='fa fa-digg'></i>
321
- <span class='apss-social-text'><?php _e( 'Share on Digg', 'accesspress-social-share' ); ?></span>
322
- <span class='apss-share'><?php _e( 'Share', 'accesspress-social-share' ); ?></span>
323
- </div>
324
- </a>
325
- </div>
326
- <?php
327
- break;
328
 
329
- case 'email':
330
- if ( strpos( $options['apss_email_body'], '%%' ) || strpos( $options['apss_email_subject'], '%%' ) ) {
331
- $link = 'mailto:?subject=' . $options['apss_email_subject'] . '&amp;body=' . $options['apss_email_body'];
332
- $link = preg_replace( array( '#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#', '#%%url%%#' ), array( $title, get_site_url(), get_permalink(), $url ), $link );
333
- } else {
334
- $link = 'mailto:?subject=' . $options['apss_email_subject'] . '&amp;body=' . $options['apss_email_body'] . ": " . $url;
335
- }
336
- ?>
337
- <div class='apss-email apss-single-icon'>
338
- <a rel='nofollow' class='share-email-popup' title='<?php _e( 'Share it on Email', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
339
- <div class='apss-icon-block clearfix'>
340
- <i class='fa fa-envelope'></i>
341
- <span class='apss-social-text'><?php _e( 'Send email', 'accesspress-social-share' ); ?></span>
342
- <span class='apss-share'><?php _e( 'Mail', 'accesspress-social-share' ); ?></span>
343
- </div>
344
- </a>
345
- </div>
346
- <?php
347
- break;
348
 
349
- case 'print':
350
- ?>
351
- <div class='apss-print apss-single-icon'>
352
- <a rel='nofollow' title='<?php _e( 'Print', 'accesspress-social-share' ); ?>' href='javascript:void(0);' onclick='window.print(); return false;'>
353
- <div class='apss-icon-block clearfix'><i class='fa fa-print'></i>
354
- <span class='apss-social-text'><?php _e( 'Print', 'accesspress-social-share' ); ?></span>
355
- <span class='apss-share'><?php _e( 'Print', 'accesspress-social-share' ); ?></span>
356
- </div>
357
- </a>
358
- </div>
359
- <?php
360
- break;
 
361
  }
362
  }
363
- }
364
 
365
- do_action('apss_more_networks_in_shortcodes');
366
 
367
- if ( isset( $total_counter_enable_options ) && $total_counter_enable_options == '1' ) {
368
- ?>
369
- <div class='apss-total-share-count'>
370
- <span class='apss-count-number'><?php echo $total_count; ?></span>
371
- <div class="apss-total-shares"><span class='apss-total-text'><?php echo _e( ' Total', 'accesspress-social-share' ); ?></span>
372
- <span class='apss-shares-text'><?php echo _e( ' Shares', 'accesspress-social-share' ); ?></span></div>
373
- </div>
374
- <?php
375
- } ?>
376
- </div>
 
 
 
52
  $counter_enable_options = 0;
53
  }
54
 
55
+ if(function_exists( 'is_amp_endpoint' ) && is_amp_endpoint()){
56
+ $show_shortcode_content = false;
57
+ }else{
58
+ $show_shortcode_content = true;
59
+ }
60
+ if($show_shortcode_content){
61
  ?>
62
+ <div class='apss-social-share apss-theme-<?php echo $icon_set_value; ?> clearfix'>
63
+ <?php
64
+ $title = trim(str_replace( '+', '%20', urlencode( $post->post_title ) ));
65
+ $content = trim(strip_shortcodes( strip_tags( $post->post_content ) ));
66
+ if ( strlen( $content ) >= 100 ) {
67
+ $excerpt = urlencode(substr( $content, 0, 100 ) . '...');
68
+ } else {
69
+ $excerpt = urlencode($content);
70
+ }
71
 
72
+ if ( isset( $attr['share_text'] ) && $attr['share_text'] != '' ) { ?> <div class='apss-share-text'><?php echo $attr['share_text']; ?></div> <?php } ?>
73
+ <?php
74
+ $total_count = 0;
75
+ foreach ( $options['social_networks'] as $key => $value ) {
76
+ if ( intval( $value ) == '1' ) {
77
+ $count = $this->get_count( $key, $url );
 
 
 
 
 
 
 
 
 
 
78
 
79
+ ///////////////////////////////////////////
80
+ if(isset($http_url_checked) && $http_url_checked=='1'){
81
+ $url_check = parse_url($url);
82
+ if($url_check['scheme'] == 'https'){
83
+ $flag=TRUE;
84
+ }else{
85
+ $flag=FALSE;
86
+ }
87
 
88
+ if($flag == TRUE){
89
+ $url1 = APSS_Class:: get_http_url($url);
90
+ $http_count = APSS_Class:: get_count($key, $url1);
91
+ if($count != $http_count){
92
+ $count += $http_count;
93
+ }else{
94
+ $count = $count;
95
+ }
96
+ }
97
  }
98
+ ///////////////////////////////////////////
 
99
 
100
+ $total_count += $count;
101
+ switch ( $key ) {
102
+ //counter available for facebook
103
+ case 'facebook':
104
+ $link = 'https://www.facebook.com/sharer/sharer.php?u=' . $url;
105
+ $count = $this->get_count( $key, $url );
106
 
107
+ ////////////////////////////////////////
108
+ if(isset($http_url_checked) && $http_url_checked=='1'){
109
+ $url_check = parse_url($url);
110
+ if($url_check['scheme'] == 'https'){
111
+ $flag=TRUE;
112
+ }else{
113
+ $flag=FALSE;
114
+ }
115
 
116
+ if($flag == TRUE){
117
+ $url1 = APSS_Class:: get_http_url($url);
118
+ $http_count = APSS_Class:: get_count($key, $url1);
119
+ if($count != $http_count){
120
+ $count += $http_count;
121
+ }else{
122
+ $count = $count;
123
+ }
124
+ }
125
  }
126
+ ///////////////////////////////////////////
127
+ ?>
128
+ <div class='apss-facebook apss-single-icon'>
129
+ <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window(event, '<?php echo $link; ?>');" <?php } ?> title='<?php _e( 'Share on Facebook', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
130
+ <div class='apss-icon-block clearfix'>
131
+ <i class='fa fa-facebook'></i>
132
+ <span class='apss-social-text'><?php _e( 'Share on Facebook', 'accesspress-social-share' ); ?></span>
133
+ <span class='apss-share'><?php _e( 'Share', 'accesspress-social-share' ); ?></span>
134
+ </div>
 
 
 
 
135
  <?php
136
+ if ( isset( $counter_enable_options ) && $counter_enable_options == '1' ) { ?>
137
+ <div class='count apss-count' data-url='<?php echo $url; ?>' data-social-network='<?php echo $key; ?>' data-social-detail="<?php echo $url . '_' . $key; ?>"><?php echo $count; ?></div>
138
+ <?php
139
+ } ?>
140
+ </a>
141
+ </div>
142
+ <?php
143
+ break;
 
 
 
 
 
 
 
144
 
145
+ //counter available for twitter
146
+ case 'twitter':
147
+ $url_twitter = $url;
148
+ $url_twitter = urlencode( $url_twitter );
149
+ if ( isset( $twitter_user ) && $twitter_user != '' ) {
150
+ $twitter_user = 'via=' . $twitter_user;
 
151
  }
152
+ $link = "https://twitter.com/intent/tweet?text=$title&amp;url=$url_twitter&amp;$twitter_user";
153
+ $count = $this->get_count( $key, $url );
154
 
155
+ ////////////////////////////////////////
156
+ if(isset($http_url_checked) && $http_url_checked=='1'){
157
+ $url_check = parse_url($url);
158
+ if($url_check['scheme'] == 'https'){
159
+ $flag=TRUE;
160
+ }else{
161
+ $flag=FALSE;
162
+ }
163
+
164
+ if($flag == TRUE){
165
+ $url1 = APSS_Class:: get_http_url($url);
166
+ $http_count = APSS_Class:: get_count($key, $url1);
167
+ if($count != $http_count){
168
+ $count += $http_count;
169
+ }else{
170
+ $count = $count;
171
+ }
172
+ }
173
  }
174
+ ///////////////////////////////////////////
175
+ ?>
176
+ <div class='apss-twitter apss-single-icon'>
177
+ <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window(event, '<?php echo $link; ?>');" href='javascript:void(0);' <?php }else{ ?> href="<?php echo $link; ?>" <?php } ?> title='<?php _e( 'Share on Twitter', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>'>
178
+ <div class='apss-icon-block clearfix'>
179
+ <i class='fa fa-twitter'></i>
180
+ <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>
181
+ </div>
182
+ <?php if ( isset( $counter_enable_options ) && $counter_enable_options == '1' && $twitter_api_use !='1' ) { ?>
183
+ <div class='count apss-count' data-url='<?php echo $url; ?>' data-social-network='<?php echo $key; ?>' data-social-detail="<?php echo $url . '_' . $key; ?>"><?php echo $count; ?></div>
184
+ <?php } ?>
185
+ </a>
186
+ </div>
187
+ <?php
188
+ break;
 
189
 
190
+ //counter available for google plus
191
+ case 'google-plus':
192
+ $link = 'https://plus.google.com/share?url=' . $url;
193
+ $count = $this->get_count( $key, $url );
194
 
195
+ ////////////////////////////////////////
196
+ if(isset($http_url_checked) && $http_url_checked=='1'){
197
+ $url_check = parse_url($url);
198
+ if($url_check['scheme'] == 'https'){
199
+ $flag=TRUE;
200
+ }else{
201
+ $flag=FALSE;
202
+ }
203
 
204
+ if($flag == TRUE){
205
+ $url1 = APSS_Class:: get_http_url($url);
206
+ $http_count = APSS_Class:: get_count($key, $url1);
207
+ if($count != $http_count){
208
+ $count += $http_count;
209
+ }else{
210
+ $count = $count;
211
+ }
212
+ }
213
  }
214
+ ///////////////////////////////////////////
 
215
 
216
+ ?>
217
+ <div class='apss-google-plus apss-single-icon'>
218
+ <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window(event, '<?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; ?>'>
219
+ <div class='apss-icon-block clearfix'>
220
+ <i class='fa fa-google-plus'></i>
221
+ <span class='apss-social-text'><?php _e( 'Share on Google Plus', 'accesspress-social-share' ); ?> </span>
222
+ <span class='apss-share'><?php _e( 'Share', 'accesspress-social-share' ); ?></span>
223
+ </div>
 
 
 
224
  <?php
225
+ if ( isset( $counter_enable_options ) && $counter_enable_options == '1' ) { ?>
226
+ <div class='count apss-count' data-url='<?php echo $url; ?>' data-social-network='<?php echo $key; ?>' data-social-detail="<?php echo $url . '_' . $key; ?>"><?php echo $count; ?></div>
227
+ <?php
228
+ } ?>
229
+ </a>
230
+ </div>
231
+ <?php
232
+ break;
233
 
234
+ //counter available for pinterest
235
+ case 'pinterest':
236
+ $count = $this->get_count( $key, $url );
237
+ ////////////////////////////////////////
238
+ if(isset($http_url_checked) && $http_url_checked=='1'){
239
+ $url_check = parse_url($url);
240
+ if($url_check['scheme'] == 'https'){
241
+ $flag=TRUE;
242
+ }else{
243
+ $flag=FALSE;
244
+ }
245
 
246
+ if($flag == TRUE){
247
+ $url1 = APSS_Class:: get_http_url($url);
248
+ $http_count = APSS_Class:: get_count($key, $url1);
249
+ if($count != $http_count){
250
+ $count += $http_count;
251
+ }else{
252
+ $count = $count;
253
+ }
254
+ }
255
  }
256
+ ///////////////////////////////////////////
257
+ ?>
258
+ <div class='apss-pinterest apss-single-icon'>
259
+ <a rel='nofollow' title='<?php _e( 'Share on Pinterest', 'accesspress-social-share' ); ?>' href='javascript:pinIt();'>
260
+ <div class='apss-icon-block clearfix'>
261
+ <i class='fa fa-pinterest'></i>
262
+ <span class='apss-social-text'><?php _e( 'Share on Pinterest', 'accesspress-social-share' ); ?></span>
263
+ <span class='apss-share'><?php _e( 'Share', 'accesspress-social-share' ); ?></span>
264
+ </div>
 
 
 
 
265
  <?php
266
+ if ( isset( $counter_enable_options ) && $counter_enable_options == '1' ) { ?>
267
+ <div class='count apss-count' data-url='<?php echo $url; ?>' data-social-network='<?php echo $key; ?>' data-social-detail="<?php echo $url . '_' . $key; ?>"><?php echo $count; ?></div>
268
+ <?php
269
+ } ?>
270
+ </a>
271
+ </div>
272
+ <?php
273
+ break;
274
 
275
+ //couter available for linkedin
276
+ case 'linkedin':
277
+ $link = "http://www.linkedin.com/shareArticle?mini=true&amp;title=" . $title . "&amp;url=" . $url . "&amp;summary=" . $excerpt;
278
+ $count = $this->get_count( $key, $url );
279
+ ////////////////////////////////////////
280
+ if(isset($http_url_checked) && $http_url_checked=='1'){
281
+ $url_check = parse_url($url);
282
+ if($url_check['scheme'] == 'https'){
283
+ $flag=TRUE;
284
+ }else{
285
+ $flag=FALSE;
286
+ }
287
 
288
+ if($flag == TRUE){
289
+ $url1 = APSS_Class:: get_http_url($url);
290
+ $http_count = APSS_Class:: get_count($key, $url1);
291
+ if($count != $http_count){
292
+ $count += $http_count;
293
+ }else{
294
+ $count = $count;
295
+ }
296
+ }
297
  }
298
+ ///////////////////////////////////////////
299
+ ?>
300
+ <div class='apss-linkedin apss-single-icon'>
301
+ <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window(event, '<?php echo $link; ?>');" <?php } ?> title='<?php _e( 'Share on LinkedIn', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
302
+ <div class='apss-icon-block clearfix'><i class='fa fa-linkedin'></i>
303
+ <span class='apss-social-text'><?php _e( 'Share on LinkedIn', 'accesspress-social-share' ); ?></span>
304
+ <span class='apss-share'><?php _e( 'Share', 'accesspress-social-share' ); ?></span>
305
+ </div>
 
306
 
 
 
 
307
  <?php
308
+ if ( isset( $counter_enable_options ) && $counter_enable_options == '1' ) { ?>
309
+ <div class='count apss-count' data-url='<?php echo $url; ?>' data-social-network='<?php echo $key; ?>' data-social-detail="<?php echo $url . '_' . $key; ?>"><?php echo $count; ?></div>
310
+ <?php
311
+ } ?>
312
 
313
+ </a>
314
+ </div>
315
+ <?php
316
+ break;
317
 
318
+ //there is no counter available for digg
319
+ case 'digg':
320
+ $link = "http://digg.com/submit?phase=2%20&amp;url=" . $url . "&amp;title=" . $title;
321
+ ?>
322
+ <div class='apss-digg apss-single-icon'>
323
+ <a rel='nofollow' <?php if($apss_link_open_option_value == 2){ ?> onclick="apss_open_in_popup_window(event, '<?php echo $link; ?>');" <?php } ?> title='<?php _e( 'Share on Digg', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
324
+ <div class='apss-icon-block clearfix'>
325
+ <i class='fa fa-digg'></i>
326
+ <span class='apss-social-text'><?php _e( 'Share on Digg', 'accesspress-social-share' ); ?></span>
327
+ <span class='apss-share'><?php _e( 'Share', 'accesspress-social-share' ); ?></span>
328
+ </div>
329
+ </a>
330
+ </div>
331
+ <?php
332
+ break;
333
 
334
+ case 'email':
335
+ if ( strpos( $options['apss_email_body'], '%%' ) || strpos( $options['apss_email_subject'], '%%' ) ) {
336
+ $link = 'mailto:?subject=' . $options['apss_email_subject'] . '&amp;body=' . $options['apss_email_body'];
337
+ $link = preg_replace( array( '#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#', '#%%url%%#' ), array( $title, get_site_url(), get_permalink(), $url ), $link );
338
+ } else {
339
+ $link = 'mailto:?subject=' . $options['apss_email_subject'] . '&amp;body=' . $options['apss_email_body'] . ": " . $url;
340
+ }
341
+ ?>
342
+ <div class='apss-email apss-single-icon'>
343
+ <a rel='nofollow' class='share-email-popup' title='<?php _e( 'Share it on Email', 'accesspress-social-share' ); ?>' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
344
+ <div class='apss-icon-block clearfix'>
345
+ <i class='fa fa-envelope'></i>
346
+ <span class='apss-social-text'><?php _e( 'Send email', 'accesspress-social-share' ); ?></span>
347
+ <span class='apss-share'><?php _e( 'Mail', 'accesspress-social-share' ); ?></span>
348
+ </div>
349
+ </a>
350
+ </div>
351
+ <?php
352
+ break;
353
 
354
+ case 'print':
355
+ ?>
356
+ <div class='apss-print apss-single-icon'>
357
+ <a rel='nofollow' title='<?php _e( 'Print', 'accesspress-social-share' ); ?>' href='javascript:void(0);' onclick='window.print(); return false;'>
358
+ <div class='apss-icon-block clearfix'><i class='fa fa-print'></i>
359
+ <span class='apss-social-text'><?php _e( 'Print', 'accesspress-social-share' ); ?></span>
360
+ <span class='apss-share'><?php _e( 'Print', 'accesspress-social-share' ); ?></span>
361
+ </div>
362
+ </a>
363
+ </div>
364
+ <?php
365
+ break;
366
+ }
367
  }
368
  }
 
369
 
370
+ do_action('apss_more_networks_in_shortcodes');
371
 
372
+ if ( isset( $total_counter_enable_options ) && $total_counter_enable_options == '1' ) {
373
+ ?>
374
+ <div class='apss-total-share-count'>
375
+ <span class='apss-count-number'><?php echo $total_count; ?></span>
376
+ <div class="apss-total-shares"><span class='apss-total-text'><?php echo _e( ' Total', 'accesspress-social-share' ); ?></span>
377
+ <span class='apss-shares-text'><?php echo _e( ' Shares', 'accesspress-social-share' ); ?></span></div>
378
+ </div>
379
+ <?php
380
+ } ?>
381
+ </div>
382
+ <?php
383
+ }
384
+ ?>
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.7
7
- Stable tag: 4.3.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -145,6 +145,10 @@ Yes. You can use the AccessPress social share by using shortcode anywhere you wa
145
  6. Backend Miscellaneous Settings Section
146
 
147
  == Changelog ==
 
 
 
 
148
  = 4.3.2 =
149
  * Done the bug fixings for the facebook share counts using access token.
150
 
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
  Tested up to: 4.7
7
+ Stable tag: 4.3.3
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
145
  6. Backend Miscellaneous Settings Section
146
 
147
  == Changelog ==
148
+ = 4.3.3 =
149
+ * Done the bug fixings for the AMP version removed the share icons from the amp version pages.
150
+ * Updated the fontawesome icons version to 4.7.0
151
+
152
  = 4.3.2 =
153
  * Done the bug fixings for the facebook share counts using access token.
154