Simple Share Buttons Adder - Version 7.3.7

Version Description

Download this release

Release Info

Developer DavidoffNeal
Plugin Icon 128x128 Simple Share Buttons Adder
Version 7.3.7
Comparing to
See all releases

Code changes from version 7.3.6 to 7.3.7

instance.php CHANGED
@@ -9,7 +9,7 @@ namespace SimpleShareButtonsAdder;
9
 
10
  define( 'SSBA_FILE', __FILE__ );
11
  define( 'SSBA_ROOT', dirname( __FILE__ ) );
12
- define( 'SSBA_VERSION', '7.3.6' );
13
 
14
  global $simple_share_buttons_adder_plugin;
15
 
9
 
10
  define( 'SSBA_FILE', __FILE__ );
11
  define( 'SSBA_ROOT', dirname( __FILE__ ) );
12
+ define( 'SSBA_VERSION', '7.3.7' );
13
 
14
  global $simple_share_buttons_adder_plugin;
15
 
php/class-admin-bits.php CHANGED
@@ -378,6 +378,10 @@ class Admin_Bits {
378
  'ssba_custom_whatsapp' => $ssba_post['ssba_custom_whatsapp'],
379
  'ssba_custom_xing' => $ssba_post['ssba_custom_xing'],
380
  'ssba_custom_yummly' => $ssba_post['ssba_custom_yummly'],
 
 
 
 
381
 
382
  // Shared count.
383
  'sharedcount_enabled' => $ssba_post['sharedcount_enabled'],
378
  'ssba_custom_whatsapp' => $ssba_post['ssba_custom_whatsapp'],
379
  'ssba_custom_xing' => $ssba_post['ssba_custom_xing'],
380
  'ssba_custom_yummly' => $ssba_post['ssba_custom_yummly'],
381
+ 'ssba_custom_email' => $ssba_post['ssba_custom_email'],
382
+ 'ssba_custom_buffer' => $ssba_post['ssba_custom_buffer'],
383
+ 'ssba_custom_diggit' => $ssba_post['ssba_custom_diggit'],
384
+ 'ssba_custom_facebook_save' => $ssba_post['ssba_custom_facebook_save'],
385
 
386
  // Shared count.
387
  'sharedcount_enabled' => $ssba_post['sharedcount_enabled'],
php/class-admin-panel.php CHANGED
@@ -96,19 +96,19 @@ class Admin_Panel {
96
  $locs2 = array(
97
  'Homepage' => array(
98
  'value' => 'ssba_bar_homepage',
99
- 'checked' => 'Y' === $arr_settings['ssba_bar_homepage'] ? true : false,
100
  ),
101
  'Pages' => array(
102
  'value' => 'ssba_bar_pages',
103
- 'checked' => 'Y' === $arr_settings['ssba_bar_pages'] ? true : false,
104
  ),
105
  'Posts' => array(
106
  'value' => 'ssba_bar_posts',
107
- 'checked' => 'Y' === $arr_settings['ssba_bar_posts'] ? true : false,
108
  ),
109
  'Categories/Archives' => array(
110
  'value' => 'ssba_bar_cats_archs',
111
- 'checked' => 'Y' === $arr_settings['ssba_bar_cats_archs'] ? true : false,
112
  ),
113
  );
114
 
96
  $locs2 = array(
97
  'Homepage' => array(
98
  'value' => 'ssba_bar_homepage',
99
+ 'checked' => isset( $arr_settings['ssba_bar_homepage'] ) && 'Y' === $arr_settings['ssba_bar_homepage'] ? true : false,
100
  ),
101
  'Pages' => array(
102
  'value' => 'ssba_bar_pages',
103
+ 'checked' => isset( $arr_settings['ssba_bar_pages'] ) && 'Y' === $arr_settings['ssba_bar_pages'] ? true : false,
104
  ),
105
  'Posts' => array(
106
  'value' => 'ssba_bar_posts',
107
+ 'checked' => isset( $arr_settings['ssba_bar_posts'] ) && 'Y' === $arr_settings['ssba_bar_posts'] ? true : false,
108
  ),
109
  'Categories/Archives' => array(
110
  'value' => 'ssba_bar_cats_archs',
111
+ 'checked' => isset( $arr_settings['ssba_bar_cats_archs'] ) && 'Y' === $arr_settings['ssba_bar_cats_archs'] ? true : false,
112
  ),
113
  );
114
 
php/class-buttons.php CHANGED
@@ -265,6 +265,23 @@ class Buttons {
265
  return $html_share_buttons;
266
  }
267
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
268
  /**
269
  * Shortcode for hiding buttons
270
  *
@@ -872,7 +889,7 @@ class Buttons {
872
  $arr_linkedin_share_details = json_decode( $html_linkedin_share_details['body'], true );
873
  $int_linkedin_share_count = $arr_linkedin_share_details['count'];
874
 
875
- return $int_linkedin_share_count ? ssba_format_number( $int_linkedin_share_count ) : '0';
876
  }
877
 
878
  /**
265
  return $html_share_buttons;
266
  }
267
 
268
+ /**
269
+ * Shortcode for adding buttons.
270
+ *
271
+ * @param array $atts The current shortcodes attributes.
272
+ *
273
+ * @shortcode ssba
274
+ *
275
+ * @return string
276
+ */
277
+ public function ssba_orig_buttons( $atts ) {
278
+ // Get buttons - NULL for $content, TRUE for shortcode flag.
279
+ $html_share_buttons = $this->show_share_buttons( null, true, $atts );
280
+
281
+ // Return buttons.
282
+ return $html_share_buttons;
283
+ }
284
+
285
  /**
286
  * Shortcode for hiding buttons
287
  *
889
  $arr_linkedin_share_details = json_decode( $html_linkedin_share_details['body'], true );
890
  $int_linkedin_share_count = $arr_linkedin_share_details['count'];
891
 
892
+ return $int_linkedin_share_count ? $this->ssba_format_number( $int_linkedin_share_count ) : '0';
893
  }
894
 
895
  /**
php/class-database.php CHANGED
@@ -181,6 +181,7 @@ class Database {
181
  'ssba_custom_print' => '',
182
  'ssba_custom_vk' => '',
183
  'ssba_custom_yummly' => '',
 
184
 
185
  // Sharedcount.
186
  'sharedcount_enabled' => '',
181
  'ssba_custom_print' => '',
182
  'ssba_custom_vk' => '',
183
  'ssba_custom_yummly' => '',
184
+ 'ssba_custom_facebook_save' => '',
185
 
186
  // Sharedcount.
187
  'sharedcount_enabled' => '',
php/class-plugin-base.php CHANGED
@@ -142,32 +142,13 @@ abstract class Plugin_Base {
142
  * Version of plugin_dir_url() which works for plugins installed in the plugins directory,
143
  * and for plugins bundled with themes.
144
  *
145
- * @throws \Exception If the plugin is not located in the expected location.
146
  * @return array
147
  */
148
  public function locate_plugin() {
149
- $file_name = $this->get_object_reflection()->getFileName();
150
-
151
- if ( '/' !== \DIRECTORY_SEPARATOR ) {
152
- $file_name = str_replace( \DIRECTORY_SEPARATOR, '/', $file_name ); // Windows compat.
153
- }
154
-
155
- $plugin_dir = preg_replace( '#(.*plugins[^/]*/[^/]+)(/.*)?#', '$1', $file_name, 1, $count );
156
-
157
- if ( 0 === $count ) {
158
- throw new \Exception( "Class not located within a directory tree containing 'plugins': $file_name" );
159
- }
160
-
161
- // Make sure that we can reliably get the relative path inside of the content directory.
162
- $plugin_path = $this->relative_path( $plugin_dir, 'wp-content', \DIRECTORY_SEPARATOR );
163
-
164
- if ( '' === $plugin_path ) {
165
- throw new \Exception( 'Plugin dir is not inside of the `wp-content` directory' );
166
- }
167
-
168
- $dir_url = content_url( trailingslashit( $plugin_path ) );
169
- $dir_path = $plugin_dir;
170
- $dir_basename = basename( $plugin_dir );
171
 
172
  return compact( 'dir_url', 'dir_path', 'dir_basename' );
173
  }
142
  * Version of plugin_dir_url() which works for plugins installed in the plugins directory,
143
  * and for plugins bundled with themes.
144
  *
 
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' );
154
  }
readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: sharethis, scottstorebloom, surlyrightclick, DavidoffNeal
3
  Tags: share buttons, social buttons, facebook, twitter, google+, share, share links, stumble upon, linkedin, pinterest, yummly, vk
4
  Requires at least: 4.5
5
  Tested up to: 4.8.2
6
- Stable tag: 7.3.6
7
  License: GPLv2 or later
8
 
9
  A simple plugin that enables you to add share buttons to all of your posts and/or pages.
@@ -22,30 +22,32 @@ By downloading and installing this plugin you are agreeing to the <a href="https
22
 
23
  == Installation ==
24
 
25
- Automatic
26
- - Click the ‘Plugins’ tab in WordPress admin view
27
- - Click the ‘Add New’ button
28
- - Search for ‘Simple Share’
29
- - Click ‘Install Now’
30
- - Activate the plugin
31
- - Navigate to ‘Installed Plugins’
32
- - Click ‘Settings’
33
- - Toggle On/Off Location Placement
34
- - Click the blue save icon
35
- FTP
36
- - Upload Simple Share Adder to the `/wp-content/plugins/` directory
37
- - Activate the plugin
38
- - Navigate to ‘Installed Plugins’
39
- - ClickSettings
40
- - Toggle On/Off Location Placement
41
- - Click the blue save icon
42
- Upload
43
- - Upload the downloaded zip file on the ‘Add New’ plugins screen (see the ‘Upload’ tab) in your WordPress admin view
44
- - Activate the plugin
45
- - Navigate toInstalled Plugins
46
- - Click ‘Settings’
47
- - Toggle On/Off Location Placement
48
- - Click the blue save icon
 
 
49
 
50
  == Frequently Asked Questions ==
51
 
3
  Tags: share buttons, social buttons, facebook, twitter, google+, share, share links, stumble upon, linkedin, pinterest, yummly, vk
4
  Requires at least: 4.5
5
  Tested up to: 4.8.2
6
+ Stable tag: 7.3.7
7
  License: GPLv2 or later
8
 
9
  A simple plugin that enables you to add share buttons to all of your posts and/or pages.
22
 
23
  == Installation ==
24
 
25
+ = Automatic =
26
+ * Click the ‘Plugins’ tab in WordPress admin view
27
+ * Click the ‘Add New’ button
28
+ * Search for ‘Simple Share’
29
+ * Click ‘Install Now’
30
+ * Activate the plugin
31
+ * Navigate to ‘Installed Plugins’
32
+ * Click ‘Settings’
33
+ * Toggle On/Off Location Placement
34
+ * Click the blue save icon
35
+
36
+ = FTP =
37
+ * Upload Simple Share Adder to the `/wp-content/plugins/` directory
38
+ * Activate the plugin
39
+ * Navigate to Installed Plugins
40
+ * Click ‘Settings’
41
+ * Toggle On/Off Location Placement
42
+ * Click the blue save icon
43
+
44
+ = Upload =
45
+ * Upload the downloaded zip file on the Add New plugins screen (see the ‘Upload’ tab) in your WordPress admin view
46
+ * Activate the plugin
47
+ * Navigate to ‘Installed Plugins’
48
+ * Click ‘Settings’
49
+ * Toggle On/Off Location Placement
50
+ * Click the blue save icon
51
 
52
  == Frequently Asked Questions ==
53
 
simple-share-buttons-adder.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Simple Share Buttons Adder
4
  * Plugin URI: https://simplesharebuttons.com
5
  * Description: A simple plugin that enables you to add share buttons to all of your posts and/or pages.
6
- * Version: 7.3.6
7
  * Author: Simple Share Buttons
8
  * Author URI: https://simplesharebuttons.com
9
  * License: GPLv2
3
  * Plugin Name: Simple Share Buttons Adder
4
  * Plugin URI: https://simplesharebuttons.com
5
  * Description: A simple plugin that enables you to add share buttons to all of your posts and/or pages.
6
+ * Version: 7.3.7
7
  * Author: Simple Share Buttons
8
  * Author URI: https://simplesharebuttons.com
9
  * License: GPLv2
templates/classic-tab.php CHANGED
@@ -75,7 +75,7 @@
75
  if ( 'custom' !== $arr_settings['ssba_image_set'] ) {
76
  $img_src = esc_attr( $this->plugin->dir_url ) . 'buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/' . esc_attr( $button ) . '.png';
77
  } else {
78
- $img_src = $custom_buttons[ $button ];
79
  } ?>
80
  <li class="ssbp-li--<?php echo esc_attr( $button );
81
  if ( ! in_array( $button, explode( ',', $arr_settings['ssba_selected_buttons'] ), true ) ) {
75
  if ( 'custom' !== $arr_settings['ssba_image_set'] ) {
76
  $img_src = esc_attr( $this->plugin->dir_url ) . 'buttons/' . esc_attr( $arr_settings['ssba_image_set'] ) . '/' . esc_attr( $button ) . '.png';
77
  } else {
78
+ $img_src = isset( $custom_buttons[ $button ] ) ? $custom_buttons[ $button ] : '';
79
  } ?>
80
  <li class="ssbp-li--<?php echo esc_attr( $button );
81
  if ( ! in_array( $button, explode( ',', $arr_settings['ssba_selected_buttons'] ), true ) ) {