Version Description
- Added Facebook Default Count field for fallback count to show when API is not available
- Changed note for facebook user ID
- Fixed small bug regarding the individual social media count shortcode cache period
Download this release
Release Info
Developer | Access Keys |
Plugin | Social Counter for WordPress – AccessPress Social Counter |
Version | 1.3.1 |
Comparing to | |
See all releases |
Code changes from version 1.3.0 to 1.3.1
- accesspress-social-counter.php +8 -3
- inc/backend/boards/social-profiles.php +9 -1
- inc/frontend/shortcode.php +6 -0
- readme.txt +6 -1
accesspress-social-counter.php
CHANGED
@@ -3,7 +3,7 @@
|
|
3 |
* Plugin Name: AccessPress Social Counter
|
4 |
* Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-social-counter/
|
5 |
* Description: A plugin to display your social accounts fans, subscribers and followers number on your website with handful of backend settings and interface.
|
6 |
-
* Version: 1.3.
|
7 |
* Author: AccessPress Themes
|
8 |
* Author URI: http://accesspressthemes.com
|
9 |
* Text Domain: aps-counter
|
@@ -24,7 +24,7 @@ if (!defined('SC_CSS_DIR')) {
|
|
24 |
define('SC_CSS_DIR', plugin_dir_url(__FILE__) . 'css');
|
25 |
}
|
26 |
if (!defined('SC_VERSION')) {
|
27 |
-
define('SC_VERSION', '1.3.
|
28 |
}
|
29 |
/**
|
30 |
* Register of widgets
|
@@ -372,6 +372,7 @@ if (!class_exists('SC_Class')) {
|
|
372 |
function get_count($social_media){
|
373 |
$count = 0;
|
374 |
$apsc_settings = $this->apsc_settings;
|
|
|
375 |
switch($social_media){
|
376 |
case 'facebook':
|
377 |
$facebook_page_id = $apsc_settings['social_profile']['facebook']['page_id'];
|
@@ -387,7 +388,11 @@ if (!class_exists('SC_Class')) {
|
|
387 |
$count = $facebook_count;
|
388 |
}
|
389 |
|
390 |
-
|
|
|
|
|
|
|
|
|
391 |
break;
|
392 |
case 'twitter':
|
393 |
|
3 |
* Plugin Name: AccessPress Social Counter
|
4 |
* Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-social-counter/
|
5 |
* Description: A plugin to display your social accounts fans, subscribers and followers number on your website with handful of backend settings and interface.
|
6 |
+
* Version: 1.3.1
|
7 |
* Author: AccessPress Themes
|
8 |
* Author URI: http://accesspressthemes.com
|
9 |
* Text Domain: aps-counter
|
24 |
define('SC_CSS_DIR', plugin_dir_url(__FILE__) . 'css');
|
25 |
}
|
26 |
if (!defined('SC_VERSION')) {
|
27 |
+
define('SC_VERSION', '1.3.1');
|
28 |
}
|
29 |
/**
|
30 |
* Register of widgets
|
372 |
function get_count($social_media){
|
373 |
$count = 0;
|
374 |
$apsc_settings = $this->apsc_settings;
|
375 |
+
$cache_period = ($apsc_settings['cache_period'] != '') ? $apsc_settings['cache_period']*60*60 : 24 * 60 * 60;
|
376 |
switch($social_media){
|
377 |
case 'facebook':
|
378 |
$facebook_page_id = $apsc_settings['social_profile']['facebook']['page_id'];
|
388 |
$count = $facebook_count;
|
389 |
}
|
390 |
|
391 |
+
$default_count = isset($apsc_settings['social_profile']['facebook']['default_count'])?$apsc_settings['social_profile']['facebook']['default_count']:0;
|
392 |
+
$count = ($count==0)?$default_count:$count;
|
393 |
+
if($count!=0){
|
394 |
+
set_transient('apsc_facebook',$count,$cache_period);
|
395 |
+
}
|
396 |
break;
|
397 |
case 'twitter':
|
398 |
|
inc/backend/boards/social-profiles.php
CHANGED
@@ -12,7 +12,15 @@
|
|
12 |
<label><?php _e('Facebook Page ID', 'aps-counter'); ?></label>
|
13 |
<div class="apsc-option-field">
|
14 |
<input type="text" name="social_profile[facebook][page_id]" value="<?php echo $apsc_settings['social_profile']['facebook']['page_id'];?>"/>
|
15 |
-
<div class="apsc-option-note"><?php _e('Please enter the page ID or page name.For example:If your page url is https://www.facebook.com/AccessPressThemes then your page ID is AccessPressThemes.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
16 |
|
17 |
</div>
|
18 |
</div>
|
12 |
<label><?php _e('Facebook Page ID', 'aps-counter'); ?></label>
|
13 |
<div class="apsc-option-field">
|
14 |
<input type="text" name="social_profile[facebook][page_id]" value="<?php echo $apsc_settings['social_profile']['facebook']['page_id'];?>"/>
|
15 |
+
<div class="apsc-option-note"><?php _e('Please enter the page ID or page name.For example:If your page url is https://www.facebook.com/AccessPressThemes then your page ID is AccessPressThemes.', 'aps-counter'); ?></div>
|
16 |
+
|
17 |
+
</div>
|
18 |
+
</div>
|
19 |
+
<div class="apsc-option-inner-wrapper">
|
20 |
+
<label><?php _e('Facebook Default Count', 'aps-counter'); ?></label>
|
21 |
+
<div class="apsc-option-field">
|
22 |
+
<input type="text" name="social_profile[facebook][default_count]" value="<?php echo isset($apsc_settings['social_profile']['facebook']['default_count'])?$apsc_settings['social_profile']['facebook']['default_count']:'';?>"/>
|
23 |
+
<div class="apsc-option-note"><?php _e('Please enter the default count for facebook to show whenever the API is unavailable.', 'aps-counter'); ?></div>
|
24 |
|
25 |
</div>
|
26 |
</div>
|
inc/frontend/shortcode.php
CHANGED
@@ -30,7 +30,13 @@ $format = isset($apsc_settings['counter_format'])?$apsc_settings['counter_format
|
|
30 |
} else {
|
31 |
$count = $facebook_count;
|
32 |
}
|
|
|
|
|
|
|
|
|
|
|
33 |
$count = ($count!='')?$this->get_formatted_count($count,$format):0;
|
|
|
34 |
?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Fans</span></div></a>
|
35 |
<?php
|
36 |
break;
|
30 |
} else {
|
31 |
$count = $facebook_count;
|
32 |
}
|
33 |
+
$default_count = isset($apsc_settings['social_profile']['facebook']['default_count'])?$apsc_settings['social_profile']['facebook']['default_count']:0;
|
34 |
+
$count = ($count==0)?$default_count:$count;
|
35 |
+
if($count!=0 || $count!=''){
|
36 |
+
set_transient('apsc_facebook',$count,$cache_period);
|
37 |
+
}
|
38 |
$count = ($count!='')?$this->get_formatted_count($count,$format):0;
|
39 |
+
|
40 |
?><span class="apsc-count"><?php echo $count; ?></span><span class="apsc-media-type">Fans</span></div></a>
|
41 |
<?php
|
42 |
break;
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: social count, social counter, social counters, social media counters, soci
|
|
4 |
Donate link: http://accesspressthemes.com/donation/
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.2
|
7 |
-
Stable tag: 1.3.
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
@@ -125,6 +125,11 @@ Once you install the plugin , you can check some general documentation about how
|
|
125 |
5. Backend Cache Settings Section
|
126 |
|
127 |
== Changelog ==
|
|
|
|
|
|
|
|
|
|
|
128 |
= 1.3.0 =
|
129 |
* Added Shortcode [aps-get-count social_media="name of social media"] to get the individual social media count only
|
130 |
|
4 |
Donate link: http://accesspressthemes.com/donation/
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.2
|
7 |
+
Stable tag: 1.3.1
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
125 |
5. Backend Cache Settings Section
|
126 |
|
127 |
== Changelog ==
|
128 |
+
= 1.3.1 =
|
129 |
+
* Added Facebook Default Count field for fallback count to show when API is not available
|
130 |
+
* Changed note for facebook user ID
|
131 |
+
* Fixed small bug regarding the individual social media count shortcode cache period
|
132 |
+
|
133 |
= 1.3.0 =
|
134 |
* Added Shortcode [aps-get-count social_media="name of social media"] to get the individual social media count only
|
135 |
|