Social Media Feather | social media sharing - Version 1.8.4

Version Description

  • Added option to decline terms of service after having accepted
Download this release

Release Info

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

Code changes from version 1.8.2 to 1.8.4

readme.txt CHANGED
@@ -3,7 +3,7 @@ Contributors: socialmediafeather
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: 4.7
6
- Stable tag: trunk
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
@@ -191,6 +191,12 @@ margin-left: 10px;
191
 
192
  == Changelog ==
193
 
 
 
 
 
 
 
194
  = 1.8.2 =
195
  * NEW: 6 icon styles which were previously available as a $15 add on are now included for FREE!
196
  * Removed NEWS dashboard widget
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: 4.7
6
+ Stable tag: 1.8.4
7
  License: GPLv2
8
  License URI: http://www.gnu.org/licenses/gpl-2.0.html
9
 
191
 
192
  == Changelog ==
193
 
194
+ = 1.8.4 =
195
+ * Added option to decline terms of service after having accepted
196
+
197
+ = 1.8.3 =
198
+ * Minor design improvements
199
+
200
  = 1.8.2 =
201
  * NEW: 6 icon styles which were previously available as a $15 add on are now included for FREE!
202
  * Removed NEWS dashboard widget
social-media-feather.php CHANGED
@@ -4,11 +4,11 @@ Plugin Name: Social Media Feather
4
  Plugin URI: http://socialmediafeather.com/
5
  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
6
  Author: socialmediafeather
7
- Version: 1.8.2
8
  Author URI: http://socialmediafeather.com/
9
  */
10
 
11
- define( 'SYNVED_VERSION', '1.8.2' );
12
 
13
  if (!function_exists('synved_wp_social_load'))
14
  {
4
  Plugin URI: http://socialmediafeather.com/
5
  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
6
  Author: socialmediafeather
7
+ Version: 1.8.4
8
  Author URI: http://socialmediafeather.com/
9
  */
10
 
11
+ define( 'SYNVED_VERSION', '1.8.4' );
12
 
13
  if (!function_exists('synved_wp_social_load'))
14
  {
synved-connect/style/admin.css CHANGED
@@ -18,3 +18,61 @@ background-color:#d2e8d4;
18
  .synved-connect-notice .notice-secondary a.rsswidget {
19
  font-size: 11px;
20
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
18
  .synved-connect-notice .notice-secondary a.rsswidget {
19
  font-size: 11px;
20
  }
21
+
22
+
23
+ .synved-switch {
24
+ position: relative;
25
+ display: inline-block;
26
+ width: 42px;
27
+ height: 14px;
28
+ }
29
+
30
+ .synved-switch input {display:none;}
31
+
32
+ .synved-slider {
33
+ position: absolute;
34
+ cursor: pointer;
35
+ top: 0;
36
+ left: 0;
37
+ right: 0;
38
+ bottom: 0;
39
+ background-color: #ccc;
40
+ -webkit-transition: .1s;
41
+ transition: .1s;
42
+ }
43
+
44
+ .synved-slider:before {
45
+ position: absolute;
46
+ content: "";
47
+ height: 20px;
48
+ width: 20px;
49
+ left: 0px;
50
+ bottom: -4px;
51
+ border:solid 1px gray;
52
+ background-color: white;
53
+ -webkit-transition: .1s;
54
+ transition: .1s;
55
+ }
56
+
57
+ input:checked + .synved-slider {
58
+ background-color: #0085ba;
59
+ }
60
+
61
+ input:focus + .synved-slider {
62
+ box-shadow: 0 0 1px #2196F3;
63
+ }
64
+
65
+ input:checked + .synved-slider:before {
66
+ -webkit-transform: translateX(20px);
67
+ -ms-transform: translateX(20px);
68
+ transform: translateX(20px);
69
+ }
70
+
71
+ /* Rounded sliders */
72
+ .synved-slider.round {
73
+ border-radius: 34px;
74
+ }
75
+
76
+ .synved-slider.round:before {
77
+ border-radius: 50%;
78
+ }
synved-connect/style/synved_old_wp_support.css ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ .notice {
2
+ background: #fff none repeat scroll 0 0;
3
+ border-left: 4px solid #fff;
4
+ box-shadow: 0 1px 1px 0 rgba(0, 0, 0, 0.1);
5
+ margin: 5px 10px 15px 2px;
6
+ padding: 1px 12px;
7
+ }
8
+
9
+ .notice-warning {
10
+ border-left-color: #ffb900;
11
+ }
12
+
13
+ .notice-success {
14
+ border-left-color: #46b450;
15
+ }
16
+
17
+ .notice-error {
18
+ border-left-color: #dc3232;
19
+ }
20
+
21
+ .notice p {
22
+ margin: 0.5em 0;
23
+ padding: 2px;
24
+ }
synved-connect/synved-connect-support.php CHANGED
@@ -3,56 +3,55 @@
3
  function synved_connect_support_social_follow_render()
4
  {
5
  $uri = synved_connect_path_uri();
6
-
7
  $out = null;
8
-
9
- $out .= '<div class="synved-connect-notice" style="position:fixed; right:30px; top:60px; width:220px; background:#ececec; font-size:110%; color:#444; padding:16px 18px 16px 18px;">';
10
-
11
  // $out .= '<a href="#" style="font-size:8px; position:absolute; top:0px; right:0px; margin-right: 5px;" onclick="' . esc_attr('jQuery(this).parents(\'.synved-connect-notice\').find(\'.notice-extra\').slideToggle(\'slow\'); return false;') . '">' . __('toggle', 'synved-connect') . '</a>';
12
 
13
  $out .= '<div class="notice-extra notice-secondary" style="border:dotted 1px #bbb;">';
14
  $out .= '<div class="sponsor-holder sponsor-type-extern">Your great site deserves a great look, make it shine with <a class="synved-connect-link" href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=37330" target="_blank" title="many themes for the price of one">a new sexy theme</a>!</div>';
15
  $out .= '</div>';
16
-
17
  // $out .= '<div style="padding:8px 10px; border:dotted 1px #bbb;">';
18
  // $out .= '<a style="display:block; line-height:32px; height:32px;" target="_blank" href="https://twitter.com/synved" title="' . __('Follow Us on Twitter!', 'synved-connect') . '"><img style="vertical-align:middle;" alt="twitter" src="' . esc_url($uri . '/image/twitter.png') . '" /><span style="line-height:normal; margin-left:8px;">' . __('Follow Us on Twitter!', 'synved-connect') . '</span></a><div style="font-size:75%; color:#888; line-height:normal; text-align:center; margin-top:5px;">' . __('We only tweet relevant updates!', 'synved-connect') . '</div>';
19
  // $out .= '</div>';
20
- //
21
  // $out .= '<div class="notice-extra" style="margin:8px 0 0 0; padding:8px 10px; border:dotted 1px #bbb;">';
22
  // $out .= '<a style="display:block; line-height:32px; height:32px;" target="_blank" href="http://synved.com/about/contact/?subject=Quote%20Request" title="' . __('Hire Us!', 'synved-connect') . '"><img style="vertical-align:middle;" alt="hire_us" src="' . esc_url($uri . '/image/hire.png') . '" /><span style="line-height:normal; margin-left:8px;">' . __('Hire Us!', 'synved-connect') . '</span></a><div style="font-size:75%; color:#888; line-height:normal; text-align:center; margin-top:5px;">' . __('For any WordPress development', 'synved-connect') . '</div>';
23
  // $out .= '</div>';
24
- //
25
  // $out .= '<div class="notice-extra notice-secondary">';
26
  // $out .= '<h4 style="margin:10px 0 -10px 0; padding:0;">News</h4>';
27
  // ob_start();
28
  // wp_widget_rss_output('http://feeds.feedburner.com/SynvedNews?format=xml', array('items' => 4, 'show_author' => 0, 'show_date' => 0, 'show_summary' => 0));
29
  // $out .= ob_get_clean();
30
  // $out .= '</div>';
31
- //
32
  // $sponsor_item = synved_connect_sponsor_item_pick(array('type' => 'intern|extern'));
33
- //
34
  // if ($sponsor_item != null)
35
  // {
36
  // $out .= '<div class="notice-extra notice-secondary" style="margin:10px 0 0 0; border:dotted 1px #bbb;">';
37
  // $out .= synved_connect_sponsor_content($sponsor_item);
38
  // $out .= '</div>';
39
  // }
40
-
41
  $out .= '</div>';
42
-
43
  return $out;
44
  }
45
 
46
  function synved_connect_support_social_follow_render_small()
47
  {
48
  $uri = synved_connect_path_uri();
49
-
50
  $out = null;
51
-
52
  $out .= '<span>';
53
  $out .= '<a target="_blank" href="https://twitter.com/synved" title="' . __('Follow Us on Twitter!', 'synved-connect') . '"><img alt="twitter" style="vertical-align:middle;" src="' . esc_url($uri . '/image/small/twitter.png') . '"></a></div>';
54
  $out .= '</span>';
55
-
56
  return $out;
57
  }
58
-
3
  function synved_connect_support_social_follow_render()
4
  {
5
  $uri = synved_connect_path_uri();
6
+
7
  $out = null;
8
+
9
+ $out .= '<div class="synved-connect-notice" style="position:fixed; right:30px; bottom:35px; width:220px; background:#ececec; font-size:110%; color:#444;">';
10
+
11
  // $out .= '<a href="#" style="font-size:8px; position:absolute; top:0px; right:0px; margin-right: 5px;" onclick="' . esc_attr('jQuery(this).parents(\'.synved-connect-notice\').find(\'.notice-extra\').slideToggle(\'slow\'); return false;') . '">' . __('toggle', 'synved-connect') . '</a>';
12
 
13
  $out .= '<div class="notice-extra notice-secondary" style="border:dotted 1px #bbb;">';
14
  $out .= '<div class="sponsor-holder sponsor-type-extern">Your great site deserves a great look, make it shine with <a class="synved-connect-link" href="http://www.elegantthemes.com/affiliates/idevaffiliate.php?id=37330" target="_blank" title="many themes for the price of one">a new sexy theme</a>!</div>';
15
  $out .= '</div>';
16
+
17
  // $out .= '<div style="padding:8px 10px; border:dotted 1px #bbb;">';
18
  // $out .= '<a style="display:block; line-height:32px; height:32px;" target="_blank" href="https://twitter.com/synved" title="' . __('Follow Us on Twitter!', 'synved-connect') . '"><img style="vertical-align:middle;" alt="twitter" src="' . esc_url($uri . '/image/twitter.png') . '" /><span style="line-height:normal; margin-left:8px;">' . __('Follow Us on Twitter!', 'synved-connect') . '</span></a><div style="font-size:75%; color:#888; line-height:normal; text-align:center; margin-top:5px;">' . __('We only tweet relevant updates!', 'synved-connect') . '</div>';
19
  // $out .= '</div>';
20
+ //
21
  // $out .= '<div class="notice-extra" style="margin:8px 0 0 0; padding:8px 10px; border:dotted 1px #bbb;">';
22
  // $out .= '<a style="display:block; line-height:32px; height:32px;" target="_blank" href="http://synved.com/about/contact/?subject=Quote%20Request" title="' . __('Hire Us!', 'synved-connect') . '"><img style="vertical-align:middle;" alt="hire_us" src="' . esc_url($uri . '/image/hire.png') . '" /><span style="line-height:normal; margin-left:8px;">' . __('Hire Us!', 'synved-connect') . '</span></a><div style="font-size:75%; color:#888; line-height:normal; text-align:center; margin-top:5px;">' . __('For any WordPress development', 'synved-connect') . '</div>';
23
  // $out .= '</div>';
24
+ //
25
  // $out .= '<div class="notice-extra notice-secondary">';
26
  // $out .= '<h4 style="margin:10px 0 -10px 0; padding:0;">News</h4>';
27
  // ob_start();
28
  // wp_widget_rss_output('http://feeds.feedburner.com/SynvedNews?format=xml', array('items' => 4, 'show_author' => 0, 'show_date' => 0, 'show_summary' => 0));
29
  // $out .= ob_get_clean();
30
  // $out .= '</div>';
31
+ //
32
  // $sponsor_item = synved_connect_sponsor_item_pick(array('type' => 'intern|extern'));
33
+ //
34
  // if ($sponsor_item != null)
35
  // {
36
  // $out .= '<div class="notice-extra notice-secondary" style="margin:10px 0 0 0; border:dotted 1px #bbb;">';
37
  // $out .= synved_connect_sponsor_content($sponsor_item);
38
  // $out .= '</div>';
39
  // }
40
+
41
  $out .= '</div>';
42
+
43
  return $out;
44
  }
45
 
46
  function synved_connect_support_social_follow_render_small()
47
  {
48
  $uri = synved_connect_path_uri();
49
+
50
  $out = null;
51
+
52
  $out .= '<span>';
53
  $out .= '<a target="_blank" href="https://twitter.com/synved" title="' . __('Follow Us on Twitter!', 'synved-connect') . '"><img alt="twitter" style="vertical-align:middle;" src="' . esc_url($uri . '/image/small/twitter.png') . '"></a></div>';
54
  $out .= '</span>';
55
+
56
  return $out;
57
  }
 
synved-connect/synved-connect.php CHANGED
@@ -26,6 +26,7 @@ include_once(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'synved-connect-sponsor.p
26
  define('SYNVED_CONNECT_LOADED', true);
27
  define('SYNVED_CONNECT_VERSION', 100000004);
28
  define('SYNVED_CONNECT_VERSION_STRING', '1.0.4');
 
29
 
30
 
31
  $synved_connect = array();
@@ -136,13 +137,23 @@ function synved_connect_enqueue_scripts()
136
  wp_register_style('synved-connect-admin', $uri . '/style/admin.css', false, '1.0');
137
 
138
  wp_enqueue_style('synved-connect-admin');
 
 
 
 
 
 
139
  }
140
 
141
  function synved_connect_init() {
142
  $install_date = get_option( 'synved_connect_install_date' );
143
 
 
144
  if ( ! $install_date ) {
145
  update_option( 'synved_connect_install_date', time() );
 
 
 
146
  }
147
 
148
  $version = get_option( 'synved_version' );
@@ -158,11 +169,12 @@ function synved_connect_init() {
158
  */
159
  function synved_connect_upgrade( $version ) {
160
  // Show the ShareThis notice on version upgrade.
 
161
  synved_option_set( 'synved_social', 'hide_sharethis_terms', false );
162
 
163
  // Saves the new option in the DB.
164
  update_option( 'synved_version', SYNVED_VERSION );
165
  }
166
 
167
- add_action( 'init', 'synved_connect_init' );
168
  add_action( 'admin_enqueue_scripts', 'synved_connect_enqueue_scripts' );
26
  define('SYNVED_CONNECT_LOADED', true);
27
  define('SYNVED_CONNECT_VERSION', 100000004);
28
  define('SYNVED_CONNECT_VERSION_STRING', '1.0.4');
29
+ define('SYNVED_WP_MODERN_VERSION', '4.1');
30
 
31
 
32
  $synved_connect = array();
137
  wp_register_style('synved-connect-admin', $uri . '/style/admin.css', false, '1.0');
138
 
139
  wp_enqueue_style('synved-connect-admin');
140
+
141
+ if ( version_compare( get_bloginfo( 'version' ), SYNVED_WP_MODERN_VERSION, 'lt' ) ) {
142
+ wp_register_style( 'synved-connect-old-wp-support-css', $uri . '/style/synved_old_wp_support.css', false,
143
+ null, 'all' );
144
+ wp_enqueue_style( 'synved-connect-old-wp-support-css' );
145
+ }
146
  }
147
 
148
  function synved_connect_init() {
149
  $install_date = get_option( 'synved_connect_install_date' );
150
 
151
+ // Fresh install.
152
  if ( ! $install_date ) {
153
  update_option( 'synved_connect_install_date', time() );
154
+ update_option( 'synved_version', SYNVED_VERSION );
155
+ synved_option_set( 'synved_social', 'accepted_sharethis_terms', false );
156
+
157
  }
158
 
159
  $version = get_option( 'synved_version' );
169
  */
170
  function synved_connect_upgrade( $version ) {
171
  // Show the ShareThis notice on version upgrade.
172
+ synved_option_set( 'synved_social', 'accepted_sharethis_terms', false );
173
  synved_option_set( 'synved_social', 'hide_sharethis_terms', false );
174
 
175
  // Saves the new option in the DB.
176
  update_option( 'synved_version', SYNVED_VERSION );
177
  }
178
 
179
+ add_action( 'init', 'synved_connect_init', 9 );
180
  add_action( 'admin_enqueue_scripts', 'synved_connect_enqueue_scripts' );
synved-option/farbtastic/marker.png CHANGED
File without changes
synved-option/script/custom.js CHANGED
@@ -117,3 +117,40 @@ jQuery(document).ready(function() {
117
  });
118
  });
119
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
117
  });
118
  });
119
 
120
+
121
+ (function ($) {
122
+ /**
123
+ * Handles "disable all features" switch button
124
+ * @type {{init: synved_switcher.init}}
125
+ */
126
+ synved_switcher = {
127
+ init: function (state) {
128
+ var checkbox = $("#synved-disable");
129
+
130
+ if (state) {
131
+ checkbox.prop('checked', 'checked');
132
+ } else {
133
+ checkbox.removeProp('checked');
134
+ }
135
+
136
+ $("#synved-slider").on("click", function (e) {
137
+
138
+ checkbox = $("#synved-disable");
139
+ if (checkbox[0].checked) {
140
+ if (confirm('This will decline ShareThis Terms of Service, please confirm.')) {
141
+ window.location.href = SYNVED_DISABLE_FEATURE_URL;
142
+ } else {
143
+ var int = setInterval(function(){
144
+ if (!checkbox[0].checked) {
145
+ checkbox[0].checked = true;
146
+ clearInterval(int);
147
+ }
148
+ }, 10);
149
+ }
150
+ } else { // disable
151
+ window.location.href = SYNVED_ENABLE_FEATURE_URL;
152
+ }
153
+ });
154
+ }
155
+ };
156
+ })(jQuery);
synved-option/synved-option-item.php CHANGED
@@ -722,7 +722,7 @@ function synved_option_item_sanitize_value($id, $name, $value, array $item = nul
722
  {
723
  $item = synved_option_item($id, $name);
724
  }
725
-
726
  if ($item == null)
727
  {
728
  return null;
@@ -741,7 +741,7 @@ function synved_option_item_sanitize_value($id, $name, $value, array $item = nul
741
 
742
  $value = synved_option_item_sanitize_value_basic($item, $value, $default);
743
  $is_valid = true;
744
-
745
  if ($set != null)
746
  {
747
  if (is_array($value))
@@ -771,7 +771,7 @@ function synved_option_item_sanitize_value($id, $name, $value, array $item = nul
771
  }
772
  }
773
  }
774
-
775
  if ($is_valid)
776
  {
777
  if ($sanitize != null)
722
  {
723
  $item = synved_option_item($id, $name);
724
  }
725
+
726
  if ($item == null)
727
  {
728
  return null;
741
 
742
  $value = synved_option_item_sanitize_value_basic($item, $value, $default);
743
  $is_valid = true;
744
+
745
  if ($set != null)
746
  {
747
  if (is_array($value))
771
  }
772
  }
773
  }
774
+
775
  if ($is_valid)
776
  {
777
  if ($sanitize != null)
synved-option/synved-option-page.php CHANGED
@@ -130,6 +130,16 @@ function synved_option_page_cb($id, $name, $item)
130
  </p>
131
  </form>
132
  </div>
 
 
 
 
 
 
 
 
 
 
133
  <?php
134
  }
135
 
130
  </p>
131
  </form>
132
  </div>
133
+
134
+ <script type="text/javascript">
135
+ const SYNVED_DISABLE_FEATURE_URL = '<?php echo admin_url('options-general.php?page=synved_social_settings&accept-terms=no'); ?>';
136
+ const SYNVED_ENABLE_FEATURE_URL = '<?php echo admin_url('options-general.php?page=synved_social_settings&accept-terms=yes'); ?>';
137
+
138
+ jQuery(document).ready(function () {
139
+ synved_switcher.init(<?php echo synved_option_get('synved_social', 'accepted_sharethis_terms'); ?>);
140
+ });
141
+ </script>
142
+
143
  <?php
144
  }
145
 
synved-option/synved-option.php CHANGED
@@ -326,7 +326,7 @@ function synved_option_item_list($id)
326
 
327
  if (isset($synved_option_list[$id]))
328
  {
329
- $list = $synved_option_list[$id]['items'];
330
 
331
  if ($list == null)
332
  {
@@ -346,22 +346,22 @@ function synved_option_prepare_list($id)
346
 
347
  if (isset($synved_option_list[$id]))
348
  {
349
- $options = $synved_option_list[$id]['options'];
350
  $options = apply_filters('synved_option_init_list', $options, $id);
351
  $options = apply_filters('synved_option_init_list_' . $id, $options, $id);
352
-
353
  $final_list = array();
354
  $default_page = null;
355
  $default_section = null;
356
-
357
  foreach ($options as $name => $item)
358
  {
359
  $type = synved_option_item_type($item);
360
-
361
  if ($type == 'options-page')
362
  {
363
  $item = synved_option_prepare_list_item($id, null, null, $name, $item);
364
-
365
  if ($item != null)
366
  {
367
  $final_list[$name] = $item;
@@ -373,14 +373,14 @@ function synved_option_prepare_list($id)
373
  {
374
  $default_page = synved_option_page_default($id);
375
  $default_page = synved_option_prepare_list_item($id, null, null, $default_page['name'], $default_page);
376
-
377
  $final_list[$default_page['name']] = &$default_page;
378
  }
379
-
380
  if ($type == 'options-section')
381
  {
382
  $item = synved_option_prepare_list_item($id, $default_page['name'], null, $name, $item);
383
-
384
  if ($item != null)
385
  {
386
  $default_page['sections'][$name] = $item;
@@ -392,15 +392,15 @@ function synved_option_prepare_list($id)
392
  {
393
  $default_section = synved_option_section_default($id, $default_page['name']);
394
  $default_section = synved_option_prepare_list_item($id, $default_page['name'], null, $default_section['name'], $default_section);
395
-
396
  $default_page['sections'][$default_section['name']] = &$default_section;
397
  }
398
-
399
  $default_section['settings'][$name] = $item;
400
  }
401
  }
402
  }
403
-
404
  if ($default_page != null)
405
  {
406
  $item = $default_page;
@@ -530,8 +530,8 @@ function synved_option_set($id, $name, $value)
530
 
531
  $options_name = synved_option_name_default($id);
532
  $options = get_option($options_name);
 
533
  $options[$name] = synved_option_item_sanitize_value($id, $name, $value);
534
-
535
  update_option($options_name, $options);
536
 
537
  unset($synved_option_list[$id]['values']);
326
 
327
  if (isset($synved_option_list[$id]))
328
  {
329
+ $list = !empty($synved_option_list[$id]['items'])?$synved_option_list[$id]['items']:null;
330
 
331
  if ($list == null)
332
  {
346
 
347
  if (isset($synved_option_list[$id]))
348
  {
349
+ $options = !empty($synved_option_list[$id]['options'])?$synved_option_list[$id]['options']:array();
350
  $options = apply_filters('synved_option_init_list', $options, $id);
351
  $options = apply_filters('synved_option_init_list_' . $id, $options, $id);
352
+
353
  $final_list = array();
354
  $default_page = null;
355
  $default_section = null;
356
+
357
  foreach ($options as $name => $item)
358
  {
359
  $type = synved_option_item_type($item);
360
+
361
  if ($type == 'options-page')
362
  {
363
  $item = synved_option_prepare_list_item($id, null, null, $name, $item);
364
+
365
  if ($item != null)
366
  {
367
  $final_list[$name] = $item;
373
  {
374
  $default_page = synved_option_page_default($id);
375
  $default_page = synved_option_prepare_list_item($id, null, null, $default_page['name'], $default_page);
376
+
377
  $final_list[$default_page['name']] = &$default_page;
378
  }
379
+
380
  if ($type == 'options-section')
381
  {
382
  $item = synved_option_prepare_list_item($id, $default_page['name'], null, $name, $item);
383
+
384
  if ($item != null)
385
  {
386
  $default_page['sections'][$name] = $item;
392
  {
393
  $default_section = synved_option_section_default($id, $default_page['name']);
394
  $default_section = synved_option_prepare_list_item($id, $default_page['name'], null, $default_section['name'], $default_section);
395
+
396
  $default_page['sections'][$default_section['name']] = &$default_section;
397
  }
398
+
399
  $default_section['settings'][$name] = $item;
400
  }
401
  }
402
  }
403
+
404
  if ($default_page != null)
405
  {
406
  $item = $default_page;
530
 
531
  $options_name = synved_option_name_default($id);
532
  $options = get_option($options_name);
533
+
534
  $options[$name] = synved_option_item_sanitize_value($id, $name, $value);
 
535
  update_option($options_name, $options);
536
 
537
  unset($synved_option_list[$id]['values']);
synved-social/synved-social-setup.php CHANGED
@@ -106,7 +106,9 @@ function synved_social_provider_settings()
106
  return $providers_settings;
107
  }
108
 
109
- $synved_social_options = array(
 
 
110
  'settings' => array(
111
  'label' => 'Social Media',
112
  'title' => 'Social Media Feather',
@@ -142,11 +144,11 @@ $synved_social_options = array(
142
  'default' => __('Hey check this out', 'social-media-feather'), 'label' => __('Default Message', 'social-media-feather'),
143
  'tip' => __('Specify the default message to use when sharing content, this is what gets replaced into the %%message%% variable', 'social-media-feather')
144
  ),
145
- 'accepted_sharethis_terms' => array(
146
- 'default' => false, 'label' => __('Extra Features', 'social-media-feather'),
147
- 'tip' => __('Allows extra social features provided using JavaScript by accepting <a href="http://socialmediafeather.com/privacy">the terms</a>.', 'social-media-feather'),
148
- 'hidden' => true
149
- ),
150
  'hide_sharethis_terms' => array(
151
  'default' => false, 'label' => __('Hide Extra Features Prompt', 'social-media-feather'),
152
  'tip' => __('Don\'t prompt for extra features.', 'social-media-feather'),
@@ -156,8 +158,15 @@ $synved_social_options = array(
156
  'default' => '',
157
  'label' => __( 'Facebook App ID', 'social-media-feather' ),
158
  ),
 
 
 
 
 
 
159
  )
160
  ),
 
161
  'section_automatic_display' => array(
162
  'label' => __('Automatic Display', 'social-media-feather'),
163
  'tip' => __('Settings affecting automating appending of social buttons to post contents', 'social-media-feather'),
@@ -341,6 +350,17 @@ synved_option_register('synved_social', $synved_social_options);
341
  synved_option_include_module_addon_list('synved-social');
342
 
343
 
 
 
 
 
 
 
 
 
 
 
 
344
  function synved_social_provider_option_value_sanitize($value, $name, $id, $item)
345
  {
346
  $default = synved_option_item_default($item);
@@ -353,30 +373,30 @@ function synved_social_provider_option_value_sanitize($value, $name, $id, $item)
353
 
354
  function synved_social_page_settings_tip($tip, $item)
355
  {
356
- // if terms have just been accepted
357
- if (isset($_GET['accept-terms']) && $_GET['accept-terms'] == "yes")
358
- {
359
- $tip .= '<div class="alert alert-success text-center">
 
 
 
360
  <p>Thank you, the update has been enabled!</p>
361
  </div>';
362
- }
363
- elseif (!synved_option_get('synved_social', 'accepted_sharethis_terms') && synved_option_get('synved_social', 'hide_sharethis_terms'))
364
- {
365
- $tip .= '<div class="notice notice-warning">
366
- <p>This update includes a host of new features, including FREE extra social share buttons and support for Facebook analytics, and requires an update to the <a href="http://socialmediafeather.com/privacy" target="_blank">privacy policy and terms of use</a> <a href="' . esc_url(add_query_arg( 'accept-terms', 'yes')) . '" class="button button-secondary">I accept</a></p>
367
- </div>';
368
- }
369
 
370
  // if (!function_exists('synved_shortcode_version'))
371
  // {
372
  // $tip .= ' <div style="background:#f2f2f2;font-size:110%;color:#444;margin-right:270px;padding:10px 15px;"><b>' . __('Note', 'social-media-feather') . '</b>: ' . sprintf(__('The Social Media Feather plugin is fully compatible with the free <a target="_blank" href="%1$s">WordPress Shortcodes</a> plugin! WordPress Shortcodes will simplify adding Social Media shortcodes to your posts and pages. You can install it using your <a href="%2$s">plugin installer</a>.', 'social-media-feather'), 'http://synved.com/wordpress-shortcodes/', add_query_arg(array('tab' => 'search', 's' => 'synved shortcodes'), admin_url('plugin-install.php'))) . '</div>';
373
  // }
374
 
375
- if (function_exists('synved_connect_support_social_follow_render'))
376
- {
377
- $tip .= synved_connect_support_social_follow_render();
378
  }
379
-
380
  return $tip;
381
  }
382
 
@@ -385,6 +405,7 @@ function synved_social_page_render_fragment($fragment, $out, $params)
385
  if ($fragment == 'page-submit-tail')
386
  {
387
  $out .= '<div style="clear:both; margin-top: -12px;"><a target="_blank" href="http://wordpress.org/support/view/plugin-reviews/social-media-feather?rate=5#postform" style="font-size:120%"><b>We need your help!</b> If you like the plugin, you can help us by leaving a 5-stars review! It only takes a minute and it\'s free!</a></div>';
 
388
  }
389
 
390
  return $out;
@@ -635,7 +656,7 @@ function synved_social_enqueue_scripts()
635
 
636
  //wp_enqueue_style('synved-social-style');
637
 
638
- if (synved_option_get('synved_social', 'accepted_sharethis_terms'))
639
  {
640
 
641
  if (is_ssl()) {
@@ -656,6 +677,13 @@ function synved_social_enqueue_scripts()
656
  }
657
  }
658
 
 
 
 
 
 
 
 
659
  function synved_social_print_styles()
660
  {
661
  echo "\r\n" . '<style type="text/css">';
@@ -958,20 +986,43 @@ function synved_social_wp_the_content($content, $id = null)
958
  return $content;
959
  }
960
 
961
- // Show ShareThis terms.
962
- function synved_social_sharethis_terms_notice()
 
 
 
 
 
 
 
963
  {
964
- ?>
965
- <div id="sharethis_terms_notice" class="notice-warning notice is-dismissible">
966
- <p>This update includes a host of new features, including FREE extra social share buttons and support for Facebook analytics, and requires an update to the <a href="http://socialmediafeather.com/privacy" target="_blank">privacy policy and terms of use</a>.
967
- <a href="<?php echo admin_url('options-general.php?page=synved_social_settings&accept-terms=yes'); ?>" class="button button-primary">I accept</a></p>
 
 
968
  </div>
969
- <script type="text/javascript">
970
- jQuery('#sharethis_terms_notice').on( 'click', '.notice-dismiss', function( event ) {
971
- jQuery.post( ajaxurl, { action: 'feather_hide_terms' } );
972
- });
973
- </script>
974
- <?php
 
 
 
 
 
 
 
 
 
 
 
 
 
 
975
  }
976
 
977
  // Hides the terms agreement at user's request.
@@ -1092,22 +1143,24 @@ function synved_social_init()
1092
  add_filter('the_content', 'synved_social_wp_the_content', 10, 2);
1093
  }
1094
 
1095
- $connect_date = get_option('synved_connect_install_date');
1096
-
1097
- if ($connect_date == false)
1098
- synved_option_set('synved_social', 'accepted_sharethis_terms', true);
1099
-
1100
  if (is_admin())
1101
  {
1102
  if (current_user_can('manage_options'))
1103
  {
1104
- if (isset($_GET['accept-terms']) && $_GET['accept-terms'] == "yes")
1105
- synved_option_set('synved_social', 'accepted_sharethis_terms', true);
 
 
 
1106
  }
1107
 
1108
- if (!synved_option_get('synved_social', 'accepted_sharethis_terms') && !synved_option_get('synved_social', 'hide_sharethis_terms'))
 
 
 
 
1109
  {
1110
- add_action('admin_notices', 'synved_social_sharethis_terms_notice');
1111
  add_action('wp_ajax_feather_hide_terms', 'synved_social_admin_hide_callback');
1112
  }
1113
  }
106
  return $providers_settings;
107
  }
108
 
109
+ $terms_accepted = synved_option_get('synved_social', 'accepted_sharethis_terms');
110
+
111
+ $synved_social_options = array(
112
  'settings' => array(
113
  'label' => 'Social Media',
114
  'title' => 'Social Media Feather',
144
  'default' => __('Hey check this out', 'social-media-feather'), 'label' => __('Default Message', 'social-media-feather'),
145
  'tip' => __('Specify the default message to use when sharing content, this is what gets replaced into the %%message%% variable', 'social-media-feather')
146
  ),
147
+ // 'accepted_sharethis_terms' => array(
148
+ // 'default' => false, 'label' => __('Extra Features', 'social-media-feather'),
149
+ // 'tip' => __('Allows extra social features provided using JavaScript by accepting <a href="http://socialmediafeather.com/privacy">the terms</a>.', 'social-media-feather'),
150
+ // 'hidden' => true
151
+ // ),
152
  'hide_sharethis_terms' => array(
153
  'default' => false, 'label' => __('Hide Extra Features Prompt', 'social-media-feather'),
154
  'tip' => __('Don\'t prompt for extra features.', 'social-media-feather'),
158
  'default' => '',
159
  'label' => __( 'Facebook App ID', 'social-media-feather' ),
160
  ),
161
+ 'accepted_sharethis_terms' => array(
162
+ 'type' => 'custom',
163
+ 'label' => __( 'Terms of Service', 'social-media-feather' ),
164
+ 'tip' => __( 'Accept or decline <a target="_blank" href="https://www.sharethis.com/terms/">ShareThis Terms of Service</a> and <a target="_blank" href="https://www.sharethis.com/privacy/">Privacy Notice</a>', 'social-media-feather' ),
165
+ 'render' => 'synved_social_accept_terms_switch'
166
+ ),
167
  )
168
  ),
169
+
170
  'section_automatic_display' => array(
171
  'label' => __('Automatic Display', 'social-media-feather'),
172
  'tip' => __('Settings affecting automating appending of social buttons to post contents', 'social-media-feather'),
350
  synved_option_include_module_addon_list('synved-social');
351
 
352
 
353
+ function synved_social_accept_terms_switch() {
354
+
355
+ $out = '<label class="synved-switch">
356
+ <input id="synved-disable" name="synved_social_settings[accepted_sharethis_terms]"
357
+ type="checkbox" value="'.(synved_social_are_terms_accepted()?1:0).'">
358
+ <div id="synved-slider" class="synved-slider round"></div>
359
+ </label>';
360
+
361
+ return $out;
362
+ }
363
+
364
  function synved_social_provider_option_value_sanitize($value, $name, $id, $item)
365
  {
366
  $default = synved_option_item_default($item);
373
 
374
  function synved_social_page_settings_tip($tip, $item)
375
  {
376
+ $tip = '';
377
+
378
+ if (preg_match( '/page=synved_social_settings/i', $_SERVER[ 'REQUEST_URI' ] )) {
379
+
380
+ // if terms have just been accepted
381
+ if ( isset( $_GET['accept-terms'] ) && $_GET['accept-terms'] == "yes" ) {
382
+ $tip .= '<div class="alert alert-success text-center">
383
  <p>Thank you, the update has been enabled!</p>
384
  </div>';
385
+ } elseif ( ! synved_option_get( 'synved_social',
386
+ 'accepted_sharethis_terms' )
387
+ ) {
388
+ $tip .= synved_social_sharethis_terms_notice( false, false );
389
+ }
 
 
390
 
391
  // if (!function_exists('synved_shortcode_version'))
392
  // {
393
  // $tip .= ' <div style="background:#f2f2f2;font-size:110%;color:#444;margin-right:270px;padding:10px 15px;"><b>' . __('Note', 'social-media-feather') . '</b>: ' . sprintf(__('The Social Media Feather plugin is fully compatible with the free <a target="_blank" href="%1$s">WordPress Shortcodes</a> plugin! WordPress Shortcodes will simplify adding Social Media shortcodes to your posts and pages. You can install it using your <a href="%2$s">plugin installer</a>.', 'social-media-feather'), 'http://synved.com/wordpress-shortcodes/', add_query_arg(array('tab' => 'search', 's' => 'synved shortcodes'), admin_url('plugin-install.php'))) . '</div>';
394
  // }
395
 
396
+ if ( function_exists( 'synved_connect_support_social_follow_render' ) ) {
397
+ $tip .= synved_connect_support_social_follow_render();
398
+ }
399
  }
 
400
  return $tip;
401
  }
402
 
405
  if ($fragment == 'page-submit-tail')
406
  {
407
  $out .= '<div style="clear:both; margin-top: -12px;"><a target="_blank" href="http://wordpress.org/support/view/plugin-reviews/social-media-feather?rate=5#postform" style="font-size:120%"><b>We need your help!</b> If you like the plugin, you can help us by leaving a 5-stars review! It only takes a minute and it\'s free!</a></div>';
408
+ $out .= '<p>By using this plugin you are agreeing to the <a href="http://socialmediafeather.com/privacy/">Terms of service and Privacy Policy</a>.</p>';
409
  }
410
 
411
  return $out;
656
 
657
  //wp_enqueue_style('synved-social-style');
658
 
659
+ if ( synved_social_are_terms_accepted() )
660
  {
661
 
662
  if (is_ssl()) {
677
  }
678
  }
679
 
680
+ /**
681
+ * @return bool
682
+ */
683
+ function synved_social_are_terms_accepted() {
684
+ return synved_option_get( 'synved_social', 'accepted_sharethis_terms' );
685
+ }
686
+
687
  function synved_social_print_styles()
688
  {
689
  echo "\r\n" . '<style type="text/css">';
986
  return $content;
987
  }
988
 
989
+ /**
990
+ * Renders ShareThis Terms of Service alert.
991
+ *
992
+ * @param bool $render_html
993
+ * @param bool $isDismissible
994
+ *
995
+ * @return string
996
+ */
997
+ function synved_social_sharethis_terms_notice($render_html = true, $isDismissible = true)
998
  {
999
+ $out = '<div id="sharethis_terms_notice" class="notice-warning notice '.(!empty($isDismissible)?'is-dismissible':'').'">
1000
+ <p>
1001
+ To get the most out of Social Media Feather and to help enable its continued development,
1002
+ please read the <a href="//sharethis.com/terms" target="_blank">ShareThis Terms of Service</a> and <a href="//sharethis.com/privacy" target="_blank">Privacy Notice</a>,
1003
+ then <a href="'.admin_url('options-general.php?page=synved_social_settings&accept-terms=yes').'">click here to accept the terms</a>.
1004
+ </p>
1005
  </div>
1006
+ <script language="JavaScript">
1007
+ jQuery(\'#sharethis_terms_notice\').on( \'click\', \'.notice-dismiss\', function( event ) {
1008
+ jQuery.post( ajaxurl, { action: \'feather_hide_terms\' } );
1009
+ });
1010
+ </script>
1011
+ ';
1012
+
1013
+ if ($render_html){
1014
+ echo $out;
1015
+ } else {
1016
+ return $out;
1017
+ }
1018
+
1019
+ }
1020
+
1021
+ /**
1022
+ * Wrapper to be able to call this method within parameters by add_action
1023
+ */
1024
+ function synved_social_sharethis_terms_notice_callback_admin_notice_wrapper() {
1025
+ synved_social_sharethis_terms_notice(true, true);
1026
  }
1027
 
1028
  // Hides the terms agreement at user's request.
1143
  add_filter('the_content', 'synved_social_wp_the_content', 10, 2);
1144
  }
1145
 
 
 
 
 
 
1146
  if (is_admin())
1147
  {
1148
  if (current_user_can('manage_options'))
1149
  {
1150
+ if (isset($_GET['accept-terms'])) {
1151
+ synved_option_set( 'synved_social', 'accepted_sharethis_terms',
1152
+ ($_GET['accept-terms'] == "yes" ? true : false) );
1153
+ wp_redirect(admin_url('options-general.php?page=synved_social_settings'));
1154
+ }
1155
  }
1156
 
1157
+ $canShowShareThisAlert = ! synved_option_get( 'synved_social',
1158
+ 'accepted_sharethis_terms' ) &&
1159
+ ! synved_option_get( 'synved_social', 'hide_sharethis_terms' ) &&
1160
+ ! preg_match( '/page=synved_social_settings/i', $_SERVER['REQUEST_URI'] );
1161
+ if ( $canShowShareThisAlert )
1162
  {
1163
+ add_action('admin_notices', 'synved_social_sharethis_terms_notice_callback_admin_notice_wrapper');
1164
  add_action('wp_ajax_feather_hide_terms', 'synved_social_admin_hide_callback');
1165
  }
1166
  }
uninstall.php ADDED
@@ -0,0 +1,17 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // if uninstall.php is not called by WordPress, die
3
+ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
4
+ die;
5
+ }
6
+
7
+ delete_option( 'synved_connect_install_date' );
8
+ delete_option( 'synved_version' );
9
+
10
+ delete_option( 'synved_connect_id_default' );
11
+
12
+ delete_option( 'widget_synved_social_share' );
13
+ delete_option( 'widget_synved_social_follow' );
14
+
15
+ delete_option( 'synved_option_wp_upgrade_addon_transfer' );
16
+
17
+ delete_option( 'synved_social_settings' );