Social Counter for WordPress – AccessPress Social Counter - Version 1.3.0

Version Description

  • Added Shortcode [aps-get-count social_media="name of social media"] to get the individual social media count only
Download this release

Release Info

Developer Access Keys
Plugin Icon 128x128 Social Counter for WordPress – AccessPress Social Counter
Version 1.3.0
Comparing to
See all releases

Code changes from version 1.2.0 to 1.3.0

accesspress-social-counter.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: AccessPress Social Counter
4
  * Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-social-counter/
5
  * Description: A plugin to display your social accounts fans, subscribers and followers number on your website with handful of backend settings and interface.
6
- * Version: 1.2.0
7
  * Author: AccessPress Themes
8
  * Author URI: http://accesspressthemes.com
9
  * Text Domain: aps-counter
@@ -24,7 +24,7 @@ if (!defined('SC_CSS_DIR')) {
24
  define('SC_CSS_DIR', plugin_dir_url(__FILE__) . 'css');
25
  }
26
  if (!defined('SC_VERSION')) {
27
- define('SC_VERSION', '1.2.0');
28
  }
29
  /**
30
  * Register of widgets
@@ -51,6 +51,7 @@ if (!class_exists('SC_Class')) {
51
  add_action('admin_post_apsc_restore_default', array($this, 'apsc_restore_default')); //restores default settings;
52
  add_action('widgets_init', array($this, 'register_apsc_widget')); //registers the widget
53
  add_shortcode('aps-counter', array($this, 'apsc_shortcode')); //adds a shortcode
 
54
  add_action('admin_post_apsc_delete_cache', array($this, 'apsc_delete_cache')); //deletes the counter values from cache
55
  }
56
 
@@ -367,6 +368,204 @@ if (!class_exists('SC_Class')) {
367
  return $response[0]->like_count;
368
 
369
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
370
 
371
 
372
  }
3
  * Plugin Name: AccessPress Social Counter
4
  * Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-social-counter/
5
  * Description: A plugin to display your social accounts fans, subscribers and followers number on your website with handful of backend settings and interface.
6
+ * Version: 1.3.0
7
  * Author: AccessPress Themes
8
  * Author URI: http://accesspressthemes.com
9
  * Text Domain: aps-counter
24
  define('SC_CSS_DIR', plugin_dir_url(__FILE__) . 'css');
25
  }
26
  if (!defined('SC_VERSION')) {
27
+ define('SC_VERSION', '1.3.0');
28
  }
29
  /**
30
  * Register of widgets
51
  add_action('admin_post_apsc_restore_default', array($this, 'apsc_restore_default')); //restores default settings;
52
  add_action('widgets_init', array($this, 'register_apsc_widget')); //registers the widget
53
  add_shortcode('aps-counter', array($this, 'apsc_shortcode')); //adds a shortcode
54
+ add_shortcode('aps-get-count',array($this,'apsc_count_shortcode')); //
55
  add_action('admin_post_apsc_delete_cache', array($this, 'apsc_delete_cache')); //deletes the counter values from cache
56
  }
57
 
368
  return $response[0]->like_count;
369
 
370
  }
371
+
372
+ function get_count($social_media){
373
+ $count = 0;
374
+ $apsc_settings = $this->apsc_settings;
375
+ switch($social_media){
376
+ case 'facebook':
377
+ $facebook_page_id = $apsc_settings['social_profile']['facebook']['page_id'];
378
+ $facebook_count = get_transient('apsc_facebook');
379
+ if (false === $facebook_count) {
380
+
381
+ $api_url = 'https://www.facebook.com/' . $facebook_page_id;
382
+
383
+ $count = $this->facebook_count($api_url);
384
+ set_transient('apsc_facebook', $count, $cache_period);
385
+
386
+ } else {
387
+ $count = $facebook_count;
388
+ }
389
+
390
+
391
+ break;
392
+ case 'twitter':
393
+
394
+ $twitter_count = get_transient('apsc_twitter');
395
+ if (false === $twitter_count) {
396
+ $count = ($this->get_twitter_count());
397
+ set_transient('apsc_twitter', $count, $cache_period);
398
+ } else {
399
+ $count = $twitter_count;
400
+ }
401
+
402
+
403
+ break;
404
+ case 'googlePlus':
405
+ $social_profile_url = 'https://plus.google.com/' . $apsc_settings['social_profile']['googlePlus']['page_id'];
406
+
407
+ $googlePlus_count = get_transient('apsc_googlePlus');
408
+ if (false === $googlePlus_count) {
409
+ $api_url = 'https://www.googleapis.com/plus/v1/people/' . $apsc_settings['social_profile']['googlePlus']['page_id'] . '?key=' . $apsc_settings['social_profile']['googlePlus']['api_key'];
410
+ $params = array(
411
+ 'sslverify' => false,
412
+ 'timeout' => 60
413
+ );
414
+ $connection = wp_remote_get($api_url, $params);
415
+
416
+ if (is_wp_error($connection)) {
417
+ $count = 0;
418
+ } else {
419
+ $_data = json_decode($connection['body'], true);
420
+
421
+ if (isset($_data['circledByCount'])) {
422
+ $count = (intval($_data['circledByCount']));
423
+ set_transient('apsc_googlePlus', $count,$cache_period);
424
+ } else {
425
+ $count = 0;
426
+ }
427
+ }
428
+ } else {
429
+ $count = $googlePlus_count;
430
+ }
431
+
432
+ break;
433
+ case 'instagram':
434
+ $username = $apsc_settings['social_profile']['instagram']['username'];
435
+ $user_id = $apsc_settings['social_profile']['instagram']['user_id'];
436
+ $social_profile_url = 'https://instagram.com/' . $username;
437
+
438
+ $instagram_count = get_transient('apsc_instagram');
439
+ if (false === $instagram_count) {
440
+ $access_token = $apsc_settings['social_profile']['instagram']['access_token'];
441
+
442
+ $api_url = 'https://api.instagram.com/v1/users/' . $user_id . '?access_token=' . $access_token;
443
+ $params = array(
444
+ 'sslverify' => false,
445
+ 'timeout' => 60
446
+ );
447
+ $connection = wp_remote_get($api_url, $params);
448
+ if (is_wp_error($connection)) {
449
+ $count = 0;
450
+ } else {
451
+ $response = json_decode($connection['body'], true);
452
+ if (
453
+ isset($response['meta']['code']) && 200 == $response['meta']['code'] && isset($response['data']['counts']['followed_by'])
454
+ ) {
455
+ $count = (intval($response['data']['counts']['followed_by']));
456
+ set_transient('apsc_instagram',$count,$cache_period);
457
+ } else {
458
+ $count = 0;
459
+ }
460
+ }
461
+ } else {
462
+ $count = $instagram_count;
463
+ }
464
+
465
+ break;
466
+ case 'youtube':
467
+ $social_profile_url = esc_url($apsc_settings['social_profile']['youtube']['channel_url']);
468
+ $count = $apsc_settings['social_profile']['youtube']['subscribers_count'];
469
+
470
+ break;
471
+ case 'soundcloud':
472
+ $username = $apsc_settings['social_profile']['soundcloud']['username'];
473
+ $social_profile_url = 'https://soundcloud.com/' . $username;
474
+
475
+ $soundcloud_count = get_transient('apsc_soundcloud');
476
+ if (false === $soundcloud_count) {
477
+ $api_url = 'https://api.soundcloud.com/users/' . $username . '.json?client_id=' . $apsc_settings['social_profile']['soundcloud']['client_id'];
478
+ $params = array(
479
+ 'sslverify' => false,
480
+ 'timeout' => 60
481
+ );
482
+
483
+ $connection = wp_remote_get($api_url, $params);
484
+ if (is_wp_error($connection)) {
485
+ $count = 0;
486
+ } else {
487
+ $response = json_decode($connection['body'], true);
488
+
489
+ if (isset($response['followers_count'])) {
490
+ $count = (intval($response['followers_count']));
491
+ set_transient( 'apsc_soundcloud',$count,$cache_period );
492
+ } else {
493
+ $count = 0;
494
+ }
495
+ }
496
+ } else {
497
+ $count = $soundcloud_count;
498
+ }
499
+
500
+ break;
501
+ case 'dribbble':
502
+ $social_profile_url = 'http://dribbble.com/'.$apsc_settings['social_profile']['dribbble']['username'];
503
+
504
+ $dribbble_count = get_transient('apsc_dribbble');
505
+ if (false === $dribbble_count) {
506
+ $username = $apsc_settings['social_profile']['dribbble']['username'];
507
+ $api_url = 'http://api.dribbble.com/' . $username;
508
+ $params = array(
509
+ 'sslverify' => false,
510
+ 'timeout' => 60
511
+ );
512
+ $connection = wp_remote_get($api_url, $params);
513
+ if (is_wp_error($connection)) {
514
+ $count = 0;
515
+ } else {
516
+ $response = json_decode($connection['body'], true);
517
+ if (isset($response['followers_count'])) {
518
+ $count = (intval($response['followers_count']));
519
+ set_transient('apsc_dribbble',$count,$cache_period );
520
+ } else {
521
+ $count = 0;
522
+ }
523
+ }
524
+ } else {
525
+ $count = $dribbble_count;
526
+ }
527
+
528
+ break;
529
+ case 'posts':
530
+
531
+ $posts_count = get_transient('apsc_posts');
532
+ if (false === $posts_count) {
533
+ $posts_count = wp_count_posts();
534
+ $count = $posts_count->publish;
535
+ set_transient('apsc_posts', $count, $cache_period);
536
+ } else {
537
+ $count = $posts_count;
538
+ }
539
+
540
+ break;
541
+ case 'comments':
542
+
543
+ $comments_count = get_transient('apsc_comments');
544
+ if (false === $comments_count) {
545
+ $data = wp_count_comments();
546
+ $count = ($data->approved);
547
+ set_transient('apsc_comments', $count, $cache_period);
548
+ } else {
549
+ $count = $comments_count;
550
+ }
551
+
552
+ break;
553
+ default:
554
+ break;
555
+ }
556
+ return $count;
557
+ }
558
+
559
+ /**
560
+ *
561
+ * Counter Only Shortcode
562
+ * */
563
+ function apsc_count_shortcode($atts){
564
+ if(isset($atts['social_media'])){
565
+ $count = $this->get_count($atts['social_media']);
566
+ return $count;
567
+ }
568
+ }
569
 
570
 
571
  }
css/backend.css CHANGED
@@ -740,7 +740,6 @@ padding: 1px 12px;
740
  background-color: #FFFBCC;
741
  padding: 10px;
742
  font-style: italic;
743
- font-size: 15px;
744
  margin-bottom: 25px;
745
- margin-top: -10px;
746
  }
740
  background-color: #FFFBCC;
741
  padding: 10px;
742
  font-style: italic;
 
743
  margin-bottom: 25px;
744
+ margin-top: 25px;
745
  }
inc/backend/boards/how-to-use.php CHANGED
@@ -2,5 +2,8 @@
2
  <div class="apsc-tab-wrapper">
3
  <p>To display the social profiles with counter, you can either use [aps-counter] <strong>Shortcode</strong> or you can use <strong>AccessPress Social Counter Widget</strong> from Appearance's widget section.</p>
4
  <p>For the complete documentation please visit:<br/> <a href="https://accesspressthemes.com/documentation/documentation-plugin-instruction-accesspress-social-counter/" target="_blank">https://accesspressthemes.com/documentation/documentation-plugin-instruction-accesspress-social-counter/</a></p>
 
 
 
5
  </div>
6
  </div>
2
  <div class="apsc-tab-wrapper">
3
  <p>To display the social profiles with counter, you can either use [aps-counter] <strong>Shortcode</strong> or you can use <strong>AccessPress Social Counter Widget</strong> from Appearance's widget section.</p>
4
  <p>For the complete documentation please visit:<br/> <a href="https://accesspressthemes.com/documentation/documentation-plugin-instruction-accesspress-social-counter/" target="_blank">https://accesspressthemes.com/documentation/documentation-plugin-instruction-accesspress-social-counter/</a></p>
5
+ <p>To get the individual count, please use below shortcode</p>
6
+ [aps-get-count social_media="facebook/twitter/googlePlus/instagram/youtube/soundcloud/dribbble/posts/comments"]
7
+
8
  </div>
9
  </div>
inc/backend/boards/social-profiles.php CHANGED
@@ -13,9 +13,11 @@
13
  <div class="apsc-option-field">
14
  <input type="text" name="social_profile[facebook][page_id]" value="<?php echo $apsc_settings['social_profile']['facebook']['page_id'];?>"/>
15
  <div class="apsc-option-note"><?php _e('Please enter the page ID or page name.For example:If your page url is https://www.facebook.com/AccessPressThemes then your page ID is AccessPressThemes.You can also find your Facebook Page ID from <a href="http://findmyfacebookid.com/" target="_blank">http://findmyfacebookid.com/</a>', 'aps-counter'); ?></div>
 
16
  </div>
17
  </div>
18
  </div>
 
19
  </div>
20
  <!---Facebook-->
21
 
@@ -64,6 +66,7 @@
64
  </div>
65
 
66
  </div>
 
67
  </div>
68
  <!--Twitter-->
69
 
@@ -90,6 +93,7 @@
90
  </div>
91
  </div>
92
  </div>
 
93
  </div>
94
  <!--Google Plus-->
95
 
@@ -123,6 +127,7 @@
123
  </div>
124
  </div>
125
  </div>
 
126
  </div>
127
  <!--Instagram-->
128
 
@@ -159,6 +164,7 @@
159
  </div>
160
  </div>
161
  </div>
 
162
  </div>
163
  <!--Youtube-->
164
 
@@ -185,6 +191,7 @@
185
  </div>
186
  </div>
187
  </div>
 
188
  </div>
189
  <!--Sound Cloud-->
190
 
@@ -204,6 +211,7 @@
204
  </div>
205
  </div>
206
  </div>
 
207
  </div>
208
  <!--Dribbble-->
209
 
@@ -214,6 +222,7 @@
214
  <label><?php _e('Display Counter','aps-counter');?></label>
215
  <div class="apsc-option-field"><label><input type="checkbox" name="social_profile[posts][active]" value="1" class="apsc-counter-activation-trigger" <?php if(isset($apsc_settings['social_profile']['posts']['active'])){?>checked="checked"<?php } ?>/><?php _e('Show/Hide', 'aps-counter'); ?></label></div>
216
  </div>
 
217
  </div>
218
  <!--Posts-->
219
 
@@ -224,6 +233,7 @@
224
  <label><?php _e('Display Counter','aps-counter');?></label>
225
  <div class="apsc-option-field"><label><input type="checkbox" name="social_profile[comments][active]" value="1" class="apsc-counter-activation-trigger" <?php if(isset($apsc_settings['social_profile']['comments']['active'])){?>checked="checked"<?php } ?>/><?php _e('Show/Hide', 'aps-counter'); ?></label></div>
226
  </div>
 
227
  </div>
228
  <!--Comments-->
229
 
13
  <div class="apsc-option-field">
14
  <input type="text" name="social_profile[facebook][page_id]" value="<?php echo $apsc_settings['social_profile']['facebook']['page_id'];?>"/>
15
  <div class="apsc-option-note"><?php _e('Please enter the page ID or page name.For example:If your page url is https://www.facebook.com/AccessPressThemes then your page ID is AccessPressThemes.You can also find your Facebook Page ID from <a href="http://findmyfacebookid.com/" target="_blank">http://findmyfacebookid.com/</a>', 'aps-counter'); ?></div>
16
+
17
  </div>
18
  </div>
19
  </div>
20
+ <div class="apsc-extra-note"><?php _e('Please use: [aps-get-count social_media="facebook"] to get the Facebook Count only');?></div>
21
  </div>
22
  <!---Facebook-->
23
 
66
  </div>
67
 
68
  </div>
69
+ <div class="apsc-extra-note"><?php _e('Please use: [aps-get-count social_media="twitter"] to get the Twitter Count only');?></div>
70
  </div>
71
  <!--Twitter-->
72
 
93
  </div>
94
  </div>
95
  </div>
96
+ <div class="apsc-extra-note"><?php _e('Please use: [aps-get-count social_media="googlePlus"] to get the Google Plus Count only');?></div>
97
  </div>
98
  <!--Google Plus-->
99
 
127
  </div>
128
  </div>
129
  </div>
130
+ <div class="apsc-extra-note"><?php _e('Please use: [aps-get-count social_media="instagram"] to get the Instagram Count only');?></div>
131
  </div>
132
  <!--Instagram-->
133
 
164
  </div>
165
  </div>
166
  </div>
167
+ <div class="apsc-extra-note"><?php _e('Please use: [aps-get-count social_media="youtube"] to get the Youtube Count only');?></div>
168
  </div>
169
  <!--Youtube-->
170
 
191
  </div>
192
  </div>
193
  </div>
194
+ <div class="apsc-extra-note"><?php _e('Please use: [aps-get-count social_media="soundcloud"] to get the SoundCloud Count only');?></div>
195
  </div>
196
  <!--Sound Cloud-->
197
 
211
  </div>
212
  </div>
213
  </div>
214
+ <div class="apsc-extra-note"><?php _e('Please use: [aps-get-count social_media="dribbble"] to get the Dribbble Count only');?></div>
215
  </div>
216
  <!--Dribbble-->
217
 
222
  <label><?php _e('Display Counter','aps-counter');?></label>
223
  <div class="apsc-option-field"><label><input type="checkbox" name="social_profile[posts][active]" value="1" class="apsc-counter-activation-trigger" <?php if(isset($apsc_settings['social_profile']['posts']['active'])){?>checked="checked"<?php } ?>/><?php _e('Show/Hide', 'aps-counter'); ?></label></div>
224
  </div>
225
+ <div class="apsc-extra-note"><?php _e('Please use: [aps-get-count social_media="posts"] to get the Posts Count only');?></div>
226
  </div>
227
  <!--Posts-->
228
 
233
  <label><?php _e('Display Counter','aps-counter');?></label>
234
  <div class="apsc-option-field"><label><input type="checkbox" name="social_profile[comments][active]" value="1" class="apsc-counter-activation-trigger" <?php if(isset($apsc_settings['social_profile']['comments']['active'])){?>checked="checked"<?php } ?>/><?php _e('Show/Hide', 'aps-counter'); ?></label></div>
235
  </div>
236
+ <div class="apsc-extra-note"><?php _e('Please use: [aps-get-count social_media="comments"] to get the Comments Count only');?></div>
237
  </div>
238
  <!--Comments-->
239
 
inc/backend/settings.php CHANGED
@@ -34,6 +34,8 @@ $apsc_settings = $this->apsc_settings;
34
 
35
  <div class="apsc-title"><?php _e('AccessPress Social Counter', 'aps-counter'); ?></div>
36
  </div>
 
 
37
  <?php if(isset($_SESSION['apsc_message'])){?><div class="apsc-success-message"><p><?php echo $_SESSION['apsc_message'];unset($_SESSION['apsc_message']);?></p></div><?php }?>
38
  <div class="apsc-boards-wrapper">
39
  <ul class="apsc-settings-tabs">
34
 
35
  <div class="apsc-title"><?php _e('AccessPress Social Counter', 'aps-counter'); ?></div>
36
  </div>
37
+ <div class="apsc-extra-note"><?php _e('Note: If you find any unsual issues then please check by deleting cache using the "Delete Cache" button below.And if you found our plugin helpful and like our plugin then please don\'t forget to give us a rating <a href="https://wordpress.org/plugins/accesspress-social-counter">here</a>.Its the only way to keep us motivated to make the plugin even better.
38
+ ','aps-counter');?></div>
39
  <?php if(isset($_SESSION['apsc_message'])){?><div class="apsc-success-message"><p><?php echo $_SESSION['apsc_message'];unset($_SESSION['apsc_message']);?></p></div><?php }?>
40
  <div class="apsc-boards-wrapper">
41
  <ul class="apsc-settings-tabs">
inc/frontend/shortcode.php CHANGED
@@ -30,7 +30,7 @@ $format = isset($apsc_settings['counter_format'])?$apsc_settings['counter_format
30
  } else {
31
  $count = $facebook_count;
32
  }
33
- $count = $this->get_formatted_count($count,$format);
34
  ?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Fans</span></div></a>
35
  <?php
36
  break;
@@ -45,7 +45,7 @@ $format = isset($apsc_settings['counter_format'])?$apsc_settings['counter_format
45
  } else {
46
  $count = $twitter_count;
47
  }
48
- $count = $this->get_formatted_count($count,$format);
49
  ?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Followers</span></div></a><?php
50
  break;
51
  case 'googlePlus':
@@ -77,7 +77,7 @@ $format = isset($apsc_settings['counter_format'])?$apsc_settings['counter_format
77
  } else {
78
  $count = $googlePlus_count;
79
  }
80
- $count = $this->get_formatted_count($count,$format);
81
  ?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Followers</span></div></a><?php
82
  break;
83
  case 'instagram':
@@ -113,7 +113,7 @@ $format = isset($apsc_settings['counter_format'])?$apsc_settings['counter_format
113
  } else {
114
  $count = $instagram_count;
115
  }
116
- $count = $this->get_formatted_count($count,$format);
117
  ?>
118
  <span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Followers</span></div></a>
119
  <?php
@@ -124,7 +124,7 @@ $format = isset($apsc_settings['counter_format'])?$apsc_settings['counter_format
124
  <a class="apsc-youtube-icon clearfix" href="<?php echo $social_profile_url; ?>" target="_blank"><div class="apsc-inner-block"><span class="social-icon"><i class="apsc-youtube fa fa-youtube"></i><span class="media-name">Youtube</span></span>
125
  <?php
126
  $youtube_count = $apsc_settings['social_profile']['youtube']['subscribers_count'];
127
- $count = $this->get_formatted_count($youtube_count,$format);
128
  ?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Subscriber</span></div></a><?php
129
  break;
130
  case 'soundcloud':
@@ -157,7 +157,7 @@ $format = isset($apsc_settings['counter_format'])?$apsc_settings['counter_format
157
  } else {
158
  $count = $soundcloud_count;
159
  }
160
- $count = $this->get_formatted_count($count,$format);
161
  ?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Followers</span></div></a><?php
162
  break;
163
  case 'dribbble':
@@ -188,7 +188,8 @@ $format = isset($apsc_settings['counter_format'])?$apsc_settings['counter_format
188
  } else {
189
  $count = $dribbble_count;
190
  }
191
- $count = $this->get_formatted_count($count,$format);
 
192
  ?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Followers</span></div></a><?php
193
  break;
194
  case 'posts':
@@ -203,7 +204,7 @@ $format = isset($apsc_settings['counter_format'])?$apsc_settings['counter_format
203
  } else {
204
  $count = $posts_count;
205
  }
206
- $count = $this->get_formatted_count($count,$format);
207
  ?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Post</span></div></a><?php
208
  break;
209
  case 'comments':
@@ -218,7 +219,7 @@ $format = isset($apsc_settings['counter_format'])?$apsc_settings['counter_format
218
  } else {
219
  $count = $comments_count;
220
  }
221
- $count = $this->get_formatted_count($count,$format);
222
  ?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Comments</span></div></a><?php
223
  break;
224
  default:
30
  } else {
31
  $count = $facebook_count;
32
  }
33
+ $count = ($count!='')?$this->get_formatted_count($count,$format):0;
34
  ?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Fans</span></div></a>
35
  <?php
36
  break;
45
  } else {
46
  $count = $twitter_count;
47
  }
48
+ $count = ($count!='')?$this->get_formatted_count($count,$format):0;
49
  ?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Followers</span></div></a><?php
50
  break;
51
  case 'googlePlus':
77
  } else {
78
  $count = $googlePlus_count;
79
  }
80
+ $count = ($count!='')?$this->get_formatted_count($count,$format):0;
81
  ?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Followers</span></div></a><?php
82
  break;
83
  case 'instagram':
113
  } else {
114
  $count = $instagram_count;
115
  }
116
+ $count = ($count!='')?$this->get_formatted_count($count,$format):0;
117
  ?>
118
  <span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Followers</span></div></a>
119
  <?php
124
  <a class="apsc-youtube-icon clearfix" href="<?php echo $social_profile_url; ?>" target="_blank"><div class="apsc-inner-block"><span class="social-icon"><i class="apsc-youtube fa fa-youtube"></i><span class="media-name">Youtube</span></span>
125
  <?php
126
  $youtube_count = $apsc_settings['social_profile']['youtube']['subscribers_count'];
127
+ $count = ($count!='')?$this->get_formatted_count($youtube_count,$format):0;
128
  ?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Subscriber</span></div></a><?php
129
  break;
130
  case 'soundcloud':
157
  } else {
158
  $count = $soundcloud_count;
159
  }
160
+ $count = ($count!='')?$this->get_formatted_count($count,$format):0;
161
  ?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Followers</span></div></a><?php
162
  break;
163
  case 'dribbble':
188
  } else {
189
  $count = $dribbble_count;
190
  }
191
+
192
+ $count = ($count!='')?$this->get_formatted_count($count,$format):0;
193
  ?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Followers</span></div></a><?php
194
  break;
195
  case 'posts':
204
  } else {
205
  $count = $posts_count;
206
  }
207
+ $count = ($count!='')?$this->get_formatted_count($count,$format):0;
208
  ?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Post</span></div></a><?php
209
  break;
210
  case 'comments':
219
  } else {
220
  $count = $comments_count;
221
  }
222
+ $count = ($count!='')?$this->get_formatted_count($count,$format):0;
223
  ?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Comments</span></div></a><?php
224
  break;
225
  default:
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: social count, social counter, social counters, social media counters, soci
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
  Tested up to: 4.2
7
- Stable tag: 1.2.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -125,6 +125,9 @@ Once you install the plugin , you can check some general documentation about how
125
  5. Backend Cache Settings Section
126
 
127
  == Changelog ==
 
 
 
128
  = 1.2.0 =
129
  * Updated Facebook API
130
  * Added Youtube Subscribers field for mannual count
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
  Tested up to: 4.2
7
+ Stable tag: 1.3.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
125
  5. Backend Cache Settings Section
126
 
127
  == Changelog ==
128
+ = 1.3.0 =
129
+ * Added Shortcode [aps-get-count social_media="name of social media"] to get the individual social media count only
130
+
131
  = 1.2.0 =
132
  * Updated Facebook API
133
  * Added Youtube Subscribers field for mannual count