Shariff Wrapper - Version 4.3.0

Version Description

  • new service Odnoklassniki (thanks to rockhit)
  • new meta box allows for individual settings per post or page
  • new option to hide share counts that are zero
  • new option to disable dynamic cache lifespan (not recommended)
  • new option to set the button size to small, medium or large
  • new option to add a custom class to the container around Shariff
  • new option to open links in a popup (thanks to jackennils)
  • new option to use NewShareCount instead of OpenShareCount (Twitter)
  • added timestamp variable to be accessible via shortcode
  • fixed post timestamp for caching under certain conditions
  • fixed Facebook share count error for never crawled pages
  • fixed empty tab after sharing on certain mobile devices
  • fixed custom title attribute (thanks to kschlager)
  • updated Flattr user id for the future (thanks to poetaster)
  • reduced changelog on wordpress.org (thanks to timse201)
  • minor css improvements
  • updated help section
Download this release

Release Info

Developer 3UU
Plugin Icon 128x128 Shariff Wrapper
Version 4.3.0
Comparing to
See all releases

Code changes from version 4.2.1 to 4.3.0

admin/admin_menu.php CHANGED
@@ -80,7 +80,7 @@ function shariff3UU_options_init(){
80
  'shariff3UU_radio_theme_render', 'design', 'shariff3UU_design_section' );
81
 
82
  // button size
83
- add_settings_field( 'shariff3UU_checkbox_buttonsize', __( 'Reduce button size by 30%.', 'shariff' ),
84
  'shariff3UU_checkbox_buttonsize_render', 'design', 'shariff3UU_design_section' );
85
 
86
  // button stretch
@@ -116,12 +116,20 @@ function shariff3UU_options_init(){
116
  'shariff3UU_text_headline_render', 'design', 'shariff3UU_design_section' );
117
 
118
  // custom css
119
- add_settings_field( 'shariff3UU_text_style', __( 'CSS attributes for the container <span style="text-decoration: underline;">around</span> Shariff:', 'shariff' ),
120
  'shariff3UU_text_style_render', 'design', 'shariff3UU_design_section' );
 
 
 
 
121
 
122
  // hide until css loaded
123
  add_settings_field( 'shariff3UU_checkbox_hideuntilcss', __( 'Hide buttons until page is fully loaded.', 'shariff' ),
124
  'shariff3UU_checkbox_hideuntilcss_render', 'design', 'shariff3UU_design_section' );
 
 
 
 
125
 
126
  // third tab - advanced
127
 
@@ -245,6 +253,10 @@ function shariff3UU_options_init(){
245
  // share counts
246
  add_settings_field( 'shariff3UU_checkbox_sharecounts', __( 'Show share counts on buttons.', 'shariff' ),
247
  'shariff3UU_checkbox_sharecounts_render', 'statistic', 'shariff3UU_statistic_section' );
 
 
 
 
248
 
249
  // Facebook App ID
250
  add_settings_field( 'shariff3UU_text_fb_id', __( 'Facebook App ID:', 'shariff' ),
@@ -265,7 +277,15 @@ function shariff3UU_options_init(){
265
  // ttl
266
  add_settings_field( 'shariff3UU_number_ttl', __( 'Cache TTL in seconds (60 - 7200):', 'shariff' ),
267
  'shariff3UU_number_ttl_render', 'statistic', 'shariff3UU_statistic_section' );
268
-
 
 
 
 
 
 
 
 
269
  // disable services
270
  add_settings_field( 'shariff3UU_multiplecheckbox_disable_services', __( 'Disable the following services (share counts only):', 'shariff' ),
271
  'shariff3UU_multiplecheckbox_disable_services_render', 'statistic', 'shariff3UU_statistic_section' );
@@ -326,7 +346,7 @@ function shariff3UU_design_sanitize( $input ) {
326
 
327
  if ( isset( $input["lang"] ) ) $valid["lang"] = sanitize_text_field( $input["lang"] );
328
  if ( isset( $input["theme"] ) ) $valid["theme"] = sanitize_text_field( $input["theme"] );
329
- if ( isset( $input["buttonsize"] ) ) $valid["buttonsize"] = absint( $input["buttonsize"] );
330
  if ( isset( $input["buttonstretch"] ) ) $valid["buttonstretch"] = absint( $input["buttonstretch"] );
331
  if ( isset( $input["borderradius"] ) ) $valid["borderradius"] = absint( $input["borderradius"] );
332
  if ( isset( $input["maincolor"] ) ) $valid["maincolor"] = sanitize_text_field( $input["maincolor"] );
@@ -335,8 +355,10 @@ function shariff3UU_design_sanitize( $input ) {
335
  if ( isset( $input["align"] ) ) $valid["align"] = sanitize_text_field( $input["align"] );
336
  if ( isset( $input["align_widget"] ) ) $valid["align_widget"] = sanitize_text_field( $input["align_widget"] );
337
  if ( isset( $input["style"] ) ) $valid["style"] = sanitize_text_field( $input["style"] );
 
338
  if ( isset( $input["headline"] ) ) $valid["headline"] = wp_kses( $input["headline"], $GLOBALS["allowed_tags"] );
339
  if ( isset( $input["hideuntilcss"] ) ) $valid["hideuntilcss"] = absint( $input["hideuntilcss"] );
 
340
 
341
  // remove empty elements
342
  $valid = array_filter($valid);
@@ -395,17 +417,20 @@ function shariff3UU_statistic_sanitize( $input ) {
395
  // create array
396
  $valid = array();
397
 
398
- if ( isset( $input["backend"] ) ) $valid["backend"] = absint( $input["backend"] );
399
- if ( isset( $input["sharecounts"] ) ) $valid["sharecounts"] = absint( $input["sharecounts"] );
400
- if ( isset( $input["ranking"] ) ) $valid["ranking"] = absint( $input["ranking"] );
401
- if ( isset( $input["automaticcache"] ) ) $valid["automaticcache"] = absint( $input["automaticcache"] );
402
- if ( isset( $input["fb_id"] ) ) $valid["fb_id"] = sanitize_text_field( $input["fb_id"] );
403
- if ( isset( $input["fb_secret"] ) ) $valid["fb_secret"] = sanitize_text_field( $input["fb_secret"] );
404
- if ( isset( $input["ttl"] ) ) $valid["ttl"] = absint( $input["ttl"] );
405
- if ( isset( $input["disable"] ) ) $valid["disable"] = sani_arrays( $input["disable"] );
406
- if ( isset( $input["external_host"] ) ) $valid["external_host"] = str_replace( ' ', '', rtrim( esc_url_raw( $input["external_host"], "/" ) ) );
407
- if ( isset( $input["external_direct"] ) ) $valid["external_direct"] = absint( $input["external_direct"] );
408
- if ( isset( $input["subapi"] ) ) $valid["subapi"] = absint( $input["subapi"] );
 
 
 
409
 
410
  // protect users from themselfs
411
  if ( isset( $valid["ttl"] ) && $valid["ttl"] < '60' ) $valid["ttl"] = '';
@@ -451,7 +476,7 @@ function shariff3UU_text_services_render() {
451
  $services = '';
452
  }
453
  echo '<input type="text" name="shariff3UU_basic[services]" value="' . esc_html($services) . '" size="75" placeholder="twitter|facebook|googleplus|info">';
454
- echo '<p><code>facebook|twitter|googleplus|whatsapp|threema|pinterest|xing|linkedin|reddit|vk|diaspora|stumbleupon</code></p>';
455
  echo '<p><code>tumblr|addthis|pocket|flattr|patreon|paypal|paypalme|bitcoin|mailform|mailto|printer|rss|info</code></p>';
456
  echo '<p>' . __( 'Use the pipe sign | (Alt Gr + &lt; or &#8997; + 7) between two or more services.', 'shariff' ) . '</p>';
457
  }
@@ -595,10 +620,11 @@ function shariff3UU_radio_theme_render() {
595
 
596
  // button size
597
  function shariff3UU_checkbox_buttonsize_render() {
598
- $plugins_url = plugins_url();
599
- echo '<input type="checkbox" name="shariff3UU_design[buttonsize]" ';
600
- if ( isset( $GLOBALS["shariff3UU_design"]["buttonsize"] ) ) echo checked( $GLOBALS["shariff3UU_design"]["buttonsize"], 1, 0 );
601
- echo ' value="1"><img src="'. $plugins_url .'/shariff/pictos/smallBtns.png" align="middle">';
 
602
  }
603
 
604
  // button stretch
@@ -696,7 +722,18 @@ function shariff3UU_text_style_render() {
696
  else {
697
  $style = '';
698
  }
699
- echo '<input type="text" name="shariff3UU_design[style]" value="' . esc_html($style) . '" size="50" placeholder="' . __( "More information in the FAQ.", "shariff" ) . '">';
 
 
 
 
 
 
 
 
 
 
 
700
  }
701
 
702
  // hide until page is fully loaded
@@ -706,6 +743,13 @@ function shariff3UU_checkbox_hideuntilcss_render() {
706
  echo ' value="1">';
707
  }
708
 
 
 
 
 
 
 
 
709
  // advanced options
710
 
711
  // description advanced options
@@ -959,6 +1003,15 @@ function shariff3UU_checkbox_sharecounts_render() {
959
  }
960
  }
961
 
 
 
 
 
 
 
 
 
 
962
  // ranking
963
  function shariff3UU_number_ranking_render() {
964
  if ( isset($GLOBALS["shariff3UU_statistic"]["ranking"]) ) {
@@ -1012,6 +1065,24 @@ function shariff3UU_number_ttl_render() {
1012
  echo '<input type="number" name="shariff3UU_statistic[ttl]" value="'. $ttl .'" maxlength="4" min="60" max="7200" placeholder="60" style="width: 75px">';
1013
  }
1014
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1015
  // disable services
1016
  function shariff3UU_multiplecheckbox_disable_services_render() {
1017
  // Facebook
@@ -1022,7 +1093,7 @@ function shariff3UU_multiplecheckbox_disable_services_render() {
1022
  // Twitter
1023
  echo '<p><input type="checkbox" name="shariff3UU_statistic[disable][twitter]" ';
1024
  if ( isset( $GLOBALS['shariff3UU_statistic']['disable']['twitter'] ) ) echo checked( $GLOBALS['shariff3UU_statistic']['disable']['twitter'], 1, 0 );
1025
- echo ' value="1">OpenShareCount (Twitter)</p>';
1026
 
1027
  // GooglePlus
1028
  echo '<p><input type="checkbox" name="shariff3UU_statistic[disable][googleplus]" ';
@@ -1165,10 +1236,10 @@ function shariff3UU_help_section_callback() {
1165
  // button size
1166
  echo '<div style="display:table-row">';
1167
  echo '<div style="display:table-cell;border:1px solid;padding:10px">buttonsize</div>';
1168
- echo '<div style="display:table-cell;border:1px solid;padding:10px">big<br>small</div>';
1169
- echo '<div style="display:table-cell;border:1px solid;padding:10px">big</div>';
1170
  echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff buttonsize="small"]</div>';
1171
- echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Small reduces the size of all buttons by 30%, regardless of theme.', 'shariff' ) . '</div>';
1172
  echo '</div>';
1173
  // buttonstretch
1174
  echo '<div style="display:table-row">';
@@ -1234,6 +1305,22 @@ function shariff3UU_help_section_callback() {
1234
  echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff headline="&lt;hr style=\'margin:20px 0\'&gt;&lt;p&gt;' . __( 'Please share this post:', 'shariff' ) . '&lt;/p&gt;"]</div>';
1235
  echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Adds a headline above the Shariff buttons. Basic HTML as well as style and class attributes can be used. To remove a headline set on the plugins options page use headline="".', 'shariff' ) . '</div>';
1236
  echo '</div>';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1237
  // twitter_via
1238
  echo '<div style="display:table-row">';
1239
  echo '<div style="display:table-cell;border:1px solid;padding:10px">twitter_via</div>';
@@ -1302,7 +1389,7 @@ function shariff3UU_help_section_callback() {
1302
  echo '<div style="display:table-row">';
1303
  echo '<div style="display:table-cell;border:1px solid;padding:10px">url</div>';
1304
  echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
1305
- echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'The url of the current post or page.</div>', 'shariff' );
1306
  echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff url="http://www.mydomain.com/somepost"]</div>';
1307
  echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Changes the url to share. Only for special use cases.', 'shariff' ) . '</div>';
1308
  echo '</div>';
@@ -1310,10 +1397,18 @@ function shariff3UU_help_section_callback() {
1310
  echo '<div style="display:table-row">';
1311
  echo '<div style="display:table-cell;border:1px solid;padding:10px">title</div>';
1312
  echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
1313
- echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'The title of the current post or page.</div>', 'shariff' );
1314
  echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff title="' . __( 'My Post Title', 'shariff' ) . '"]</div>';
1315
  echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Changes the title to share. Only for special use cases.', 'shariff' ) . '</div>';
1316
  echo '</div>';
 
 
 
 
 
 
 
 
1317
  // rssfeed
1318
  echo '<div style="display:table-row">';
1319
  echo '<div style="display:table-cell;border:1px solid;padding:10px">rssfeed</div>';
@@ -1354,7 +1449,7 @@ function shariff3UU_status_section_callback() {
1354
  $post_url2 = esc_url( get_bloginfo( 'url' ) );
1355
 
1356
  // set services
1357
- $services = array( 'facebook', 'twitter', 'googleplus', 'pinterest', 'linkedin', 'xing', 'reddit', 'stumbleupon', 'tumblr', 'vk', 'addthis', 'flattr' );
1358
 
1359
  // we only need the backend part
1360
  $backend = '1';
80
  'shariff3UU_radio_theme_render', 'design', 'shariff3UU_design_section' );
81
 
82
  // button size
83
+ add_settings_field( 'shariff3UU_checkbox_buttonsize', __( 'Button size:', 'shariff' ),
84
  'shariff3UU_checkbox_buttonsize_render', 'design', 'shariff3UU_design_section' );
85
 
86
  // button stretch
116
  'shariff3UU_text_headline_render', 'design', 'shariff3UU_design_section' );
117
 
118
  // custom css
119
+ add_settings_field( 'shariff3UU_text_style', __( 'Custom CSS <u>attributes</u> for the container <u>around</u> Shariff:', 'shariff' ),
120
  'shariff3UU_text_style_render', 'design', 'shariff3UU_design_section' );
121
+
122
+ // custom css class
123
+ add_settings_field( 'shariff3UU_text_cssclass', __( 'Custom CSS <u>class</u> for the container <u>around</u> Shariff:', 'shariff' ),
124
+ 'shariff3UU_text_cssclass_render', 'design', 'shariff3UU_design_section' );
125
 
126
  // hide until css loaded
127
  add_settings_field( 'shariff3UU_checkbox_hideuntilcss', __( 'Hide buttons until page is fully loaded.', 'shariff' ),
128
  'shariff3UU_checkbox_hideuntilcss_render', 'design', 'shariff3UU_design_section' );
129
+
130
+ // open in popup
131
+ add_settings_field( 'shariff3UU_checkbox_popup', __( 'Open links in a popup (requires JavaScript).', 'shariff' ),
132
+ 'shariff3UU_checkbox_popup_render', 'design', 'shariff3UU_design_section' );
133
 
134
  // third tab - advanced
135
 
253
  // share counts
254
  add_settings_field( 'shariff3UU_checkbox_sharecounts', __( 'Show share counts on buttons.', 'shariff' ),
255
  'shariff3UU_checkbox_sharecounts_render', 'statistic', 'shariff3UU_statistic_section' );
256
+
257
+ // hide when zero
258
+ add_settings_field( 'shariff3UU_checkbox_hidezero', __( 'Hide share counts when they are zero.', 'shariff' ),
259
+ 'shariff3UU_checkbox_hidezero_render', 'statistic', 'shariff3UU_statistic_section' );
260
 
261
  // Facebook App ID
262
  add_settings_field( 'shariff3UU_text_fb_id', __( 'Facebook App ID:', 'shariff' ),
277
  // ttl
278
  add_settings_field( 'shariff3UU_number_ttl', __( 'Cache TTL in seconds (60 - 7200):', 'shariff' ),
279
  'shariff3UU_number_ttl_render', 'statistic', 'shariff3UU_statistic_section' );
280
+
281
+ // disable dynamic cache lifespan
282
+ add_settings_field( 'shariff3UU_checkbox_disable_dynamic_cache', __( 'Disable the dynamic cache lifespan (not recommended).', 'shariff' ),
283
+ 'shariff3UU_checkbox_disable_dynamic_cache_render', 'statistic', 'shariff3UU_statistic_section' );
284
+
285
+ // Twitter NewShareCount
286
+ add_settings_field( 'shariff3UU_checkbox_newsharecount', __( 'Use NewShareCount instead of OpenShareCount for Twitter.', 'shariff' ),
287
+ 'shariff3UU_checkbox_newsharecount_render', 'statistic', 'shariff3UU_statistic_section' );
288
+
289
  // disable services
290
  add_settings_field( 'shariff3UU_multiplecheckbox_disable_services', __( 'Disable the following services (share counts only):', 'shariff' ),
291
  'shariff3UU_multiplecheckbox_disable_services_render', 'statistic', 'shariff3UU_statistic_section' );
346
 
347
  if ( isset( $input["lang"] ) ) $valid["lang"] = sanitize_text_field( $input["lang"] );
348
  if ( isset( $input["theme"] ) ) $valid["theme"] = sanitize_text_field( $input["theme"] );
349
+ if ( isset( $input["buttonsize"] ) ) $valid["buttonsize"] = sanitize_text_field( $input["buttonsize"] );
350
  if ( isset( $input["buttonstretch"] ) ) $valid["buttonstretch"] = absint( $input["buttonstretch"] );
351
  if ( isset( $input["borderradius"] ) ) $valid["borderradius"] = absint( $input["borderradius"] );
352
  if ( isset( $input["maincolor"] ) ) $valid["maincolor"] = sanitize_text_field( $input["maincolor"] );
355
  if ( isset( $input["align"] ) ) $valid["align"] = sanitize_text_field( $input["align"] );
356
  if ( isset( $input["align_widget"] ) ) $valid["align_widget"] = sanitize_text_field( $input["align_widget"] );
357
  if ( isset( $input["style"] ) ) $valid["style"] = sanitize_text_field( $input["style"] );
358
+ if ( isset( $input["cssclass"] ) ) $valid["cssclass"] = sanitize_text_field( $input["cssclass"] );
359
  if ( isset( $input["headline"] ) ) $valid["headline"] = wp_kses( $input["headline"], $GLOBALS["allowed_tags"] );
360
  if ( isset( $input["hideuntilcss"] ) ) $valid["hideuntilcss"] = absint( $input["hideuntilcss"] );
361
+ if ( isset( $input["popup"] ) ) $valid["popup"] = absint( $input["popup"] );
362
 
363
  // remove empty elements
364
  $valid = array_filter($valid);
417
  // create array
418
  $valid = array();
419
 
420
+ if ( isset( $input["backend"] ) ) $valid["backend"] = absint( $input["backend"] );
421
+ if ( isset( $input["sharecounts"] ) ) $valid["sharecounts"] = absint( $input["sharecounts"] );
422
+ if ( isset( $input["hidezero"] ) ) $valid["hidezero"] = absint( $input["hidezero"] );
423
+ if ( isset( $input["ranking"] ) ) $valid["ranking"] = absint( $input["ranking"] );
424
+ if ( isset( $input["automaticcache"] ) ) $valid["automaticcache"] = absint( $input["automaticcache"] );
425
+ if ( isset( $input["fb_id"] ) ) $valid["fb_id"] = sanitize_text_field( $input["fb_id"] );
426
+ if ( isset( $input["fb_secret"] ) ) $valid["fb_secret"] = sanitize_text_field( $input["fb_secret"] );
427
+ if ( isset( $input["ttl"] ) ) $valid["ttl"] = absint( $input["ttl"] );
428
+ if ( isset( $input["disable_dynamic_cache"] ) ) $valid["disable_dynamic_cache"] = absint( $input["disable_dynamic_cache"] );
429
+ if ( isset( $input["newsharecount"] ) ) $valid["newsharecount"] = absint( $input["newsharecount"] );
430
+ if ( isset( $input["disable"] ) ) $valid["disable"] = sani_arrays( $input["disable"] );
431
+ if ( isset( $input["external_host"] ) ) $valid["external_host"] = str_replace( ' ', '', rtrim( esc_url_raw( $input["external_host"], "/" ) ) );
432
+ if ( isset( $input["external_direct"] ) ) $valid["external_direct"] = absint( $input["external_direct"] );
433
+ if ( isset( $input["subapi"] ) ) $valid["subapi"] = absint( $input["subapi"] );
434
 
435
  // protect users from themselfs
436
  if ( isset( $valid["ttl"] ) && $valid["ttl"] < '60' ) $valid["ttl"] = '';
476
  $services = '';
477
  }
478
  echo '<input type="text" name="shariff3UU_basic[services]" value="' . esc_html($services) . '" size="75" placeholder="twitter|facebook|googleplus|info">';
479
+ echo '<p><code>facebook|twitter|googleplus|whatsapp|threema|pinterest|xing|linkedin|reddit|vk|odnoklassniki|diaspora|stumbleupon</code></p>';
480
  echo '<p><code>tumblr|addthis|pocket|flattr|patreon|paypal|paypalme|bitcoin|mailform|mailto|printer|rss|info</code></p>';
481
  echo '<p>' . __( 'Use the pipe sign | (Alt Gr + &lt; or &#8997; + 7) between two or more services.', 'shariff' ) . '</p>';
482
  }
620
 
621
  // button size
622
  function shariff3UU_checkbox_buttonsize_render() {
623
+ $options = $GLOBALS['shariff3UU_design'];
624
+ if ( ! isset( $options['buttonsize'] ) ) $options['buttonsize'] = 'medium';
625
+ echo '<p><input type="radio" name="shariff3UU_design[buttonsize]" value="small" ' . checked( $options["buttonsize"], "small", 0 ) . '>' . __( "small", "shariff" ) . '</p>';
626
+ echo '<p><input type="radio" name="shariff3UU_design[buttonsize]" value="medium" ' . checked( $options["buttonsize"], "medium", 0 ) . '>' . __( "medium", "shariff" ) . '</p>';
627
+ echo '<p><input type="radio" name="shariff3UU_design[buttonsize]" value="large" ' . checked( $options["buttonsize"], "large", 0 ) . '>' . __( "large", "shariff" ) . '</p>';
628
  }
629
 
630
  // button stretch
722
  else {
723
  $style = '';
724
  }
725
+ echo '<input type="text" name="shariff3UU_design[style]" value="' . esc_html( $style ) . '" size="50" placeholder="' . __( "More information in the FAQ.", "shariff" ) . '">';
726
+ }
727
+
728
+ // custom css class
729
+ function shariff3UU_text_cssclass_render() {
730
+ if ( isset( $GLOBALS["shariff3UU_design"]["cssclass"] ) ) {
731
+ $cssclass = $GLOBALS["shariff3UU_design"]["cssclass"];
732
+ }
733
+ else {
734
+ $cssclass = '';
735
+ }
736
+ echo '<input type="text" name="shariff3UU_design[cssclass]" value="' . esc_html( $cssclass ) . '" size="50" placeholder="' . __( "More information in the FAQ.", "shariff" ) . '">';
737
  }
738
 
739
  // hide until page is fully loaded
743
  echo ' value="1">';
744
  }
745
 
746
+ // open links in a popup
747
+ function shariff3UU_checkbox_popup_render() {
748
+ echo '<input type="checkbox" name="shariff3UU_design[popup]" ';
749
+ if ( isset( $GLOBALS["shariff3UU_design"]["popup"] ) ) echo checked( $GLOBALS["shariff3UU_design"]["popup"], 1, 0 );
750
+ echo ' value="1">';
751
+ }
752
+
753
  // advanced options
754
 
755
  // description advanced options
1003
  }
1004
  }
1005
 
1006
+ // hide when zero
1007
+ function shariff3UU_checkbox_hidezero_render() {
1008
+ echo '<input type="checkbox" name="shariff3UU_statistic[hidezero]" ';
1009
+ if ( isset( $GLOBALS['shariff3UU_statistic']['hidezero'] ) ) {
1010
+ echo checked( $GLOBALS['shariff3UU_statistic']['hidezero'], 1, 0 );
1011
+ }
1012
+ echo ' value="1">';
1013
+ }
1014
+
1015
  // ranking
1016
  function shariff3UU_number_ranking_render() {
1017
  if ( isset($GLOBALS["shariff3UU_statistic"]["ranking"]) ) {
1065
  echo '<input type="number" name="shariff3UU_statistic[ttl]" value="'. $ttl .'" maxlength="4" min="60" max="7200" placeholder="60" style="width: 75px">';
1066
  }
1067
 
1068
+ // disable dynamic cache lifespan
1069
+ function shariff3UU_checkbox_disable_dynamic_cache_render() {
1070
+ echo '<input type="checkbox" name="shariff3UU_statistic[disable_dynamic_cache]" ';
1071
+ if ( isset( $GLOBALS['shariff3UU_statistic']['disable_dynamic_cache'] ) ) {
1072
+ echo checked( $GLOBALS['shariff3UU_statistic']['disable_dynamic_cache'], 1, 0 );
1073
+ }
1074
+ echo ' value="1">';
1075
+ }
1076
+
1077
+ // Twitter NewShareCount
1078
+ function shariff3UU_checkbox_newsharecount_render() {
1079
+ echo '<input type="checkbox" name="shariff3UU_statistic[newsharecount]" ';
1080
+ if ( isset( $GLOBALS['shariff3UU_statistic']['newsharecount'] ) ) {
1081
+ echo checked( $GLOBALS['shariff3UU_statistic']['newsharecount'], 1, 0 );
1082
+ }
1083
+ echo ' value="1">';
1084
+ }
1085
+
1086
  // disable services
1087
  function shariff3UU_multiplecheckbox_disable_services_render() {
1088
  // Facebook
1093
  // Twitter
1094
  echo '<p><input type="checkbox" name="shariff3UU_statistic[disable][twitter]" ';
1095
  if ( isset( $GLOBALS['shariff3UU_statistic']['disable']['twitter'] ) ) echo checked( $GLOBALS['shariff3UU_statistic']['disable']['twitter'], 1, 0 );
1096
+ echo ' value="1">Twitter</p>';
1097
 
1098
  // GooglePlus
1099
  echo '<p><input type="checkbox" name="shariff3UU_statistic[disable][googleplus]" ';
1236
  // button size
1237
  echo '<div style="display:table-row">';
1238
  echo '<div style="display:table-cell;border:1px solid;padding:10px">buttonsize</div>';
1239
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">small<br>medium<br>large</div>';
1240
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">medium</div>';
1241
  echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff buttonsize="small"]</div>';
1242
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Determines the button size regardless of theme choice.', 'shariff' ) . '</div>';
1243
  echo '</div>';
1244
  // buttonstretch
1245
  echo '<div style="display:table-row">';
1305
  echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff headline="&lt;hr style=\'margin:20px 0\'&gt;&lt;p&gt;' . __( 'Please share this post:', 'shariff' ) . '&lt;/p&gt;"]</div>';
1306
  echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Adds a headline above the Shariff buttons. Basic HTML as well as style and class attributes can be used. To remove a headline set on the plugins options page use headline="".', 'shariff' ) . '</div>';
1307
  echo '</div>';
1308
+ // style
1309
+ echo '<div style="display:table-row">';
1310
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">style</div>';
1311
+ echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
1312
+ echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
1313
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff style="margin:20px;"]</div>';
1314
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Adds custom <u>style</u> attributes to the container <u>around</u> Shariff.', 'shariff' ) . '</div>';
1315
+ echo '</div>';
1316
+ // cssclass
1317
+ echo '<div style="display:table-row">';
1318
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">cssclass</div>';
1319
+ echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
1320
+ echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
1321
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff class="classname"]</div>';
1322
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Adds a custom <u>class</u> to the container <u>around</u> Shariff.', 'shariff' ) . '</div>';
1323
+ echo '</div>';
1324
  // twitter_via
1325
  echo '<div style="display:table-row">';
1326
  echo '<div style="display:table-cell;border:1px solid;padding:10px">twitter_via</div>';
1389
  echo '<div style="display:table-row">';
1390
  echo '<div style="display:table-cell;border:1px solid;padding:10px">url</div>';
1391
  echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
1392
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'The url of the current post or page.', 'shariff' ) . '</div>';
1393
  echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff url="http://www.mydomain.com/somepost"]</div>';
1394
  echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Changes the url to share. Only for special use cases.', 'shariff' ) . '</div>';
1395
  echo '</div>';
1397
  echo '<div style="display:table-row">';
1398
  echo '<div style="display:table-cell;border:1px solid;padding:10px">title</div>';
1399
  echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
1400
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'The title of the current post or page.', 'shariff' ) . '</div>';
1401
  echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff title="' . __( 'My Post Title', 'shariff' ) . '"]</div>';
1402
  echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Changes the title to share. Only for special use cases.', 'shariff' ) . '</div>';
1403
  echo '</div>';
1404
+ // timestamp
1405
+ echo '<div style="display:table-row">';
1406
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">timestamp</div>';
1407
+ echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
1408
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'The timestamp of the last modification of the current post or page.', 'shariff' ) . '</div>';
1409
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff timestamp="1473240010"]</div>';
1410
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">' . __( 'Provides the time the current post or page was last modified as a timestamp. Used for determining the dynamic cache lifespan. Only for special use cases.', 'shariff' ) . '</div>';
1411
+ echo '</div>';
1412
  // rssfeed
1413
  echo '<div style="display:table-row">';
1414
  echo '<div style="display:table-cell;border:1px solid;padding:10px">rssfeed</div>';
1449
  $post_url2 = esc_url( get_bloginfo( 'url' ) );
1450
 
1451
  // set services
1452
+ $services = array( 'facebook', 'twitter', 'googleplus', 'pinterest', 'linkedin', 'xing', 'reddit', 'stumbleupon', 'tumblr', 'vk', 'addthis', 'flattr', 'odnoklassniki' );
1453
 
1454
  // we only need the backend part
1455
  $backend = '1';
admin/admin_metabox.php ADDED
@@ -0,0 +1,143 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Will be included in the shariff.php only, when user is logged in.
3
+
4
+ // prevent direct calls to admin_menu.php
5
+ if ( ! class_exists('WP') ) { die(); }
6
+
7
+ // call setup function on the post editor screen
8
+ add_action( 'load-post.php', 'shariff3UU_metabox_setup' );
9
+ add_action( 'load-post-new.php', 'shariff3UU_metabox_setup' );
10
+
11
+ // meta box setup function
12
+ function shariff3UU_metabox_setup() {
13
+ add_action( 'add_meta_boxes', 'shariff3UU_add_metabox' );
14
+ }
15
+
16
+ // add meta box
17
+ function shariff3UU_add_metabox() {
18
+ foreach( get_post_types() as $posttype ) {
19
+ add_meta_box( 'shariff_metabox', __( 'Shariff Settings', 'shariff' ), 'shariff3uu_build_metabox', $posttype, 'side', 'default' );
20
+ }
21
+ }
22
+
23
+ // build meta box
24
+ function shariff3uu_build_metabox() {
25
+ // scripts for pinterest image media uploader
26
+ wp_enqueue_media();
27
+ wp_register_script( 'shariff_mediaupload', plugins_url( '../js/shariff-media.js', __FILE__ ), array( 'jquery' ), '1.0', true );
28
+ $translation_array = array( 'choose_image' => __( 'Choose image', 'shariff' ) );
29
+ wp_localize_script( 'shariff_mediaupload', 'shariff_media', $translation_array );
30
+ wp_enqueue_script( 'shariff_mediaupload' );
31
+
32
+ // make sure the form request comes from WordPress
33
+ wp_nonce_field( basename( __FILE__ ), 'shariff_metabox_nonce' );
34
+
35
+ // retrieve the current metabox disable value
36
+ $shariff_metabox_disable = get_post_meta( get_the_ID(), 'shariff_metabox_disable', true );
37
+ // disable checkbox
38
+ echo '<p><strong>' . __( 'Disable Shariff', 'shariff' ) . '</strong><br>';
39
+ echo '<input type="checkbox" name="shariff_metabox_disable"';
40
+ if ( isset( $shariff_metabox_disable ) ) echo checked( $shariff_metabox_disable, 1, 0 );
41
+ echo '>';
42
+ echo '<label for="shariff_metabox_disable">' . __( 'Disable Shariff for this content.', 'shariff' ) . '</label></p>';
43
+
44
+ // retrieve the current metabox add before and after values
45
+ $shariff_metabox_before = get_post_meta( get_the_ID(), 'shariff_metabox_before', true );
46
+ $shariff_metabox_after = get_post_meta( get_the_ID(), 'shariff_metabox_after', true );
47
+ // add Shariff checkboxes
48
+ echo '<p><strong>' . __( 'Add Shariff', 'shariff' ) . '</strong><br>';
49
+ // before checkbox
50
+ echo '<input type="checkbox" name="shariff_metabox_before"';
51
+ if ( isset( $shariff_metabox_before ) ) echo checked( $shariff_metabox_before, 1, 0 );
52
+ echo '>';
53
+ echo '<label for="shariff_metabox_before">' . __( 'Add buttons <u>before</u> this content.', 'shariff' ) . '</label><br>';
54
+ // after checkbox
55
+ echo '<input type="checkbox" name="shariff_metabox_after"';
56
+ if ( isset( $shariff_metabox_after ) ) echo checked( $shariff_metabox_after, 1, 0 );
57
+ echo '>';
58
+ echo '<label for="shariff_metabox_after">' . __( 'Add buttons <u>after</u> this content.', 'shariff' ) . '</label></p>';
59
+
60
+ // retrieve the current metabox media value (pinterest image)
61
+ $shariff_metabox_media = get_post_meta( get_the_ID(), 'shariff_metabox_media', true );
62
+ // metabox shortcode
63
+ echo '<p><strong>' . __( 'Pinterest Image', 'shariff' ) . '</strong><br><label for="shariff_metabox_media">' . __( 'The complete url to your desired custom image for Pinterest.', 'shariff' ) . '</label><br>';
64
+ echo '<input type="text" name="shariff_metabox_media" value="' . esc_html( $shariff_metabox_media ) . '" id="shariff-image-url" style="width:55%; margin-right:5px"><input type="button" name="upload-btn" id="shariff-upload-btn" class="button-secondary" value="' . __( 'Choose image', 'shariff' ) . '"></p>';
65
+
66
+ // retrieve the current metabox shortcode value
67
+ $shariff_metabox = get_post_meta( get_the_ID(), 'shariff_metabox', true );
68
+ // metabox shortcode
69
+ echo '<p><strong>' . __( 'Shortcode', 'shariff' ) . '</strong><br><label for="shariff_metabox">' . __( 'The settings in this shortcode field overwrite <u>all</u> global settings.', 'shariff' ) . '</label><br>';
70
+ echo '<input type="text" name="shariff_metabox" value="' . esc_html( $shariff_metabox ) . '" placeholder="[shariff]" style="width:100%"></p>';
71
+
72
+ // retrieve the current metabox ignore widget value
73
+ $shariff_metabox_ignore_widget = get_post_meta( get_the_ID(), 'shariff_metabox_ignore_widget', true );
74
+ // disable checkbox
75
+ echo '<p><strong>' . __( 'Ignore Widgets', 'shariff' ) . '</strong><br>';
76
+ echo '<input type="checkbox" name="shariff_metabox_ignore_widget"';
77
+ if ( isset( $shariff_metabox_ignore_widget ) ) echo checked( $shariff_metabox_ignore_widget, 1, 0 );
78
+ echo '>';
79
+ echo '<label for="shariff_metabox_ignore_widget">' . __( 'Do not affect buttons in widgets.', 'shariff' ) . '</label></p>';
80
+ }
81
+
82
+ // save meta data
83
+ function shariff3UU_save_metabox_data( $post_id, $post ) {
84
+ // check nonce and if shariff_metabox is set
85
+ if ( isset( $_REQUEST['shariff_metabox_nonce'] ) && wp_verify_nonce( $_REQUEST['shariff_metabox_nonce'], basename( __FILE__ ) ) ) {
86
+ // check if we are not autosaving or previewing (revision)
87
+ $post_type_object = get_post_type_object( $post->post_type );
88
+ if ( ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) || wp_is_post_revision( $post ) || ( is_multisite() && ms_is_switched() ) || ! current_user_can( $post_type_object->cap->edit_post, $post_id ) ) {
89
+ return;
90
+ }
91
+ // else we are good to go and can save our meta box data
92
+ else {
93
+ // save meta box disable
94
+ if ( isset( $_POST['shariff_metabox_disable'] ) && $_POST['shariff_metabox_disable'] == 'on' ) {
95
+ update_post_meta( $post_id, 'shariff_metabox_disable', '1' );
96
+ }
97
+ else {
98
+ delete_post_meta( $post_id, 'shariff_metabox_disable', '1' );
99
+ }
100
+
101
+ // save meta box add before value
102
+ if ( isset( $_POST['shariff_metabox_before'] ) && $_POST['shariff_metabox_before'] == 'on' ) {
103
+ update_post_meta( $post_id, 'shariff_metabox_before', '1' );
104
+ }
105
+ else {
106
+ delete_post_meta( $post_id, 'shariff_metabox_before', '1' );
107
+ }
108
+
109
+ // save meta box add after value
110
+ if ( isset( $_POST['shariff_metabox_after'] ) && $_POST['shariff_metabox_after'] == 'on' ) {
111
+ update_post_meta( $post_id, 'shariff_metabox_after', '1' );
112
+ }
113
+ else {
114
+ delete_post_meta( $post_id, 'shariff_metabox_after', '1' );
115
+ }
116
+
117
+ // save meta box media
118
+ if ( isset( $_POST['shariff_metabox_media'] ) && ! empty( $_POST['shariff_metabox_media'] ) ) {
119
+ update_post_meta( $post_id, 'shariff_metabox_media', esc_url_raw( $_POST['shariff_metabox_media'] ) );
120
+ }
121
+ else {
122
+ delete_post_meta( $post_id, 'shariff_metabox_media' );
123
+ }
124
+
125
+ // save meta box shortcode
126
+ if ( isset( $_POST['shariff_metabox'] ) && ! empty( $_POST['shariff_metabox'] ) ) {
127
+ update_post_meta( $post_id, 'shariff_metabox', wp_kses( $_POST['shariff_metabox'], $GLOBALS["allowed_tags"] ) );
128
+ }
129
+ else {
130
+ delete_post_meta( $post_id, 'shariff_metabox' );
131
+ }
132
+
133
+ // save meta box ignore widgets
134
+ if ( isset( $_POST['shariff_metabox_ignore_widget'] ) && $_POST['shariff_metabox_ignore_widget'] == 'on' ) {
135
+ update_post_meta( $post_id, 'shariff_metabox_ignore_widget', '1' );
136
+ }
137
+ else {
138
+ delete_post_meta( $post_id, 'shariff_metabox_ignore_widget', '1' );
139
+ }
140
+ }
141
+ }
142
+ }
143
+ add_action( 'save_post', 'shariff3UU_save_metabox_data', 10, 2 );
changelog.txt ADDED
@@ -0,0 +1,551 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ === Shariff Wrapper ===
2
+
3
+ == Changelog ==
4
+
5
+ = 4.3.0 =
6
+ - new service Odnoklassniki (thanks to rockhit)
7
+ - new meta box allows for individual settings per post or page
8
+ - new option to hide share counts that are zero
9
+ - new option to disable dynamic cache lifespan (not recommended)
10
+ - new option to set the button size to small, medium or large
11
+ - new option to add a custom class to the container around Shariff
12
+ - new option to open links in a popup (thanks to jackennils)
13
+ - new option to use NewShareCount instead of OpenShareCount (Twitter)
14
+ - added timestamp variable to be accessible via shortcode
15
+ - fixed post timestamp for caching under certain conditions
16
+ - fixed Facebook share count error for never crawled pages
17
+ - fixed empty tab after sharing on certain mobile devices
18
+ - fixed custom title attribute (thanks to kschlager)
19
+ - updated Flattr user id for the future (thanks to poetaster)
20
+ - reduced changelog on wordpress.org (thanks to timse201)
21
+ - minor css improvements
22
+ - updated help section
23
+
24
+ = 4.2.1 =
25
+ - fixed WhatsApp button on Android when using Chrome
26
+ - fixed Shariff being added to RSS feeds under certain conditions
27
+ - updated to latest Facebook Graph API for share count requests
28
+
29
+ = 4.2.0 =
30
+ - new option to set the rate limit for sending mails using the mail form
31
+ - added home url as fallback for share count requests
32
+ - added further anti-spam prevention mechanics
33
+ - added noopener and noreferrer to share links
34
+ - fixed double encoding of share count request links
35
+ - updated media uploader request for translation
36
+ - updated handling of admin notices following WordPress core
37
+ - tested and optimized for WordPress 4.6
38
+
39
+ = 4.1.2 =
40
+ - new fallback for share count requests in case pretty permalinks are disabled
41
+ - new filter shariff3UU_render_atts to change options on the fly (thx Ov3rfly)
42
+ - fixed share title in cases with html encoded characters
43
+ - fixed double counting on ranking tab under certain conditions
44
+ - fixed php info notice in admin notices
45
+
46
+ = 4.1.1 =
47
+ - new option to disable the Shariff buttons outside of the main loop
48
+ - fixed Facebook App ID request
49
+ - minor css fix
50
+
51
+ = 4.1.0 =
52
+ - new design option to set a custom button color for all buttons
53
+ - new design option to set a border radius for the round theme (up to a square)
54
+ - new design option to hide all buttons until the page is fully loaded
55
+ - new mailform option to use a html anchor (again)
56
+ - new statistic option to fill the cache automatically
57
+ - new statistic option to set the amount of posts for the ranking tab
58
+ - new statistic option to use share counts with PHP < 5.4
59
+ - fixed preventing buttons from beeing added to excerpts under certain conditions
60
+ - fixed urlencoding of share count requests
61
+ - improved handling of wrong or mistyped service entries
62
+ - minor bug fixes
63
+
64
+ = 4.0.8 =
65
+ - new workaround for sites running PHP 5.2 and older
66
+
67
+ = 4.0.7 =
68
+ - new option for WordPress installations with REST API not reachable in root
69
+
70
+ = 4.0.6 =
71
+ - fixed an error in combination with bbpress
72
+ - fixed ab error on very old PHP versions
73
+ - fixed ranking tab
74
+ - minor css improvements
75
+
76
+ = 4.0.5 =
77
+ - fixed mail form link
78
+ - fixed xmlns for w3c
79
+
80
+ = 4.0.4 =
81
+ - removed some remaining wrong text domains for translations
82
+ - minor css fixes
83
+
84
+ = 4.0.3 =
85
+ - fixed mobile services not showing on certain tablets
86
+ - fixed type error on totalnumber when cache is empty
87
+ - fixed share count requests when WordPress is installed in a subdirectory
88
+ - fixed urlencoding of share url, title and media
89
+ - added width and height to SVGs to prevent large initial icons prior to css
90
+ - new classes shariff-buttons and shariff-link added
91
+ - removed local translation files due to switching to wordpress.org language packs
92
+ - minor css resets added
93
+
94
+ = 4.0.2 =
95
+ - added minor css resets to prevent influence of theme css
96
+ - fixed LinkedIn share link
97
+
98
+ = 4.0.1 =
99
+ - prevent php warning messages on unsuccessful includes while WP_DEBUG is active
100
+ - change text domain to match plugin slug
101
+
102
+ = 4.0.0 =
103
+ - complete overhaul of the plugin core
104
+ - buttons now also work without JavaScript
105
+ - icon font has been removed and replaced with SVGs
106
+ - share counts now use the WP REST API
107
+ - share counts now always show the last cached counts prior to updating them
108
+ - fixed duplicated share count requests
109
+ - new ranking tab shows the shares of your last 100 posts
110
+ - new service pocket
111
+ - new option to show the total amount of shares in the headline with %total
112
+ - new option to use the total amount of shares in your theme (see FAQ)
113
+ - new action hook shariff_share_counts (see FAQ)
114
+ - new option to change the priority of the shortcode filter
115
+ - new support for selective refresh introduced in WP 4.5
116
+ - new external API feature replaces the external host option (experimental, see FAQ)
117
+ - new support for SCRIPT_DEBUG
118
+ - css and js files are now only loaded on pages with Shariff buttons
119
+ - improved compatibility with plugin Autoptimize (force scripts in head)
120
+ - improved compatibility with multiple caching plugins
121
+ - all shortcodes are now being stripped from the mail message body
122
+ - fixed potential double sending of mails
123
+ - removed all jQuery dependencies
124
+ - requires at least WordPress 4.4 (only for share counts)
125
+ - we no longer support IE 8 (if it ever worked)
126
+ - updated status tab
127
+ - updated help section
128
+ - minor bug fixes
129
+ - code cleanup
130
+
131
+ = 3.4.2 =
132
+ - fixed share counts on mobile devices with exactly 360px width
133
+ - fixed error on the help tab regarding services (thx to Andreas)
134
+ - small css improvements
135
+ - added h4-h6 to the allowed tags for the headline
136
+
137
+ = 3.4.1 =
138
+ - changed diaspora share url to official one
139
+ - fixed css of rss button when using round theme in widget
140
+ - fixed accessibility of share button text
141
+ - added rssfeed option to help section
142
+ - updated to Heise version 1.23.0
143
+
144
+ = 3.4.0 =
145
+ - new service rss
146
+ - minor bug fixes
147
+ - update to Heise version 1.22.0
148
+
149
+ = 3.3.3 =
150
+ - fix anonymous function request for PHP < version 5.3
151
+
152
+ = 3.3.2 =
153
+ - improve/extend handling of custom post types
154
+ - fix Facebook ID call
155
+
156
+ = 3.3.1 =
157
+ - fix ttl setting on statistic tab
158
+ - reduce timeout for post requests to five seconds
159
+
160
+ = 3.3.0 =
161
+ - new option to use an external host for Shariff and the share count backend
162
+ - new share count service OpenShareCount.com for Twitter
163
+ - new settings tab "Statistic" for all options regarding the share counts
164
+ - new settings tab "Status" for all system checks to increase performance
165
+ - new design preview button without Twitter
166
+ - fix counter VK on design round
167
+ - fix Facebook total_count again
168
+ - fix double Twitter share windows under certain conditions
169
+ - reactivate Flattr counts, since they fixed their API
170
+ - purge Shariff transients on update, deactivate and uninstall
171
+ - code cleanup
172
+ - add vk to help section
173
+ - add a known bugs section to the readme
174
+
175
+ = 3.2.0 =
176
+ - new service VK
177
+ - new share count service VK
178
+ - new dynamic cache lifespan (ttl) based on post / page age (last modified)
179
+ - new option to disable individual services (only share counts)
180
+ - fix Facebook share counts now use total_counts again
181
+ - fix search for custom WP locations
182
+ - backend optimization
183
+ - temporarily disabled the Flattr counts (statistic) due to ongoing problems of the Flattr API
184
+ - fix use of wp_title() is/was deprecated in WP4.4
185
+
186
+ = 3.1.3 =
187
+ - fix ajax call when a custom permalink structure is used
188
+
189
+ = 3.1.2 =
190
+ - fix Facebook ID on 32-bit systems
191
+
192
+ = 3.1.1 =
193
+ - make admin help compatible to the new backend
194
+
195
+ = 3.1.0 =
196
+ - new option to add buttons before/after the excerpt
197
+ - new service Threema (thanks to medienverbinder)
198
+ - new service Diaspora (thanks to craiq)
199
+ - new service AddThis (thanks to bozana)
200
+ - new share count service AddThis (thanks to bozana)
201
+ - new service PayPal.Me
202
+ - new google icon
203
+ - fix title tag usage in some cases
204
+ - fix rel to data-rel popup
205
+ - fix round buttons in certain themes
206
+ - fix Flattr API to fetch counts again
207
+ - workaround to fix the wrong JSON answer of xing API
208
+ - up to date with Heise code version 1.21.0 2015-11-06
209
+
210
+ = 3.0.0 =
211
+ - new WP specific statistics backend for share counts
212
+ - new SHARIFF_WP_ROOT_PATH constant for custom wp locations
213
+ - automatic search for custom WP locations (thanks to hirasso)
214
+ - fix timeout issues and a lot of other backend issues
215
+ - deprecated Heise shariff-backend-php
216
+ - deprecated ZendFramework
217
+ - deprecated shariff3uu_cache directory
218
+ - deprecated SHARIFF_BACKEND_TMPDIR constant
219
+
220
+ = 2.4.3 =
221
+ - fix proxy settings
222
+ - fix PHP error notice caused by a race condition around concurrent requests in Zend_Cache
223
+ - fix PHP notice and error in backend on multisite
224
+
225
+ = 2.4.2 =
226
+ - fix lang attribute again
227
+ - fix update notice
228
+
229
+ = 2.4.1 =
230
+ - fix lang attribute
231
+ - nicer support hints about GD lib
232
+ - cleanup readme.txt
233
+
234
+ = 2.4.0 =
235
+ - ensure compatibility to WordPress 4.3
236
+ - new service Tumblr
237
+ - new service Patreon
238
+ - new service PayPal
239
+ - new service Bitcoin
240
+ - new supporting bbpress
241
+ - new using proxy settings from wp_config (thanks to Shogathu)
242
+ - fix automatic button language
243
+ - fix button language for Facebook
244
+ - fix problems with plugin "Hide Title"
245
+ - fix backend (statistic) for multisite environments
246
+ - fix backend (statistic) if WP_DEBUG is set to true
247
+ - fix language info in help section
248
+ - update to Heise version 1.16.0
249
+ - remove unnesseray guzzle docs
250
+
251
+ = 2.3.4 =
252
+ - add Italian language to the mailform
253
+
254
+ = 2.3.3 =
255
+ - fix Pinterest button, if pinit.js is present
256
+ - small css fixes
257
+
258
+ = 2.3.2 =
259
+ - add French (thanks Charlotte) and Italian (thanks Pier) translations
260
+ - improve screen reader compatibility
261
+ - fix: prefill mail_comment in case of an error
262
+ - fix: do not send more than 1 email as CC. Use a new mail for all recipients.
263
+ - fix: fallback to English at the email form only if language is not supported by this plugin
264
+ - cleanup mf_wait + extend time to wait of robots blocker to 2 sec
265
+
266
+ = 2.3.1 =
267
+ - fix facebook api (app id & secret)
268
+ - fix CSS mailform label
269
+
270
+ = 2.3.0 =
271
+ - redesing of the plugins options page
272
+ - mail form improved (a lot)
273
+ - split mail into mailform and mailto (check your manual shorttags!)
274
+ - new backend status section
275
+ - new option to use Facebook Graph API ID in case of rate limit problems
276
+ - new option to stretch the buttons horizontally
277
+ - new option to add a headline above the Shariff buttons
278
+ - many new button languages
279
+ - new default cache directory
280
+ - fix creation of default cache directory in case it is not month / year based
281
+ - fix url-shorttag-option in widget
282
+ - fix widget mailform link, if pressed twice
283
+ - fix widget mailform on blog page
284
+ - fix responsive flow of buttons in IE
285
+ - fix Twitter: prevent double encoding with text longer than 120 chars
286
+ - update shariff backend to 1.5.0 (Heise)
287
+ - update shariff JS to 1.14.0 (Heise)
288
+ - many more minor improvements
289
+ - code cleanup
290
+
291
+ = 2.2.4 =
292
+ - security fix
293
+
294
+ = 2.2.3 =
295
+ - extend blocking of shariff buttons within password protected posts
296
+
297
+ = 2.2.2 =
298
+ - allow email functionality only if service email is configured within the
299
+ admin menu as common service for all posts
300
+
301
+ = 2.2.1 =
302
+ - "fix" fallback to old twitter api again
303
+
304
+ = 2.2.0 =
305
+ - add option to hide Shariff on password protected posts
306
+ - tested up to WP 4.2.2
307
+ - "fix" fallback to old twitter api if another twitter script is found in order to avoid opening the share window twice
308
+ - share text of the mailto link now is "email"
309
+ - fix typo and cleanup code
310
+
311
+ = 2.1.2 =
312
+ - fix to make it work with PHP < 5.3 (you should really update your PHP version or change your hoster)
313
+
314
+ = 2.1.1 =
315
+ - change code because of a error with some PHP versions
316
+
317
+ = 2.1.0 =
318
+ - replace sender name if a name is provided with the mail form or set in admin menu
319
+ - add option to append the post content to the mail
320
+ - add mail header "Precedence: bulk" to avoid answers of autoresponder
321
+ - fix: rename a function to avoid problems with other plugins
322
+ - improve css
323
+
324
+ = 2.0.2 =
325
+ - fix: mail URLs must be a real link and not url-encoded
326
+ - hotfix: mail form disabled if not on single post. Avoid the
327
+ self destruction by the DOS-checker ;-)
328
+ - cleanup Shariff JS code (mailURL no longer needed)
329
+
330
+ = 2.0.1 =
331
+ - fix email form method POST
332
+
333
+ = 2.0.0 =
334
+ - changes to stay compatible to Heise implementation
335
+ - remove obsolet SHARIFF_ALL_POSTS
336
+ - fix some small css attributes (size)
337
+ - code clean up
338
+
339
+ = 1.9.9 =
340
+ - fix widget bug (wrong share links)
341
+
342
+ = 1.9.8 =
343
+ - add headers to avoid caching of backend data
344
+ - tested with WP 4.2 beta
345
+ - add option to use on custom pages (e.g. WooCommerce)
346
+ - better handling of pinterest media attribute
347
+ - bugfix: SHARIFF_BACKEND_TMPDIR in backend
348
+ - improve uninstal of cache dir (todo: change to a better named dir)
349
+ - add option to use smaller size buttons
350
+ - fix again target of the mailto-link
351
+ - cleanup code
352
+
353
+ = 1.9.7 =
354
+ - roll back to stable
355
+
356
+ = 1.9.6 =
357
+ - now really go back to 1st block in loop at WMPU
358
+
359
+ = 1.9.5 =
360
+ - nu abba: missing version update
361
+
362
+ = 1.9.4 =
363
+ - fix update bug on WPMS
364
+
365
+ = 1.9.3 =
366
+ - add missing backend files. Last change for this Sunday ;-)
367
+
368
+ = 1.9.2 =
369
+ - fix stupid bug with the update file :-( Sorry!
370
+ - fix initialisation of REMOTEHOSTS
371
+
372
+ = 1.9.1 =
373
+ - merge with original Shariff JS/CSS code version 1.9.3
374
+ - CSS theme default like Heise default again + "add" theme color
375
+ - fix the theme "white"
376
+ - backend now up to date
377
+ - disable WPDebug in backend config
378
+ - improve uninstall (options shariff3UU, shariff3UUversion,
379
+ widget_shariff) and compatible with multisite installations
380
+ - improve deactivation
381
+
382
+ = 1.9 =
383
+ - add Flattr
384
+ - improve version control
385
+ - update frensh translations
386
+ - use configuration from admin menu for blank shariff shortcodes
387
+ - own (much smaller) fonts
388
+
389
+ = 1.8.1 =
390
+ - remove the relativ network-path from service declarations (pinterest,
391
+ reddit, stumbleupon, xing) because it really makes no sense to change
392
+ the protocol within a popup of a secure target to unsecure connections
393
+ depending on the protocol the page is using
394
+ - change name of jQuery object to avoid conflicts with other plugins/themes
395
+
396
+ = 1.8 =
397
+ - add options to place Shariff (right/left/center)
398
+ - fix: migration check
399
+ - css optimized
400
+ - use the WP bundled jQuery now (save about 80% bandwidth :-)
401
+
402
+ = 1.7.1 =
403
+ - optimize css (thanks again to @jplambeck)
404
+ - code cleanup (No more warnings in debug mode. Perhaps ;-)
405
+ - sanitize admin input (thanks again to @jplambeck)
406
+ - set the title attribute to overwrite get_the_title() now supported
407
+ - fix: check SHARIFF_BACKEND_TMPDIR
408
+ - add uninstall script
409
+
410
+ = 1.7 =
411
+ - CHANGES: if no attributes are configured within a shorttag first try to
412
+ use the option from admin page. However if there are no services
413
+ configured use the old defaults of Heise to make it backward compatible
414
+ - add the new service attribut `mailto` to prepare getting the original
415
+ behavior of the Heise code that provide a email form with `mail`
416
+ - add option to put Shariff on overview page too
417
+ - add internal version tracker to enable better migration options in the
418
+ future
419
+ - optimized css for the info attribute, added priority to the title
420
+ attribute over DC.title attribute (thanks again to @jplambeck )
421
+
422
+ = 1.6.1 =
423
+ - fix: again enable WhatsUp on mobile now also works with Mozilla. Sorry
424
+ this has not been become part of the main branche. Therefor it was lost
425
+ with the last update :-(
426
+ - added .shariff span { color: inherit; } (thanks again to @jplambeck )
427
+
428
+ = 1.6. =
429
+ - adopted new responsive css code (thanks to @jplambeck )
430
+ - update included fa-fonts
431
+ - fix: descrition "printer"
432
+ - fix: use WP_CONTENT_URL in admin menu
433
+
434
+ = 1.5.4 =
435
+ - remove alternativ css with links to external hosters. If do you really
436
+ want enable breaking privacy plz feel free to code you own css
437
+
438
+ = 1.5.3 =
439
+ - hide counter within the theme round
440
+
441
+ = 1.5.2 =
442
+ - default backend temp dir now uses wp content dir
443
+ - updated original shariff JS code
444
+
445
+ = 1.5.1 =
446
+ - fix: constant had have a wrong declaration check
447
+
448
+ = 1.5.0 =
449
+ - add option "url" to set a fixed URI for all sites (only in shorttag and
450
+ widgets) because usually it is not a good idea to manipulate this
451
+ - fix: do not show error in elseif (/tmp check in admin menu)
452
+
453
+ = 1.4.4 =
454
+ - add option to force frensh and spanish buttons
455
+ - clean up theme selection
456
+
457
+ = 1.4.3 =
458
+ - look like wp_enqueue_script has problems with the shariff js code. Now own
459
+ script link at the end of the site. Should also improve performance ;-)
460
+
461
+ = 1.4.2 =
462
+ - fix: add the attribute data-title that is needed by the shariff on some
463
+ themes to render it above the other div containers.
464
+ - only long PHP-Tags because auf problems with WAMPs
465
+ - some code clean up. Hopefully it will become more robust on WAMP systems.
466
+
467
+ = 1.4.1 =
468
+ - fixed stupid typo with the SHARIFF_BACKEND_TMP constant
469
+
470
+ = 1.4.0 =
471
+ - add a DIV container to use positioning with CSS
472
+ - remove long PHP-tags that cause parse problem on Windows
473
+
474
+ = 1.3.0 =
475
+ - clean up the code
476
+ - add backend options (TTL and temp dir)
477
+
478
+ = 1.2.7 =
479
+ - fixed: enable WhatsUp on mobile now also works with Mozilla
480
+ - print button does not open a new window
481
+ - removed min.js make it more readable for own local changes
482
+
483
+ = 1.2.6 =
484
+ - add print button
485
+ - add default image for pinterest to avoid broken design and giuve a hint
486
+
487
+ = 1.2.5 =
488
+ - hotfix for pinterest (see FAQ)
489
+
490
+ = 1.2.4 =
491
+ - bugfix: widget does not work if SHARIFF_ALL_POSTS is set but not enabled
492
+ in the admin menu (Please remember, that SHARIFF_ALL_POSTS will be
493
+ removed with next major version)
494
+ - add option to add shariff at the begin of a post
495
+ - merge with new original backend for counters
496
+ - add spanish language on buttons; hide whatsup on mobile devices
497
+ (merge with yanniks code)
498
+ - add reddit
499
+ - add stumbleupon
500
+
501
+ = 1.2.3 =
502
+ - add round theme to the admin menu
503
+
504
+ = 1.2.2 =
505
+ - tested with WP 4.1
506
+ - added french language for buttons
507
+ - added theme "round" (round buttons without text but with fixed width)
508
+
509
+ = 1.2.1 =
510
+ - typos
511
+
512
+ = 1.2 =
513
+ - add widget support
514
+
515
+ = create a Stable1.0 tag =
516
+ - no new funtionality to this tag. Only bugfixes!
517
+
518
+ = 1.1.1 =
519
+ - add french language for the admin menu (thanks Celine ;-)
520
+ - fix backend problem on shared hosting with no writeable tmp dir
521
+
522
+ = 1.1 =
523
+ - add whatsapp|pinterest|linkedin|xing
524
+ - include latest upstream changes (fix mail etc.)
525
+ - add old default selection of services to make it backward compatible
526
+
527
+ = 1.0.2 =
528
+ - add German translation to the admin menu (Admin-Menue in Deutsch)
529
+ - code cleanup
530
+
531
+ = 1.0.1 =
532
+ - add PHP version check (5.4 is needed by the backend option)
533
+
534
+ = 1.0 =
535
+ - add admin menu page
536
+ - disable the default add on a post if a special formed tag was found
537
+ - add support for the theme attribute
538
+
539
+ = 0.4 =
540
+ - Include latest upstream changes
541
+ - use get_permalink() to set the parameter data-url
542
+
543
+ = 0.3 =
544
+ - add support for "hideshariff"
545
+ - add screenshots
546
+
547
+ = 0.2 =
548
+ - removed the private update server and changed test domain
549
+
550
+ = 0.1 =
551
+ - initial release
css/shariff.css CHANGED
@@ -1,6 +1,7 @@
1
  /* Shariff Wrapper */
2
  .shariff-main { display: block !important; }
3
  .shariff ul {
 
4
  display: flex;
5
  flex-direction: row;
6
  flex-flow: row wrap;
@@ -141,6 +142,29 @@
141
  padding: 0 !important;
142
  height: 25px !important;
143
  }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
144
  /* orientation vertical */
145
  .shariff .orientation-vertical { flex-direction: column; }
146
  .shariff .orientation-vertical li { width: 135px; }
@@ -253,6 +277,7 @@
253
  position: absolute;
254
  right: 0;
255
  top: 0;
 
256
  padding: 2px;
257
  text-decoration: none;
258
  box-shadow: none !important;
@@ -285,6 +310,8 @@
285
  }
286
  .shariff .buttonsize-small .shariff-button.info { width: 25px; }
287
  .shariff .buttonsize-small .info a { width: 25px; }
 
 
288
  .shariff .info .shariff-icon svg {
289
  display: block;
290
  margin: auto;
@@ -293,6 +320,7 @@
293
  @media only screen and (max-width: 360px) {
294
  .shariff .orientation-horizontal li { width: 35px; }
295
  .shariff .orientation-horizontal.buttonsize-small li { width: 25px; }
 
296
  .shariff .orientation-horizontal .shariff-icon svg { display: block; margin: auto; }
297
  .shariff .orientation-horizontal .shariff-count { display: none; }
298
  }
@@ -304,6 +332,7 @@
304
  @media only screen and (min-width: 768px) {
305
  .shariff .orientation-horizontal li { width: 130px; }
306
  .shariff .orientation-horizontal.buttonsize-small li { width: 105px; }
 
307
  .shariff .orientation-horizontal li .shariff-text { display: inline; }
308
  }
309
  @media only screen and (min-device-width: 1025px) {
1
  /* Shariff Wrapper */
2
  .shariff-main { display: block !important; }
3
  .shariff ul {
4
+ display: -webkit-flex;
5
  display: flex;
6
  flex-direction: row;
7
  flex-flow: row wrap;
142
  padding: 0 !important;
143
  height: 25px !important;
144
  }
145
+ /* buttonsize large */
146
+ .shariff .buttonsize-large li { height: 45px !important; }
147
+ .shariff .buttonsize-large a { height: 45px !important; }
148
+ .shariff .buttonsize-large.orientation-vertical li { width: 155px; }
149
+ .shariff .buttonsize-large .shariff-icon svg {
150
+ width: 40px;
151
+ height: 28px;
152
+ padding: 9px 2px;
153
+ }
154
+ .shariff .buttonsize-large .shariff-text,
155
+ .shariff .buttonsize-large .shariff-count {
156
+ font-size: 14px;
157
+ line-height: 45px;
158
+ padding: 0 10px;
159
+ height: 43px;
160
+ }
161
+ .shariff .buttonsize-large .shariff-text { padding-left: 1px !important; }
162
+ .shariff .buttonsize-large.theme-round li { width: 45px !important; }
163
+ .shariff .buttonsize-large.theme-round a { width: 45px !important; }
164
+ .shariff .buttonsize-large.theme-round .shariff-count {
165
+ padding: 0 !important;
166
+ height: 45px !important;
167
+ }
168
  /* orientation vertical */
169
  .shariff .orientation-vertical { flex-direction: column; }
170
  .shariff .orientation-vertical li { width: 135px; }
277
  position: absolute;
278
  right: 0;
279
  top: 0;
280
+ width: 20px;
281
  padding: 2px;
282
  text-decoration: none;
283
  box-shadow: none !important;
310
  }
311
  .shariff .buttonsize-small .shariff-button.info { width: 25px; }
312
  .shariff .buttonsize-small .info a { width: 25px; }
313
+ .shariff .buttonsize-large .shariff-button.info { width: 45px; }
314
+ .shariff .buttonsize-large .info a { width: 45px; }
315
  .shariff .info .shariff-icon svg {
316
  display: block;
317
  margin: auto;
320
  @media only screen and (max-width: 360px) {
321
  .shariff .orientation-horizontal li { width: 35px; }
322
  .shariff .orientation-horizontal.buttonsize-small li { width: 25px; }
323
+ .shariff .orientation-horizontal.buttonsize-large li { width: 45px; }
324
  .shariff .orientation-horizontal .shariff-icon svg { display: block; margin: auto; }
325
  .shariff .orientation-horizontal .shariff-count { display: none; }
326
  }
332
  @media only screen and (min-width: 768px) {
333
  .shariff .orientation-horizontal li { width: 130px; }
334
  .shariff .orientation-horizontal.buttonsize-small li { width: 105px; }
335
+ .shariff .orientation-horizontal.buttonsize-large li { width: 155px; }
336
  .shariff .orientation-horizontal li .shariff-text { display: inline; }
337
  }
338
  @media only screen and (min-device-width: 1025px) {
css/shariff.min.css CHANGED
@@ -1 +1 @@
1
- .shariff-main{display:block!important}.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-type:none!important;list-style-image: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;box-sizing:border-box;border:0;color:#fff;text-decoration:none;background-image:none!important}.shariff a:hover{color:#fff;background-color:inherit!important;text-decoration:none!important}.shariff span{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;fill:#fff}.shariff-button::before{content:none!important}.shariff .theme-color .shariff-count{background-color:transparent!important;color:#fff!important}.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-white a{background-color:#fff!important;border:1px solid #ddd}.shariff .theme-white a:hover{background-color:#eee!important}.shariff .theme-white svg{fill:inherit}.shariff .theme-white .shariff-count{background-color:transparent;margin:0}.shariff .theme-round li{background:none;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 .buttonsize-small li{height:25px!important}.shariff .buttonsize-small a{height:25px!important}.shariff .buttonsize-small.orientation-vertical li{width:115px}.shariff .buttonsize-small .shariff-icon svg{width:22px;height:15px;padding:5px 1px}.shariff .buttonsize-small .shariff-text,.shariff .buttonsize-small .shariff-count{font-size:11px;line-height:25px;padding:0 5px;height:23px}.shariff .buttonsize-small .shariff-text{padding-left:1px!important}.shariff .buttonsize-small.theme-round li{width:25px!important}.shariff .buttonsize-small.theme-round a{width:25px!important}.shariff .buttonsize-small.theme-round .shariff-count{padding:0!important;height:25px!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 .theme-default li,.widget .shariff .theme-color li,.widget .shariff .theme-grey li,.widget .shariff .theme-round li{border:medium none;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_mailform{background:#eee none repeat scroll 0 0;border:1px solid;margin:10px;max-width:750px;padding:10px 15px}.shariff_mailform form{margin:0!important}.shariff_mailform fieldset{border:none;margin:0!important;padding:0}.shariff_mailform label{margin-left:3px;display:inline-block}.shariff_mailform p{margin:10px 0!important}.shariff_mailform textarea{height:auto!important;margin:0!important;padding:0;width:100%}.shariff_mailform input,.shariff_mailform select{vertical-align:baseline;height:2.2rem;padding:0 10px;width:100%;margin:0!important}.shariff_mailform_error{color:red;font-weight:700;padding:0 0 5px}.shariff_mailform_disabled{color:red;font-weight:700;padding:2px 0 0}.shariff_mailform_headline{position:relative;padding:0}.shariff_mailform_headline legend{font-weight:700!important}.shariff_mailform_submit{cursor:pointer}.shariff_closeX{position:absolute;right:0;top:0;padding:2px;text-decoration:none;box-shadow:none!important;border:none!important;cursor:pointer}.shariff_closeX svg:hover{fill:#c00}#shariff_mailform_url{display:none!important}.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 .buttonsize-small .shariff-button.info{width:25px}.shariff .buttonsize-small .info a{width:25px}.shariff .info .shariff-icon svg{display:block;margin:auto}@media only screen and (max-width: 360px){.shariff .orientation-horizontal li{width:35px}.shariff .orientation-horizontal.buttonsize-small li{width:25px}.shariff .orientation-horizontal .shariff-icon svg{display:block;margin:auto}.shariff .orientation-horizontal .shariff-count{display:none}}@media only screen and (min-width: 361px){.shariff .orientation-horizontal li{width:80px}.shariff .orientation-horizontal li .shariff-text{display:block}.shariff .orientation-horizontal li .shariff-count{display:block}}@media only screen and (min-width: 768px){.shariff .orientation-horizontal li{width:130px}.shariff .orientation-horizontal.buttonsize-small li{width:105px}.shariff .orientation-horizontal li .shariff-text{display:inline}}@media only screen and (min-device-width: 1025px){.shariff .shariff-mobile{display:none!important}}
1
+ .shariff-main{display:block!important}.shariff ul{display:-webkit-flex;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-type:none!important;list-style-image: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;box-sizing:border-box;border:0;color:#fff;text-decoration:none;background-image:none!important}.shariff a:hover{color:#fff;background-color:inherit!important;text-decoration:none!important}.shariff span{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;fill:#fff}.shariff-button::before{content:none!important}.shariff .theme-color .shariff-count{background-color:transparent!important;color:#fff!important}.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-white a{background-color:#fff!important;border:1px solid #ddd}.shariff .theme-white a:hover{background-color:#eee!important}.shariff .theme-white svg{fill:inherit}.shariff .theme-white .shariff-count{background-color:transparent;margin:0}.shariff .theme-round li{background:none;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 .buttonsize-small li{height:25px!important}.shariff .buttonsize-small a{height:25px!important}.shariff .buttonsize-small.orientation-vertical li{width:115px}.shariff .buttonsize-small .shariff-icon svg{width:22px;height:15px;padding:5px 1px}.shariff .buttonsize-small .shariff-text,.shariff .buttonsize-small .shariff-count{font-size:11px;line-height:25px;padding:0 5px;height:23px}.shariff .buttonsize-small .shariff-text{padding-left:1px!important}.shariff .buttonsize-small.theme-round li{width:25px!important}.shariff .buttonsize-small.theme-round a{width:25px!important}.shariff .buttonsize-small.theme-round .shariff-count{padding:0!important;height:25px!important}.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 .buttonsize-large.theme-round li{width: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 .theme-default li,.widget .shariff .theme-color li,.widget .shariff .theme-grey li,.widget .shariff .theme-round li{border:medium none;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_mailform{background:#eee none repeat scroll 0 0;border:1px solid;margin:10px;max-width:750px;padding:10px 15px}.shariff_mailform form{margin:0!important}.shariff_mailform fieldset{border:none;margin:0!important;padding:0}.shariff_mailform label{margin-left:3px;display:inline-block}.shariff_mailform p{margin:10px 0!important}.shariff_mailform textarea{height:auto!important;margin:0!important;padding:0;width:100%}.shariff_mailform input,.shariff_mailform select{vertical-align:baseline;height:2.2rem;padding:0 10px;width:100%;margin:0!important}.shariff_mailform_error{color:red;font-weight:700;padding:0 0 5px}.shariff_mailform_disabled{color:red;font-weight:700;padding:2px 0 0}.shariff_mailform_headline{position:relative;padding:0}.shariff_mailform_headline legend{font-weight:700!important}.shariff_mailform_submit{cursor:pointer}.shariff_closeX{position:absolute;right:0;top:0;width:20px;padding:2px;text-decoration:none;box-shadow:none!important;border:none!important;cursor:pointer}.shariff_closeX svg:hover{fill:#c00}#shariff_mailform_url{display:none!important}.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 .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 .orientation-horizontal li{width:35px}.shariff .orientation-horizontal.buttonsize-small li{width:25px}.shariff .orientation-horizontal.buttonsize-large li{width:45px}.shariff .orientation-horizontal .shariff-icon svg{display:block;margin:auto}.shariff .orientation-horizontal .shariff-count{display:none}}@media only screen and (min-width: 361px){.shariff .orientation-horizontal li{width:80px}.shariff .orientation-horizontal li .shariff-text{display:block}.shariff .orientation-horizontal li .shariff-count{display:block}}@media only screen and (min-width: 768px){.shariff .orientation-horizontal li{width:130px}.shariff .orientation-horizontal.buttonsize-small li{width:105px}.shariff .orientation-horizontal.buttonsize-large li{width:155px}.shariff .orientation-horizontal li .shariff-text{display:inline}}@media only screen and (min-device-width: 1025px){.shariff .shariff-mobile{display:none!important}}
js/shariff-popup.js ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ // shariff add click listener function
2
+ function shariff_click() {
3
+ // enabled strict mode
4
+ "use strict";
5
+ // get elements
6
+ var classname = document.getElementsByClassName("shariff-link");
7
+ // set all event listeners
8
+ for ( var i = 0; i < classname.length; i++ ) {
9
+ classname[i].addEventListener('click', shariff_popup, false);
10
+ }
11
+ }
12
+ // actual popup function
13
+ function shariff_popup( evt ) {
14
+ // set variables
15
+ var t = this.getAttribute('href');
16
+ var o = screen.width/2-350;
17
+ var r = screen.height/2-250;
18
+ var l = t.length;
19
+ // open popup if not one of the special services
20
+ if ( t.substring( 0, 7 ) != "mailto:" && t.substring( l-9 ) != "view=mail" && t != "javascript:window.print()" && t != "http://ct.de/-2467514" ) {
21
+ // prevent default action
22
+ evt.preventDefault();
23
+ // open popup
24
+ window.open( t,"_blank","height=500, width=700, status=yes, toolbar=no, menubar=no, location=no, top="+r+", left="+o );
25
+ // return false to prevent tab opening in some browsers
26
+ return false;
27
+ }
28
+ }
29
+ // add event listener to call shariff popup function after DOM
30
+ document.addEventListener( "DOMContentLoaded", shariff_click, false );
js/shariff-popup.min.js ADDED
@@ -0,0 +1 @@
 
1
+ function shariff_click(){"use strict";for(var a=document.getElementsByClassName("shariff-link"),b=0;b<a.length;b++)a[b].addEventListener("click",shariff_popup,!1)}function shariff_popup(a){var b=this.getAttribute("href"),c=screen.width/2-350,d=screen.height/2-250,e=b.length;if("mailto:"!=b.substring(0,7)&&"view=mail"!=b.substring(e-9)&&"javascript:window.print()"!=b&&"http://ct.de/-2467514"!=b)return a.preventDefault(),window.open(b,"_blank","height=500, width=700, status=yes, toolbar=no, menubar=no, location=no, top="+d+", left="+c),!1}document.addEventListener("DOMContentLoaded",shariff_click,!1);
js/shariff.js CHANGED
@@ -88,7 +88,7 @@ function shariff_add_share_counts( share_url, data, containers ) {
88
  var shariff_count = containers[d].getElementsByClassName("shariff-count");
89
  for ( var s = 0; shariff_count[s]; s++ ) {
90
  // add share count, if we have one, and make it visible
91
- if ( data !== null && typeof data[shariff_count[s].dataset.service] !== 'undefined' ) {
92
  shariff_count[s].innerHTML = data[shariff_count[s].dataset.service];
93
  shariff_count[s].style.opacity = '1';
94
  }
88
  var shariff_count = containers[d].getElementsByClassName("shariff-count");
89
  for ( var s = 0; shariff_count[s]; s++ ) {
90
  // add share count, if we have one, and make it visible
91
+ if ( data !== null && typeof data[shariff_count[s].dataset.service] !== 'undefined' && ( typeof containers[d].dataset.hidezero === 'undefined' || ( containers[d].dataset.hidezero == '1' && data[shariff_count[s].dataset.service] > 0 ) ) ) {
92
  shariff_count[s].innerHTML = data[shariff_count[s].dataset.service];
93
  shariff_count[s].style.opacity = '1';
94
  }
js/shariff.min.js CHANGED
@@ -1 +1 @@
1
- function shariff_share_counts(){"use strict";for(var e=document.getElementsByClassName("shariff"),t={},s=0;e[s];s++){var a=e[s].dataset.url,n=e[s].dataset.services,r=e[s].dataset.timestamp,f=e[s].dataset.backendurl;"undefined"==typeof f&&(f="/wp-json/shariff/v1/share_counts?");var i=f+"url="+a+"&services="+n+"&timestamp="+r;if("undefined"!=typeof n)if(t[a]){n=t[a][1]+"|"+n;var o=n.split("|");o=o.filter(function(e,t,s){return s.indexOf(e)==t}),n=o.join("|"),i=f+"url="+a+"&services="+n+"&timestamp="+r,t[a]=[a,n,r,i]}else t[a]=[a,n,r,i]}for(var u in t)t.hasOwnProperty(u)&&shariff_get_share_counts(t[u][0],t[u][3],e)}function shariff_get_share_counts(e,t,s){var a=new XMLHttpRequest;a.open("GET",t,!0),a.onload=function(){a.status>=200&&a.status<400&&shariff_add_share_counts(e,JSON.parse(a.responseText),s)},a.send()}function shariff_add_share_counts(e,t,s){for(var a=0;s[a];a++)if(s[a].dataset.url==e){for(var n=s[a].getElementsByClassName("shariff-totalnumber"),r=0;n[r];r++)null!==t&&"undefined"!=typeof t.total&&(n[r].innerHTML=t.total);for(var f=s[a].getElementsByClassName("shariff-total"),i=0;f[i];i++)null!==t&&"undefined"!=typeof t.total&&(f[i].innerHTML=t.total);for(var o=s[a].getElementsByClassName("shariff-count"),u=0;o[u];u++)null!==t&&"undefined"!=typeof t[o[u].dataset.service]&&(o[u].innerHTML=t[o[u].dataset.service],o[u].style.opacity="1")}}document.addEventListener("DOMContentLoaded",shariff_share_counts,!1);
1
+ function shariff_share_counts(){"use strict";for(var a=document.getElementsByClassName("shariff"),b={},c=0;a[c];c++){var d=a[c].dataset.url,e=a[c].dataset.services,f=a[c].dataset.timestamp,g=a[c].dataset.backendurl;"undefined"==typeof g&&(g="/wp-json/shariff/v1/share_counts?");var h=g+"url="+d+"&services="+e+"&timestamp="+f;if("undefined"!=typeof e)if(b[d]){e=b[d][1]+"|"+e;var i=e.split("|");i=i.filter(function(a,b,c){return c.indexOf(a)==b}),e=i.join("|"),h=g+"url="+d+"&services="+e+"&timestamp="+f,b[d]=[d,e,f,h]}else b[d]=[d,e,f,h]}for(var j in b)b.hasOwnProperty(j)&&shariff_get_share_counts(b[j][0],b[j][3],a)}function shariff_get_share_counts(a,b,c){var d=new XMLHttpRequest;d.open("GET",b,!0),d.onload=function(){d.status>=200&&d.status<400&&shariff_add_share_counts(a,JSON.parse(d.responseText),c)},d.send()}function shariff_add_share_counts(a,b,c){for(var d=0;c[d];d++)if(c[d].dataset.url==a){for(var e=c[d].getElementsByClassName("shariff-totalnumber"),f=0;e[f];f++)null!==b&&"undefined"!=typeof b.total&&(e[f].innerHTML=b.total);for(var g=c[d].getElementsByClassName("shariff-total"),h=0;g[h];h++)null!==b&&"undefined"!=typeof b.total&&(g[h].innerHTML=b.total);for(var i=c[d].getElementsByClassName("shariff-count"),j=0;i[j];j++)null!==b&&"undefined"!=typeof b[i[j].dataset.service]&&("undefined"==typeof c[d].dataset.hidezero||"1"==c[d].dataset.hidezero&&b[i[j].dataset.service]>0)&&(i[j].innerHTML=b[i[j].dataset.service],i[j].style.opacity="1")}}document.addEventListener("DOMContentLoaded",shariff_share_counts,!1);
pictos/smallBtns.png DELETED
Binary file
pictos/stretchBtns.png DELETED
Binary file
pictos/verticalBtns.png DELETED
Binary file
readme.txt CHANGED
@@ -2,10 +2,10 @@
2
  Contributors: 3UU, starguide
3
  Tags: Shariff, Facebook, Twitter, VKontakte, VK, GooglePlus, WhatsApp, share buttons, sharing, privacy, social
4
  Requires at least: 4.4
5
- Tested up to: 4.6
6
- Stable tag: 4.2.1
7
  License: MIT
8
- License URI: http://opensource.org/licenses/MIT
9
  Donate link: http://folge.link/?bitcoin=1Ritz1iUaLaxuYcXhUCoFhkVRH6GWiMTP
10
 
11
  The Shariff Wrapper provides share buttons that respect the privacy of your visitors and are compliant to German data protection laws.
@@ -62,7 +62,7 @@ WARNING: This hook will get called A LOT. So be sure you know what you are doing
62
  A: It uses the same options that have been configured on the plugin options page. However, you can put in a shorttag that overwrites the default options. It has the same format as you use in posts. Take a look at the help section of the plugin options page for more information.
63
 
64
  = Q: Can I change the options on a single post? =
65
- A: Yes. If the [shariff] shortcut is found in a post, it has priority over all settings from the plugin options page.
66
 
67
  = Q: Why are shares not listed? =
68
  A: Shariff tries to protect the privacy of your visitors. In order to do this, the statistics have to be requested by your server, so social networks only see a request of your server and not from your visitor. However, we do not know, if you want this. Therefore it is not enabled by default.
@@ -71,15 +71,15 @@ A: Shariff tries to protect the privacy of your visitors. In order to do this, t
71
  A: Enable it on the plugin options page in general or add `backend="on"` to the shariff shorttag in your post.
72
 
73
  = Q: I still do not see share counts =
74
- A: Please have a look at the status tab on the plugin options page. It states wether share counts are enabled and if there is a problem with a service. Please also keep in mind that the plugin has a minimum refresh time of 60 seconds and the each service has their own cache as well.
75
 
76
  = Q: Why can't I change the TTL to a smaller / bigger value? =
77
  A: The time to live (TTL) value determines, if a share count of a post or page gets refreshed when someone visits this specific page / post of your blog. Too small values create too much useless traffic, too high values negate the goal of motivating visitors to also share a post. The value can be adjusted between 60 and 7200 seconds. Keep in mind, the actual lifespan depends on the age of the post as well.
78
 
79
- = Q: I get the Facebook API error message "request limit reached" =
80
  A: Facebook has a rate limit of 600 requests per 600 seconds per IP address. Especially in shared hosting environments many domains share the same IP address and therefore the same limit. To avoid this you can try to raise the TTL value or provide a Facebook App ID and Secret. Google "facebook app id secret" will provide many guides on how to get these.
81
 
82
- = Q: How can I change the position of all buttons =
83
  A: Have a look at the alignment options in the admin menu or checkout the
84
  style option.
85
 
@@ -88,7 +88,7 @@ A: Have a look at the parameters "theme", "orientation" and "buttonsize". They w
88
  overview. But please be warned: This is a test page! It is possible that you find features that are only provided in the development version. Use it only to get an impression of the design options.
89
 
90
  = Q: How can I change the design of a single button? =
91
- A: If you are a CSS guru please feel free to modify the css file. But of course this is a bad idea, because all changes will be destroyed with the next update! Instead take a look at the style attribute of the shorttag. If you put in any value it will create a DIV container with the ID "ShariffSC" around the buttons. If you are really a CSS guru you will know what does the magic from here on out. ;-)
92
 
93
  = Q: I want the buttons to stay fixed while scrolling! =
94
  A: No problem. Just use the style attribute to add some CSS to the shorttag. For example in a widget (adjust the width as needed):
@@ -105,18 +105,18 @@ A: Use the headline attribute to add or remove it. For example, you can use the
105
  Of course you can use all other options in that shorttag as well.
106
 
107
  = Q: Can I add [shariff] on all posts? =
108
- A: Yes, check out the plugin options page.
109
 
110
  = Q: But I want to hide it on a single post! =
111
- A: Do you really know what you want? ;-) However, it is possible. Write anywhere in your post "hideshariff". It will be removed and Shariff will not be added. This will make it compatible with the other plugin "Shariff for Wordpress". You can also use "/hideshariff" to write "hideshariff" in your post.
112
 
113
- = Q: What are the differences between these two plugins? =
114
  A: One is developed by us, one by someone else. ;-) The main difference is that this plugin has a few more options and a great support. :-) Neither of the plugins are "official" or directly developed by Heise.
115
 
116
  = Q: Does it work with a CDN? =
117
  A: Yes.
118
 
119
- = Q: Pinterest does not show an image =
120
  A: You can add media="http://wwww.example.com/yourImage.png"
121
  within the [shariff] shorttag or add it in on the plugin options page - of course with the link to your image.
122
 
@@ -137,6 +137,9 @@ A: Yes, take a look at the Mail Form tab on the plugin options page.
137
  = Q: What happened to the Twitter share counts and what is OpenShareCount? =
138
  A: Please read: https://www.jplambeck.de/twitter-saveoursharecounts/
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!
@@ -172,10 +175,29 @@ fixed in the future - if we have time to spend or you provide us with a lot of "
172
 
173
  == Changelog ==
174
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
175
  = 4.2.1 =
176
- - fix WhatsApp button on Android when using Chrome
177
- - fix Shariff being added to RSS feeds under certain conditions
178
- - update to latest Facebook Graph API for share count requests
179
 
180
  = 4.2.0 =
181
  - new option to set the rate limit for sending mails using the mail form
@@ -190,13 +212,13 @@ fixed in the future - if we have time to spend or you provide us with a lot of "
190
  = 4.1.2 =
191
  - new fallback for share count requests in case pretty permalinks are disabled
192
  - new filter shariff3UU_render_atts to change options on the fly (thx Ov3rfly)
193
- - fix share title in cases with html encoded characters
194
- - fix double counting on ranking tab under certain conditions
195
- - fix php info notice in admin notices
196
 
197
  = 4.1.1 =
198
  - new option to disable the Shariff buttons outside of the main loop
199
- - fix Facebook App ID request
200
  - minor css fix
201
 
202
  = 4.1.0 =
@@ -207,8 +229,8 @@ fixed in the future - if we have time to spend or you provide us with a lot of "
207
  - new statistic option to fill the cache automatically
208
  - new statistic option to set the amount of posts for the ranking tab
209
  - new statistic option to use share counts with PHP < 5.4
210
- - fix preventing buttons from beeing added to excerpts under certain conditions
211
- - fix urlencoding of share count requests
212
  - improved handling of wrong or mistyped service entries
213
  - minor bug fixes
214
 
@@ -219,25 +241,25 @@ fixed in the future - if we have time to spend or you provide us with a lot of "
219
  - new option for WordPress installations with REST API not reachable in root
220
 
221
  = 4.0.6 =
222
- - fix error in combination with bbpress
223
- - fix error on very old PHP versions
224
- - fix ranking tab
225
  - minor css improvements
226
 
227
  = 4.0.5 =
228
- - fix mail form link
229
- - fix xmlns for w3c
230
 
231
  = 4.0.4 =
232
  - removed some remaining wrong text domains for translations
233
  - minor css fixes
234
 
235
  = 4.0.3 =
236
- - fix mobile services not showing on certain tablets
237
- - fix type error on totalnumber when cache is empty
238
- - fix share count requests when WordPress is installed in a subdirectory
239
- - fix urlencoding of share url, title and media
240
- - add width and height to SVGs to prevent large initial icons prior to css
241
  - new classes shariff-buttons and shariff-link added
242
  - removed local translation files due to switching to wordpress.org language packs
243
  - minor css resets added
@@ -248,7 +270,7 @@ fixed in the future - if we have time to spend or you provide us with a lot of "
248
 
249
  = 4.0.1 =
250
  - prevent php warning messages on unsuccessful includes while WP_DEBUG is active
251
- - change text domain to match plugin slug
252
 
253
  = 4.0.0 =
254
  - complete overhaul of the plugin core
@@ -279,424 +301,4 @@ fixed in the future - if we have time to spend or you provide us with a lot of "
279
  - minor bug fixes
280
  - code cleanup
281
 
282
- = 3.4.2 =
283
- - fixed share counts on mobile devices with exactly 360px width
284
- - fixed error on the help tab regarding services (thx to Andreas)
285
- - small css improvements
286
- - added h4-h6 to the allowed tags for the headline
287
-
288
- = 3.4.1 =
289
- - changed diaspora share url to official one
290
- - fixed css of rss button when using round theme in widget
291
- - fixed accessibility of share button text
292
- - added rssfeed option to help section
293
- - updated to Heise version 1.23.0
294
-
295
- = 3.4.0 =
296
- - new service rss
297
- - minor bug fixes
298
- - update to Heise version 1.22.0
299
-
300
- = 3.3.3 =
301
- - fix anonymous function request for PHP < version 5.3
302
-
303
- = 3.3.2 =
304
- - improve/extend handling of custom post types
305
- - fix Facebook ID call
306
-
307
- = 3.3.1 =
308
- - fix ttl setting on statistic tab
309
- - reduce timeout for post requests to five seconds
310
-
311
- = 3.3.0 =
312
- - new option to use an external host for Shariff and the share count backend
313
- - new share count service OpenShareCount.com for Twitter
314
- - new settings tab "Statistic" for all options regarding the share counts
315
- - new settings tab "Status" for all system checks to increase performance
316
- - new design preview button without Twitter
317
- - fix counter VK on design round
318
- - fix Facebook total_count again
319
- - fix double Twitter share windows under certain conditions
320
- - reactivate Flattr counts, since they fixed their API
321
- - purge Shariff transients on update, deactivate and uninstall
322
- - code cleanup
323
- - add vk to help section
324
- - add a known bugs section to the readme
325
-
326
- = 3.2.0 =
327
- - new service VK
328
- - new share count service VK
329
- - new dynamic cache lifespan (ttl) based on post / page age (last modified)
330
- - new option to disable individual services (only share counts)
331
- - fix Facebook share counts now use total_counts again
332
- - fix search for custom WP locations
333
- - backend optimization
334
- - temporarily disabled the Flattr counts (statistic) due to ongoing problems of the Flattr API
335
- - fix use of wp_title() is/was deprecated in WP4.4
336
-
337
- = 3.1.3 =
338
- - fix ajax call when a custom permalink structure is used
339
-
340
- = 3.1.2 =
341
- - fix Facebook ID on 32-bit systems
342
-
343
- = 3.1.1 =
344
- - make admin help compatible to the new backend
345
-
346
- = 3.1.0 =
347
- - new option to add buttons before/after the excerpt
348
- - new service Threema (thanks to medienverbinder)
349
- - new service Diaspora (thanks to craiq)
350
- - new service AddThis (thanks to bozana)
351
- - new share count service AddThis (thanks to bozana)
352
- - new service PayPal.Me
353
- - new google icon
354
- - fix title tag usage in some cases
355
- - fix rel to data-rel popup
356
- - fix round buttons in certain themes
357
- - fix Flattr API to fetch counts again
358
- - workaround to fix the wrong JSON answer of xing API
359
- - up to date with Heise code version 1.21.0 2015-11-06
360
-
361
- = 3.0.0 =
362
- - new WP specific statistics backend for share counts
363
- - new SHARIFF_WP_ROOT_PATH constant for custom wp locations
364
- - automatic search for custom WP locations (thanks to hirasso)
365
- - fix timeout issues and a lot of other backend issues
366
- - deprecated Heise shariff-backend-php
367
- - deprecated ZendFramework
368
- - deprecated shariff3uu_cache directory
369
- - deprecated SHARIFF_BACKEND_TMPDIR constant
370
-
371
- = 2.4.3 =
372
- - fix proxy settings
373
- - fix PHP error notice caused by a race condition around concurrent requests in Zend_Cache
374
- - fix PHP notice and error in backend on multisite
375
-
376
- = 2.4.2 =
377
- - fix lang attribute again
378
- - fix update notice
379
-
380
- = 2.4.1 =
381
- - fix lang attribute
382
- - nicer support hints about GD lib
383
- - cleanup readme.txt
384
-
385
- = 2.4.0 =
386
- - ensure compatibility to WordPress 4.3
387
- - new service Tumblr
388
- - new service Patreon
389
- - new service PayPal
390
- - new service Bitcoin
391
- - new supporting bbpress
392
- - new using proxy settings from wp_config (thanks to Shogathu)
393
- - fix automatic button language
394
- - fix button language for Facebook
395
- - fix problems with plugin "Hide Title"
396
- - fix backend (statistic) for multisite environments
397
- - fix backend (statistic) if WP_DEBUG is set to true
398
- - fix language info in help section
399
- - update to Heise version 1.16.0
400
- - remove unnesseray guzzle docs
401
-
402
- = 2.3.4 =
403
- - add Italian language to the mailform
404
-
405
- = 2.3.3 =
406
- - fix Pinterest button, if pinit.js is present
407
- - small css fixes
408
-
409
- = 2.3.2 =
410
- - add French (thanks Charlotte) and Italian (thanks Pier) translations
411
- - improve screen reader compatibility
412
- - fix: prefill mail_comment in case of an error
413
- - fix: do not send more than 1 email as CC. Use a new mail for all recipients.
414
- - fix: fallback to English at the email form only if language is not supported by this plugin
415
- - cleanup mf_wait + extend time to wait of robots blocker to 2 sec
416
-
417
- = 2.3.1 =
418
- - fix facebook api (app id & secret)
419
- - fix CSS mailform label
420
-
421
- = 2.3.0 =
422
- - redesing of the plugins options page
423
- - mail form improved (a lot)
424
- - split mail into mailform and mailto (check your manual shorttags!)
425
- - new backend status section
426
- - new option to use Facebook Graph API ID in case of rate limit problems
427
- - new option to stretch the buttons horizontally
428
- - new option to add a headline above the Shariff buttons
429
- - many new button languages
430
- - new default cache directory
431
- - fix creation of default cache directory in case it is not month / year based
432
- - fix url-shorttag-option in widget
433
- - fix widget mailform link, if pressed twice
434
- - fix widget mailform on blog page
435
- - fix responsive flow of buttons in IE
436
- - fix Twitter: prevent double encoding with text longer than 120 chars
437
- - update shariff backend to 1.5.0 (Heise)
438
- - update shariff JS to 1.14.0 (Heise)
439
- - many more minor improvements
440
- - code cleanup
441
-
442
- = 2.2.4 =
443
- - security fix
444
-
445
- = 2.2.3 =
446
- - extend blocking of shariff buttons within password protected posts
447
-
448
- = 2.2.2 =
449
- - allow email functionality only if service email is configured within the
450
- admin menu as common service for all posts
451
-
452
- = 2.2.1 =
453
- - "fix" fallback to old twitter api again
454
-
455
- = 2.2.0 =
456
- - add option to hide Shariff on password protected posts
457
- - tested up to WP 4.2.2
458
- - "fix" fallback to old twitter api if another twitter script is found in order to avoid opening the share window twice
459
- - share text of the mailto link now is "email"
460
- - fix typo and cleanup code
461
-
462
- = 2.1.2 =
463
- - fix to make it work with PHP < 5.3 (you should really update your PHP version or change your hoster)
464
-
465
- = 2.1.1 =
466
- - change code because of a error with some PHP versions
467
-
468
- = 2.1.0 =
469
- - replace sender name if a name is provided with the mail form or set in admin menu
470
- - add option to append the post content to the mail
471
- - add mail header "Precedence: bulk" to avoid answers of autoresponder
472
- - fix: rename a function to avoid problems with other plugins
473
- - improve css
474
-
475
- = 2.0.2 =
476
- - fix: mail URLs must be a real link and not url-encoded
477
- - hotfix: mail form disabled if not on single post. Avoid the
478
- self destruction by the DOS-checker ;-)
479
- - cleanup Shariff JS code (mailURL no longer needed)
480
-
481
- = 2.0.1 =
482
- - fix email form method POST
483
-
484
- = 2.0.0 =
485
- - changes to stay compatible to Heise implementation
486
- - remove obsolet SHARIFF_ALL_POSTS
487
- - fix some small css attributes (size)
488
- - code clean up
489
-
490
- = 1.9.9 =
491
- - fix widget bug (wrong share links)
492
-
493
- = 1.9.8 =
494
- - add headers to avoid caching of backend data
495
- - tested with WP 4.2 beta
496
- - add option to use on custom pages (e.g. WooCommerce)
497
- - better handling of pinterest media attribute
498
- - bugfix: SHARIFF_BACKEND_TMPDIR in backend
499
- - improve uninstal of cache dir (todo: change to a better named dir)
500
- - add option to use smaller size buttons
501
- - fix again target of the mailto-link
502
- - cleanup code
503
-
504
- = 1.9.7 =
505
- - roll back to stable
506
-
507
- = 1.9.6 =
508
- - now really go back to 1st block in loop at WMPU
509
-
510
- = 1.9.5 =
511
- - nu abba: missing version update
512
-
513
- = 1.9.4 =
514
- - fix update bug on WPMS
515
-
516
- = 1.9.3 =
517
- - add missing backend files. Last change for this Sunday ;-)
518
-
519
- = 1.9.2 =
520
- - fix stupid bug with the update file :-( Sorry!
521
- - fix initialisation of REMOTEHOSTS
522
-
523
- = 1.9.1 =
524
- - merge with original Shariff JS/CSS code version 1.9.3
525
- - CSS theme default like Heise default again + "add" theme color
526
- - fix the theme "white"
527
- - backend now up to date
528
- - disable WPDebug in backend config
529
- - improve uninstall (options shariff3UU, shariff3UUversion,
530
- widget_shariff) and compatible with multisite installations
531
- - improve deactivation
532
-
533
- = 1.9 =
534
- - add Flattr
535
- - improve version control
536
- - update frensh translations
537
- - use configuration from admin menu for blank shariff shortcodes
538
- - own (much smaller) fonts
539
-
540
- = 1.8.1 =
541
- - remove the relativ network-path from service declarations (pinterest,
542
- reddit, stumbleupon, xing) because it really makes no sense to change
543
- the protocol within a popup of a secure target to unsecure connections
544
- depending on the protocol the page is using
545
- - change name of jQuery object to avoid conflicts with other plugins/themes
546
-
547
- = 1.8 =
548
- - add options to place Shariff (right/left/center)
549
- - fix: migration check
550
- - css optimized
551
- - use the WP bundled jQuery now (save about 80% bandwidth :-)
552
-
553
- = 1.7.1 =
554
- - optimize css (thanks again to @jplambeck)
555
- - code cleanup (No more warnings in debug mode. Perhaps ;-)
556
- - sanitize admin input (thanks again to @jplambeck)
557
- - set the title attribute to overwrite get_the_title() now supported
558
- - fix: check SHARIFF_BACKEND_TMPDIR
559
- - add uninstall script
560
-
561
- = 1.7 =
562
- - CHANGES: if no attributes are configured within a shorttag first try to
563
- use the option from admin page. However if there are no services
564
- configured use the old defaults of Heise to make it backward compatible
565
- - add the new service attribut `mailto` to prepare getting the original
566
- behavior of the Heise code that provide a email form with `mail`
567
- - add option to put Shariff on overview page too
568
- - add internal version tracker to enable better migration options in the
569
- future
570
- - optimized css for the info attribute, added priority to the title
571
- attribute over DC.title attribute (thanks again to @jplambeck )
572
-
573
- = 1.6.1 =
574
- - fix: again enable WhatsUp on mobile now also works with Mozilla. Sorry
575
- this has not been become part of the main branche. Therefor it was lost
576
- with the last update :-(
577
- - added .shariff span { color: inherit; } (thanks again to @jplambeck )
578
-
579
- = 1.6. =
580
- - adopted new responsive css code (thanks to @jplambeck )
581
- - update included fa-fonts
582
- - fix: descrition "printer"
583
- - fix: use WP_CONTENT_URL in admin menu
584
-
585
- = 1.5.4 =
586
- - remove alternativ css with links to external hosters. If do you really
587
- want enable breaking privacy plz feel free to code you own css
588
-
589
- = 1.5.3 =
590
- - hide counter within the theme round
591
-
592
- = 1.5.2 =
593
- - default backend temp dir now uses wp content dir
594
- - updated original shariff JS code
595
-
596
- = 1.5.1 =
597
- - fix: constant had have a wrong declaration check
598
-
599
- = 1.5.0 =
600
- - add option "url" to set a fixed URI for all sites (only in shorttag and
601
- widgets) because usually it is not a good idea to manipulate this
602
- - fix: do not show error in elseif (/tmp check in admin menu)
603
-
604
- = 1.4.4 =
605
- - add option to force frensh and spanish buttons
606
- - clean up theme selection
607
-
608
- = 1.4.3 =
609
- - look like wp_enqueue_script has problems with the shariff js code. Now own
610
- script link at the end of the site. Should also improve performance ;-)
611
-
612
- = 1.4.2 =
613
- - fix: add the attribute data-title that is needed by the shariff on some
614
- themes to render it above the other div containers.
615
- - only long PHP-Tags because auf problems with WAMPs
616
- - some code clean up. Hopefully it will become more robust on WAMP systems.
617
-
618
- = 1.4.1 =
619
- - fixed stupid typo with the SHARIFF_BACKEND_TMP constant
620
-
621
- = 1.4.0 =
622
- - add a DIV container to use positioning with CSS
623
- - remove long PHP-tags that cause parse problem on Windows
624
-
625
- = 1.3.0 =
626
- - clean up the code
627
- - add backend options (TTL and temp dir)
628
-
629
- = 1.2.7 =
630
- - fixed: enable WhatsUp on mobile now also works with Mozilla
631
- - print button does not open a new window
632
- - removed min.js make it more readable for own local changes
633
-
634
- = 1.2.6 =
635
- - add print button
636
- - add default image for pinterest to avoid broken design and giuve a hint
637
-
638
- = 1.2.5 =
639
- - hotfix for pinterest (see FAQ)
640
-
641
- = 1.2.4 =
642
- - bugfix: widget does not work if SHARIFF_ALL_POSTS is set but not enabled
643
- in the admin menu (Please remember, that SHARIFF_ALL_POSTS will be
644
- removed with next major version)
645
- - add option to add shariff at the begin of a post
646
- - merge with new original backend for counters
647
- - add spanish language on buttons; hide whatsup on mobile devices
648
- (merge with yanniks code)
649
- - add reddit
650
- - add stumbleupon
651
-
652
- = 1.2.3 =
653
- - add round theme to the admin menu
654
-
655
- = 1.2.2 =
656
- - tested with WP 4.1
657
- - added french language for buttons
658
- - added theme "round" (round buttons without text but with fixed width)
659
-
660
- = 1.2.1 =
661
- - typos
662
-
663
- = 1.2 =
664
- - add widget support
665
-
666
- = create a Stable1.0 tag =
667
- - no new funtionality to this tag. Only bugfixes!
668
-
669
- = 1.1.1 =
670
- - add french language for the admin menu (thanks Celine ;-)
671
- - fix backend problem on shared hosting with no writeable tmp dir
672
-
673
- = 1.1 =
674
- - add whatsapp|pinterest|linkedin|xing
675
- - include latest upstream changes (fix mail etc.)
676
- - add old default selection of services to make it backward compatible
677
-
678
- = 1.0.2 =
679
- - add German translation to the admin menu (Admin-Menue in Deutsch)
680
- - code cleanup
681
-
682
- = 1.0.1 =
683
- - add PHP version check (5.4 is needed by the backend option)
684
-
685
- = 1.0 =
686
- - add admin menu page
687
- - disable the default add on a post if a special formed tag was found
688
- - add support for the theme attribute
689
-
690
- = 0.4 =
691
- - Include latest upstream changes
692
- - use get_permalink() to set the parameter data-url
693
-
694
- = 0.3 =
695
- - add support for "hideshariff"
696
- - add screenshots
697
-
698
- = 0.2 =
699
- - removed the private update server and changed test domain
700
-
701
- = 0.1 =
702
- - initial release
2
  Contributors: 3UU, starguide
3
  Tags: Shariff, Facebook, Twitter, VKontakte, VK, GooglePlus, WhatsApp, share buttons, sharing, privacy, social
4
  Requires at least: 4.4
5
+ Tested up to: 4.9.4
6
+ Stable tag: 4.3.0
7
  License: MIT
8
+ License URI: http://opensource.org/licenses/mit
9
  Donate link: http://folge.link/?bitcoin=1Ritz1iUaLaxuYcXhUCoFhkVRH6GWiMTP
10
 
11
  The Shariff Wrapper provides share buttons that respect the privacy of your visitors and are compliant to German data protection laws.
62
  A: It uses the same options that have been configured on the plugin options page. However, you can put in a shorttag that overwrites the default options. It has the same format as you use in posts. Take a look at the help section of the plugin options page for more information.
63
 
64
  = Q: Can I change the options on a single post? =
65
+ A: Yes. You can change all options using the shorttag in the Shariff meta box on the right side of the post edit screen.
66
 
67
  = Q: Why are shares not listed? =
68
  A: Shariff tries to protect the privacy of your visitors. In order to do this, the statistics have to be requested by your server, so social networks only see a request of your server and not from your visitor. However, we do not know, if you want this. Therefore it is not enabled by default.
71
  A: Enable it on the plugin options page in general or add `backend="on"` to the shariff shorttag in your post.
72
 
73
  = Q: I still do not see share counts =
74
+ A: Please have a look at the status tab on the plugin options page. It states wether share counts are enabled and if there is a problem with a service. Please also keep in mind that the plugin has a minimum refresh time of 60 seconds and that each service has their own cache as well.
75
 
76
  = Q: Why can't I change the TTL to a smaller / bigger value? =
77
  A: The time to live (TTL) value determines, if a share count of a post or page gets refreshed when someone visits this specific page / post of your blog. Too small values create too much useless traffic, too high values negate the goal of motivating visitors to also share a post. The value can be adjusted between 60 and 7200 seconds. Keep in mind, the actual lifespan depends on the age of the post as well.
78
 
79
+ = Q: I get the Facebook API error message "request limit reached"! =
80
  A: Facebook has a rate limit of 600 requests per 600 seconds per IP address. Especially in shared hosting environments many domains share the same IP address and therefore the same limit. To avoid this you can try to raise the TTL value or provide a Facebook App ID and Secret. Google "facebook app id secret" will provide many guides on how to get these.
81
 
82
+ = Q: How can I change the position of all buttons? =
83
  A: Have a look at the alignment options in the admin menu or checkout the
84
  style option.
85
 
88
  overview. But please be warned: This is a test page! It is possible that you find features that are only provided in the development version. Use it only to get an impression of the design options.
89
 
90
  = Q: How can I change the design of a single button? =
91
+ A: If you are a CSS guru please feel free to modify the css file. But of course this is a bad idea, because all changes will be destroyed with the next update! Instead take a look at the style and class attribute of the shorttag. If you put in any value it will create a DIV container with the ID "ShariffSC" around the buttons. If you are really a CSS guru you will know what does the magic from here on out. ;-)
92
 
93
  = Q: I want the buttons to stay fixed while scrolling! =
94
  A: No problem. Just use the style attribute to add some CSS to the shorttag. For example in a widget (adjust the width as needed):
105
  Of course you can use all other options in that shorttag as well.
106
 
107
  = Q: Can I add [shariff] on all posts? =
108
+ A: Yes, check out the plugin options.
109
 
110
  = Q: But I want to hide it on a single post! =
111
+ A: Do you really know what you want? ;-) However, it is possible. Write anywhere in your post "hideshariff". It will be removed and Shariff will not be added. You can also use "/hideshariff" to write "hideshariff" in your post. You might also want to take a look at the Shariff meta box on the right side of your post edit screen.
112
 
113
+ = Q: What are the differences between the two Shariff plugins? =
114
  A: One is developed by us, one by someone else. ;-) The main difference is that this plugin has a few more options and a great support. :-) Neither of the plugins are "official" or directly developed by Heise.
115
 
116
  = Q: Does it work with a CDN? =
117
  A: Yes.
118
 
119
+ = Q: Pinterest does not show an image! =
120
  A: You can add media="http://wwww.example.com/yourImage.png"
121
  within the [shariff] shorttag or add it in on the plugin options page - of course with the link to your image.
122
 
137
  = Q: What happened to the Twitter share counts and what is OpenShareCount? =
138
  A: Please read: https://www.jplambeck.de/twitter-saveoursharecounts/
139
 
140
+ = Q: The buttons are not correctly beeing shown on my custom theme! =
141
+ 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
142
+
143
  = EXPERIMENTAL FEATURES =
144
 
145
  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!
175
 
176
  == Changelog ==
177
 
178
+ = 4.3.0 =
179
+ - new service Odnoklassniki (thanks to rockhit)
180
+ - new meta box allows for individual settings per post or page
181
+ - new option to hide share counts that are zero
182
+ - new option to disable dynamic cache lifespan (not recommended)
183
+ - new option to set the button size to small, medium or large
184
+ - new option to add a custom class to the container around Shariff
185
+ - new option to open links in a popup (thanks to jackennils)
186
+ - new option to use NewShareCount instead of OpenShareCount (Twitter)
187
+ - added timestamp variable to be accessible via shortcode
188
+ - fixed post timestamp for caching under certain conditions
189
+ - fixed Facebook share count error for never crawled pages
190
+ - fixed empty tab after sharing on certain mobile devices
191
+ - fixed custom title attribute (thanks to kschlager)
192
+ - updated Flattr user id for the future (thanks to poetaster)
193
+ - reduced changelog on wordpress.org (thanks to timse201)
194
+ - minor css improvements
195
+ - updated help section
196
+
197
  = 4.2.1 =
198
+ - fixed WhatsApp button on Android when using Chrome
199
+ - fixed Shariff being added to RSS feeds under certain conditions
200
+ - updated to latest Facebook Graph API for share count requests
201
 
202
  = 4.2.0 =
203
  - new option to set the rate limit for sending mails using the mail form
212
  = 4.1.2 =
213
  - new fallback for share count requests in case pretty permalinks are disabled
214
  - new filter shariff3UU_render_atts to change options on the fly (thx Ov3rfly)
215
+ - fixed share title in cases with html encoded characters
216
+ - fixed double counting on ranking tab under certain conditions
217
+ - fixed php info notice in admin notices
218
 
219
  = 4.1.1 =
220
  - new option to disable the Shariff buttons outside of the main loop
221
+ - fixed Facebook App ID request
222
  - minor css fix
223
 
224
  = 4.1.0 =
229
  - new statistic option to fill the cache automatically
230
  - new statistic option to set the amount of posts for the ranking tab
231
  - new statistic option to use share counts with PHP < 5.4
232
+ - fixed preventing buttons from beeing added to excerpts under certain conditions
233
+ - fixed urlencoding of share count requests
234
  - improved handling of wrong or mistyped service entries
235
  - minor bug fixes
236
 
241
  - new option for WordPress installations with REST API not reachable in root
242
 
243
  = 4.0.6 =
244
+ - fixed an error in combination with bbpress
245
+ - fixed ab error on very old PHP versions
246
+ - fixed ranking tab
247
  - minor css improvements
248
 
249
  = 4.0.5 =
250
+ - fixed mail form link
251
+ - fixed xmlns for w3c
252
 
253
  = 4.0.4 =
254
  - removed some remaining wrong text domains for translations
255
  - minor css fixes
256
 
257
  = 4.0.3 =
258
+ - fixed mobile services not showing on certain tablets
259
+ - fixed type error on totalnumber when cache is empty
260
+ - fixed share count requests when WordPress is installed in a subdirectory
261
+ - fixed urlencoding of share url, title and media
262
+ - added width and height to SVGs to prevent large initial icons prior to css
263
  - new classes shariff-buttons and shariff-link added
264
  - removed local translation files due to switching to wordpress.org language packs
265
  - minor css resets added
270
 
271
  = 4.0.1 =
272
  - prevent php warning messages on unsuccessful includes while WP_DEBUG is active
273
+ - changed text domain to match plugin slug
274
 
275
  = 4.0.0 =
276
  - complete overhaul of the plugin core
301
  - minor bug fixes
302
  - code cleanup
303
 
304
+ The complete changelog can be found here: https://plugins.svn.wordpress.org/shariff/trunk/changelog.txt
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
services/shariff-facebook.php CHANGED
@@ -67,11 +67,13 @@ elseif ( isset( $backend ) && $backend == '1' ) {
67
  // use token to get share counts
68
  $facebook = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://graph.facebook.com/v2.2/?id=' . $post_url . '&' . $fb_token ) ) );
69
  $facebook_json = json_decode( $facebook, true );
 
70
  }
71
  // otherwise use the normal way
72
  else {
73
  $facebook = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://graph.facebook.com/?id=' . $post_url ) ) );
74
  $facebook_json = json_decode( $facebook, true );
 
75
  }
76
 
77
  // store results - use total_count if it exists, otherwise use share_count - ordered based on proximity of occurrence
@@ -84,6 +86,9 @@ elseif ( isset( $backend ) && $backend == '1' ) {
84
  elseif ( isset($facebook_json['data'] ) && isset( $facebook_json['data'][0] ) && isset( $facebook_json['data'][0]['share_count'] ) ) {
85
  $share_counts['facebook'] = intval( $facebook_json['data'][0]['share_count'] );
86
  }
 
 
 
87
  // record errors, if enabled (e.g. request from the status tab)
88
  elseif ( isset( $record_errors ) && $record_errors == '1' ) {
89
  $service_errors['facebook'] = $facebook;
67
  // use token to get share counts
68
  $facebook = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://graph.facebook.com/v2.2/?id=' . $post_url . '&' . $fb_token ) ) );
69
  $facebook_json = json_decode( $facebook, true );
70
+ $nofbid = '0';
71
  }
72
  // otherwise use the normal way
73
  else {
74
  $facebook = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://graph.facebook.com/?id=' . $post_url ) ) );
75
  $facebook_json = json_decode( $facebook, true );
76
+ $nofbid = '1';
77
  }
78
 
79
  // store results - use total_count if it exists, otherwise use share_count - ordered based on proximity of occurrence
86
  elseif ( isset($facebook_json['data'] ) && isset( $facebook_json['data'][0] ) && isset( $facebook_json['data'][0]['share_count'] ) ) {
87
  $share_counts['facebook'] = intval( $facebook_json['data'][0]['share_count'] );
88
  }
89
+ elseif ( isset( $facebook_json['id'] ) && ! isset( $facebook_json['error'] ) && $nofbid = '1' ) {
90
+ $share_counts['facebook'] = '0';
91
+ }
92
  // record errors, if enabled (e.g. request from the status tab)
93
  elseif ( isset( $record_errors ) && $record_errors == '1' ) {
94
  $service_errors['facebook'] = $facebook;
services/shariff-flattr.php CHANGED
@@ -18,7 +18,7 @@ if ( isset( $frontend ) && $frontend == '1' ) {
18
  else $flattruser = '';
19
 
20
  // build button url
21
- $button_url = $service_url . '?url=' . $share_url . '&title=' . $share_title . '&language=' . $lang . '&user_id=' . $flattruser;
22
 
23
  // svg icon
24
  $svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 31 32"><path d="M0 28.4v-16.4q0-5.7 2.7-8.9t8.3-3.2h17.5q-0.2 0.2-1.7 1.7t-3.2 3.2-3.5 3.5-3 3-1.3 1.2q-0.5 0-0.5-0.5v-5h-1.5q-1.9 0-3 0.2t-2 0.8-1.2 1.8-0.4 3.1v8.4zM2.1 32.1q0.2-0.2 1.7-1.7t3.2-3.2 3.5-3.5 3-3 1.3-1.2q0.5 0 0.5 0.5v5h1.5q3.7 0 5.2-1.2t1.4-4.8v-8.4l7.2-7.1v16.4q0 5.7-2.7 8.9t-8.3 3.2h-17.5z"/></svg>';
18
  else $flattruser = '';
19
 
20
  // build button url
21
+ $button_url = $service_url . '?url=' . $share_url . '&title=' . $share_title . '&language=' . $lang . '&fid=' . $flattruser;
22
 
23
  // svg icon
24
  $svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 31 32"><path d="M0 28.4v-16.4q0-5.7 2.7-8.9t8.3-3.2h17.5q-0.2 0.2-1.7 1.7t-3.2 3.2-3.5 3.5-3 3-1.3 1.2q-0.5 0-0.5-0.5v-5h-1.5q-1.9 0-3 0.2t-2 0.8-1.2 1.8-0.4 3.1v8.4zM2.1 32.1q0.2-0.2 1.7-1.7t3.2-3.2 3.5-3.5 3-3 1.3-1.2q0.5 0 0.5 0.5v5h1.5q3.7 0 5.2-1.2t1.4-4.8v-8.4l7.2-7.1v16.4q0 5.7-2.7 8.9t-8.3 3.2h-17.5z"/></svg>';
services/shariff-odnoklassniki.php ADDED
@@ -0,0 +1,69 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ <?php
2
+ // Odnoklassniki
3
+
4
+ // prevent direct calls
5
+ if ( ! class_exists('WP') ) { die(); }
6
+
7
+ // frontend
8
+ if ( isset( $frontend ) && $frontend == '1' ) {
9
+ // service url
10
+ $service_url = esc_url( 'https://www.odnoklassniki.ru/dk' );
11
+
12
+ // build button url
13
+ $button_url = $service_url . '?st.cmd=addShare&st._surl=' . $share_url . '&title=' . $share_title;
14
+
15
+ // svg icon
16
+ $svg_icon = '<svg xmlns="http://www.w3.org/2000/svg" width="14" height="20" viewBox="0 0 14 20"><path d="M7.1 10.1q-2.1 0-3.6-1.5t-1.5-3.6q0-2.1 1.5-3.6t3.6-1.5 3.6 1.5 1.5 3.6q0 2.1-1.5 3.6t-3.6 1.5zM7.1 2.6q-1 0-1.8 0.7t-0.7 1.8q0 1 0.7 1.8t1.8 0.7 1.8-0.7 0.7-1.8q0-1-0.7-1.8t-1.8-0.7zM13 10.7q0.1 0.3 0.2 0.6t0 0.5-0.3 0.4-0.5 0.4-0.7 0.5q-1.3 0.8-3.5 1l0.8 0.8 3 3q0.3 0.3 0.3 0.8t-0.3 0.8l-0.1 0.1q-0.3 0.3-0.8 0.3t-0.8-0.3q-0.7-0.8-3-3l-3 3q-0.3 0.3-0.8 0.3t-0.8-0.3l-0.1-0.1q-0.3-0.3-0.3-0.8t0.3-0.8l3.8-3.8q-2.3-0.2-3.5-1-0.4-0.3-0.7-0.5t-0.5-0.4-0.3-0.4 0-0.5 0.2-0.6q0.1-0.2 0.3-0.4t0.5-0.2 0.6 0 0.7 0.4q0.1 0 0.2 0.1t0.5 0.3 0.8 0.3 1 0.3 1.3 0.1q1 0 1.9-0.3t1.3-0.6l0.4-0.3q0.4-0.3 0.7-0.4t0.6 0 0.5 0.2 0.3 0.4z"/></svg>';
17
+
18
+ // colors
19
+ $main_color = '#ee8208';
20
+ $secondary_color = '#f3a752';
21
+
22
+ // backend available?
23
+ $backend_available = '1';
24
+
25
+ // button title / label
26
+ $button_title_array = array(
27
+ 'bg' => 'Сподели във Odnoklassniki',
28
+ 'da' => 'Del på Odnoklassniki',
29
+ 'de' => 'Bei Odnoklassniki teilen',
30
+ 'en' => 'Share on Odnoklassniki',
31
+ 'es' => 'Compartir en Odnoklassniki',
32
+ 'fi' => 'Jaa Odnoklassniki',
33
+ 'fr' => 'Partager sur Odnoklassniki',
34
+ 'hr' => 'Podijelite na Odnoklassniki',
35
+ 'hu' => 'Megosztás Odnoklassniki',
36
+ 'it' => 'Condividi su Odnoklassniki',
37
+ 'ja' => 'Odnoklassnikiでシェア',
38
+ 'ko' => '오드 노 클라스 니키 공유',
39
+ 'nl' => 'Delen op Odnoklassniki',
40
+ 'no' => 'Del på Odnoklassniki',
41
+ 'pl' => 'Udostępnij na Odnoklassniki',
42
+ 'pt' => 'Compartilhar no Odnoklassniki',
43
+ 'ro' => 'Partajează pe Odnoklassniki',
44
+ 'ru' => 'Поделиться на Odnoklassniki',
45
+ 'sk' => 'Zdieľať na Odnoklassniki',
46
+ 'sl' => 'Deli na Odnoklassniki',
47
+ 'sr' => 'Podeli na Odnoklassniki',
48
+ 'sv' => 'Dela på Odnoklassniki',
49
+ 'tr' => 'Odnoklassniki\'ta paylaş',
50
+ 'zh' => '在Odnoklassniki上分享',
51
+ );
52
+ }
53
+ // backend
54
+ elseif ( isset( $backend ) && $backend == '1' ) {
55
+ // get share counts
56
+ $odnoklassniki = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://connect.ok.ru/dk?st.cmd=extLike&uid=odklcnt0&ref=' . $post_url ) ) );
57
+
58
+ // check results
59
+ preg_match( '/^ODKL\.updateCount\(\'odklcnt0\',\'(\d+)\'\);$/i', $odnoklassniki, $ok_shares );
60
+
61
+ // store results
62
+ if ( isset( $ok_shares ) && ! empty( $ok_shares ) ) {
63
+ $share_counts['odnoklassniki'] = intval( $ok_shares[1] );
64
+ }
65
+ // record errors, if enabled (e.g. request from the status tab)
66
+ elseif ( isset( $record_errors ) && $record_errors == '1' ) {
67
+ $service_errors['odnoklassniki'] = $odnoklassniki;
68
+ }
69
+ }
services/shariff-twitter.php CHANGED
@@ -63,7 +63,8 @@ if ( isset( $frontend ) && $frontend == '1' ) {
63
  // backend
64
  elseif ( isset( $backend ) && $backend == '1' ) {
65
  // fetch counts
66
- $twitter = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'http://opensharecount.com/count.json?url=' . $post_url ) ) );
 
67
  $twitter_json = json_decode( $twitter, true );
68
 
69
  // store results, if we have some
63
  // backend
64
  elseif ( isset( $backend ) && $backend == '1' ) {
65
  // fetch counts
66
+ if ( isset( $shariff3UU['newsharecount'] ) && $shariff3UU['newsharecount'] == '1' ) $twitter = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'http://public.newsharecounts.com/count.json?url=' . $post_url ) ) );
67
+ else $twitter = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'http://opensharecount.com/count.json?url=' . $post_url ) ) );
68
  $twitter_json = json_decode( $twitter, true );
69
 
70
  // store results, if we have some
shariff.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Shariff Wrapper
4
  * Plugin URI: https://de.wordpress.org/plugins/shariff/
5
  * Description: The Shariff Wrapper provides share buttons that respect the privacy of your visitors and are compliant to the German data protection laws.
6
- * Version: 4.2.1
7
  * Author: Jan-Peter Lambeck & 3UU
8
  * Author URI: https://de.wordpress.org/plugins/shariff/
9
  * License: MIT
@@ -26,7 +26,7 @@ $shariff3UU = array_merge( $shariff3UU_basic, $shariff3UU_design, $shariff3UU_ad
26
  // update function to perform tasks _once_ after an update, based on version number to work for automatic as well as manual updates
27
  function shariff3UU_update() {
28
  /******************** ADJUST VERSION ********************/
29
- $code_version = "4.2.1"; // set code version - needs to be adjusted for every new version!
30
  /******************** ADJUST VERSION ********************/
31
 
32
  // get options
@@ -69,6 +69,16 @@ if ( is_admin() ) {
69
  include( plugin_dir_path( __FILE__ ) . 'admin/admin_notices.php' );
70
  }
71
 
 
 
 
 
 
 
 
 
 
 
72
  // waiting for WordPress core to handle the saving of the dismiss click themself
73
  function shariff3UU_dismiss_update_notice() {
74
  update_option( 'shariff3UU_hide_update_notice', 'hide' );
@@ -167,7 +177,7 @@ function shariff3UU_share_counts( WP_REST_Request $request ) {
167
  }
168
 
169
  // adjust ttl based on the post age
170
- if ( isset ( $timestamp ) ) {
171
  // the timestamp represents the last time the post or page was modfied
172
  $post_time = intval( $timestamp );
173
  $current_time = current_time( 'timestamp', true );
@@ -421,23 +431,27 @@ function shariff3UU_posts( $content ) {
421
 
422
  // type of current post
423
  $current_post_type = get_post_type();
424
- if ($current_post_type === 'post') $current_post_type = 'posts';
 
 
 
 
425
 
426
- // now add shariff
427
  if ( ! is_singular() ) {
428
  // on blog page
429
- if ( isset( $shariff3UU["add_before"]["posts_blogpage"] ) && $shariff3UU["add_before"]["posts_blogpage"] == '1') $content = '[shariff]' . $content;
430
- if ( isset( $shariff3UU["add_after"]["posts_blogpage"] ) && $shariff3UU["add_after"]["posts_blogpage"] == '1' ) $content .= '[shariff]';
431
  }
432
  elseif ( is_singular( 'post' ) ) {
433
  // on single post
434
- if ( isset( $shariff3UU["add_before"][$current_post_type] ) && $shariff3UU["add_before"][$current_post_type] == '1' ) $content = '[shariff]' . $content;
435
- if ( isset( $shariff3UU["add_after"][$current_post_type] ) && $shariff3UU["add_after"][$current_post_type] == '1' ) $content .= '[shariff]';
436
  }
437
  elseif ( is_singular( 'page' ) ) {
438
  // on pages
439
- if ( isset( $shariff3UU["add_before"]["pages"] ) && $shariff3UU["add_before"]["pages"] == '1' ) $content = '[shariff]' . $content;
440
- if ( isset( $shariff3UU["add_after"]["pages"] ) && $shariff3UU["add_after"]["pages"] == '1' ) $content .= '[shariff]';
441
  }
442
  else {
443
  // on custom_post_types
@@ -445,10 +459,19 @@ function shariff3UU_posts( $content ) {
445
  if ( is_array( $all_custom_post_types ) ) {
446
  $custom_types = array_keys( $all_custom_post_types );
447
  // add shariff, if custom type and option checked in the admin menu
448
- if ( isset( $shariff3UU['add_after'][$current_post_type] ) && $shariff3UU['add_after'][$current_post_type] == '1' ) $content .= '[shariff]';
449
  }
450
  }
451
-
 
 
 
 
 
 
 
 
 
452
  return $content;
453
  }
454
  if ( ! isset( $GLOBALS["shariff3UU"]["shortcodeprio"] ) ) $GLOBALS["shariff3UU"]["shortcodeprio"] = '10';
@@ -521,7 +544,7 @@ add_shortcode( 'shariff', 'shariff3UU_render' );
521
  function shariff3UU_render( $atts, $content = null ) {
522
  // get options
523
  $shariff3UU = $GLOBALS["shariff3UU"];
524
-
525
  // avoid errors if no attributes are given - instead use the old set of services to make it backward compatible
526
  if ( empty( $shariff3UU["services"] ) ) $shariff3UU["services"] = "twitter|facebook|googleplus|info";
527
 
@@ -532,6 +555,45 @@ function shariff3UU_render( $atts, $content = null ) {
532
  if ( isset( $shariff3UU["buttonsize"] ) && $shariff3UU["buttonsize"] == '1' ) $backend_options["buttonsize"] = 'small';
533
  if ( empty( $atts ) ) $atts = $backend_options;
534
  else $atts = array_merge( $backend_options, $atts );
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
535
 
536
  // Ov3rfly: make atts configurable from outside, e.g. for language etc.
537
  $atts = apply_filters( 'shariff3UU_render_atts', $atts );
@@ -557,6 +619,7 @@ function shariff3UU_render( $atts, $content = null ) {
557
  }
558
 
559
  // enqueue share count script (the JS should be loaded at the footer - make sure that wp_footer() is present in your theme!)
 
560
  if ( array_key_exists( 'backend', $atts ) && $atts['backend'] == "on" ) {
561
  // if SCRIPT_DEBUG is true, we load the non minified version
562
  if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG === TRUE ) {
@@ -566,13 +629,25 @@ function shariff3UU_render( $atts, $content = null ) {
566
  wp_enqueue_script( 'shariffjs', plugins_url( '/js/shariff.min.js', __FILE__ ), '', $shariff3UU["version"], true );
567
  }
568
  }
 
 
 
 
 
 
 
 
 
 
 
 
569
 
570
  // share url
571
  if ( array_key_exists( 'url', $atts ) ) $share_url = urlencode( $atts['url'] );
572
  else $share_url = urlencode( get_permalink() );
573
 
574
  // share title
575
- if ( array_key_exists( 'title', $atts ) ) $share_title = urlencode( html_entity_decode( get_the_title(), ENT_COMPAT, 'UTF-8' ) );
576
  else $share_title = urlencode( html_entity_decode( get_the_title(), ENT_COMPAT, 'UTF-8' ) );
577
 
578
  // set transient name
@@ -589,9 +664,13 @@ function shariff3UU_render( $atts, $content = null ) {
589
  // prevent info notices in case debug mode is on
590
  $output = '';
591
 
592
- // if we have a style attribute add ShariffSC container including these styles
593
- if ( array_key_exists( 'style', $atts ) ) {
594
- $output .= '<div class="ShariffSC" style="' . esc_html( $atts['style'] ) . '">';
 
 
 
 
595
  }
596
 
597
  // if no language is set, try http_negotiate_language
@@ -630,7 +709,8 @@ function shariff3UU_render( $atts, $content = null ) {
630
  );
631
 
632
  // add timestamp for cache
633
- if ( array_key_exists( 'timestamp', $atts ) ) $output .= ' data-timestamp="' . absint( get_the_modified_date( 'U', true ) ) . '"';
 
634
 
635
  // start output of actual Shariff buttons
636
  $output .= '<div class="shariff shariff-main';
@@ -654,7 +734,11 @@ function shariff3UU_render( $atts, $content = null ) {
654
  // share url
655
  $output .= ' data-url="' . esc_html( $share_url ) . '"';
656
  // timestamp for cache
657
- $output .= ' data-timestamp="' . absint( get_the_modified_date( 'U', true ) ) . '"';
 
 
 
 
658
  // add external api if entered
659
  if ( isset( $shariff3UU["external_host"] ) && ! empty( $shariff3UU["external_host"] ) && isset( $shariff3UU["external_direct"] ) ) {
660
  $output .= ' data-backendurl="' . $shariff3UU["external_host"] . '"';
@@ -691,7 +775,7 @@ function shariff3UU_render( $atts, $content = null ) {
691
  else $output .= 'orientation-horizontal ';
692
  // size
693
  if ( array_key_exists( 'buttonsize', $atts ) ) $output .= 'buttonsize-' . esc_html( $atts['buttonsize'] );
694
- else $output .= 'buttonsize-big';
695
  $output .= '">';
696
 
697
  // prevent warnings while debug mode is on
@@ -777,7 +861,7 @@ function shariff3UU_render( $atts, $content = null ) {
777
 
778
  // build the actual button
779
  $output .= '<a href="' . $button_url . '" title="' . $button_title . '" aria-label="' . $button_title . '" role="button" rel="';
780
- if ( $mobile_only != '1' ) $output .= 'noopener noreferrer ';
781
  $output .= 'nofollow" class="shariff-link" ';
782
  // same window?
783
  if ( ! isset( $same_window ) || isset( $same_window ) && $same_window != '1' ) $output .= 'target="_blank" ';
@@ -794,8 +878,8 @@ function shariff3UU_render( $atts, $content = null ) {
794
  // share counts?
795
  if ( array_key_exists( 'sharecounts', $atts ) && $atts['sharecounts'] == "1" && $backend_available == '1' && ! isset ( $shariff3UU["disable"][ $service ] ) ) {
796
  $output .= '<span class="shariff-count" data-service="' . $service . '" style="color:' . $main_color;
797
- if ( array_key_exists( $service, $share_counts ) === true && $share_counts[ $service ] !== null && $share_counts[ $service ] !== '-1' ) {
798
- $output .= '">' . $share_counts[ $service ];
799
  }
800
  else $output .= ';opacity:0">';
801
  $output .= '</span>&nbsp;';
@@ -860,6 +944,15 @@ function shariff3UU_render( $atts, $content = null ) {
860
  return $output;
861
  }
862
 
 
 
 
 
 
 
 
 
 
863
  // prepend mailform if view=mail or send mail if act=sendMail
864
  function shariff3UU_viewmail( $content ) {
865
  // prepend the mail form and return content
@@ -1377,8 +1470,8 @@ class ShariffWidget extends WP_Widget {
1377
  else $media = ' media="' . plugins_url( '/pictos/defaultHint.png', __FILE__ ) . '"';
1378
  }
1379
 
1380
- // build shorttag and add url, title and media if necessary
1381
- $shorttag = substr($shorttag,0,-1) . $page_title . $page_url . $media . ']';
1382
 
1383
  // replace mailform with mailto if on blog page to avoid broken button
1384
  if ( ! is_singular() ) {
3
  * Plugin Name: Shariff Wrapper
4
  * Plugin URI: https://de.wordpress.org/plugins/shariff/
5
  * Description: The Shariff Wrapper provides share buttons that respect the privacy of your visitors and are compliant to the German data protection laws.
6
+ * Version: 4.3.0
7
  * Author: Jan-Peter Lambeck & 3UU
8
  * Author URI: https://de.wordpress.org/plugins/shariff/
9
  * License: MIT
26
  // update function to perform tasks _once_ after an update, based on version number to work for automatic as well as manual updates
27
  function shariff3UU_update() {
28
  /******************** ADJUST VERSION ********************/
29
+ $code_version = "4.3.0"; // set code version - needs to be adjusted for every new version!
30
  /******************** ADJUST VERSION ********************/
31
 
32
  // get options
69
  include( plugin_dir_path( __FILE__ ) . 'admin/admin_notices.php' );
70
  }
71
 
72
+ // custom meta box
73
+ function shariff3UU_include_metabox() {
74
+ // check if user is allowed to publish posts
75
+ if ( current_user_can( 'publish_posts' ) ) {
76
+ // include admin_metabox.php
77
+ include( plugin_dir_path( __FILE__ ) . 'admin/admin_metabox.php' );
78
+ }
79
+ }
80
+ add_action('init','shariff3UU_include_metabox');
81
+
82
  // waiting for WordPress core to handle the saving of the dismiss click themself
83
  function shariff3UU_dismiss_update_notice() {
84
  update_option( 'shariff3UU_hide_update_notice', 'hide' );
177
  }
178
 
179
  // adjust ttl based on the post age
180
+ if ( isset ( $timestamp ) && ( ! isset( $shariff3UU["disable_dynamic_cache"] ) || ( isset( $shariff3UU["disable_dynamic_cache"] ) && $shariff3UU["disable_dynamic_cache"] != '1' ) ) ) {
181
  // the timestamp represents the last time the post or page was modfied
182
  $post_time = intval( $timestamp );
183
  $current_time = current_time( 'timestamp', true );
431
 
432
  // type of current post
433
  $current_post_type = get_post_type();
434
+ if ( $current_post_type === 'post' ) $current_post_type = 'posts';
435
+
436
+ // prevent php warnings in debug mode
437
+ $add_before = '';
438
+ $add_after = '';
439
 
440
+ // check if shariff should be added automatically (plugin options)
441
  if ( ! is_singular() ) {
442
  // on blog page
443
+ if ( isset( $shariff3UU["add_before"]["posts_blogpage"] ) && $shariff3UU["add_before"]["posts_blogpage"] == '1') $add_before = '1';
444
+ if ( isset( $shariff3UU["add_after"]["posts_blogpage"] ) && $shariff3UU["add_after"]["posts_blogpage"] == '1' ) $add_after = '1';
445
  }
446
  elseif ( is_singular( 'post' ) ) {
447
  // on single post
448
+ if ( isset( $shariff3UU["add_before"][$current_post_type] ) && $shariff3UU["add_before"][$current_post_type] == '1' ) $add_before = '1';
449
+ if ( isset( $shariff3UU["add_after"][$current_post_type] ) && $shariff3UU["add_after"][$current_post_type] == '1' ) $add_after = '1';
450
  }
451
  elseif ( is_singular( 'page' ) ) {
452
  // on pages
453
+ if ( isset( $shariff3UU["add_before"]["pages"] ) && $shariff3UU["add_before"]["pages"] == '1' ) $add_before = '1';
454
+ if ( isset( $shariff3UU["add_after"]["pages"] ) && $shariff3UU["add_after"]["pages"] == '1' ) $add_after = '1';
455
  }
456
  else {
457
  // on custom_post_types
459
  if ( is_array( $all_custom_post_types ) ) {
460
  $custom_types = array_keys( $all_custom_post_types );
461
  // add shariff, if custom type and option checked in the admin menu
462
+ if ( isset( $shariff3UU['add_after'][$current_post_type] ) && $shariff3UU['add_after'][$current_post_type] == '1' ) $add_after = '1';
463
  }
464
  }
465
+
466
+ // check if buttons are enabled on a single post or page via the meta box
467
+ if ( get_post_meta( get_the_ID(), 'shariff_metabox_before', true ) ) $add_before = '1';
468
+ if ( get_post_meta( get_the_ID(), 'shariff_metabox_after', true ) ) $add_after = '1';
469
+
470
+ // add shariff
471
+ if ( $add_before === '1' ) $content = '[shariff]' . $content;
472
+ if ( $add_after === '1' ) $content .= '[shariff]';
473
+
474
+ // return content
475
  return $content;
476
  }
477
  if ( ! isset( $GLOBALS["shariff3UU"]["shortcodeprio"] ) ) $GLOBALS["shariff3UU"]["shortcodeprio"] = '10';
544
  function shariff3UU_render( $atts, $content = null ) {
545
  // get options
546
  $shariff3UU = $GLOBALS["shariff3UU"];
547
+
548
  // avoid errors if no attributes are given - instead use the old set of services to make it backward compatible
549
  if ( empty( $shariff3UU["services"] ) ) $shariff3UU["services"] = "twitter|facebook|googleplus|info";
550
 
555
  if ( isset( $shariff3UU["buttonsize"] ) && $shariff3UU["buttonsize"] == '1' ) $backend_options["buttonsize"] = 'small';
556
  if ( empty( $atts ) ) $atts = $backend_options;
557
  else $atts = array_merge( $backend_options, $atts );
558
+
559
+ // get meta box shortcode
560
+ $shariff_metabox_ignore_widget = get_post_meta( get_the_ID(), 'shariff_metabox_ignore_widget', true );
561
+
562
+ // if we are not a widget or if we are a widget and not beeing set to be ignored we add the meta box settings
563
+ if ( ( ! isset( $atts["widget"] ) || ( isset( $atts["widget"] ) && $atts["widget"] == '1' && $shariff_metabox_ignore_widget != '1' ) ) && $atts["services"] != "total" && $atts["services"] != "totalnumber" ) {
564
+ // get meta box disable value
565
+ $shariff3UU_metabox_disable = get_post_meta( get_the_ID(), 'shariff_metabox_disable', true );
566
+
567
+ // if the meta box setting is set to diasbled we stop all further actions
568
+ if ( $shariff3UU_metabox_disable == '1' ) return;
569
+
570
+ // get meta box shortcode
571
+ $shariff3UU_metabox = get_post_meta( get_the_ID(), 'shariff_metabox', true );
572
+
573
+ // replace shariff with shariffmeta
574
+ $shariff3UU_metabox = str_replace( '[shariff ', '[shariffmeta ', $shariff3UU_metabox );
575
+
576
+ // get meta box atts
577
+ do_shortcode( $shariff3UU_metabox );
578
+ if ( isset( $GLOBALS["shariff3UU"]["metabox"] ) ) {
579
+ $metabox = $GLOBALS["shariff3UU"]["metabox"];
580
+ }
581
+ else {
582
+ $metabox = '';
583
+ }
584
+
585
+ // get meta box media attribute
586
+ $shariff3UU_metabox_media = get_post_meta( get_the_ID(), 'shariff_metabox_media', true );
587
+ if ( ! empty( $shariff3UU_metabox_media ) ) {
588
+ $metabox["media"] = $shariff3UU_metabox_media;
589
+ }
590
+
591
+ // merge with atts array (meta box shortcode overrides all others)
592
+ if ( ! empty( $metabox ) ) $atts = array_merge( $atts, $metabox );
593
+
594
+ // clear metabox global
595
+ $GLOBALS["shariff3UU"]["metabox"] = '';
596
+ }
597
 
598
  // Ov3rfly: make atts configurable from outside, e.g. for language etc.
599
  $atts = apply_filters( 'shariff3UU_render_atts', $atts );
619
  }
620
 
621
  // enqueue share count script (the JS should be loaded at the footer - make sure that wp_footer() is present in your theme!)
622
+ // if SCRIPT_DEBUG is true, we load the non minified version
623
  if ( array_key_exists( 'backend', $atts ) && $atts['backend'] == "on" ) {
624
  // if SCRIPT_DEBUG is true, we load the non minified version
625
  if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG === TRUE ) {
629
  wp_enqueue_script( 'shariffjs', plugins_url( '/js/shariff.min.js', __FILE__ ), '', $shariff3UU["version"], true );
630
  }
631
  }
632
+
633
+ // enqueue popup script (the JS should be loaded at the footer - make sure that wp_footer() is present in your theme!)
634
+ // if SCRIPT_DEBUG is true, we load the non minified version
635
+ if ( array_key_exists( 'popup', $atts ) && $atts['popup'] == "1" ) {
636
+ // if SCRIPT_DEBUG is true, we load the non minified version
637
+ if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG === TRUE ) {
638
+ wp_enqueue_script( 'shariff_popup', plugins_url( '/js/shariff-popup.js', __FILE__ ), '', $shariff3UU["version"], true );
639
+ }
640
+ else {
641
+ wp_enqueue_script( 'shariff_popup', plugins_url( '/js/shariff-popup.min.js', __FILE__ ), '', $shariff3UU["version"], true );
642
+ }
643
+ }
644
 
645
  // share url
646
  if ( array_key_exists( 'url', $atts ) ) $share_url = urlencode( $atts['url'] );
647
  else $share_url = urlencode( get_permalink() );
648
 
649
  // share title
650
+ if ( array_key_exists( 'title', $atts ) ) $share_title = urlencode( $atts['title'] );
651
  else $share_title = urlencode( html_entity_decode( get_the_title(), ENT_COMPAT, 'UTF-8' ) );
652
 
653
  // set transient name
664
  // prevent info notices in case debug mode is on
665
  $output = '';
666
 
667
+ // if we have a custom style attribute or a class add ShariffSC container including these styles
668
+ if ( array_key_exists( 'style', $atts ) || array_key_exists( 'cssclass', $atts ) ) {
669
+ $output .= '<div class="ShariffSC';
670
+ if ( array_key_exists( 'cssclass', $atts ) ) $output .= ' ' . esc_html( $atts['cssclass'] ) . '"';
671
+ else $output .= '"';
672
+ if ( array_key_exists( 'style', $atts ) ) $output .= ' style="' . esc_html( $atts['style'] ) . '"';
673
+ $output .= '>';
674
  }
675
 
676
  // if no language is set, try http_negotiate_language
709
  );
710
 
711
  // add timestamp for cache
712
+ if ( array_key_exists( 'timestamp', $atts ) ) $post_timestamp = $atts['timestamp'];
713
+ else $post_timestamp = absint( get_the_modified_date( 'U' ) );
714
 
715
  // start output of actual Shariff buttons
716
  $output .= '<div class="shariff shariff-main';
734
  // share url
735
  $output .= ' data-url="' . esc_html( $share_url ) . '"';
736
  // timestamp for cache
737
+ $output .= ' data-timestamp="' . $post_timestamp . '"';
738
+ // hide share counts when zero
739
+ if ( isset( $atts['hidezero'] ) && $atts['hidezero'] == '1' ) {
740
+ $output .= ' data-hidezero="1"';
741
+ }
742
  // add external api if entered
743
  if ( isset( $shariff3UU["external_host"] ) && ! empty( $shariff3UU["external_host"] ) && isset( $shariff3UU["external_direct"] ) ) {
744
  $output .= ' data-backendurl="' . $shariff3UU["external_host"] . '"';
775
  else $output .= 'orientation-horizontal ';
776
  // size
777
  if ( array_key_exists( 'buttonsize', $atts ) ) $output .= 'buttonsize-' . esc_html( $atts['buttonsize'] );
778
+ else $output .= 'buttonsize-medium';
779
  $output .= '">';
780
 
781
  // prevent warnings while debug mode is on
861
 
862
  // build the actual button
863
  $output .= '<a href="' . $button_url . '" title="' . $button_title . '" aria-label="' . $button_title . '" role="button" rel="';
864
+ if ( $mobile_only != '1' ) $output .= 'noopener ';
865
  $output .= 'nofollow" class="shariff-link" ';
866
  // same window?
867
  if ( ! isset( $same_window ) || isset( $same_window ) && $same_window != '1' ) $output .= 'target="_blank" ';
878
  // share counts?
879
  if ( array_key_exists( 'sharecounts', $atts ) && $atts['sharecounts'] == "1" && $backend_available == '1' && ! isset ( $shariff3UU["disable"][ $service ] ) ) {
880
  $output .= '<span class="shariff-count" data-service="' . $service . '" style="color:' . $main_color;
881
+ if ( array_key_exists( $service, $share_counts ) === true && $share_counts[ $service ] !== null && $share_counts[ $service ] !== '-1' && ( ! isset( $atts['hidezero'] ) || ( isset( $atts['hidezero'] ) && $atts['hidezero'] != '1' ) || ( isset( $atts['hidezero'] ) && $atts['hidezero'] == '1' && $share_counts[ $service ] > 0 ) ) ) {
882
+ $output .= '"> ' . $share_counts[ $service ];
883
  }
884
  else $output .= ';opacity:0">';
885
  $output .= '</span>&nbsp;';
944
  return $output;
945
  }
946
 
947
+ // register helper shortcode
948
+ add_shortcode( 'shariffmeta', 'shariff3UU_meta' );
949
+
950
+ // meta box helper function
951
+ function shariff3UU_meta( $atts, $content = null ) {
952
+ $GLOBALS["shariff3UU"]["metabox"] = $atts;
953
+ return;
954
+ }
955
+
956
  // prepend mailform if view=mail or send mail if act=sendMail
957
  function shariff3UU_viewmail( $content ) {
958
  // prepend the mail form and return content
1470
  else $media = ' media="' . plugins_url( '/pictos/defaultHint.png', __FILE__ ) . '"';
1471
  }
1472
 
1473
+ // build shorttag and add url, title and media if necessary as well as the widget attribute
1474
+ $shorttag = substr($shorttag,0,-1) . $page_title . $page_url . $media . ' widget="1"]';
1475
 
1476
  // replace mailform with mailto if on blog page to avoid broken button
1477
  if ( ! is_singular() ) {