Social Counter for WordPress – AccessPress Social Counter - Version 1.8.9

Version Description

  • Solved facebook page follower count issue.
  • Added new settings for instagram and dribbble to fetch follower count.
  • WordPress latest version compatibility checked.
Download this release

Release Info

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

Code changes from version 1.8.8 to 1.8.9

accesspress-social-counter.php CHANGED
@@ -6,7 +6,7 @@ defined( 'ABSPATH' ) or die( "No script kiddies please!" );
6
  * Plugin Name: AccessPress Social Counter
7
  * Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-social-counter/
8
  * Description: A plugin to display your social accounts fans, subscribers and followers number on your website with handful of backend settings and interface.
9
- * Version: 1.8.8
10
  * Author: AccessPress Themes
11
  * Author URI: http://accesspressthemes.com
12
  * Text Domain: aps-counter
@@ -29,7 +29,7 @@ if ( ! defined( 'SC_CSS_DIR' ) ) {
29
  }
30
 
31
  if ( ! defined( 'SC_VERSION' ) ) {
32
- define( 'SC_VERSION', '1.8.8' );
33
  }
34
 
35
  if ( ! defined( 'SC_PATH' ) ) {
@@ -43,8 +43,7 @@ defined('APSC_LITE_DETAIL') or define('APSC_LITE_DETAIL', 'https://accesspressth
43
  defined('APSC_LITE_RATING') or define('APSC_LITE_RATING', 'https://wordpress.org/support/plugin/accesspress-social-counter/reviews/#new-post');
44
 
45
  defined('APSC_PRO_PLUGIN_NAME') or define('APSC_PRO_PLUGIN_NAME', 'AccessPress Social Pro');
46
- defined('APSC_PRO_LINK') or define('APSC_PRO_LINK','https://1.envato.market/c/1302794/275988/4415?u=https%3A%2F%2Fcodecanyon.net%2Fitem%2Faccesspress-social-pro%2F10429645
47
- ');
48
  defined('APSC_PRO_DEMO') or define('APSC_PRO_DEMO', 'http://demo.accesspressthemes.com/wordpress-plugins/accesspress-social-pro');
49
  defined('APSC_PRO_DETAIL') or define('APSC_PRO_DETAIL', 'https://accesspressthemes.com/wordpress-plugins/accesspress-social-pro/');
50
 
@@ -192,14 +191,19 @@ if ( ! class_exists( 'SC_Class' ) ) {
192
  'consumer_secret' => '',
193
  'access_token' => '',
194
  'access_token_secret' => '' ),
195
- 'instagram' => array('username' => '',
 
 
196
  'access_token' => '',
197
  'user_id' => '' ),
198
  'youtube' => array( 'username' => '',
199
  'channel_url' => '' ),
200
  'soundcloud' => array( 'username' => '',
201
  'client_id' => '' ),
202
- 'dribbble' => array( 'username' => '' ),
 
 
 
203
  ),
204
  'profile_order' => array( 'facebook', 'twitter', 'instagram', 'youtube', 'soundcloud', 'dribbble', 'posts', 'comments' ),
205
  'social_profile_theme' => 'theme-1',
6
  * Plugin Name: AccessPress Social Counter
7
  * Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-social-counter/
8
  * Description: A plugin to display your social accounts fans, subscribers and followers number on your website with handful of backend settings and interface.
9
+ * Version: 1.8.9
10
  * Author: AccessPress Themes
11
  * Author URI: http://accesspressthemes.com
12
  * Text Domain: aps-counter
29
  }
30
 
31
  if ( ! defined( 'SC_VERSION' ) ) {
32
+ define( 'SC_VERSION', '1.8.9' );
33
  }
34
 
35
  if ( ! defined( 'SC_PATH' ) ) {
43
  defined('APSC_LITE_RATING') or define('APSC_LITE_RATING', 'https://wordpress.org/support/plugin/accesspress-social-counter/reviews/#new-post');
44
 
45
  defined('APSC_PRO_PLUGIN_NAME') or define('APSC_PRO_PLUGIN_NAME', 'AccessPress Social Pro');
46
+ defined('APSC_PRO_LINK') or define('APSC_PRO_LINK','https://accesspressthemes.com/wordpress-plugins/accesspress-social-pro/');
 
47
  defined('APSC_PRO_DEMO') or define('APSC_PRO_DEMO', 'http://demo.accesspressthemes.com/wordpress-plugins/accesspress-social-pro');
48
  defined('APSC_PRO_DETAIL') or define('APSC_PRO_DETAIL', 'https://accesspressthemes.com/wordpress-plugins/accesspress-social-pro/');
49
 
191
  'consumer_secret' => '',
192
  'access_token' => '',
193
  'access_token_secret' => '' ),
194
+ 'instagram' => array('app_id' => '',
195
+ 'app_secret' => '',
196
+ 'username' => '',
197
  'access_token' => '',
198
  'user_id' => '' ),
199
  'youtube' => array( 'username' => '',
200
  'channel_url' => '' ),
201
  'soundcloud' => array( 'username' => '',
202
  'client_id' => '' ),
203
+ 'dribbble' => array( 'client_id' => '',
204
+ 'client_secret' => '',
205
+ 'username' => '',
206
+ 'access_token' => ''),
207
  ),
208
  'profile_order' => array( 'facebook', 'twitter', 'instagram', 'youtube', 'soundcloud', 'dribbble', 'posts', 'comments' ),
209
  'social_profile_theme' => 'theme-1',
css/backend.css CHANGED
@@ -852,7 +852,17 @@ span.apsc-option-trigger {
852
  .nav-tab {
853
  margin-top: 0.5em;
854
  }
855
-
 
 
 
 
 
 
 
 
 
 
856
  @media screen and (max-width: 1076px) {
857
  .nav-tab {
858
  width: 40%;
852
  .nav-tab {
853
  margin-top: 0.5em;
854
  }
855
+ #get_token {
856
+ text-decoration: none;
857
+ background-color: #3d74f1;
858
+ color: #fff;
859
+ border: 1px solid #3d74f1;
860
+ height: 30px;
861
+ line-height: 30px;
862
+ padding: 0 10px;
863
+ margin: 10px 0px 10px 0;
864
+ display: inline-block;
865
+ }
866
  @media screen and (max-width: 1076px) {
867
  .nav-tab {
868
  width: 40%;
inc/backend/boards/about.php CHANGED
@@ -4,7 +4,7 @@
4
 
5
  <p><?php _e( 'AccessPress Themes is a venture of Access Keys - who has developed hundreds of Custom WordPress themes and plugins for its clients over the years.', 'accesspress-social-counter' ); ?> </p>
6
 
7
- <p><strong><?php _e( 'AccessPress Social Counter', 'accesspress-social-counter' ); ?></strong><?php _e( 'is a', 'accesspress-social-counter' ); ?> <strong><?php _e( 'Free WordPress plugin', 'accesspress-social-counter' ); ?>
8
  </strong><?php _e( 'to display your social accounts fans, subscribers and followers number on your website !
9
  A perfect plugin to show your social media stats and encourage more to join your network.
10
  You can select the social media profiles you want to activate, enter details of your social media and select one of the designs from beautifully designed 5 design themes.
@@ -36,26 +36,6 @@
36
 
37
 
38
  <div class = "halfseperator"></div>
39
- <h3 class = "sub-title"><?php _e( 'More from AccessPress Themes', 'accesspress-social-counter' ); ?></h3>
40
- <div class = "product">
41
- <a href = "http://accesspressthemes.com/plugins" target = "_blank">
42
- <span class = "product-title"><?php _e( 'WordPress Plugins', 'accesspress-social-counter' ); ?></span>
43
- <img src = "<?php echo SC_IMAGE_DIR; ?>/plugin.png" alt = "<?php esc_attr_e( 'WordPress Plugins', 'accesspress-social-counter' ); ?>" />
44
- </a>
45
- </div>
46
- <div class = "product">
47
- <a href = "http://accesspressthemes.com/wordpress-themes" target = "_blank">
48
- <span class = "product-title"><?php _e( 'WordPress Themes', 'accesspress-social-counter' ); ?></span>
49
- <img src = "<?php echo SC_IMAGE_DIR; ?>/theme.png" alt = "<?php esc_attr_e( 'WordPress Themes', 'accesspress-social-counter' ); ?>" />
50
- </a>
51
- </div>
52
-
53
- <div class = "product">
54
- <a href = "http://accesspressthemes.com/contact" target = "_blank">
55
- <span class = "product-title"><?php _e( 'WordPress Customization', 'accesspress-social-counter' ); ?></span>
56
- <img src = "<?php echo SC_IMAGE_DIR; ?>/customize.png" alt = "<?php esc_attr_e( 'WordPress Customization', 'accesspress-social-counter' ); ?>" />
57
- </a>
58
- </div>
59
 
60
  <div class = "seperator"></div><div class = "dottedline"></div><div class = "seperator"></div>
61
 
@@ -72,10 +52,6 @@
72
  <p><strong><?php _e( 'Like us on facebook', 'accesspress-social-counter' ); ?>:</strong><br />
73
  <iframe style = "border: none; overflow: hidden; width: 764px; height: 206px;" src = "//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FAccessPress-Themes%2F1396595907277967&amp;width=842&amp;height=258&amp;colorscheme=light&amp;show_faces=true&amp;header=false&amp;stream=false&amp;show_border=true&amp;appId=1411139805828592" width = "240" height = "150" frameborder = "0" scrolling = "no"></iframe></p>
74
 
75
- <ul class = "social-icon">
76
- <li><a href = "http://www.pinterest.com/accesspresswp/" target = "_blank"><img src = "<?php echo SC_IMAGE_DIR; ?>/pinterest.png" alt = "pinterest"></a></li>
77
- <li><a href = "https://www.flickr.com/photos/accesspressthemes/" target = "_blank"><img src = "<?php echo SC_IMAGE_DIR; ?>/flicker.png" alt = "flicker"></a></li>
78
- <li><a href = "https://twitter.com/apthemes" target = "_blank"><img src = "<?php echo SC_IMAGE_DIR; ?>/twitter.png" alt = "twitter"/></a></li>
79
- </ul>
80
  </div>
81
  </div>
4
 
5
  <p><?php _e( 'AccessPress Themes is a venture of Access Keys - who has developed hundreds of Custom WordPress themes and plugins for its clients over the years.', 'accesspress-social-counter' ); ?> </p>
6
 
7
+ <p><strong><?php _e( 'AccessPress Social Counter', 'accesspress-social-counter' ); ?></strong><?php _e( ' is a', 'accesspress-social-counter' ); ?> <strong><?php _e( 'Free WordPress plugin', 'accesspress-social-counter' ); ?>
8
  </strong><?php _e( 'to display your social accounts fans, subscribers and followers number on your website !
9
  A perfect plugin to show your social media stats and encourage more to join your network.
10
  You can select the social media profiles you want to activate, enter details of your social media and select one of the designs from beautifully designed 5 design themes.
36
 
37
 
38
  <div class = "halfseperator"></div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
39
 
40
  <div class = "seperator"></div><div class = "dottedline"></div><div class = "seperator"></div>
41
 
52
  <p><strong><?php _e( 'Like us on facebook', 'accesspress-social-counter' ); ?>:</strong><br />
53
  <iframe style = "border: none; overflow: hidden; width: 764px; height: 206px;" src = "//www.facebook.com/plugins/likebox.php?href=https%3A%2F%2Fwww.facebook.com%2Fpages%2FAccessPress-Themes%2F1396595907277967&amp;width=842&amp;height=258&amp;colorscheme=light&amp;show_faces=true&amp;header=false&amp;stream=false&amp;show_border=true&amp;appId=1411139805828592" width = "240" height = "150" frameborder = "0" scrolling = "no"></iframe></p>
54
 
55
+
 
 
 
 
56
  </div>
57
  </div>
inc/backend/boards/social-profiles.php CHANGED
@@ -13,20 +13,20 @@
13
  </div>
14
  <div class="apsc-option-inner-wrapper ">
15
  <label for="apsc-facebook-method">
16
- <?php _e( 'Facebook Counter Extraction', 'ap-social-pro' ) ?>
17
  </label>
18
  <div class="apsc-option-field">
19
  <label class="apsc-fb-method">
20
  <input type="radio" name="social_profile[facebook][method]" value="1" class="apss-facebook-method" id="" <?php echo isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] == '1' ? ' checked="checked" ' : '1111'; ?>/>
21
- <?php _e( 'Method 1', 'ap-social-pro' ); ?>
22
  </label>
23
- <div class="apsc-option-note"><?php _e( 'Method 1 you will require to enter your app id and app secret. Due to recent changes in Facebook API, most of our clients have been complaining that "Method 1" does not work. ', 'ap-social-pro' ); ?></div>
24
 
25
  <label class="apsc-fb-method">
26
  <input type="radio" name="social_profile[facebook][method]" value="2" class="apss-facebook-method" id="" <?php echo isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] == '2' ? 'checked="checked"' : '2222'; ?>/>
27
- <?php _e( 'Method 2', 'ap-social-pro' ); ?>
28
  </label>
29
- <div class="apsc-option-note"><?php _e( 'Method 2 makes use of a third party API "WidgetPack" to do the work. Please login to your Facebook account using the "FB Connect" button and connect WidgetPack to Facebook. Once done, you will notice that the image and name of your page will be displayed beneath the "FB Connect" button in the plugin settings. When you click on it, All the details will automatically be entered in the fields beneath the "FB Connect Button". Note: Your FB login details will NOT be stored.', 'ap-social-pro' ); ?></div>
30
  </div>
31
  </div>
32
  <div class="apss-facebook-method-1" id="apss-facebook-method-1" <?php echo ( isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] == '1' ) ? 'style=display:block;' : 'style=display:none;'; ?>>
@@ -97,37 +97,37 @@
97
  }
98
  </style>
99
  <div class="apsc-option-inner-wrapper apsc-row-even">
100
- <label><?php _e( 'Facebook Login', 'ap-social-pro' ); ?></label>
101
  <div class="apsc-option-field">
102
- <button type="button" id="apsc_fb_connect"><?php _e( 'FB Connect', 'ap-social-pro' ); ?></button>
103
  <div class="apsc-fb-pages-list"></div>
104
  </div>
105
  </div>
106
  <div class="apsc-option-inner-wrapper apsc-row-even">
107
- <label><?php _e( 'Page Name', 'ap-social-pro' ); ?></label>
108
  <div class="apsc-option-field">
109
- <input type="text" id="" class="apsc-page-name" name="social_profile[facebook][page_name]" value="<?php (isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'page_name' ] ) && ! empty( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'page_name' ] )) ? esc_attr_e( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'page_name' ] ) : ''; ?>" class="apsc-page-name" placeholder="<?php _e( 'Page Name', 'ap-social-pro' ); ?>" readonly />
110
- <div class="apsc-option-note"><?php _e( ' ', 'ap-social-pro' ); ?></div>
111
  </div>
112
  </div>
113
  <div class="apsc-option-inner-wrapper apsc-row-even">
114
- <label><?php _e( 'Page ID', 'ap-social-pro' ); ?></label>
115
  <div class="apsc-option-field">
116
- <input type="text" class="apsc-page-id" id="" name="social_profile[facebook][fb_page_id]" value="<?php (isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'fb_page_id' ] ) && ! empty( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'fb_page_id' ] )) ? esc_attr_e( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'fb_page_id' ] ) : ''; ?>" class="apsc-page-name" placeholder="<?php _e( 'Page ID', 'ap-social-pro' ); ?>" readonly />
117
- <div class="apsc-option-note"><?php _e( ' ', 'ap-social-pro' ); ?></div>
118
  </div>
119
  </div>
120
  <div class="apsc-option-inner-wrapper apsc-row-even">
121
- <label><?php _e( 'Access Token', 'ap-social-pro' ); ?></label>
122
  <div class="apsc-option-field">
123
- <input type="text" id="" class="apsc-page-token" name="social_profile[facebook][access_token]" value="<?php (isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'access_token' ] ) && ! empty( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'access_token' ] )) ? esc_attr_e( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'access_token' ] ) : ''; ?>" class="apsc-page-name" placeholder="<?php _e( 'Access Token', 'ap-social-pro' ); ?>" readonly />
124
- <div class="apsc-option-note"><?php _e( ' ', 'ap-social-pro' ); ?></div>
125
  </div>
126
  </div>
127
  <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-widget-id="<?php echo 'apss-facebook-method-2'; ?>" onload="fbrev_init({widgetId: this.getAttribute('data-widget-id')})" style="display:none">
128
  </div>
129
  <div class="apsc-option-inner-wrapper apsc-row-odd">
130
- <label><?php _e( 'Default Count', 'ap-social-pro' ); ?></label>
131
  <div class="apsc-option-field">
132
  <input type="text" name="social_profile[facebook][default_count]" value="<?php
133
  if ( isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'default_count' ] ) ) {
@@ -136,7 +136,7 @@
136
  echo '';
137
  }
138
  ?>"/>
139
- <div class="apsc-option-note"><?php _e( 'Please enter the default count to show instead of 0 when API\'s are not available.', 'ap-social-pro' ); ?></div>
140
  </div>
141
  </div>
142
  <div class="apsc-extra-note"><?php _e( 'Please use: [aps-get-count social_media="facebook"] to get the Facebook Count only.You can also pass count_format parameter too in this shortcode to format your count.Formats are "short" for abbreviated format and "comma" for comma separated formats.' ); ?></div>
@@ -207,10 +207,10 @@
207
  </div>
208
  </div>
209
  <div class="apsc-option-inner-wrapper apsc-row-odd">
210
- <label><?php _e( 'Default Count', 'ap-social-pro' ); ?></label>
211
  <div class="apsc-option-field">
212
  <input type="text" name="social_profile[twitter][default_count]" value="<?php echo isset( $apsc_settings[ 'social_profile' ][ 'twitter' ][ 'default_count' ] ) && $apsc_settings[ 'social_profile' ][ 'twitter' ][ 'default_count' ] != '' ? $apsc_settings[ 'social_profile' ][ 'twitter' ][ 'default_count' ] : ''; ?>"/>
213
- <div class="apsc-option-note"><?php _e( 'Please enter the default count to show instead of 0 when API\'s are not available.', 'ap-social-pro' ); ?></div>
214
  </div>
215
  </div>
216
  </div>
@@ -220,12 +220,54 @@
220
 
221
  <!--Instagram-->
222
  <div class="apsc-option-outer-wrapper">
 
 
 
 
 
 
223
  <h4><?php _e( 'Instagram', 'accesspress-social-counter' ) ?></h4>
224
  <div class="apsc-option-inner-wrapper">
225
  <label><?php _e( 'Display Counter', 'accesspress-social-counter' ) ?></label>
226
  <div class="apsc-option-field"><label><input type="checkbox" name="social_profile[instagram][active]" value="1" class="apsc-counter-activation-trigger" <?php if ( isset( $apsc_settings[ 'social_profile' ][ 'instagram' ][ 'active' ] ) ) { ?>checked="checked"<?php } ?>/><?php _e( 'Show/Hide', 'accesspress-social-counter' ); ?></label></div>
227
  </div>
228
  <div class="apsc-option-extra">
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
229
  <div class="apsc-option-inner-wrapper">
230
  <label><?php _e( 'Instagram Username', 'accesspress-social-counter' ); ?></label>
231
  <div class="apsc-option-field">
@@ -236,22 +278,38 @@
236
  <div class="apsc-option-inner-wrapper">
237
  <label><?php _e( 'Instagram User ID', 'accesspress-social-counter' ); ?></label>
238
  <div class="apsc-option-field">
239
- <input type="text" name="social_profile[instagram][user_id]" value="<?php echo esc_attr( $apsc_settings[ 'social_profile' ][ 'instagram' ][ 'user_id' ] ); ?>"/>
240
- <div class="apsc-option-note"><?php _e( 'Please enter the instagram user ID.You can get this information from <a href="http://instagram.pixelunion.net/" target="_blank">http://www.pinceladasdaweb.com.br/instagram/access-token/</a>', 'accesspress-social-counter' ); ?></div>
 
 
 
 
 
 
 
 
241
  </div>
242
  </div>
243
  <div class="apsc-option-inner-wrapper">
244
  <label><?php _e( 'Instagram Access Token', 'accesspress-social-counter' ); ?></label>
245
  <div class="apsc-option-field">
246
- <input type="text" name="social_profile[instagram][access_token]" value="<?php echo esc_attr( $apsc_settings[ 'social_profile' ][ 'instagram' ][ 'access_token' ] ); ?>"/>
247
- <div class="apsc-option-note"><?php _e( 'Please enter the instagram Access Token.You can get this information from <a href="http://instagram.pixelunion.net/" target="_blank">http://instagram.pixelunion.net/</a>', 'accesspress-social-counter' ); ?></div>
 
 
 
 
 
 
 
 
248
  </div>
249
  </div>
250
  <div class="apsc-option-inner-wrapper apsc-row-odd">
251
- <label><?php _e( 'Default Count', 'ap-social-pro' ); ?></label>
252
  <div class="apsc-option-field">
253
  <input type="text" name="social_profile[instagram][default_count]" value="<?php echo isset( $apsc_settings[ 'social_profile' ][ 'instagram' ][ 'default_count' ] ) && $apsc_settings[ 'social_profile' ][ 'instagram' ][ 'default_count' ] != '' ? $apsc_settings[ 'social_profile' ][ 'instagram' ][ 'default_count' ] : ''; ?>"/>
254
- <div class="apsc-option-note"><?php _e( 'Please enter the default count to show instead of 0 when API\'s are not available.', 'ap-social-pro' ); ?></div>
255
  </div>
256
  </div>
257
  </div>
@@ -323,10 +381,10 @@
323
  </div>
324
  </div>
325
  <div class="apsc-option-inner-wrapper apsc-row-even">
326
- <label><?php _e( 'Default Count', 'ap-social-pro' ); ?></label>
327
  <div class="apsc-option-field">
328
  <input type="text" name="social_profile[soundcloud][default_count]" value="<?php echo isset( $apsc_settings[ 'social_profile' ][ 'soundcloud' ][ 'default_count' ] ) && $apsc_settings[ 'social_profile' ][ 'soundcloud' ][ 'default_count' ] != '' ? $apsc_settings[ 'social_profile' ][ 'soundcloud' ][ 'default_count' ] : ''; ?>"/>
329
- <div class="apsc-option-note"><?php _e( 'Please enter the default count to show instead of 0 when API\'s are not available.', 'ap-social-pro' ); ?></div>
330
  </div>
331
  </div>
332
  </div>
@@ -349,27 +407,90 @@
349
  <div class="apsc-option-note"><?php _e( 'Please enter your dribbble username.For example:Creativedash', 'accesspress-social-counter' ); ?></div>
350
  </div>
351
  </div>
352
- </div>
353
- <div class="apsc-option-inner-wrapper apsc-row-odd">
354
- <label><?php _e( 'Access Token', 'ap-social-pro' ); ?></label>
355
  <div class="apsc-option-field">
356
- <input type="text" name="social_profile[dribbble][access_token]" value="<?php
357
- if ( isset( $apsc_settings[ 'social_profile' ][ 'dribbble' ][ 'access_token' ] ) ) {
358
- echo $apsc_settings[ 'social_profile' ][ 'dribbble' ][ 'access_token' ];
359
- }
360
- ?>"/>
361
- <div class="apsc-option-note"><?php _e( 'Please enter access token from your dribbble app.', 'ap-social-pro' ); ?></div>
362
- <div class="apsc-option-note">
363
- How to get access token? <br />
364
- please login to your dribbble account first and go to <a href='https://dribbble.com/account/applications/new' target='_blank'>this</a> link and create an app. There you will need to enter your app name, Description, Website URL, Callback URL and need to accept the dribbble API terms and conditions and Click on Register Application button. Upon Registration after page reload you will get your client access token. This is the required access token.
365
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
366
  </div>
 
367
  </div>
 
368
  <div class="apsc-option-inner-wrapper apsc-row-even">
369
- <label><?php _e( 'Default Count', 'ap-social-pro' ); ?></label>
370
  <div class="apsc-option-field">
371
  <input type="text" name="social_profile[dribbble][default_count]" value="<?php echo isset( $apsc_settings[ 'social_profile' ][ 'dribbble' ][ 'default_count' ] ) && $apsc_settings[ 'social_profile' ][ 'dribbble' ][ 'default_count' ] != '' ? $apsc_settings[ 'social_profile' ][ 'dribbble' ][ 'default_count' ] : ''; ?>"/>
372
- <div class="apsc-option-note"><?php _e( 'Please enter the default count to show instead of 0 when API\'s are not available.', 'ap-social-pro' ); ?></div>
373
  </div>
374
  </div>
375
  <div class="apsc-extra-note"><?php _e( 'Please use: [aps-get-count social_media="dribbble"] to get the Dribbble Count only.You can also pass count_format parameter too in this shortcode to format your count.Formats are "short" for abbreviated format and "comma" for comma separated formats.' ); ?></div>
13
  </div>
14
  <div class="apsc-option-inner-wrapper ">
15
  <label for="apsc-facebook-method">
16
+ <?php _e( 'Facebook Counter Extraction', 'accesspress-social-counter' ) ?>
17
  </label>
18
  <div class="apsc-option-field">
19
  <label class="apsc-fb-method">
20
  <input type="radio" name="social_profile[facebook][method]" value="1" class="apss-facebook-method" id="" <?php echo isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] == '1' ? ' checked="checked" ' : '1111'; ?>/>
21
+ <?php _e( 'Method 1', 'accesspress-social-counter' ); ?>
22
  </label>
23
+ <div class="apsc-option-note"><?php _e( 'Method 1 you will require to enter your app id and app secret. Due to recent changes in Facebook API, most of our clients have been complaining that "Method 1" does not work. ', 'accesspress-social-counter' ); ?></div>
24
 
25
  <label class="apsc-fb-method">
26
  <input type="radio" name="social_profile[facebook][method]" value="2" class="apss-facebook-method" id="" <?php echo isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] == '2' ? 'checked="checked"' : '2222'; ?>/>
27
+ <?php _e( 'Method 2', 'accesspress-social-counter' ); ?>
28
  </label>
29
+ <div class="apsc-option-note"><?php _e( 'Method 2 makes use of a third party API "WidgetPack" to do the work. Please login to your Facebook account using the "FB Connect" button and connect WidgetPack to Facebook. Once done, you will notice that the image and name of your page will be displayed beneath the "FB Connect" button in the plugin settings. When you click on it, All the details will automatically be entered in the fields beneath the "FB Connect Button". Note: Your FB login details will NOT be stored.', 'accesspress-social-counter' ); ?></div>
30
  </div>
31
  </div>
32
  <div class="apss-facebook-method-1" id="apss-facebook-method-1" <?php echo ( isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] == '1' ) ? 'style=display:block;' : 'style=display:none;'; ?>>
97
  }
98
  </style>
99
  <div class="apsc-option-inner-wrapper apsc-row-even">
100
+ <label><?php _e( 'Facebook Login', 'accesspress-social-counter' ); ?></label>
101
  <div class="apsc-option-field">
102
+ <button type="button" id="apsc_fb_connect"><?php _e( 'FB Connect', 'accesspress-social-counter' ); ?></button>
103
  <div class="apsc-fb-pages-list"></div>
104
  </div>
105
  </div>
106
  <div class="apsc-option-inner-wrapper apsc-row-even">
107
+ <label><?php _e( 'Page Name', 'accesspress-social-counter' ); ?></label>
108
  <div class="apsc-option-field">
109
+ <input type="text" id="" class="apsc-page-name" name="social_profile[facebook][page_name]" value="<?php (isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'page_name' ] ) && ! empty( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'page_name' ] )) ? esc_attr_e( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'page_name' ] ) : ''; ?>" class="apsc-page-name" placeholder="<?php _e( 'Page Name', 'accesspress-social-counter' ); ?>" readonly />
110
+ <div class="apsc-option-note"><?php _e( ' ', 'accesspress-social-counter' ); ?></div>
111
  </div>
112
  </div>
113
  <div class="apsc-option-inner-wrapper apsc-row-even">
114
+ <label><?php _e( 'Page ID', 'accesspress-social-counter' ); ?></label>
115
  <div class="apsc-option-field">
116
+ <input type="text" class="apsc-page-id" id="" name="social_profile[facebook][fb_page_id]" value="<?php (isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'fb_page_id' ] ) && ! empty( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'fb_page_id' ] )) ? esc_attr_e( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'fb_page_id' ] ) : ''; ?>" class="apsc-page-name" placeholder="<?php _e( 'Page ID', 'accesspress-social-counter' ); ?>" readonly />
117
+ <div class="apsc-option-note"><?php _e( ' ', 'accesspress-social-counter' ); ?></div>
118
  </div>
119
  </div>
120
  <div class="apsc-option-inner-wrapper apsc-row-even">
121
+ <label><?php _e( 'Access Token', 'accesspress-social-counter' ); ?></label>
122
  <div class="apsc-option-field">
123
+ <input type="text" id="" class="apsc-page-token" name="social_profile[facebook][access_token]" value="<?php (isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'access_token' ] ) && ! empty( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'access_token' ] )) ? esc_attr_e( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'access_token' ] ) : ''; ?>" class="apsc-page-name" placeholder="<?php _e( 'Access Token', 'accesspress-social-counter' ); ?>" readonly />
124
+ <div class="apsc-option-note"><?php _e( ' ', 'accesspress-social-counter' ); ?></div>
125
  </div>
126
  </div>
127
  <img src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7" data-widget-id="<?php echo 'apss-facebook-method-2'; ?>" onload="fbrev_init({widgetId: this.getAttribute('data-widget-id')})" style="display:none">
128
  </div>
129
  <div class="apsc-option-inner-wrapper apsc-row-odd">
130
+ <label><?php _e( 'Default Count', 'accesspress-social-counter' ); ?></label>
131
  <div class="apsc-option-field">
132
  <input type="text" name="social_profile[facebook][default_count]" value="<?php
133
  if ( isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'default_count' ] ) ) {
136
  echo '';
137
  }
138
  ?>"/>
139
+ <div class="apsc-option-note"><?php _e( 'Please enter the default count to show instead of 0 when API\'s are not available.', 'accesspress-social-counter' ); ?></div>
140
  </div>
141
  </div>
142
  <div class="apsc-extra-note"><?php _e( 'Please use: [aps-get-count social_media="facebook"] to get the Facebook Count only.You can also pass count_format parameter too in this shortcode to format your count.Formats are "short" for abbreviated format and "comma" for comma separated formats.' ); ?></div>
207
  </div>
208
  </div>
209
  <div class="apsc-option-inner-wrapper apsc-row-odd">
210
+ <label><?php _e( 'Default Count', 'accesspress-social-counter' ); ?></label>
211
  <div class="apsc-option-field">
212
  <input type="text" name="social_profile[twitter][default_count]" value="<?php echo isset( $apsc_settings[ 'social_profile' ][ 'twitter' ][ 'default_count' ] ) && $apsc_settings[ 'social_profile' ][ 'twitter' ][ 'default_count' ] != '' ? $apsc_settings[ 'social_profile' ][ 'twitter' ][ 'default_count' ] : ''; ?>"/>
213
+ <div class="apsc-option-note"><?php _e( 'Please enter the default count to show instead of 0 when API\'s are not available.', 'accesspress-social-counter' ); ?></div>
214
  </div>
215
  </div>
216
  </div>
220
 
221
  <!--Instagram-->
222
  <div class="apsc-option-outer-wrapper">
223
+ <div class="apsc-extra-note">
224
+ <p><?php _e('Note: After the latest changes in instagram api, your instagram account should be business account in order to get follower count.
225
+ According to this changes, you need to go to <a href="https://developers.facebook.com">this</a> link to create app. Setup facebook login and put (https://demo.accesspressthemes.com/wordpress-plugins/insta-feed/graph/access_token.php) as valid oauth redirect url.Then, enter
226
+ your app id and app secret in backend and first save it.Then, click on get access token.After few steps of selecting
227
+ your facebook page and instagram account you should be redirected to backend with your user id and access token', 'accesspress-social-counter'); ?></p>
228
+ </div>
229
  <h4><?php _e( 'Instagram', 'accesspress-social-counter' ) ?></h4>
230
  <div class="apsc-option-inner-wrapper">
231
  <label><?php _e( 'Display Counter', 'accesspress-social-counter' ) ?></label>
232
  <div class="apsc-option-field"><label><input type="checkbox" name="social_profile[instagram][active]" value="1" class="apsc-counter-activation-trigger" <?php if ( isset( $apsc_settings[ 'social_profile' ][ 'instagram' ][ 'active' ] ) ) { ?>checked="checked"<?php } ?>/><?php _e( 'Show/Hide', 'accesspress-social-counter' ); ?></label></div>
233
  </div>
234
  <div class="apsc-option-extra">
235
+
236
+ <div class="apsc-option-inner-wrapper">
237
+ <label><?php _e('Facebook App ID', 'accesspress-social-counter'); ?></label>
238
+ <div class="apsc-option-field">
239
+ <input type="text" name="social_profile[instagram][app_id]" placeholder="Enter your facebook app id" value="<?php echo isset($apsc_settings['social_profile']['instagram']['app_id']) && $apsc_settings['social_profile']['instagram']['app_id'] != '' ? $apsc_settings['social_profile']['instagram']['app_id'] : ''; ?>"/>
240
+ <div class="apsc-option-note"><?php _e('Please enter your facebook app id from developers page.', 'accesspress-social-counter'); ?></div>
241
+ </div>
242
+ </div>
243
+ <div class="apsc-option-inner-wrapper">
244
+ <label><?php _e('Facebook App Secret', 'accesspress-social-counter'); ?></label>
245
+ <div class="apsc-option-field">
246
+ <input type="text" name="social_profile[instagram][app_secret]" placeholder="Enter your facebook app secret" value="<?php echo isset($apsc_settings['social_profile']['instagram']['app_secret']) ? esc_attr($apsc_settings['social_profile']['instagram']['app_secret']) : ''; ?>"/>
247
+ <div class="apsc-option-note"><?php _e('Please enter your facebook app secret from developers page.', 'accesspress-social-counter'); ?></div>
248
+ </div>
249
+ </div>
250
+ <?php
251
+ //$dribbble_url='https://dribbble.com/oauth/authorize?'.$apsc_settings[ 'social_profile' ][ 'dribbble' ][ 'client_id' ].'';
252
+ if (isset($apsc_settings['social_profile']['instagram']['app_id'])) {
253
+ $instagram_app_id = $apsc_settings['social_profile']['instagram']['app_id'];
254
+ } else {
255
+ $instagram_app_id = '';
256
+ }
257
+ if (isset($apsc_settings['social_profile']['instagram']['app_secret'])) {
258
+ $instagram_app_secret = $apsc_settings['social_profile']['instagram']['app_secret'];
259
+ } else {
260
+ $instagram_app_secret = '';
261
+ }
262
+ ?>
263
+ <div class="apsc-option-inner-wrapper apsc-row-even">
264
+ <label><?php _e('Get Instagram Access Token', 'accesspress-social-counter'); ?></label>
265
+ <div class="apsc-option-field">
266
+ <a target="_self" id="get_token" href="https://demo.accesspressthemes.com/wordpress-plugins/insta-feed/graph/access_token.php?app_id=<?php echo esc_attr($instagram_app_id);?>&app_secret=<?php echo esc_attr($instagram_app_secret); ?>&back_url=<?php echo admin_url('admin.php?page=ap-social-counter'); ?>">Get access token</a>
267
+ <div class="apsc-option-note"><?php _e('Note: After entering your app id and app secret remember to save changes first,then only proceed toward getting access token.', 'accesspress-social-counter'); ?>
268
+ </div>
269
+ </div>
270
+ </div>
271
  <div class="apsc-option-inner-wrapper">
272
  <label><?php _e( 'Instagram Username', 'accesspress-social-counter' ); ?></label>
273
  <div class="apsc-option-field">
278
  <div class="apsc-option-inner-wrapper">
279
  <label><?php _e( 'Instagram User ID', 'accesspress-social-counter' ); ?></label>
280
  <div class="apsc-option-field">
281
+ <input type="text" name="social_profile[instagram][user_id]" value="<?php
282
+ if (isset($_GET["instaid"])) {
283
+ echo esc_attr($_GET["instaid"]);
284
+ } elseif (isset($apsc_settings['social_profile']['instagram']['user_id'])) {
285
+ echo esc_attr($apsc_settings['social_profile']['instagram']['user_id']);
286
+ } else {
287
+ echo '';
288
+ }
289
+ ?>"/>
290
+ <div class="apsc-option-note"><?php _e( 'Note: If not loaded automatically after clicking Get Access Token button provided above, please check if you have followed all steps properly.', 'accesspress-social-counter' ); ?></div>
291
  </div>
292
  </div>
293
  <div class="apsc-option-inner-wrapper">
294
  <label><?php _e( 'Instagram Access Token', 'accesspress-social-counter' ); ?></label>
295
  <div class="apsc-option-field">
296
+ <input type="text" name="social_profile[instagram][access_token]" value="<?php
297
+ if (isset($_GET["access_token"])) {
298
+ echo esc_attr($_GET["access_token"]);
299
+ } elseif (isset($apsc_settings['social_profile']['instagram']['access_token']) && $apsc_settings['social_profile']['instagram']['access_token'] != '') {
300
+ echo esc_attr($apsc_settings['social_profile']['instagram']['access_token']);
301
+ } else {
302
+ echo '';
303
+ }
304
+ ?>"/>
305
+ <div class="apsc-option-note"><?php _e( 'Note: If not loaded automatically after clicking Get Access Token button provided above, please check if you have followed all steps properly.', 'accesspress-social-counter' ); ?></div>
306
  </div>
307
  </div>
308
  <div class="apsc-option-inner-wrapper apsc-row-odd">
309
+ <label><?php _e( 'Default Count', 'accesspress-social-counter' ); ?></label>
310
  <div class="apsc-option-field">
311
  <input type="text" name="social_profile[instagram][default_count]" value="<?php echo isset( $apsc_settings[ 'social_profile' ][ 'instagram' ][ 'default_count' ] ) && $apsc_settings[ 'social_profile' ][ 'instagram' ][ 'default_count' ] != '' ? $apsc_settings[ 'social_profile' ][ 'instagram' ][ 'default_count' ] : ''; ?>"/>
312
+ <div class="apsc-option-note"><?php _e( 'Please enter the default count to show instead of 0 when API\'s are not available.', 'accesspress-social-counter' ); ?></div>
313
  </div>
314
  </div>
315
  </div>
381
  </div>
382
  </div>
383
  <div class="apsc-option-inner-wrapper apsc-row-even">
384
+ <label><?php _e( 'Default Count', 'accesspress-social-counter' ); ?></label>
385
  <div class="apsc-option-field">
386
  <input type="text" name="social_profile[soundcloud][default_count]" value="<?php echo isset( $apsc_settings[ 'social_profile' ][ 'soundcloud' ][ 'default_count' ] ) && $apsc_settings[ 'social_profile' ][ 'soundcloud' ][ 'default_count' ] != '' ? $apsc_settings[ 'social_profile' ][ 'soundcloud' ][ 'default_count' ] : ''; ?>"/>
387
+ <div class="apsc-option-note"><?php _e( 'Please enter the default count to show instead of 0 when API\'s are not available.', 'accesspress-social-counter' ); ?></div>
388
  </div>
389
  </div>
390
  </div>
407
  <div class="apsc-option-note"><?php _e( 'Please enter your dribbble username.For example:Creativedash', 'accesspress-social-counter' ); ?></div>
408
  </div>
409
  </div>
410
+ <div class="apsc-option-inner-wrapper apsc-row-odd">
411
+ <label><?php _e('Dribbble Client id', 'accesspress-social-counter'); ?></label>
 
412
  <div class="apsc-option-field">
413
+ <input type="text" name="social_profile[dribbble][client_id]" value="<?php echo isset($apsc_settings['social_profile']['dribbble']['client_id']) && $apsc_settings['social_profile']['dribbble']['client_id'] != '' ? $apsc_settings['social_profile']['dribbble']['client_id'] : ''; ?>"/>
414
+ <div class="apsc-option-note"><?php _e('Please enter your dribbble client id', 'accesspress-social-counter'); ?></div>
415
+ </div>
416
+ </div>
417
+ <div class="apsc-option-inner-wrapper apsc-row-even">
418
+ <label><?php _e('Dribbble Client secret', 'accesspress-social-counter'); ?></label>
419
+ <div class="apsc-option-field">
420
+ <input type="text" name="social_profile[dribbble][client_secret]" value="<?php echo isset($apsc_settings['social_profile']['dribbble']['client_secret']) && $apsc_settings['social_profile']['dribbble']['client_secret'] != '' ? $apsc_settings['social_profile']['dribbble']['client_secret'] : ''; ?>"/>
421
+ <div class="apsc-option-note"><?php _e('Please enter your dribbble client secret', 'accesspress-social-counter'); ?></div>
422
+ </div>
423
+ </div>
424
+ <?php
425
+ //$dribbble_url='https://dribbble.com/oauth/authorize?'.$apsc_settings[ 'social_profile' ][ 'dribbble' ][ 'client_id' ].'';
426
+ if (isset($apsc_settings['social_profile']['dribbble']['client_id'])) {
427
+ $dribble_client_id = $apsc_settings['social_profile']['dribbble']['client_id'];
428
+ } else {
429
+ $dribble_client_id = '';
430
+ }
431
+ if (isset($apsc_settings['social_profile']['dribbble']['client_secret'])) {
432
+ $dribble_client_secret = $apsc_settings['social_profile']['dribbble']['client_secret'];
433
+ } else {
434
+ $dribble_client_secret = '';
435
+ }
436
+ ?>
437
+ <div class="apsc-option-inner-wrapper apsc-row-odd">
438
+ <label><?php _e('Get Dribbble access token', 'accesspress-social-counter'); ?></label>
439
+ <!-- <div class="apsc-option-field"> -->
440
+ <div class="apsc-option-field">
441
+ <a target="_self" id="get_token" href="https://dribbble.com/oauth/authorize?client_id=<?php echo $dribble_client_id; ?>&client_secret=<?php echo $dribble_client_secret; ?>">Get access token</a>
442
+ <div class="apsc-option-note">
443
+ <?php $back_url = admin_url('admin.php?page=ap-social-counter');
444
+ ?>
445
+ <?php _e('Note: After entering your app id and app secret remember to save changes first,then only proceed toward getting access token. Please enter (' . $back_url . ') as callback url', 'accesspress-social-counter'); ?>
446
+ </div>
447
+ </div>
448
+ </div>
449
+ <?php
450
+ if (isset($_GET['code']) && $_GET['code'] != '') {
451
+ $redirect_url = admin_url('admin.php?page=ap-social-counter-pro');
452
+ $curl = curl_init('https://dribbble.com/oauth/token');
453
+ curl_setopt($curl, CURLOPT_POST, true);
454
+ curl_setopt($curl, CURLOPT_POSTFIELDS, array(
455
+ 'client_id' => $dribble_client_id,
456
+ 'client_secret' => $dribble_client_secret,
457
+ 'code' => $_GET['code'],
458
+ // The code from the previous request
459
+ //'redirect_uri' => $redirect_url,
460
+ // 'grant_type' => 'authorization_code'
461
+ ));
462
+ curl_setopt($curl, CURLOPT_RETURNTRANSFER, 1);
463
+ $auth = curl_exec($curl);
464
+ $secret = json_decode($auth);
465
+ //die(print_r($secret));
466
+ $accessToken = $secret->access_token;
467
+ }
468
+ ?>
469
+
470
+ <div class="apsc-option-inner-wrapper apsc-row-even">
471
+ <label><?php _e('Access Token', 'accesspress-social-counter'); ?></label>
472
+ <div class="apsc-option-field">
473
+ <input type="text" name="social_profile[dribbble][access_token]" value="<?php
474
+ if (isset($accessToken)) {
475
+ echo $accessToken;
476
+ } elseif (isset($apsc_settings['social_profile']['dribbble']['access_token'])) {
477
+ echo $apsc_settings['social_profile']['dribbble']['access_token'];
478
+ }
479
+ ?>"/>
480
+ <div class="apsc-option-note"><?php _e('Note: If not loaded automatically after clicking Get Access Token button provided above, please check if you have followed all steps properly.', 'accesspress-social-counter'); ?></div>
481
+ <div class="apsc-option-note">
482
+ How to create application? <br />
483
+ please login to your dribbble account first and go to <a href='https://dribbble.com/account/applications/new' target='_blank'>this</a> link and create an app. There you will need to enter your app name, Description, Website URL, Callback URL and need to accept the dribbble API terms and conditions and Click on Register Application button. Upon Registration after page reload you will get your client id and client secret.
484
+ </div>
485
  </div>
486
+ </div>
487
  </div>
488
+
489
  <div class="apsc-option-inner-wrapper apsc-row-even">
490
+ <label><?php _e( 'Default Count', 'accesspress-social-counter' ); ?></label>
491
  <div class="apsc-option-field">
492
  <input type="text" name="social_profile[dribbble][default_count]" value="<?php echo isset( $apsc_settings[ 'social_profile' ][ 'dribbble' ][ 'default_count' ] ) && $apsc_settings[ 'social_profile' ][ 'dribbble' ][ 'default_count' ] != '' ? $apsc_settings[ 'social_profile' ][ 'dribbble' ][ 'default_count' ] : ''; ?>"/>
493
+ <div class="apsc-option-note"><?php _e( 'Please enter the default count to show instead of 0 when API\'s are not available.', 'accesspress-social-counter' ); ?></div>
494
  </div>
495
  </div>
496
  <div class="apsc-extra-note"><?php _e( 'Please use: [aps-get-count social_media="dribbble"] to get the Dribbble Count only.You can also pass count_format parameter too in this shortcode to format your count.Formats are "short" for abbreviated format and "comma" for comma separated formats.' ); ?></div>
inc/backend/settings.php CHANGED
@@ -51,7 +51,6 @@ $apsc_settings = $this->apsc_settings;
51
  <a href="javascript:void(0)" id="system-status" class="nav-tab apsc-tabs-trigger"><?php _e('System Status', 'accesspress-social-counter'); ?></a>
52
  <a href="javascript:void(0)" id="how_to_use-settings" class="nav-tab apsc-tabs-trigger"><?php _e('How to use', 'accesspress-social-counter'); ?></a>
53
  <a href="javascript:void(0)" id="about-settings" class="nav-tab apsc-tabs-trigger"><?php _e('About', 'accesspress-social-counter'); ?></a>
54
- <a href="http://wpallclub.com" target="_blank" id="about-settings" class="nav-tab apsc-tabs-trigger"><?php _e('More WP Resources', 'accesspress-social-counter'); ?></a>
55
  </h2>
56
 
57
  <div class="metabox-holder">
51
  <a href="javascript:void(0)" id="system-status" class="nav-tab apsc-tabs-trigger"><?php _e('System Status', 'accesspress-social-counter'); ?></a>
52
  <a href="javascript:void(0)" id="how_to_use-settings" class="nav-tab apsc-tabs-trigger"><?php _e('How to use', 'accesspress-social-counter'); ?></a>
53
  <a href="javascript:void(0)" id="about-settings" class="nav-tab apsc-tabs-trigger"><?php _e('About', 'accesspress-social-counter'); ?></a>
 
54
  </h2>
55
 
56
  <div class="metabox-holder">
inc/frontend/social_network/extract_count/facebook.php CHANGED
@@ -1,27 +1,47 @@
1
- <?php
2
- defined( 'ABSPATH' ) or die( "No script kiddies please!" );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
3
  $facebook_page_id = isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'page_id' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'page_id' ] != '' ? $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'page_id' ] : '';
4
  $default_count = isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'default_count' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'default_count' ] != '' ? $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'default_count' ] : '0';
5
  $facebook_count = get_transient( 'apsc_facebook' );
6
-
7
  if ( false === $facebook_count ) {
8
  $facebook_method = ( isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] != '' ) ? esc_attr( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] ) : '2';
9
  if ( $facebook_method == '1' ) {
10
- $count = $this -> new_fb_count();
11
- } else {
12
- if ( isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'app_id' ], $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'app_secret' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'app_id' ] != '' && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'app_secret' ] != '' ) {
13
- $count = $this -> new_fb_count();
14
  } else {
15
  $api_url = 'https://www.facebook.com/' . $facebook_page_id;
16
  $count = $this -> facebook_count( $api_url );
17
  }
 
 
18
  }
 
19
  set_transient( 'apsc_facebook', $count, $cache_period );
20
  } else {
21
  $count = $facebook_count;
22
  }
23
 
24
- $count = ($count == 0) ? $default_count : $count;
25
- if ( $count != 0 ) {
26
- set_transient( 'apsc_facebook', $count, $cache_period );
27
- }
1
+ <?php defined( 'ABSPATH' ) or die( "No script kiddies please!" );
2
+ //$facebook_page_id = isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'page_id' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'page_id' ] != '' ? $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'page_id' ] : '';
3
+ //$default_count = isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'default_count' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'default_count' ] != '' ? $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'default_count' ] : '0';
4
+ //$facebook_count = get_transient( 'apsc_facebook' );
5
+ //
6
+ //if ( false === $facebook_count ) {
7
+ // $facebook_method = ( isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] != '' ) ? esc_attr( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] ) : '2';
8
+ // if ( $facebook_method == '1' ) {
9
+ // $count = $this -> new_fb_count();
10
+ // } else {
11
+ // if ( isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'app_id' ], $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'app_secret' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'app_id' ] != '' && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'app_secret' ] != '' ) {
12
+ // $count = $this -> new_fb_count();
13
+ // } else {
14
+ // $api_url = 'https://www.facebook.com/' . $facebook_page_id;
15
+ // $count = $this -> facebook_count( $api_url );
16
+ // }
17
+ // }
18
+ // set_transient( 'apsc_facebook', $count, $cache_period );
19
+ //} else {
20
+ // $count = $facebook_count;
21
+ //}
22
+ //
23
+ //$count = ($count == 0) ? $default_count : $count;
24
+ //if ( $count != 0 ) {
25
+ // set_transient( 'apsc_facebook', $count, $cache_period );
26
+ //}
27
  $facebook_page_id = isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'page_id' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'page_id' ] != '' ? $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'page_id' ] : '';
28
  $default_count = isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'default_count' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'default_count' ] != '' ? $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'default_count' ] : '0';
29
  $facebook_count = get_transient( 'apsc_facebook' );
 
30
  if ( false === $facebook_count ) {
31
  $facebook_method = ( isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] != '' ) ? esc_attr( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'method' ] ) : '2';
32
  if ( $facebook_method == '1' ) {
33
+ if ( isset( $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'app_id' ], $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'app_secret' ] ) && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'app_id' ] != '' && $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'app_secret' ] != '' ) {
34
+ $count = $this -> new_fb_count();
 
 
35
  } else {
36
  $api_url = 'https://www.facebook.com/' . $facebook_page_id;
37
  $count = $this -> facebook_count( $api_url );
38
  }
39
+ } else {
40
+ $count = $this -> new_fb_count();
41
  }
42
+ $count = ($count == 0) ? $default_count : $count;
43
  set_transient( 'apsc_facebook', $count, $cache_period );
44
  } else {
45
  $count = $facebook_count;
46
  }
47
 
 
 
 
 
inc/frontend/social_network/extract_count/instagram.php CHANGED
@@ -8,10 +8,35 @@ $social_profile_url = 'https://instagram.com/' . $username;
8
 
9
  $instagram_count = get_transient( 'apsc_instagram' );
10
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
11
  if ( false === $instagram_count ) {
12
- $access_token = $apsc_settings[ 'social_profile' ][ 'instagram' ][ 'access_token' ];
13
-
14
- $api_url = 'https://api.instagram.com/v1/users/self/?access_token=' . $access_token;
15
  $params = array(
16
  'sslverify' => false,
17
  'timeout' => 60
@@ -21,15 +46,18 @@ if ( false === $instagram_count ) {
21
  $count = $default_count;
22
  } else {
23
  $response = json_decode( $connection[ 'body' ], true );
24
- if (
25
- isset( $response[ 'meta' ][ 'code' ] ) && 200 == $response[ 'meta' ][ 'code' ] && isset( $response[ 'data' ][ 'counts' ][ 'followed_by' ] )
26
- ) {
27
- $count = (intval( $response[ 'data' ][ 'counts' ][ 'followed_by' ] ));
28
- set_transient( 'apsc_instagram', $count, $cache_period );
 
29
  } else {
 
30
  $count = $default_count;
31
  }
32
  }
 
33
  } else {
34
  $count = $instagram_count;
35
  }
8
 
9
  $instagram_count = get_transient( 'apsc_instagram' );
10
 
11
+ //if ( false === $instagram_count ) {
12
+ // $access_token = $apsc_settings[ 'social_profile' ][ 'instagram' ][ 'access_token' ];
13
+ //
14
+ // $api_url = 'https://api.instagram.com/v1/users/self/?access_token=' . $access_token;
15
+ // $params = array(
16
+ // 'sslverify' => false,
17
+ // 'timeout' => 60
18
+ // );
19
+ // $connection = wp_remote_get( $api_url, $params );
20
+ // if ( is_wp_error( $connection ) ) {
21
+ // $count = $default_count;
22
+ // } else {
23
+ // $response = json_decode( $connection[ 'body' ], true );
24
+ // if (
25
+ // isset( $response[ 'meta' ][ 'code' ] ) && 200 == $response[ 'meta' ][ 'code' ] && isset( $response[ 'data' ][ 'counts' ][ 'followed_by' ] )
26
+ // ) {
27
+ // $count = (intval( $response[ 'data' ][ 'counts' ][ 'followed_by' ] ));
28
+ // set_transient( 'apsc_instagram', $count, $cache_period );
29
+ // } else {
30
+ // $count = $default_count;
31
+ // }
32
+ // }
33
+ //} else {
34
+ // $count = $instagram_count;
35
+ //}
36
  if ( false === $instagram_count ) {
37
+ $access_token = (isset( $apsc_settings[ 'social_profile' ][ 'instagram' ][ 'access_token' ] ) && $apsc_settings[ 'social_profile' ][ 'instagram' ][ 'access_token' ] != '') ? $apsc_settings[ 'social_profile' ][ 'instagram' ][ 'access_token' ] : '';
38
+ $api_url='https://graph.facebook.com/v5.0/'.$user_id.'?fields=business_discovery.username('.$username.'){username,follows_count,followers_count}&access_token=' . $access_token .'';
39
+ // die(var_dump($api_url));
40
  $params = array(
41
  'sslverify' => false,
42
  'timeout' => 60
46
  $count = $default_count;
47
  } else {
48
  $response = json_decode( $connection[ 'body' ], true );
49
+ // echo "<pre>";
50
+ // print_r($response);
51
+ // echo "</pre>";
52
+ if ( isset( $response[ 'business_discovery' ][ 'followers_count' ] ) ) {
53
+ $count = intval( $response[ 'business_discovery' ][ 'followers_count' ] );
54
+ // var_dump($count);
55
  } else {
56
+ //die(print_r($response));
57
  $count = $default_count;
58
  }
59
  }
60
+ set_transient( 'apsc_instagram', $count, $cache_period );
61
  } else {
62
  $count = $instagram_count;
63
  }
nbproject/private/private.properties DELETED
@@ -1,2 +0,0 @@
1
- index.file=index.php
2
- url=http://localhost/accesspress-social-counter/
 
 
nbproject/private/private.xml DELETED
@@ -1,10 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project-private xmlns="http://www.netbeans.org/ns/project-private/1">
3
- <editor-bookmarks xmlns="http://www.netbeans.org/ns/editor-bookmarks/2" lastBookmarkId="0"/>
4
- <open-files xmlns="http://www.netbeans.org/ns/projectui-open-files/2">
5
- <group>
6
- <file>file:/E:/XAMPP/htdocs/accesspress-social-counter/wp-content/plugins/accesspress-social-counter/inc/backend/boards/social-profiles.php</file>
7
- <file>file:/E:/XAMPP/htdocs/accesspress-social-counter/wp-content/plugins/accesspress-social-counter/js/backend.js</file>
8
- </group>
9
- </open-files>
10
- </project-private>
 
 
 
 
 
 
 
 
 
 
nbproject/project.properties DELETED
@@ -1,7 +0,0 @@
1
- include.path=${php.global.include.path}
2
- php.version=PHP_70
3
- source.encoding=UTF-8
4
- src.dir=.
5
- tags.asp=false
6
- tags.short=false
7
- web.root=.
 
 
 
 
 
 
 
nbproject/project.xml DELETED
@@ -1,9 +0,0 @@
1
- <?xml version="1.0" encoding="UTF-8"?>
2
- <project xmlns="http://www.netbeans.org/ns/project/1">
3
- <type>org.netbeans.modules.php.project</type>
4
- <configuration>
5
- <data xmlns="http://www.netbeans.org/ns/php-project/1">
6
- <name>accesspress-social-counter</name>
7
- </data>
8
- </configuration>
9
- </project>
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -3,15 +3,15 @@ Contributors: Access Keys
3
  Tags: social count, social counter, social counters, social media counters, social media, social network, social profiles counter, social profile count, social profile, social icons, social icon counter
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 4.5
6
- Tested up to: 5.3.2
7
- Stable tag: 1.8.8
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  A plugin to display your social accounts fans, subscribers and followers number on your website with handful of backend settings.
12
 
13
  == Description ==
14
- [Homepage](https://accesspressthemes.com/) | [Documentation](https://accesspressthemes.com/documentation/accesspress-social-counter/) | [Support](https://accesspressthemes.com/support) | [Demo](http://demo.accesspressthemes.com/wordpress-plugins/accesspress-social-counter/) | [Premium Version](https://accesspressthemes.com/wordpress-plugins/accesspress-social-pro/)
15
 
16
  <strong>AccessPress Social Counter</strong> is a <strong>Free WordPress plugin</strong> to display your social accounts fans, subscribers and followers number on your website!
17
  A perfect plugin to show your social media stats and encourage more to join your network.
@@ -85,7 +85,6 @@ Note: If Instagram followers count is returning 0, it is due to change in the in
85
  = Some Useful Links =
86
  * <strong>Support Email</strong>: support@accesspressthemes.com
87
  * <strong>Support Forum Link</strong>: http://accesspressthemes.com/support/
88
- * <strong>Website Link</strong>: http://accesspressthemes.com/
89
  * <strong>Youtube channel link</strong>: https://www.youtube.com/watch?v=TjZNcVG3fDE
90
  * <strong>Facebook link</strong>: https://www.facebook.com/AccessPressThemes
91
 
@@ -100,22 +99,6 @@ For complete information and documentation regarding plugin,please visit below l
100
 
101
  [Demo](http://demo.accesspressthemes.com/wordpress-plugins/accesspress-social-counter/)
102
 
103
- == More Resources ==
104
- Themes Compatible With Our Plugin :
105
-
106
- AccessPress Social Counter works best with every WordPress theme. Its even more remarkable when used with popular themes of ours or any other being compatible to almost all of the themes.
107
-
108
- AND IF THIS PLUGIN HAS IMPRESSED YOU, THEN YOU WOULD ENJOY OUR OTHER PROJECTS TOO. DO CHECK THESE OUT :
109
-
110
- [WPAll Club](https://wpallclub.com/) - A complete WordPress resources club. WordPress tutorials, blogs, curated free and premium themes and plugins, WordPress deals, offers, hosting info and more.
111
-
112
- [Premium WordPress Themes](https://themeforest.net/user/accesskeys/portfolio) - 6 premium WordPress themes well suited for all sort of websites. Professional, well coded and highly configurable themes for you.
113
-
114
- [Premium WordPress Plugins](https://codecanyon.net/user/accesskeys/portfolio) - 45+ premium WordPress plugins of many different types. High user ratings, great quality and best sellers in CodeCanyon marketplace.
115
-
116
- [AccessPress Themes](https://accesspressthemes.com/) - AccessPress Themes has 50+ beautiful and elegant, fully responsive, multipurpose themes to meet your need for free and commercial basis.
117
-
118
- [8Degree Themes](https://8degreethemes.com/) - 8Degree Themes offers 15+ free WordPress themes and 16+ premium WordPress themes carefully crafted with creativity.
119
 
120
  == Installation ==
121
  1. Unzip accesspress-social-counter.zip
@@ -147,6 +130,11 @@ Once you install the plugin , you can check some general documentation about how
147
 
148
  == Changelog ==
149
 
 
 
 
 
 
150
  = 1.8.8 =
151
  * Added font awesome 4 and 5 compatibility settings in backend and frontend.
152
  * Added few css to solve font awesome issue.
3
  Tags: social count, social counter, social counters, social media counters, social media, social network, social profiles counter, social profile count, social profile, social icons, social icon counter
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 4.5
6
+ Tested up to: 5.5
7
+ Stable tag: 1.8.9
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
  A plugin to display your social accounts fans, subscribers and followers number on your website with handful of backend settings.
12
 
13
  == Description ==
14
+ [Documentation](https://accesspressthemes.com/documentation/accesspress-social-counter/) | [Support](https://accesspressthemes.com/support) | [Demo](http://demo.accesspressthemes.com/wordpress-plugins/accesspress-social-counter/) | [Premium Version](https://accesspressthemes.com/wordpress-plugins/accesspress-social-pro/)
15
 
16
  <strong>AccessPress Social Counter</strong> is a <strong>Free WordPress plugin</strong> to display your social accounts fans, subscribers and followers number on your website!
17
  A perfect plugin to show your social media stats and encourage more to join your network.
85
  = Some Useful Links =
86
  * <strong>Support Email</strong>: support@accesspressthemes.com
87
  * <strong>Support Forum Link</strong>: http://accesspressthemes.com/support/
 
88
  * <strong>Youtube channel link</strong>: https://www.youtube.com/watch?v=TjZNcVG3fDE
89
  * <strong>Facebook link</strong>: https://www.facebook.com/AccessPressThemes
90
 
99
 
100
  [Demo](http://demo.accesspressthemes.com/wordpress-plugins/accesspress-social-counter/)
101
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
102
 
103
  == Installation ==
104
  1. Unzip accesspress-social-counter.zip
130
 
131
  == Changelog ==
132
 
133
+ = 1.8.9 =
134
+ * Solved facebook page follower count issue.
135
+ * Added new settings for instagram and dribbble to fetch follower count.
136
+ * WordPress latest version compatibility checked.
137
+
138
  = 1.8.8 =
139
  * Added font awesome 4 and 5 compatibility settings in backend and frontend.
140
  * Added few css to solve font awesome issue.