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

Version Description

  • Important release, Please upgrade immediately. BugFix: Horizontal issue.

=

Download this release

Release Info

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

Code changes from version 1.8.1 to 1.8.2

assets/images/ssb_grey_logi.png ADDED
Binary file
inc/ssb-deactivate-form.php ADDED
@@ -0,0 +1,256 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <style>
2
+ .wp-ssb-hidden{
3
+ overflow: hidden;
4
+ }
5
+ .wp-ssb-popup-overlay .wp-ssb-internal-message{
6
+ margin: 3px 0 3px 22px;
7
+ display: none;
8
+ }
9
+ .wp-ssb-reason-input{
10
+ margin: 3px 0 3px 22px;
11
+ display: none;
12
+ }
13
+ .wp-ssb-reason-input input[type="text"]{
14
+ width: 100%;
15
+ display: block;
16
+ }
17
+ .wp-ssb-popup-overlay{
18
+ background: rgba(0,0,0, .8);
19
+ position: fixed;
20
+ top:0;
21
+ left: 0;
22
+ height: 100%;
23
+ width: 100%;
24
+ z-index: 1000;
25
+ overflow: auto;
26
+ visibility: hidden;
27
+ opacity: 0;
28
+ transition: opacity 0.3s ease-in-out:
29
+ }
30
+ .wp-ssb-popup-overlay.wp-ssb-active{
31
+ opacity: 1;
32
+ visibility: visible;
33
+ }
34
+ .wp-ssb-serveypanel{
35
+ width: 600px;
36
+ background: #fff;
37
+ margin: 65px auto 0;
38
+ }
39
+ .wp-ssb-popup-header{
40
+ background: #f1f1f1;
41
+ padding: 20px;
42
+ border-bottom: 1px solid #ccc;
43
+ }
44
+ .wp-ssb-popup-header h2{
45
+ margin: 0;
46
+ }
47
+ .wp-ssb-popup-body{
48
+ padding: 10px 20px;
49
+ }
50
+ .wp-ssb-popup-footer{
51
+ background: #f9f3f3;
52
+ padding: 10px 20px;
53
+ border-top: 1px solid #ccc;
54
+ }
55
+ .wp-ssb-popup-footer:after{
56
+ content:"";
57
+ display: table;
58
+ clear: both;
59
+ }
60
+ .action-btns{
61
+ float: right;
62
+ }
63
+ .wp-ssb-anonymous{
64
+ display: none;
65
+ }
66
+ .attention, .error-message {
67
+ color: red;
68
+ font-weight: 600;
69
+ display: none;
70
+ }
71
+ .wp-ssb-spinner{
72
+ display: none;
73
+ }
74
+ .wp-ssb-spinner img{
75
+ margin-top: 3px;
76
+ }
77
+
78
+ </style>
79
+
80
+ <div class="wp-ssb-popup-overlay">
81
+ <div class="wp-ssb-serveypanel">
82
+ <form action="#" method="post" id="wp-ssb-deactivate-form">
83
+ <div class="wp-ssb-popup-header">
84
+ <h2><?php _e( 'Quick feedback about Simple Social Buttons', 'wp-ssb' ); ?></h2>
85
+ </div>
86
+ <div class="wp-ssb-popup-body">
87
+ <h3><?php _e( 'If you have a moment, please let us know why you are deactivating:', 'wp-ssb' ); ?></h3>
88
+ <ul id="wp-ssb-reason-list">
89
+ <li class="wp-ssb-reason" data-input-type="" data-input-placeholder="">
90
+ <label>
91
+ <span>
92
+ <input type="radio" name="wp-ssb-selected-reason" value="1">
93
+ </span>
94
+ <span><?php _e( 'I only needed the plugin for a short period', 'wp-ssb' ); ?></span>
95
+ </label>
96
+ <div class="wp-ssb-internal-message"></div>
97
+ </li>
98
+ <li class="wp-ssb-reason has-input" data-input-type="textfield">
99
+ <label>
100
+ <span>
101
+ <input type="radio" name="wp-ssb-selected-reason" value="2">
102
+ </span>
103
+ <span><?php _e( 'I found a better plugin', 'wp-ssb' ); ?></span>
104
+ </label>
105
+ <div class="wp-ssb-internal-message"></div>
106
+ <div class="wp-ssb-reason-input"><span class="message error-message"><?php _e( 'Kindly tell us the name of plugin', 'wp-ssb' ); ?></span><input type="text" name="better_plugin" placeholder="What's the plugin's name?"></div>
107
+ </li>
108
+ <li class="wp-ssb-reason" data-input-type="" data-input-placeholder="">
109
+ <label>
110
+ <span>
111
+ <input type="radio" name="wp-ssb-selected-reason" value="3">
112
+ </span>
113
+ <span><?php _e( 'The plugin broke my site', 'wp-ssb' ); ?></span>
114
+ </label>
115
+ <div class="wp-ssb-internal-message"></div>
116
+ </li>
117
+ <li class="wp-ssb-reason" data-input-type="" data-input-placeholder="">
118
+ <label>
119
+ <span>
120
+ <input type="radio" name="wp-ssb-selected-reason" value="4">
121
+ </span>
122
+ <span><?php _e( 'The plugin suddenly stopped working', 'wp-ssb' ); ?></span>
123
+ </label>
124
+ <div class="wp-ssb-internal-message"></div>
125
+ </li>
126
+ <li class="wp-ssb-reason" data-input-type="" data-input-placeholder="">
127
+ <label>
128
+ <span>
129
+ <input type="radio" name="wp-ssb-selected-reason" value="5">
130
+ </span>
131
+ <span><?php _e( 'I no longer need the plugin', 'wp-ssb' ); ?></span>
132
+ </label>
133
+ <div class="wp-ssb-internal-message"></div>
134
+ </li>
135
+ <li class="wp-ssb-reason" data-input-type="" data-input-placeholder="">
136
+ <label>
137
+ <span>
138
+ <input type="radio" name="wp-ssb-selected-reason" value="6">
139
+ </span>
140
+ <span><?php _e( "It's a temporary deactivation. I'm just debugging an issue.", 'wp-ssb' ); ?></span>
141
+ </label>
142
+ <div class="wp-ssb-internal-message"></div>
143
+ </li>
144
+ <li class="wp-ssb-reason has-input" data-input-type="textfield" >
145
+ <label>
146
+ <span>
147
+ <input type="radio" name="wp-ssb-selected-reason" value="7">
148
+ </span>
149
+ <span><?php _e( 'Other', 'wp-ssb' ); ?></span>
150
+ </label>
151
+ <div class="wp-ssb-internal-message"></div>
152
+ <div class="wp-ssb-reason-input"><span class="message error-message "><?php _e( 'Kindly tell us the reason so we can improve.', 'wp-ssb' ); ?></span><input type="text" name="other_reason" placeholder="Would you like to share what's other reason ?"></div>
153
+ </li>
154
+ </ul>
155
+ </div>
156
+ <div class="wp-ssb-popup-footer">
157
+ <label class="wp-ssb-anonymous"><input type="checkbox" /><?php _e( 'Anonymous feedback', 'wp-ssb' ); ?></label>
158
+ <input type="button" class="button button-secondary button-skip wp-ssb-popup-skip-feedback" value="Skip &amp; Deactivate" >
159
+ <div class="action-btns">
160
+ <span class="wp-ssb-spinner"><img src="<?php echo admin_url( '/images/spinner.gif' ); ?>" alt=""></span>
161
+ <input type="submit" class="button button-secondary button-deactivate wp-ssb-popup-allow-deactivate" value="Submit &amp; Deactivate" disabled="disabled">
162
+ <a href="#" class="button button-primary wp-ssb-popup-button-close"><?php _e( 'Cancel', 'wp-ssb' ); ?></a>
163
+
164
+ </div>
165
+ </div>
166
+ </form>
167
+ </div>
168
+ </div>
169
+
170
+
171
+ <script>
172
+ (function( $ ) {
173
+
174
+ $(function() {
175
+
176
+ var pluginSlug = 'simple-social-buttons';
177
+ // Code to fire when the DOM is ready.
178
+
179
+ $(document).on('click', 'tr[data-slug="' + pluginSlug + '"] .deactivate', function(e){
180
+ e.preventDefault();
181
+
182
+ $('.wp-ssb-popup-overlay').addClass('wp-ssb-active');
183
+ $('body').addClass('wp-ssb-hidden');
184
+ });
185
+ $(document).on('click', '.wp-ssb-popup-button-close', function () {
186
+ close_popup();
187
+ });
188
+ $(document).on('click', ".wp-ssb-serveypanel,tr[data-slug='" + pluginSlug + "'] .deactivate",function(e){
189
+ e.stopPropagation();
190
+ });
191
+
192
+ $(document).click(function(){
193
+ close_popup();
194
+ });
195
+ $('.wp-ssb-reason label').on('click', function(){
196
+ if($(this).find('input[type="radio"]').is(':checked')){
197
+ //$('.wp-ssb-anonymous').show();
198
+ $(this).next().next('.wp-ssb-reason-input').show().end().end().parent().siblings().find('.wp-ssb-reason-input').hide();
199
+ }
200
+ });
201
+ $('input[type="radio"][name="wp-ssb-selected-reason"]').on('click', function(event) {
202
+ $(".wp-ssb-popup-allow-deactivate").removeAttr('disabled');
203
+ });
204
+ $(document).on('submit', '#wp-ssb-deactivate-form', function(event) {
205
+ event.preventDefault();
206
+
207
+ var _reason = $(this).find('input[type="radio"][name="wp-ssb-selected-reason"]:checked').val();
208
+ var _reason_details = '';
209
+ if ( _reason == 2 ) {
210
+ _reason_details = $(this).find("input[type='text'][name='better_plugin']").val();
211
+ } else if ( _reason == 7 ) {
212
+ _reason_details = $(this).find("input[type='text'][name='other_reason']").val();
213
+ }
214
+
215
+ if ( ( _reason == 7 || _reason == 2 ) && _reason_details == '' ) {
216
+ $('.message.error-message').show();
217
+ return ;
218
+ }
219
+
220
+ $.ajax({
221
+ url: ajaxurl,
222
+ type: 'POST',
223
+ data: {
224
+ action : 'ssb_deactivate',
225
+ reason : _reason,
226
+ reason_detail : _reason_details,
227
+ },
228
+ beforeSend: function(){
229
+ $(".wp-ssb-spinner").show();
230
+ $(".wp-ssb-popup-allow-deactivate").attr("disabled", "disabled");
231
+ }
232
+ })
233
+ .done(function() {
234
+ $(".wp-ssb-spinner").hide();
235
+ $(".wp-ssb-popup-allow-deactivate").removeAttr("disabled");
236
+ window.location.href = $("tr[data-slug='"+ pluginSlug +"'] .deactivate a").attr('href');
237
+ });
238
+
239
+ });
240
+
241
+ $('.wp-ssb-popup-skip-feedback').on('click', function(e){
242
+ window.location.href = $("tr[data-slug='"+ pluginSlug +"'] .deactivate a").attr('href');
243
+ })
244
+
245
+ function close_popup() {
246
+ $('.wp-ssb-popup-overlay').removeClass('wp-ssb-active');
247
+ $('#wp-ssb-deactivate-form').trigger("reset");
248
+ $(".wp-ssb-popup-allow-deactivate").attr('disabled', 'disabled');
249
+ $(".wp-ssb-reason-input").hide();
250
+ $('body').removeClass('wp-ssb-hidden');
251
+ $('.message.error-message').hide();
252
+ }
253
+ });
254
+
255
+ })( jQuery ); // This invokes the function above and allows us to use '$' in place of 'jQuery' in our code.
256
+ </script>
readme.txt CHANGED
@@ -4,7 +4,7 @@ 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.1
8
  License: GPLv2 or later
9
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
10
 
@@ -111,12 +111,19 @@ Big thanks to:
111
 
112
  == Upgrade Notice ==
113
 
114
- = 1.8.1 =
115
  * Important release, Please upgrade immediately. BugFix: Horizontal issue.
116
 
117
 
118
  == Changelog ==
119
 
 
 
 
 
 
 
 
120
  = 1.8.1 =
121
  * BugFix: Horizontal issue.
122
 
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
 
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.
123
+ * Enhancement: Add Review Notice.
124
+ * Enhancement: Add deactivate popup feedback form.
125
+
126
+
127
  = 1.8.1 =
128
  * BugFix: Horizontal issue.
129
 
simple-social-buttons.php CHANGED
@@ -4,7 +4,7 @@
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.1
8
  * Author: WPBrigade
9
  * Author URI: http://adnan.pk/
10
  */
@@ -36,7 +36,7 @@
36
 
37
  class SimpleSocialButtonsPR {
38
  var $pluginName = 'Simple Social Buttons';
39
- var $pluginVersion = '1.8.1';
40
  var $pluginPrefix = 'ssb_pr_';
41
  var $hideCustomMetaKey = '_ssb_hide';
42
 
@@ -68,6 +68,8 @@ class SimpleSocialButtonsPR {
68
  register_activation_hook( __FILE__, array(&$this, 'plugin_install') );
69
  register_deactivation_hook( __FILE__, array(&$this, 'plugin_uninstall') );
70
 
 
 
71
  /**
72
  * Action hooks
73
  */
@@ -98,6 +100,11 @@ class SimpleSocialButtonsPR {
98
  load_plugin_textdomain( 'simplesocialbuttons', '', dirname( plugin_basename( __FILE__ ) ).'/lang' );
99
  }
100
 
 
 
 
 
 
101
  /**
102
  * Both avoids time-wasting https calls AND provides better SSL-protection if the current server is accessed using HTTPS
103
  */
@@ -184,7 +191,7 @@ window.___gcfg = {lang: '<?php echo $lang_g; ?>'};
184
  div.ssb-button-pinterest { width: 100px; }
185
  .fb-like iframe { max-width: none !important; }
186
  .simplesocialbuttons .simplesocialbutton { display: inline-block; vertical-align: top; width: auto; }
187
- .simplesocialbuttons .simplesocialbutton iframe { margin: 0; }
188
  .simplesocialbuttons .simplesocialbutton + .simplesocialbutton { margin-left: 20px; }
189
  </style>
190
  <!-- End of Simple Social Buttons -->
@@ -450,6 +457,7 @@ class SimpleSocialButtonsPR_Admin extends SimpleSocialButtonsPR {
450
  function __construct() {
451
  parent::__construct();
452
 
 
453
  add_action('admin_menu', array(&$this, 'admin_actions') );
454
  add_action('add_meta_boxes', array(&$this, 'ssb_meta_box'));
455
  add_action('save_post', array(&$this, 'ssb_save_meta'), 10, 2);
@@ -457,11 +465,16 @@ class SimpleSocialButtonsPR_Admin extends SimpleSocialButtonsPR {
457
  add_filter('plugin_action_links', array(&$this, 'plugin_action_links'), 10, 2 );
458
 
459
  add_action( 'wp_ajax_ssb_subscriber', array( $this, 'ssb_subscriber' ) );
 
 
 
 
 
460
  }
461
 
462
  public function admin_actions() {
463
  if (current_user_can('activate_plugins'))
464
- add_options_page('Simple Social Buttons ', 'Social Buttons ', "activate_plugins", 'simple-social-buttons', array(&$this, 'admin_page') );
465
  }
466
 
467
  public function admin_page() {
@@ -480,7 +493,7 @@ class SimpleSocialButtonsPR_Admin extends SimpleSocialButtonsPR {
480
  }
481
 
482
  if ($file == $this_plugin) {
483
- $settings_link = '<a href="' . get_bloginfo('wpurl') . '/wp-admin/options-general.php?page=simple-social-buttons">'.__('Settings', 'simplesocialbuttons').'</a>';
484
  array_unshift($links, $settings_link);
485
  }
486
 
@@ -619,6 +632,184 @@ class SimpleSocialButtonsPR_Admin extends SimpleSocialButtonsPR {
619
  wp_die();
620
  }
621
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
622
 
623
  } // end SimpleSocialButtonsPR_Admin
624
 
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
  */
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
 
68
  register_activation_hook( __FILE__, array(&$this, 'plugin_install') );
69
  register_deactivation_hook( __FILE__, array(&$this, 'plugin_uninstall') );
70
 
71
+
72
+ $this->constants();
73
  /**
74
  * Action hooks
75
  */
100
  load_plugin_textdomain( 'simplesocialbuttons', '', dirname( plugin_basename( __FILE__ ) ).'/lang' );
101
  }
102
 
103
+ function constants() {
104
+ define( 'SSB_FEEDBACK_SERVER', 'https://wpbrigade.com/' );
105
+ define( 'SSB_VERSION', $this->pluginVersion );
106
+ define( 'SSB_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
107
+ }
108
  /**
109
  * Both avoids time-wasting https calls AND provides better SSL-protection if the current server is accessed using HTTPS
110
  */
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 -->
457
  function __construct() {
458
  parent::__construct();
459
 
460
+
461
  add_action('admin_menu', array(&$this, 'admin_actions') );
462
  add_action('add_meta_boxes', array(&$this, 'ssb_meta_box'));
463
  add_action('save_post', array(&$this, 'ssb_save_meta'), 10, 2);
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
 
475
  public function admin_actions() {
476
  if (current_user_can('activate_plugins'))
477
+ add_menu_page( 'Simple Social Buttons ', 'Social Buttons ', "activate_plugins", 'simple-social-buttons', array(&$this, 'admin_page'), 'dashicons-share', 100 );
478
  }
479
 
480
  public function admin_page() {
493
  }
494
 
495
  if ($file == $this_plugin) {
496
+ $settings_link = '<a href="' . admin_url( 'admin.php?page=simple-social-buttons' ) . '">'.__('Settings', 'simplesocialbuttons').'</a>';
497
  array_unshift($links, $settings_link);
498
  }
499
 
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;
642
+
643
+ if ( 'plugins.php' !== $pagenow ) {
644
+ return;
645
+ }
646
+
647
+ include SSB_PLUGIN_DIR . 'inc/ssb-deactivate-form.php';
648
+ }
649
+
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' );
657
+ $_reason = sanitize_text_field( wp_unslash( $_POST['reason'] ) );
658
+ $reason_detail = sanitize_text_field( wp_unslash( $_POST['reason_detail'] ) );
659
+ $reason = '';
660
+
661
+ if ( $_reason == '1' ) {
662
+ $reason = 'I only needed the plugin for a short period';
663
+ } elseif ( $_reason == '2' ) {
664
+ $reason = 'I found a better plugin';
665
+ } elseif ( $_reason == '3' ) {
666
+ $reason = 'The plugin broke my site';
667
+ } elseif ( $_reason == '4' ) {
668
+ $reason = 'The plugin suddenly stopped working';
669
+ } elseif ( $_reason == '5' ) {
670
+ $reason = 'I no longer need the plugin';
671
+ } elseif ( $_reason == '6' ) {
672
+ $reason = 'It\'s a temporary deactivation. I\'m just debugging an issue.';
673
+ } elseif ( $_reason == '7' ) {
674
+ $reason = 'Other';
675
+ }
676
+ $fields = array(
677
+ 'email' => $email,
678
+ 'website' => get_site_url(),
679
+ 'action' => 'Deactivate',
680
+ 'reason' => $reason,
681
+ 'reason_detail' => $reason_detail,
682
+ 'blog_language' => get_bloginfo( 'language' ),
683
+ 'wordpress_version' => get_bloginfo( 'version' ),
684
+ 'plugin_version' => SSB_VERSION,
685
+ 'plugin_name' => 'Simple Social Buttons',
686
+ );
687
+
688
+ $response = wp_remote_post( SSB_FEEDBACK_SERVER, array(
689
+ 'method' => 'POST',
690
+ 'timeout' => 5,
691
+ 'httpversion' => '1.0',
692
+ 'blocking' => false,
693
+ 'headers' => array(),
694
+ 'body' => $fields,
695
+ ) );
696
+
697
+ wp_die();
698
+ }
699
+
700
+ /**
701
+ * Check either to show notice or not.
702
+ *
703
+ * @since 1.8.2
704
+ */
705
+ public function review_notice() {
706
+
707
+ $this->review_dismissal();
708
+ $this->review_prending();
709
+
710
+ $review_dismissal = get_site_option( 'ssb_review_dismiss' );
711
+ if ( 'yes' == $review_dismissal ) {
712
+ return;
713
+ }
714
+
715
+ $activation_time = get_site_option( 'ssb_active_time' );
716
+ if ( ! $activation_time ) {
717
+
718
+ $activation_time = time();
719
+ add_site_option( 'ssb_active_time', $activation_time );
720
+ }
721
+
722
+ // 1296000 = 15 Days in seconds.
723
+ if ( time() - $activation_time > 1296000 ) {
724
+ add_action( 'admin_notices' , array( $this, 'review_notice_message' ) );
725
+ }
726
+
727
+ }
728
+
729
+ /**
730
+ * Show review Message After 15 days.
731
+ *
732
+ * @since 1.8.2
733
+ */
734
+ public function review_notice_message() {
735
+
736
+ $scheme = ( parse_url( $_SERVER['REQUEST_URI'], PHP_URL_QUERY ) ) ? '&' : '?';
737
+ $url = $_SERVER['REQUEST_URI'] . $scheme . 'ssb_review_dismiss=yes';
738
+ $dismiss_url = wp_nonce_url( $url, 'ssb-review-nonce' );
739
+
740
+ $_later_link = $_SERVER['REQUEST_URI'] . $scheme . 'ssb_review_later=yes';
741
+ $later_url = wp_nonce_url( $_later_link, 'ssb-review-nonce' );
742
+
743
+ ?>
744
+ <style media="screen">
745
+ .ssb-review-notice { padding: 15px 15px 15px 0; background-color: #fff; border-radius: 3px; margin: 20px 20px 0 0; border-left: 4px solid transparent; } .ssb-review-notice:after { content: ''; display: table; clear: both; }
746
+ .ssb-review-thumbnail { width: 114px; float: left; line-height: 80px; text-align: center; border-right: 4px solid transparent; }
747
+ .ssb-review-thumbnail img { width: 74px; vertical-align: middle; }
748
+ .ssb-review-text { overflow: hidden; }
749
+ .ssb-review-text h3 { font-size: 24px; margin: 0 0 5px; font-weight: 400; line-height: 1.3; }
750
+ .ssb-review-text p { font-size: 13px; margin: 0 0 5px; }
751
+ .ssb-review-ul { margin: 0; padding: 0; }
752
+ .ssb-review-ul li { display: inline-block; margin-right: 15px; }
753
+ .ssb-review-ul li a { display: inline-block; color: #10738B; text-decoration: none; padding-left: 26px; position: relative; }
754
+ .ssb-review-ul li a span { position: absolute; left: 0; top: -2px; }
755
+ </style>
756
+ <div class="ssb-review-notice">
757
+ <div class="ssb-review-thumbnail">
758
+ <img src="<?php echo plugins_url( 'assets/images/ssb_grey_logi.png', __FILE__ ) ?>" alt="">
759
+ </div>
760
+ <div class="ssb-review-text">
761
+ <h3><?php _e( 'Leave A Review?', 'simplesocialbuttons' ) ?></h3>
762
+ <p><?php _e( 'We hope you\'ve enjoyed using Simple Social Buttons! Would you consider leaving us a review on WordPress.org?', 'simplesocialbuttons' ) ?></p>
763
+ <ul class="ssb-review-ul"><li><a href="https://wordpress.org/support/plugin/simple-social-buttons/reviews/?filter=5" target="_blank"><span class="dashicons dashicons-external"></span><?php _e( 'Sure! I\'d love to!', 'simplesocialbuttons' ) ?></a></li>
764
+ <li><a href="<?php echo $dismiss_url ?>"><span class="dashicons dashicons-smiley"></span><?php _e( 'I\'ve already left a review', 'simplesocialbuttons' ) ?></a></li>
765
+ <li><a href="<?php echo $later_url ?>"><span class="dashicons dashicons-calendar-alt"></span><?php _e( 'Maybe Later', 'simplesocialbuttons' ) ?></a></li>
766
+ <li><a href="<?php echo $dismiss_url ?>"><span class="dashicons dashicons-dismiss"></span><?php _e( 'Never show again', 'simplesocialbuttons' ) ?></a></li></ul>
767
+ </div>
768
+ </div>
769
+ <?php
770
+ }
771
+
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
+
779
+ // delete_site_option( 'ssb_review_dismiss' );
780
+ if ( ! is_admin() ||
781
+ ! current_user_can( 'manage_options' ) ||
782
+ ! isset( $_GET['_wpnonce'] ) ||
783
+ ! wp_verify_nonce( sanitize_key( wp_unslash( $_GET['_wpnonce'] ) ), 'ssb-review-nonce' ) ||
784
+ ! isset( $_GET['ssb_review_later'] ) ) {
785
+
786
+ return;
787
+ }
788
+
789
+ // Reset Time to current time.
790
+ update_site_option( 'ssb_active_time', time() );
791
+
792
+ }
793
+
794
+ /**
795
+ * Check and Dismiss review message.
796
+ *
797
+ * @since 1.8.2
798
+ */
799
+ private function review_dismissal() {
800
+
801
+ //delete_site_option( 'ssb_review_dismiss' );
802
+ if ( ! is_admin() ||
803
+ ! current_user_can( 'manage_options' ) ||
804
+ ! isset( $_GET['_wpnonce'] ) ||
805
+ ! wp_verify_nonce( sanitize_key( wp_unslash( $_GET['_wpnonce'] ) ), 'ssb-review-nonce' ) ||
806
+ ! isset( $_GET['ssb_review_dismiss'] ) ) {
807
+
808
+ return;
809
+ }
810
+
811
+ add_site_option( 'ssb_review_dismiss', 'yes' );
812
+ }
813
 
814
  } // end SimpleSocialButtonsPR_Admin
815
 
ssb-admin.php CHANGED
@@ -281,7 +281,7 @@ extract( $settings, EXTR_PREFIX_ALL, 'ssb' );
281
  </li>
282
 
283
  <li>
284
- <a href="https://wordpress.org/plugins/simple-social-buttons/?filter=5" class="button wordpress" target="_blank" title="Rate on Wordpress.org">Rate on Wordpress.org<span class="dashicons dashicons-wordpress"></span>
285
  </a>
286
  </li>
287
  </ul>
281
  </li>
282
 
283
  <li>
284
+ <a href="https://wordpress.org/plugins/simple-social-buttons/?filter=5" class="button wordpress" target="_blank" title="Rate on WordPress.org">Rate on WordPress.org<span class="dashicons dashicons-wordpress"></span>
285
  </a>
286
  </li>
287
  </ul>