Social Share WordPress Plugin – AccessPress Social Share - Version 4.1.2

Version Description

  • Changed the priority of the_content filter to make the plugin compactible with "Advanced Ads" plugin.
  • Updated the 'apss_count' shortcode to support multiple networks. Please see "how to use" tab for more information.
Download this release

Release Info

Developer Access Keys
Plugin Icon 128x128 Social Share WordPress Plugin – AccessPress Social Share
Version 4.1.2
Comparing to
See all releases

Code changes from version 4.1.1 to 4.1.2

accesspress-social-share.php CHANGED
@@ -4,7 +4,7 @@ defined( 'ABSPATH' ) or die( "No script kiddies please!" );
4
  Plugin name: Social Share WordPress Plugin - 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: 4.1.1
8
  Author: AccessPress Themes
9
  Author URI: http://accesspressthemes.com
10
  Text Domain: accesspress-social-share
@@ -30,7 +30,7 @@ if ( !defined( 'APSS_LANG_DIR' ) ) {
30
  }
31
 
32
  if ( !defined( 'APSS_VERSION' ) ) {
33
- define( 'APSS_VERSION', '4.1.1' );
34
  }
35
 
36
  if ( !defined( 'APSS_TEXT_DOMAIN' ) ) {
@@ -59,7 +59,7 @@ if ( !class_exists( 'APSS_Class' ) ) {
59
  add_action( 'init', array( $this, 'plugin_text_domain' ) ); //load the plugin text domain
60
  add_action( 'init', array( $this, 'session_init' ) ); //start the session if not started yet.
61
  add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_assets' ) ); //registers all the assets required for wp-admin
62
- add_filter( 'the_content', array( $this, 'apss_the_content_filter' ), 12 ); // add the filter function for display of social share icons in frontend //added 12 priority level at the end to make the plugin compactible with Visual Composer.
63
 
64
  if ( isset( $this->apss_settings['disable_frontend_assets'] ) && $this->apss_settings['disable_frontend_assets'] != '1' ) {
65
  add_action( 'wp_enqueue_scripts', array( $this, 'register_frontend_assets' ) ); //registers all the assets required for the frontend
@@ -282,12 +282,12 @@ if ( !class_exists( 'APSS_Class' ) ) {
282
  }
283
 
284
  //frontend counter only Shortcode
285
- function apss_count_shortcode( $atts ) {
286
- if ( isset( $atts['network'] ) ) {
287
- $url = $this->curPageURL();
288
- $count = $this->get_count( $atts['network'], $url );
289
- return $count;
290
- }
291
  }
292
 
293
  ///////////////////////////for post meta options//////////////////////////////////
4
  Plugin name: Social Share WordPress Plugin - 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: 4.1.2
8
  Author: AccessPress Themes
9
  Author URI: http://accesspressthemes.com
10
  Text Domain: accesspress-social-share
30
  }
31
 
32
  if ( !defined( 'APSS_VERSION' ) ) {
33
+ define( 'APSS_VERSION', '4.1.2' );
34
  }
35
 
36
  if ( !defined( 'APSS_TEXT_DOMAIN' ) ) {
59
  add_action( 'init', array( $this, 'plugin_text_domain' ) ); //load the plugin text domain
60
  add_action( 'init', array( $this, 'session_init' ) ); //start the session if not started yet.
61
  add_action( 'admin_enqueue_scripts', array( $this, 'register_admin_assets' ) ); //registers all the assets required for wp-admin
62
+ add_filter( 'the_content', array( $this, 'apss_the_content_filter' ), 110 ); // add the filter function for display of social share icons in frontend //added 12 priority level at the end to make the plugin compactible with Visual Composer.
63
 
64
  if ( isset( $this->apss_settings['disable_frontend_assets'] ) && $this->apss_settings['disable_frontend_assets'] != '1' ) {
65
  add_action( 'wp_enqueue_scripts', array( $this, 'register_frontend_assets' ) ); //registers all the assets required for the frontend
282
  }
283
 
284
  //frontend counter only Shortcode
285
+ function apss_count_shortcode( $attr ) {
286
+ ob_start();
287
+ include( 'inc/frontend/count_shortcode.php' );
288
+ $html = ob_get_contents();
289
+ ob_get_clean();
290
+ return $html;
291
  }
292
 
293
  ///////////////////////////for post meta options//////////////////////////////////
inc/backend/how-to-use.php CHANGED
@@ -33,21 +33,30 @@
33
  <li><i class="fa fa-check"></i>total_counter : You can enable or disable the total share counter. To enable the total share count use total_counter='1' and to disable it simply don't use total_counter parameter or use parameter total_counter='0'.</li>
34
  <li><i class="fa fa-check"></i>custom_share_link : You can enter the custom share link in case if the link provided by shortcode is not as per your need. To enable the custom share link use custom_share_link='custom link as per your need.'</li>
35
  </ul>
36
- <li><i class="fa fa-check"></i>Example 2: <code>[apss_share networks='facebook, twitter, pinterest' share_text='Share it' counter='1' total_counter='1']</code></li>
37
  </ul>
38
  </p></dd>
39
  <dd>
40
- <p>You can use shortcode [apss_count] for the display of the social share count only in the contents. You need to enter network name you want to display.
41
  <ul class="how-list">
42
- <li><i class="fa fa-check"></i>Example 1: <code>[apss_count network='facebook']</code>
43
- Please note that this shortcode takes only one network value at a time. So if you want to fetch the share count for facebook and pinterest you need to use <code>[apss_count network='facebook']</code> and <code>[apss_count network='pinterest']</code> respectively.
44
- </li>
45
- <li><i class="fa fa-check"></i>Available network parameters are: facebook, twitter, google-plus, pinterest, linkedin</li>
 
 
 
 
 
 
 
 
 
 
46
  </ul>
47
  </p>
48
  </dd>
49
-
50
  <dd>
51
- <p><b>Also for now you can use shortcode [apss-share] and [apss-count] for the display of the social shares and counts only as well but in upcoming plugin updates this shortcode will be removed and use the new one.</b></p>
52
  </dd>
53
  </dl>
33
  <li><i class="fa fa-check"></i>total_counter : You can enable or disable the total share counter. To enable the total share count use total_counter='1' and to disable it simply don't use total_counter parameter or use parameter total_counter='0'.</li>
34
  <li><i class="fa fa-check"></i>custom_share_link : You can enter the custom share link in case if the link provided by shortcode is not as per your need. To enable the custom share link use custom_share_link='custom link as per your need.'</li>
35
  </ul>
36
+ <li><i class="fa fa-check"></i>Example 1.1: <code>[apss_share networks='facebook, twitter, pinterest' share_text='Share it' counter='1' total_counter='1']</code></li>
37
  </ul>
38
  </p></dd>
39
  <dd>
40
+ <p>You can use the below shortcode to display the share counts number only in the content using shortcode. You can wrap that number in your reqired html tags and use it as per your need. The share count displayed will be the sum of entered network attributes.
41
  <ul class="how-list">
42
+ <li><li><i class="fa fa-check"></i>Example 2: <code>[apss_count]</code></li></li>
43
+ <li>Available Parameters</li>
44
+ <ul>
45
+ <li><i class="fa fa-check"></i>network : You can define which social medias to show total share counts. You need to enter the networks name in string in comma separated values. You need to enter at least one network attribute.</li>
46
+ <li>Available network parameters are: facebook, twitter, google-plus, pinterest, linkedin</li>
47
+ <li>Example 2.1: <code>[apss_count network='facebook, pinterest']</code></li>
48
+ <li>This will show the sum of share counts from facebook and pinterest.</li>
49
+ </ul>
50
+ <ul>
51
+ <li><i class="fa fa-check"></i>custom_url_link</li>
52
+ <li>Now you can use attribute "custom_url_link" to fetch the share counts for custom url as well.</li>
53
+ <li>Example 2.2: <code>[apss_count network='facebook, pinterest' custom_url_link='<?php echo site_url('sample-page'); ?>']</code></li>
54
+ <li>This attribute is useful in case if the shortcode is not fetching the share counts for shortcode placed url and force the shortcode to use the url from the attribute defined in custom_url_link.</li>
55
+ </ul>
56
  </ul>
57
  </p>
58
  </dd>
 
59
  <dd>
60
+ <p><b>For now you can use shortcode [apss-share] and [apss-count] for the display of the social shares and counts only as well but in upcoming plugin updates this shortcode will be removed and use the new one. So we suggest to use only the new shortcodes.</b></p>
61
  </dd>
62
  </dl>
inc/frontend/count_shortcode.php ADDED
@@ -0,0 +1,52 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ defined( 'ABSPATH' ) or die( "No script kiddies please!" );
3
+ global $post;
4
+ $options = get_option( APSS_SETTING_NAME );
5
+ if(isset($attr['custom_url_link']) && $attr['custom_url_link'] !=''){
6
+ $url = esc_url($attr['custom_url_link']);
7
+ }else{
8
+ $url = (get_permalink() != FALSE) ? get_permalink() : $this->curPageURL();
9
+ }
10
+ if ( isset( $attr['network'] ) ) {
11
+ $raw_array = explode( ',', $attr['network'] );
12
+ $network_array = array_map( 'trim', $raw_array );
13
+ $new_array = array();
14
+ foreach ( $network_array as $network ) {
15
+ $new_array[$network] = '1';
16
+ }
17
+ $options['social_networks'] = $new_array;
18
+ }
19
+ $total_count = 0;
20
+ $count = 0;
21
+ foreach ( $options['social_networks'] as $key => $value ) {
22
+ if ( intval( $value ) == '1' ) {
23
+ switch ( $key ) {
24
+ //counter available for facebook
25
+ case 'facebook':
26
+ $count = $this->get_count( $key, $url );
27
+ break;
28
+
29
+ //counter available for twitter
30
+ case 'twitter':
31
+ $count = $this->get_count( $key, $url );
32
+ break;
33
+
34
+ //counter available for google plus
35
+ case 'google-plus':
36
+ $count = $this->get_count( $key, $url );
37
+ break;
38
+
39
+ //counter available for pinterest
40
+ case 'pinterest':
41
+ $count = $this->get_count( $key, $url );
42
+ break;
43
+
44
+ //couter available for linkedin
45
+ case 'linkedin':
46
+ $count = $this->get_count( $key, $url );
47
+ break;
48
+ }
49
+ $total_count += $count;
50
+ }
51
+ }
52
+ echo $total_count;
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.5
7
- Stable tag: 4.1.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -131,6 +131,10 @@ Yes. You can use the AccessPress social share by using shortcode anywhere you wa
131
  6. Backend Miscellaneous Settings Section
132
 
133
  == Changelog ==
 
 
 
 
134
  = 4.1.1 =
135
  * Added options to disable the cache for the url share counts.
136
  * Added an option to enable the social share in popup window.
4
  Donate link: http://accesspressthemes.com/donation/
5
  Requires at least: 3.8
6
  Tested up to: 4.5
7
+ Stable tag: 4.1.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
131
  6. Backend Miscellaneous Settings Section
132
 
133
  == Changelog ==
134
+ = 4.1.2 =
135
+ * Changed the priority of the_content filter to make the plugin compactible with "Advanced Ads" plugin.
136
+ * Updated the 'apss_count' shortcode to support multiple networks. Please see "how to use" tab for more information.
137
+
138
  = 4.1.1 =
139
  * Added options to disable the cache for the url share counts.
140
  * Added an option to enable the social share in popup window.