Social Media Feather | social media sharing - Version 2.1.1

Version Description

  • Fix bug with follow
Download this release

Release Info

Developer socialmediafeather
Plugin Icon 128x128 Social Media Feather | social media sharing
Version 2.1.1
Comparing to
See all releases

Code changes from version 2.1.0 to 2.1.1

php/class-plugin-base.php CHANGED
@@ -145,9 +145,8 @@ abstract class Plugin_Base {
145
  * @return array
146
  */
147
  public function locate_plugin() {
148
- $base_file = str_replace( 'php', '', __FILE__ );
149
- $dir_url = trailingslashit( plugins_url( '', $base_file ) );
150
- $dir_path = substr( str_replace( 'class-plugin-base', '', $base_file ), 0, - 2 );
151
  $dir_basename = basename( $dir_path );
152
 
153
  return compact( 'dir_url', 'dir_path', 'dir_basename' );
145
  * @return array
146
  */
147
  public function locate_plugin() {
148
+ $dir_url = SOCIAL_MEDIA_FEATHER_PLUGIN_URL;
149
+ $dir_path = SOCIAL_MEDIA_FEATHER_PLUGIN_DIRECTORY;
 
150
  $dir_basename = basename( $dir_path );
151
 
152
  return compact( 'dir_url', 'dir_path', 'dir_basename' );
php/class-plugin.php CHANGED
@@ -31,6 +31,9 @@ class Plugin extends Plugin_Base {
31
  public function __construct() {
32
  parent::__construct();
33
 
 
 
 
34
  // Initiate classes.
35
  $classes = array(
36
  new SocialMediaFeather( $this ),
31
  public function __construct() {
32
  parent::__construct();
33
 
34
+ // Include SocialMediaFeather class intentionally.
35
+ include_once trailingslashit( __DIR__ ) . 'class-socialmediafeather.php';
36
+
37
  // Initiate classes.
38
  $classes = array(
39
  new SocialMediaFeather( $this ),
php/class-socialmediafeather.php CHANGED
@@ -93,7 +93,7 @@ class SocialMediaFeather {
93
 
94
  wp_enqueue_script(
95
  "{$this->plugin->assets_prefix}-app",
96
- $this->plugin->dir_url . 'build/index.js',
97
  $dependency_settings['dependencies'],
98
  $dependency_settings['version'],
99
  false
@@ -212,7 +212,7 @@ class SocialMediaFeather {
212
  *
213
  * @return array Sanitized array of fields.
214
  */
215
- public function sanitize_incoming_fields( array $fields ): array {
216
  $whitelist = $this->get_field_whitelist();
217
 
218
  // Remove fields that aren't in our whitelist.
@@ -315,7 +315,7 @@ class SocialMediaFeather {
315
  *
316
  * @return array Hashed array with fields as key and sanitizer type as value.
317
  */
318
- public function get_field_whitelist(): array {
319
  return array(
320
  'accepted_sharethis_terms' => array(
321
  'type' => 'boolean',
93
 
94
  wp_enqueue_script(
95
  "{$this->plugin->assets_prefix}-app",
96
+ "{$this->plugin->dir_url}build/index.js",
97
  $dependency_settings['dependencies'],
98
  $dependency_settings['version'],
99
  false
212
  *
213
  * @return array Sanitized array of fields.
214
  */
215
+ public function sanitize_incoming_fields( array $fields ) {
216
  $whitelist = $this->get_field_whitelist();
217
 
218
  // Remove fields that aren't in our whitelist.
315
  *
316
  * @return array Hashed array with fields as key and sanitizer type as value.
317
  */
318
+ public function get_field_whitelist() {
319
  return array(
320
  'accepted_sharethis_terms' => array(
321
  'type' => 'boolean',
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: socialmediafeather, scottstorebloom, scottmweaver
3
  Tags: social media, social sharing, social buttons, Facebook, Share, Like, twitter, google, Reddit, youtube, instagram, pinterest, social media buttons, button, shortcode, sidebar, sharing buttons, follow buttons
4
  Requires at least: 3.1
5
  Tested up to: 5.9.1
6
- Stable tag: 2.1.0
7
- Version: 2.1.0
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -190,6 +190,9 @@ margin-left: 10px;
190
 
191
  == Changelog ==
192
 
 
 
 
193
  = 2.1.0 =
194
  * New settings interface.
195
  * Sanitize everything!
3
  Tags: social media, social sharing, social buttons, Facebook, Share, Like, twitter, google, Reddit, youtube, instagram, pinterest, social media buttons, button, shortcode, sidebar, sharing buttons, follow buttons
4
  Requires at least: 3.1
5
  Tested up to: 5.9.1
6
+ Stable tag: 2.1.1
7
+ Version: 2.1.1
8
  License: GPLv2
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
190
 
191
  == Changelog ==
192
 
193
+ = 2.1.1 =
194
+ * Fix bug with follow
195
+
196
  = 2.1.0 =
197
  * New settings interface.
198
  * Sanitize everything!
social-media-feather.php CHANGED
@@ -5,7 +5,7 @@
5
  * Plugin URI: https://sharethis.com/platform/wordpress-social-media-feather/
6
  * Description: Super lightweight social media plugin to add nice and effective social media sharing and following buttons and icons anywhere on your site quickly and easily.
7
  * Author: socialmediafeather
8
- * Version: 2.1.0
9
  * Author URI: https://sharethis.com/platform/wordpress-social-media-feather/
10
  *
11
  * @package SocialMediaFeather
@@ -16,7 +16,7 @@ define( 'SOCIAL_MEDIA_FEATHER_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
16
 
17
  const SOCIAL_MEDIA_FEATHER_PLUGIN_MAIN_FILE = __FILE__;
18
 
19
- const SYNVED_VERSION = '2.1.0';
20
 
21
  if ( false === function_exists( 'synved_wp_social_load' ) ) {
22
  /**
5
  * Plugin URI: https://sharethis.com/platform/wordpress-social-media-feather/
6
  * Description: Super lightweight social media plugin to add nice and effective social media sharing and following buttons and icons anywhere on your site quickly and easily.
7
  * Author: socialmediafeather
8
+ * Version: 2.1.1
9
  * Author URI: https://sharethis.com/platform/wordpress-social-media-feather/
10
  *
11
  * @package SocialMediaFeather
16
 
17
  const SOCIAL_MEDIA_FEATHER_PLUGIN_MAIN_FILE = __FILE__;
18
 
19
+ const SYNVED_VERSION = '2.1.1';
20
 
21
  if ( false === function_exists( 'synved_wp_social_load' ) ) {
22
  /**
synved-option/synved-option-item.php CHANGED
@@ -531,7 +531,7 @@ function synved_option_item_set( array $item ) {
531
  * @return mixed|string|SynvedOptionCallback|null
532
  */
533
  function synved_option_item_callback( array $item, $callback_id, $callback_parameters = null ) {
534
- $callback = $item[ $callback_id ] ?? null;
535
 
536
  if ( false === empty( $callback ) ) {
537
  $callback = trim( $callback );
531
  * @return mixed|string|SynvedOptionCallback|null
532
  */
533
  function synved_option_item_callback( array $item, $callback_id, $callback_parameters = null ) {
534
+ $callback = true === isset( $item[ $callback_id ] ) ? $item[ $callback_id ] : null;
535
 
536
  if ( false === empty( $callback ) ) {
537
  $callback = trim( $callback );
synved-option/synved-option-page.php CHANGED
@@ -122,7 +122,9 @@ function synved_option_page_add( $id, $name, $item ) {
122
  $type = synved_option_item_type( $item );
123
 
124
  if ( 'options-page' === $type ) {
125
- $label = synved_option_item_label( $item ) ?? $name;
 
 
126
  $parent = synved_option_item_parent( $item );
127
  $role = synved_option_item_role( $item );
128
 
122
  $type = synved_option_item_type( $item );
123
 
124
  if ( 'options-page' === $type ) {
125
+ $label = synved_option_item_label( $item );
126
+ $label = false === empty( $label ) ? $label : $name;
127
+
128
  $parent = synved_option_item_parent( $item );
129
  $role = synved_option_item_role( $item );
130
 
synved-social/synved-social-setup.php CHANGED
@@ -849,13 +849,13 @@ function synved_social_wp_the_content( $content, $id = null ) {
849
  }
850
 
851
  if ( false === empty( $id ) ) {
 
 
852
  $exclude = 'yes' === get_post_meta( $id, 'synved_social_exclude', true );
853
  $exclude_share = 'yes' === get_post_meta( $id, 'synved_social_exclude_share', true );
854
  $exclude_follow = 'yes' === get_post_meta( $id, 'synved_social_exclude_follow', true );
855
 
856
- if ( false === $exclude_share
857
- && false !== synved_option_get( 'synved_social', 'automatic_share_single', false )
858
- ) {
859
  $exclude_share = false === (
860
  true === is_singular( synved_option_get( 'synved_social', 'automatic_share_post_types' ) )
861
  && (
@@ -865,7 +865,7 @@ function synved_social_wp_the_content( $content, $id = null ) {
865
  }
866
 
867
  if ( false === $exclude_follow &&
868
- false !== synved_option_get( 'synved_social', 'automatic_follow_single', false )
869
  ) {
870
  $exclude_follow = false === (
871
  true === is_singular( synved_option_get( 'synved_social', 'automatic_follow_post_types' ) )
@@ -878,7 +878,7 @@ function synved_social_wp_the_content( $content, $id = null ) {
878
 
879
  if ( false === $exclude ) {
880
  if ( false === $exclude_share
881
- && false !== synved_option_get( 'synved_social', 'automatic_share', false )
882
  ) {
883
  $post_type = get_post_type();
884
  $type_list = synved_option_get( 'synved_social', 'automatic_share_post_types' );
@@ -926,9 +926,11 @@ function synved_social_wp_the_content( $content, $id = null ) {
926
  $separator_before = $separator;
927
  }
928
 
929
- if ( false === $exclude_follow
930
- && false !== synved_option_get( 'synved_social', 'automatic_follow', false )
931
- ) {
 
 
932
  $post_type = get_post_type();
933
  $type_list = synved_option_get( 'synved_social', 'automatic_follow_post_types', array() );
934
 
@@ -1165,9 +1167,10 @@ function synved_social_init() {
1165
  add_shortcode( 'synved_feather_follow', 'synved_social_follow_shortcode' );
1166
  }
1167
 
1168
- if ( false !== synved_option_get( 'synved_social', 'automatic_share', false )
1169
- || false !== synved_option_get( 'synved_social', 'automatic_follow', false )
1170
- ) {
 
1171
  add_filter( 'the_content', 'synved_social_wp_the_content', 10, 2 );
1172
  }
1173
 
849
  }
850
 
851
  if ( false === empty( $id ) ) {
852
+ $automatic_share_single = boolval( synved_option_get( 'synved_social', 'automatic_share_single', false ) );
853
+
854
  $exclude = 'yes' === get_post_meta( $id, 'synved_social_exclude', true );
855
  $exclude_share = 'yes' === get_post_meta( $id, 'synved_social_exclude_share', true );
856
  $exclude_follow = 'yes' === get_post_meta( $id, 'synved_social_exclude_follow', true );
857
 
858
+ if ( false === $exclude_share && false !== $automatic_share_single ) {
 
 
859
  $exclude_share = false === (
860
  true === is_singular( synved_option_get( 'synved_social', 'automatic_share_post_types' ) )
861
  && (
865
  }
866
 
867
  if ( false === $exclude_follow &&
868
+ false !== boolval( synved_option_get( 'synved_social', 'automatic_follow_single', false ) )
869
  ) {
870
  $exclude_follow = false === (
871
  true === is_singular( synved_option_get( 'synved_social', 'automatic_follow_post_types' ) )
878
 
879
  if ( false === $exclude ) {
880
  if ( false === $exclude_share
881
+ && false !== boolval( synved_option_get( 'synved_social', 'automatic_share', false ) )
882
  ) {
883
  $post_type = get_post_type();
884
  $type_list = synved_option_get( 'synved_social', 'automatic_share_post_types' );
926
  $separator_before = $separator;
927
  }
928
 
929
+ $synved_social_settings = get_option( 'synved_social_settings' );
930
+
931
+ $automatic_follow = boolval( $synved_social_settings['automatic_follow'] );
932
+
933
+ if ( false === $exclude_follow && false !== $automatic_follow ) {
934
  $post_type = get_post_type();
935
  $type_list = synved_option_get( 'synved_social', 'automatic_follow_post_types', array() );
936
 
1167
  add_shortcode( 'synved_feather_follow', 'synved_social_follow_shortcode' );
1168
  }
1169
 
1170
+ $automatic_share = boolval( synved_option_get( 'synved_social', 'automatic_share', false ) );
1171
+ $automatic_follow = boolval( synved_option_get( 'synved_social', 'automatic_follow', false ) );
1172
+
1173
+ if ( false !== $automatic_share || false !== $automatic_follow ) {
1174
  add_filter( 'the_content', 'synved_social_wp_the_content', 10, 2 );
1175
  }
1176