Shariff Wrapper - Version 4.5.1

Version Description

  • added support for the new WordPress Privacy Policy Guide added in 4.9.6
  • minor css adjustments
  • minor bug fixes
Download this release

Release Info

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

Code changes from version 4.5.0 to 4.5.1

admin/admin-menu.php CHANGED
@@ -1560,7 +1560,7 @@ function shariff3uu_help_section_callback() {
1560
  // Language.
1561
  echo '<div style="display:table-row">';
1562
  echo '<div style="display:table-cell;border:1px solid;padding:10px">language</div>';
1563
- echo '<div style="display:table-cell;border:1px solid;padding:10px">da, de, en, es, fi, fr, hr, hu, it, ja, ko, nl, no, pl, pt, ro, ru, sk, sl, sr, sv, tr, zh</div>';
1564
  echo '<div style="display:table-cell;border:1px solid;padding:10px">' . esc_html__( 'Automatically selected by browser.', 'shariff' ) . '</div>';
1565
  echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff lang="de"]</div>';
1566
  echo '<div style="display:table-cell;border:1px solid;padding:10px">' . esc_html__( 'Changes the language of the share buttons.', 'shariff' ) . '</div>';
1560
  // Language.
1561
  echo '<div style="display:table-row">';
1562
  echo '<div style="display:table-cell;border:1px solid;padding:10px">language</div>';
1563
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">bg, cs, da, de, en, es, fi, fr, hr, hu, it, ja, ko, nl, no, pl, pt, ro, ru, sk, sl, sr, sv, tr, zh</div>';
1564
  echo '<div style="display:table-cell;border:1px solid;padding:10px">' . esc_html__( 'Automatically selected by browser.', 'shariff' ) . '</div>';
1565
  echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff lang="de"]</div>';
1566
  echo '<div style="display:table-cell;border:1px solid;padding:10px">' . esc_html__( 'Changes the language of the share buttons.', 'shariff' ) . '</div>';
changelog.txt CHANGED
@@ -2,6 +2,11 @@
2
 
3
  == Changelog ==
4
 
 
 
 
 
 
5
  = 4.5.0 =
6
  - new option to add Shariff to custom WordPress hooks
7
  - new option to support multilingual sites using WPML and other plugins
2
 
3
  == Changelog ==
4
 
5
+ = 4.5.1 =
6
+ - added support for the new WordPress Privacy Policy Guide added in 4.9.6
7
+ - minor css adjustments
8
+ - minor bug fixes
9
+
10
  = 4.5.0 =
11
  - new option to add Shariff to custom WordPress hooks
12
  - new option to support multilingual sites using WPML and other plugins
css/shariff.css CHANGED
@@ -342,24 +342,19 @@
342
  }
343
  /* media queries */
344
  @media only screen and (max-width: 360px) {
345
- .shariff .shariff-buttons li { width: 35px; }
346
  .shariff .shariff-buttons.buttonsize-small li { width: 25px; }
 
347
  .shariff .shariff-buttons.buttonsize-large li { width: 45px; }
348
  .shariff .shariff-buttons .shariff-icon svg { display: block; margin: auto; }
349
  .shariff .shariff-buttons .shariff-text { display: none; }
350
- }
351
- @media only screen and (min-width: 361px) {
352
- .shariff .shariff-buttons li { width: 90px; }
353
- .shariff .shariff-buttons.buttonsize-large li { width: 130px; }
354
- }
355
- @media only screen and (max-width: 768px) {
356
  .shariff .shariff-buttons .shariff-count { display: none; }
357
  }
358
- @media only screen and (min-width: 768px) {
359
- .shariff .shariff-buttons li { width: 130px; }
360
  .shariff .shariff-buttons.buttonsize-small li { width: 105px; }
 
361
  .shariff .shariff-buttons.buttonsize-large li { width: 155px; }
362
- .shariff .shariff-buttons li .shariff-text { display: inline; }
 
363
  }
364
  @media only screen and (min-device-width: 1025px) {
365
  /*noinspection CssUnusedSymbol*/
342
  }
343
  /* media queries */
344
  @media only screen and (max-width: 360px) {
 
345
  .shariff .shariff-buttons.buttonsize-small li { width: 25px; }
346
+ .shariff .shariff-buttons li { width: 35px; }
347
  .shariff .shariff-buttons.buttonsize-large li { width: 45px; }
348
  .shariff .shariff-buttons .shariff-icon svg { display: block; margin: auto; }
349
  .shariff .shariff-buttons .shariff-text { display: none; }
 
 
 
 
 
 
350
  .shariff .shariff-buttons .shariff-count { display: none; }
351
  }
352
+ @media only screen and (min-width: 361px) {
 
353
  .shariff .shariff-buttons.buttonsize-small li { width: 105px; }
354
+ .shariff .shariff-buttons li { width: 130px; }
355
  .shariff .shariff-buttons.buttonsize-large li { width: 155px; }
356
+ .shariff .shariff-buttons .shariff-text { display: inline; }
357
+ .shariff .shariff-buttons .shariff-count { display: inline; }
358
  }
359
  @media only screen and (min-device-width: 1025px) {
360
  /*noinspection CssUnusedSymbol*/
css/shariff.min.css CHANGED
@@ -1 +1 @@
1
- .shariff{display:block !important;clear:both}.shariff ul{display:flex;flex-direction:row;flex-flow:row wrap;padding:0 !important;margin:0 !important}.shariff li{height:35px;box-sizing:border-box;list-style:none !important;overflow:hidden !important;margin:5px !important;padding:0 !important;text-indent:0 !important;border-left:0 none !important}.shariff a{position:relative;display:block !important;height:35px;padding:0;margin:0;box-sizing:border-box;border:0;text-decoration:none;background-image:none !important;text-align:left;box-shadow:none;cursor:pointer}.shariff a:hover{color:#fff;background-color:inherit !important;text-decoration:none !important}.shariff a:visited{color:inherit}.shariff .shariff-count{position:absolute;height:33px;top:0;right:0;margin:1px;padding:0 8px;background-color:rgba(255,255,255,0.5)}.shariff .shariff-count,.shariff .shariff-text{font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:36px;vertical-align:top}.shariff .shariff-text{padding-left:3px}.shariff .shariff-icon svg{width:32px;height:20px;padding:7px 1px;box-sizing:content-box}.shariff-button::before{content:none !important}.shariff .shariff-buttons .shariff-text-white{color:#fff}.shariff .shariff-buttons .shariff-hidezero{opacity:0}.shariff .theme-default a{color:#fff !important}.shariff .theme-default .shariff-icon svg path{fill:#fff}.shariff .theme-color .shariff-count{background-color:transparent !important;color:#fff !important}.shariff .theme-color .shariff-icon svg path{fill:#fff}.shariff .theme-grey a{background-color:#b0b0b0 !important}.shariff .theme-grey a:hover{background-color:inherit !important}.shariff .theme-grey .shariff-count{background-color:transparent;color:#fff !important}.shariff .theme-grey .shariff-icon svg path{fill:#fff}.shariff .theme-white a{background-color:#fff !important;border:1px solid #ddd}.shariff .theme-white a:hover{background-color:#eee !important;color:inherit}.shariff .theme-white svg{fill:currentColor}.shariff .theme-white .shariff-count{background-color:transparent;margin:0}.shariff .shariff-buttons.theme-round li{width:35px !important;height:35px;border-radius:50%;margin:5px}.shariff .theme-round a{position:relative;height:35px;border-radius:50%}.shariff .theme-round .shariff-icon svg{display:block;margin:auto;padding:8px 1px}.shariff .theme-round .shariff-text{display:block}.shariff .theme-round .shariff-count{display:inline;padding:0;right:0;left:0;top:0;background-color:transparent;color:transparent !important;text-align:center}.shariff .theme-round .shariff-count:hover{background-color:inherit !important;color:#fff !important}.shariff .theme-round .shariff-icon svg path{fill:#fff}.shariff .shariff-buttons.buttonsize-small li{height:25px !important}.shariff .shariff-buttons.buttonsize-small a{height:25px !important}.shariff .shariff-buttons.buttonsize-small.orientation-vertical li{width:115px}.shariff .shariff-buttons.buttonsize-small .shariff-icon svg{width:22px;height:15px;padding:5px 1px}.shariff .shariff-buttons.buttonsize-small .shariff-text,.shariff .shariff-buttons.buttonsize-small .shariff-count{font-size:11px;line-height:25px;padding:0 5px;height:23px}.shariff .shariff-buttons.buttonsize-small .shariff-text{padding-left:1px !important}.shariff .shariff-buttons.buttonsize-small.theme-round li{width:25px !important}.shariff .shariff-buttons.buttonsize-small.theme-round a{width:25px !important}.shariff .shariff-buttons.buttonsize-small.theme-round .shariff-count{padding:0 !important;height:25px !important}.shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li{margin:5px 7px}.shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li:first-child{margin-left:5px}.shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li:last-child{margin-right:5px}.shariff .buttonsize-large li{height:45px !important}.shariff .buttonsize-large a{height:45px !important}.shariff .buttonsize-large.orientation-vertical li{width:155px}.shariff .buttonsize-large .shariff-icon svg{width:40px;height:28px;padding:9px 2px}.shariff .buttonsize-large .shariff-text,.shariff .buttonsize-large .shariff-count{font-size:14px;line-height:45px;padding:0 10px;height:43px}.shariff .buttonsize-large .shariff-text{padding-left:1px !important}.shariff .shariff-buttons.buttonsize-large.theme-round li{width:45px !important;height:45px !important}.shariff .buttonsize-large.theme-round a{width:45px !important}.shariff .buttonsize-large.theme-round .shariff-count{padding:0 !important;height:45px !important}.shariff .orientation-vertical{flex-direction:column}.shariff .orientation-vertical li{width:135px}.shariff.shariff-align-flex-start ul{justify-content:flex-start;align-items:flex-start}.shariff.shariff-align-center ul{justify-content:center;align-items:center}.shariff.shariff-align-flex-end ul{justify-content:flex-end;align-items:flex-end}.widget .shariff.shariff-widget-align-flex-start ul{justify-content:flex-start;align-items:flex-start}.widget .shariff.shariff-widget-align-center ul{justify-content:center;align-items:center}.widget .shariff.shariff-widget-align-flex-end ul{justify-content:flex-end;align-items:flex-end}.shariff.shariff-buttonstretch li{flex:1 0 auto !important}.shariff.shariff-buttonstretch .orientation-vertical li{width:100% !important}.widget .shariff li{border:0;font-weight:400}.widget .shariff .theme-default a,.widget .shariff .theme-color a,.widget .shariff .theme-grey a,.widget .shariff .theme-round a{color:#fff;display:block;font-weight:400}.widget .shariff .theme-default a:hover,.widget .shariff .theme-color a:hover,.widget .shariff .theme-grey a:hover,.widget .shariff .theme-round a:hover{color:#fff;font-weight:400}.shariff-warning{background-color:red;color:#fff;font-size:20px;font-weight:700;padding:10px;text-align:center;margin:0 auto;line-height:1.5}.shariff .info a{border:1px solid #ddd;width:35px}.shariff .shariff-button.info{width:35px;flex:0 0 auto !important}.shariff .theme-default .shariff-button.shariff-nocustomcolor.info svg path{fill:#999}.shariff .theme-round .shariff-button.shariff-nocustomcolor.info svg path{fill:#999}.shariff .buttonsize-small .shariff-button.info{width:25px}.shariff .buttonsize-small .info a{width:25px}.shariff .buttonsize-large .shariff-button.info{width:45px}.shariff .buttonsize-large .info a{width:45px}.shariff .info .shariff-icon svg{display:block;margin:auto}@media only screen and (max-width:360px){.shariff .shariff-buttons li{width:35px}.shariff .shariff-buttons.buttonsize-small li{width:25px}.shariff .shariff-buttons.buttonsize-large li{width:45px}.shariff .shariff-buttons .shariff-icon svg{display:block;margin:auto}.shariff .shariff-buttons .shariff-text{display:none}}@media only screen and (min-width:361px){.shariff .shariff-buttons li{width:90px}.shariff .shariff-buttons.buttonsize-large li{width:130px}}@media only screen and (max-width:768px){.shariff .shariff-buttons .shariff-count{display:none}}@media only screen and (min-width:768px){.shariff .shariff-buttons li{width:130px}.shariff .shariff-buttons.buttonsize-small li{width:105px}.shariff .shariff-buttons.buttonsize-large li{width:155px}.shariff .shariff-buttons li .shariff-text{display:inline}}@media only screen and (min-device-width:1025px){.shariff .shariff-mobile{display:none !important}}
1
+ .shariff{display:block !important;clear:both}.shariff ul{display:flex;flex-direction:row;flex-flow:row wrap;padding:0 !important;margin:0 !important}.shariff li{height:35px;box-sizing:border-box;list-style:none !important;overflow:hidden !important;margin:5px !important;padding:0 !important;text-indent:0 !important;border-left:0 none !important}.shariff a{position:relative;display:block !important;height:35px;padding:0;margin:0;box-sizing:border-box;border:0;text-decoration:none;background-image:none !important;text-align:left;box-shadow:none;cursor:pointer}.shariff a:hover{color:#fff;background-color:inherit !important;text-decoration:none !important}.shariff a:visited{color:inherit}.shariff .shariff-count{position:absolute;height:33px;top:0;right:0;margin:1px;padding:0 8px;background-color:rgba(255,255,255,0.5)}.shariff .shariff-count,.shariff .shariff-text{font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:36px;vertical-align:top}.shariff .shariff-text{padding-left:3px}.shariff .shariff-icon svg{width:32px;height:20px;padding:7px 1px;box-sizing:content-box}.shariff-button::before{content:none !important}.shariff .shariff-buttons .shariff-text-white{color:#fff}.shariff .shariff-buttons .shariff-hidezero{opacity:0}.shariff .theme-default a{color:#fff !important}.shariff .theme-default .shariff-icon svg path{fill:#fff}.shariff .theme-color .shariff-count{background-color:transparent !important;color:#fff !important}.shariff .theme-color .shariff-icon svg path{fill:#fff}.shariff .theme-grey a{background-color:#b0b0b0 !important}.shariff .theme-grey a:hover{background-color:inherit !important}.shariff .theme-grey .shariff-count{background-color:transparent;color:#fff !important}.shariff .theme-grey .shariff-icon svg path{fill:#fff}.shariff .theme-white a{background-color:#fff !important;border:1px solid #ddd}.shariff .theme-white a:hover{background-color:#eee !important;color:inherit}.shariff .theme-white svg{fill:currentColor}.shariff .theme-white .shariff-count{background-color:transparent;margin:0}.shariff .shariff-buttons.theme-round li{width:35px !important;height:35px;border-radius:50%;margin:5px}.shariff .theme-round a{position:relative;height:35px;border-radius:50%}.shariff .theme-round .shariff-icon svg{display:block;margin:auto;padding:8px 1px}.shariff .theme-round .shariff-text{display:block}.shariff .theme-round .shariff-count{display:inline;padding:0;right:0;left:0;top:0;background-color:transparent;color:transparent !important;text-align:center}.shariff .theme-round .shariff-count:hover{background-color:inherit !important;color:#fff !important}.shariff .theme-round .shariff-icon svg path{fill:#fff}.shariff .shariff-buttons.buttonsize-small li{height:25px !important}.shariff .shariff-buttons.buttonsize-small a{height:25px !important}.shariff .shariff-buttons.buttonsize-small.orientation-vertical li{width:115px}.shariff .shariff-buttons.buttonsize-small .shariff-icon svg{width:22px;height:15px;padding:5px 1px}.shariff .shariff-buttons.buttonsize-small .shariff-text,.shariff .shariff-buttons.buttonsize-small .shariff-count{font-size:11px;line-height:25px;padding:0 5px;height:23px}.shariff .shariff-buttons.buttonsize-small .shariff-text{padding-left:1px !important}.shariff .shariff-buttons.buttonsize-small.theme-round li{width:25px !important}.shariff .shariff-buttons.buttonsize-small.theme-round a{width:25px !important}.shariff .shariff-buttons.buttonsize-small.theme-round .shariff-count{padding:0 !important;height:25px !important}.shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li{margin:5px 7px}.shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li:first-child{margin-left:5px}.shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li:last-child{margin-right:5px}.shariff .buttonsize-large li{height:45px !important}.shariff .buttonsize-large a{height:45px !important}.shariff .buttonsize-large.orientation-vertical li{width:155px}.shariff .buttonsize-large .shariff-icon svg{width:40px;height:28px;padding:9px 2px}.shariff .buttonsize-large .shariff-text,.shariff .buttonsize-large .shariff-count{font-size:14px;line-height:45px;padding:0 10px;height:43px}.shariff .buttonsize-large .shariff-text{padding-left:1px !important}.shariff .shariff-buttons.buttonsize-large.theme-round li{width:45px !important;height:45px !important}.shariff .buttonsize-large.theme-round a{width:45px !important}.shariff .buttonsize-large.theme-round .shariff-count{padding:0 !important;height:45px !important}.shariff .orientation-vertical{flex-direction:column}.shariff .orientation-vertical li{width:135px}.shariff.shariff-align-flex-start ul{justify-content:flex-start;align-items:flex-start}.shariff.shariff-align-center ul{justify-content:center;align-items:center}.shariff.shariff-align-flex-end ul{justify-content:flex-end;align-items:flex-end}.widget .shariff.shariff-widget-align-flex-start ul{justify-content:flex-start;align-items:flex-start}.widget .shariff.shariff-widget-align-center ul{justify-content:center;align-items:center}.widget .shariff.shariff-widget-align-flex-end ul{justify-content:flex-end;align-items:flex-end}.shariff.shariff-buttonstretch li{flex:1 0 auto !important}.shariff.shariff-buttonstretch .orientation-vertical li{width:100% !important}.widget .shariff li{border:0;font-weight:400}.widget .shariff .theme-default a,.widget .shariff .theme-color a,.widget .shariff .theme-grey a,.widget .shariff .theme-round a{color:#fff;display:block;font-weight:400}.widget .shariff .theme-default a:hover,.widget .shariff .theme-color a:hover,.widget .shariff .theme-grey a:hover,.widget .shariff .theme-round a:hover{color:#fff;font-weight:400}.shariff-warning{background-color:red;color:#fff;font-size:20px;font-weight:700;padding:10px;text-align:center;margin:0 auto;line-height:1.5}.shariff .info a{border:1px solid #ddd;width:35px}.shariff .shariff-button.info{width:35px;flex:0 0 auto !important}.shariff .theme-default .shariff-button.shariff-nocustomcolor.info svg path{fill:#999}.shariff .theme-round .shariff-button.shariff-nocustomcolor.info svg path{fill:#999}.shariff .buttonsize-small .shariff-button.info{width:25px}.shariff .buttonsize-small .info a{width:25px}.shariff .buttonsize-large .shariff-button.info{width:45px}.shariff .buttonsize-large .info a{width:45px}.shariff .info .shariff-icon svg{display:block;margin:auto}@media only screen and (max-width:360px){.shariff .shariff-buttons.buttonsize-small li{width:25px}.shariff .shariff-buttons li{width:35px}.shariff .shariff-buttons.buttonsize-large li{width:45px}.shariff .shariff-buttons .shariff-icon svg{display:block;margin:auto}.shariff .shariff-buttons .shariff-text{display:none}.shariff .shariff-buttons .shariff-count{display:none}}@media only screen and (min-width:361px){.shariff .shariff-buttons.buttonsize-small li{width:105px}.shariff .shariff-buttons li{width:130px}.shariff .shariff-buttons.buttonsize-large li{width:155px}.shariff .shariff-buttons .shariff-text{display:inline}.shariff .shariff-buttons .shariff-count{display:inline}}@media only screen and (min-device-width:1025px){.shariff .shariff-mobile{display:none !important}}
includes/class-shariff-widget.php CHANGED
@@ -148,7 +148,7 @@ class Shariff_Widget extends WP_Widget {
148
  // Replace brackets [ and ] with ( and ).
149
  $page_title = str_replace( '[', '(', $page_title );
150
  $page_title = str_replace( ']', ')', $page_title );
151
- $page_title = ' title="' . $page_title . '"';
152
  }
153
 
154
  // Same for media.
148
  // Replace brackets [ and ] with ( and ).
149
  $page_title = str_replace( '[', '(', $page_title );
150
  $page_title = str_replace( ']', ')', $page_title );
151
+ $page_title = ' title="' . html_entity_decode( wp_strip_all_tags( $page_title ), ENT_COMPAT, 'UTF-8' ) . '"';
152
  }
153
 
154
  // Same for media.
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Shariff Wrapper ===
2
  Contributors: starguide, 3UU
3
  Tags: Shariff, GDPR, DSGVO, share buttons, sharing
4
- Requires at least: 4.9
5
  Requires PHP: 5.6
6
  Tested up to: 4.9
7
- Stable tag: 4.5.0
8
  License: MIT
9
  License URI: http://opensource.org/licenses/mit
10
 
@@ -12,7 +12,7 @@ Shariff provides share buttons that respect the privacy of your visitors and fol
12
 
13
  == Description ==
14
 
15
- The "original" share buttons automatically transmit data of your visitors to the social network sites as soon as they visit your website. They do not need to click on a share button for this and therefore have no choice, if they want their data to be send. The German computer magazine c't has developed "Shariff" `(ʃɛɹɪf)` that follows the General Data Protection Regulation (GDPR - Regulation (EU) 2016/679). This plugin adapts the Shariff concept and provides an easy to use solution for WordPress. We currently support 32 services: AddThis, Bitcoin, Diaspora, Facebook, Flattr, Flipboard, GooglePlus, LinkedIn, mailto, Mastodon, Odnoklassniki, Patreon, PayPal, PayPal.me, Pinterest, Pocket, Printer, Qzone, Reddit, RSS, SMS, Stumbleupon, Telegram, TencentWeibo, Threema, Tumblr, Twitter, VK, Wallabag, Weibo, WhatsApp, Xing.
16
 
17
  For more information about the Shariff project check out the original [GitHub project](https://github.com/heiseonline/shariff) and read about the project itself [c’t information page](http://ct.de/shariff) (in German).
18
 
@@ -28,14 +28,11 @@ To enable it for all posts please check the options in the plugin settings.
28
 
29
  == Screenshots ==
30
 
31
- 1. Differently styled share buttons (all small).
32
  2. Basic options.
33
  3. Design options.
34
  4. Advanced options.
35
- 5. Mail form options.
36
- 6. Help section.
37
- 7. Manual shorttag with options in a post.
38
- 8. Widget menu. Shorttag works like in posts.
39
 
40
  == Frequently Asked Questions ==
41
 
@@ -122,25 +119,12 @@ A: You can use the "url" parameter within the shortcode
122
  `[shariff url="http://www.example.com/"]`
123
  This is also available within widgets. However, it is not a good idea to manipulate the URI, because it could mislead your visitors. So you should only use it, if this is really needed and you do really know what you are doing. Therefore it is not available on the plugin options page in general.
124
 
125
- = Q: What is the difference between the services `mailform` and `mailto´? =
126
- A: mailform will provide an e-mail form on top of the post or page and mailto will draw a link with the mailto-protocol to open the default e-mail application of the client.
127
-
128
- = Q: What happened to `mail`? =
129
- A: mail was replaced with mailform to provide an easier way of distinguishing between the two types of mail buttons.
130
-
131
- = Q: Can I disable the mail form completely? =
132
- A: Yes, take a look at the Mail Form tab on the plugin options page.
133
-
134
  = Q: What happened to the Twitter share counts and what is OpenShareCount? =
135
  A: Please read: https://www.jplambeck.de/twitter-saveoursharecounts/
136
 
137
  = Q: The buttons are not correctly being shown on my custom theme! =
138
  A: Please make sure that wp_footer(); has been added to your theme. For more information please visit: https://codex.wordpress.org/Function_Reference/wp_footer
139
 
140
- = EXPERIMENTAL FEATURES =
141
-
142
- Features marked as "experimental" in the admin menu are experimental! This means: We think it is a good extension to our plugin that we would like to include in a future version, but we are not sure yet about the best solution that works for all or most people. So please feel free to use and test it and report back to us about it. Experimental features might be removed in an update, if it does not work out. So please pay close attention to our changelog!
143
-
144
  = Q: What is the external API feature? =
145
  A: First of all: Usually you do not need it! The plugin requests all share counts itself. However, there are some reasons to put the backend on another server:
146
  - avoid requests from you WP server to all the social networks
@@ -157,7 +141,7 @@ But please have in mind that there are also some good reasons not to use externa
157
  A: In the statistic settings fill in the URL to the API of the external server. For the WordPress installation on the external server you have to create a "constant" called SHARIFF_FRONTENDS to permit other domains to use it. Please have in mind that you have to fill in all subdomains you want to use! The domains must be defined like this:
158
  `define( 'SHARIFF_FRONTENDS', 'example.com|www.example.com|blog.example.com|another-domain.com' );`
159
 
160
- = Q: What does "Request external API directly." means? =
161
  A: By default, the browser request the share counts from the server your site is running on. If you have entered an external API your server will then request the counts from this external API instead of fetching them itself. Therefore, the external server will only see the IP from your server and not the one from your visitors. If you check this option, the browser of your visitors will instead directly request the share counts from the external API and therefore reveal their IP address to them. This might be faster, but it is less secure. Please also make sure to set the Access-Control-Allow-Origin header right. If your site is available using https, your external API will need to be reached by https as well. Otherwise the request will get blocked for security reasons. All options and features (e.g. the ranking tab) regarding the statistic will only work on the external server.
162
 
163
  = KNOWN BUGS =
@@ -168,6 +152,11 @@ These are bugs or unexpected glitches that we know of, but that do not have an i
168
 
169
  == Changelog ==
170
 
 
 
 
 
 
171
  = 4.5.0 =
172
  - new option to add Shariff to custom WordPress hooks
173
  - new option to support multilingual sites using WPML and other plugins
@@ -249,111 +238,4 @@ These are bugs or unexpected glitches that we know of, but that do not have an i
249
  - minor css improvements
250
  - updated help section
251
 
252
- = 4.2.1 =
253
- - fixed WhatsApp button on Android when using Chrome
254
- - fixed Shariff being added to RSS feeds under certain conditions
255
- - updated to latest Facebook Graph API for share count requests
256
-
257
- = 4.2.0 =
258
- - new option to set the rate limit for sending mails using the mail form
259
- - added home url as fallback for share count requests
260
- - added further anti-spam prevention mechanics
261
- - added noopener and noreferrer to share links
262
- - fixed double encoding of share count request links
263
- - updated media uploader request for translation
264
- - updated handling of admin notices following WordPress core
265
- - tested and optimized for WordPress 4.6
266
-
267
- = 4.1.2 =
268
- - new fallback for share count requests in case pretty permalinks are disabled
269
- - new filter shariff3UU_render_atts to change options on the fly (thx Ov3rfly)
270
- - fixed share title in cases with html encoded characters
271
- - fixed double counting on ranking tab under certain conditions
272
- - fixed php info notice in admin notices
273
-
274
- = 4.1.1 =
275
- - new option to disable the Shariff buttons outside of the main loop
276
- - fixed Facebook App ID request
277
- - minor css fix
278
-
279
- = 4.1.0 =
280
- - new design option to set a custom button color for all buttons
281
- - new design option to set a border radius for the round theme (up to a square)
282
- - new design option to hide all buttons until the page is fully loaded
283
- - new mailform option to use a html anchor (again)
284
- - new statistic option to fill the cache automatically
285
- - new statistic option to set the amount of posts for the ranking tab
286
- - new statistic option to use share counts with PHP < 5.4
287
- - fixed preventing buttons from being added to excerpts under certain conditions
288
- - fixed url encoding of share count requests
289
- - improved handling of wrong or mistyped service entries
290
- - minor bug fixes
291
-
292
- = 4.0.8 =
293
- - new workaround for sites running PHP 5.2 and older
294
-
295
- = 4.0.7 =
296
- - new option for WordPress installations with REST API not reachable in root
297
-
298
- = 4.0.6 =
299
- - fixed an error in combination with bbpress
300
- - fixed an error on very old PHP versions
301
- - fixed ranking tab
302
- - minor css improvements
303
-
304
- = 4.0.5 =
305
- - fixed mail form link
306
- - fixed xmlns for w3c
307
-
308
- = 4.0.4 =
309
- - removed some remaining wrong text domains for translations
310
- - minor css fixes
311
-
312
- = 4.0.3 =
313
- - fixed mobile services not showing on certain tablets
314
- - fixed type error on totalnumber when cache is empty
315
- - fixed share count requests when WordPress is installed in a subdirectory
316
- - fixed url encoding of share url, title and media
317
- - added width and height to SVGs to prevent large initial icons prior to css
318
- - new classes shariff-buttons and shariff-link added
319
- - removed local translation files due to switching to wordpress.org language packs
320
- - minor css resets added
321
-
322
- = 4.0.2 =
323
- - added minor css resets to prevent influence of theme css
324
- - fixed LinkedIn share link
325
-
326
- = 4.0.1 =
327
- - prevent php warning messages on unsuccessful includes while WP_DEBUG is active
328
- - changed text domain to match plugin slug
329
-
330
- = 4.0.0 =
331
- - complete overhaul of the plugin core
332
- - buttons now also work without JavaScript
333
- - icon font has been removed and replaced with SVGs
334
- - share counts now use the WP REST API
335
- - share counts now always show the last cached counts prior to updating them
336
- - fixed duplicated share count requests
337
- - new ranking tab shows the shares of your last 100 posts
338
- - new service pocket
339
- - new option to show the total amount of shares in the headline with %total
340
- - new option to use the total amount of shares in your theme (see FAQ)
341
- - new action hook shariff_share_counts (see FAQ)
342
- - new option to change the priority of the shortcode filter
343
- - new support for selective refresh introduced in WP 4.5
344
- - new external API feature replaces the external host option (experimental, see FAQ)
345
- - new support for SCRIPT_DEBUG
346
- - css and js files are now only loaded on pages with Shariff buttons
347
- - improved compatibility with plugin Autoptimize (force scripts in head)
348
- - improved compatibility with multiple caching plugins
349
- - all shortcodes are now being stripped from the mail message body
350
- - fixed potential double sending of mails
351
- - removed all jQuery dependencies
352
- - requires at least WordPress 4.4 (only for share counts)
353
- - we no longer support IE 8 (if it ever worked)
354
- - updated status tab
355
- - updated help section
356
- - minor bug fixes
357
- - code cleanup
358
-
359
  The complete changelog can be found here: https://plugins.svn.wordpress.org/shariff/trunk/changelog.txt
1
  === Shariff Wrapper ===
2
  Contributors: starguide, 3UU
3
  Tags: Shariff, GDPR, DSGVO, share buttons, sharing
4
+ Requires at least: 4.7
5
  Requires PHP: 5.6
6
  Tested up to: 4.9
7
+ Stable tag: 4.5.1
8
  License: MIT
9
  License URI: http://opensource.org/licenses/mit
10
 
12
 
13
  == Description ==
14
 
15
+ The "original" share buttons automatically transmit data of your visitors to the social network sites as soon as they visit your website. They do not need to click on a share button for this and therefore have no choice, if they want their data to be send. The German computer magazine c't has developed "Shariff" `(ʃɛɹɪf)` that follows the General Data Protection Regulation (GDPR - Regulation (EU) 2016/679). This plugin adapts the Shariff concept and provides an easy to use solution for WordPress. We currently support 32 services in 25 languages: AddThis, Bitcoin, Diaspora, Facebook, Flattr, Flipboard, GooglePlus, LinkedIn, mailto, Mastodon, Odnoklassniki, Patreon, PayPal, PayPal.me, Pinterest, Pocket, Printer, Qzone, Reddit, RSS, SMS, Stumbleupon, Telegram, TencentWeibo, Threema, Tumblr, Twitter, VK, Wallabag, Weibo, WhatsApp, Xing.
16
 
17
  For more information about the Shariff project check out the original [GitHub project](https://github.com/heiseonline/shariff) and read about the project itself [c’t information page](http://ct.de/shariff) (in German).
18
 
28
 
29
  == Screenshots ==
30
 
31
+ 1. Differently styled share buttons.
32
  2. Basic options.
33
  3. Design options.
34
  4. Advanced options.
35
+ 5. Statistic options.
 
 
 
36
 
37
  == Frequently Asked Questions ==
38
 
119
  `[shariff url="http://www.example.com/"]`
120
  This is also available within widgets. However, it is not a good idea to manipulate the URI, because it could mislead your visitors. So you should only use it, if this is really needed and you do really know what you are doing. Therefore it is not available on the plugin options page in general.
121
 
 
 
 
 
 
 
 
 
 
122
  = Q: What happened to the Twitter share counts and what is OpenShareCount? =
123
  A: Please read: https://www.jplambeck.de/twitter-saveoursharecounts/
124
 
125
  = Q: The buttons are not correctly being shown on my custom theme! =
126
  A: Please make sure that wp_footer(); has been added to your theme. For more information please visit: https://codex.wordpress.org/Function_Reference/wp_footer
127
 
 
 
 
 
128
  = Q: What is the external API feature? =
129
  A: First of all: Usually you do not need it! The plugin requests all share counts itself. However, there are some reasons to put the backend on another server:
130
  - avoid requests from you WP server to all the social networks
141
  A: In the statistic settings fill in the URL to the API of the external server. For the WordPress installation on the external server you have to create a "constant" called SHARIFF_FRONTENDS to permit other domains to use it. Please have in mind that you have to fill in all subdomains you want to use! The domains must be defined like this:
142
  `define( 'SHARIFF_FRONTENDS', 'example.com|www.example.com|blog.example.com|another-domain.com' );`
143
 
144
+ = Q: What does "Request external API directly." mean? =
145
  A: By default, the browser request the share counts from the server your site is running on. If you have entered an external API your server will then request the counts from this external API instead of fetching them itself. Therefore, the external server will only see the IP from your server and not the one from your visitors. If you check this option, the browser of your visitors will instead directly request the share counts from the external API and therefore reveal their IP address to them. This might be faster, but it is less secure. Please also make sure to set the Access-Control-Allow-Origin header right. If your site is available using https, your external API will need to be reached by https as well. Otherwise the request will get blocked for security reasons. All options and features (e.g. the ranking tab) regarding the statistic will only work on the external server.
146
 
147
  = KNOWN BUGS =
152
 
153
  == Changelog ==
154
 
155
+ = 4.5.1 =
156
+ - added support for the new WordPress Privacy Policy Guide added in 4.9.6
157
+ - minor css adjustments
158
+ - minor bug fixes
159
+
160
  = 4.5.0 =
161
  - new option to add Shariff to custom WordPress hooks
162
  - new option to support multilingual sites using WPML and other plugins
238
  - minor css improvements
239
  - updated help section
240
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
241
  The complete changelog can be found here: https://plugins.svn.wordpress.org/shariff/trunk/changelog.txt
services/shariff-pinterest.php CHANGED
@@ -11,23 +11,19 @@ if ( ! class_exists( 'WP' ) ) {
11
  }
12
 
13
  // Check if function catch_image exists.
14
- if ( ! function_exists( 'catch_image' ) ) {
15
  /**
16
  * Helper function to get the first image of a post.
17
  */
18
- function catch_image() {
19
- // @codingStandardsIgnoreStart
20
- $files = get_children( 'post_parent=' . get_the_ID() . '&post_type=attachment&post_mime_type=image' );
21
- // @codingStandardsIgnoreEnd
22
- if ( $files ) {
23
- $keys = array_reverse( array_keys( $files ) );
24
- $num = $keys[0];
25
- $imageurl = wp_get_attachment_url( $num );
26
- return $imageurl;
27
  }
28
- return '';
29
- }
30
- }
31
 
32
  // Check if we need the frontend or the backend part.
33
  if ( isset( $frontend ) && 1 === $frontend ) {
@@ -44,14 +40,14 @@ if ( isset( $frontend ) && 1 === $frontend ) {
44
  if ( ! empty( $feat_image ) ) {
45
  $share_media = esc_html( $feat_image );
46
  } else {
47
- $first_image = catch_image();
48
  if ( ! empty( $first_image ) ) {
49
  $share_media = esc_html( $first_image );
50
  } else {
51
  if ( isset( $shariff3uu['default_pinterest'] ) ) {
52
  $share_media = $shariff3uu['default_pinterest'];
53
  } else {
54
- $share_media = plugins_url( '../pictos/defaultHint.png', __FILE__ );
55
  }
56
  }
57
  }
11
  }
12
 
13
  // Check if function catch_image exists.
14
+ if ( ! function_exists( 'shariff3uu_catch_image' ) ) {
15
  /**
16
  * Helper function to get the first image of a post.
17
  */
18
+ function shariff3uu_catch_image() {
19
+ $result = preg_match_all( '/<img.+src=[\'"]([^\'"]+)[\'"].*>/i', get_post_field( 'post_content', get_the_ID() ), $matches );
20
+ if ( array_key_exists( 0, $matches[1] ) ) {
21
+ return $matches[1][0];
22
+ } else {
23
+ return '';
 
 
 
24
  }
25
+ };
26
+ };
 
27
 
28
  // Check if we need the frontend or the backend part.
29
  if ( isset( $frontend ) && 1 === $frontend ) {
40
  if ( ! empty( $feat_image ) ) {
41
  $share_media = esc_html( $feat_image );
42
  } else {
43
+ $first_image = shariff3uu_catch_image();
44
  if ( ! empty( $first_image ) ) {
45
  $share_media = esc_html( $first_image );
46
  } else {
47
  if ( isset( $shariff3uu['default_pinterest'] ) ) {
48
  $share_media = $shariff3uu['default_pinterest'];
49
  } else {
50
+ $share_media = plugins_url( '/images/defaultHint.png', dirname( __FILE__ ) );
51
  }
52
  }
53
  }
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.5.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.5.0';
37
 
38
  // Get options.
39
  $shariff3uu = $GLOBALS['shariff3uu'];
@@ -46,6 +46,21 @@ function shariff3uu_update() {
46
  }
47
  add_action( 'admin_init', 'shariff3uu_update' );
48
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
  /** Require Shariff Widget. */
50
  require dirname( __FILE__ ) . '/includes/class-shariff-widget.php';
51
 
@@ -947,7 +962,7 @@ function shariff3uu_render( $atts ) {
947
  // Enqueues the stylesheet (loading it here makes sure that it is only loaded on pages that actually contain shariff buttons).
948
  // If SCRIPT_DEBUG is set to true, the non minified version will be loaded.
949
  if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG === true ) {
950
- wp_enqueue_style( 'shariffcss', plugins_url( '/css/shariff.min.css', __FILE__ ), '', $shariff3uu['version'] );
951
  } else {
952
  wp_enqueue_style( 'shariffcss', plugins_url( '/css/shariff.min.css', __FILE__ ), '', $shariff3uu['version'] );
953
  }
@@ -1107,7 +1122,7 @@ function shariff3uu_render( $atts ) {
1107
  }
1108
  if ( 0 === $share_counts['total'] && array_key_exists( 'headline_zero', $atts ) && ! empty( $atts['headline_zero'] ) ) {
1109
  $atts['headline_zero'] = str_replace( '%total', '<span class="shariff-total">' . absint( $share_counts['total'] ) . '</span>', $atts['headline_zero'] );
1110
- $output .= '<div class="ShariffHeadline">' . $atts['headline_zero'] . '</div>';
1111
  } else {
1112
  $atts['headline'] = str_replace( '%total', '<span class="shariff-total">' . absint( $share_counts['total'] ) . '</span>', $atts['headline'] );
1113
  $output .= '<div class="ShariffHeadline">' . $atts['headline'] . '</div>';
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.5.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.5.1';
37
 
38
  // Get options.
39
  $shariff3uu = $GLOBALS['shariff3uu'];
46
  }
47
  add_action( 'admin_init', 'shariff3uu_update' );
48
 
49
+ /**
50
+ * Add privacy policy suggestions to WordPress privacy generator introduced in WordPress 4.9.6.
51
+ */
52
+ function shariff3uu_privacy() {
53
+ if ( function_exists( 'wp_add_privacy_policy_content' ) ) {
54
+ $content = __( '<h2>Social Media Plugin "Shariff Wrapper"</h2>
55
+
56
+ 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>
57
+
58
+ On our website we offer share buttons for the following services / companies: AddThis, Diaspora, Facebook, Flattr, Flipboard, GooglePlus, LinkedIn, Mastodon, Odnoklassniki, Patreon, PayPal, Pinterest, Pocket, Qzone, Reddit, Stumbleupon, Telegram, TencentWeibo, Threema, Tumblr, Twitter, VK, Wallabag, Weibo, WhatsApp, Xing.', 'shariff' );
59
+ wp_add_privacy_policy_content( 'Shariff Wrapper', wp_kses_post( wpautop( $content, false ) ) );
60
+ }
61
+ }
62
+ add_action( 'admin_init', 'shariff3uu_privacy' );
63
+
64
  /** Require Shariff Widget. */
65
  require dirname( __FILE__ ) . '/includes/class-shariff-widget.php';
66
 
962
  // Enqueues the stylesheet (loading it here makes sure that it is only loaded on pages that actually contain shariff buttons).
963
  // If SCRIPT_DEBUG is set to true, the non minified version will be loaded.
964
  if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG === true ) {
965
+ wp_enqueue_style( 'shariffcss', plugins_url( '/css/shariff.css', __FILE__ ), '', $shariff3uu['version'] );
966
  } else {
967
  wp_enqueue_style( 'shariffcss', plugins_url( '/css/shariff.min.css', __FILE__ ), '', $shariff3uu['version'] );
968
  }
1122
  }
1123
  if ( 0 === $share_counts['total'] && array_key_exists( 'headline_zero', $atts ) && ! empty( $atts['headline_zero'] ) ) {
1124
  $atts['headline_zero'] = str_replace( '%total', '<span class="shariff-total">' . absint( $share_counts['total'] ) . '</span>', $atts['headline_zero'] );
1125
+ $output .= '<div class="ShariffHeadline">' . $atts['headline_zero'] . '</div>';
1126
  } else {
1127
  $atts['headline'] = str_replace( '%total', '<span class="shariff-total">' . absint( $share_counts['total'] ) . '</span>', $atts['headline'] );
1128
  $output .= '<div class="ShariffHeadline">' . $atts['headline'] . '</div>';