Simple Social Media Share Buttons – Social Sharing for Everyone - Version 1.9.0

Version Description

  • New Feature Release. Please upgrade immediately and provide your feedback. highly recommended.

=

Download this release

Release Info

Developer hiddenpearls
Plugin Icon 128x128 Simple Social Media Share Buttons – Social Sharing for Everyone
Version 1.9.0
Comparing to
See all releases

Code changes from version 1.8.2 to 1.9.0

assets/images/fblike.jpg ADDED
Binary file
assets/images/fbshare.jpg ADDED
Binary file
assets/images/googleplus.jpg ADDED
Binary file
assets/images/linkedin.jpg ADDED
Binary file
assets/images/pinterest.jpg ADDED
Binary file
assets/images/ssb_icon.png ADDED
Binary file
assets/images/twitter.jpg ADDED
Binary file
assets/js/admin.js ADDED
@@ -0,0 +1,28 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // IIFE - Immediately Invoked Function Expression
2
+ (function($, window, document) {
3
+
4
+
5
+ // Listen for the jQuery ready event on the document
6
+ $(function() {
7
+
8
+ // The DOM is ready!
9
+ $("#ssb_active_icons").sortable({
10
+ connectWith: "#ssb_inactive_icons",
11
+ cursor: 'move',
12
+ update: function(event, ui) {
13
+ var order = $("#ssb_active_icons").sortable("toArray", {attribute: 'data-id' } );
14
+ $('#ssb_icons_order').val( order.join(','));
15
+ },
16
+ });
17
+
18
+ $("#ssb_inactive_icons").sortable({
19
+ connectWith: "#ssb_active_icons",
20
+ cursor: 'move'
21
+ });
22
+
23
+
24
+ });
25
+
26
+ // The rest of the code goes here!
27
+
28
+ }(window.jQuery, window, document));
readme.txt CHANGED
@@ -1,14 +1,14 @@
1
  === Simple Social Buttons ===
2
  Contributors: WPBrigade, hiddenpearls
3
  Donate link: https://wpbrigade.com/
4
- Tags: facebook, google, twitter, pinterest, plus one, like it, like, share, pin, pin it
5
  Requires at least: 2.8
6
  Tested up to: 4.8
7
- Stable tag: 1.8.2
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
- Insert and customize social buttons: Facebook Like it, Google plus +1, Twitter share, Pinterest Pin it. Share your content with friends.
12
 
13
  == Description ==
14
 
@@ -111,12 +111,19 @@ Big thanks to:
111
 
112
  == Upgrade Notice ==
113
 
114
- = 1.8.2 =
115
- * Important release, Please upgrade immediately. BugFix: Horizontal issue.
116
 
117
 
118
  == Changelog ==
119
 
 
 
 
 
 
 
 
120
  = 1.8.2 =
121
  * BugFix: share button position issue with 2016 theme.
122
  * Enhancement: move menu out from settings.
1
  === Simple Social Buttons ===
2
  Contributors: WPBrigade, hiddenpearls
3
  Donate link: https://wpbrigade.com/
4
+ Tags: facebook, google, twitter, pinterest, plus one, like it, like, share, pin, linkedin, Social share, Social buttons
5
  Requires at least: 2.8
6
  Tested up to: 4.8
7
+ Stable tag: 1.9.0
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
11
+ Insert and customize social buttons: Facebook Like it, Share, LinkedIn, Google plus +1, Twitter share, Pinterest Pin it. Share your content with friends.
12
 
13
  == Description ==
14
 
111
 
112
  == Upgrade Notice ==
113
 
114
+ = 1.9.0 =
115
+ * New Feature Release. Please upgrade immediately and provide your feedback. highly recommended.
116
 
117
 
118
  == Changelog ==
119
 
120
+ = 1.9.0 =
121
+ * Enhancement: Social Share Buttons Drag and Drop Feature.
122
+ * Enhancement: Introducing New Social Buttons: Facebook Share, LinkedIn.
123
+ * Enhancement: Responsive Social Share Buttons styling.
124
+ * Enhancement: Move Menu out from Settings.
125
+ * BugFix: CodeCleanup and Improvement.
126
+
127
  = 1.8.2 =
128
  * BugFix: share button position issue with 2016 theme.
129
  * Enhancement: move menu out from settings.
simple-social-buttons.php CHANGED
@@ -1,13 +1,14 @@
1
  <?php
2
- /*
3
- *
4
- * Plugin Name: Simple Social Buttons
5
- * Plugin URI: http://www.WPBrigade.com/wordpress/plugins/simple-social-buttons/
6
- * Description: Insert social buttons into posts and archives: Facebook "Like it", Google Plus One "+1", Twitter share and Pinterest.
7
- * Version: 1.8.2
8
- * Author: WPBrigade
9
- * Author URI: http://adnan.pk/
10
- */
 
11
 
12
  /* Copyright 2011, Muhammad Adnan (WPBrigade) (email : captain@wpbrigade.com)
13
 
@@ -36,7 +37,7 @@
36
 
37
  class SimpleSocialButtonsPR {
38
  var $pluginName = 'Simple Social Buttons';
39
- var $pluginVersion = '1.8.2';
40
  var $pluginPrefix = 'ssb_pr_';
41
  var $hideCustomMetaKey = '_ssb_hide';
42
 
@@ -51,11 +52,13 @@ class SimpleSocialButtonsPR {
51
  'beforepage' => '1',
52
  'afterpage' => '0',
53
  'beforearchive' => '0',
54
- 'afterarchive' => '0'
 
 
55
  );
56
 
57
  // defined buttons
58
- var $arrKnownButtons = array('fblike', 'googleplus', 'twitter', 'pinterest');
59
 
60
  // an array to store current settings, to avoid passing them between functions
61
  var $settings = array();
@@ -94,6 +97,8 @@ class SimpleSocialButtonsPR {
94
  */
95
  add_filter( 'the_content', array(&$this, 'insert_buttons') );
96
  add_filter( 'the_excerpt', array(&$this, 'insert_buttons') );
 
 
97
  }
98
 
99
  function plugin_init() {
@@ -152,7 +157,7 @@ window.___gcfg = {lang: '<?php echo $lang_g; ?>'};
152
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
153
  })();
154
  <?php endif;?>
155
- <?php if ((int)$this->settings['fblike'] != 0):?>
156
  // facebook
157
  (function(d, s, id) {
158
  var js, fjs = d.getElementsByTagName(s)[0];
@@ -171,6 +176,10 @@ window.___gcfg = {lang: '<?php echo $lang_g; ?>'};
171
  <?php if ((int)$this->settings['pinterest'] != 0):?>
172
  <script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
173
  <?php endif;?>
 
 
 
 
174
  <!-- /End of Simple Social Buttons -->
175
 
176
  <?php
@@ -183,16 +192,17 @@ window.___gcfg = {lang: '<?php echo $lang_g; ?>'};
183
 
184
  <!-- Simple Social Buttons style sheet -->
185
  <style type="text/css">
186
- div.simplesocialbuttons { height: 20px; margin: 10px auto 10px 0; text-align: left; clear: left; }
187
  div.simplesocialbutton { float: left; }
188
  div.ssb-button-googleplus { width: 100px; }
189
  div.ssb-button-fblike { width: 140px; line-height: 1; }
 
190
  div.ssb-button-twitter { width: 130px; }
191
  div.ssb-button-pinterest { width: 100px; }
192
  .fb-like iframe { max-width: none !important; }
193
- .simplesocialbuttons .simplesocialbutton { display: inline-block; vertical-align: top; width: auto; }
194
  .simplesocialbuttons .simplesocialbutton iframe { margin: 0; vertical-align: inherit; }
195
- .simplesocialbuttons .simplesocialbutton + .simplesocialbutton { margin-left: 20px; }
196
  </style>
197
  <!-- End of Simple Social Buttons -->
198
 
@@ -321,6 +331,27 @@ window.___gcfg = {lang: '<?php echo $lang_g; ?>'};
321
  return $return;
322
  }
323
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
324
  /**
325
  * Insert the buttons to the content
326
  */
@@ -333,7 +364,9 @@ window.___gcfg = {lang: '<?php echo $lang_g; ?>'};
333
  // creating order
334
  $order = array();
335
  foreach ($this->arrKnownButtons as $button_name) {
336
- $order[$button_name] = $this->settings[$button_name];
 
 
337
  }
338
  $ssb_buttonscode = $this->generate_buttons_code($order);
339
 
@@ -413,9 +446,15 @@ window.___gcfg = {lang: '<?php echo $lang_g; ?>'};
413
  case 'fblike':
414
  $arrButtonsCode[] = '<div class="simplesocialbutton ssb-button-fblike"><!-- Facebook like--><div id="fb-root"></div><div class="fb-like" data-href="'.$permalink.'" data-send="false" data-layout="button_count" data-show-faces="false"></div></div>';
415
  break;
 
 
 
416
  case 'twitter':
417
  $arrButtonsCode[] = '<div class="simplesocialbutton ssb-button-twitter"><!-- Twitter--><a href="https://twitter.com/share" class="twitter-share-button" data-text="'.$title.'" data-url="'.$permalink.'" ' . ((!empty($this->settings['twitterusername'])) ? 'data-via="'.$this->settings['twitterusername'].'" ' : '') . 'rel="nofollow"></a></div>';
418
  break;
 
 
 
419
  case 'pinterest':
420
  global $post;
421
  $thumb_id = get_post_thumbnail_id($post->ID);
@@ -464,11 +503,11 @@ class SimpleSocialButtonsPR_Admin extends SimpleSocialButtonsPR {
464
 
465
  add_filter('plugin_action_links', array(&$this, 'plugin_action_links'), 10, 2 );
466
 
467
- add_action( 'wp_ajax_ssb_subscriber', array( $this, 'ssb_subscriber' ) );
468
-
469
  add_action( 'admin_footer', array( $this, 'add_deactive_modal' ) );
470
  add_action( 'wp_ajax_ssb_deactivate', array( $this, 'ssb_deactivate' ) );
471
  add_action( 'admin_init', array( $this, 'review_notice' ) );
 
 
472
 
473
  }
474
 
@@ -500,6 +539,14 @@ class SimpleSocialButtonsPR_Admin extends SimpleSocialButtonsPR {
500
  return $links;
501
  }
502
 
 
 
 
 
 
 
 
 
503
  /**
504
  * Register meta box to hide/show SSB plugin on single post or page
505
  */
@@ -567,75 +614,11 @@ class SimpleSocialButtonsPR_Admin extends SimpleSocialButtonsPR {
567
  update_post_meta($postId, $this->hideCustomMetaKey, $newValue);
568
  }
569
 
570
- function ssb_subscriber() {
571
-
572
- $email = sanitize_email( wp_unslash( $_POST['subscriber_mail'] ) );
573
- $display_name = sanitize_text_field( wp_unslash( $_POST['name'] ) );
574
-
575
-
576
- $data = array(
577
- 'email_address' => $email,
578
- "status_if_new" => "pending",
579
- // 'status' => 'pending', // "subscribed","unsubscribed","cleaned","pending"
580
- 'merge_fields' => array(
581
- 'FNAME' => $display_name
582
- ),
583
- 'interests' => array(
584
- '7aec774503' => true, // add interest ? loginPress => d91a783713 || Related Posts Thumbnails => 1c85722a4b || Newsletter Subscribers => 3eefb18f62
585
- )
586
- );
587
-
588
-
589
- $apiKey = '7f32f907a2e6ceeaf8a97fc00b962b2b-us15';
590
- $listId = '30d28e0fc3';
591
-
592
- $memberId = md5( strtolower( $data['email_address'] ) );
593
- $dataCenter = substr( $apiKey , strpos( $apiKey,'-' ) + 1 );
594
-
595
-
596
- $url = 'https://' . $dataCenter . '.api.mailchimp.com/3.0/lists/' . $listId .'/members/' . $memberId;
597
-
598
- // 2d13665c08ff83f22de7cc7da216db12
599
- $json = json_encode( $data );
600
-
601
- $ch = curl_init( $url );
602
-
603
- curl_setopt( $ch, CURLOPT_USERPWD, 'user:' . $apiKey );
604
- curl_setopt( $ch, CURLOPT_HTTPHEADER, array( 'Content-Type: application/json' ) );
605
- curl_setopt( $ch, CURLOPT_RETURNTRANSFER, true );
606
- curl_setopt( $ch, CURLOPT_TIMEOUT, 10 );
607
- curl_setopt( $ch, CURLOPT_CUSTOMREQUEST, 'PUT' );
608
- curl_setopt( $ch, CURLOPT_POST, true );
609
- curl_setopt( $ch, CURLOPT_SSL_VERIFYPEER, false );
610
- curl_setopt( $ch, CURLOPT_POSTFIELDS, $json );
611
-
612
- curl_setopt( $ch, CURLOPT_USERAGENT, 'Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.0.3705; .NET CLR 1.1.4322)' );
613
-
614
- $result = curl_exec( $ch );
615
-
616
- if( $request_type == 'GET' ){
617
- $result_array = json_decode ( $result , true );
618
- $status = $result_array['status'];
619
- return $status;
620
- }
621
- // var_dump($result);
622
- // var_dump( curl_getinfo( $ch ) );
623
-
624
- $httpCode = curl_getinfo( $ch, CURLINFO_HTTP_CODE );
625
-
626
- curl_close( $ch );
627
- if ( 200 == $httpCode ) {
628
- echo "Thank you!";
629
- } else {
630
- echo "oops! Please try again later.";
631
- }
632
- wp_die();
633
- }
634
 
635
  /**
636
  * Show the popup on pluing deactivate
637
  *
638
- * @since 1.8.2
639
  */
640
  function add_deactive_modal() {
641
  global $pagenow;
@@ -650,7 +633,7 @@ class SimpleSocialButtonsPR_Admin extends SimpleSocialButtonsPR {
650
  /**
651
  * Send the user responce to api.
652
  *
653
- * @since 1.8.2
654
  */
655
  function ssb_deactivate() {
656
  $email = get_option( 'admin_email' );
@@ -700,7 +683,7 @@ class SimpleSocialButtonsPR_Admin extends SimpleSocialButtonsPR {
700
  /**
701
  * Check either to show notice or not.
702
  *
703
- * @since 1.8.2
704
  */
705
  public function review_notice() {
706
 
@@ -729,7 +712,7 @@ class SimpleSocialButtonsPR_Admin extends SimpleSocialButtonsPR {
729
  /**
730
  * Show review Message After 15 days.
731
  *
732
- * @since 1.8.2
733
  */
734
  public function review_notice_message() {
735
 
@@ -772,7 +755,7 @@ class SimpleSocialButtonsPR_Admin extends SimpleSocialButtonsPR {
772
  /**
773
  * Set time to current so review notice will popup after 15 days
774
  *
775
- * @since 1.8.2
776
  */
777
  function review_prending() {
778
 
@@ -794,7 +777,7 @@ function review_prending() {
794
  /**
795
  * Check and Dismiss review message.
796
  *
797
- * @since 1.8.2
798
  */
799
  private function review_dismissal() {
800
 
@@ -811,6 +794,35 @@ private function review_dismissal() {
811
  add_site_option( 'ssb_review_dismiss', 'yes' );
812
  }
813
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
814
  } // end SimpleSocialButtonsPR_Admin
815
 
816
  if(is_admin() ) {
1
  <?php
2
+ /**
3
+ * Plugin Name: Simple Social Buttons
4
+ * Plugin URI: http://www.WPBrigade.com/wordpress/plugins/simple-social-buttons/
5
+ * Description: Insert social buttons into posts, pages and archives: <code>Facebook</code> "Like it", "Share", <code>Google</code> Plus One "+1", <code>Twitter</code> share, <code>LinkedIn</code> and <code>Pinterest</code>.
6
+ * Version: 1.9.0
7
+ * Author: WPBrigade
8
+ * Author URI: http://www.WPBrigade.com/
9
+ * Text Domain: simplesocialbuttons
10
+ * Domain Path: /lang
11
+ */
12
 
13
  /* Copyright 2011, Muhammad Adnan (WPBrigade) (email : captain@wpbrigade.com)
14
 
37
 
38
  class SimpleSocialButtonsPR {
39
  var $pluginName = 'Simple Social Buttons';
40
+ var $pluginVersion = '1.9.0';
41
  var $pluginPrefix = 'ssb_pr_';
42
  var $hideCustomMetaKey = '_ssb_hide';
43
 
52
  'beforepage' => '1',
53
  'afterpage' => '0',
54
  'beforearchive' => '0',
55
+ 'afterarchive' => '0',
56
+ 'fbshare' => '0',
57
+ 'linkedin' => '0'
58
  );
59
 
60
  // defined buttons
61
+ var $arrKnownButtons = array('fblike', 'googleplus', 'twitter', 'pinterest', 'fbshare', 'linkedin');
62
 
63
  // an array to store current settings, to avoid passing them between functions
64
  var $settings = array();
97
  */
98
  add_filter( 'the_content', array(&$this, 'insert_buttons') );
99
  add_filter( 'the_excerpt', array(&$this, 'insert_buttons') );
100
+
101
+ add_filter( 'plugin_row_meta', array( $this, '_row_meta'), 10, 2 );
102
  }
103
 
104
  function plugin_init() {
157
  var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(po, s);
158
  })();
159
  <?php endif;?>
160
+ <?php if ((int)$this->settings['fblike'] != 0 || (int)$this->settings['fbshare'] != 0):?>
161
  // facebook
162
  (function(d, s, id) {
163
  var js, fjs = d.getElementsByTagName(s)[0];
176
  <?php if ((int)$this->settings['pinterest'] != 0):?>
177
  <script type="text/javascript" src="//assets.pinterest.com/js/pinit.js"></script>
178
  <?php endif;?>
179
+ <!-- linkedin -->
180
+ <?php if ( isset( $this->settings['linkedin'] ) && (int)$this->settings['linkedin'] != 0): ?>
181
+ <script src="//platform.linkedin.com/in.js" type="text/javascript"> lang: en_US</script>
182
+ <?php endif; ?>
183
  <!-- /End of Simple Social Buttons -->
184
 
185
  <?php
192
 
193
  <!-- Simple Social Buttons style sheet -->
194
  <style type="text/css">
195
+ div.simplesocialbuttons { height: auto; margin: 5px auto 5px -5px; text-align: left; clear: left; }
196
  div.simplesocialbutton { float: left; }
197
  div.ssb-button-googleplus { width: 100px; }
198
  div.ssb-button-fblike { width: 140px; line-height: 1; }
199
+ div.ssb-button-fbshare { width: 140px; line-height: 1; }
200
  div.ssb-button-twitter { width: 130px; }
201
  div.ssb-button-pinterest { width: 100px; }
202
  .fb-like iframe { max-width: none !important; }
203
+ .simplesocialbuttons .simplesocialbutton { display: inline-block; vertical-align: top; width: auto;float: none; margin: 0 5px 5px;}
204
  .simplesocialbuttons .simplesocialbutton iframe { margin: 0; vertical-align: inherit; }
205
+
206
  </style>
207
  <!-- End of Simple Social Buttons -->
208
 
331
  return $return;
332
  }
333
 
334
+
335
+ /**
336
+ * Add Thumbs Up Icon
337
+ *
338
+ * @since 1.9.0
339
+ */
340
+ public function _row_meta( $links, $file ) {
341
+
342
+ if ( strpos( $file, 'simple-social-buttons.php' ) !== false ) {
343
+
344
+ // Set link for Reviews.
345
+ $new_links = array('<a href="https://wordpress.org/support/plugin/simple-social-buttons/reviews/?filter=5" target="_blank"><span class="dashicons dashicons-thumbs-up"></span> ' . __( 'Vote!', 'simplesocialbuttons' ) . '</a>',
346
+ );
347
+
348
+ $links = array_merge( $links, $new_links );
349
+ }
350
+
351
+ return $links;
352
+ }
353
+
354
+
355
  /**
356
  * Insert the buttons to the content
357
  */
364
  // creating order
365
  $order = array();
366
  foreach ($this->arrKnownButtons as $button_name) {
367
+ if ( isset( $this->settings[$button_name] ) ) {
368
+ $order[$button_name] = $this->settings[$button_name];
369
+ }
370
  }
371
  $ssb_buttonscode = $this->generate_buttons_code($order);
372
 
446
  case 'fblike':
447
  $arrButtonsCode[] = '<div class="simplesocialbutton ssb-button-fblike"><!-- Facebook like--><div id="fb-root"></div><div class="fb-like" data-href="'.$permalink.'" data-send="false" data-layout="button_count" data-show-faces="false"></div></div>';
448
  break;
449
+ case 'fbshare':
450
+ $arrButtonsCode[] = '<div class="simplesocialbutton ssb-button-fblike"><!-- Facebook Share--><div id="fb-root"></div><div class="fb-share-button" data-href="'.$permalink.'" data-send="false" data-layout="button_count" ></div></div>';
451
+ break;
452
  case 'twitter':
453
  $arrButtonsCode[] = '<div class="simplesocialbutton ssb-button-twitter"><!-- Twitter--><a href="https://twitter.com/share" class="twitter-share-button" data-text="'.$title.'" data-url="'.$permalink.'" ' . ((!empty($this->settings['twitterusername'])) ? 'data-via="'.$this->settings['twitterusername'].'" ' : '') . 'rel="nofollow"></a></div>';
454
  break;
455
+ case 'linkedin':
456
+ $arrButtonsCode[] = '<div class="simplesocialbutton ssb-button-linkdin"><!-- LinkdIn--><script type="IN/Share" data-counter="right"></script></div>';
457
+ break;
458
  case 'pinterest':
459
  global $post;
460
  $thumb_id = get_post_thumbnail_id($post->ID);
503
 
504
  add_filter('plugin_action_links', array(&$this, 'plugin_action_links'), 10, 2 );
505
 
 
 
506
  add_action( 'admin_footer', array( $this, 'add_deactive_modal' ) );
507
  add_action( 'wp_ajax_ssb_deactivate', array( $this, 'ssb_deactivate' ) );
508
  add_action( 'admin_init', array( $this, 'review_notice' ) );
509
+ add_action( 'admin_enqueue_scripts', array( $this, 'admin_enqueue_scripts' ) );
510
+ add_action( 'in_admin_header', array( $this, 'skip_notices' ), 100000 );
511
 
512
  }
513
 
539
  return $links;
540
  }
541
 
542
+ function admin_enqueue_scripts( $page ) {
543
+
544
+ if ( 'toplevel_page_simple-social-buttons' == $page ) {
545
+ wp_enqueue_script( 'ssb-admin-js', plugins_url( 'assets/js/admin.js', __FILE__ ), array( 'jquery', 'jquery-ui-sortable' ), time(), $in_footer = false );
546
+ }
547
+
548
+ }
549
+
550
  /**
551
  * Register meta box to hide/show SSB plugin on single post or page
552
  */
614
  update_post_meta($postId, $this->hideCustomMetaKey, $newValue);
615
  }
616
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
617
 
618
  /**
619
  * Show the popup on pluing deactivate
620
  *
621
+ * @since 1.9.0
622
  */
623
  function add_deactive_modal() {
624
  global $pagenow;
633
  /**
634
  * Send the user responce to api.
635
  *
636
+ * @since 1.9.0
637
  */
638
  function ssb_deactivate() {
639
  $email = get_option( 'admin_email' );
683
  /**
684
  * Check either to show notice or not.
685
  *
686
+ * @since 1.9.0
687
  */
688
  public function review_notice() {
689
 
712
  /**
713
  * Show review Message After 15 days.
714
  *
715
+ * @since 1.9.0
716
  */
717
  public function review_notice_message() {
718
 
755
  /**
756
  * Set time to current so review notice will popup after 15 days
757
  *
758
+ * @since 1.9.0
759
  */
760
  function review_prending() {
761
 
777
  /**
778
  * Check and Dismiss review message.
779
  *
780
+ * @since 1.9.0
781
  */
782
  private function review_dismissal() {
783
 
794
  add_site_option( 'ssb_review_dismiss', 'yes' );
795
  }
796
 
797
+
798
+ /**
799
+ * Skip the all the notice from settings page.
800
+ *
801
+ * @since 1.9.0
802
+ */
803
+ function skip_notices() {
804
+
805
+ if ( 'toplevel_page_simple-social-buttons' === get_current_screen()->id ) {
806
+
807
+ global $wp_filter;
808
+
809
+ if ( is_network_admin() and isset( $wp_filter['network_admin_notices'] ) ) {
810
+ unset( $wp_filter['network_admin_notices'] );
811
+ } elseif ( is_user_admin() and isset( $wp_filter['user_admin_notices'] ) ) {
812
+ unset( $wp_filter['user_admin_notices'] );
813
+ } else {
814
+ if ( isset( $wp_filter['admin_notices'] ) ) {
815
+ unset( $wp_filter['admin_notices'] );
816
+ }
817
+ }
818
+
819
+ if ( isset( $wp_filter['all_admin_notices'] ) ) {
820
+ unset( $wp_filter['all_admin_notices'] );
821
+ }
822
+ }
823
+
824
+ }
825
+
826
  } // end SimpleSocialButtonsPR_Admin
827
 
828
  if(is_admin() ) {
ssb-admin.php CHANGED
@@ -78,6 +78,67 @@ div.inside ul li {
78
  .ssb_settings_container #poststuff{
79
  min-width: 100%;
80
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
81
  @media only screen and (max-width: 850px){
82
 
83
  .ssb_settings_container{
@@ -86,15 +147,32 @@ div.inside ul li {
86
  .ssb_right_sidebar{
87
  float: left;
88
  }
 
 
 
89
  }
90
  </style>
91
 
92
- <h2>Simple Social Buttons - <?php _e('Settings'); ?>:</h2>
 
 
 
 
 
93
 
94
- <p><?php _e('<strong>Simple Social Buttons</strong> by <strong>WPBrigade</strong>. This plugin adds a social media buttons, such as: <strong>Google +1</strong>, <strong>Facebook Like it</strong>, <strong>Twitter share</strong> and <strong>Pinterest</strong>. The most flexible social buttons plugin ever.', 'simplesocialbuttons'); ?></p>
95
 
96
  <?php
97
 
 
 
 
 
 
 
 
 
 
98
  if(strtolower(@$_POST['hiddenconfirm']) == 'y') {
99
 
100
  /**
@@ -102,6 +180,11 @@ if(strtolower(@$_POST['hiddenconfirm']) == 'y') {
102
  * @see http://codex.wordpress.org/Function_Reference/wp_parse_args
103
  */
104
 
 
 
 
 
 
105
  $updateSettings = array(
106
  'googleplus' => isset( $_POST['ssb_googleplus'] ) ? sanitize_text_field( wp_unslash( $_POST['ssb_googleplus'] ) ) : '',
107
  'fblike' => isset( $_POST['ssb_fblike'] ) ? sanitize_text_field( wp_unslash( $_POST['ssb_fblike'] ) ) : '',
@@ -125,7 +208,7 @@ if(strtolower(@$_POST['hiddenconfirm']) == 'y') {
125
  'twitterusername' => isset( $_POST['ssb_twitterusername'] ) ? str_replace(array("@", " "), "", sanitize_text_field( wp_unslash( $_POST['ssb_twitterusername'] ) ) ) : '',
126
  );
127
 
128
- $this->update_settings( $updateSettings );
129
 
130
  }
131
 
@@ -141,6 +224,7 @@ $settings = $this->get_settings();
141
 
142
  extract( $settings, EXTR_PREFIX_ALL, 'ssb' );
143
 
 
144
  ?>
145
 
146
 
@@ -149,68 +233,47 @@ extract( $settings, EXTR_PREFIX_ALL, 'ssb' );
149
  <form name="ssb_form" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
150
 
151
  <div class="postbox">
 
152
  <div class="inside">
153
- <h3><?php _e('Select buttons', 'simplesocialbuttons'); ?></h3>
154
- <h4><?php _e('Select social media buttons:', 'simplesocialbuttons'); ?></h4>
155
-
156
-
157
- <p><select name="ssb_googleplus" id="ssb_googleplus">
158
- <option value=""<?php if(empty($ssb_googleplus) != false) {
159
- ?>selected="selected"<?php
160
- } ?>><?php _e('inactive', 'simplesocialbuttons'); ?></option>
161
-
162
- <?php for($pos = 1; $pos < 4; $pos++) { ?>
163
- <option value="<?php echo $pos; ?>"<?php if($ssb_googleplus == $pos) {
164
- ?>selected="selected"<?php
165
- } ?>> # <?php echo $pos; ?> </option>
166
- <?php } ?>
167
- </select> &nbsp;
168
- <label for="ssb_googleplus"><?php _e('Google plus one (+1)', 'simplesocialbuttons'); ?></label></p>
169
-
170
- <!-- fblike -->
171
- <p><select name="ssb_fblike" id="ssb_fblike">
172
- <option value=""<?php if(empty($ssb_fblike) != false) {
173
- ?>selected="selected"<?php
174
- } ?>><?php _e('inactive', 'simplesocialbuttons'); ?></option>
175
-
176
- <?php for($pos = 1; $pos < 5; $pos++) { ?>
177
- <option value="<?php echo $pos; ?>"<?php if($ssb_fblike == $pos) {
178
- ?>selected="selected"<?php
179
- } ?>> # <?php echo $pos; ?> </option>
180
- <?php } ?>
181
- </select> &nbsp;
182
- <label for="ssb_fblike"><?php _e('Facebook Like it', 'simplesocialbuttons'); ?></label></p>
183
- <!-- /fblike -->
184
-
185
- <!-- twitter -->
186
- <p><select name="ssb_twitter" id="ssb_twitter">
187
- <option value=""<?php if(empty($ssb_twitter) != false) {
188
- ?>selected="selected"<?php
189
- } ?>><?php _e('inactive', 'simplesocialbuttons'); ?></option>
190
-
191
- <?php for($pos = 1; $pos < 5; $pos++) { ?>
192
- <option value="<?php echo $pos; ?>"<?php if($ssb_twitter == $pos) {
193
- ?>selected="selected"<?php
194
- } ?>> # <?php echo $pos; ?> </option>
195
- <?php } ?>
196
- </select> &nbsp;
197
- <label for="ssb_twitter"><?php _e('Twitter share', 'simplesocialbuttons'); ?></label></p>
198
- <!-- /twitter -->
199
-
200
- <!-- pinterest -->
201
- <p><select name="ssb_pinterest" id="ssb_pinterest">
202
- <option value=""<?php if(empty($ssb_pinterest) != false) {
203
- ?>selected="selected"<?php
204
- } ?>><?php _e('inactive', 'simplesocialbuttons'); ?></option>
205
-
206
- <?php for($pos = 1; $pos < 5; $pos++) { ?>
207
- <option value="<?php echo $pos; ?>"<?php if($ssb_pinterest == $pos) {
208
- ?>selected="selected"<?php
209
- } ?>> # <?php echo $pos; ?> </option>
210
- <?php } ?>
211
- </select> &nbsp;
212
- <label for="ssb_pinterest"><?php _e('Pinterest - Pin It', 'simplesocialbuttons'); ?></label> (<?php echo _e('Will be visible only on post with thumbnail', 'simplesocialbuttons');?>)</p>
213
- <!-- /pinterest -->
214
 
215
  <p><label for="ssb_override_css"><input type="checkbox" name="ssb_override_css" id="ssb_override_css" value="1" <?php if(!empty($ssb_override_css)) { echo 'checked="checked"'; } ?>/> <?php _e('Disable plugin CSS (only advanced users)', 'simplesocialbuttons'); ?></label></p>
216
  </div>
@@ -272,11 +335,11 @@ extract( $settings, EXTR_PREFIX_ALL, 'ssb' );
272
  <h2>Spread the Word</h2>
273
  <ul class="ssb_social_links">
274
  <li>
275
- <a href="http://twitter.com/share?text=This is Best Related Social Share for WordPress&amp;url=https://wordpress.org/plugins/simple-social-buttons/" data-count="none" class="button twitter" target="_blank" title="Post to Twitter Now">Share on Twitter<span class="dashicons dashicons-twitter"></span></a>
276
  </li>
277
 
278
  <li>
279
- <a href="https://www.facebook.com/sharer/sharer.php?u=https://wordpress.org/plugins/simple-social-buttons/" class="button facebook" target="_blank" title="Share with your facebook friends about this awesome plugin.">Share on Facebook<span class="dashicons dashicons-facebook"></span>
280
  </a>
281
  </li>
282
 
@@ -316,17 +379,21 @@ extract( $settings, EXTR_PREFIX_ALL, 'ssb' );
316
  <div class="postbox ssb_social_links_wrapper">
317
  <div class="sidebar postbox">
318
  <h2>Recommended Plugins</h2>
319
- <!-- <p>Following are the plugins highly recommend by Team WPBrigade.</p> -->
320
  <ul class="plugins_lists">
321
  <li>
322
- <a href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=related-posts-lite&amp;utm_medium=sidebar&amp;utm_campaign=pro-upgrade" data-count="none" target="_blank" title="Post to Twitter Now">LoginPress - Login Customizer</a>
323
  </li>
324
 
325
  <li>
326
- <a href="https://analytify.io/ref/73/?utm_source=related-posts-lite&amp;utm_medium=sidebar&amp;utm_campaign=pro-upgrade" target="_blank" title="Share with your facebook friends about this awesome plugin.">Google Analytics by Analytify
327
  </a>
328
  </li>
329
 
 
 
 
 
330
  <li>
331
  <a href="http://wpbrigade.com/recommend/maintenance-mode" target="_blank" title="Under Construction &amp; Maintenance mode">Under Construction &amp; Maintenance mode
332
  </a>
@@ -341,24 +408,21 @@ extract( $settings, EXTR_PREFIX_ALL, 'ssb' );
341
 
342
  <script type="text/javascript">
343
  jQuery(document).ready(function($) {
344
-
345
  $('#ssb_subscribe_btn').on('click', function(event) {
346
  event.preventDefault();
347
-
348
  var subscriber_mail = $('#ssb_subscribe_mail').val();
349
  var name = $('#ssb_subscribe_name').val();
350
  if (!subscriber_mail) {
351
  $('.ssb_subscribe_warning').html('Please Enter Email');
352
  return;
353
  }
354
-
355
  $.ajax({
356
- url: ajaxurl,
357
  type: 'POST',
358
  data: {
359
  subscriber_mail : subscriber_mail,
360
- action : 'ssb_subscriber',
361
- name : name
362
  },
363
  beforeSend : function() {
364
  $('.ssb_subscribe_loader').show();
@@ -369,8 +433,6 @@ jQuery(document).ready(function($) {
369
  $('.ssb_return_message').html(res);
370
  $('.ssb_subscribe_loader').hide();
371
  });
372
-
373
  });
374
-
375
  });
376
  </script>
78
  .ssb_settings_container #poststuff{
79
  min-width: 100%;
80
  }
81
+ .ssb_settings_container #poststuff h2{
82
+ border-bottom: 1px solid #ccc;
83
+ font-size: 1.3em;
84
+ }
85
+ .ssb_settings_container #poststuff .ssb_settings_box{
86
+ border:1px solid #ccc;
87
+ overflow: hidden;
88
+ display: table;
89
+ background: #f6f6f6;
90
+ }
91
+ .ssb_settings_container #poststuff .ssb_settings_box + .ssb_settings_box{
92
+ border-top: 0;
93
+ }
94
+ .ssb_settings_container #poststuff .ssb_settings_box h2{
95
+ width: 180px;
96
+ float: left;
97
+ text-align: center;
98
+ background: #f6f6f6;
99
+ border:0;
100
+ display: table-cell;
101
+ padding: 10px;
102
+ }
103
+ .ssb_settings_container #poststuff .ssb_settings_box ul{
104
+ overflow: hidden;
105
+ margin:0;
106
+ padding: 10px 0;
107
+ list-style: none;
108
+ font-size: 0;
109
+ border-left: 1px solid #ccc;
110
+ display: table-cell;
111
+ vertical-align: top;
112
+ width: 100%;
113
+ background: #fff;
114
+ }
115
+ .ssb_settings_container #poststuff .ssb_settings_box ul li{
116
+ display: inline-block;
117
+ margin-bottom: 0;
118
+ list-style: none;
119
+ font-size: 16px;
120
+ }
121
+ .ssb_settings_container #poststuff .ssb_settings_box ul li:hover{
122
+ cursor: pointer;
123
+
124
+ }
125
+ .ssb-top-bar{
126
+ background: #f3fbff;
127
+ overflow: hidden;
128
+ padding: 12px 20px;
129
+
130
+ }
131
+ .ssb-top-bar img {
132
+ float: left;
133
+ margin-right: 20px;
134
+ width: 100px;
135
+ }
136
+ .ssb-top-bar-content{
137
+ overflow: hidden;
138
+ }
139
+ .ssb-top-bar-content h2{
140
+ margin: 10px 0;
141
+ }
142
  @media only screen and (max-width: 850px){
143
 
144
  .ssb_settings_container{
147
  .ssb_right_sidebar{
148
  float: left;
149
  }
150
+ .ssb_settings_container #poststuff .ssb_settings_box h2{
151
+ width: 120px;
152
+ }
153
  }
154
  </style>
155
 
156
+ <div class="ssb-top-bar">
157
+ <a href="https://wpbrigade.com/"><img src="<?php echo plugins_url( 'assets/images/ssb_icon.png', __FILE__ ) ?>" alt="Simple Social Buttons"></a>
158
+ <div class="ssb-top-bar-content">
159
+ <h2>Simple Social Buttons - <?php _e('Settings'); ?>:</h2>
160
+ <p><?php _e('<strong>Simple Social Buttons</strong> by <strong><a href="https://wpbrigade.com/">WPBrigade</a></strong>. This plugin adds a social media buttons, such as: <strong>Google +1</strong>, <strong>Facebook Like it</strong>, <strong>Facebook share</strong>, <strong>Twitter share</strong>, <strong>LinkedIn share</strong> and <strong>Pinterest</strong>. The most flexible social buttons plugin ever.', 'simplesocialbuttons'); ?></p>
161
+ </div>
162
 
163
+ </div>
164
 
165
  <?php
166
 
167
+ $all_icons = array(
168
+ 'fblike' => 0,
169
+ 'twitter' => 0,
170
+ 'googleplus' => 0,
171
+ 'pinterest' => 0,
172
+ 'fbshare' => 0,
173
+ 'linkedin' => 0
174
+ );
175
+
176
  if(strtolower(@$_POST['hiddenconfirm']) == 'y') {
177
 
178
  /**
180
  * @see http://codex.wordpress.org/Function_Reference/wp_parse_args
181
  */
182
 
183
+ // image_oder return string thats why we explode it.
184
+ // add empty array to start form 1 index.
185
+ update_option( 'ssb_icons_order', sanitize_text_field( wp_unslash( $_POST['ssb_icons_order'] ) ) );
186
+ $ssb_icons_order = array_merge( array(0), explode( ',', sanitize_text_field( wp_unslash( $_POST['ssb_icons_order'] ) ) ) );
187
+
188
  $updateSettings = array(
189
  'googleplus' => isset( $_POST['ssb_googleplus'] ) ? sanitize_text_field( wp_unslash( $_POST['ssb_googleplus'] ) ) : '',
190
  'fblike' => isset( $_POST['ssb_fblike'] ) ? sanitize_text_field( wp_unslash( $_POST['ssb_fblike'] ) ) : '',
208
  'twitterusername' => isset( $_POST['ssb_twitterusername'] ) ? str_replace(array("@", " "), "", sanitize_text_field( wp_unslash( $_POST['ssb_twitterusername'] ) ) ) : '',
209
  );
210
 
211
+ $this->update_settings( array_merge( $updateSettings, array_merge( $all_icons, array_flip( $ssb_icons_order ) ) ) );
212
 
213
  }
214
 
224
 
225
  extract( $settings, EXTR_PREFIX_ALL, 'ssb' );
226
 
227
+
228
  ?>
229
 
230
 
233
  <form name="ssb_form" method="post" action="<?php echo $_SERVER['REQUEST_URI']; ?>">
234
 
235
  <div class="postbox">
236
+ <h2>Select buttons</h2>
237
  <div class="inside">
238
+ <p>Drag & Drop to activate and order your share buttons:</p>
239
+ <div class="ssb_settings_box">
240
+
241
+
242
+ <h2>Active</h2>
243
+ <ul id="ssb_active_icons" class="items" style="min-height:35px">
244
+ <!-- <li id="facebook" class="list">FaceBook</li>
245
+ <li id="twitter" class="list">Twiiter</li> -->
246
+
247
+ <?php
248
+ $ssb_icons_order = array();
249
+ foreach ($this->arrKnownButtons as $button_name) {
250
+ $ssb_icons_order[$button_name] = isset( $settings[$button_name] ) ? $settings[$button_name] : '' ;
251
+ }
252
+ asort( $ssb_icons_order );
253
+ ?>
254
+ <?php foreach ($ssb_icons_order as $key => $value): ?>
255
+ <?php if ( $value != 0): ?>
256
+ <li data-id="<?php echo $key ?>" class="list"><img src="<?php echo plugins_url( 'assets/images/'.$key.'.jpg', __FILE__ ) ?>" /></li>
257
+ <?php endif; ?>
258
+ <?php endforeach; ?>
259
+
260
+
261
+ </ul>
262
+ </div>
263
+ <div class="ssb_settings_box">
264
+ <h2>InActive</h2>
265
+
266
+ <ul id="ssb_inactive_icons" class="items" style="min-height:35px">
267
+ <?php foreach ( $ssb_icons_order as $key => $value): ?>
268
+ <?php if ( $value == 0): ?>
269
+ <li data-id="<?php echo $key ?>" class="list" ><img src="<?php echo plugins_url( 'assets/images/'.$key.'.jpg', __FILE__ ) ?>" /></li>
270
+ <?php endif; ?>
271
+ <?php endforeach; ?>
272
+ </ul>
273
+ </div>
274
+
275
+ <input type="hidden" id="ssb_icons_order" name="ssb_icons_order" value="<?php echo get_option( 'ssb_icons_order', join( ',', array_flip( array_filter( $ssb_icons_order ) ) ) ) ?>" />
276
+
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
277
 
278
  <p><label for="ssb_override_css"><input type="checkbox" name="ssb_override_css" id="ssb_override_css" value="1" <?php if(!empty($ssb_override_css)) { echo 'checked="checked"'; } ?>/> <?php _e('Disable plugin CSS (only advanced users)', 'simplesocialbuttons'); ?></label></p>
279
  </div>
335
  <h2>Spread the Word</h2>
336
  <ul class="ssb_social_links">
337
  <li>
338
+ <a href="http://twitter.com/share?text=Check out this (FREE) Amazing Social Share Plugin for WordPress&amp;url=https://wordpress.org/plugins/simple-social-buttons/" data-count="none" class="button twitter" target="_blank" title="Post to Twitter Now">Share on Twitter<span class="dashicons dashicons-twitter"></span></a>
339
  </li>
340
 
341
  <li>
342
+ <a href="https://www.facebook.com/sharer/sharer.php?u=https://wordpress.org/plugins/simple-social-buttons/" class="button facebook" target="_blank" title="Check out this (FREE) Amazing Social Share Plugin for WordPress">Share on Facebook<span class="dashicons dashicons-facebook"></span>
343
  </a>
344
  </li>
345
 
379
  <div class="postbox ssb_social_links_wrapper">
380
  <div class="sidebar postbox">
381
  <h2>Recommended Plugins</h2>
382
+ <!-- <p>Following are the plugins highly recommend by Team WPBrigade.com</p> -->
383
  <ul class="plugins_lists">
384
  <li>
385
+ <a href="https://wpbrigade.com/wordpress/plugins/loginpress-pro/?utm_source=ssb-lite&amp;utm_medium=sidebar&amp;utm_campaign=pro-upgrade" target="_blank" title="Post to Twitter Now">LoginPress - Login Customizer</a>
386
  </li>
387
 
388
  <li>
389
+ <a href="https://analytify.io/ref/73/?utm_source=ssb-lite&amp;utm_medium=sidebar&amp;utm_campaign=pro-upgrade" target="_blank" title="Share with your facebook friends about this awesome plugin.">Google Analytics by Analytify
390
  </a>
391
  </li>
392
 
393
+ <li>
394
+ <a href="https://wpbrigade.com/wordpress/plugins/related-posts/?utm_source=ssb-lite&amp;utm_medium=sidebar&amp;utm_campaign=pro-upgrade" target="_blank" title="Releated Posts Thumbnails">Releated Posts Thumbnails</a>
395
+ </li>
396
+
397
  <li>
398
  <a href="http://wpbrigade.com/recommend/maintenance-mode" target="_blank" title="Under Construction &amp; Maintenance mode">Under Construction &amp; Maintenance mode
399
  </a>
408
 
409
  <script type="text/javascript">
410
  jQuery(document).ready(function($) {
 
411
  $('#ssb_subscribe_btn').on('click', function(event) {
412
  event.preventDefault();
 
413
  var subscriber_mail = $('#ssb_subscribe_mail').val();
414
  var name = $('#ssb_subscribe_name').val();
415
  if (!subscriber_mail) {
416
  $('.ssb_subscribe_warning').html('Please Enter Email');
417
  return;
418
  }
 
419
  $.ajax({
420
+ url: 'https://wpbrigade.com/wp-json/wpbrigade/v1/subsribe-to-mailchimp',
421
  type: 'POST',
422
  data: {
423
  subscriber_mail : subscriber_mail,
424
+ name : name,
425
+ plugin_name : 'ssb'
426
  },
427
  beforeSend : function() {
428
  $('.ssb_subscribe_loader').show();
433
  $('.ssb_return_message').html(res);
434
  $('.ssb_subscribe_loader').hide();
435
  });
 
436
  });
 
437
  });
438
  </script>