Version Description
- Fixed the plugin text domain issue for localization.
- Texts modification in about section and miscellaneous settings section.
Download this release
Release Info
Developer | Access Keys |
Plugin | Social Share WordPress Plugin – AccessPress Social Share |
Version | 1.0.6 |
Comparing to | |
See all releases |
Code changes from version 1.0.5 to 1.0.6
- accesspress-social-share.php +36 -54
- inc/backend/about-apss.php +3 -3
- inc/backend/activation.php +25 -25
- inc/backend/main-page.php +3 -3
- inc/backend/save-settings.php +6 -6
- inc/frontend/content-filter.php +27 -35
- inc/frontend/shortcode.php +1 -3
- js/frontend.js +2 -0
- readme.txt +5 -1
accesspress-social-share.php
CHANGED
@@ -4,7 +4,7 @@ defined( 'ABSPATH' ) or die( "No script kiddies please!" );
|
|
4 |
Plugin name: AccessPress Social Share
|
5 |
Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-social-share/
|
6 |
Description: A plugin to add various social media shares to a site with dynamic configuration options.
|
7 |
-
Version: 1.0.
|
8 |
Author: AccessPress Themes
|
9 |
Author URI: http://accesspressthemes.com
|
10 |
Text Domain:apss-share
|
@@ -31,7 +31,7 @@ if( !defined( 'APSS_LANG_DIR' ) ) {
|
|
31 |
}
|
32 |
|
33 |
if( !defined( 'APSS_VERSION' ) ) {
|
34 |
-
define( 'APSS_VERSION', '1.0.
|
35 |
}
|
36 |
|
37 |
if(!defined('APSS_TEXT_DOMAIN')){
|
@@ -67,7 +67,7 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
67 |
add_action('admin_post_apss_clear_cache',array($this,'apss_clear_cache'));//clear the cache of the social share counter.
|
68 |
add_shortcode('apss-share', array($this, 'apss_shortcode')); //adds a shortcode
|
69 |
add_action('wp_ajax_nopriv_frontend_counter', array($this, 'frontend_counter'));
|
70 |
-
add_action('wp_ajax_frontend_counter', array($this, 'frontend_counter'));
|
71 |
}
|
72 |
|
73 |
//called when plugin is activated
|
@@ -78,7 +78,7 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
78 |
|
79 |
if( !get_option( APSS_COUNT_TRANSIENTS ) ){
|
80 |
$apss_social_counts_transients = array();
|
81 |
-
update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients);
|
82 |
}
|
83 |
}
|
84 |
|
@@ -90,7 +90,7 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
90 |
//add plugins menu in backend
|
91 |
function add_apss_menu(){
|
92 |
add_menu_page( 'AccessPress Social Share', 'AccessPress Social Share', 'manage_options', 'apss-share', array( $this, 'main_page' ), APSS_IMAGE_DIR . '/apss-icon.png' );
|
93 |
-
add_submenu_page( 'apss-share', __( 'Social Icons Settings',
|
94 |
}
|
95 |
|
96 |
//plugins backend admin page
|
@@ -100,8 +100,8 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
100 |
|
101 |
//for saving the plugin settings
|
102 |
function apss_save_options(){
|
103 |
-
if ( isset( $_POST['apss_add_nonce_save_settings'] ) && isset( $_POST['apss_submit_settings'] ) && wp_verify_nonce( $_POST['apss_add_nonce_save_settings'], 'apss_nonce_save_settings') ){
|
104 |
-
|
105 |
}
|
106 |
else
|
107 |
{
|
@@ -145,9 +145,7 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
145 |
$html_content = ob_get_contents();
|
146 |
ob_get_clean();
|
147 |
|
148 |
-
$options = $this->apss_settings;
|
149 |
$share_shows_in_options=$options['share_options'];
|
150 |
-
|
151 |
$all = in_array('all', $options['share_options']);
|
152 |
$is_lists_authorized = (is_search()) && $all ? true : false;
|
153 |
|
@@ -168,25 +166,25 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
168 |
|
169 |
}
|
170 |
|
171 |
-
$is_category = in_array('categories', $options['share_options']);
|
172 |
-
$default_category=(is_category()) && $is_category ? true : false;
|
173 |
|
174 |
-
$is_default_archive=in_array('archives', $options['share_options']);
|
175 |
-
$default_archives=( (is_archive() && !is_tax() )&& !is_category() ) && $is_default_archive ? true : false;
|
176 |
|
177 |
-
if(empty($options['share_options'])){
|
178 |
return $post_content;
|
179 |
|
180 |
-
}else if($is_lists_authorized || $is_singular || $is_tax || $is_front_page || $default_category || $default_archives){
|
181 |
-
if ($options['share_positions'] == 'below_content') {
|
182 |
return $post_content . "<div class='apss-social-share apss-theme-$icon_set_value clearfix' >" . $html_content . "</div>";
|
183 |
}
|
184 |
|
185 |
-
if ($options['share_positions'] == 'above_content') {
|
186 |
return "<div class='apss-social-share apss-theme-$icon_set_value clearfix'>$html_content</div>" . $post_content;
|
187 |
}
|
188 |
|
189 |
-
if ($options['share_positions'] == 'on_both') {
|
190 |
return "<div class='apss-social-share apss-theme-$icon_set_value clearfix'>$html_content</div>" . $post_content . "<div class='apss-social-share apss-theme-$icon_set_value clearfix'>$html_content</div>";
|
191 |
}
|
192 |
|
@@ -194,7 +192,6 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
194 |
return $post_content;
|
195 |
}
|
196 |
|
197 |
-
|
198 |
}
|
199 |
|
200 |
//functions to register frontend styles and scripts
|
@@ -202,15 +199,15 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
202 |
/**
|
203 |
* Backend CSS
|
204 |
* */
|
205 |
-
if(isset($_GET['page']) && $_GET['page']=='apss-share'){
|
206 |
-
wp_enqueue_style( 'aps-admin-css', APSS_CSS_DIR . '/backend.css',false,APSS_VERSION ); //registering plugin admin css
|
207 |
-
wp_enqueue_style( 'fontawesome-css', APSS_CSS_DIR . '/font-awesome.min.css',false,APSS_VERSION );
|
208 |
|
209 |
/**
|
210 |
* Backend JS
|
211 |
* */
|
212 |
wp_enqueue_script( 'jquery-ui-sortable' );
|
213 |
-
wp_enqueue_script( 'apss-admin-js', APSS_JS_DIR . '/backend.js', array('jquery', 'jquery-ui-sortable', 'wp-color-picker'),APSS_VERSION );//registering plugin's admin js
|
214 |
}
|
215 |
}
|
216 |
|
@@ -218,12 +215,12 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
218 |
* Registers Frontend Assets
|
219 |
* */
|
220 |
function register_frontend_assets() {
|
221 |
-
wp_enqueue_style( 'apss-font-awesome',APSS_CSS_DIR.'/font-awesome.min.css',array(),APSS_VERSION );
|
222 |
-
wp_enqueue_style( 'apss-font-opensans','http://fonts.googleapis.com/css?family=Open+Sans',array(),false);
|
223 |
wp_enqueue_style( 'apss-frontend-css', APSS_CSS_DIR . '/frontend.css', array( 'apss-font-awesome' ), APSS_VERSION );
|
224 |
wp_enqueue_script('apss-frontend-mainjs', APSS_JS_DIR . '/frontend.js', array('jquery'), APSS_VERSION, true);
|
225 |
-
$ajax_nonce = wp_create_nonce('apss-ajax-nonce');
|
226 |
-
wp_localize_script('apss-frontend-mainjs', 'frontend_ajax_object', array('ajax_url' => admin_url() . 'admin-ajax.php', 'ajax_nonce' => $ajax_nonce));
|
227 |
}
|
228 |
|
229 |
/**
|
@@ -239,11 +236,11 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
239 |
//function to restore the default setting of a plugin
|
240 |
function apss_restore_default_settings(){
|
241 |
$nonce = $_REQUEST['_wpnonce'];
|
242 |
-
if(!empty($_GET) && wp_verify_nonce( $nonce, 'apss-restore-default-settings-nonce' ))
|
243 |
{
|
244 |
//restore the default plugin activation settings from the activation page.
|
245 |
include( 'inc/backend/activation.php' );
|
246 |
-
$_SESSION['apss_message'] = __( 'Settings restored Successfully.', APSS_TEXT_DOMAIN );
|
247 |
wp_redirect( admin_url().'admin.php?page=apss-share' );
|
248 |
exit;
|
249 |
}else{
|
@@ -265,20 +262,17 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
265 |
//for setting the counter transient in separate options value
|
266 |
$apss_social_counts_transients = get_option( APSS_COUNT_TRANSIENTS );
|
267 |
if (false === $fb_transient_count) {
|
268 |
-
$json_string = $this->get_json_values('https://graph.facebook.com/?id=' . $url);
|
269 |
-
$json = json_decode($json_string, true);
|
270 |
-
$facebook_count = isset($json['shares']) ? intval($json['shares']) : 0;
|
271 |
set_transient($fb_transient, $facebook_count, $cache_period);
|
272 |
-
if(!in_array( $fb_transient, $apss_social_counts_transients)){
|
273 |
$apss_social_counts_transients[] = $fb_transient;
|
274 |
-
update_option(APSS_COUNT_TRANSIENTS
|
275 |
}
|
276 |
-
|
277 |
-
|
278 |
} else {
|
279 |
$facebook_count = $fb_transient_count;
|
280 |
}
|
281 |
-
|
282 |
return $facebook_count;
|
283 |
}
|
284 |
|
@@ -291,8 +285,6 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
291 |
|
292 |
//for setting the counter transient in separate options value
|
293 |
$apss_social_counts_transients = get_option(APSS_COUNT_TRANSIENTS);
|
294 |
-
|
295 |
-
|
296 |
if (false === $twitter_transient_count) {
|
297 |
$json_string = $this->get_json_values('http://urls.api.twitter.com/1/urls/count.json?url=' . $url);
|
298 |
$json = json_decode($json_string, true);
|
@@ -302,7 +294,6 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
302 |
$apss_social_counts_transients[] = $twitter_transient;
|
303 |
update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
|
304 |
}
|
305 |
-
|
306 |
} else {
|
307 |
$tweet_count = $twitter_transient_count;
|
308 |
}
|
@@ -318,7 +309,6 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
318 |
|
319 |
//for setting the counter transient in separate options value
|
320 |
$apss_social_counts_transients = get_option(APSS_COUNT_TRANSIENTS);
|
321 |
-
|
322 |
if (false === $googlePlus_transient_count) {
|
323 |
$curl = curl_init();
|
324 |
curl_setopt($curl, CURLOPT_URL, "https://clients6.google.com/rpc");
|
@@ -336,10 +326,8 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
336 |
$apss_social_counts_transients[] = $googlePlus_transient;
|
337 |
update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
|
338 |
}
|
339 |
-
|
340 |
} else {
|
341 |
$plusones_count = $googlePlus_transient_count;
|
342 |
-
|
343 |
}
|
344 |
return $plusones_count;
|
345 |
}
|
@@ -353,8 +341,6 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
353 |
|
354 |
//for setting the counter transient in separate options value
|
355 |
$apss_social_counts_transients = get_option(APSS_COUNT_TRANSIENTS);
|
356 |
-
|
357 |
-
|
358 |
if (false === $pinterest_transient_count) {
|
359 |
$json_string = $this->get_json_values('http://api.pinterest.com/v1/urls/count.json?url=' . $url);
|
360 |
$json_string = preg_replace('/^receiveCount\((.*)\)$/', "\\1", $json_string);
|
@@ -391,10 +377,8 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
391 |
$apss_social_counts_transients[] = $linkedin_transient;
|
392 |
update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
|
393 |
}
|
394 |
-
|
395 |
} else {
|
396 |
$linkedin_count = $linkedin_transient_count;
|
397 |
-
|
398 |
}
|
399 |
return $linkedin_count;
|
400 |
}
|
@@ -404,14 +388,13 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
404 |
private function get_json_values( $url ){
|
405 |
$apss_settings = $this->apss_settings;
|
406 |
$cache_period = $apss_settings['cache_period']*60*60;
|
407 |
-
$args = array('timeout' => 10);
|
408 |
-
$response = wp_remote_get($url, $args);
|
409 |
-
$json_response = wp_remote_retrieve_body($response);
|
410 |
return $json_response;
|
411 |
}
|
412 |
|
413 |
////////////////////////////////////for count ends here/////////////////////////////////////////////
|
414 |
-
|
415 |
function get_count($profile_name, $url) {
|
416 |
switch ($profile_name) {
|
417 |
case 'facebook':
|
@@ -443,7 +426,7 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
443 |
|
444 |
|
445 |
function frontend_counter() {
|
446 |
-
if (!empty($_GET) && wp_verify_nonce($_GET['_wpnonce'], 'apss-ajax-nonce')) {
|
447 |
$apss_settings = $this->apss_settings;
|
448 |
$new_detail_array = array();
|
449 |
if (isset($_POST['data'])) {
|
@@ -460,7 +443,7 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
460 |
$new_detail_array[] = $this->get_count($network, $url);
|
461 |
}
|
462 |
}
|
463 |
-
die(json_encode($new_detail_array));
|
464 |
}
|
465 |
}
|
466 |
|
@@ -472,7 +455,6 @@ if( !class_exists( 'APSS_Class' ) ){
|
|
472 |
function apss_clear_cache() {
|
473 |
if (!empty($_GET) && wp_verify_nonce($_GET['_wpnonce'], 'apss-clear-cache-nonce')) {
|
474 |
$apss_settings = $this->apss_settings;
|
475 |
-
|
476 |
$apss_social_counts_transients = get_option(APSS_COUNT_TRANSIENTS);
|
477 |
foreach ($apss_social_counts_transients as $transient) {
|
478 |
delete_transient($transient);
|
4 |
Plugin name: AccessPress Social Share
|
5 |
Plugin URI: https://accesspressthemes.com/wordpress-plugins/accesspress-social-share/
|
6 |
Description: A plugin to add various social media shares to a site with dynamic configuration options.
|
7 |
+
Version: 1.0.6
|
8 |
Author: AccessPress Themes
|
9 |
Author URI: http://accesspressthemes.com
|
10 |
Text Domain:apss-share
|
31 |
}
|
32 |
|
33 |
if( !defined( 'APSS_VERSION' ) ) {
|
34 |
+
define( 'APSS_VERSION', '1.0.6' );
|
35 |
}
|
36 |
|
37 |
if(!defined('APSS_TEXT_DOMAIN')){
|
67 |
add_action('admin_post_apss_clear_cache',array($this,'apss_clear_cache'));//clear the cache of the social share counter.
|
68 |
add_shortcode('apss-share', array($this, 'apss_shortcode')); //adds a shortcode
|
69 |
add_action('wp_ajax_nopriv_frontend_counter', array($this, 'frontend_counter'));
|
70 |
+
add_action('wp_ajax_frontend_counter', array($this, 'frontend_counter')); // action for ajax counter
|
71 |
}
|
72 |
|
73 |
//called when plugin is activated
|
78 |
|
79 |
if( !get_option( APSS_COUNT_TRANSIENTS ) ){
|
80 |
$apss_social_counts_transients = array();
|
81 |
+
update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
|
82 |
}
|
83 |
}
|
84 |
|
90 |
//add plugins menu in backend
|
91 |
function add_apss_menu(){
|
92 |
add_menu_page( 'AccessPress Social Share', 'AccessPress Social Share', 'manage_options', 'apss-share', array( $this, 'main_page' ), APSS_IMAGE_DIR . '/apss-icon.png' );
|
93 |
+
add_submenu_page( 'apss-share', __( 'Social Icons Settings', APSS_TEXT_DOMAIN ), __( 'Social Icons Settings', APSS_TEXT_DOMAIN ), 'manage_options', 'apss-share', array( $this, 'main_page' ) );
|
94 |
}
|
95 |
|
96 |
//plugins backend admin page
|
100 |
|
101 |
//for saving the plugin settings
|
102 |
function apss_save_options(){
|
103 |
+
if ( isset( $_POST['apss_add_nonce_save_settings'] ) && isset( $_POST['apss_submit_settings'] ) && wp_verify_nonce( $_POST['apss_add_nonce_save_settings'], 'apss_nonce_save_settings') ){
|
104 |
+
include( 'inc/backend/save-settings.php' );
|
105 |
}
|
106 |
else
|
107 |
{
|
145 |
$html_content = ob_get_contents();
|
146 |
ob_get_clean();
|
147 |
|
|
|
148 |
$share_shows_in_options=$options['share_options'];
|
|
|
149 |
$all = in_array('all', $options['share_options']);
|
150 |
$is_lists_authorized = (is_search()) && $all ? true : false;
|
151 |
|
166 |
|
167 |
}
|
168 |
|
169 |
+
$is_category = in_array( 'categories', $options['share_options'] );
|
170 |
+
$default_category=( is_category() ) && $is_category ? true : false;
|
171 |
|
172 |
+
$is_default_archive=in_array( 'archives', $options['share_options'] );
|
173 |
+
$default_archives=( ( is_archive() && !is_tax() )&& !is_category() ) && $is_default_archive ? true : false;
|
174 |
|
175 |
+
if( empty($options['share_options']) ){
|
176 |
return $post_content;
|
177 |
|
178 |
+
}else if( $is_lists_authorized || $is_singular || $is_tax || $is_front_page || $default_category || $default_archives ){
|
179 |
+
if ( $options['share_positions'] == 'below_content' ) {
|
180 |
return $post_content . "<div class='apss-social-share apss-theme-$icon_set_value clearfix' >" . $html_content . "</div>";
|
181 |
}
|
182 |
|
183 |
+
if ( $options['share_positions'] == 'above_content' ) {
|
184 |
return "<div class='apss-social-share apss-theme-$icon_set_value clearfix'>$html_content</div>" . $post_content;
|
185 |
}
|
186 |
|
187 |
+
if ( $options['share_positions'] == 'on_both' ) {
|
188 |
return "<div class='apss-social-share apss-theme-$icon_set_value clearfix'>$html_content</div>" . $post_content . "<div class='apss-social-share apss-theme-$icon_set_value clearfix'>$html_content</div>";
|
189 |
}
|
190 |
|
192 |
return $post_content;
|
193 |
}
|
194 |
|
|
|
195 |
}
|
196 |
|
197 |
//functions to register frontend styles and scripts
|
199 |
/**
|
200 |
* Backend CSS
|
201 |
* */
|
202 |
+
if( isset($_GET['page']) && $_GET['page']=='apss-share' ){
|
203 |
+
wp_enqueue_style( 'aps-admin-css', APSS_CSS_DIR . '/backend.css', false, APSS_VERSION ); //registering plugin admin css
|
204 |
+
wp_enqueue_style( 'fontawesome-css', APSS_CSS_DIR . '/font-awesome.min.css', false, APSS_VERSION );
|
205 |
|
206 |
/**
|
207 |
* Backend JS
|
208 |
* */
|
209 |
wp_enqueue_script( 'jquery-ui-sortable' );
|
210 |
+
wp_enqueue_script( 'apss-admin-js', APSS_JS_DIR . '/backend.js', array( 'jquery', 'jquery-ui-sortable', 'wp-color-picker' ), APSS_VERSION );//registering plugin's admin js
|
211 |
}
|
212 |
}
|
213 |
|
215 |
* Registers Frontend Assets
|
216 |
* */
|
217 |
function register_frontend_assets() {
|
218 |
+
wp_enqueue_style( 'apss-font-awesome', APSS_CSS_DIR.'/font-awesome.min.css',array(),APSS_VERSION );
|
219 |
+
wp_enqueue_style( 'apss-font-opensans', 'http://fonts.googleapis.com/css?family=Open+Sans',array(),false);
|
220 |
wp_enqueue_style( 'apss-frontend-css', APSS_CSS_DIR . '/frontend.css', array( 'apss-font-awesome' ), APSS_VERSION );
|
221 |
wp_enqueue_script('apss-frontend-mainjs', APSS_JS_DIR . '/frontend.js', array('jquery'), APSS_VERSION, true);
|
222 |
+
$ajax_nonce = wp_create_nonce( 'apss-ajax-nonce' );
|
223 |
+
wp_localize_script( 'apss-frontend-mainjs', 'frontend_ajax_object', array( 'ajax_url' => admin_url() . 'admin-ajax.php', 'ajax_nonce' => $ajax_nonce ) );
|
224 |
}
|
225 |
|
226 |
/**
|
236 |
//function to restore the default setting of a plugin
|
237 |
function apss_restore_default_settings(){
|
238 |
$nonce = $_REQUEST['_wpnonce'];
|
239 |
+
if(!empty($_GET) && wp_verify_nonce( $nonce, 'apss-restore-default-settings-nonce' ) )
|
240 |
{
|
241 |
//restore the default plugin activation settings from the activation page.
|
242 |
include( 'inc/backend/activation.php' );
|
243 |
+
$_SESSION['apss_message'] = __( 'Settings restored Successfully.', APSS_TEXT_DOMAIN );
|
244 |
wp_redirect( admin_url().'admin.php?page=apss-share' );
|
245 |
exit;
|
246 |
}else{
|
262 |
//for setting the counter transient in separate options value
|
263 |
$apss_social_counts_transients = get_option( APSS_COUNT_TRANSIENTS );
|
264 |
if (false === $fb_transient_count) {
|
265 |
+
$json_string = $this->get_json_values( 'https://graph.facebook.com/?id=' . $url );
|
266 |
+
$json = json_decode( $json_string, true );
|
267 |
+
$facebook_count = isset($json['shares']) ? intval( $json['shares'] ) : 0;
|
268 |
set_transient($fb_transient, $facebook_count, $cache_period);
|
269 |
+
if( !in_array( $fb_transient, $apss_social_counts_transients) ){
|
270 |
$apss_social_counts_transients[] = $fb_transient;
|
271 |
+
update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients);
|
272 |
}
|
|
|
|
|
273 |
} else {
|
274 |
$facebook_count = $fb_transient_count;
|
275 |
}
|
|
|
276 |
return $facebook_count;
|
277 |
}
|
278 |
|
285 |
|
286 |
//for setting the counter transient in separate options value
|
287 |
$apss_social_counts_transients = get_option(APSS_COUNT_TRANSIENTS);
|
|
|
|
|
288 |
if (false === $twitter_transient_count) {
|
289 |
$json_string = $this->get_json_values('http://urls.api.twitter.com/1/urls/count.json?url=' . $url);
|
290 |
$json = json_decode($json_string, true);
|
294 |
$apss_social_counts_transients[] = $twitter_transient;
|
295 |
update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
|
296 |
}
|
|
|
297 |
} else {
|
298 |
$tweet_count = $twitter_transient_count;
|
299 |
}
|
309 |
|
310 |
//for setting the counter transient in separate options value
|
311 |
$apss_social_counts_transients = get_option(APSS_COUNT_TRANSIENTS);
|
|
|
312 |
if (false === $googlePlus_transient_count) {
|
313 |
$curl = curl_init();
|
314 |
curl_setopt($curl, CURLOPT_URL, "https://clients6.google.com/rpc");
|
326 |
$apss_social_counts_transients[] = $googlePlus_transient;
|
327 |
update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
|
328 |
}
|
|
|
329 |
} else {
|
330 |
$plusones_count = $googlePlus_transient_count;
|
|
|
331 |
}
|
332 |
return $plusones_count;
|
333 |
}
|
341 |
|
342 |
//for setting the counter transient in separate options value
|
343 |
$apss_social_counts_transients = get_option(APSS_COUNT_TRANSIENTS);
|
|
|
|
|
344 |
if (false === $pinterest_transient_count) {
|
345 |
$json_string = $this->get_json_values('http://api.pinterest.com/v1/urls/count.json?url=' . $url);
|
346 |
$json_string = preg_replace('/^receiveCount\((.*)\)$/', "\\1", $json_string);
|
377 |
$apss_social_counts_transients[] = $linkedin_transient;
|
378 |
update_option( APSS_COUNT_TRANSIENTS, $apss_social_counts_transients );
|
379 |
}
|
|
|
380 |
} else {
|
381 |
$linkedin_count = $linkedin_transient_count;
|
|
|
382 |
}
|
383 |
return $linkedin_count;
|
384 |
}
|
388 |
private function get_json_values( $url ){
|
389 |
$apss_settings = $this->apss_settings;
|
390 |
$cache_period = $apss_settings['cache_period']*60*60;
|
391 |
+
$args = array( 'timeout' => 10 );
|
392 |
+
$response = wp_remote_get( $url, $args );
|
393 |
+
$json_response = wp_remote_retrieve_body( $response );
|
394 |
return $json_response;
|
395 |
}
|
396 |
|
397 |
////////////////////////////////////for count ends here/////////////////////////////////////////////
|
|
|
398 |
function get_count($profile_name, $url) {
|
399 |
switch ($profile_name) {
|
400 |
case 'facebook':
|
426 |
|
427 |
|
428 |
function frontend_counter() {
|
429 |
+
if (!empty($_GET) && wp_verify_nonce( $_GET['_wpnonce'], 'apss-ajax-nonce' ) ) {
|
430 |
$apss_settings = $this->apss_settings;
|
431 |
$new_detail_array = array();
|
432 |
if (isset($_POST['data'])) {
|
443 |
$new_detail_array[] = $this->get_count($network, $url);
|
444 |
}
|
445 |
}
|
446 |
+
die( json_encode( $new_detail_array ) );
|
447 |
}
|
448 |
}
|
449 |
|
455 |
function apss_clear_cache() {
|
456 |
if (!empty($_GET) && wp_verify_nonce($_GET['_wpnonce'], 'apss-clear-cache-nonce')) {
|
457 |
$apss_settings = $this->apss_settings;
|
|
|
458 |
$apss_social_counts_transients = get_option(APSS_COUNT_TRANSIENTS);
|
459 |
foreach ($apss_social_counts_transients as $transient) {
|
460 |
delete_transient($transient);
|
inc/backend/about-apss.php
CHANGED
@@ -4,7 +4,7 @@
|
|
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 Share</strong> - is plugin to allow anyone easily share website content (pages, posts) on major social media (Facebook, Twitter
|
8 |
<div class="halfseperator"></div>
|
9 |
<p><strong>Please visit our product page for more details here:</strong><br />
|
10 |
<a href="http://accesspressthemes.com/wordpress-plugins/accesspress-social-share/" target="_blank">http://accesspressthemes.com/wordpress-plugins/accesspress-social-share/</a></p>
|
@@ -24,14 +24,14 @@
|
|
24 |
<h3>Other products by AccessPress themes </h3>
|
25 |
<div class="other-products-inner">
|
26 |
<div class="product">
|
27 |
-
<div class="logo-product"><img src="<?php echo APSS_IMAGE_DIR;?>/aplite.png" alt="<?php esc_attr_e('AccessPress Social Share',
|
28 |
<div class="productext"><p><strong>AccessPress Lite</strong> - A very popular Free WordPress theme, available in WordPress.org<br />
|
29 |
<a href="http://accesspressthemes.com/wordpress-themes/accesspress-lite/" target="_blank">http://accesspressthemes.com/wordpress-themes/accesspress-lite/</a></p>
|
30 |
</div>
|
31 |
</div>
|
32 |
|
33 |
<div class="product">
|
34 |
-
<div class="logo-product"><img src="<?php echo APSS_IMAGE_DIR;?>/appro.png" alt="<?php esc_attr_e('AccessPress Social Share',
|
35 |
<div class="productext"><p><strong>AccessPress Pro</strong> - Premium version of AccessPress lite<br />
|
36 |
<a href="http://accesspressthemes.com/wordpress-themes/accesspress-lite/" target="_blank">http://accesspressthemes.com/wordpress-themes/accesspress-pro/</a></p>
|
37 |
</div>
|
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 Share</strong> - is plugin to allow anyone easily share website content (pages, posts) on major social media (Facebook, Twitter, Google+, Pinterest, LinkedIn and Digg). A perfect plugin to make any content on your website social-share-friendly, and increase your social reach dramatically! </p>
|
8 |
<div class="halfseperator"></div>
|
9 |
<p><strong>Please visit our product page for more details here:</strong><br />
|
10 |
<a href="http://accesspressthemes.com/wordpress-plugins/accesspress-social-share/" target="_blank">http://accesspressthemes.com/wordpress-plugins/accesspress-social-share/</a></p>
|
24 |
<h3>Other products by AccessPress themes </h3>
|
25 |
<div class="other-products-inner">
|
26 |
<div class="product">
|
27 |
+
<div class="logo-product"><img src="<?php echo APSS_IMAGE_DIR;?>/aplite.png" alt="<?php esc_attr_e( 'AccessPress Social Share', APSS_TEXT_DOMAIN ); ?>" /></div>
|
28 |
<div class="productext"><p><strong>AccessPress Lite</strong> - A very popular Free WordPress theme, available in WordPress.org<br />
|
29 |
<a href="http://accesspressthemes.com/wordpress-themes/accesspress-lite/" target="_blank">http://accesspressthemes.com/wordpress-themes/accesspress-lite/</a></p>
|
30 |
</div>
|
31 |
</div>
|
32 |
|
33 |
<div class="product">
|
34 |
+
<div class="logo-product"><img src="<?php echo APSS_IMAGE_DIR;?>/appro.png" alt="<?php esc_attr_e( 'AccessPress Social Share', APSS_TEXT_DOMAIN ); ?>" /></div>
|
35 |
<div class="productext"><p><strong>AccessPress Pro</strong> - Premium version of AccessPress lite<br />
|
36 |
<a href="http://accesspressthemes.com/wordpress-themes/accesspress-lite/" target="_blank">http://accesspressthemes.com/wordpress-themes/accesspress-pro/</a></p>
|
37 |
</div>
|
inc/backend/activation.php
CHANGED
@@ -1,26 +1,26 @@
|
|
1 |
-
<?php
|
2 |
defined('ABSPATH') or die("No script kiddies please!");
|
3 |
-
|
4 |
-
|
5 |
-
|
6 |
-
|
7 |
-
|
8 |
-
|
9 |
-
|
10 |
-
|
11 |
-
|
12 |
-
|
13 |
-
|
14 |
-
|
15 |
-
|
16 |
-
|
17 |
-
|
18 |
-
|
19 |
-
|
20 |
-
|
21 |
-
|
22 |
-
|
23 |
-
|
24 |
-
|
25 |
-
|
26 |
-
|
1 |
+
<?php
|
2 |
defined('ABSPATH') or die("No script kiddies please!");
|
3 |
+
$apss_share_settings=array();
|
4 |
+
$share_options = array('post', 'page');
|
5 |
+
$apss_share_settings['share_options']=$share_options;
|
6 |
+
$apss_share_settings['social_icon_set']='1';
|
7 |
+
$apss_share_settings['share_positions']='below_content';
|
8 |
+
$social_networks=array('facebook'=>'1',
|
9 |
+
'twitter'=>'1',
|
10 |
+
'google-plus'=>'1',
|
11 |
+
'pinterest'=>'1',
|
12 |
+
'linkedin'=>'1',
|
13 |
+
'digg'=>'1',
|
14 |
+
'email'=>'0',
|
15 |
+
'print'=>'0',
|
16 |
+
);
|
17 |
+
$apss_share_settings['social_networks']=$social_networks;
|
18 |
+
$apss_share_settings['twitter_username'] = '';
|
19 |
+
$apss_share_settings['counter_enable_options']='0';
|
20 |
+
$apss_share_settings['cache_period']='24';
|
21 |
+
$apss_share_settings['apss_social_counts_transients']=array();
|
22 |
+
$apss_share_settings['dialog_box_options'] ='1';
|
23 |
+
$apss_share_settings['footer_javascript'] = '1';
|
24 |
+
$apss_share_settings['apss_email_subject'] = 'Please visit this link %%url%%';
|
25 |
+
$apss_share_settings['apss_email_body'] = 'Hey Buddy!, I found this information for you: "%%title%%". Here is the website link: %%permalink%%. Thank you.';
|
26 |
+
update_option( APSS_SETTING_NAME, $apss_share_settings);
|
inc/backend/main-page.php
CHANGED
@@ -2,7 +2,7 @@
|
|
2 |
<div class="apss-wrapper-block">
|
3 |
<div class="apss-setting-header clearfix">
|
4 |
<div class="apss-headerlogo">
|
5 |
-
<img src="<?php echo APSS_IMAGE_DIR; ?>/logo-old.png" alt="<?php esc_attr_e('AccessPress Social Share',
|
6 |
</div>
|
7 |
<div class="apss-header-icons">
|
8 |
<p>Follow us for new updates</p>
|
@@ -104,7 +104,7 @@ if(isset($_SESSION['apss_message'])){ ?>
|
|
104 |
</div>
|
105 |
|
106 |
<div class=" apss-icon-sets">
|
107 |
-
<h2><?php _e( 'Social icons sets', APSS_TEXT_DOMAIN ); ?> </h2>
|
108 |
<?php _e('Please choose any one out of available icon themes:', APSS_TEXT_DOMAIN ); ?>
|
109 |
<p><input id="apss_icon_set_1" value="1" name="apss_share_settings[social_icon_set]" type="radio" <?php if($options['social_icon_set'] =='1'){ echo "checked='checked'"; } ?> ><label for="apss_icon_set_1"><span class="apss_demo_icon apss_demo_icons_1"></span><?php _e('Theme 1', APSS_TEXT_DOMAIN ); ?><div class="apss-theme-image"><img src="<?php echo APSS_IMAGE_DIR.'/theme/theme1.jpg';?>"/></div></label></p>
|
110 |
<p><input id="apss_icon_set_2" value="2" name="apss_share_settings[social_icon_set]" type="radio" <?php if($options['social_icon_set'] =='2'){ echo "checked='checked'"; } ?> ><label for="apss_icon_set_2"><span class="apss_demo_icon apss_demo_icons_2"></span><?php _e('Theme 2', APSS_TEXT_DOMAIN ); ?><div class="apss-theme-image"><img src="<?php echo APSS_IMAGE_DIR.'/theme/theme2.jpg';?>"/></div></label></p>
|
@@ -135,7 +135,7 @@ if(isset($_SESSION['apss_message'])){ ?>
|
|
135 |
</div>
|
136 |
|
137 |
<div class='cache-settings'>
|
138 |
-
<h4><?php _e( 'Cache Settings', APSS_TEXT_DOMAIN ); ?> </h4>
|
139 |
<label for="apss_cache_settings"><?php _e( 'Cache Period:', APSS_TEXT_DOMAIN ); ?></label>
|
140 |
<input type='text' id="apss_cache_period" name='apss_share_settings[cache_settings]' value="<?php if(isset($options['cache_period'])){ echo $options['cache_period']; } ?>" onkeyup="removeMe('invalid_cache_period');"/>
|
141 |
<span class="error invalid_cache_period"></span>
|
2 |
<div class="apss-wrapper-block">
|
3 |
<div class="apss-setting-header clearfix">
|
4 |
<div class="apss-headerlogo">
|
5 |
+
<img src="<?php echo APSS_IMAGE_DIR; ?>/logo-old.png" alt="<?php esc_attr_e( 'AccessPress Social Share', APSS_TEXT_DOMAIN ); ?>" />
|
6 |
</div>
|
7 |
<div class="apss-header-icons">
|
8 |
<p>Follow us for new updates</p>
|
104 |
</div>
|
105 |
|
106 |
<div class=" apss-icon-sets">
|
107 |
+
<h2><?php _e( 'Social icons sets: ', APSS_TEXT_DOMAIN ); ?> </h2>
|
108 |
<?php _e('Please choose any one out of available icon themes:', APSS_TEXT_DOMAIN ); ?>
|
109 |
<p><input id="apss_icon_set_1" value="1" name="apss_share_settings[social_icon_set]" type="radio" <?php if($options['social_icon_set'] =='1'){ echo "checked='checked'"; } ?> ><label for="apss_icon_set_1"><span class="apss_demo_icon apss_demo_icons_1"></span><?php _e('Theme 1', APSS_TEXT_DOMAIN ); ?><div class="apss-theme-image"><img src="<?php echo APSS_IMAGE_DIR.'/theme/theme1.jpg';?>"/></div></label></p>
|
110 |
<p><input id="apss_icon_set_2" value="2" name="apss_share_settings[social_icon_set]" type="radio" <?php if($options['social_icon_set'] =='2'){ echo "checked='checked'"; } ?> ><label for="apss_icon_set_2"><span class="apss_demo_icon apss_demo_icons_2"></span><?php _e('Theme 2', APSS_TEXT_DOMAIN ); ?><div class="apss-theme-image"><img src="<?php echo APSS_IMAGE_DIR.'/theme/theme2.jpg';?>"/></div></label></p>
|
135 |
</div>
|
136 |
|
137 |
<div class='cache-settings'>
|
138 |
+
<h4><?php _e( 'Cache Settings: ', APSS_TEXT_DOMAIN ); ?> </h4>
|
139 |
<label for="apss_cache_settings"><?php _e( 'Cache Period:', APSS_TEXT_DOMAIN ); ?></label>
|
140 |
<input type='text' id="apss_cache_period" name='apss_share_settings[cache_settings]' value="<?php if(isset($options['cache_period'])){ echo $options['cache_period']; } ?>" onkeyup="removeMe('invalid_cache_period');"/>
|
141 |
<span class="error invalid_cache_period"></span>
|
inc/backend/save-settings.php
CHANGED
@@ -1,5 +1,5 @@
|
|
1 |
<?php defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); ?>
|
2 |
-
<?php
|
3 |
$apss_share_settings=array();
|
4 |
if( $_POST['action']=='apss_save_options' ){
|
5 |
$share_options = array();
|
@@ -10,12 +10,12 @@
|
|
10 |
$apss_share_settings['share_options']=$share_options;
|
11 |
$apss_share_settings['social_icon_set']=$_POST['apss_share_settings']['social_icon_set'];
|
12 |
$apss_share_settings['share_positions']=$_POST['apss_share_settings']['social_share_position_options'];
|
13 |
-
|
14 |
$apss_social_newtwork_order = explode(',',$_POST['apss_social_newtwork_order']);
|
15 |
$social_network_array = array();
|
16 |
foreach( $apss_social_newtwork_order as $social_network )
|
17 |
{
|
18 |
-
$social_network_array[$social_network] = (isset($_POST['social_networks'][$social_network]))? 1 : 0;
|
19 |
}
|
20 |
|
21 |
$apss_share_settings['social_networks']=$social_network_array;
|
@@ -31,9 +31,9 @@
|
|
31 |
}
|
32 |
|
33 |
// The option already exists, so we just update it.
|
34 |
-
update_option(APSS_SETTING_NAME, $apss_share_settings );
|
35 |
-
$_SESSION['apss_message'] = __('Settings Saved Successfully.', APSS_TEXT_DOMAIN);
|
36 |
-
wp_redirect(admin_url().'admin.php?page=apss-share');
|
37 |
exit;
|
38 |
|
39 |
}
|
1 |
<?php defined( 'ABSPATH' ) or die( 'No script kiddies please!' ); ?>
|
2 |
+
<?php
|
3 |
$apss_share_settings=array();
|
4 |
if( $_POST['action']=='apss_save_options' ){
|
5 |
$share_options = array();
|
10 |
$apss_share_settings['share_options']=$share_options;
|
11 |
$apss_share_settings['social_icon_set']=$_POST['apss_share_settings']['social_icon_set'];
|
12 |
$apss_share_settings['share_positions']=$_POST['apss_share_settings']['social_share_position_options'];
|
13 |
+
|
14 |
$apss_social_newtwork_order = explode(',',$_POST['apss_social_newtwork_order']);
|
15 |
$social_network_array = array();
|
16 |
foreach( $apss_social_newtwork_order as $social_network )
|
17 |
{
|
18 |
+
$social_network_array[$social_network] = (isset($_POST['social_networks'][$social_network]))? 1 : 0;
|
19 |
}
|
20 |
|
21 |
$apss_share_settings['social_networks']=$social_network_array;
|
31 |
}
|
32 |
|
33 |
// The option already exists, so we just update it.
|
34 |
+
update_option( APSS_SETTING_NAME, $apss_share_settings );
|
35 |
+
$_SESSION['apss_message'] = __( 'Settings Saved Successfully.', APSS_TEXT_DOMAIN );
|
36 |
+
wp_redirect( admin_url().'admin.php?page=apss-share' );
|
37 |
exit;
|
38 |
|
39 |
}
|
inc/frontend/content-filter.php
CHANGED
@@ -2,14 +2,12 @@
|
|
2 |
$apss_link_open_option=($options['dialog_box_options']=='1') ? "_blank": "";
|
3 |
$twitter_user=$options['twitter_username'];
|
4 |
$counter_enable_options=$options['counter_enable_options'];
|
5 |
-
$api_link='';
|
6 |
$icon_set_value=$options['social_icon_set'];
|
7 |
-
$url =
|
8 |
-
$text= get_the_title();
|
9 |
$cache_period = ($options['cache_period'] != '') ? $options['cache_period']*60*60 : 24 * 60 * 60 ;
|
10 |
foreach( $options['social_networks'] as $key=>$value ){
|
11 |
if( intval($value)=='1' ){
|
12 |
-
switch($key){
|
13 |
//counter available for facebook
|
14 |
case 'facebook':
|
15 |
$link = 'https://www.facebook.com/sharer/sharer.php?u='.$url;
|
@@ -18,15 +16,15 @@ foreach( $options['social_networks'] as $key=>$value ){
|
|
18 |
<a title='Share on Facebook' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
|
19 |
<div class='apss-icon-block clearfix'>
|
20 |
<i class='fa fa-facebook'></i>
|
21 |
-
<span class='apss-social-text'><?php _e('Share on', APSS_TEXT_DOMAIN ); ?> <?php echo ucfirst($key); ?></span>
|
22 |
<span class='apss-share'><?php _e( 'Share', APSS_TEXT_DOMAIN ); ?></span>
|
23 |
</div>
|
24 |
-
|
25 |
-
|
26 |
-
|
27 |
</a>
|
28 |
</div>
|
29 |
-
<?php
|
30 |
break;
|
31 |
|
32 |
//counter available for twitter
|
@@ -42,10 +40,10 @@ foreach( $options['social_networks'] as $key=>$value ){
|
|
42 |
<a title='Share on Twitter' target='<?php echo $apss_link_open_option; ?>' href="<?php echo $link; ?>">
|
43 |
<div class='apss-icon-block clearfix'>
|
44 |
<i class='fa fa-twitter'></i>
|
45 |
-
<span class='apss-social-text'><?php _e('Share on', APSS_TEXT_DOMAIN ); ?> <?php echo ucfirst($key); ?></span><span class='apss-share'><?php _e( 'Tweet', APSS_TEXT_DOMAIN ); ?></span>
|
46 |
</div>
|
47 |
-
<?php if(isset($counter_enable_options) && $counter_enable_options=='1'){ ?>
|
48 |
-
<div class='count apss-count' data-url='<?php echo $url
|
49 |
<?php } ?>
|
50 |
</a>
|
51 |
</div>
|
@@ -58,14 +56,14 @@ foreach( $options['social_networks'] as $key=>$value ){
|
|
58 |
?>
|
59 |
<div class='apss-google-plus apss-single-icon'>
|
60 |
<a title='Share on Google+' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
|
61 |
-
|
62 |
-
|
63 |
-
|
64 |
-
|
65 |
-
|
66 |
-
|
67 |
-
|
68 |
-
|
69 |
</a>
|
70 |
</div>
|
71 |
<?php
|
@@ -73,22 +71,18 @@ foreach( $options['social_networks'] as $key=>$value ){
|
|
73 |
|
74 |
//counter available for pinterest
|
75 |
case 'pinterest':
|
76 |
-
// if(has_post_thumbnail()){
|
77 |
-
// $image = wp_get_attachment_image_src( get_post_thumbnail_id( $post->ID ), 'single-post-thumbnail' );
|
78 |
-
// $link = 'http://pinterest.com/pin/create/bookmarklet/?media='.$image[0].'&url='.$url.'&title='.$title.'&description='.$excerpt;
|
79 |
?>
|
80 |
|
81 |
<div class='apss-pinterest apss-single-icon'>
|
82 |
<a title='Share on Pinterest' href='javascript:void((function()%7Bvar%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)%7D)());'>
|
83 |
<div class='apss-icon-block clearfix'>
|
84 |
<i class='fa fa-pinterest'></i>
|
85 |
-
<span class='apss-social-text'><?php _e('Share on', APSS_TEXT_DOMAIN ); ?> <?php echo ucfirst($key); ?></span>
|
86 |
<span class='apss-share'><?php _e( 'Share', APSS_TEXT_DOMAIN ); ?></span>
|
87 |
</div>
|
88 |
-
|
89 |
-
|
90 |
-
|
91 |
-
<?php } ?>
|
92 |
|
93 |
</a>
|
94 |
</div>
|
@@ -103,14 +97,12 @@ foreach( $options['social_networks'] as $key=>$value ){
|
|
103 |
<div class='apss-linkedin apss-single-icon'>
|
104 |
<a title='Share on LinkedIn' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
|
105 |
<div class='apss-icon-block clearfix'><i class='fa fa-linkedin'></i>
|
106 |
-
<span class='apss-social-text'><?php _e('Share on', APSS_TEXT_DOMAIN ); ?> <?php echo ucfirst($key); ?></span>
|
107 |
<span class='apss-share'><?php _e( 'Share', APSS_TEXT_DOMAIN ); ?></span>
|
108 |
</div>
|
109 |
-
|
110 |
-
<?php
|
111 |
-
<div class='count apss-count' data-url='<?php echo $url;?>' data-social-network='<?php echo $key; ?>' data-social-detail="<?php echo $url.'_'.$key;?>">Loading...</div>
|
112 |
<?php } ?>
|
113 |
-
|
114 |
</a>
|
115 |
</div>
|
116 |
<?php
|
@@ -124,7 +116,7 @@ foreach( $options['social_networks'] as $key=>$value ){
|
|
124 |
<a title='Share on Digg' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
|
125 |
<div class='apss-icon-block clearfix'>
|
126 |
<i class='fa fa-digg'></i>
|
127 |
-
<span class='apss-social-text'><?php _e('Share on', APSS_TEXT_DOMAIN ); ?> <?php echo ucfirst($key); ?></span>
|
128 |
<span class='apss-share'><?php _e( 'Share', APSS_TEXT_DOMAIN ); ?></span>
|
129 |
</div>
|
130 |
</a>
|
@@ -136,7 +128,7 @@ foreach( $options['social_networks'] as $key=>$value ){
|
|
136 |
case 'email':
|
137 |
if ( strpos( $options['apss_email_body'], '%%' ) || strpos( $options['apss_email_subject'], '%%' ) ) {
|
138 |
$link = 'mailto:?subject='.$options['apss_email_subject'].'&body='.$options['apss_email_body'];
|
139 |
-
$link = preg_replace( array( '#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#', '#%%url%%#' ), array(
|
140 |
}
|
141 |
else {
|
142 |
$link = 'mailto:?subject='.$options['apss_email_subject'].'&body='.$options['apss_email_body'].": ".$url;
|
2 |
$apss_link_open_option=($options['dialog_box_options']=='1') ? "_blank": "";
|
3 |
$twitter_user=$options['twitter_username'];
|
4 |
$counter_enable_options=$options['counter_enable_options'];
|
|
|
5 |
$icon_set_value=$options['social_icon_set'];
|
6 |
+
$url = get_permalink(); //$this->curPageURL();
|
|
|
7 |
$cache_period = ($options['cache_period'] != '') ? $options['cache_period']*60*60 : 24 * 60 * 60 ;
|
8 |
foreach( $options['social_networks'] as $key=>$value ){
|
9 |
if( intval($value)=='1' ){
|
10 |
+
switch( $key ){
|
11 |
//counter available for facebook
|
12 |
case 'facebook':
|
13 |
$link = 'https://www.facebook.com/sharer/sharer.php?u='.$url;
|
16 |
<a title='Share on Facebook' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
|
17 |
<div class='apss-icon-block clearfix'>
|
18 |
<i class='fa fa-facebook'></i>
|
19 |
+
<span class='apss-social-text'><?php _e( 'Share on', APSS_TEXT_DOMAIN ); ?> <?php echo ucfirst( $key ); ?></span>
|
20 |
<span class='apss-share'><?php _e( 'Share', APSS_TEXT_DOMAIN ); ?></span>
|
21 |
</div>
|
22 |
+
<?php if(isset($counter_enable_options) && $counter_enable_options=='1'){ ?>
|
23 |
+
<div class='count apss-count' data-url='<?php echo $url; ?>' data-social-network='<?php echo $key; ?>' data-social-detail="<?php echo $url.'_'.$key; ?>">Loading...</div>
|
24 |
+
<?php } ?>
|
25 |
</a>
|
26 |
</div>
|
27 |
+
<?php
|
28 |
break;
|
29 |
|
30 |
//counter available for twitter
|
40 |
<a title='Share on Twitter' target='<?php echo $apss_link_open_option; ?>' href="<?php echo $link; ?>">
|
41 |
<div class='apss-icon-block clearfix'>
|
42 |
<i class='fa fa-twitter'></i>
|
43 |
+
<span class='apss-social-text'><?php _e( 'Share on', APSS_TEXT_DOMAIN ); ?> <?php echo ucfirst($key); ?></span><span class='apss-share'><?php _e( 'Tweet', APSS_TEXT_DOMAIN ); ?></span>
|
44 |
</div>
|
45 |
+
<?php if( isset( $counter_enable_options ) && $counter_enable_options=='1'){ ?>
|
46 |
+
<div class='count apss-count' data-url='<?php echo $url; ?>' data-social-network='<?php echo $key; ?>' data-social-detail="<?php echo $url.'_'.$key; ?>">Loading...</div>
|
47 |
<?php } ?>
|
48 |
</a>
|
49 |
</div>
|
56 |
?>
|
57 |
<div class='apss-google-plus apss-single-icon'>
|
58 |
<a title='Share on Google+' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
|
59 |
+
<div class='apss-icon-block clearfix'>
|
60 |
+
<i class='fa fa-google-plus'></i>
|
61 |
+
<span class='apss-social-text'><?php _e('Share on', APSS_TEXT_DOMAIN ); ?> Google Plus</span>
|
62 |
+
<span class='apss-share'><?php _e( 'Share', APSS_TEXT_DOMAIN ); ?></span>
|
63 |
+
</div>
|
64 |
+
<?php if(isset($counter_enable_options) && $counter_enable_options=='1'){ ?>
|
65 |
+
<div class='count apss-count' data-url='<?php echo $url;?>' data-social-network='<?php echo $key; ?>' data-social-detail="<?php echo $url.'_'.$key;?>">Loading...</div>
|
66 |
+
<?php } ?>
|
67 |
</a>
|
68 |
</div>
|
69 |
<?php
|
71 |
|
72 |
//counter available for pinterest
|
73 |
case 'pinterest':
|
|
|
|
|
|
|
74 |
?>
|
75 |
|
76 |
<div class='apss-pinterest apss-single-icon'>
|
77 |
<a title='Share on Pinterest' href='javascript:void((function()%7Bvar%20e=document.createElement('script');e.setAttribute('type','text/javascript');e.setAttribute('charset','UTF-8');e.setAttribute('src','http://assets.pinterest.com/js/pinmarklet.js?r='+Math.random()*99999999);document.body.appendChild(e)%7D)());'>
|
78 |
<div class='apss-icon-block clearfix'>
|
79 |
<i class='fa fa-pinterest'></i>
|
80 |
+
<span class='apss-social-text'><?php _e( 'Share on', APSS_TEXT_DOMAIN ); ?> <?php echo ucfirst($key); ?></span>
|
81 |
<span class='apss-share'><?php _e( 'Share', APSS_TEXT_DOMAIN ); ?></span>
|
82 |
</div>
|
83 |
+
<?php if( isset( $counter_enable_options ) && $counter_enable_options=='1' ){ ?>
|
84 |
+
<div class='count apss-count' data-url='<?php echo $url; ?>' data-social-network='<?php echo $key; ?>' data-social-detail="<?php echo $url.'_'.$key;?>">Loading...</div>
|
85 |
+
<?php } ?>
|
|
|
86 |
|
87 |
</a>
|
88 |
</div>
|
97 |
<div class='apss-linkedin apss-single-icon'>
|
98 |
<a title='Share on LinkedIn' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
|
99 |
<div class='apss-icon-block clearfix'><i class='fa fa-linkedin'></i>
|
100 |
+
<span class='apss-social-text'><?php _e( 'Share on', APSS_TEXT_DOMAIN ); ?> <?php echo ucfirst($key); ?></span>
|
101 |
<span class='apss-share'><?php _e( 'Share', APSS_TEXT_DOMAIN ); ?></span>
|
102 |
</div>
|
103 |
+
<?php if( isset( $counter_enable_options ) && $counter_enable_options=='1' ){ ?>
|
104 |
+
<div class='count apss-count' data-url='<?php echo $url; ?>' data-social-network='<?php echo $key; ?>' data-social-detail="<?php echo $url.'_'.$key; ?>">Loading...</div>
|
|
|
105 |
<?php } ?>
|
|
|
106 |
</a>
|
107 |
</div>
|
108 |
<?php
|
116 |
<a title='Share on Digg' target='<?php echo $apss_link_open_option; ?>' href='<?php echo $link; ?>'>
|
117 |
<div class='apss-icon-block clearfix'>
|
118 |
<i class='fa fa-digg'></i>
|
119 |
+
<span class='apss-social-text'><?php _e( 'Share on', APSS_TEXT_DOMAIN ); ?> <?php echo ucfirst($key); ?></span>
|
120 |
<span class='apss-share'><?php _e( 'Share', APSS_TEXT_DOMAIN ); ?></span>
|
121 |
</div>
|
122 |
</a>
|
128 |
case 'email':
|
129 |
if ( strpos( $options['apss_email_body'], '%%' ) || strpos( $options['apss_email_subject'], '%%' ) ) {
|
130 |
$link = 'mailto:?subject='.$options['apss_email_subject'].'&body='.$options['apss_email_body'];
|
131 |
+
$link = preg_replace( array( '#%%title%%#', '#%%siteurl%%#', '#%%permalink%%#', '#%%url%%#' ), array( $title, get_site_url(), get_permalink(), $url ), $link );
|
132 |
}
|
133 |
else {
|
134 |
$link = 'mailto:?subject='.$options['apss_email_subject'].'&body='.$options['apss_email_body'].": ".$url;
|
inc/frontend/shortcode.php
CHANGED
@@ -6,8 +6,7 @@ $apss_link_open_option=($options['dialog_box_options']=='1') ? "_blank": "";
|
|
6 |
$twitter_user=$options['twitter_username'];
|
7 |
$counter_enable_options=$options['counter_enable_options'];
|
8 |
$icon_set_value=$options['social_icon_set'];
|
9 |
-
$url= $this->curPageURL();
|
10 |
-
$text= get_the_title();
|
11 |
$cache_period = ($options['cache_period'] != '') ? $options['cache_period']*60*60 : 24 * 60 * 60 ;
|
12 |
|
13 |
if( isset($attr['networks']) ){
|
@@ -189,7 +188,6 @@ foreach( $options['social_networks'] as $key=>$value ){
|
|
189 |
</div>
|
190 |
<?php
|
191 |
break;
|
192 |
-
|
193 |
}
|
194 |
}
|
195 |
|
6 |
$twitter_user=$options['twitter_username'];
|
7 |
$counter_enable_options=$options['counter_enable_options'];
|
8 |
$icon_set_value=$options['social_icon_set'];
|
9 |
+
$url= $this->curPageURL();
|
|
|
10 |
$cache_period = ($options['cache_period'] != '') ? $options['cache_period']*60*60 : 24 * 60 * 60 ;
|
11 |
|
12 |
if( isset($attr['networks']) ){
|
188 |
</div>
|
189 |
<?php
|
190 |
break;
|
|
|
191 |
}
|
192 |
}
|
193 |
|
js/frontend.js
CHANGED
@@ -7,6 +7,8 @@ jQuery(document).ready(function ($) {
|
|
7 |
shortcode_profile_array.push(social_detail);
|
8 |
}
|
9 |
});
|
|
|
|
|
10 |
if (shortcode_profile_array.length > 0)
|
11 |
{
|
12 |
$.ajax({
|
7 |
shortcode_profile_array.push(social_detail);
|
8 |
}
|
9 |
});
|
10 |
+
|
11 |
+
// ajax call for social counter
|
12 |
if (shortcode_profile_array.length > 0)
|
13 |
{
|
14 |
$.ajax({
|
readme.txt
CHANGED
@@ -4,7 +4,7 @@ Tags: social share counter, social share, social media share, social network sha
|
|
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 |
|
@@ -119,6 +119,10 @@ Yes. You can use the AccessPress social share by using shortcode anywhere you wa
|
|
119 |
6. Backend Miscellaneous Settings Section
|
120 |
|
121 |
== Changelog ==
|
|
|
|
|
|
|
|
|
122 |
= 1.0.5 =
|
123 |
* Added the shortcode options.
|
124 |
* fixed small css issue for the twitter share display.
|
4 |
Donate link: http://accesspressthemes.com/donation/
|
5 |
Requires at least: 3.8
|
6 |
Tested up to: 4.1
|
7 |
+
Stable tag: 1.0.6
|
8 |
License: GPLv2 or later
|
9 |
License URI: http://www.gnu.org/licenses/gpl-2.0.html
|
10 |
|
119 |
6. Backend Miscellaneous Settings Section
|
120 |
|
121 |
== Changelog ==
|
122 |
+
= 1.0.6 =
|
123 |
+
* Fixed the plugin text domain issue for localization.
|
124 |
+
* Texts modification in about section and miscellaneous settings section.
|
125 |
+
|
126 |
= 1.0.5 =
|
127 |
* Added the shortcode options.
|
128 |
* fixed small css issue for the twitter share display.
|