Shariff Wrapper - Version 4.6.1

Version Description

  • replaced Stumbleupon with its successor Mix (thanks to Mark)
  • added an option to hide WhatsApp on desktop devices
  • updated Odnoklassniki API
  • fixed an issue with WPML and some older Shariff setups
Download this release

Release Info

Developer starguide
Plugin Icon 128x128 Shariff Wrapper
Version 4.6.1
Comparing to
See all releases

Code changes from version 4.6.0 to 4.6.1

admin/admin-menu.php CHANGED
@@ -12,7 +12,7 @@ if ( ! class_exists( 'WP' ) ) {
12
  }
13
 
14
  // Set services that have a share count API / backend.
15
- $shariff3uu_services_backend = array( 'facebook', 'twitter', 'pinterest', 'xing', 'reddit', 'stumbleupon', 'tumblr', 'vk', 'addthis', 'flattr', 'odnoklassniki' );
16
 
17
 
18
  // Adds the actions for the admin page.
@@ -374,6 +374,15 @@ function shariff3uu_options_init() {
374
  'shariff3uu_advanced_section'
375
  );
376
 
 
 
 
 
 
 
 
 
 
377
  // Shortcode priority.
378
  add_settings_field(
379
  'shariff3uu_number_shortcodeprio',
@@ -704,6 +713,9 @@ function shariff3uu_advanced_sanitize( $input ) {
704
  if ( isset( $input['default_pinterest'] ) ) {
705
  $valid['default_pinterest'] = sanitize_text_field( $input['default_pinterest'] );
706
  }
 
 
 
707
  if ( isset( $input['shortcodeprio'] ) ) {
708
  $valid['shortcodeprio'] = absint( $input['shortcodeprio'] );
709
  }
@@ -824,9 +836,9 @@ function shariff3uu_text_services_render() {
824
  $services = '';
825
  }
826
  echo '<input type="text" name="shariff3uu_basic[services]" value="' . esc_html( $services ) . '" size="90" placeholder="twitter|facebook|linkedin|info">';
827
- echo '<p><code>addthis|bitcoin|diaspora|facebook|flattr|flipboard|info|linkedin|mailto</code></p>';
828
  echo '<p><code>odnoklassniki|patreon|paypal|paypalme|pinterest|pocket|printer|qzone|reddit</code></p>';
829
- echo '<p><code>rss|sms|stumbleupon|telegram|tencentweibo|threema|tumblr|twitter|vk|wallabag|weibo</code></p>';
830
  echo '<p><code>whatsapp|xing</code></p>';
831
  echo '<p>' . esc_html__( 'Use the pipe sign | (Alt Gr + &lt; or &#8997; + 7) between two or more services.', 'shariff' ) . '</p>';
832
  }
@@ -1396,6 +1408,17 @@ function shariff3uu_text_default_pinterest_render() {
1396
  echo '<div><input type="text" name="shariff3uu_advanced[default_pinterest]" value="' . esc_url( $options['default_pinterest'] ) . '" id="shariff-image-url" class="regular-text"><input type="button" name="upload-btn" id="shariff-upload-btn" class="button-secondary" value="' . esc_html__( 'Choose image', 'shariff' ) . '"></div>';
1397
  }
1398
 
 
 
 
 
 
 
 
 
 
 
 
1399
  /**
1400
  * Shortcode Priority.
1401
  */
@@ -1710,7 +1733,7 @@ function shariff3uu_help_section_callback() {
1710
  // Services.
1711
  echo '<div style="display:table-row">';
1712
  echo '<div style="display:table-cell;border:1px solid;padding:10px">services</div>';
1713
- echo '<div style="display:table-cell;border:1px solid;padding:10px">addthis<br>bitcoin<br>diaspora<br>facebook<br>flattr<br>flipboard<br>info<br>linkedin<br>mailto<br>odnoklassniki<br>patreon<br>paypal<br>paypalme<br>pinterest<br>pocket<br>printer<br>qzone<br>reddit<br>rss<br>sms<br>stumbleupon<br>telegram<br>tencentweibo<br>threema<br>tumblr<br>twitter<br>vk<br>wallabag<br>weibo<br>whatsapp<br>xing</div>';
1714
  echo '<div style="display:table-cell;border:1px solid;padding:10px">twitter|facebook|linkedin|info</div>';
1715
  echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff services="facebook|twitter|mailto"]</div>';
1716
  echo '<div style="display:table-cell;border:1px solid;padding:10px">' . esc_html__( 'Determines which buttons to show and in which order.', 'shariff' ) . '</div>';
12
  }
13
 
14
  // Set services that have a share count API / backend.
15
+ $shariff3uu_services_backend = array( 'facebook', 'twitter', 'pinterest', 'xing', 'reddit', 'tumblr', 'vk', 'addthis', 'flattr', 'odnoklassniki' );
16
 
17
 
18
  // Adds the actions for the admin page.
374
  'shariff3uu_advanced_section'
375
  );
376
 
377
+ // Hide WhatsApp.
378
+ add_settings_field(
379
+ 'shariff3uu_checkbox_hide_whatsapp',
380
+ __( 'Hide WhatsApp on desktop devices.', 'shariff' ),
381
+ 'shariff3uu_checkbox_hide_whatsapp_render',
382
+ 'shariff3uu_advanced',
383
+ 'shariff3uu_advanced_section'
384
+ );
385
+
386
  // Shortcode priority.
387
  add_settings_field(
388
  'shariff3uu_number_shortcodeprio',
713
  if ( isset( $input['default_pinterest'] ) ) {
714
  $valid['default_pinterest'] = sanitize_text_field( $input['default_pinterest'] );
715
  }
716
+ if ( isset( $input['hide_whatsapp'] ) ) {
717
+ $valid['hide_whatsapp'] = absint( $input['hide_whatsapp'] );
718
+ }
719
  if ( isset( $input['shortcodeprio'] ) ) {
720
  $valid['shortcodeprio'] = absint( $input['shortcodeprio'] );
721
  }
836
  $services = '';
837
  }
838
  echo '<input type="text" name="shariff3uu_basic[services]" value="' . esc_html( $services ) . '" size="90" placeholder="twitter|facebook|linkedin|info">';
839
+ echo '<p><code>addthis|bitcoin|diaspora|facebook|flattr|flipboard|info|linkedin|mailto|mix</code></p>';
840
  echo '<p><code>odnoklassniki|patreon|paypal|paypalme|pinterest|pocket|printer|qzone|reddit</code></p>';
841
+ echo '<p><code>rss|sms|telegram|tencentweibo|threema|tumblr|twitter|vk|wallabag|weibo</code></p>';
842
  echo '<p><code>whatsapp|xing</code></p>';
843
  echo '<p>' . esc_html__( 'Use the pipe sign | (Alt Gr + &lt; or &#8997; + 7) between two or more services.', 'shariff' ) . '</p>';
844
  }
1408
  echo '<div><input type="text" name="shariff3uu_advanced[default_pinterest]" value="' . esc_url( $options['default_pinterest'] ) . '" id="shariff-image-url" class="regular-text"><input type="button" name="upload-btn" id="shariff-upload-btn" class="button-secondary" value="' . esc_html__( 'Choose image', 'shariff' ) . '"></div>';
1409
  }
1410
 
1411
+ /**
1412
+ * Hide WhatsApp on Desktop.
1413
+ */
1414
+ function shariff3uu_checkbox_hide_whatsapp_render() {
1415
+ echo '<input type="checkbox" name="shariff3uu_advanced[hide_whatsapp]" ';
1416
+ if ( isset( $GLOBALS['shariff3uu_advanced']['hide_whatsapp'] ) ) {
1417
+ echo checked( $GLOBALS['shariff3uu_advanced']['hide_whatsapp'], 1, 0 );
1418
+ }
1419
+ echo ' value="1">';
1420
+ }
1421
+
1422
  /**
1423
  * Shortcode Priority.
1424
  */
1733
  // Services.
1734
  echo '<div style="display:table-row">';
1735
  echo '<div style="display:table-cell;border:1px solid;padding:10px">services</div>';
1736
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">addthis<br>bitcoin<br>diaspora<br>facebook<br>flattr<br>flipboard<br>info<br>linkedin<br>mailto<br>mix<br>odnoklassniki<br>patreon<br>paypal<br>paypalme<br>pinterest<br>pocket<br>printer<br>qzone<br>reddit<br>rss<br>sms<br>telegram<br>tencentweibo<br>threema<br>tumblr<br>twitter<br>vk<br>wallabag<br>weibo<br>whatsapp<br>xing</div>';
1737
  echo '<div style="display:table-cell;border:1px solid;padding:10px">twitter|facebook|linkedin|info</div>';
1738
  echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff services="facebook|twitter|mailto"]</div>';
1739
  echo '<div style="display:table-cell;border:1px solid;padding:10px">' . esc_html__( 'Determines which buttons to show and in which order.', 'shariff' ) . '</div>';
changelog.txt CHANGED
@@ -2,6 +2,12 @@
2
 
3
  == Changelog ==
4
 
 
 
 
 
 
 
5
  = 4.6.0 =
6
  - new high contrast theme (WCAG)
7
  - improved support for WPML for easier translation of headlines and info button texts
2
 
3
  == Changelog ==
4
 
5
+ = 4.6.1 =
6
+ - replaced Stumbleupon with its successor Mix (thanks to Mark)
7
+ - added an option to hide WhatsApp on desktop devices
8
+ - updated Odnoklassniki API
9
+ - fixed an issue with WPML and some older Shariff setups
10
+
11
  = 4.6.0 =
12
  - new high contrast theme (WCAG)
13
  - improved support for WPML for easier translation of headlines and info button texts
readme.txt CHANGED
@@ -4,7 +4,7 @@ Tags: Shariff, GDPR, DSGVO, share buttons, sharing
4
  Requires at least: 4.9
5
  Requires PHP: 7.1
6
  Tested up to: 5.1
7
- Stable tag: 4.5.4
8
  License: MIT
9
  License URI: http://opensource.org/licenses/mit
10
 
@@ -152,6 +152,12 @@ These are bugs or unexpected glitches that we know of, but that do not have an i
152
 
153
  == Changelog ==
154
 
 
 
 
 
 
 
155
  = 4.6.0 =
156
  - new high contrast theme (WCAG)
157
  - improved support for WPML for easier translation of headlines and info button texts
4
  Requires at least: 4.9
5
  Requires PHP: 7.1
6
  Tested up to: 5.1
7
+ Stable tag: 4.6.1
8
  License: MIT
9
  License URI: http://opensource.org/licenses/mit
10
 
152
 
153
  == Changelog ==
154
 
155
+ = 4.6.1 =
156
+ - replaced Stumbleupon with its successor Mix (thanks to Mark)
157
+ - added an option to hide WhatsApp on desktop devices
158
+ - updated Odnoklassniki API
159
+ - fixed an issue with WPML and some older Shariff setups
160
+
161
  = 4.6.0 =
162
  - new high contrast theme (WCAG)
163
  - improved support for WPML for easier translation of headlines and info button texts
services/shariff-mix.php ADDED
@@ -0,0 +1,56 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ /**
3
+ * Will be included in the shariff.php only, when Mix is requested as a service.
4
+ *
5
+ * @package Shariff Wrapper
6
+ */
7
+
8
+ // Prevent direct calls.
9
+ if ( ! class_exists( 'WP' ) ) {
10
+ die();
11
+ }
12
+
13
+ // Check if we need the frontend or the backend part.
14
+ if ( isset( $frontend ) && 1 === $frontend ) {
15
+ // Service URL.
16
+ $service_url = esc_url( 'https://mix.com/add' );
17
+
18
+ // Build the button URL.
19
+ $button_url = $service_url . '?url=' . $share_url;
20
+
21
+ // Set the Colors (Hexadecimal including the #).
22
+ $main_color = '#ff8226';
23
+ $secondary_color = '#FFB27A';
24
+ $wcag_color = '#8F3C00';
25
+
26
+ // SVG icon.
27
+ $svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 448 512"><path fill="' . $main_color . '" d="M0 64v348.9c0 56.2 88 58.1 88 0V174.3c7.9-52.9 88-50.4 88 6.5v175.3c0 57.9 96 58 96 0V240c5.3-54.7 88-52.5 88 4.3v23.8c0 59.9 88 56.6 88 0V64H0z"/></svg>';
28
+
29
+ // Backend available?
30
+ $backend_available = 0;
31
+
32
+ // Button alt label.
33
+ $button_title_array = array(
34
+ 'bg' => 'Сподели във Mix',
35
+ 'cs' => 'Sdílet na Mix',
36
+ 'da' => 'Del på Mix',
37
+ 'de' => 'Bei Mix teilen',
38
+ 'en' => 'Share on Mix',
39
+ 'es' => 'Compartir en Mix',
40
+ 'fi' => 'Jaa Mixissa',
41
+ 'fr' => 'Partager sur Mix',
42
+ 'hr' => 'Podijelite na Mix',
43
+ 'hu' => 'Megosztás Mix',
44
+ 'it' => 'Condividi su Mix',
45
+ 'nl' => 'Delen op Mix',
46
+ 'no' => 'Del på Mix',
47
+ 'pl' => 'Udostępnij na Mix',
48
+ 'pt' => 'Compartilhar no Mix',
49
+ 'ro' => 'Partajează pe Mix',
50
+ 'ru' => 'Поделиться на Mix',
51
+ 'sk' => 'Zdieľať na Mix',
52
+ 'sl' => 'Deli na Mix',
53
+ 'sr' => 'Podeli na Mix',
54
+ 'sv' => 'Dela på Mix',
55
+ );
56
+ }
services/shariff-odnoklassniki.php CHANGED
@@ -13,10 +13,10 @@ if ( ! class_exists( 'WP' ) ) {
13
  // Check if we need the frontend or the backend part.
14
  if ( isset( $frontend ) && 1 === $frontend ) {
15
  // Service URL.
16
- $service_url = esc_url( 'https://www.odnoklassniki.ru/dk' );
17
 
18
  // Build button URL.
19
- $button_url = $service_url . '?st.cmd=addShare&st._surl=' . $share_url . '&title=' . $share_title;
20
 
21
  // Colors.
22
  $main_color = '#ee8208';
@@ -58,14 +58,14 @@ if ( isset( $frontend ) && 1 === $frontend ) {
58
  );
59
  } elseif ( isset( $backend ) && 1 === $backend ) {
60
  // Fetch share counts.
61
- $odnoklassniki = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://connect.ok.ru/dk?st.cmd=extLike&uid=odklcnt0&ref=' . $post_url ) ) );
62
 
63
- // Check results.
64
- preg_match( '/^ODKL\.updateCount\(\'odklcnt0\',\'(\d+)\'\);$/i', $odnoklassniki, $ok_shares );
65
 
66
  // Store results and record errors, if enabled (e.g. request from the status tab).
67
- if ( isset( $ok_shares ) && ! empty( $ok_shares ) ) {
68
- $share_counts['odnoklassniki'] = intval( $ok_shares[1] );
69
  } elseif ( isset( $record_errors ) && 1 === $record_errors ) {
70
  $service_errors['odnoklassniki'] = $odnoklassniki;
71
  }
13
  // Check if we need the frontend or the backend part.
14
  if ( isset( $frontend ) && 1 === $frontend ) {
15
  // Service URL.
16
+ $service_url = esc_url( 'https://connect.ok.ru/offer' );
17
 
18
  // Build button URL.
19
+ $button_url = $service_url . '?url=' . $share_url . '&title=' . $share_title;
20
 
21
  // Colors.
22
  $main_color = '#ee8208';
58
  );
59
  } elseif ( isset( $backend ) && 1 === $backend ) {
60
  // Fetch share counts.
61
+ $odnoklassniki = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://connect.ok.ru/dk?st.cmd=extLike&tp=json&ref=' . $post_url ) ) );
62
 
63
+ // Decode the json response.
64
+ $odnoklassniki_json = json_decode( $odnoklassniki, true );
65
 
66
  // Store results and record errors, if enabled (e.g. request from the status tab).
67
+ if ( isset( $odnoklassniki_json ) && ! empty( $odnoklassniki_json ) ) {
68
+ $share_counts['odnoklassniki'] = intval( $odnoklassniki_json['count'] );
69
  } elseif ( isset( $record_errors ) && 1 === $record_errors ) {
70
  $service_errors['odnoklassniki'] = $odnoklassniki;
71
  }
services/shariff-stumbleupon.php DELETED
@@ -1,75 +0,0 @@
1
- <?php
2
- /**
3
- * Will be included in the shariff.php only, when Stumbleupon is requested as a service.
4
- *
5
- * @package Shariff Wrapper
6
- */
7
-
8
- // Prevent direct calls.
9
- if ( ! class_exists( 'WP' ) ) {
10
- die();
11
- }
12
-
13
- // Check if we need the frontend or the backend part.
14
- if ( isset( $frontend ) && 1 === $frontend ) {
15
- // Service URL.
16
- $service_url = esc_url( 'https://www.stumbleupon.com/submit' );
17
-
18
- // Build button URL.
19
- $button_url = $service_url . '?url=' . $share_url;
20
-
21
- // Colors.
22
- $main_color = '#eb4b24';
23
- $secondary_color = '#e1370e';
24
- $wcag_color = '#A22D16';
25
-
26
- // SVG icon.
27
- $svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 37 32"><path fill="' . $main_color . '" d="M19 12.7v-2.1q0-0.7-0.5-1.3t-1.3-0.5-1.3 0.5-0.5 1.3v10.9q0 3.1-2.2 5.3t-5.4 2.2q-3.2 0-5.4-2.2t-2.2-5.4v-4.8h5.9v4.7q0 0.8 0.5 1.3t1.3 0.5 1.3-0.5 0.5-1.3v-11.1q0-3 2.2-5.2t5.4-2.1q3.1 0 5.4 2.2t2.3 5.2v2.4l-3.5 1zM28.4 16.7h5.9v4.8q0 3.2-2.2 5.4t-5.4 2.2-5.4-2.2-2.2-5.4v-4.8l2.3 1.1 3.5-1v4.8q0 0.7 0.5 1.3t1.3 0.5 1.3-0.5 0.5-1.3v-4.9z"/></svg>';
28
-
29
- // Backend available?
30
- $backend_available = 1;
31
-
32
- // Button alt label.
33
- $button_title_array = array(
34
- 'bg' => 'Сподели в Stumbleupon',
35
- 'cs' => 'Sdílet na Stumbleuponu',
36
- 'da' => 'Del på Stumbleupon',
37
- 'de' => 'Bei Stumbleupon teilen',
38
- 'en' => 'Share on Stumbleupon',
39
- 'es' => 'Compartir en Stumbleupon',
40
- 'fi' => 'Jaa Stumbleuponissä',
41
- 'fr' => 'Partager sur Stumbleupon',
42
- 'hr' => 'Podijelite na Stumbleupon',
43
- 'hu' => 'Megosztás Stumbleupon',
44
- 'it' => 'Condividi su Stumbleupon',
45
- 'ja' => 'Stumbleupon上で共有',
46
- 'ko' => 'Stumbleupon에서 공유하기',
47
- 'nl' => 'Delen op Stumbleupon',
48
- 'no' => 'Del på Stumbleupon',
49
- 'pl' => 'Udostępnij przez Stumbleupon',
50
- 'pt' => 'Compartilhar no Stumbleupon',
51
- 'ro' => 'Partajează pe Stumbleupon',
52
- 'ru' => 'Поделиться на Stumbleupon',
53
- 'sk' => 'Zdieľať na Stumbleupon',
54
- 'sl' => 'Deli na Stumbleupon',
55
- 'sr' => 'Podeli na Stumbleupon-u',
56
- 'sv' => 'Dela på Stumbleupon',
57
- 'tr' => 'Stumbleupon\'ta paylaş',
58
- 'zh' => '分享至Stumbleupon',
59
- );
60
- } elseif ( isset( $backend ) && 1 === $backend ) {
61
- // Fetch counts.
62
- $stumbleupon = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://www.stumbleupon.com/services/1.01/badge.getinfo?url=' . $post_url ) ) );
63
- $stumbleupon_json = json_decode( $stumbleupon, true );
64
-
65
- // Store results, if we have some and record errors, if enabled (e.g. request from the status tab).
66
- if ( isset( $stumbleupon_json['success'] ) && true === $stumbleupon_json['success'] ) {
67
- if ( isset( $stumbleupon_json['result']['views'] ) ) {
68
- $share_counts['stumbleupon'] = intval( $stumbleupon_json['result']['views'] );
69
- } else {
70
- $share_counts['stumbleupon'] = 0;
71
- }
72
- } elseif ( isset( $record_errors ) && 1 === $record_errors ) {
73
- $service_errors['stumbleupon'] = $stumbleupon;
74
- }
75
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
services/shariff-whatsapp.php CHANGED
@@ -27,7 +27,11 @@ if ( isset( $frontend ) && 1 === $frontend ) {
27
  $svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="' . $main_color . '" d="M17.6 17.4q0.2 0 1.7 0.8t1.6 0.9q0 0.1 0 0.3 0 0.6-0.3 1.4-0.3 0.7-1.3 1.2t-1.8 0.5q-1 0-3.4-1.1-1.7-0.8-3-2.1t-2.6-3.3q-1.3-1.9-1.3-3.5v-0.1q0.1-1.6 1.3-2.8 0.4-0.4 0.9-0.4 0.1 0 0.3 0t0.3 0q0.3 0 0.5 0.1t0.3 0.5q0.1 0.4 0.6 1.6t0.4 1.3q0 0.4-0.6 1t-0.6 0.8q0 0.1 0.1 0.3 0.6 1.3 1.8 2.4 1 0.9 2.7 1.8 0.2 0.1 0.4 0.1 0.3 0 1-0.9t0.9-0.9zM14 26.9q2.3 0 4.3-0.9t3.6-2.4 2.4-3.6 0.9-4.3-0.9-4.3-2.4-3.6-3.6-2.4-4.3-0.9-4.3 0.9-3.6 2.4-2.4 3.6-0.9 4.3q0 3.6 2.1 6.6l-1.4 4.2 4.3-1.4q2.8 1.9 6.2 1.9zM14 2.2q2.7 0 5.2 1.1t4.3 2.9 2.9 4.3 1.1 5.2-1.1 5.2-2.9 4.3-4.3 2.9-5.2 1.1q-3.5 0-6.5-1.7l-7.4 2.4 2.4-7.2q-1.9-3.2-1.9-6.9 0-2.7 1.1-5.2t2.9-4.3 4.3-2.9 5.2-1.1z"/></svg>';
28
 
29
  // Mobile only?
30
- $mobile_only = 0;
 
 
 
 
31
 
32
  // Button alt label.
33
  $button_title_array = array(
27
  $svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 32 32"><path fill="' . $main_color . '" d="M17.6 17.4q0.2 0 1.7 0.8t1.6 0.9q0 0.1 0 0.3 0 0.6-0.3 1.4-0.3 0.7-1.3 1.2t-1.8 0.5q-1 0-3.4-1.1-1.7-0.8-3-2.1t-2.6-3.3q-1.3-1.9-1.3-3.5v-0.1q0.1-1.6 1.3-2.8 0.4-0.4 0.9-0.4 0.1 0 0.3 0t0.3 0q0.3 0 0.5 0.1t0.3 0.5q0.1 0.4 0.6 1.6t0.4 1.3q0 0.4-0.6 1t-0.6 0.8q0 0.1 0.1 0.3 0.6 1.3 1.8 2.4 1 0.9 2.7 1.8 0.2 0.1 0.4 0.1 0.3 0 1-0.9t0.9-0.9zM14 26.9q2.3 0 4.3-0.9t3.6-2.4 2.4-3.6 0.9-4.3-0.9-4.3-2.4-3.6-3.6-2.4-4.3-0.9-4.3 0.9-3.6 2.4-2.4 3.6-0.9 4.3q0 3.6 2.1 6.6l-1.4 4.2 4.3-1.4q2.8 1.9 6.2 1.9zM14 2.2q2.7 0 5.2 1.1t4.3 2.9 2.9 4.3 1.1 5.2-1.1 5.2-2.9 4.3-4.3 2.9-5.2 1.1q-3.5 0-6.5-1.7l-7.4 2.4 2.4-7.2q-1.9-3.2-1.9-6.9 0-2.7 1.1-5.2t2.9-4.3 4.3-2.9 5.2-1.1z"/></svg>';
28
 
29
  // Mobile only?
30
+ if ( isset( $atts['hide_whatsapp'] ) && 1 === $atts['hide_whatsapp'] ) {
31
+ $mobile_only = 1;
32
+ } else {
33
+ $mobile_only = 0;
34
+ }
35
 
36
  // Button alt label.
37
  $button_title_array = array(
shariff.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Shariff Wrapper
4
  * Plugin URI: https://wordpress.org/plugins-wp/shariff/
5
  * Description: Shariff provides share buttons that respect the privacy of your visitors and follow the General Data Protection Regulation (GDPR).
6
- * Version: 4.6.0
7
  * Author: Jan-Peter Lambeck & 3UU
8
  * Author URI: https://wordpress.org/plugins/shariff/
9
  * License: MIT
@@ -33,7 +33,7 @@ $shariff3uu = array_merge( $shariff3uu_basic, $shariff3uu_design, $shariff3uu_ad
33
  */
34
  function shariff3uu_update() {
35
  // Adjust code version.
36
- $code_version = '4.6.0';
37
 
38
  // Get options.
39
  $shariff3uu = $GLOBALS['shariff3uu'];
@@ -56,7 +56,7 @@ function shariff3uu_privacy() {
56
 
57
  On our website we offer you the possibility to use so called "Social Media Buttons". To protect your data, we use a solution called "Shariff". Hereby the share buttons are implemented as static images, which contain a link to the corresponding social network site. If you click on such a button, you will be redirected to the respective social network site in the same way, as normal links would do as well. Only in that moment of time the provider of the social network site will get information about you, for example your IP address. If you do not click on such a share button, no data will be transmitted. Information about the collection and usage of your date on the social network sites can be found in the corresponding terms of use of the respective provider. More information about the plugin and the Shariff solution can be found here: <a href="https://wordpress.org/plugins/shariff/">https://wordpress.org/plugins/shariff/</a>
58
 
59
- On our website we offer share buttons for the following services / companies: AddThis, Diaspora, Facebook, Flattr, Flipboard, LinkedIn, Odnoklassniki, Patreon, PayPal, Pinterest, Pocket, Qzone, Reddit, Stumbleupon, Telegram, TencentWeibo, Threema, Tumblr, Twitter, VK, Wallabag, Weibo, WhatsApp, Xing.',
60
  'shariff'
61
  );
62
  wp_add_privacy_policy_content( 'Shariff Wrapper', wp_kses_post( wpautop( $content, false ) ) );
3
  * Plugin Name: Shariff Wrapper
4
  * Plugin URI: https://wordpress.org/plugins-wp/shariff/
5
  * Description: Shariff provides share buttons that respect the privacy of your visitors and follow the General Data Protection Regulation (GDPR).
6
+ * Version: 4.6.1
7
  * Author: Jan-Peter Lambeck & 3UU
8
  * Author URI: https://wordpress.org/plugins/shariff/
9
  * License: MIT
33
  */
34
  function shariff3uu_update() {
35
  // Adjust code version.
36
+ $code_version = '4.6.1';
37
 
38
  // Get options.
39
  $shariff3uu = $GLOBALS['shariff3uu'];
56
 
57
  On our website we offer you the possibility to use so called "Social Media Buttons". To protect your data, we use a solution called "Shariff". Hereby the share buttons are implemented as static images, which contain a link to the corresponding social network site. If you click on such a button, you will be redirected to the respective social network site in the same way, as normal links would do as well. Only in that moment of time the provider of the social network site will get information about you, for example your IP address. If you do not click on such a share button, no data will be transmitted. Information about the collection and usage of your date on the social network sites can be found in the corresponding terms of use of the respective provider. More information about the plugin and the Shariff solution can be found here: <a href="https://wordpress.org/plugins/shariff/">https://wordpress.org/plugins/shariff/</a>
58
 
59
+ On our website we offer share buttons for the following services / companies: AddThis, Diaspora, Facebook, Flattr, Flipboard, LinkedIn, Mix, Odnoklassniki, Patreon, PayPal, Pinterest, Pocket, Qzone, Reddit, Telegram, TencentWeibo, Threema, Tumblr, Twitter, VK, Wallabag, Weibo, WhatsApp, Xing.',
60
  'shariff'
61
  );
62
  wp_add_privacy_policy_content( 'Shariff Wrapper', wp_kses_post( wpautop( $content, false ) ) );
updates.php CHANGED
@@ -256,27 +256,6 @@ if ( isset( $GLOBALS['shariff3UU']['version'] ) && -1 === version_compare( $GLOB
256
  }
257
  }
258
 
259
- /**
260
- * Migration < 4.4
261
- */
262
- if ( isset( $GLOBALS['shariff3UU']['version'] ) && -1 === version_compare( $GLOBALS['shariff3UU']['version'], '4.4.0' ) ) {
263
- // Remove hide update notice setting.
264
- delete_option( 'shariff3UU_hide_update_notice' );
265
- // Create new options.
266
- $GLOBALS['shariff3uu_basic'] = (array) get_option( 'shariff3UU_basic' );
267
- $GLOBALS['shariff3uu_design'] = (array) get_option( 'shariff3UU_design' );
268
- $GLOBALS['shariff3uu_advanced'] = (array) get_option( 'shariff3UU_advanced' );
269
- $GLOBALS['shariff3uu_statistic'] = (array) get_option( 'shariff3UU_statistic' );
270
- // Delete old options.
271
- delete_option( 'shariff3UU_basic' );
272
- delete_option( 'shariff3UU_design' );
273
- delete_option( 'shariff3UU_advanced' );
274
- delete_option( 'shariff3UU_mailform' );
275
- delete_option( 'shariff3UU_statistic' );
276
- // Update version.
277
- $GLOBALS['shariff3UU']['version'] = '4.4.0';
278
- }
279
-
280
  /**
281
  * Migration < 4.5
282
  */
@@ -331,10 +310,6 @@ function shariff3uu_purge_transients() {
331
  wp_cache_flush();
332
  }
333
 
334
- // Remove Shariff cron job and add it again, if wanted.
335
- wp_clear_scheduled_hook( 'shariff3UU_fill_cache' );
336
- do_action( 'shariff3uu_save_statistic_options' );
337
-
338
  // Set new version.
339
  $GLOBALS['shariff3uu']['version'] = $code_version;
340
  $GLOBALS['shariff3uu_basic']['version'] = $code_version;
@@ -343,14 +318,26 @@ $GLOBALS['shariff3uu_basic']['version'] = $code_version;
343
  * Remove empty elements and save to options table.
344
  */
345
  // Basic.
 
346
  $shariff3uu_basic = array_filter( $GLOBALS['shariff3uu_basic'] );
347
  update_option( 'shariff3uu_basic', $shariff3uu_basic );
348
  // Design.
 
349
  $shariff3uu_design = array_filter( $GLOBALS['shariff3uu_design'] );
350
  update_option( 'shariff3uu_design', $shariff3uu_design );
351
  // Advanced.
 
352
  $shariff3uu_advanced = array_filter( $GLOBALS['shariff3uu_advanced'] );
353
  update_option( 'shariff3uu_advanced', $shariff3uu_advanced );
354
  // Statistic.
 
355
  $shariff3uu_statistic = array_filter( $GLOBALS['shariff3uu_statistic'] );
356
  update_option( 'shariff3uu_statistic', $shariff3uu_statistic );
 
 
 
 
 
 
 
 
256
  }
257
  }
258
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
259
  /**
260
  * Migration < 4.5
261
  */
310
  wp_cache_flush();
311
  }
312
 
 
 
 
 
313
  // Set new version.
314
  $GLOBALS['shariff3uu']['version'] = $code_version;
315
  $GLOBALS['shariff3uu_basic']['version'] = $code_version;
318
  * Remove empty elements and save to options table.
319
  */
320
  // Basic.
321
+ delete_option( 'shariff3uu_basic' );
322
  $shariff3uu_basic = array_filter( $GLOBALS['shariff3uu_basic'] );
323
  update_option( 'shariff3uu_basic', $shariff3uu_basic );
324
  // Design.
325
+ delete_option( 'shariff3uu_design' );
326
  $shariff3uu_design = array_filter( $GLOBALS['shariff3uu_design'] );
327
  update_option( 'shariff3uu_design', $shariff3uu_design );
328
  // Advanced.
329
+ delete_option( 'shariff3uu_advanced' );
330
  $shariff3uu_advanced = array_filter( $GLOBALS['shariff3uu_advanced'] );
331
  update_option( 'shariff3uu_advanced', $shariff3uu_advanced );
332
  // Statistic.
333
+ delete_option( 'shariff3uu_statistic' );
334
  $shariff3uu_statistic = array_filter( $GLOBALS['shariff3uu_statistic'] );
335
  update_option( 'shariff3uu_statistic', $shariff3uu_statistic );
336
+
337
+ // Remove old settings.
338
+ delete_option( 'shariff3UU_mailform' );
339
+ delete_option( 'shariff3UU_hide_update_notice' );
340
+
341
+ // Remove Shariff cron job and add it again, if wanted.
342
+ wp_clear_scheduled_hook( 'shariff3uu_fill_cache' );
343
+ do_action( 'shariff3uu_save_statistic_options' );