Social Counter for WordPress – AccessPress Social Counter - Version 1.7.7

Version Description

  • WordPress 5.0 compatibility check
Download this release

Release Info

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

Code changes from version 1.7.6 to 1.7.7

accesspress-social-counter.php CHANGED
@@ -1,9 +1,11 @@
1
- <?php defined('ABSPATH') or die("No script kiddies please!");
 
 
2
  /**
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.7.5
7
  * Author: AccessPress Themes
8
  * Author URI: http://accesspressthemes.com
9
  * Text Domain: aps-counter
@@ -14,109 +16,109 @@
14
  /**
15
  * Declartion of necessary constants for plugin
16
  * */
17
- if (!defined('SC_IMAGE_DIR')) {
18
- define('SC_IMAGE_DIR', plugin_dir_url(__FILE__) . 'images');
19
  }
20
- if (!defined('SC_JS_DIR')) {
21
- define('SC_JS_DIR', plugin_dir_url(__FILE__) . 'js');
22
  }
23
- 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.7.5');
28
  }
29
  /**
30
  * Register of widgets
31
  * */
32
  include_once('inc/backend/widget.php');
33
- if (!class_exists('SC_Class')) {
34
 
35
- class SC_Class {
36
 
37
  var $apsc_settings;
38
 
39
  /**
40
- * Initializes the plugin functions
41
  */
42
- function __construct() {
43
- $this->apsc_settings = get_option('apsc_settings');
44
- register_activation_hook(__FILE__, array($this, 'load_default_settings')); //loads default settings for the plugin while activating the plugin
45
- add_action('init', array($this, 'plugin_text_domain')); //loads text domain for translation ready
46
- add_action('admin_menu', array($this, 'add_sc_menu')); //adds plugin menu in wp-admin
47
- add_action('admin_enqueue_scripts', array($this, 'register_admin_assets')); //registers admin assests such as js and css
48
- add_action('wp_enqueue_scripts', array($this, 'register_frontend_assets')); //registers js and css for frontend
49
- add_action('admin_post_apsc_settings_action', array($this, 'apsc_settings_action')); //recieves the posted values from settings form
50
- add_action('admin_post_apsc_restore_default', array($this, 'apsc_restore_default')); //restores default settings;
51
- add_action('widgets_init', array($this, 'register_apsc_widget')); //registers the widget
52
- add_shortcode('aps-counter', array($this, 'apsc_shortcode')); //adds a shortcode
53
- add_shortcode('aps-get-count',array($this,'apsc_count_shortcode')); //
54
- add_action('admin_post_apsc_delete_cache', array($this, 'apsc_delete_cache')); //deletes the counter values from cache
55
  }
56
 
57
  /**
58
  * Plugin Translation
59
  */
60
- function plugin_text_domain() {
61
- load_plugin_textdomain('accesspress-social-counter', false, basename(dirname(__FILE__)) . '/languages/');
62
  }
63
 
64
  /**
65
  * Load Default Settings
66
  * */
67
- function load_default_settings() {
68
- if (!get_option('apsc_settings')) {
69
- $apsc_settings = $this->get_default_settings();
70
- update_option('apsc_settings', $apsc_settings);
71
  }
72
  }
73
 
74
  /**
75
  * Plugin Admin Menu
76
  */
77
- function add_sc_menu() {
78
- add_menu_page(__('AccessPress Social Counter', 'accesspress-social-counter'), __('AccessPress Social Counter', 'accesspress-social-counter'), 'manage_options', 'ap-social-counter', array($this, 'sc_settings'), SC_IMAGE_DIR.'/sc-icon.png');
79
  }
80
 
81
  /**
82
  * Plugin Main Settings Page
83
  */
84
- function sc_settings() {
85
  include('inc/backend/settings.php');
86
  }
87
 
88
  /**
89
  * Registering of backend js and css
90
  */
91
- function register_admin_assets() {
92
- if (isset($_GET['page']) && $_GET['page'] == 'ap-social-counter') {
93
- wp_enqueue_style('sc-admin-css', SC_CSS_DIR . '/backend.css', array(), SC_VERSION);
94
- wp_enqueue_script('sc-admin-js', SC_JS_DIR . '/backend.js', array('jquery', 'jquery-ui-sortable'), SC_VERSION);
95
  }
96
 
97
- wp_enqueue_style('fontawesome-css', SC_CSS_DIR.'/font-awesome.min.css',false,SC_VERSION);
98
  }
99
 
100
  /**
101
  * Registers Frontend Assets
102
  * */
103
- function register_frontend_assets() {
104
- $apsc_settings = $this->apsc_settings;
105
- $enable_font_css = (isset($apsc_settings['disable_font_css']) && $apsc_settings['disable_font_css']==0)?true:false;
106
- $enable_frontend_css = (isset($apsc_settings['disable_frontend_css']) && $apsc_settings['disable_frontend_css']==0)?true:false;
107
- if($enable_font_css){
108
- wp_enqueue_style('fontawesome-css', SC_CSS_DIR.'/font-awesome.min.css',false,SC_VERSION);
109
  }
110
- if($enable_frontend_css){
111
- wp_enqueue_style('apsc-frontend-css', SC_CSS_DIR . '/frontend.css', array(), SC_VERSION);
112
  }
113
  }
114
 
115
  /**
116
  * Saves settings to database
117
  */
118
- function apsc_settings_action() {
119
- if (!empty($_POST) && wp_verify_nonce($_POST['apsc_settings_nonce'], 'apsc_settings_action')) {
120
  include('inc/backend/save-settings.php');
121
  }
122
  }
@@ -124,43 +126,42 @@ if (!class_exists('SC_Class')) {
124
  /**
125
  * Prints array in pre format
126
  */
127
- function print_array($array) {
128
  echo "<pre>";
129
- print_r($array);
130
  echo "</pre>";
131
  }
132
 
133
-
134
  /**
135
- * Restores the default
136
  */
137
- function apsc_restore_default() {
138
- if (!empty($_GET) && wp_verify_nonce($_GET['_wpnonce'], 'apsc-restore-default-nonce')) {
139
- $apsc_settings = $this->get_default_settings();
140
- update_option('apsc_settings', $apsc_settings);
141
- $_SESSION['apsc_message'] = __('Default Settings Restored Successfully', 'accesspress-social-counter');
142
- wp_redirect(admin_url() . 'admin.php?page=ap-social-counter');
143
  }
144
  }
145
 
146
  /**
147
  * Returns Default Settings
148
  */
149
- function get_default_settings() {
150
- $apsc_settings = array('social_profile' => array('facebook' => array('page_id' => ''),
151
- 'twitter' => array('username' => '', 'consumer_key' => '', 'consumer_secret' => '', 'access_token' => '', 'access_token_secret' => ''),
152
- 'googlePlus' => array('page_id' => '', 'api_key' => ''),
153
- 'instagram' => array('username' => '', 'access_token' => '','user_id'=>''),
154
- 'youtube' => array('username' => '', 'channel_url' => ''),
155
- 'soundcloud' => array('username' => '', 'client_id' => ''),
156
- 'dribbble' => array('username' => ''),
157
  ),
158
- 'profile_order' => array('facebook', 'twitter', 'googlePlus', 'instagram', 'youtube', 'soundcloud', 'dribbble', 'posts', 'comments'),
159
  'social_profile_theme' => 'theme-1',
160
- 'counter_format'=>'comma',
161
  'cache_period' => '',
162
- 'disable_font_css'=>0,
163
- 'disable_frontend_css'=>0
164
  );
165
  return $apsc_settings;
166
  }
@@ -168,14 +169,14 @@ if (!class_exists('SC_Class')) {
168
  /**
169
  * AccessPress Social Counter Widget
170
  */
171
- function register_apsc_widget() {
172
- register_widget('APSC_Widget');
173
  }
174
 
175
  /**
176
  * Adds Shortcode
177
  */
178
- function apsc_shortcode($atts) {
179
  ob_start();
180
  include('inc/frontend/shortcode.php');
181
  $html = ob_get_contents();
@@ -186,19 +187,19 @@ if (!class_exists('SC_Class')) {
186
  /**
187
  * Clears the counter cache
188
  */
189
- function apsc_delete_cache() {
190
- if (!empty($_GET) && wp_verify_nonce($_GET['_wpnonce'], 'apsc-cache-nonce')) {
191
- $transient_array = array('apsc_facebook', 'apsc_twitter', 'apsc_youtube', 'apsc_instagram', 'apsc_googlePlus', 'apsc_soundcloud', 'apsc_dribbble', 'apsc_posts', 'apsc_comments');
192
- foreach ($transient_array as $transient) {
193
- delete_transient($transient);
194
  }
195
- $_SESSION['apsc_message'] = __('Cache Deleted Successfully', 'accesspress-social-counter');
196
- wp_redirect(admin_url() . 'admin.php?page=ap-social-counter');
197
  }
198
  }
199
 
200
  /**
201
- *
202
  * @param type $user
203
  * @param type $consumer_key
204
  * @param type $consumer_secret
@@ -206,34 +207,34 @@ if (!class_exists('SC_Class')) {
206
  * @param type $oauth_access_token_secret
207
  * @return string
208
  */
209
- function authorization($user, $consumer_key, $consumer_secret, $oauth_access_token, $oauth_access_token_secret) {
210
  $query = 'screen_name=' . $user;
211
- $signature = $this->signature($query, $consumer_key, $consumer_secret, $oauth_access_token, $oauth_access_token_secret);
212
 
213
- return $this->header($signature);
214
  }
215
 
216
  /**
217
- *
218
  * @param type $url
219
  * @param type $query
220
  * @param type $method
221
  * @param type $params
222
  * @return type string
223
  */
224
- function signature_base_string($url, $query, $method, $params) {
225
  $return = array();
226
- ksort($params);
227
 
228
- foreach ($params as $key => $value) {
229
  $return[] = $key . '=' . $value;
230
  }
231
 
232
- return $method . "&" . rawurlencode($url) . '&' . rawurlencode(implode('&', $return)) . '%26' . rawurlencode($query);
233
  }
234
 
235
  /**
236
- *
237
  * @param type $query
238
  * @param type $consumer_key
239
  * @param type $consumer_secret
@@ -241,20 +242,20 @@ if (!class_exists('SC_Class')) {
241
  * @param type $oauth_access_token_secret
242
  * @return type array
243
  */
244
- function signature($query, $consumer_key, $consumer_secret, $oauth_access_token, $oauth_access_token_secret) {
245
  $oauth = array(
246
  'oauth_consumer_key' => $consumer_key,
247
- 'oauth_nonce' => hash_hmac('sha1', time(), true),
248
  'oauth_signature_method' => 'HMAC-SHA1',
249
  'oauth_token' => $oauth_access_token,
250
  'oauth_timestamp' => time(),
251
  'oauth_version' => '1.0'
252
  );
253
  $api_url = 'https://api.twitter.com/1.1/users/show.json';
254
- $base_info = $this->signature_base_string($api_url, $query, 'GET', $oauth);
255
- $composite_key = rawurlencode($consumer_secret) . '&' . rawurlencode($oauth_access_token_secret);
256
- $oauth_signature = base64_encode(hash_hmac('sha1', $base_info, $composite_key, true));
257
- $oauth['oauth_signature'] = $oauth_signature;
258
 
259
  return $oauth;
260
  }
@@ -266,15 +267,15 @@ if (!class_exists('SC_Class')) {
266
  *
267
  * @return string OAuth Authorization.
268
  */
269
- public function header($signature) {
270
  $return = 'OAuth ';
271
  $values = array();
272
 
273
- foreach ($signature as $key => $value) {
274
- $values[] = $key . '="' . rawurlencode($value) . '"';
275
  }
276
 
277
- $return .= implode(', ', $values);
278
 
279
  return $return;
280
  }
@@ -282,9 +283,9 @@ if (!class_exists('SC_Class')) {
282
  /**
283
  * Returns twitter count
284
  */
285
- function get_twitter_count() {
286
- $apsc_settings = $this->apsc_settings;
287
- $user = $apsc_settings['social_profile']['twitter']['username'];
288
  $api_url = 'https://api.twitter.com/1.1/users/show.json';
289
  $params = array(
290
  'method' => 'GET',
@@ -292,172 +293,162 @@ if (!class_exists('SC_Class')) {
292
  'timeout' => 60,
293
  'headers' => array(
294
  'Content-Type' => 'application/x-www-form-urlencoded',
295
- 'Authorization' => $this->authorization(
296
- $user, $apsc_settings['social_profile']['twitter']['consumer_key'], $apsc_settings['social_profile']['twitter']['consumer_secret'], $apsc_settings['social_profile']['twitter']['access_token'], $apsc_settings['social_profile']['twitter']['access_token_secret']
297
  )
298
  )
299
  );
300
 
301
- $connection = wp_remote_get($api_url . '?screen_name=' . $user, $params);
302
 
303
- if (is_wp_error($connection)) {
304
  $count = 0;
305
  } else {
306
- $_data = json_decode($connection['body'], true);
307
- if (isset($_data['followers_count'])) {
308
- $count = intval($_data['followers_count']);
309
-
310
  } else {
311
  $count = 0;
312
  }
313
  }
314
  return $count;
315
  }
316
-
317
  /**
318
- *
319
  * @param int $count
320
  * @param string $format
321
  */
322
- function get_formatted_count($count, $format) {
323
- if($count==''){
324
  return '';
325
  }
326
- switch ($format) {
327
  case 'comma':
328
- $count = number_format($count);
329
  break;
330
  case 'short':
331
- $count = $this->abreviateTotalCount($count);
332
  break;
333
  default:
334
  break;
335
  }
336
  return $count;
337
  }
338
-
339
- /**
340
- *
341
  * @param integer $value
342
  * @return string
343
  */
344
- function abreviateTotalCount($value) {
345
 
346
- $abbreviations = array(12 => 'T', 9 => 'B', 6 => 'M', 3 => 'K', 0 => '');
347
 
348
- foreach ($abbreviations as $exponent => $abbreviation) {
349
 
350
- if ($value >= pow(10, $exponent)) {
351
 
352
- return round(floatval($value / pow(10, $exponent)), 1) . $abbreviation;
353
  }
354
  }
355
  }
356
-
357
- function facebook_count($url){
358
-
359
  // Query in FQL
360
- $fql = "SELECT like_count ";
361
  $fql .= " FROM link_stat WHERE url = '$url'";
362
-
363
- $fqlURL = "https://api.facebook.com/method/fql.query?format=json&query=" . urlencode($fql);
364
-
365
  // Facebook Response is in JSON
366
- $response = wp_remote_get($fqlURL);
367
- $response = json_decode($response['body']);
368
- if(is_array($response) && isset($response[0]->like_count)){
369
- return $response[0]->like_count;
370
- }else{
371
  $count = '0';
372
  return $count;
373
  }
374
-
375
-
376
  }
377
-
378
- function get_count($social_media){
379
  include('inc/frontend/api.php');
380
  return $count;
381
  }
382
-
383
  /**
384
- *
385
  * Counter Only Shortcode
386
  * */
387
- function apsc_count_shortcode($atts){
388
- if(isset($atts['social_media'])){
389
- $count = $this->get_count($atts['social_media']);
390
- if(isset($atts['count_format']) && $count!=''){
391
- $count = $this->get_formatted_count($count,$atts['count_format']);
392
  }
393
  return $count;
394
  }
395
- }
396
-
397
- /**
398
- * Get Facebook Access Token
399
- * */
400
- function get_fb_access_token(){
401
- $apsc_settings = $this->apsc_settings;
402
  $api_url = 'https://graph.facebook.com/';
403
- $url = sprintf(
404
- '%soauth/access_token?client_id=%s&client_secret=%s&grant_type=client_credentials',
405
- $api_url,
406
- $apsc_settings['social_profile']['facebook']['app_id'] ,
407
- $apsc_settings['social_profile']['facebook']['app_secret']
408
- );
409
- $access_token = wp_remote_get( $url, array( 'timeout' => 60 ) );
410
- //echo "<pre>";
411
  // print_r($access_token);
412
  // echo "</pre>";
413
  // die();
414
- if ( is_wp_error( $access_token ) || ( isset( $access_token['response']['code'] ) && 200 != $access_token['response']['code'] ) ) {
415
- return '';
416
- } else {
417
- return sanitize_text_field( $access_token['body'] );
418
- }
419
- }
420
-
421
- /**
422
- * Get New Facebook Count
423
- * */
424
- function new_fb_count(){
425
- $apsc_settings = $this->apsc_settings;
426
- $access_token = $this->get_fb_access_token();
427
- $access_token = json_decode($access_token);
428
- $access_token = $access_token->access_token;
429
- $api_url = 'https://graph.facebook.com/v2.6/';
430
- $url = sprintf(
431
- '%s%s?fields=fan_count&access_token=%s',
432
- $api_url,
433
- $apsc_settings['social_profile']['facebook']['page_id'] ,
434
- $access_token
435
- );
436
-
437
- $connection = wp_remote_get( $url, array( 'timeout' => 60 ) );
438
- //echo "<pre>";
439
  // print_r($connection);
440
  // echo "</pre>";
441
  // die();
442
-
443
- if ( is_wp_error( $connection ) || ( isset( $connection['response']['code'] ) && 200 != $connection['response']['code'] ) ) {
444
- $total = 0;
445
- } else {
446
- $_data = json_decode( $connection['body'], true );
447
-
448
- if ( isset( $_data['fan_count'] ) ) {
449
- $count = intval( $_data['fan_count'] );
450
-
451
- $total = $count;
452
- } else {
453
- $total = 0;
454
- }
455
- }
456
-
457
-
458
- return $total;
459
- }
460
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
461
 
462
  }
463
 
1
+ <?php
2
+
3
+ defined( 'ABSPATH' ) or die( "No script kiddies please!" );
4
  /**
5
  * Plugin Name: AccessPress Social Counter
6
  * Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-social-counter/
7
+ * Description: A plugin to display your social accounts fans, subscribers and followers number on your website with handful of backend settings and interface.
8
+ * Version: 1.7.7
9
  * Author: AccessPress Themes
10
  * Author URI: http://accesspressthemes.com
11
  * Text Domain: aps-counter
16
  /**
17
  * Declartion of necessary constants for plugin
18
  * */
19
+ if ( ! defined( 'SC_IMAGE_DIR' ) ) {
20
+ define( 'SC_IMAGE_DIR', plugin_dir_url( __FILE__ ) . 'images' );
21
  }
22
+ if ( ! defined( 'SC_JS_DIR' ) ) {
23
+ define( 'SC_JS_DIR', plugin_dir_url( __FILE__ ) . 'js' );
24
  }
25
+ if ( ! defined( 'SC_CSS_DIR' ) ) {
26
+ define( 'SC_CSS_DIR', plugin_dir_url( __FILE__ ) . 'css' );
27
  }
28
+ if ( ! defined( 'SC_VERSION' ) ) {
29
+ define( 'SC_VERSION', '1.7.7' );
30
  }
31
  /**
32
  * Register of widgets
33
  * */
34
  include_once('inc/backend/widget.php');
35
+ if ( ! class_exists( 'SC_Class' ) ) {
36
 
37
+ class SC_Class{
38
 
39
  var $apsc_settings;
40
 
41
  /**
42
+ * Initializes the plugin functions
43
  */
44
+ function __construct(){
45
+ $this -> apsc_settings = get_option( 'apsc_settings' );
46
+ register_activation_hook( __FILE__, array( $this, 'load_default_settings' ) ); //loads default settings for the plugin while activating the plugin
47
+ add_action( 'init', array( $this, 'plugin_text_domain' ) ); //loads text domain for translation ready
48
+ add_action( 'admin_menu', array( $this, 'add_sc_menu' ) ); //adds plugin menu in wp-admin
49
+ add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_assets' ) ); //registers admin assests such as js and css
50
+ add_action( 'wp_enqueue_scripts', array( $this, 'register_frontend_assets' ) ); //registers js and css for frontend
51
+ add_action( 'admin_post_apsc_settings_action', array( $this, 'apsc_settings_action' ) ); //recieves the posted values from settings form
52
+ add_action( 'admin_post_apsc_restore_default', array( $this, 'apsc_restore_default' ) ); //restores default settings;
53
+ add_action( 'widgets_init', array( $this, 'register_apsc_widget' ) ); //registers the widget
54
+ add_shortcode( 'aps-counter', array( $this, 'apsc_shortcode' ) ); //adds a shortcode
55
+ add_shortcode( 'aps-get-count', array( $this, 'apsc_count_shortcode' ) ); //
56
+ add_action( 'admin_post_apsc_delete_cache', array( $this, 'apsc_delete_cache' ) ); //deletes the counter values from cache
57
  }
58
 
59
  /**
60
  * Plugin Translation
61
  */
62
+ function plugin_text_domain(){
63
+ load_plugin_textdomain( 'accesspress-social-counter', false, basename( dirname( __FILE__ ) ) . '/languages/' );
64
  }
65
 
66
  /**
67
  * Load Default Settings
68
  * */
69
+ function load_default_settings(){
70
+ if ( ! get_option( 'apsc_settings' ) ) {
71
+ $apsc_settings = $this -> get_default_settings();
72
+ update_option( 'apsc_settings', $apsc_settings );
73
  }
74
  }
75
 
76
  /**
77
  * Plugin Admin Menu
78
  */
79
+ function add_sc_menu(){
80
+ add_menu_page( __( 'AccessPress Social Counter', 'accesspress-social-counter' ), __( 'AccessPress Social Counter', 'accesspress-social-counter' ), 'manage_options', 'ap-social-counter', array( $this, 'sc_settings' ), SC_IMAGE_DIR . '/sc-icon.png' );
81
  }
82
 
83
  /**
84
  * Plugin Main Settings Page
85
  */
86
+ function sc_settings(){
87
  include('inc/backend/settings.php');
88
  }
89
 
90
  /**
91
  * Registering of backend js and css
92
  */
93
+ function register_admin_assets(){
94
+ if ( isset( $_GET[ 'page' ] ) && $_GET[ 'page' ] == 'ap-social-counter' ) {
95
+ wp_enqueue_style( 'sc-admin-css', SC_CSS_DIR . '/backend.css', array(), SC_VERSION );
96
+ wp_enqueue_script( 'sc-admin-js', SC_JS_DIR . '/backend.js', array( 'jquery', 'jquery-ui-sortable' ), SC_VERSION );
97
  }
98
 
99
+ wp_enqueue_style( 'fontawesome-css', SC_CSS_DIR . '/font-awesome.min.css', false, SC_VERSION );
100
  }
101
 
102
  /**
103
  * Registers Frontend Assets
104
  * */
105
+ function register_frontend_assets(){
106
+ $apsc_settings = $this -> apsc_settings;
107
+ $enable_font_css = (isset( $apsc_settings[ 'disable_font_css' ] ) && $apsc_settings[ 'disable_font_css' ] == 0) ? true : false;
108
+ $enable_frontend_css = (isset( $apsc_settings[ 'disable_frontend_css' ] ) && $apsc_settings[ 'disable_frontend_css' ] == 0) ? true : false;
109
+ if ( $enable_font_css ) {
110
+ wp_enqueue_style( 'fontawesome-css', SC_CSS_DIR . '/font-awesome.min.css', false, SC_VERSION );
111
  }
112
+ if ( $enable_frontend_css ) {
113
+ wp_enqueue_style( 'apsc-frontend-css', SC_CSS_DIR . '/frontend.css', array(), SC_VERSION );
114
  }
115
  }
116
 
117
  /**
118
  * Saves settings to database
119
  */
120
+ function apsc_settings_action(){
121
+ if ( ! empty( $_POST ) && wp_verify_nonce( $_POST[ 'apsc_settings_nonce' ], 'apsc_settings_action' ) ) {
122
  include('inc/backend/save-settings.php');
123
  }
124
  }
126
  /**
127
  * Prints array in pre format
128
  */
129
+ function print_array( $array ){
130
  echo "<pre>";
131
+ print_r( $array );
132
  echo "</pre>";
133
  }
134
 
 
135
  /**
136
+ * Restores the default
137
  */
138
+ function apsc_restore_default(){
139
+ if ( ! empty( $_GET ) && wp_verify_nonce( $_GET[ '_wpnonce' ], 'apsc-restore-default-nonce' ) ) {
140
+ $apsc_settings = $this -> get_default_settings();
141
+ update_option( 'apsc_settings', $apsc_settings );
142
+ $_SESSION[ 'apsc_message' ] = __( 'Default Settings Restored Successfully', 'accesspress-social-counter' );
143
+ wp_redirect( admin_url() . 'admin.php?page=ap-social-counter' );
144
  }
145
  }
146
 
147
  /**
148
  * Returns Default Settings
149
  */
150
+ function get_default_settings(){
151
+ $apsc_settings = array( 'social_profile' => array( 'facebook' => array( 'page_id' => '' ),
152
+ 'twitter' => array( 'username' => '', 'consumer_key' => '', 'consumer_secret' => '', 'access_token' => '', 'access_token_secret' => '' ),
153
+ 'googlePlus' => array( 'page_id' => '', 'api_key' => '' ),
154
+ 'instagram' => array( 'username' => '', 'access_token' => '', 'user_id' => '' ),
155
+ 'youtube' => array( 'username' => '', 'channel_url' => '' ),
156
+ 'soundcloud' => array( 'username' => '', 'client_id' => '' ),
157
+ 'dribbble' => array( 'username' => '' ),
158
  ),
159
+ 'profile_order' => array( 'facebook', 'twitter', 'googlePlus', 'instagram', 'youtube', 'soundcloud', 'dribbble', 'posts', 'comments' ),
160
  'social_profile_theme' => 'theme-1',
161
+ 'counter_format' => 'comma',
162
  'cache_period' => '',
163
+ 'disable_font_css' => 0,
164
+ 'disable_frontend_css' => 0
165
  );
166
  return $apsc_settings;
167
  }
169
  /**
170
  * AccessPress Social Counter Widget
171
  */
172
+ function register_apsc_widget(){
173
+ register_widget( 'APSC_Widget' );
174
  }
175
 
176
  /**
177
  * Adds Shortcode
178
  */
179
+ function apsc_shortcode( $atts ){
180
  ob_start();
181
  include('inc/frontend/shortcode.php');
182
  $html = ob_get_contents();
187
  /**
188
  * Clears the counter cache
189
  */
190
+ function apsc_delete_cache(){
191
+ if ( ! empty( $_GET ) && wp_verify_nonce( $_GET[ '_wpnonce' ], 'apsc-cache-nonce' ) ) {
192
+ $transient_array = array( 'apsc_facebook', 'apsc_twitter', 'apsc_youtube', 'apsc_instagram', 'apsc_googlePlus', 'apsc_soundcloud', 'apsc_dribbble', 'apsc_posts', 'apsc_comments' );
193
+ foreach ( $transient_array as $transient ) {
194
+ delete_transient( $transient );
195
  }
196
+ $_SESSION[ 'apsc_message' ] = __( 'Cache Deleted Successfully', 'accesspress-social-counter' );
197
+ wp_redirect( admin_url() . 'admin.php?page=ap-social-counter' );
198
  }
199
  }
200
 
201
  /**
202
+ *
203
  * @param type $user
204
  * @param type $consumer_key
205
  * @param type $consumer_secret
207
  * @param type $oauth_access_token_secret
208
  * @return string
209
  */
210
+ function authorization( $user, $consumer_key, $consumer_secret, $oauth_access_token, $oauth_access_token_secret ){
211
  $query = 'screen_name=' . $user;
212
+ $signature = $this -> signature( $query, $consumer_key, $consumer_secret, $oauth_access_token, $oauth_access_token_secret );
213
 
214
+ return $this -> header( $signature );
215
  }
216
 
217
  /**
218
+ *
219
  * @param type $url
220
  * @param type $query
221
  * @param type $method
222
  * @param type $params
223
  * @return type string
224
  */
225
+ function signature_base_string( $url, $query, $method, $params ){
226
  $return = array();
227
+ ksort( $params );
228
 
229
+ foreach ( $params as $key => $value ) {
230
  $return[] = $key . '=' . $value;
231
  }
232
 
233
+ return $method . "&" . rawurlencode( $url ) . '&' . rawurlencode( implode( '&', $return ) ) . '%26' . rawurlencode( $query );
234
  }
235
 
236
  /**
237
+ *
238
  * @param type $query
239
  * @param type $consumer_key
240
  * @param type $consumer_secret
242
  * @param type $oauth_access_token_secret
243
  * @return type array
244
  */
245
+ function signature( $query, $consumer_key, $consumer_secret, $oauth_access_token, $oauth_access_token_secret ){
246
  $oauth = array(
247
  'oauth_consumer_key' => $consumer_key,
248
+ 'oauth_nonce' => hash_hmac( 'sha1', time(), true ),
249
  'oauth_signature_method' => 'HMAC-SHA1',
250
  'oauth_token' => $oauth_access_token,
251
  'oauth_timestamp' => time(),
252
  'oauth_version' => '1.0'
253
  );
254
  $api_url = 'https://api.twitter.com/1.1/users/show.json';
255
+ $base_info = $this -> signature_base_string( $api_url, $query, 'GET', $oauth );
256
+ $composite_key = rawurlencode( $consumer_secret ) . '&' . rawurlencode( $oauth_access_token_secret );
257
+ $oauth_signature = base64_encode( hash_hmac( 'sha1', $base_info, $composite_key, true ) );
258
+ $oauth[ 'oauth_signature' ] = $oauth_signature;
259
 
260
  return $oauth;
261
  }
267
  *
268
  * @return string OAuth Authorization.
269
  */
270
+ public function header( $signature ){
271
  $return = 'OAuth ';
272
  $values = array();
273
 
274
+ foreach ( $signature as $key => $value ) {
275
+ $values[] = $key . '="' . rawurlencode( $value ) . '"';
276
  }
277
 
278
+ $return .= implode( ', ', $values );
279
 
280
  return $return;
281
  }
283
  /**
284
  * Returns twitter count
285
  */
286
+ function get_twitter_count(){
287
+ $apsc_settings = $this -> apsc_settings;
288
+ $user = $apsc_settings[ 'social_profile' ][ 'twitter' ][ 'username' ];
289
  $api_url = 'https://api.twitter.com/1.1/users/show.json';
290
  $params = array(
291
  'method' => 'GET',
293
  'timeout' => 60,
294
  'headers' => array(
295
  'Content-Type' => 'application/x-www-form-urlencoded',
296
+ 'Authorization' => $this -> authorization(
297
+ $user, $apsc_settings[ 'social_profile' ][ 'twitter' ][ 'consumer_key' ], $apsc_settings[ 'social_profile' ][ 'twitter' ][ 'consumer_secret' ], $apsc_settings[ 'social_profile' ][ 'twitter' ][ 'access_token' ], $apsc_settings[ 'social_profile' ][ 'twitter' ][ 'access_token_secret' ]
298
  )
299
  )
300
  );
301
 
302
+ $connection = wp_remote_get( $api_url . '?screen_name=' . $user, $params );
303
 
304
+ if ( is_wp_error( $connection ) ) {
305
  $count = 0;
306
  } else {
307
+ $_data = json_decode( $connection[ 'body' ], true );
308
+ if ( isset( $_data[ 'followers_count' ] ) ) {
309
+ $count = intval( $_data[ 'followers_count' ] );
 
310
  } else {
311
  $count = 0;
312
  }
313
  }
314
  return $count;
315
  }
316
+
317
  /**
318
+ *
319
  * @param int $count
320
  * @param string $format
321
  */
322
+ function get_formatted_count( $count, $format ){
323
+ if ( $count == '' ) {
324
  return '';
325
  }
326
+ switch ( $format ) {
327
  case 'comma':
328
+ $count = number_format( $count );
329
  break;
330
  case 'short':
331
+ $count = $this -> abreviateTotalCount( $count );
332
  break;
333
  default:
334
  break;
335
  }
336
  return $count;
337
  }
338
+
339
+ /**
340
+ *
341
  * @param integer $value
342
  * @return string
343
  */
344
+ function abreviateTotalCount( $value ){
345
 
346
+ $abbreviations = array( 12 => 'T', 9 => 'B', 6 => 'M', 3 => 'K', 0 => '' );
347
 
348
+ foreach ( $abbreviations as $exponent => $abbreviation ) {
349
 
350
+ if ( $value >= pow( 10, $exponent ) ) {
351
 
352
+ return round( floatval( $value / pow( 10, $exponent ) ), 1 ) . $abbreviation;
353
  }
354
  }
355
  }
356
+
357
+ function facebook_count( $url ){
358
+
359
  // Query in FQL
360
+ $fql = "SELECT like_count ";
361
  $fql .= " FROM link_stat WHERE url = '$url'";
362
+
363
+ $fqlURL = "https://api.facebook.com/method/fql.query?format=json&query=" . urlencode( $fql );
364
+
365
  // Facebook Response is in JSON
366
+ $response = wp_remote_get( $fqlURL );
367
+ $response = json_decode( $response[ 'body' ] );
368
+ if ( is_array( $response ) && isset( $response[ 0 ] -> like_count ) ) {
369
+ return $response[ 0 ] -> like_count;
370
+ } else {
371
  $count = '0';
372
  return $count;
373
  }
 
 
374
  }
375
+
376
+ function get_count( $social_media ){
377
  include('inc/frontend/api.php');
378
  return $count;
379
  }
380
+
381
  /**
382
+ *
383
  * Counter Only Shortcode
384
  * */
385
+ function apsc_count_shortcode( $atts ){
386
+ if ( isset( $atts[ 'social_media' ] ) ) {
387
+ $count = $this -> get_count( $atts[ 'social_media' ] );
388
+ if ( isset( $atts[ 'count_format' ] ) && $count != '' ) {
389
+ $count = $this -> get_formatted_count( $count, $atts[ 'count_format' ] );
390
  }
391
  return $count;
392
  }
393
+ }
394
+
395
+ /**
396
+ * Get Facebook Access Token
397
+ * */
398
+ function get_fb_access_token(){
399
+ $apsc_settings = $this -> apsc_settings;
400
  $api_url = 'https://graph.facebook.com/';
401
+ $url = sprintf(
402
+ '%soauth/access_token?client_id=%s&client_secret=%s&grant_type=client_credentials', $api_url, $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'app_id' ], $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'app_secret' ]
403
+ );
404
+ $access_token = wp_remote_get( $url, array( 'timeout' => 60 ) );
405
+ //echo "<pre>";
 
 
 
406
  // print_r($access_token);
407
  // echo "</pre>";
408
  // die();
409
+ if ( is_wp_error( $access_token ) || ( isset( $access_token[ 'response' ][ 'code' ] ) && 200 != $access_token[ 'response' ][ 'code' ] ) ) {
410
+ return '';
411
+ } else {
412
+ return sanitize_text_field( $access_token[ 'body' ] );
413
+ }
414
+ }
415
+
416
+ /**
417
+ * Get New Facebook Count
418
+ * */
419
+ function new_fb_count(){
420
+ $apsc_settings = $this -> apsc_settings;
421
+ $access_token = $this -> get_fb_access_token();
422
+ $access_token = json_decode( $access_token );
423
+ $access_token = $access_token -> access_token;
424
+ $api_url = 'https://graph.facebook.com/v2.6/';
425
+ $url = sprintf(
426
+ '%s%s?fields=fan_count&access_token=%s', $api_url, $apsc_settings[ 'social_profile' ][ 'facebook' ][ 'page_id' ], $access_token
427
+ );
428
+
429
+ $connection = wp_remote_get( $url, array( 'timeout' => 60 ) );
430
+ //echo "<pre>";
 
 
 
431
  // print_r($connection);
432
  // echo "</pre>";
433
  // die();
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
434
 
435
+ if ( is_wp_error( $connection ) || ( isset( $connection[ 'response' ][ 'code' ] ) && 200 != $connection[ 'response' ][ 'code' ] ) ) {
436
+ $total = 0;
437
+ } else {
438
+ $_data = json_decode( $connection[ 'body' ], true );
439
+
440
+ if ( isset( $_data[ 'fan_count' ] ) ) {
441
+ $count = intval( $_data[ 'fan_count' ] );
442
+
443
+ $total = $count;
444
+ } else {
445
+ $total = 0;
446
+ }
447
+ }
448
+
449
+
450
+ return $total;
451
+ }
452
 
453
  }
454
 
images/Thumbs.db DELETED
Binary file
inc/backend/boards/about.php CHANGED
@@ -1,74 +1,70 @@
1
  <div class="apsc-boards-tabs" id="apsc-board-about-settings" style="display: none;">
2
- <div class="apsc-tab-wrapper">
3
- <p><strong>AccessPress Social Counter </strong> - is a FREE WordPress Plugin by AccessPress Themes. </p>
4
 
5
- <p>AccessPress Themes is a venture of Access Keys - who has developed hundreds of Custom WordPress themes and plugins for its clients over the years. </p>
6
 
7
- <p><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!
8
- A perfect plugin to show your social media stats and encourage more to join your network.
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
9
 
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.
11
 
12
- All you have to do is either use a widget or shortcode to display your social media counter right on your website in your chosen location!
13
 
14
- The available social media in FREE version are: Facebook, Twitter, Google+, Instagram, Youtube, Sound Cloud and Dribbble along with Posts and Comments count. </p>
15
- <div class="halfseperator"></div>
16
- <p><strong>Please visit our product page for more details here:</strong><br />
17
- <a href="https://accesspressthemes.com/wordpress-plugins/accesspress-social-counter/" target="_blank">https://accesspressthemes.com/wordpress-plugins/accesspress-social-counter/</a></p>
18
- <div class="halfseperator"></div>
19
- <p><strong>Plugin documentation can be found here:</strong><br />
20
- <a href="https://accesspressthemes.com/documentation/accesspress-social-counter/" target="_blank">https://accesspressthemes.com/documentation/accesspress-social-counter/</a></p>
21
- <div class="halfseperator"></div>
22
-
23
-
24
- <h3 class="sub-title">More from AccessPress Themes</h3>
25
- <div class="product">
26
- <a href="http://accesspressthemes.com/plugins" target="_blank">
27
- <span class="product-title">WordPress Plugins</span>
28
- <img src="<?php echo SC_IMAGE_DIR;?>/plugin.png" alt="<?php esc_attr_e('WordPress Plugins','accesspress-anonymous-post'); ?>" />
29
- </a>
30
- </div>
31
-
32
-
33
-
34
 
35
- <div class="product">
36
- <a href="http://accesspressthemes.com/wordpress-themes" target="_blank">
37
- <span class="product-title">WordPress Themes</span>
38
- <img src="<?php echo SC_IMAGE_DIR;?>/theme.png" alt="<?php esc_attr_e('WordPress Themes','accesspress-anonymous-post'); ?>" />
39
- </a>
40
- </div>
41
-
42
- <div class="product">
43
- <a href="http://accesspressthemes.com/contact" target="_blank">
44
- <span class="product-title">WordPress Customization</span>
45
- <img src="<?php echo SC_IMAGE_DIR;?>/customize.png" alt="<?php esc_attr_e('WordPress Customization','accesspress-anonymous-post'); ?>" />
46
- </a>
47
- </div>
48
 
 
 
 
 
 
 
49
 
50
- <div class="seperator"></div><div class="dottedline"></div><div class="seperator"></div>
51
 
52
- <h3 class="sub-title">Get in touch</h3>
53
- <p>If you’ve any question/feedback, please get in touch: <br />
54
- <strong>General enquiries:</strong> <a href="mailto:info@accesspressthemes.com">info@accesspressthemes.com</a><br />
55
- <strong>Support:</strong> <a href="mailto:support@accesspressthemes.com">support@accesspressthemes.com</a><br />
56
- <strong>Sales:</strong> <a href="mailto:sales@accesspressthemes.com">sales@accesspressthemes.com</a>
57
- </p>
58
- <div class="seperator"></div><div class="dottedline"></div><div class="seperator"></div>
59
- <h3 class="sub-title">Get social</h3>
60
- <p>Get connected with us on social media. Facebook is the best place to find updates on our themes/plugins: </p>
61
 
 
 
 
 
 
 
 
 
 
62
 
63
- <p><strong>Like us on facebook:</strong><br />
64
- <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>
65
 
66
- <ul class="social-icon">
67
- <li><a href="https://plus.google.com/u/0/+Accesspressthemesprofile/about" target="_blank"><img src="<?php echo SC_IMAGE_DIR;?>/googleplus.png" alt="google+"></a></li>
68
- <li><a href="http://www.pinterest.com/accesspresswp/" target="_blank"><img src="<?php echo SC_IMAGE_DIR;?>/pinterest.png" alt="pinterest"></a></li>
69
- <li><a href="https://www.flickr.com/photos/accesspressthemes/" target="_blank"><img src="<?php echo SC_IMAGE_DIR;?>/flicker.png" alt="flicker"></a></li>
70
- <li><a href="https://twitter.com/apthemes" target="_blank"><img src="<?php echo SC_IMAGE_DIR;?>/twitter.png" alt="twitter"/></a></li>
71
- </ul>
72
 
73
- </div>
74
- </div>
 
 
 
 
 
 
 
1
  <div class="apsc-boards-tabs" id="apsc-board-about-settings" style="display: none;">
2
+ <div class="apsc-tab-wrapper">
3
+ <p><strong><?php _e( 'AccessPress Social Counter', 'accesspress-social-counter' ); ?> </strong> - <?php _e( 'is a FREE WordPress Plugin by AccessPress Themes.', 'accesspress-social-counter' ); ?> </p>
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.
11
+ All you have to do is either use a widget or shortcode to display your social media counter right on your website in your chosen location !
12
+ The available social media in FREE version are: Facebook, Twitter, Google+, Instagram, Youtube, Sound Cloud and Dribbble along with Posts and Comments count.', 'accesspress-social-counter' ); ?> </p>
13
+ <div class = "halfseperator"></div>
14
+ <p><strong><?php _e( 'Please visit our product page for more details here:', 'accesspress-social-counter' ); ?></strong><br />
15
+ <a href = "https://accesspressthemes.com/wordpress-plugins/accesspress-social-counter/" target = "_blank">https://accesspressthemes.com/wordpress-plugins/accesspress-social-counter/</a></p>
16
+ <div class = "halfseperator"></div>
17
+ <p><strong><?php _e( 'Plugin documentation can be found here:', 'accesspress-social-counter' ); ?></strong><br />
18
+ <a href = "https://accesspressthemes.com/documentation/accesspress-social-counter/" target = "_blank">https://accesspressthemes.com/documentation/accesspress-social-counter/</a></p>
19
+ <div class = "halfseperator"></div>
20
+ <h3 class = "sub-title"><?php _e( 'More from AccessPress Themes', 'accesspress-social-counter' ); ?></h3>
21
+ <div class = "product">
22
+ <a href = "http://accesspressthemes.com/plugins" target = "_blank">
23
+ <span class = "product-title"><?php _e( 'WordPress Plugins', 'accesspress-social-counter' ); ?></span>
24
+ <img src = "<?php echo SC_IMAGE_DIR; ?>/plugin.png" alt = "<?php esc_attr_e( 'WordPress Plugins', 'accesspress-social-counter' ); ?>" />
25
+ </a>
26
+ </div>
27
 
 
28
 
 
29
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
30
 
31
+ <div class = "product">
32
+ <a href = "http://accesspressthemes.com/wordpress-themes" target = "_blank">
33
+ <span class = "product-title"><?php _e( 'WordPress Themes', 'accesspress-social-counter' ); ?></span>
34
+ <img src = "<?php echo SC_IMAGE_DIR; ?>/theme.png" alt = "<?php esc_attr_e( 'WordPress Themes', 'accesspress-social-counter' ); ?>" />
35
+ </a>
36
+ </div>
 
 
 
 
 
 
 
37
 
38
+ <div class = "product">
39
+ <a href = "http://accesspressthemes.com/contact" target = "_blank">
40
+ <span class = "product-title"><?php _e( 'WordPress Customization', 'accesspress-social-counter' ); ?></span>
41
+ <img src = "<?php echo SC_IMAGE_DIR; ?>/customize.png" alt = "<?php esc_attr_e( 'WordPress Customization', 'accesspress-social-counter' ); ?>" />
42
+ </a>
43
+ </div>
44
 
 
45
 
46
+ <div class = "seperator"></div><div class = "dottedline"></div><div class = "seperator"></div>
 
 
 
 
 
 
 
 
47
 
48
+ <h3 class = "sub-title"><?php _e( 'Get in touch', 'accesspress-social-counter' ); ?></h3>
49
+ <p><?php _e( 'If you’ve any question/feedback, please get in touch:', 'accesspress-social-counter' ); ?> <br />
50
+ <strong><?php _e( 'General enquiries', 'accesspress-social-counter' ); ?>:</strong> <a href = "mailto:info@accesspressthemes.com">info@accesspressthemes.com</a><br />
51
+ <strong><?php _e( 'Support', 'accesspress-social-counter' ); ?>:</strong> <a href = "mailto:support@accesspressthemes.com">support@accesspressthemes.com</a><br />
52
+ <strong><?php _e( 'Sales', 'accesspress-social-counter' ); ?>:</strong> <a href = "mailto:sales@accesspressthemes.com">sales@accesspressthemes.com</a>
53
+ </p>
54
+ <div class = "seperator"></div><div class = "dottedline"></div><div class = "seperator"></div>
55
+ <h3 class = "sub-title"><?php _e( 'Get social', 'accesspress-social-counter' ); ?></h3>
56
+ <p><?php _e( 'Get connected with us on social media. Facebook is the best place to find updates on our themes/plugins', 'accesspress-social-counter' ); ?>: </p>
57
 
 
 
58
 
59
+ <p><strong><?php _e( 'Like us on facebook', 'accesspress-social-counter' ); ?>:</strong><br />
60
+ <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>
 
 
 
 
61
 
62
+ <ul class = "social-icon">
63
+ <li><a href = "https://plus.google.com/u/0/+Accesspressthemesprofile/about" target = "_blank"><img src = "<?php echo SC_IMAGE_DIR; ?>/googleplus.png" alt = "google+"></a></li>
64
+ <li><a href = "http://www.pinterest.com/accesspresswp/" target = "_blank"><img src = "<?php echo SC_IMAGE_DIR; ?>/pinterest.png" alt = "pinterest"></a></li>
65
+ <li><a href = "https://www.flickr.com/photos/accesspressthemes/" target = "_blank"><img src = "<?php echo SC_IMAGE_DIR; ?>/flicker.png" alt = "flicker"></a></li>
66
+ <li><a href = "https://twitter.com/apthemes" target = "_blank"><img src = "<?php echo SC_IMAGE_DIR; ?>/twitter.png" alt = "twitter"/></a></li>
67
+ </ul>
68
+
69
+ </div>
70
+ </div>
inc/backend/boards/how-to-use.php CHANGED
@@ -1,15 +1,14 @@
1
  <div class="apsc-boards-tabs" id="apsc-board-how_to_use-settings" style="display:none">
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
-
5
- <p>You can also pass the theme parameter in the shorcode to get the desired theme while displaying the count. For example [aps-counter theme="theme-1"] . There are 5 available themes so you can change theme-1 upto theme-5 . </p>
6
- <p>For the complete documentation please visit:<br/> <a href="https://accesspressthemes.com/documentation/accesspress-social-counter/" target="_blank">https://accesspressthemes.com/documentation/accesspress-social-counter/</a></p>
7
- <p>To get the individual count, please use below shortcode</p><br /><br />
8
  [aps-get-count social_media="facebook/twitter/googlePlus/instagram/youtube/soundcloud/dribbble/posts/comments" count_format="default/comma/short"]
9
  <p><strong>Note</strong>: Use any value separated by "/" . For example [aps-get-count social_media="facebook" count_format="short"]</p>
10
-
11
- <p>You can check our full plugin setup tutorial in below video.</p>
12
  <iframe width="560" height="315" src="https://www.youtube.com/embed/3WAvqRrHzkM?controls=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>
13
-
14
  </div>
15
  </div>
1
  <div class="apsc-boards-tabs" id="apsc-board-how_to_use-settings" style="display:none">
2
  <div class="apsc-tab-wrapper">
3
+ <p><?php _e( 'To display the social profiles with counter, you can either use', 'accesspress-social-counter' ); ?> [aps-counter] <strong><?php _e( 'Shortcode', 'accesspress-social-counter' ); ?></strong><?php _e( 'or you can use', 'accesspress-social-counter' ); ?> <strong><?php _e( 'AccessPress Social Counter Widget', 'accesspress-social-counter' ); ?></strong><?php _e( "from Appearance's widget section.", 'accesspress-social-counter' ); ?></p>
4
+ <p><?php _e( 'You can also pass the theme parameter in the shorcode to get the desired theme while displaying the count. For example [aps-counter theme="theme-1"] . There are 5 available themes so you can change theme-1 upto theme-5.', 'accesspress-social-counter' ); ?> </p>
5
+ <p><?php _e( 'For the complete documentation please visit:', 'accesspress-social-counter' ); ?><br/> <a href="https://accesspressthemes.com/documentation/accesspress-social-counter/" target="_blank">https://accesspressthemes.com/documentation/accesspress-social-counter/</a></p>
6
+ <p><?php _e( 'To get the individual count, please use below shortcode', 'accesspress-social-counter' ); ?></p><br /><br />
 
7
  [aps-get-count social_media="facebook/twitter/googlePlus/instagram/youtube/soundcloud/dribbble/posts/comments" count_format="default/comma/short"]
8
  <p><strong>Note</strong>: Use any value separated by "/" . For example [aps-get-count social_media="facebook" count_format="short"]</p>
9
+
10
+ <p><?php _e( 'You can check our full plugin setup tutorial in below video.', 'accesspress-social-counter' ); ?></p>
11
  <iframe width="560" height="315" src="https://www.youtube.com/embed/3WAvqRrHzkM?controls=0&amp;showinfo=0" frameborder="0" allowfullscreen></iframe>
12
+
13
  </div>
14
  </div>
inc/backend/boards/more-wp.php DELETED
@@ -1,19 +0,0 @@
1
- <div class="apsc-boards-tabs" id="apsc-board-morewp-settings" style="display: none;">
2
- <div class="apsc-tab-wrapper">
3
- <div>
4
- <p><strong>AccessPress Social Counter</strong> works best with every WordPress theme. It's even more remarkable when used with popular themes like VMagazine and AccessPress Parallax.</p>
5
-
6
- <p>AND IF THIS PLUGIN HAS IMPRESSED YOU, THEN YOU WOULD ENJOY OUR OTHER PROJECTS TOO. DO CHECK THESE OUT :</p>
7
-
8
- <p><a href="https://wpall.club/">WPAll Club</a> - A complete WordPress resources club. WordPress tutorials, blogs, curated free and premium themes and plugins, WordPress deals, offers, hosting info and more.</p>
9
-
10
- <p> <a href="https://themeforest.net/user/accesskeys/portfolio">Premium WordPress Themes</a> - <strong>6 premium WordPress</strong> themes well suited for all sort of websites. Professional, well coded and highly configurable themes for you. </p>
11
-
12
- <p> <a href="https://codecanyon.net/user/accesskeys/portfolio?Ref=AccessKeys">Premium WordPress Plugins</a> - <strong>45+ premium WordPress plugins</strong> of many different types. High user ratings, great quality and best sellers in CodeCanyon marketplace. </p>
13
-
14
- <p> <a href="https://accesspressthemes.com/">AccessPress Themes</a> - <strong>AccessPress Themes</strong> has 50+ beautiful and elegant, fully responsive, multipurpose themes to meet your need for free and commercial basis.</p>
15
-
16
- <p> <a href="https://8degreethemes.com/">8Degree Themes</a> - <strong>8Degree Themes</strong> offers 15+ free WordPress themes and 16+ premium WordPress themes carefully crafted with creativity.</p>
17
- </div>
18
- </div>
19
- </div>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
inc/backend/boards/system-status.php CHANGED
@@ -1,39 +1,36 @@
1
  <div class="apsc-boards-tabs" id="apsc-board-system-status" style="display:none">
2
- <div class="apsc-tab-wrapper">
3
- <div class="apsc-option-inner-wrapper">
4
- <label>fsockopen/cURL</label>
5
- <div class="apsc-option-field">
6
- <?php
7
  if ( function_exists( 'fsockopen' ) || function_exists( 'curl_init' ) ) {
8
- if ( function_exists( 'fsockopen' ) && function_exists( 'curl_init' ) ) {
9
- _e( 'Your server has fsockopen and cURL enabled.', 'accesspress-social-counter' );
10
- } elseif ( function_exists( 'fsockopen' ) ) {
11
- _e( 'Your server has fsockopen enabled, cURL is disabled.', 'accesspress-social-counter' );
12
- } else {
13
- _e( 'Your server has cURL enabled, fsockopen is disabled.', 'accesspress-social-counter' );
14
- }
15
-
16
-
17
- }
18
  ?>
19
- </div>
20
- </div>
21
  <div class="apsc-option-inner-wrapper">
22
- <label>WP Remote Get</label>
23
- <div class="apsc-option-field">
24
- <?php
25
-
26
- $response = wp_remote_get( 'https://httpbin.org/ip', array( 'timeout' => 60 ) );
27
 
28
- if ( ! is_wp_error( $response ) && $response['response']['code'] >= 200 && $response['response']['code'] < 300 ) {
29
-
30
- _e( 'wp_remote_get() was successful.', 'accesspress-social-counter' );
31
- } elseif ( is_wp_error( $response ) ) {
32
- _e( 'wp_remote_get() failed. This plugin won\'t work with your server. Contact your hosting provider. Error:', 'accesspress-social-counter' ) . ' ' . $response->get_error_message();
33
- }
34
- ?>
35
- </div>
36
- </div>
37
- <div class="apsc-extra-note"><?php _e('Note: The plugin will only work properly if fsockopen/cURL and wp_remote_get is working in your server.','accesspress-social-counter');?></div>
38
- </div>
39
  </div>
1
  <div class="apsc-boards-tabs" id="apsc-board-system-status" style="display:none">
2
+ <div class="apsc-tab-wrapper">
3
+ <div class="apsc-option-inner-wrapper">
4
+ <label><?php _e( 'fsockopen/cURL', 'accesspress-social-counter' ); ?></label>
5
+ <div class="apsc-option-field">
6
+ <?php
7
  if ( function_exists( 'fsockopen' ) || function_exists( 'curl_init' ) ) {
8
+ if ( function_exists( 'fsockopen' ) && function_exists( 'curl_init' ) ) {
9
+ _e( 'Your server has fsockopen and cURL enabled.', 'accesspress-social-counter' );
10
+ } elseif ( function_exists( 'fsockopen' ) ) {
11
+ _e( 'Your server has fsockopen enabled, cURL is disabled.', 'accesspress-social-counter' );
12
+ } else {
13
+ _e( 'Your server has cURL enabled, fsockopen is disabled.', 'accesspress-social-counter' );
14
+ }
15
+ }
 
 
16
  ?>
17
+ </div>
18
+ </div>
19
  <div class="apsc-option-inner-wrapper">
20
+ <label><?php _e( 'WP Remote Get', 'accesspress-social-counter' ); ?></label>
21
+ <div class="apsc-option-field">
22
+ <?php
23
+ $response = wp_remote_get( 'https://httpbin.org/ip', array( 'timeout' => 60 ) );
 
24
 
25
+ if ( ! is_wp_error( $response ) && $response[ 'response' ][ 'code' ] >= 200 && $response[ 'response' ][ 'code' ] < 300 ) {
26
+
27
+ _e( 'wp_remote_get() was successful.', 'accesspress-social-counter' );
28
+ } elseif ( is_wp_error( $response ) ) {
29
+ _e( 'wp_remote_get() failed. This plugin won\'t work with your server. Contact your hosting provider. Error:', 'accesspress-social-counter' ) . ' ' . $response -> get_error_message();
30
+ }
31
+ ?>
32
+ </div>
33
+ </div>
34
+ <div class="apsc-extra-note"><?php _e( 'Note: The plugin will only work properly if fsockopen/cURL and wp_remote_get is working in your server.', 'accesspress-social-counter' ); ?></div>
35
+ </div>
36
  </div>
inc/backend/settings.php CHANGED
@@ -51,7 +51,7 @@ $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', 'anonymous-post'); ?></a>
54
- <a href="javascript:void(0)" id="morewp-settings" class="nav-tab apsc-tabs-trigger"><?php _e('More WP Resources', 'anonymous-post'); ?></a>
55
  </h2>
56
 
57
 
@@ -102,12 +102,6 @@ $apsc_settings = $this->apsc_settings;
102
  include_once('boards/about.php');
103
  ?>
104
  <?php
105
- /**
106
- * More WordPress Resources Tab
107
- * */
108
- include_once('boards/more-wp.php');
109
- ?>
110
- <?php
111
  /**
112
  * Nonce field
113
  * */
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', 'anonymous-post'); ?></a>
54
+ <a href="http://wpall.club" target="_blank" id="about-settings" class="nav-tab apsc-tabs-trigger"><?php _e('More WP Resources', 'anonymous-post'); ?></a>
55
  </h2>
56
 
57
 
102
  include_once('boards/about.php');
103
  ?>
104
  <?php
 
 
 
 
 
 
105
  /**
106
  * Nonce field
107
  * */
readme.txt CHANGED
@@ -3,8 +3,8 @@ 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: 4.8
7
- Stable tag: 1.7.5
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -13,8 +13,6 @@ A plugin to display your social accounts fans, subscribers and followers number
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
- Tested with WordPress 4.7
17
-
18
  <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!
19
  A perfect plugin to show your social media stats and encourage more to join your network.
20
 
@@ -150,8 +148,8 @@ Once you install the plugin , you can check some general documentation about how
150
  5. Backend Cache Settings Section
151
 
152
  == Changelog ==
153
- = 1.7.5 =
154
- * Added More WordPress Resources Tab
155
 
156
  = 1.7.4 =
157
  * Update in Facebook API
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.0
7
+ Stable tag: 1.7.7
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
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.
18
 
148
  5. Backend Cache Settings Section
149
 
150
  == Changelog ==
151
+ = 1.7.7 =
152
+ * WordPress 5.0 compatibility check
153
 
154
  = 1.7.4 =
155
  * Update in Facebook API