Version Description
- Done number formatting for counts
Download this release
Release Info
Developer | Access Keys |
Plugin | Social Counter for WordPress – AccessPress Social Counter |
Version | 1.0.2 |
Comparing to | |
See all releases |
Code changes from version 1.0.1 to 1.0.2
- accesspress-social-counter.php +2 -2
- inc/frontend/shortcode.php +8 -8
- readme.txt +4 -1
accesspress-social-counter.php
CHANGED
@@ -5,7 +5,7 @@ defined('ABSPATH') or die("No script kiddies please!");
|
|
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.0.
|
9 |
* Author: AccessPress Themes
|
10 |
* Author URI: http://accesspressthemes.com
|
11 |
* Text Domain: aps-counter
|
@@ -26,7 +26,7 @@ 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.0.
|
30 |
}
|
31 |
/**
|
32 |
* Register of widgets
|
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.0.2
|
9 |
* Author: AccessPress Themes
|
10 |
* Author URI: http://accesspressthemes.com
|
11 |
* Text Domain: aps-counter
|
26 |
define('SC_CSS_DIR', plugin_dir_url(__FILE__) . 'css');
|
27 |
}
|
28 |
if (!defined('SC_VERSION')) {
|
29 |
+
define('SC_VERSION', '1.0.2');
|
30 |
}
|
31 |
/**
|
32 |
* Register of widgets
|
inc/frontend/shortcode.php
CHANGED
@@ -31,7 +31,7 @@ $apsc_settings = $this->apsc_settings;
|
|
31 |
$count = 0;
|
32 |
} else {
|
33 |
$body = json_decode($connection['body']);
|
34 |
-
$count = $body->likes;
|
35 |
set_transient('apsc_facebook', $count, $cache_period);
|
36 |
}
|
37 |
} else {
|
@@ -46,7 +46,7 @@ $apsc_settings = $this->apsc_settings;
|
|
46 |
<?php
|
47 |
$twitter_count = get_transient('apsc_twitter');
|
48 |
if (false === $twitter_count) {
|
49 |
-
$count = $this->get_twitter_count();
|
50 |
set_transient('apsc_twitter', $count, $cache_period);
|
51 |
} else {
|
52 |
$count = $twitter_count;
|
@@ -73,7 +73,7 @@ $apsc_settings = $this->apsc_settings;
|
|
73 |
$_data = json_decode($connection['body'], true);
|
74 |
|
75 |
if (isset($_data['circledByCount'])) {
|
76 |
-
$count = intval($_data['circledByCount']);
|
77 |
set_transient('apsc_googlePlus', $count,$cache_period);
|
78 |
} else {
|
79 |
$count = 0;
|
@@ -108,7 +108,7 @@ $apsc_settings = $this->apsc_settings;
|
|
108 |
if (
|
109 |
isset($response['meta']['code']) && 200 == $response['meta']['code'] && isset($response['data']['counts']['followed_by'])
|
110 |
) {
|
111 |
-
$count = intval($response['data']['counts']['followed_by']);
|
112 |
set_transient('apsc_instagram',$count,$cache_period);
|
113 |
} else {
|
114 |
$count = 0;
|
@@ -140,7 +140,7 @@ $apsc_settings = $this->apsc_settings;
|
|
140 |
try {
|
141 |
$body = str_replace('yt:', '', $connection['body']);
|
142 |
$xml = @new SimpleXmlElement($body, LIBXML_NOCDATA);
|
143 |
-
$count = intval($xml->statistics['subscriberCount']);
|
144 |
set_transient('apsc_youtube',$count,$cache_period);
|
145 |
} catch (Exception $e) {
|
146 |
$count = 0;
|
@@ -172,7 +172,7 @@ $apsc_settings = $this->apsc_settings;
|
|
172 |
$response = json_decode($connection['body'], true);
|
173 |
|
174 |
if (isset($response['followers_count'])) {
|
175 |
-
$count = intval($response['followers_count']);
|
176 |
set_transient( 'apsc_soundcloud',$count,$cache_period );
|
177 |
} else {
|
178 |
$count = 0;
|
@@ -202,7 +202,7 @@ $apsc_settings = $this->apsc_settings;
|
|
202 |
} else {
|
203 |
$response = json_decode($connection['body'], true);
|
204 |
if (isset($response['followers_count'])) {
|
205 |
-
$count = intval($response['followers_count']);
|
206 |
set_transient('apsc_dribbble',$count,$cache_period );
|
207 |
} else {
|
208 |
$count = 0;
|
@@ -234,7 +234,7 @@ $apsc_settings = $this->apsc_settings;
|
|
234 |
$comments_count = get_transient('apsc_comments');
|
235 |
if (false === $comments_count) {
|
236 |
$data = wp_count_comments();
|
237 |
-
$count = $data->approved;
|
238 |
set_transient('apsc_comments', $count, $cache_period);
|
239 |
} else {
|
240 |
$count = $comments_count;
|
31 |
$count = 0;
|
32 |
} else {
|
33 |
$body = json_decode($connection['body']);
|
34 |
+
$count = number_format($body->likes);
|
35 |
set_transient('apsc_facebook', $count, $cache_period);
|
36 |
}
|
37 |
} else {
|
46 |
<?php
|
47 |
$twitter_count = get_transient('apsc_twitter');
|
48 |
if (false === $twitter_count) {
|
49 |
+
$count = number_format($this->get_twitter_count());
|
50 |
set_transient('apsc_twitter', $count, $cache_period);
|
51 |
} else {
|
52 |
$count = $twitter_count;
|
73 |
$_data = json_decode($connection['body'], true);
|
74 |
|
75 |
if (isset($_data['circledByCount'])) {
|
76 |
+
$count = number_format(intval($_data['circledByCount']));
|
77 |
set_transient('apsc_googlePlus', $count,$cache_period);
|
78 |
} else {
|
79 |
$count = 0;
|
108 |
if (
|
109 |
isset($response['meta']['code']) && 200 == $response['meta']['code'] && isset($response['data']['counts']['followed_by'])
|
110 |
) {
|
111 |
+
$count = number_format(intval($response['data']['counts']['followed_by']));
|
112 |
set_transient('apsc_instagram',$count,$cache_period);
|
113 |
} else {
|
114 |
$count = 0;
|
140 |
try {
|
141 |
$body = str_replace('yt:', '', $connection['body']);
|
142 |
$xml = @new SimpleXmlElement($body, LIBXML_NOCDATA);
|
143 |
+
$count = number_format(intval($xml->statistics['subscriberCount']));
|
144 |
set_transient('apsc_youtube',$count,$cache_period);
|
145 |
} catch (Exception $e) {
|
146 |
$count = 0;
|
172 |
$response = json_decode($connection['body'], true);
|
173 |
|
174 |
if (isset($response['followers_count'])) {
|
175 |
+
$count = number_format(intval($response['followers_count']));
|
176 |
set_transient( 'apsc_soundcloud',$count,$cache_period );
|
177 |
} else {
|
178 |
$count = 0;
|
202 |
} else {
|
203 |
$response = json_decode($connection['body'], true);
|
204 |
if (isset($response['followers_count'])) {
|
205 |
+
$count = number_format(intval($response['followers_count']));
|
206 |
set_transient('apsc_dribbble',$count,$cache_period );
|
207 |
} else {
|
208 |
$count = 0;
|
234 |
$comments_count = get_transient('apsc_comments');
|
235 |
if (false === $comments_count) {
|
236 |
$data = wp_count_comments();
|
237 |
+
$count = number_format($data->approved);
|
238 |
set_transient('apsc_comments', $count, $cache_period);
|
239 |
} else {
|
240 |
$count = $comments_count;
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: social count, social counter, social counters, social media counters, soci
|
|
4 |
Donate link: http://accesspressthemes.com/donation/
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.1
|
7 |
-
Stable tag: 1.0.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -93,6 +93,9 @@ Once you install the plugin , you can check some general documentation about how
|
|
93 |
5. Backend Cache Settings Section
|
94 |
|
95 |
== Changelog ==
|
|
|
|
|
|
|
96 |
= 1.0.1 =
|
97 |
* Done some fixes for mobile version
|
98 |
|
4 |
Donate link: http://accesspressthemes.com/donation/
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.1
|
7 |
+
Stable tag: 1.0.2
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
93 |
5. Backend Cache Settings Section
|
94 |
|
95 |
== Changelog ==
|
96 |
+
= 1.0.2 =
|
97 |
+
* Done number formatting for counts
|
98 |
+
|
99 |
= 1.0.1 =
|
100 |
* Done some fixes for mobile version
|
101 |
|