Social Media Follow Buttons Bar - Version 4.61

Version Description

  • Oct 3, 2020 =
  • New feature: Restoring screen position after saving changes. No more annoying return to the top of the page after clicking the "Save" button.
  • Maintenance: Loading of dynamic content on the settings page has been updated to more versatile.
Download this release

Release Info

Developer Arthur Gareginyan
Plugin Icon 128x128 Social Media Follow Buttons Bar
Version 4.61
Comparing to
See all releases

Code changes from version 4.60 to 4.61

inc/js/admin.js CHANGED
@@ -19,8 +19,8 @@ jQuery(document).ready(function($) {
19
  }, 3000);
20
  }
21
 
22
- // Add dynamic content to page tabs. Needed for having an up to date content.
23
- $('.include-tab-store').load('https://www.spacexchimp.com/assets/dynamic-content/plugins.html #include-tab-store');
24
 
25
  // Add questions and answers into spoilers and color them in different colors
26
  $('.panel-group .panel').each(function(i) {
19
  }, 3000);
20
  }
21
 
22
+ // Add a dynamic content to the plugin settings page. Needed for having an up to date banners
23
+ $('.include-tab-store').load('https://resources.spacexchimp.com/wordpress/plugins/dynamic-content/page.html');
24
 
25
  // Add questions and answers into spoilers and color them in different colors
26
  $('.panel-group .panel').each(function(i) {
inc/php/controls.php CHANGED
@@ -284,6 +284,27 @@ function spacexchimp_p005_control_checkbox( $name, $items, $label, $help ) {
284
  spacexchimp_p005_control_help( $help );
285
  }
286
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
287
  /**
288
  * Generator of the separator between option groups
289
  */
284
  spacexchimp_p005_control_help( $help );
285
  }
286
 
287
+ /**
288
+ * Generator of the hidden option for saving plugin settings to database
289
+ */
290
+ function spacexchimp_p005_control_hidden( $name, $value ) {
291
+
292
+ // Put value of plugin constants into an array for easier access
293
+ $plugin = spacexchimp_p005_plugin();
294
+
295
+ // Generate a part of table
296
+ $out = "<input
297
+ type='hidden'
298
+ name='" . $plugin['settings'] . "_settings[$name]'
299
+ id='" . $plugin['settings'] . "_settings[$name]'
300
+ value='$value'
301
+ class='control-hidden $name'
302
+ >";
303
+
304
+ // Print the generated part of table
305
+ echo $out;
306
+ }
307
+
308
  /**
309
  * Generator of the separator between option groups
310
  */
inc/php/inline-js.php ADDED
@@ -0,0 +1,38 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+
3
+ /**
4
+ * Prevent Direct Access
5
+ */
6
+ defined( 'ABSPATH' ) or die( "Restricted access!" );
7
+
8
+ // Retrieve options from database and declare variables
9
+ $options = get_option( $plugin['settings'] . '_settings' );
10
+
11
+ // Make the "$options" array if the plugin options data in the database is not exist
12
+ if ( ! is_array( $options ) ) {
13
+ $options = array();
14
+ }
15
+
16
+ $hidden_scrollto = !empty( $options['hidden_scrollto'] ) ? $options['hidden_scrollto'] : '0';
17
+
18
+ ?>
19
+ <script type="text/javascript">
20
+ jQuery(document).ready(function($) {
21
+
22
+ // Scroll to previouse position
23
+ var hidden_scrollto = <?php echo $hidden_scrollto; ?>;
24
+ $(document).scrollTop(hidden_scrollto);
25
+
26
+ // Update the value of the scroll position option
27
+ $(window).scroll(function() {
28
+ $('input:hidden.control-hidden.hidden_scrollto').val($(document).scrollTop());
29
+ });
30
+ });
31
+ </script>
32
+ <?php
33
+
34
+ // Update the plugin options data in the database
35
+ if ( $hidden_scrollto != '0' ) {
36
+ $options['hidden_scrollto'] = '0';
37
+ update_option( $plugin['settings'] . '_settings', $options );
38
+ }
inc/php/messages.php CHANGED
@@ -126,5 +126,13 @@ function spacexchimp_p005_message_save() {
126
  <?php _e( 'Settings saved successfully.', $plugin['text'] ); ?>
127
  </p>
128
  </div>
 
 
 
 
 
 
 
 
129
  <?php
130
  }
126
  <?php _e( 'Settings saved successfully.', $plugin['text'] ); ?>
127
  </p>
128
  </div>
129
+ <style>
130
+ #message.updated {
131
+ z-index: 9999;
132
+ position: fixed;
133
+ top: 40px;
134
+ right: 40px;
135
+ }
136
+ </style>
137
  <?php
138
  }
inc/php/page.php CHANGED
@@ -55,6 +55,9 @@ function spacexchimp_p005_render_submenu_page() {
55
  <?php require_once( $plugin['path'] . 'inc/php/sidebar.php' ); ?>
56
 
57
  <?php require_once( $plugin['path'] . 'inc/php/tabs/settings.php' ); ?>
 
 
 
58
  </div>
59
  <!-- END-TAB SETTINGS -->
60
 
55
  <?php require_once( $plugin['path'] . 'inc/php/sidebar.php' ); ?>
56
 
57
  <?php require_once( $plugin['path'] . 'inc/php/tabs/settings.php' ); ?>
58
+
59
+ <!-- INCLUDE PHP-JS FILE -->
60
+ <?php require_once( $plugin['path'] . 'inc/php/inline-js.php' ); ?>
61
  </div>
62
  <!-- END-TAB SETTINGS -->
63
 
inc/php/tabs/settings.php CHANGED
@@ -146,6 +146,14 @@ defined( 'ABSPATH' ) or die( "Restricted access!" );
146
  </div>
147
  </div>
148
 
 
 
 
 
 
 
 
 
149
  <!-- SUBMIT -->
150
  <input type="submit" name="submit" id="submit" class="btn btn-default btn-lg button-save-main" value="<?php _e( 'Save changes', $plugin['text'] ); ?>">
151
  <!-- END SUBMIT -->
146
  </div>
147
  </div>
148
 
149
+ <!-- HIDDEN -->
150
+ <?php
151
+ spacexchimp_p005_control_hidden( 'hidden_scrollto',
152
+ '0'
153
+ );
154
+ ?>
155
+ <!-- END HIDDEN -->
156
+
157
  <!-- SUBMIT -->
158
  <input type="submit" name="submit" id="submit" class="btn btn-default btn-lg button-save-main" value="<?php _e( 'Save changes', $plugin['text'] ); ?>">
159
  <!-- END SUBMIT -->
readme.txt CHANGED
@@ -5,7 +5,7 @@ Donate link: https://www.spacexchimp.com/donate.html
5
  Requires at least: 4.9
6
  Tested up to: 5.5
7
  Requires PHP: 5.6
8
- Stable tag: 4.60
9
  License: GPL3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
@@ -314,6 +314,10 @@ Commercial licensing (e.g. for projects that can’t use an open-source license)
314
 
315
  == Changelog ==
316
 
 
 
 
 
317
  = 4.60 - Aug 10, 2020 =
318
  * Maintenance: Ensure compatibility with upcoming WordPress 5.5.
319
  * Enhancement: Remove the second ask for an upgrade on the "Plugins" page and change the color of some links to the right emotional colors. (Thanks to Abdulla Hussain)
5
  Requires at least: 4.9
6
  Tested up to: 5.5
7
  Requires PHP: 5.6
8
+ Stable tag: 4.61
9
  License: GPL3
10
  License URI: http://www.gnu.org/licenses/gpl-3.0.html
11
 
314
 
315
  == Changelog ==
316
 
317
+ = 4.61 - Oct 3, 2020 =
318
+ * New feature: Restoring screen position after saving changes. No more annoying return to the top of the page after clicking the "Save" button.
319
+ * Maintenance: Loading of dynamic content on the settings page has been updated to more versatile.
320
+
321
  = 4.60 - Aug 10, 2020 =
322
  * Maintenance: Ensure compatibility with upcoming WordPress 5.5.
323
  * Enhancement: Remove the second ask for an upgrade on the "Plugins" page and change the color of some links to the right emotional colors. (Thanks to Abdulla Hussain)
social-media-buttons-toolbar.php CHANGED
@@ -5,7 +5,7 @@
5
  * Description: Easily and safely add a smart bar with social media follow buttons (not share, only link to your profiles) to any place (post content, page content, widget, sidebar, header, footer) of your WordPress website.
6
  * Author: Space X-Chimp
7
  * Author URI: https://www.spacexchimp.com
8
- * Version: 4.60
9
  * License: GPL3
10
  * Text Domain: social-media-buttons-toolbar
11
  * Domain Path: /languages/
5
  * Description: Easily and safely add a smart bar with social media follow buttons (not share, only link to your profiles) to any place (post content, page content, widget, sidebar, header, footer) of your WordPress website.
6
  * Author: Space X-Chimp
7
  * Author URI: https://www.spacexchimp.com
8
+ * Version: 4.61
9
  * License: GPL3
10
  * Text Domain: social-media-buttons-toolbar
11
  * Domain Path: /languages/