Shariff Wrapper - Version 4.5.3

Version Description

  • removed LinkedIn Share Counts due to LinkedIn removing them completely
  • removed GooglePlus Share Counts due to Google shutting GooglePlus down
  • removed OpenShareCount due to the service having shut down
  • removed NewShareCount due to the service having shut down
  • removed Mastodon temporarily until a new working solution is available
  • deprecated GooglePlus as a service, will be removed with the next release
  • added TwitCount (twitcount.com) as an alternative for Twitter share counts
  • updated to Facebook Graph API v3.2
  • updated to WordPress Coding Standards 2.0
  • corrected minor typos
  • added the new logo thanks to Philipp Wildfeuer (@phil_sauvage)
Download this release

Release Info

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

Code changes from version 4.5.2 to 4.5.3

admin/admin-menu.php CHANGED
@@ -58,27 +58,51 @@ function shariff3uu_options_init() {
58
  register_setting( 'basic', 'shariff3uu_basic', 'shariff3uu_basic_sanitize' );
59
 
60
  // First tab - basic options.
61
- add_settings_section( 'shariff3uu_basic_section', __( 'Basic options', 'shariff' ),
62
- 'shariff3uu_basic_section_callback', 'basic' );
 
 
 
 
63
 
64
  // Services.
65
  add_settings_field( 'shariff3uu_text_services', '<div style="width:450px">' . __( 'Enable the following services in the provided order:', 'shariff' ) . '</div>', 'shariff3uu_text_services_render', 'basic', 'shariff3uu_basic_section' );
66
 
67
  // Add after.
68
- add_settings_field( 'shariff3uu_multiplecheckbox_add_after', __( 'Add the Shariff buttons <u>after</u> all:', 'shariff' ),
69
- 'shariff3uu_multiplecheckbox_add_after_render', 'basic', 'shariff3uu_basic_section' );
 
 
 
 
 
70
 
71
  // Add before.
72
- add_settings_field( 'shariff3uu_checkbox_add_before', __( 'Add the Shariff buttons <u>before</u> all:', 'shariff' ),
73
- 'shariff3uu_multiplecheckbox_add_before_render', 'basic', 'shariff3uu_basic_section' );
 
 
 
 
 
74
 
75
  // Disable on protected posts.
76
- add_settings_field( 'shariff3uu_checkbox_disable_on_protected', __( 'Disable the Shariff buttons on password protected posts.', 'shariff' ),
77
- 'shariff3uu_checkbox_disable_on_protected_render', 'basic', 'shariff3uu_basic_section' );
 
 
 
 
 
78
 
79
  // Disable outside of loop.
80
- add_settings_field( 'shariff3uu_checkbox_disable_outside_loop', __( 'Disable the Shariff buttons outside of the main loop.', 'shariff' ),
81
- 'shariff3uu_checkbox_disable_outside_loop_render', 'basic', 'shariff3uu_basic_section' );
 
 
 
 
 
82
 
83
  // Add to custom WordPress hooks.
84
  add_settings_field( 'shariff3uu_text_custom_hooks', __( 'Add Shariff to the following custom WordPress hooks:', 'shariff' ), 'shariff3uu_text_custom_hooks_render', 'basic', 'shariff3uu_basic_section' );
@@ -95,72 +119,157 @@ function shariff3uu_options_init() {
95
  add_settings_section( 'shariff3uu_design_section', __( 'Design options', 'shariff' ), 'shariff3uu_design_section_callback', 'design' );
96
 
97
  // Button language.
98
- add_settings_field( 'shariff3uu_select_language', '<div style="width:450px">' . esc_html__( 'Default button language:', 'shariff' ) . '</div>',
99
- 'shariff3uu_select_language_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
100
 
101
  // Automatic button language for multilingual sites.
102
- add_settings_field( 'shariff3uu_checkbox_autolang', __( 'Automatically set button language based on locale (e.g. set by WPML).', 'shariff' ),
103
- 'shariff3uu_checkbox_autolang_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
104
 
105
  // Theme.
106
- add_settings_field( 'shariff3uu_radio_theme', __( 'Shariff button design:', 'shariff' ),
107
- 'shariff3uu_radio_theme_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
108
 
109
  // Button size.
110
- add_settings_field( 'shariff3uu_checkbox_buttonsize', __( 'Button size:', 'shariff' ),
111
- 'shariff3uu_checkbox_buttonsize_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
112
 
113
  // Button stretch.
114
- add_settings_field( 'shariff3uu_checkbox_buttonsstretch', __( 'Stretch buttons horizontally to full width.', 'shariff' ),
115
- 'shariff3uu_checkbox_buttonstretch_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
116
 
117
  // Border radius.
118
- add_settings_field( 'shariff3uu_number_borderradius', __( 'Border radius for the round theme (1-50):', 'shariff' ),
119
- 'shariff3uu_number_borderradius_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
120
 
121
  // Custom main color.
122
- add_settings_field( 'shariff3uu_text_maincolor', __( 'Custom main color for <b>all</b> buttons (hexadecimal):', 'shariff' ),
123
- 'shariff3uu_text_maincolor_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
124
 
125
  // Custom secondary color.
126
- add_settings_field( 'shariff3uu_text_secondarycolor', __( 'Custom secondary color for <b>all</b> buttons (hexadecimal):', 'shariff' ),
127
- 'shariff3uu_text_secondarycolor_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
128
 
129
  // Vertical.
130
- add_settings_field( 'shariff3uu_checkbox_vertical', __( 'Shariff button orientation <b>vertical</b>.', 'shariff' ),
131
- 'shariff3uu_checkbox_vertical_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
132
 
133
  // Alignment option.
134
- add_settings_field( 'shariff3uu_radio_align', __( 'Alignment of the Shariff buttons:', 'shariff' ),
135
- 'shariff3uu_radio_align_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
136
 
137
  // Alignment option for the widget.
138
- add_settings_field( 'shariff3uu_radio_align_widget', __( 'Alignment of the Shariff buttons in the widget:', 'shariff' ),
139
- 'shariff3uu_radio_align_widget_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
140
 
141
  // Headline.
142
- add_settings_field( 'shariff3uu_text_headline', __( 'Headline above all Shariff buttons:', 'shariff' ),
143
- 'shariff3uu_text_headline_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
144
 
145
  // Alternative headline if share counts are zero.
146
- add_settings_field( 'shariff3uu_text_headline_zero', __( 'Alternative headline, if share counts are zero:', 'shariff' ),
147
- 'shariff3uu_text_headline_zero_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
148
 
149
  // Custom css.
150
- add_settings_field( 'shariff3uu_text_style', __( 'Custom CSS <u>attributes</u> for the container <u>around</u> Shariff:', 'shariff' ),
151
- 'shariff3uu_text_style_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
152
 
153
  // Custom css class.
154
- add_settings_field( 'shariff3uu_text_cssclass', __( 'Custom CSS <u>class</u> for the container <u>around</u> Shariff:', 'shariff' ),
155
- 'shariff3uu_text_cssclass_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
156
 
157
  // Hide until css loaded.
158
- add_settings_field( 'shariff3uu_checkbox_hideuntilcss', __( 'Hide buttons until page is fully loaded.', 'shariff' ),
159
- 'shariff3uu_checkbox_hideuntilcss_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
160
 
161
  // Open in popup.
162
- add_settings_field( 'shariff3uu_checkbox_popup', __( 'Open links in a popup (requires JavaScript).', 'shariff' ),
163
- 'shariff3uu_checkbox_popup_render', 'design', 'shariff3uu_design_section' );
 
 
 
 
 
164
 
165
  /** Third tab - advanced */
166
 
@@ -168,65 +277,120 @@ function shariff3uu_options_init() {
168
  register_setting( 'advanced', 'shariff3uu_advanced', 'shariff3uu_advanced_sanitize' );
169
 
170
  // Third tab - advanced options.
171
- add_settings_section( 'shariff3uu_advanced_section', __( 'Advanced options', 'shariff' ),
172
- 'shariff3uu_advanced_section_callback', 'advanced' );
 
 
 
 
173
 
174
  // Info url.
175
  add_settings_field(
176
- 'shariff3uu_text_info_url', '<div style="width:450px">' . __( 'Custom link for the info button:', 'shariff' ) . '</div>',
177
- 'shariff3uu_text_info_url_render', 'advanced', 'shariff3uu_advanced_section' );
 
 
 
 
178
 
179
  // Info text.
180
  add_settings_field(
181
- 'shariff3uu_text_info_text', __( 'Custom text for the info button:', 'shariff' ),
182
- 'shariff3uu_text_info_text_render', 'advanced', 'shariff3uu_advanced_section' );
 
 
 
 
183
 
184
  // Twitter via.
185
  add_settings_field(
186
- 'shariff3uu_text_twittervia', __( 'Twitter username for the via tag:', 'shariff' ),
187
- 'shariff3uu_text_twittervia_render', 'advanced', 'shariff3uu_advanced_section' );
 
 
 
 
188
 
189
  // Flattr username.
190
  add_settings_field(
191
- 'shariff3uu_text_flattruser', __( 'Flattr username:', 'shariff' ),
192
- 'shariff3uu_text_flattruser_render', 'advanced', 'shariff3uu_advanced_section' );
 
 
 
 
193
 
194
  // Patreon username.
195
  add_settings_field(
196
- 'shariff3uu_text_patreonid', __( 'Patreon username:', 'shariff' ),
197
- 'shariff3uu_text_patreonid_render', 'advanced', 'shariff3uu_advanced_section' );
 
 
 
 
198
 
199
  // Paypal button id.
200
  add_settings_field(
201
- 'shariff3uu_text_paypalbuttonid', __( 'PayPal hosted button ID:', 'shariff' ),
202
- 'shariff3uu_text_paypalbuttonid_render', 'advanced', 'shariff3uu_advanced_section' );
 
 
 
 
203
 
204
  // Paypalme id.
205
  add_settings_field(
206
- 'shariff3uu_text_paypalmeid', __( 'PayPal.Me ID:', 'shariff' ),
207
- 'shariff3uu_text_paypalmeid_render', 'advanced', 'shariff3uu_advanced_section' );
 
 
 
 
208
 
209
  // Bitcoin address.
210
  add_settings_field(
211
- 'shariff3uu_text_bitcoinaddress', __( 'Bitcoin address:', 'shariff' ),
212
- 'shariff3uu_text_bitcoinaddress_render', 'advanced', 'shariff3uu_advanced_section' );
 
 
 
 
213
 
214
  // RSS feed.
215
  add_settings_field(
216
- 'shariff3uu_text_rssfeed', __( 'RSS feed:', 'shariff' ),
217
- 'shariff3uu_text_rssfeed_render', 'advanced', 'shariff3uu_advanced_section' );
 
 
 
 
218
 
219
  // Default image for pinterest.
220
- add_settings_field( 'shariff3uu_text_default_pinterest', __( 'Default image for Pinterest:', 'shariff' ),
221
- 'shariff3uu_text_default_pinterest_render', 'advanced', 'shariff3uu_advanced_section' );
 
 
 
 
 
222
 
223
  // Shortcode priority.
224
- add_settings_field( 'shariff3uu_number_shortcodeprio', __( 'Shortcode priority:', 'shariff' ),
225
- 'shariff3uu_number_shortcodeprio_render', 'advanced', 'shariff3uu_advanced_section' );
 
 
 
 
 
226
 
227
  // Disable metabox.
228
- add_settings_field( 'shariff3uu_checkbox_disable_metabox', __( 'Disable the metabox.', 'shariff' ),
229
- 'shariff3uu_checkbox_disable_metabox_render', 'advanced', 'shariff3uu_advanced_section' );
 
 
 
 
 
230
 
231
  /** Fifth tab - statistic */
232
 
@@ -234,82 +398,159 @@ function shariff3uu_options_init() {
234
  register_setting( 'statistic', 'shariff3uu_statistic', 'shariff3uu_statistic_sanitize' );
235
 
236
  // Fifth tab (statistic).
237
- add_settings_section( 'shariff3uu_statistic_section', __( 'Statistic', 'shariff' ),
238
- 'shariff3uu_statistic_section_callback', 'statistic' );
 
 
 
 
239
 
240
  // Statistic.
241
- add_settings_field( 'shariff3uu_checkbox_backend', '<div style="width:450px">' . __( 'Enable statistic.', 'shariff' ) . '</div>',
242
- 'shariff3uu_checkbox_backend_render', 'statistic', 'shariff3uu_statistic_section' );
 
 
 
 
 
243
 
244
  // Share counts.
245
- add_settings_field( 'shariff3uu_checkbox_sharecounts', __( 'Show share counts on buttons.', 'shariff' ),
246
- 'shariff3uu_checkbox_sharecounts_render', 'statistic', 'shariff3uu_statistic_section' );
 
 
 
 
 
247
 
248
  // Hide when zero.
249
- add_settings_field( 'shariff3uu_checkbox_hidezero', __( 'Hide share counts when they are zero.', 'shariff' ),
250
- 'shariff3uu_checkbox_hidezero_render', 'statistic', 'shariff3uu_statistic_section' );
 
 
 
 
 
251
 
252
  // Facebook App ID.
253
- add_settings_field( 'shariff3uu_text_fb_id', __( 'Facebook App ID:', 'shariff' ),
254
- 'shariff3uu_text_fb_id_render', 'statistic', 'shariff3uu_statistic_section' );
 
 
 
 
 
255
 
256
  // Facebook App Secret.
257
- add_settings_field( 'shariff3uu_text_fb_secret', __( 'Facebook App Secret:', 'shariff' ),
258
- 'shariff3uu_text_fb_secret_render', 'statistic', 'shariff3uu_statistic_section' );
 
 
 
 
 
259
 
260
  // Automatic cache.
261
- add_settings_field( 'shariff3uu_checkbox_automaticcache', __( 'Fill cache automatically.', 'shariff' ),
262
- 'shariff3uu_checkbox_automaticcache_render', 'statistic', 'shariff3uu_statistic_section' );
 
 
 
 
 
263
 
264
  // Ranking.
265
- add_settings_field( 'shariff3uu_number_ranking', __( 'Number of posts on ranking tab:', 'shariff' ),
266
- 'shariff3uu_number_ranking_render', 'statistic', 'shariff3uu_statistic_section' );
 
 
 
 
 
267
 
268
  // TTL.
269
- add_settings_field( 'shariff3uu_number_ttl', __( 'Cache TTL in seconds (60 - 7200):', 'shariff' ),
270
- 'shariff3uu_number_ttl_render', 'statistic', 'shariff3uu_statistic_section' );
 
 
 
 
 
271
 
272
  // Disable dynamic cache lifespan.
273
- add_settings_field( 'shariff3uu_checkbox_disable_dynamic_cache', __( 'Disable the dynamic cache lifespan (not recommended).', 'shariff' ),
274
- 'shariff3uu_checkbox_disable_dynamic_cache_render', 'statistic', 'shariff3uu_statistic_section' );
275
-
276
- // Twitter NewShareCount.
277
- add_settings_field( 'shariff3uu_checkbox_newsharecount', __( 'Use NewShareCount instead of OpenShareCount for Twitter.', 'shariff' ),
278
- 'shariff3uu_checkbox_newsharecount_render', 'statistic', 'shariff3uu_statistic_section' );
 
279
 
280
  // Disable services.
281
- add_settings_field( 'shariff3uu_multiplecheckbox_disable_services', __( 'Disable the following services (share counts only):', 'shariff' ),
282
- 'shariff3uu_multiplecheckbox_disable_services_render', 'statistic', 'shariff3uu_statistic_section' );
 
 
 
 
 
283
 
284
  // External hosts.
285
- add_settings_field( 'shariff3uu_text_external_host', __( 'External API for share counts:', 'shariff' ),
286
- 'shariff3uu_text_external_host_render', 'statistic', 'shariff3uu_statistic_section' );
 
 
 
 
 
287
 
288
  // Request external api directly from js.
289
- add_settings_field( 'shariff3uu_checkbox_external_direct', __( 'Request external API directly.', 'shariff' ),
290
- 'shariff3uu_checkbox_external_direct_render', 'statistic', 'shariff3uu_statistic_section' );
 
 
 
 
 
291
 
292
  // WP in sub folder and api only reachable there?
293
- add_settings_field( 'shariff3uu_checkbox_subapi', __( 'Local API not reachable in root.', 'shariff' ),
294
- 'shariff3uu_checkbox_subapi_render', 'statistic', 'shariff3uu_statistic_section' );
 
 
 
 
 
295
 
296
  /** Sixth tab - help */
297
 
298
  // Register sixth tab (help).
299
- add_settings_section( 'shariff3uu_help_section', __( 'Shariff Help', 'shariff' ),
300
- 'shariff3uu_help_section_callback', 'help' );
 
 
 
 
301
 
302
  /** Seventh tab - status */
303
 
304
  // Register seventh tab (status).
305
- add_settings_section( 'shariff3uu_status_section', __( 'Status', 'shariff' ),
306
- 'shariff3uu_status_section_callback', 'status' );
 
 
 
 
307
 
308
  /** Eight tab - ranking */
309
 
310
  // Register eight tab (ranking).
311
- add_settings_section( 'shariff3uu_ranking_section', __( 'Ranking', 'shariff' ),
312
- 'shariff3uu_ranking_section_callback', 'ranking' );
 
 
 
 
313
  }
314
 
315
  /**
@@ -514,9 +755,6 @@ function shariff3uu_statistic_sanitize( $input ) {
514
  if ( isset( $input['disable_dynamic_cache'] ) ) {
515
  $valid['disable_dynamic_cache'] = absint( $input['disable_dynamic_cache'] );
516
  }
517
- if ( isset( $input['newsharecount'] ) ) {
518
- $valid['newsharecount'] = absint( $input['newsharecount'] );
519
- }
520
  if ( isset( $input['disable'] ) ) {
521
  $valid['disable'] = sani_arrays( $input['disable'] );
522
  }
@@ -585,9 +823,9 @@ function shariff3uu_text_services_render() {
585
  } else {
586
  $services = '';
587
  }
588
- echo '<input type="text" name="shariff3uu_basic[services]" value="' . esc_html( $services ) . '" size="90" placeholder="twitter|facebook|googleplus|info">';
589
- echo '<p><code>addthis|bitcoin|diaspora|facebook|flattr|flipboard|googleplus|info|linkedin|mailto</code></p>';
590
- echo '<p><code>mastodon|odnoklassniki|patreon|paypal|paypalme|pinterest|pocket|printer|qzone|reddit</code></p>';
591
  echo '<p><code>rss|sms|stumbleupon|telegram|tencentweibo|threema|tumblr|twitter|vk|wallabag|weibo</code></p>';
592
  echo '<p><code>whatsapp|xing</code></p>';
593
  echo '<p>' . esc_html__( 'Use the pipe sign | (Alt Gr + &lt; or &#8997; + 7) between two or more services.', 'shariff' ) . '</p>';
@@ -750,15 +988,19 @@ function shariff3uu_design_section_callback() {
750
  $help_link = get_bloginfo( 'wpurl' ) . '/wp-admin/options-general.php?page=shariff3uu&tab=help';
751
  // Translators: %s will be replaced with the correct URL to the help section.
752
  printf( wp_kses( __( 'For more information please take a look at the <a href="%s">Help Section</a>. ', 'shariff' ), array( 'a' => array( 'href' => true ) ) ), esc_url( $help_link ) );
753
- // Translators: %s will be replaced with the correct URL to the wordpress.org support forum.
754
- printf( wp_kses( __( 'You should also check out the <a href="%s" target="_blank">Support Forum</a>. ', 'shariff' ),
755
- array(
756
- 'a' => array(
757
- 'href' => true,
758
- 'target' => true,
759
- ),
760
- )
761
- ), 'https://wordpress.org/support/plugin/shariff/' );
 
 
 
 
762
  }
763
 
764
  /**
@@ -824,7 +1066,7 @@ function shariff3uu_radio_theme_render() {
824
  <input type="radio" name="shariff3uu_design[theme]" value="" ' . checked( $options['theme'], '', 0 ) . '>default
825
  </div>
826
  <div class="shariff_options-cell">
827
- <img src="' . esc_url( $plugins_url ) . '/shariff/images/defaultBtns.png">
828
  </div>
829
  </div>
830
  <div style="display:table-row">
@@ -832,7 +1074,7 @@ function shariff3uu_radio_theme_render() {
832
  <input type="radio" name="shariff3uu_design[theme]" value="color" ' . checked( $options['theme'], 'color', 0 ) . '>color
833
  </div>
834
  <div class="shariff_options-cell">
835
- <img src="' . esc_url( $plugins_url ) . '/shariff/images/colorBtns.png">
836
  </div>
837
  </div>
838
  <div style="display:table-row">
@@ -840,7 +1082,7 @@ function shariff3uu_radio_theme_render() {
840
  <input type="radio" name="shariff3uu_design[theme]" value="grey" ' . checked( $options['theme'], 'grey', 0 ) . '>grey
841
  </div>
842
  <div class="shariff_options-cell">
843
- <img src="' . esc_url( $plugins_url ) . '/shariff/images/greyBtns.png">
844
  </div>
845
  </div>
846
  <div style="display:table-row">
@@ -848,7 +1090,7 @@ function shariff3uu_radio_theme_render() {
848
  <input type="radio" name="shariff3uu_design[theme]" value="white" ' . checked( $options['theme'], 'white', 0 ) . '>white
849
  </div>
850
  <div class="shariff_options-cell">
851
- <img src="' . esc_url( $plugins_url ) . '/shariff/images/whiteBtns.png">
852
  </div>
853
  </div>
854
  <div style="display:table-row">
@@ -856,7 +1098,7 @@ function shariff3uu_radio_theme_render() {
856
  <input type="radio" name="shariff3uu_design[theme]" value="round" ' . checked( $options['theme'], 'round', 0 ) . '>round
857
  </div>
858
  <div class="shariff_options-cell">
859
- <img src="' . esc_url( $plugins_url ) . '/shariff/images/roundBtns.png">
860
  </div>
861
  </div>
862
  </div>';
@@ -1052,15 +1294,19 @@ function shariff3uu_advanced_section_callback() {
1052
  $help_link = get_bloginfo( 'wpurl' ) . '/wp-admin/options-general.php?page=shariff3uu&tab=help';
1053
  // Translators: %s will be replaced with the correct URL to the help section.
1054
  printf( wp_kses( __( 'For more information please take a look at the <a href="%s">Help Section</a>. ', 'shariff' ), array( 'a' => array( 'href' => true ) ) ), esc_url( $help_link ) );
1055
- // Translators: %s will be replaced with the correct URL to the wordpress.org support forum.
1056
- printf( wp_kses( __( 'You should also check out the <a href="%s" target="_blank">Support Forum</a>. ', 'shariff' ),
1057
- array(
1058
- 'a' => array(
1059
- 'href' => true,
1060
- 'target' => true,
1061
- ),
1062
- )
1063
- ), 'https://wordpress.org/support/plugin/shariff/' );
 
 
 
 
1064
  }
1065
 
1066
  /**
@@ -1214,6 +1460,8 @@ function shariff3uu_checkbox_disable_metabox_render() {
1214
  */
1215
  function shariff3uu_statistic_section_callback() {
1216
  echo esc_html__( 'This determines how share counts are handled by Shariff.', 'shariff' );
 
 
1217
  if ( isset( $GLOBALS['shariff3uu_statistic']['external_direct'] ) ) {
1218
  echo '<br><span style="color:red;font-weight:bold;">';
1219
  echo esc_html__( 'Warning: ', 'shariff' );
@@ -1336,16 +1584,6 @@ function shariff3uu_checkbox_disable_dynamic_cache_render() {
1336
  echo ' value="1">';
1337
  }
1338
 
1339
- /**
1340
- * Twitter NewShareCount.
1341
- */
1342
- function shariff3uu_checkbox_newsharecount_render() {
1343
- echo '<input type="checkbox" name="shariff3uu_statistic[newsharecount]" ';
1344
- if ( isset( $GLOBALS['shariff3uu_statistic']['newsharecount'] ) ) {
1345
- echo checked( $GLOBALS['shariff3uu_statistic']['newsharecount'], 1, 0 );
1346
- }
1347
- echo ' value="1">';
1348
- }
1349
  /**
1350
  * Disable services.
1351
  */
@@ -1373,7 +1611,8 @@ function shariff3uu_text_external_host_render() {
1373
  $external_host = '';
1374
  }
1375
  echo '<input type="text" name="shariff3uu_statistic[external_host]" value="' . esc_html( $external_host ) . '" size="50" placeholder="' . esc_url( get_bloginfo( 'url' ) ) . '/wp-json/shariff/v1/share_counts">';
1376
- echo '<p>' . wp_kses( __( 'Warning: This is an experimental feature. Please read the <a href="https://wordpress.org/plugins/shariff/faq/" target="_blank">Frequently Asked Questions (FAQ)</a>.', 'shariff' ),
 
1377
  array(
1378
  'a' => array(
1379
  'href' => true,
@@ -1412,57 +1651,81 @@ function shariff3uu_checkbox_subapi_render() {
1412
  */
1413
  function shariff3uu_help_section_callback() {
1414
  echo '<p>';
1415
- // Translators: %1$s and %2$s will be replaced with the correct URLs to the authors websites.
1416
- printf( wp_kses( __( 'The WordPress plugin "Shariff Wrapper" has been developed by <a href="%1$s" target="_blank">Jan-Peter Lambeck</a> and <a href="%2$s" target="_blank">3UU</a> in order to help protect the privacy of your visitors. ', 'shariff' ),
1417
- array(
1418
- 'a' => array(
1419
- 'href' => true,
1420
- 'target' => true,
1421
- ),
1422
- )
1423
- ), 'https://www.jplambeck.de', 'https://datenverwurstungszentrale.com' );
 
 
 
 
 
1424
  echo ' ';
1425
- // Translators: %s will be replaced with the correct URL to the German computer magazine.
1426
- printf( wp_kses( __( 'It is based on the original Shariff buttons developed by the German computer magazine <a href="%s" target="_blank">c\'t</a> that are compliant to the General Data Protection Regulation (GDPR) (Regulation (EU) 2016/679).', 'shariff' ),
1427
- array(
1428
- 'a' => array(
1429
- 'href' => true,
1430
- 'target' => true,
1431
- ),
1432
- )
1433
- ), 'https://ct.de/-2467514' );
 
 
 
 
1434
  echo ' ';
1435
- // Translators: %1$s and %2$s will be replaced with the correct URLs to FAQ and the forum on wordpress.org.
1436
- printf( wp_kses( __( 'If you need any help with the plugin, take a look at the <a href="%1$s" target="_blank">Frequently Asked Questions (FAQ)</a> and the <a href="%2$s" target="_blank">Support Forum</a> on wordpress.org. ', 'shariff' ),
1437
- array(
1438
- 'a' => array(
1439
- 'href' => true,
1440
- 'target' => true,
1441
- ),
1442
- )
1443
- ), 'https://wordpress.org/plugins/shariff/#faq', 'https://wordpress.org/support/plugin/shariff' );
 
 
 
 
 
1444
  echo '</p>';
1445
  echo '<p>';
1446
  // Translators: %s will be replaced with the correct URL to the authors twitter account.
1447
- printf( wp_kses( __( 'You can also follow <a href="%s" target=_blank">@jplambeck</a> on Twitter.', 'shariff' ),
1448
- array(
1449
- 'a' => array(
1450
- 'href' => true,
1451
- 'target' => true,
1452
- ),
1453
- )
1454
- ), 'https://twitter.com/jplambeck' );
 
 
 
 
 
1455
  echo '</p>';
1456
  echo '<p>';
1457
  // Translators: %s will be replaced with the correct URL to the wordpress.org review page.
1458
- printf( wp_kses( __( 'If you enjoy our plugin, please consider writing a review about it on <a href="%s" target="_blank">wordpress.org</a>.', 'shariff' ),
1459
- array(
1460
- 'a' => array(
1461
- 'href' => true,
1462
- 'target' => true,
1463
- ),
1464
- )
1465
- ), 'https://wordpress.org/support/view/plugin-reviews/shariff' );
 
 
 
 
 
1466
  echo '</p>';
1467
  echo '<p>';
1468
  echo wp_kses( __( 'This is a list of all available options for the <code>[shariff]</code> shortcode:', 'shariff' ), array( 'code' => array() ) );
@@ -1480,8 +1743,8 @@ function shariff3uu_help_section_callback() {
1480
  // Services.
1481
  echo '<div style="display:table-row">';
1482
  echo '<div style="display:table-cell;border:1px solid;padding:10px">services</div>';
1483
- echo '<div style="display:table-cell;border:1px solid;padding:10px">addthis<br>bitcoin<br>diaspora<br>facebook<br>flattr<br>flipboard<br>googleplus<br>info<br>linkedin<br>mailto<br>mastodon<br>odnoklassniki<br>patreon<br>paypal<br>paypalme<br>pinterest<br>pocket<br>printer<br>qzone<br>reddit<br>rss<br>sms<br>stumbleupon<br>telegram<br>tencentweibo<br>threema<br>tumblr<br>twitter<br>vk<br>wallabag<br>weibo<br>whatsapp<br>xing</div>';
1484
- echo '<div style="display:table-cell;border:1px solid;padding:10px">twitter|facebook|googleplus|info</div>';
1485
  echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff services="facebook|twitter|mailto"]</div>';
1486
  echo '<div style="display:table-cell;border:1px solid;padding:10px">' . esc_html__( 'Determines which buttons to show and in which order.', 'shariff' ) . '</div>';
1487
  echo '</div>';
@@ -1691,7 +1954,7 @@ function shariff3uu_help_section_callback() {
1691
  echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
1692
  echo '<div style="display:table-cell;border:1px solid;padding:10px">http://www.mydomain.com/feed/rss/</div>';
1693
  echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff rssfeed="http://www.mydomain.com/feed/rss2/"]</div>';
1694
- echo '<div style="display:table-cell;border:1px solid;padding:10px">' . esc_html__( 'Changes the rss feed url to another feed.', 'shariff' ) . '</div>';
1695
  echo '</div>';
1696
 
1697
  echo '</div>';
@@ -1789,7 +2052,7 @@ function shariff3uu_status_section_callback() {
1789
  echo '</div>';
1790
  echo '</div>';
1791
  }
1792
- }// End if().
1793
 
1794
  // GD needed for QR codes of the Bitcoin links.
1795
  echo '<div style="display:table-row">';
@@ -2192,13 +2455,13 @@ function shariff3uu_options_page() {
2192
  echo '<input type="hidden" name="shariff3uu_basic[version]" value="' . esc_html( $GLOBALS['shariff3uu_basic']['version'] ) . '">';
2193
 
2194
  // Determine active tab.
2195
- // @codingStandardsIgnoreStart
2196
  if ( isset( $_GET['tab'] ) ) {
 
2197
  $active_tab = $_GET['tab'];
2198
  } else {
2199
  $active_tab = 'basic';
2200
  }
2201
- // @codingStandardsIgnoreEnd
2202
 
2203
  // Tabs.
2204
  echo '<h2 class="nav-tab-wrapper">';
58
  register_setting( 'basic', 'shariff3uu_basic', 'shariff3uu_basic_sanitize' );
59
 
60
  // First tab - basic options.
61
+ add_settings_section(
62
+ 'shariff3uu_basic_section',
63
+ __( 'Basic options', 'shariff' ),
64
+ 'shariff3uu_basic_section_callback',
65
+ 'basic'
66
+ );
67
 
68
  // Services.
69
  add_settings_field( 'shariff3uu_text_services', '<div style="width:450px">' . __( 'Enable the following services in the provided order:', 'shariff' ) . '</div>', 'shariff3uu_text_services_render', 'basic', 'shariff3uu_basic_section' );
70
 
71
  // Add after.
72
+ add_settings_field(
73
+ 'shariff3uu_multiplecheckbox_add_after',
74
+ __( 'Add the Shariff buttons <u>after</u> all:', 'shariff' ),
75
+ 'shariff3uu_multiplecheckbox_add_after_render',
76
+ 'basic',
77
+ 'shariff3uu_basic_section'
78
+ );
79
 
80
  // Add before.
81
+ add_settings_field(
82
+ 'shariff3uu_checkbox_add_before',
83
+ __( 'Add the Shariff buttons <u>before</u> all:', 'shariff' ),
84
+ 'shariff3uu_multiplecheckbox_add_before_render',
85
+ 'basic',
86
+ 'shariff3uu_basic_section'
87
+ );
88
 
89
  // Disable on protected posts.
90
+ add_settings_field(
91
+ 'shariff3uu_checkbox_disable_on_protected',
92
+ __( 'Disable the Shariff buttons on password protected posts.', 'shariff' ),
93
+ 'shariff3uu_checkbox_disable_on_protected_render',
94
+ 'basic',
95
+ 'shariff3uu_basic_section'
96
+ );
97
 
98
  // Disable outside of loop.
99
+ add_settings_field(
100
+ 'shariff3uu_checkbox_disable_outside_loop',
101
+ __( 'Disable the Shariff buttons outside of the main loop.', 'shariff' ),
102
+ 'shariff3uu_checkbox_disable_outside_loop_render',
103
+ 'basic',
104
+ 'shariff3uu_basic_section'
105
+ );
106
 
107
  // Add to custom WordPress hooks.
108
  add_settings_field( 'shariff3uu_text_custom_hooks', __( 'Add Shariff to the following custom WordPress hooks:', 'shariff' ), 'shariff3uu_text_custom_hooks_render', 'basic', 'shariff3uu_basic_section' );
119
  add_settings_section( 'shariff3uu_design_section', __( 'Design options', 'shariff' ), 'shariff3uu_design_section_callback', 'design' );
120
 
121
  // Button language.
122
+ add_settings_field(
123
+ 'shariff3uu_select_language',
124
+ '<div style="width:450px">' . esc_html__( 'Default button language:', 'shariff' ) . '</div>',
125
+ 'shariff3uu_select_language_render',
126
+ 'design',
127
+ 'shariff3uu_design_section'
128
+ );
129
 
130
  // Automatic button language for multilingual sites.
131
+ add_settings_field(
132
+ 'shariff3uu_checkbox_autolang',
133
+ __( 'Automatically set button language based on locale (e.g. set by WPML).', 'shariff' ),
134
+ 'shariff3uu_checkbox_autolang_render',
135
+ 'design',
136
+ 'shariff3uu_design_section'
137
+ );
138
 
139
  // Theme.
140
+ add_settings_field(
141
+ 'shariff3uu_radio_theme',
142
+ __( 'Shariff button design:', 'shariff' ),
143
+ 'shariff3uu_radio_theme_render',
144
+ 'design',
145
+ 'shariff3uu_design_section'
146
+ );
147
 
148
  // Button size.
149
+ add_settings_field(
150
+ 'shariff3uu_checkbox_buttonsize',
151
+ __( 'Button size:', 'shariff' ),
152
+ 'shariff3uu_checkbox_buttonsize_render',
153
+ 'design',
154
+ 'shariff3uu_design_section'
155
+ );
156
 
157
  // Button stretch.
158
+ add_settings_field(
159
+ 'shariff3uu_checkbox_buttonsstretch',
160
+ __( 'Stretch buttons horizontally to full width.', 'shariff' ),
161
+ 'shariff3uu_checkbox_buttonstretch_render',
162
+ 'design',
163
+ 'shariff3uu_design_section'
164
+ );
165
 
166
  // Border radius.
167
+ add_settings_field(
168
+ 'shariff3uu_number_borderradius',
169
+ __( 'Border radius for the round theme (1-50):', 'shariff' ),
170
+ 'shariff3uu_number_borderradius_render',
171
+ 'design',
172
+ 'shariff3uu_design_section'
173
+ );
174
 
175
  // Custom main color.
176
+ add_settings_field(
177
+ 'shariff3uu_text_maincolor',
178
+ __( 'Custom main color for <b>all</b> buttons (hexadecimal):', 'shariff' ),
179
+ 'shariff3uu_text_maincolor_render',
180
+ 'design',
181
+ 'shariff3uu_design_section'
182
+ );
183
 
184
  // Custom secondary color.
185
+ add_settings_field(
186
+ 'shariff3uu_text_secondarycolor',
187
+ __( 'Custom secondary color for <b>all</b> buttons (hexadecimal):', 'shariff' ),
188
+ 'shariff3uu_text_secondarycolor_render',
189
+ 'design',
190
+ 'shariff3uu_design_section'
191
+ );
192
 
193
  // Vertical.
194
+ add_settings_field(
195
+ 'shariff3uu_checkbox_vertical',
196
+ __( 'Shariff button orientation <b>vertical</b>.', 'shariff' ),
197
+ 'shariff3uu_checkbox_vertical_render',
198
+ 'design',
199
+ 'shariff3uu_design_section'
200
+ );
201
 
202
  // Alignment option.
203
+ add_settings_field(
204
+ 'shariff3uu_radio_align',
205
+ __( 'Alignment of the Shariff buttons:', 'shariff' ),
206
+ 'shariff3uu_radio_align_render',
207
+ 'design',
208
+ 'shariff3uu_design_section'
209
+ );
210
 
211
  // Alignment option for the widget.
212
+ add_settings_field(
213
+ 'shariff3uu_radio_align_widget',
214
+ __( 'Alignment of the Shariff buttons in the widget:', 'shariff' ),
215
+ 'shariff3uu_radio_align_widget_render',
216
+ 'design',
217
+ 'shariff3uu_design_section'
218
+ );
219
 
220
  // Headline.
221
+ add_settings_field(
222
+ 'shariff3uu_text_headline',
223
+ __( 'Headline above all Shariff buttons:', 'shariff' ),
224
+ 'shariff3uu_text_headline_render',
225
+ 'design',
226
+ 'shariff3uu_design_section'
227
+ );
228
 
229
  // Alternative headline if share counts are zero.
230
+ add_settings_field(
231
+ 'shariff3uu_text_headline_zero',
232
+ __( 'Alternative headline, if share counts are zero:', 'shariff' ),
233
+ 'shariff3uu_text_headline_zero_render',
234
+ 'design',
235
+ 'shariff3uu_design_section'
236
+ );
237
 
238
  // Custom css.
239
+ add_settings_field(
240
+ 'shariff3uu_text_style',
241
+ __( 'Custom CSS <u>attributes</u> for the container <u>around</u> Shariff:', 'shariff' ),
242
+ 'shariff3uu_text_style_render',
243
+ 'design',
244
+ 'shariff3uu_design_section'
245
+ );
246
 
247
  // Custom css class.
248
+ add_settings_field(
249
+ 'shariff3uu_text_cssclass',
250
+ __( 'Custom CSS <u>class</u> for the container <u>around</u> Shariff:', 'shariff' ),
251
+ 'shariff3uu_text_cssclass_render',
252
+ 'design',
253
+ 'shariff3uu_design_section'
254
+ );
255
 
256
  // Hide until css loaded.
257
+ add_settings_field(
258
+ 'shariff3uu_checkbox_hideuntilcss',
259
+ __( 'Hide buttons until page is fully loaded.', 'shariff' ),
260
+ 'shariff3uu_checkbox_hideuntilcss_render',
261
+ 'design',
262
+ 'shariff3uu_design_section'
263
+ );
264
 
265
  // Open in popup.
266
+ add_settings_field(
267
+ 'shariff3uu_checkbox_popup',
268
+ __( 'Open links in a popup (requires JavaScript).', 'shariff' ),
269
+ 'shariff3uu_checkbox_popup_render',
270
+ 'design',
271
+ 'shariff3uu_design_section'
272
+ );
273
 
274
  /** Third tab - advanced */
275
 
277
  register_setting( 'advanced', 'shariff3uu_advanced', 'shariff3uu_advanced_sanitize' );
278
 
279
  // Third tab - advanced options.
280
+ add_settings_section(
281
+ 'shariff3uu_advanced_section',
282
+ __( 'Advanced options', 'shariff' ),
283
+ 'shariff3uu_advanced_section_callback',
284
+ 'advanced'
285
+ );
286
 
287
  // Info url.
288
  add_settings_field(
289
+ 'shariff3uu_text_info_url',
290
+ '<div style="width:450px">' . __( 'Custom link for the info button:', 'shariff' ) . '</div>',
291
+ 'shariff3uu_text_info_url_render',
292
+ 'advanced',
293
+ 'shariff3uu_advanced_section'
294
+ );
295
 
296
  // Info text.
297
  add_settings_field(
298
+ 'shariff3uu_text_info_text',
299
+ __( 'Custom text for the info button:', 'shariff' ),
300
+ 'shariff3uu_text_info_text_render',
301
+ 'advanced',
302
+ 'shariff3uu_advanced_section'
303
+ );
304
 
305
  // Twitter via.
306
  add_settings_field(
307
+ 'shariff3uu_text_twittervia',
308
+ __( 'Twitter username for the via tag:', 'shariff' ),
309
+ 'shariff3uu_text_twittervia_render',
310
+ 'advanced',
311
+ 'shariff3uu_advanced_section'
312
+ );
313
 
314
  // Flattr username.
315
  add_settings_field(
316
+ 'shariff3uu_text_flattruser',
317
+ __( 'Flattr username:', 'shariff' ),
318
+ 'shariff3uu_text_flattruser_render',
319
+ 'advanced',
320
+ 'shariff3uu_advanced_section'
321
+ );
322
 
323
  // Patreon username.
324
  add_settings_field(
325
+ 'shariff3uu_text_patreonid',
326
+ __( 'Patreon username:', 'shariff' ),
327
+ 'shariff3uu_text_patreonid_render',
328
+ 'advanced',
329
+ 'shariff3uu_advanced_section'
330
+ );
331
 
332
  // Paypal button id.
333
  add_settings_field(
334
+ 'shariff3uu_text_paypalbuttonid',
335
+ __( 'PayPal hosted button ID:', 'shariff' ),
336
+ 'shariff3uu_text_paypalbuttonid_render',
337
+ 'advanced',
338
+ 'shariff3uu_advanced_section'
339
+ );
340
 
341
  // Paypalme id.
342
  add_settings_field(
343
+ 'shariff3uu_text_paypalmeid',
344
+ __( 'PayPal.Me ID:', 'shariff' ),
345
+ 'shariff3uu_text_paypalmeid_render',
346
+ 'advanced',
347
+ 'shariff3uu_advanced_section'
348
+ );
349
 
350
  // Bitcoin address.
351
  add_settings_field(
352
+ 'shariff3uu_text_bitcoinaddress',
353
+ __( 'Bitcoin address:', 'shariff' ),
354
+ 'shariff3uu_text_bitcoinaddress_render',
355
+ 'advanced',
356
+ 'shariff3uu_advanced_section'
357
+ );
358
 
359
  // RSS feed.
360
  add_settings_field(
361
+ 'shariff3uu_text_rssfeed',
362
+ __( 'RSS feed:', 'shariff' ),
363
+ 'shariff3uu_text_rssfeed_render',
364
+ 'advanced',
365
+ 'shariff3uu_advanced_section'
366
+ );
367
 
368
  // Default image for pinterest.
369
+ add_settings_field(
370
+ 'shariff3uu_text_default_pinterest',
371
+ __( 'Default image for Pinterest:', 'shariff' ),
372
+ 'shariff3uu_text_default_pinterest_render',
373
+ 'advanced',
374
+ 'shariff3uu_advanced_section'
375
+ );
376
 
377
  // Shortcode priority.
378
+ add_settings_field(
379
+ 'shariff3uu_number_shortcodeprio',
380
+ __( 'Shortcode priority:', 'shariff' ),
381
+ 'shariff3uu_number_shortcodeprio_render',
382
+ 'advanced',
383
+ 'shariff3uu_advanced_section'
384
+ );
385
 
386
  // Disable metabox.
387
+ add_settings_field(
388
+ 'shariff3uu_checkbox_disable_metabox',
389
+ __( 'Disable the metabox.', 'shariff' ),
390
+ 'shariff3uu_checkbox_disable_metabox_render',
391
+ 'advanced',
392
+ 'shariff3uu_advanced_section'
393
+ );
394
 
395
  /** Fifth tab - statistic */
396
 
398
  register_setting( 'statistic', 'shariff3uu_statistic', 'shariff3uu_statistic_sanitize' );
399
 
400
  // Fifth tab (statistic).
401
+ add_settings_section(
402
+ 'shariff3uu_statistic_section',
403
+ __( 'Statistic', 'shariff' ),
404
+ 'shariff3uu_statistic_section_callback',
405
+ 'statistic'
406
+ );
407
 
408
  // Statistic.
409
+ add_settings_field(
410
+ 'shariff3uu_checkbox_backend',
411
+ '<div style="width:450px">' . __( 'Enable statistic.', 'shariff' ) . '</div>',
412
+ 'shariff3uu_checkbox_backend_render',
413
+ 'statistic',
414
+ 'shariff3uu_statistic_section'
415
+ );
416
 
417
  // Share counts.
418
+ add_settings_field(
419
+ 'shariff3uu_checkbox_sharecounts',
420
+ __( 'Show share counts on buttons.', 'shariff' ),
421
+ 'shariff3uu_checkbox_sharecounts_render',
422
+ 'statistic',
423
+ 'shariff3uu_statistic_section'
424
+ );
425
 
426
  // Hide when zero.
427
+ add_settings_field(
428
+ 'shariff3uu_checkbox_hidezero',
429
+ __( 'Hide share counts when they are zero.', 'shariff' ),
430
+ 'shariff3uu_checkbox_hidezero_render',
431
+ 'statistic',
432
+ 'shariff3uu_statistic_section'
433
+ );
434
 
435
  // Facebook App ID.
436
+ add_settings_field(
437
+ 'shariff3uu_text_fb_id',
438
+ __( 'Facebook App ID:', 'shariff' ),
439
+ 'shariff3uu_text_fb_id_render',
440
+ 'statistic',
441
+ 'shariff3uu_statistic_section'
442
+ );
443
 
444
  // Facebook App Secret.
445
+ add_settings_field(
446
+ 'shariff3uu_text_fb_secret',
447
+ __( 'Facebook App Secret:', 'shariff' ),
448
+ 'shariff3uu_text_fb_secret_render',
449
+ 'statistic',
450
+ 'shariff3uu_statistic_section'
451
+ );
452
 
453
  // Automatic cache.
454
+ add_settings_field(
455
+ 'shariff3uu_checkbox_automaticcache',
456
+ __( 'Fill cache automatically.', 'shariff' ),
457
+ 'shariff3uu_checkbox_automaticcache_render',
458
+ 'statistic',
459
+ 'shariff3uu_statistic_section'
460
+ );
461
 
462
  // Ranking.
463
+ add_settings_field(
464
+ 'shariff3uu_number_ranking',
465
+ __( 'Number of posts on ranking tab:', 'shariff' ),
466
+ 'shariff3uu_number_ranking_render',
467
+ 'statistic',
468
+ 'shariff3uu_statistic_section'
469
+ );
470
 
471
  // TTL.
472
+ add_settings_field(
473
+ 'shariff3uu_number_ttl',
474
+ __( 'Cache TTL in seconds (60 - 7200):', 'shariff' ),
475
+ 'shariff3uu_number_ttl_render',
476
+ 'statistic',
477
+ 'shariff3uu_statistic_section'
478
+ );
479
 
480
  // Disable dynamic cache lifespan.
481
+ add_settings_field(
482
+ 'shariff3uu_checkbox_disable_dynamic_cache',
483
+ __( 'Disable the dynamic cache lifespan (not recommended).', 'shariff' ),
484
+ 'shariff3uu_checkbox_disable_dynamic_cache_render',
485
+ 'statistic',
486
+ 'shariff3uu_statistic_section'
487
+ );
488
 
489
  // Disable services.
490
+ add_settings_field(
491
+ 'shariff3uu_multiplecheckbox_disable_services',
492
+ __( 'Disable the following services (share counts only):', 'shariff' ),
493
+ 'shariff3uu_multiplecheckbox_disable_services_render',
494
+ 'statistic',
495
+ 'shariff3uu_statistic_section'
496
+ );
497
 
498
  // External hosts.
499
+ add_settings_field(
500
+ 'shariff3uu_text_external_host',
501
+ __( 'External API for share counts:', 'shariff' ),
502
+ 'shariff3uu_text_external_host_render',
503
+ 'statistic',
504
+ 'shariff3uu_statistic_section'
505
+ );
506
 
507
  // Request external api directly from js.
508
+ add_settings_field(
509
+ 'shariff3uu_checkbox_external_direct',
510
+ __( 'Request external API directly.', 'shariff' ),
511
+ 'shariff3uu_checkbox_external_direct_render',
512
+ 'statistic',
513
+ 'shariff3uu_statistic_section'
514
+ );
515
 
516
  // WP in sub folder and api only reachable there?
517
+ add_settings_field(
518
+ 'shariff3uu_checkbox_subapi',
519
+ __( 'Local API not reachable in root.', 'shariff' ),
520
+ 'shariff3uu_checkbox_subapi_render',
521
+ 'statistic',
522
+ 'shariff3uu_statistic_section'
523
+ );
524
 
525
  /** Sixth tab - help */
526
 
527
  // Register sixth tab (help).
528
+ add_settings_section(
529
+ 'shariff3uu_help_section',
530
+ __( 'Shariff Help', 'shariff' ),
531
+ 'shariff3uu_help_section_callback',
532
+ 'help'
533
+ );
534
 
535
  /** Seventh tab - status */
536
 
537
  // Register seventh tab (status).
538
+ add_settings_section(
539
+ 'shariff3uu_status_section',
540
+ __( 'Status', 'shariff' ),
541
+ 'shariff3uu_status_section_callback',
542
+ 'status'
543
+ );
544
 
545
  /** Eight tab - ranking */
546
 
547
  // Register eight tab (ranking).
548
+ add_settings_section(
549
+ 'shariff3uu_ranking_section',
550
+ __( 'Ranking', 'shariff' ),
551
+ 'shariff3uu_ranking_section_callback',
552
+ 'ranking'
553
+ );
554
  }
555
 
556
  /**
755
  if ( isset( $input['disable_dynamic_cache'] ) ) {
756
  $valid['disable_dynamic_cache'] = absint( $input['disable_dynamic_cache'] );
757
  }
 
 
 
758
  if ( isset( $input['disable'] ) ) {
759
  $valid['disable'] = sani_arrays( $input['disable'] );
760
  }
823
  } else {
824
  $services = '';
825
  }
826
+ echo '<input type="text" name="shariff3uu_basic[services]" value="' . esc_html( $services ) . '" size="90" placeholder="twitter|facebook|linkedin|info">';
827
+ echo '<p><code>addthis|bitcoin|diaspora|facebook|flattr|flipboard|info|linkedin|mailto</code></p>';
828
+ echo '<p><code>odnoklassniki|patreon|paypal|paypalme|pinterest|pocket|printer|qzone|reddit</code></p>';
829
  echo '<p><code>rss|sms|stumbleupon|telegram|tencentweibo|threema|tumblr|twitter|vk|wallabag|weibo</code></p>';
830
  echo '<p><code>whatsapp|xing</code></p>';
831
  echo '<p>' . esc_html__( 'Use the pipe sign | (Alt Gr + &lt; or &#8997; + 7) between two or more services.', 'shariff' ) . '</p>';
988
  $help_link = get_bloginfo( 'wpurl' ) . '/wp-admin/options-general.php?page=shariff3uu&tab=help';
989
  // Translators: %s will be replaced with the correct URL to the help section.
990
  printf( wp_kses( __( 'For more information please take a look at the <a href="%s">Help Section</a>. ', 'shariff' ), array( 'a' => array( 'href' => true ) ) ), esc_url( $help_link ) );
991
+ printf(
992
+ wp_kses(
993
+ // Translators: %s will be replaced with the correct URL to the wordpress.org support forum.
994
+ __( 'You should also check out the <a href="%s" target="_blank">Support Forum</a>. ', 'shariff' ),
995
+ array(
996
+ 'a' => array(
997
+ 'href' => true,
998
+ 'target' => true,
999
+ ),
1000
+ )
1001
+ ),
1002
+ 'https://wordpress.org/support/plugin/shariff/'
1003
+ );
1004
  }
1005
 
1006
  /**
1066
  <input type="radio" name="shariff3uu_design[theme]" value="" ' . checked( $options['theme'], '', 0 ) . '>default
1067
  </div>
1068
  <div class="shariff_options-cell">
1069
+ <img alt="default" src="' . esc_url( $plugins_url ) . '/shariff/images/defaultBtns.png">
1070
  </div>
1071
  </div>
1072
  <div style="display:table-row">
1074
  <input type="radio" name="shariff3uu_design[theme]" value="color" ' . checked( $options['theme'], 'color', 0 ) . '>color
1075
  </div>
1076
  <div class="shariff_options-cell">
1077
+ <img alt="color" src="' . esc_url( $plugins_url ) . '/shariff/images/colorBtns.png">
1078
  </div>
1079
  </div>
1080
  <div style="display:table-row">
1082
  <input type="radio" name="shariff3uu_design[theme]" value="grey" ' . checked( $options['theme'], 'grey', 0 ) . '>grey
1083
  </div>
1084
  <div class="shariff_options-cell">
1085
+ <img alt="grey" src="' . esc_url( $plugins_url ) . '/shariff/images/greyBtns.png">
1086
  </div>
1087
  </div>
1088
  <div style="display:table-row">
1090
  <input type="radio" name="shariff3uu_design[theme]" value="white" ' . checked( $options['theme'], 'white', 0 ) . '>white
1091
  </div>
1092
  <div class="shariff_options-cell">
1093
+ <img alt="white" src="' . esc_url( $plugins_url ) . '/shariff/images/whiteBtns.png">
1094
  </div>
1095
  </div>
1096
  <div style="display:table-row">
1098
  <input type="radio" name="shariff3uu_design[theme]" value="round" ' . checked( $options['theme'], 'round', 0 ) . '>round
1099
  </div>
1100
  <div class="shariff_options-cell">
1101
+ <img alt="round" src="' . esc_url( $plugins_url ) . '/shariff/images/roundBtns.png">
1102
  </div>
1103
  </div>
1104
  </div>';
1294
  $help_link = get_bloginfo( 'wpurl' ) . '/wp-admin/options-general.php?page=shariff3uu&tab=help';
1295
  // Translators: %s will be replaced with the correct URL to the help section.
1296
  printf( wp_kses( __( 'For more information please take a look at the <a href="%s">Help Section</a>. ', 'shariff' ), array( 'a' => array( 'href' => true ) ) ), esc_url( $help_link ) );
1297
+ printf(
1298
+ wp_kses(
1299
+ // Translators: %s will be replaced with the correct URL to the wordpress.org support forum.
1300
+ __( 'You should also check out the <a href="%s" target="_blank">Support Forum</a>. ', 'shariff' ),
1301
+ array(
1302
+ 'a' => array(
1303
+ 'href' => true,
1304
+ 'target' => true,
1305
+ ),
1306
+ )
1307
+ ),
1308
+ 'https://wordpress.org/support/plugin/shariff/'
1309
+ );
1310
  }
1311
 
1312
  /**
1460
  */
1461
  function shariff3uu_statistic_section_callback() {
1462
  echo esc_html__( 'This determines how share counts are handled by Shariff.', 'shariff' );
1463
+ echo '<br>';
1464
+ echo esc_html__( 'Notice: Twitter does not offer official share counts anymore. As an alternative share counts for Twitter can be requested via twitcount.com. You will need to register with them for it to work. Otherwise the count will always be zero.', 'shariff' );
1465
  if ( isset( $GLOBALS['shariff3uu_statistic']['external_direct'] ) ) {
1466
  echo '<br><span style="color:red;font-weight:bold;">';
1467
  echo esc_html__( 'Warning: ', 'shariff' );
1584
  echo ' value="1">';
1585
  }
1586
 
 
 
 
 
 
 
 
 
 
 
1587
  /**
1588
  * Disable services.
1589
  */
1611
  $external_host = '';
1612
  }
1613
  echo '<input type="text" name="shariff3uu_statistic[external_host]" value="' . esc_html( $external_host ) . '" size="50" placeholder="' . esc_url( get_bloginfo( 'url' ) ) . '/wp-json/shariff/v1/share_counts">';
1614
+ echo '<p>' . wp_kses(
1615
+ __( 'Warning: This is an experimental feature. Please read the <a href="https://wordpress.org/plugins/shariff/faq/" target="_blank">Frequently Asked Questions (FAQ)</a>.', 'shariff' ),
1616
  array(
1617
  'a' => array(
1618
  'href' => true,
1651
  */
1652
  function shariff3uu_help_section_callback() {
1653
  echo '<p>';
1654
+ printf(
1655
+ wp_kses(
1656
+ // Translators: %1$s and %2$s will be replaced with the correct URLs to the authors websites.
1657
+ __( 'The WordPress plugin "Shariff Wrapper" has been developed by <a href="%1$s" target="_blank">Jan-Peter Lambeck</a> and <a href="%2$s" target="_blank">3UU</a> in order to help protect the privacy of your visitors. ', 'shariff' ),
1658
+ array(
1659
+ 'a' => array(
1660
+ 'href' => true,
1661
+ 'target' => true,
1662
+ ),
1663
+ )
1664
+ ),
1665
+ 'https://www.jplambeck.de',
1666
+ 'https://datenverwurstungszentrale.com'
1667
+ );
1668
  echo ' ';
1669
+ printf(
1670
+ wp_kses(
1671
+ // Translators: %s will be replaced with the correct URL to the German computer magazine.
1672
+ __( 'It is based on the original Shariff buttons developed by the German computer magazine <a href="%s" target="_blank">c\'t</a> that are compliant to the General Data Protection Regulation (GDPR) (Regulation (EU) 2016/679).', 'shariff' ),
1673
+ array(
1674
+ 'a' => array(
1675
+ 'href' => true,
1676
+ 'target' => true,
1677
+ ),
1678
+ )
1679
+ ),
1680
+ 'https://ct.de/-2467514'
1681
+ );
1682
  echo ' ';
1683
+ printf(
1684
+ wp_kses(
1685
+ // Translators: %1$s and %2$s will be replaced with the correct URLs to FAQ and the forum on wordpress.org.
1686
+ __( 'If you need any help with the plugin, take a look at the <a href="%1$s" target="_blank">Frequently Asked Questions (FAQ)</a> and the <a href="%2$s" target="_blank">Support Forum</a> on wordpress.org. ', 'shariff' ),
1687
+ array(
1688
+ 'a' => array(
1689
+ 'href' => true,
1690
+ 'target' => true,
1691
+ ),
1692
+ )
1693
+ ),
1694
+ 'https://wordpress.org/plugins/shariff/#faq',
1695
+ 'https://wordpress.org/support/plugin/shariff'
1696
+ );
1697
  echo '</p>';
1698
  echo '<p>';
1699
  // Translators: %s will be replaced with the correct URL to the authors twitter account.
1700
+ printf(
1701
+ wp_kses(
1702
+ // Translators: %s will be replaced with the correct URL to the authors twitter account.
1703
+ __( 'You can also follow <a href="%s" target=_blank">@jplambeck</a> on Twitter.', 'shariff' ),
1704
+ array(
1705
+ 'a' => array(
1706
+ 'href' => true,
1707
+ 'target' => true,
1708
+ ),
1709
+ )
1710
+ ),
1711
+ 'https://twitter.com/jplambeck'
1712
+ );
1713
  echo '</p>';
1714
  echo '<p>';
1715
  // Translators: %s will be replaced with the correct URL to the wordpress.org review page.
1716
+ printf(
1717
+ wp_kses(
1718
+ // Translators: %s will be replaced with the correct URL to the wordpress.org review page.
1719
+ __( 'If you enjoy our plugin, please consider writing a review about it on <a href="%s" target="_blank">wordpress.org</a>.', 'shariff' ),
1720
+ array(
1721
+ 'a' => array(
1722
+ 'href' => true,
1723
+ 'target' => true,
1724
+ ),
1725
+ )
1726
+ ),
1727
+ 'https://wordpress.org/support/view/plugin-reviews/shariff'
1728
+ );
1729
  echo '</p>';
1730
  echo '<p>';
1731
  echo wp_kses( __( 'This is a list of all available options for the <code>[shariff]</code> shortcode:', 'shariff' ), array( 'code' => array() ) );
1743
  // Services.
1744
  echo '<div style="display:table-row">';
1745
  echo '<div style="display:table-cell;border:1px solid;padding:10px">services</div>';
1746
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">addthis<br>bitcoin<br>diaspora<br>facebook<br>flattr<br>flipboard<br>info<br>linkedin<br>mailto<br>odnoklassniki<br>patreon<br>paypal<br>paypalme<br>pinterest<br>pocket<br>printer<br>qzone<br>reddit<br>rss<br>sms<br>stumbleupon<br>telegram<br>tencentweibo<br>threema<br>tumblr<br>twitter<br>vk<br>wallabag<br>weibo<br>whatsapp<br>xing</div>';
1747
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">twitter|facebook|linkedin|info</div>';
1748
  echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff services="facebook|twitter|mailto"]</div>';
1749
  echo '<div style="display:table-cell;border:1px solid;padding:10px">' . esc_html__( 'Determines which buttons to show and in which order.', 'shariff' ) . '</div>';
1750
  echo '</div>';
1954
  echo '<div style="display:table-cell;border:1px solid;padding:10px"></div>';
1955
  echo '<div style="display:table-cell;border:1px solid;padding:10px">http://www.mydomain.com/feed/rss/</div>';
1956
  echo '<div style="display:table-cell;border:1px solid;padding:10px">[shariff rssfeed="http://www.mydomain.com/feed/rss2/"]</div>';
1957
+ echo '<div style="display:table-cell;border:1px solid;padding:10px">' . esc_html__( 'Changes the RSS feed url to another feed.', 'shariff' ) . '</div>';
1958
  echo '</div>';
1959
 
1960
  echo '</div>';
2052
  echo '</div>';
2053
  echo '</div>';
2054
  }
2055
+ }// End if.
2056
 
2057
  // GD needed for QR codes of the Bitcoin links.
2058
  echo '<div style="display:table-row">';
2455
  echo '<input type="hidden" name="shariff3uu_basic[version]" value="' . esc_html( $GLOBALS['shariff3uu_basic']['version'] ) . '">';
2456
 
2457
  // Determine active tab.
2458
+ // phpcs:ignore
2459
  if ( isset( $_GET['tab'] ) ) {
2460
+ // phpcs:ignore
2461
  $active_tab = $_GET['tab'];
2462
  } else {
2463
  $active_tab = 'basic';
2464
  }
 
2465
 
2466
  // Tabs.
2467
  echo '<h2 class="nav-tab-wrapper">';
bitcoin.php CHANGED
@@ -1,4 +1,4 @@
1
- <?php
2
  /**
3
  * Generates an QR code for bitcoin.
4
  *
1
+ <?php /** @noinspection PhpCSValidationInspection */
2
  /**
3
  * Generates an QR code for bitcoin.
4
  *
changelog.txt CHANGED
@@ -2,6 +2,19 @@
2
 
3
  == Changelog ==
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  = 4.5.2 =
6
  - added support for share count requests of multilingual sites
7
  - updated button translations for Twitter and Pinterest (thanks to Jessica, @jess78)
2
 
3
  == Changelog ==
4
 
5
+ = 4.5.3 =
6
+ - removed LinkedIn Share Counts due to LinkedIn removing them completely
7
+ - removed GooglePlus Share Counts due to Google shutting GooglePlus down
8
+ - removed OpenShareCount due to the service having shut down
9
+ - removed NewShareCount due to the service having shut down
10
+ - removed Mastodon temporarily until a new working solution is available
11
+ - deprecated GooglePlus as a service, will be removed with the next release
12
+ - added TwitCount (twitcount.com) as an alternative for Twitter share counts
13
+ - updated to Facebook Graph API v3.2
14
+ - updated to WordPress Coding Standards 2.0
15
+ - corrected minor typos
16
+ - added the new logo thanks to Philipp Wildfeuer (@phil_sauvage)
17
+
18
  = 4.5.2 =
19
  - added support for share count requests of multilingual sites
20
  - updated button translations for Twitter and Pinterest (thanks to Jessica, @jess78)
css/shariff.css CHANGED
@@ -65,7 +65,7 @@
65
  width: 32px;
66
  height: 20px;
67
  padding: 7px 1px;
68
- box-sizing: content-box;
69
  }
70
  .shariff-button::before {
71
  content: none !important;
65
  width: 32px;
66
  height: 20px;
67
  padding: 7px 1px;
68
+ box-sizing: content-box !important;
69
  }
70
  .shariff-button::before {
71
  content: none !important;
css/shariff.min.css CHANGED
@@ -1 +1 @@
1
- .shariff{display:block !important;clear:both}.shariff ul{display:flex;flex-direction:row;flex-flow:row wrap;padding:0 !important;margin:0 !important}.shariff li{height:35px;box-sizing:border-box;list-style:none !important;overflow:hidden !important;margin:5px !important;padding:0 !important;text-indent:0 !important;border-left:0 none !important}.shariff a{position:relative;display:block !important;height:35px;padding:0;margin:0;box-sizing:border-box;border:0;text-decoration:none;background-image:none !important;text-align:left;box-shadow:none;cursor:pointer}.shariff a:hover{color:#fff;background-color:inherit !important;text-decoration:none !important}.shariff a:visited{color:inherit}.shariff .shariff-count{position:absolute;height:33px;top:0;right:0;margin:1px;padding:0 8px;background-color:rgba(255,255,255,0.5)}.shariff .shariff-count,.shariff .shariff-text{font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:36px;vertical-align:top}.shariff .shariff-text{padding-left:3px}.shariff .shariff-icon svg{width:32px;height:20px;padding:7px 1px;box-sizing:content-box}.shariff-button::before{content:none !important}.shariff .shariff-buttons .shariff-text-white{color:#fff}.shariff .shariff-buttons .shariff-hidezero{opacity:0}.shariff .theme-default a{color:#fff !important}.shariff .theme-default .shariff-icon svg path{fill:#fff}.shariff .theme-color .shariff-count{background-color:transparent !important;color:#fff !important}.shariff .theme-color .shariff-icon svg path{fill:#fff}.shariff .theme-grey a{background-color:#b0b0b0 !important}.shariff .theme-grey a:hover{background-color:inherit !important}.shariff .theme-grey .shariff-count{background-color:transparent;color:#fff !important}.shariff .theme-grey .shariff-icon svg path{fill:#fff}.shariff .theme-white a{background-color:#fff !important;border:1px solid #ddd}.shariff .theme-white a:hover{background-color:#eee !important;color:inherit}.shariff .theme-white svg{fill:currentColor}.shariff .theme-white .shariff-count{background-color:transparent;margin:0}.shariff .shariff-buttons.theme-round li{width:35px !important;height:35px;border-radius:50%;margin:5px}.shariff .theme-round a{position:relative;height:35px;border-radius:50%}.shariff .theme-round .shariff-icon svg{display:block;margin:auto;padding:8px 1px}.shariff .theme-round .shariff-text{display:block}.shariff .theme-round .shariff-count{display:inline;padding:0;right:0;left:0;top:0;background-color:transparent;color:transparent !important;text-align:center}.shariff .theme-round .shariff-count:hover{background-color:inherit !important;color:#fff !important}.shariff .theme-round .shariff-icon svg path{fill:#fff}.shariff .shariff-buttons.buttonsize-small li{height:25px !important}.shariff .shariff-buttons.buttonsize-small a{height:25px !important}.shariff .shariff-buttons.buttonsize-small.orientation-vertical li{width:115px}.shariff .shariff-buttons.buttonsize-small .shariff-icon svg{width:22px;height:15px;padding:5px 1px}.shariff .shariff-buttons.buttonsize-small .shariff-text,.shariff .shariff-buttons.buttonsize-small .shariff-count{font-size:11px;line-height:25px;padding:0 5px;height:23px}.shariff .shariff-buttons.buttonsize-small .shariff-text{padding-left:1px !important}.shariff .shariff-buttons.buttonsize-small.theme-round li{width:25px !important}.shariff .shariff-buttons.buttonsize-small.theme-round a{width:25px !important}.shariff .shariff-buttons.buttonsize-small.theme-round .shariff-count{padding:0 !important;height:25px !important}.shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li{margin:5px 7px}.shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li:first-child{margin-left:5px}.shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li:last-child{margin-right:5px}.shariff .buttonsize-large li{height:45px !important}.shariff .buttonsize-large a{height:45px !important}.shariff .buttonsize-large.orientation-vertical li{width:155px}.shariff .buttonsize-large .shariff-icon svg{width:40px;height:28px;padding:9px 2px}.shariff .buttonsize-large .shariff-text,.shariff .buttonsize-large .shariff-count{font-size:14px;line-height:45px;padding:0 10px;height:43px}.shariff .buttonsize-large .shariff-text{padding-left:1px !important}.shariff .shariff-buttons.buttonsize-large.theme-round li{width:45px !important;height:45px !important}.shariff .buttonsize-large.theme-round a{width:45px !important}.shariff .buttonsize-large.theme-round .shariff-count{padding:0 !important;height:45px !important}.shariff .orientation-vertical{flex-direction:column}.shariff .orientation-vertical li{width:135px}.shariff.shariff-align-flex-start ul{justify-content:flex-start;align-items:flex-start}.shariff.shariff-align-center ul{justify-content:center;align-items:center}.shariff.shariff-align-flex-end ul{justify-content:flex-end;align-items:flex-end}.widget .shariff.shariff-widget-align-flex-start ul{justify-content:flex-start;align-items:flex-start}.widget .shariff.shariff-widget-align-center ul{justify-content:center;align-items:center}.widget .shariff.shariff-widget-align-flex-end ul{justify-content:flex-end;align-items:flex-end}.shariff.shariff-buttonstretch li{flex:1 0 auto !important}.shariff.shariff-buttonstretch .orientation-vertical li{width:100% !important}.widget .shariff li{border:0;font-weight:400}.widget .shariff .theme-default a,.widget .shariff .theme-color a,.widget .shariff .theme-grey a,.widget .shariff .theme-round a{color:#fff;display:block;font-weight:400}.widget .shariff .theme-default a:hover,.widget .shariff .theme-color a:hover,.widget .shariff .theme-grey a:hover,.widget .shariff .theme-round a:hover{color:#fff;font-weight:400}.shariff-warning{background-color:red;color:#fff;font-size:20px;font-weight:700;padding:10px;text-align:center;margin:0 auto;line-height:1.5}.shariff .info a{border:1px solid #ddd;width:35px}.shariff .shariff-button.info{width:35px;flex:0 0 auto !important}.shariff .theme-default .shariff-button.shariff-nocustomcolor.info svg path{fill:#999}.shariff .theme-round .shariff-button.shariff-nocustomcolor.info svg path{fill:#999}.shariff .buttonsize-small .shariff-button.info{width:25px}.shariff .buttonsize-small .info a{width:25px}.shariff .buttonsize-large .shariff-button.info{width:45px}.shariff .buttonsize-large .info a{width:45px}.shariff .info .shariff-icon svg{display:block;margin:auto}@media only screen and (max-width:360px){.shariff .shariff-buttons.buttonsize-small li{width:25px}.shariff .shariff-buttons li{width:35px}.shariff .shariff-buttons.buttonsize-large li{width:45px}.shariff .shariff-buttons .shariff-icon svg{display:block;margin:auto}.shariff .shariff-buttons .shariff-text{display:none}.shariff .shariff-buttons .shariff-count{display:none}}@media only screen and (min-width:361px){.shariff .shariff-buttons.buttonsize-small li{width:105px}.shariff .shariff-buttons li{width:125px}.shariff .shariff-buttons.buttonsize-large li{width:155px}.shariff .shariff-buttons .shariff-text{display:inline}.shariff .shariff-buttons .shariff-count{display:inline}}@media only screen and (min-device-width:1025px){.shariff .shariff-mobile{display:none !important}}
1
+ .shariff{display:block !important;clear:both}.shariff ul{display:flex;flex-direction:row;flex-flow:row wrap;padding:0 !important;margin:0 !important}.shariff li{height:35px;box-sizing:border-box;list-style:none !important;overflow:hidden !important;margin:5px !important;padding:0 !important;text-indent:0 !important;border-left:0 none !important}.shariff a{position:relative;display:block !important;height:35px;padding:0;margin:0;box-sizing:border-box;border:0;text-decoration:none;background-image:none !important;text-align:left;box-shadow:none;cursor:pointer}.shariff a:hover{color:#fff;background-color:inherit !important;text-decoration:none !important}.shariff a:visited{color:inherit}.shariff .shariff-count{position:absolute;height:33px;top:0;right:0;margin:1px;padding:0 8px;background-color:rgba(255,255,255,0.5)}.shariff .shariff-count,.shariff .shariff-text{font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:36px;vertical-align:top}.shariff .shariff-text{padding-left:3px}.shariff .shariff-icon svg{width:32px;height:20px;padding:7px 1px;box-sizing:content-box !important}.shariff-button::before{content:none !important}.shariff .shariff-buttons .shariff-text-white{color:#fff}.shariff .shariff-buttons .shariff-hidezero{opacity:0}.shariff .theme-default a{color:#fff !important}.shariff .theme-default .shariff-icon svg path{fill:#fff}.shariff .theme-color .shariff-count{background-color:transparent !important;color:#fff !important}.shariff .theme-color .shariff-icon svg path{fill:#fff}.shariff .theme-grey a{background-color:#b0b0b0 !important}.shariff .theme-grey a:hover{background-color:inherit !important}.shariff .theme-grey .shariff-count{background-color:transparent;color:#fff !important}.shariff .theme-grey .shariff-icon svg path{fill:#fff}.shariff .theme-white a{background-color:#fff !important;border:1px solid #ddd}.shariff .theme-white a:hover{background-color:#eee !important;color:inherit}.shariff .theme-white svg{fill:currentColor}.shariff .theme-white .shariff-count{background-color:transparent;margin:0}.shariff .shariff-buttons.theme-round li{width:35px !important;height:35px;border-radius:50%;margin:5px}.shariff .theme-round a{position:relative;height:35px;border-radius:50%}.shariff .theme-round .shariff-icon svg{display:block;margin:auto;padding:8px 1px}.shariff .theme-round .shariff-text{display:block}.shariff .theme-round .shariff-count{display:inline;padding:0;right:0;left:0;top:0;background-color:transparent;color:transparent !important;text-align:center}.shariff .theme-round .shariff-count:hover{background-color:inherit !important;color:#fff !important}.shariff .theme-round .shariff-icon svg path{fill:#fff}.shariff .shariff-buttons.buttonsize-small li{height:25px !important}.shariff .shariff-buttons.buttonsize-small a{height:25px !important}.shariff .shariff-buttons.buttonsize-small.orientation-vertical li{width:115px}.shariff .shariff-buttons.buttonsize-small .shariff-icon svg{width:22px;height:15px;padding:5px 1px}.shariff .shariff-buttons.buttonsize-small .shariff-text,.shariff .shariff-buttons.buttonsize-small .shariff-count{font-size:11px;line-height:25px;padding:0 5px;height:23px}.shariff .shariff-buttons.buttonsize-small .shariff-text{padding-left:1px !important}.shariff .shariff-buttons.buttonsize-small.theme-round li{width:25px !important}.shariff .shariff-buttons.buttonsize-small.theme-round a{width:25px !important}.shariff .shariff-buttons.buttonsize-small.theme-round .shariff-count{padding:0 !important;height:25px !important}.shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li{margin:5px 7px}.shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li:first-child{margin-left:5px}.shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li:last-child{margin-right:5px}.shariff .buttonsize-large li{height:45px !important}.shariff .buttonsize-large a{height:45px !important}.shariff .buttonsize-large.orientation-vertical li{width:155px}.shariff .buttonsize-large .shariff-icon svg{width:40px;height:28px;padding:9px 2px}.shariff .buttonsize-large .shariff-text,.shariff .buttonsize-large .shariff-count{font-size:14px;line-height:45px;padding:0 10px;height:43px}.shariff .buttonsize-large .shariff-text{padding-left:1px !important}.shariff .shariff-buttons.buttonsize-large.theme-round li{width:45px !important;height:45px !important}.shariff .buttonsize-large.theme-round a{width:45px !important}.shariff .buttonsize-large.theme-round .shariff-count{padding:0 !important;height:45px !important}.shariff .orientation-vertical{flex-direction:column}.shariff .orientation-vertical li{width:135px}.shariff.shariff-align-flex-start ul{justify-content:flex-start;align-items:flex-start}.shariff.shariff-align-center ul{justify-content:center;align-items:center}.shariff.shariff-align-flex-end ul{justify-content:flex-end;align-items:flex-end}.widget .shariff.shariff-widget-align-flex-start ul{justify-content:flex-start;align-items:flex-start}.widget .shariff.shariff-widget-align-center ul{justify-content:center;align-items:center}.widget .shariff.shariff-widget-align-flex-end ul{justify-content:flex-end;align-items:flex-end}.shariff.shariff-buttonstretch li{flex:1 0 auto !important}.shariff.shariff-buttonstretch .orientation-vertical li{width:100% !important}.widget .shariff li{border:0;font-weight:400}.widget .shariff .theme-default a,.widget .shariff .theme-color a,.widget .shariff .theme-grey a,.widget .shariff .theme-round a{color:#fff;display:block;font-weight:400}.widget .shariff .theme-default a:hover,.widget .shariff .theme-color a:hover,.widget .shariff .theme-grey a:hover,.widget .shariff .theme-round a:hover{color:#fff;font-weight:400}.shariff-warning{background-color:red;color:#fff;font-size:20px;font-weight:700;padding:10px;text-align:center;margin:0 auto;line-height:1.5}.shariff .info a{border:1px solid #ddd;width:35px}.shariff .shariff-button.info{width:35px;flex:0 0 auto !important}.shariff .theme-default .shariff-button.shariff-nocustomcolor.info svg path{fill:#999}.shariff .theme-round .shariff-button.shariff-nocustomcolor.info svg path{fill:#999}.shariff .buttonsize-small .shariff-button.info{width:25px}.shariff .buttonsize-small .info a{width:25px}.shariff .buttonsize-large .shariff-button.info{width:45px}.shariff .buttonsize-large .info a{width:45px}.shariff .info .shariff-icon svg{display:block;margin:auto}@media only screen and (max-width:360px){.shariff .shariff-buttons.buttonsize-small li{width:25px}.shariff .shariff-buttons li{width:35px}.shariff .shariff-buttons.buttonsize-large li{width:45px}.shariff .shariff-buttons .shariff-icon svg{display:block;margin:auto}.shariff .shariff-buttons .shariff-text{display:none}.shariff .shariff-buttons .shariff-count{display:none}}@media only screen and (min-width:361px){.shariff .shariff-buttons.buttonsize-small li{width:105px}.shariff .shariff-buttons li{width:125px}.shariff .shariff-buttons.buttonsize-large li{width:155px}.shariff .shariff-buttons .shariff-text{display:inline}.shariff .shariff-buttons .shariff-count{display:inline}}@media only screen and (min-device-width:1025px){.shariff .shariff-mobile{display:none !important}}
includes/class-shariff-widget.php CHANGED
@@ -1,176 +1,179 @@
1
- <?php
2
- /**
3
- * Will be included in the shariff.php.
4
- *
5
- * @package Shariff Wrapper
6
- */
7
-
8
- /**
9
- * Class ShariffWidget
10
- */
11
- class Shariff_Widget extends WP_Widget {
12
- /**
13
- * Registers the widget with the WordPress Widget API.
14
- */
15
- public static function register() {
16
- register_widget( __CLASS__ );
17
- }
18
-
19
- /**
20
- * Shariff_Widget constructor.
21
- */
22
- public function __construct() {
23
- // Add translations.
24
- if ( function_exists( 'load_plugin_textdomain' ) ) {
25
- load_plugin_textdomain( 'shariff' );
26
- }
27
-
28
- $widget_options = array(
29
- 'classname' => 'Shariff',
30
- 'description' => __( 'Add Shariff as configured on the plugin options page.', 'shariff' ),
31
- 'customize_selective_refresh' => true,
32
- );
33
-
34
- $control_options = array();
35
- parent::__construct( 'Shariff', 'Shariff', $widget_options, $control_options );
36
- }
37
-
38
- /**
39
- * Create the actual form.
40
- *
41
- * @param array $instance Current instance.
42
- *
43
- * @return void
44
- */
45
- public function form( $instance ) {
46
- // Set widgets defaults.
47
- $instance = wp_parse_args( (array) $instance, array(
48
- 'shariff-title' => '',
49
- 'shariff-tag' => '[shariff]',
50
- ));
51
- // Sets the title.
52
- echo '<p style="border-bottom: 1px solid #DFDFDF;"><strong>' . esc_html__( 'Title', 'shariff' ) . '</strong></p>';
53
- // Set the title.
54
- echo '<p><input id="' . esc_html( $this->get_field_id( 'shariff-title' ) ) . '" name="' . esc_html( $this->get_field_name( 'shariff-title' ) ) . '" type="text" size="45" value="' . esc_html( $instance['shariff-title'] ) . '" /> ' . esc_html__( '(optional)', 'shariff' ) . '</p>';
55
- // Sets the shorttag.
56
- echo '<p style="border-bottom: 1px solid #DFDFDF;"><strong>Shorttag</strong></p>';
57
- // Sets the shorttag.
58
- echo '<p><input id="' . esc_html( $this->get_field_id( 'shariff-tag' ) ) . '" name="' . esc_html( $this->get_field_name( 'shariff-tag' ) ) . '" type="text" value=\'' . esc_html( str_replace( '\'', '"', $instance['shariff-tag'] ) ) . '\' size="45" /> ' . esc_html__( '(optional)', 'shariff' ) . '</p>';
59
- echo '<p style="clear:both;"></p>';
60
- }
61
-
62
- /**
63
- * Saves the widget configuration.
64
- *
65
- * @param array $new_instance The new instance.
66
- * @param array $old_instance The old instance.
67
- *
68
- * @return array The updated instance.
69
- */
70
- public function update( $new_instance, $old_instance ) {
71
- $instance = $old_instance;
72
-
73
- // Sets the widget conf defaults.
74
- $new_instance = wp_parse_args( (array) $new_instance, array(
75
- 'shariff-title' => '',
76
- 'shariff-tag' => '[shariff]',
77
- ));
78
-
79
- // Checks the input values.
80
- $instance['shariff-title'] = (string) strip_tags( $new_instance['shariff-title'] );
81
- $instance['shariff-tag'] = (string) wp_kses( $new_instance['shariff-tag'], $GLOBALS['allowed_tags'] );
82
-
83
- // Saves the config.
84
- return $instance;
85
- }
86
-
87
- /**
88
- * Draws the widget.
89
- *
90
- * @param array $args Provided arguments.
91
- * @param array $instance The current instance.
92
- */
93
- public function widget( $args, $instance ) {
94
- // Get options.
95
- $shariff3uu = $GLOBALS['shariff3uu'];
96
-
97
- // Creates the container.
98
- // @codingStandardsIgnoreStart
99
- echo $args['before_widget'];
100
- // @codingStandardsIgnoreEnd
101
-
102
- // Prints the title of the widget, if provided.
103
- if ( empty( $instance['shariff-title'] ) ) {
104
- $title = '';
105
- } else {
106
- apply_filters( 'shariff_title', $instance['shariff-title'] );
107
- $title = $instance['shariff-title'];
108
- }
109
- if ( ! empty( $title ) ) {
110
- echo wp_kses( $args['before_title'] . $title . $args['after_title'], $GLOBALS['allowed_tags'] );
111
- }
112
-
113
- // Print the shorttag, but keep the original shorttag for further reference.
114
- $original_shorttag = $instance['shariff-tag'];
115
-
116
- // If nothing is configured, uses the global options from admin menu.
117
- if ( '[shariff]' === $instance['shariff-tag'] ) {
118
- $shorttag = '[shariff]';
119
- } else {
120
- $shorttag = $instance['shariff-tag'];
121
- }
122
-
123
- // Sets the url to the current page to prevent sharing the first or last post on pages with multiple posts.
124
- // For example the blog page. Of course only if no manual url is provided in the shorttag.
125
- $page_url = '';
126
- if ( strpos( $original_shorttag, ' url=' ) === false ) {
127
- $wpurl = get_bloginfo( 'wpurl' );
128
- $wpurl = str_replace( wp_make_link_relative( $wpurl ), '', $wpurl );
129
- if ( isset( $_SERVER['REQUEST_URI'] ) ) {
130
- $page_url = ' url="' . $wpurl . esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '"';
131
- } else {
132
- global $wp;
133
- $page_url = ' url="' . home_url( add_query_arg( array(), $wp->request ) ) . '"';
134
- }
135
- }
136
-
137
- // Same for title.
138
- $page_title = '';
139
- $wp_title = '';
140
- if ( strpos( $original_shorttag, 'title=' ) === false ) {
141
- $wp_title = wp_get_document_title();
142
- // wp_title for all pages that have it.
143
- if ( ! empty( $wp_title ) ) {
144
- $page_title = $wp_title;
145
- } else {
146
- $page_title = get_bloginfo( 'name' );
147
- }
148
- // Replace brackets [ and ] with ( and ).
149
- $page_title = str_replace( '[', '(', $page_title );
150
- $page_title = str_replace( ']', ')', $page_title );
151
- $page_title = ' title="' . wp_strip_all_tags( html_entity_decode( $page_title, ENT_COMPAT, 'UTF-8' ) ) . '"';
152
- }
153
-
154
- // Same for media.
155
- $media = '';
156
- if ( array_key_exists( 'services', $shariff3uu ) && strstr( $shariff3uu['services'], 'pinterest' ) && ( strpos( $original_shorttag, 'media=' ) === false ) ) {
157
- if ( isset( $shariff3uu['default_pinterest'] ) ) {
158
- $media = ' media="' . $shariff3uu['default_pinterest'] . '"';
159
- }
160
- }
161
-
162
- // Builds the shorttag and adds the url, title and media if necessary as well as the widget attribute.
163
- $shorttag = substr( $shorttag, 0, -1 ) . $page_title . $page_url . $media . ' widget="1"]';
164
-
165
- // Processes the shortcode if it is not password protected or "disable on password protected posts" is not set.
166
- if ( 1 !== post_password_required( get_the_ID() ) || ( isset( $shariff3uu['disable_on_protected'] ) && 1 !== $shariff3uu['disable_on_protected'] ) ) {
167
- echo do_shortcode( $shorttag );
168
- }
169
-
170
- // Closes the Container.
171
- // @codingStandardsIgnoreStart
172
- echo $args['after_widget'];
173
- // @codingStandardsIgnoreEnd
174
- } // End of widget.
175
- } // End of class ShariffWidget.
176
- add_action( 'widgets_init', array( 'Shariff_Widget', 'register' ) );
 
 
 
1
+ <?php
2
+ /**
3
+ * Will be included in the shariff.php.
4
+ *
5
+ * @package Shariff Wrapper
6
+ */
7
+
8
+ /**
9
+ * Class ShariffWidget
10
+ */
11
+ class Shariff_Widget extends WP_Widget {
12
+ /**
13
+ * Registers the widget with the WordPress Widget API.
14
+ */
15
+ public static function register() {
16
+ register_widget( __CLASS__ );
17
+ }
18
+
19
+ /**
20
+ * Shariff_Widget constructor.
21
+ */
22
+ public function __construct() {
23
+ // Add translations.
24
+ if ( function_exists( 'load_plugin_textdomain' ) ) {
25
+ load_plugin_textdomain( 'shariff' );
26
+ }
27
+
28
+ $widget_options = array(
29
+ 'classname' => 'Shariff',
30
+ 'description' => __( 'Add Shariff as configured on the plugin options page.', 'shariff' ),
31
+ 'customize_selective_refresh' => true,
32
+ );
33
+
34
+ $control_options = array();
35
+ parent::__construct( 'Shariff', 'Shariff', $widget_options, $control_options );
36
+ }
37
+
38
+ /**
39
+ * Create the actual form.
40
+ *
41
+ * @param array $instance Current instance.
42
+ *
43
+ * @return void
44
+ */
45
+ public function form( $instance ) {
46
+ // Set widgets defaults.
47
+ $instance = wp_parse_args(
48
+ (array) $instance,
49
+ array(
50
+ 'shariff-title' => '',
51
+ 'shariff-tag' => '[shariff]',
52
+ )
53
+ );
54
+ // Sets the title.
55
+ echo '<p style="border-bottom: 1px solid #DFDFDF;"><strong>' . esc_html__( 'Title', 'shariff' ) . '</strong></p>';
56
+ // Set the title.
57
+ echo '<p><input id="' . esc_html( $this->get_field_id( 'shariff-title' ) ) . '" name="' . esc_html( $this->get_field_name( 'shariff-title' ) ) . '" type="text" size="45" value="' . esc_html( $instance['shariff-title'] ) . '" /> ' . esc_html__( '(optional)', 'shariff' ) . '</p>';
58
+ // Sets the shorttag.
59
+ echo '<p style="border-bottom: 1px solid #DFDFDF;"><strong>Shorttag</strong></p>';
60
+ // Sets the shorttag.
61
+ echo '<p><input id="' . esc_html( $this->get_field_id( 'shariff-tag' ) ) . '" name="' . esc_html( $this->get_field_name( 'shariff-tag' ) ) . '" type="text" value=\'' . esc_html( str_replace( '\'', '"', $instance['shariff-tag'] ) ) . '\' size="45" /> ' . esc_html__( '(optional)', 'shariff' ) . '</p>';
62
+ echo '<p style="clear:both;"></p>';
63
+ }
64
+
65
+ /**
66
+ * Saves the widget configuration.
67
+ *
68
+ * @param array $new_instance The new instance.
69
+ * @param array $old_instance The old instance.
70
+ *
71
+ * @return array The updated instance.
72
+ */
73
+ public function update( $new_instance, $old_instance ) {
74
+ $instance = $old_instance;
75
+
76
+ // Sets the widget conf defaults.
77
+ $new_instance = wp_parse_args(
78
+ (array) $new_instance,
79
+ array(
80
+ 'shariff-title' => '',
81
+ 'shariff-tag' => '[shariff]',
82
+ )
83
+ );
84
+
85
+ // Checks the input values.
86
+ $instance['shariff-title'] = (string) wp_strip_all_tags( $new_instance['shariff-title'] );
87
+ $instance['shariff-tag'] = (string) wp_kses( $new_instance['shariff-tag'], $GLOBALS['allowed_tags'] );
88
+
89
+ // Saves the config.
90
+ return $instance;
91
+ }
92
+
93
+ /**
94
+ * Draws the widget.
95
+ *
96
+ * @param array $args Provided arguments.
97
+ * @param array $instance The current instance.
98
+ */
99
+ public function widget( $args, $instance ) {
100
+ // Get options.
101
+ $shariff3uu = $GLOBALS['shariff3uu'];
102
+
103
+ // Creates the container.
104
+ $allowed_tags = wp_kses_allowed_html( 'post' );
105
+ echo wp_kses( $args['before_widget'], $allowed_tags );
106
+
107
+ // Prints the title of the widget, if provided.
108
+ if ( empty( $instance['shariff-title'] ) ) {
109
+ $title = '';
110
+ } else {
111
+ apply_filters( 'shariff_title', $instance['shariff-title'] );
112
+ $title = $instance['shariff-title'];
113
+ }
114
+ if ( ! empty( $title ) ) {
115
+ echo wp_kses( $args['before_title'] . $title . $args['after_title'], $GLOBALS['allowed_tags'] );
116
+ }
117
+
118
+ // Print the shorttag, but keep the original shorttag for further reference.
119
+ $original_shorttag = $instance['shariff-tag'];
120
+
121
+ // If nothing is configured, uses the global options from admin menu.
122
+ if ( '[shariff]' === $instance['shariff-tag'] ) {
123
+ $shorttag = '[shariff]';
124
+ } else {
125
+ $shorttag = $instance['shariff-tag'];
126
+ }
127
+
128
+ // Sets the url to the current page to prevent sharing the first or last post on pages with multiple posts.
129
+ // For example the blog page. Of course only if no manual url is provided in the shorttag.
130
+ $page_url = '';
131
+ if ( strpos( $original_shorttag, ' url=' ) === false ) {
132
+ $wpurl = get_bloginfo( 'wpurl' );
133
+ $wpurl = str_replace( wp_make_link_relative( $wpurl ), '', $wpurl );
134
+ if ( isset( $_SERVER['REQUEST_URI'] ) ) {
135
+ $page_url = ' url="' . $wpurl . esc_url_raw( wp_unslash( $_SERVER['REQUEST_URI'] ) ) . '"';
136
+ } else {
137
+ global $wp;
138
+ $page_url = ' url="' . home_url( add_query_arg( array(), $wp->request ) ) . '"';
139
+ }
140
+ }
141
+
142
+ // Same for title.
143
+ $page_title = '';
144
+ $wp_title = '';
145
+ if ( strpos( $original_shorttag, 'title=' ) === false ) {
146
+ $wp_title = wp_get_document_title();
147
+ // wp_title for all pages that have it.
148
+ if ( ! empty( $wp_title ) ) {
149
+ $page_title = $wp_title;
150
+ } else {
151
+ $page_title = get_bloginfo( 'name' );
152
+ }
153
+ // Replace brackets [ and ] with ( and ).
154
+ $page_title = str_replace( '[', '(', $page_title );
155
+ $page_title = str_replace( ']', ')', $page_title );
156
+ $page_title = ' title="' . wp_strip_all_tags( html_entity_decode( $page_title, ENT_COMPAT, 'UTF-8' ) ) . '"';
157
+ }
158
+
159
+ // Same for media.
160
+ $media = '';
161
+ if ( array_key_exists( 'services', $shariff3uu ) && strstr( $shariff3uu['services'], 'pinterest' ) && ( strpos( $original_shorttag, 'media=' ) === false ) ) {
162
+ if ( isset( $shariff3uu['default_pinterest'] ) ) {
163
+ $media = ' media="' . $shariff3uu['default_pinterest'] . '"';
164
+ }
165
+ }
166
+
167
+ // Builds the shorttag and adds the url, title and media if necessary as well as the widget attribute.
168
+ $shorttag = substr( $shorttag, 0, -1 ) . $page_title . $page_url . $media . ' widget="1"]';
169
+
170
+ // Processes the shortcode if it is not password protected or "disable on password protected posts" is not set.
171
+ if ( 1 !== post_password_required( get_the_ID() ) || ( isset( $shariff3uu['disable_on_protected'] ) && 1 !== $shariff3uu['disable_on_protected'] ) ) {
172
+ echo do_shortcode( $shorttag );
173
+ }
174
+
175
+ // Closes the Container.
176
+ echo wp_kses( $args['after_widget'], $allowed_tags );
177
+ } // End of widget.
178
+ } // End of class ShariffWidget.
179
+ add_action( 'widgets_init', array( 'Shariff_Widget', 'register' ) );
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Shariff Wrapper ===
2
  Contributors: starguide, 3UU
3
  Tags: Shariff, GDPR, DSGVO, share buttons, sharing
4
- Requires at least: 4.7
5
- Requires PHP: 5.6
6
- Tested up to: 4.9
7
- Stable tag: 4.5.2
8
  License: MIT
9
  License URI: http://opensource.org/licenses/mit
10
 
@@ -12,7 +12,7 @@ Shariff provides share buttons that respect the privacy of your visitors and fol
12
 
13
  == Description ==
14
 
15
- The "original" share buttons automatically transmit data of your visitors to the social network sites as soon as they visit your website. They do not need to click on a share button for this and therefore have no choice, if they want their data to be send. The German computer magazine c't has developed "Shariff" `(ʃɛɹɪf)` that follows the General Data Protection Regulation (GDPR - Regulation (EU) 2016/679). This plugin adapts the Shariff concept and provides an easy to use solution for WordPress. We currently support 32 services in 25 languages: AddThis, Bitcoin, Diaspora, Facebook, Flattr, Flipboard, GooglePlus, LinkedIn, mailto, Mastodon, Odnoklassniki, Patreon, PayPal, PayPal.me, Pinterest, Pocket, Printer, Qzone, Reddit, RSS, SMS, Stumbleupon, Telegram, TencentWeibo, Threema, Tumblr, Twitter, VK, Wallabag, Weibo, WhatsApp, Xing.
16
 
17
  For more information about the Shariff project check out the original [GitHub project](https://github.com/heiseonline/shariff) and read about the project itself [c’t information page](http://ct.de/shariff) (in German).
18
 
@@ -152,6 +152,19 @@ These are bugs or unexpected glitches that we know of, but that do not have an i
152
 
153
  == Changelog ==
154
 
 
 
 
 
 
 
 
 
 
 
 
 
 
155
  = 4.5.2 =
156
  - added support for share count requests of multilingual sites
157
  - updated button translations for Twitter and Pinterest (thanks to Jessica, @jess78)
@@ -170,77 +183,4 @@ These are bugs or unexpected glitches that we know of, but that do not have an i
170
  - updated button languages, now supporting 25 languages
171
  - fixed a bug causing share counts to not being displayed properly
172
 
173
- = 4.4.4 =
174
- - added support for automatic addition to bbpress forums, topics and replies
175
- - fixed a bug that caused "hideshariff" to not function properly
176
-
177
- = 4.4.3 =
178
- - new support for additional manual AMP integrations
179
- - fixed a PHP error on certain server configurations
180
- - new support for the print button on AMP pages
181
- - fixed a markup typo
182
- - minor css improvements
183
-
184
- = 4.4.2 =
185
- - new support for the "AMP for WP" plugin by Ahmed and Mohammed Kaludi
186
- - improved support for the "AMP for WordPress" plugin by Automattic
187
- - new additional workaround for servers without $_SERVER for category pages
188
- - minor bug fixes
189
-
190
- = 4.4.1 =
191
- - new service wallabag (thanks to Torsten, @knodderdachs)
192
- - minor bug fixes
193
- - updated help section
194
-
195
- = 4.4.0 =
196
- - new service Telegram (thanks to Daniel Sturm, @dcsturm)
197
- - new service Flipboard (thanks to csigncsign, @csigncsign)
198
- - new service Mastodon (thanks to scroom, @scroom)
199
- - new service Qzone
200
- - new service Weibo
201
- - new service TencentWeibo
202
- - new service SMS (will work on iOS, might not work on other phones)
203
- - new support of the "AMP for WordPress" plugin by Automattic
204
- - new option to set a custom text for the info button
205
- - new option to disable the metabox
206
- - new option to add shariff to CPTs before the content
207
- - new ranking table now also shows pages
208
- - new fix to prevent Shariff buttons from being displayed on admin pages
209
- - new fix to support WP-CLI (thanks to Daniel Jagszent, @d--j)
210
- - fixed HTML errors regarding self closing tags (thanks to Tooni, @tooni)
211
- - fixed a missing closing tag under certain conditions (thanks to Pat, @fortythousandmiles)
212
- - removed GooglePlus share counts due to Google removing the API
213
- - added Czech translation of the buttons
214
- - updated a lot of button translations
215
- - updated to Facebook Graph API 2.12
216
- - updated a lot of strings to allow for easier translation
217
- - updated the reddit icon
218
- - updated help section
219
- - improved documentation of the REST API endpoint for share counts (thanks to David)
220
- - major improvements in regards to code quality
221
- - minor css improvements
222
- - minor security improvements
223
- - removed the mail form for the time being due to technical and legal due diligence
224
- - if you need the mail form functionality, please stick to version 4.3
225
- - https://downloads.wordpress.org/plugin/shariff.4.3.0.zip
226
-
227
- = 4.3.0 =
228
- - new service Odnoklassniki (thanks to rockhit)
229
- - new meta box allows for individual settings per post or page
230
- - new option to hide share counts that are zero
231
- - new option to disable dynamic cache lifespan (not recommended)
232
- - new option to set the button size to small, medium or large
233
- - new option to add a custom class to the container around Shariff
234
- - new option to open links in a popup (thanks to jackennils)
235
- - new option to use NewShareCount instead of OpenShareCount (Twitter)
236
- - added timestamp variable to be accessible via shortcode
237
- - fixed post timestamp for caching under certain conditions
238
- - fixed Facebook share count error for never crawled pages
239
- - fixed empty tab after sharing on certain mobile devices
240
- - fixed custom title attribute (thanks to kschlager)
241
- - updated Flattr user id for the future (thanks to poetaster)
242
- - reduced changelog on wordpress.org (thanks to timse201)
243
- - minor css improvements
244
- - updated help section
245
-
246
  The complete changelog can be found here: https://plugins.svn.wordpress.org/shariff/trunk/changelog.txt
1
  === Shariff Wrapper ===
2
  Contributors: starguide, 3UU
3
  Tags: Shariff, GDPR, DSGVO, share buttons, sharing
4
+ Requires at least: 4.9
5
+ Requires PHP: 7.2
6
+ Tested up to: 5.0
7
+ Stable tag: 4.5.3
8
  License: MIT
9
  License URI: http://opensource.org/licenses/mit
10
 
12
 
13
  == Description ==
14
 
15
+ The "original" share buttons automatically transmit data of your visitors to the social network sites as soon as they visit your website. They do not need to click on a share button for this and therefore have no choice, if they want their data to be send. The German computer magazine c't has developed "Shariff" `(ʃɛɹɪf)` that follows the General Data Protection Regulation (GDPR - Regulation (EU) 2016/679). This plugin adapts the Shariff concept and provides an easy to use solution for WordPress. We currently support 30 services in 25 languages: AddThis, Bitcoin, Diaspora, Facebook, Flattr, Flipboard, LinkedIn, mailto, Odnoklassniki, Patreon, PayPal, PayPal.me, Pinterest, Pocket, Printer, Qzone, Reddit, RSS, SMS, Stumbleupon, Telegram, TencentWeibo, Threema, Tumblr, Twitter, VK, Wallabag, Weibo, WhatsApp, Xing.
16
 
17
  For more information about the Shariff project check out the original [GitHub project](https://github.com/heiseonline/shariff) and read about the project itself [c’t information page](http://ct.de/shariff) (in German).
18
 
152
 
153
  == Changelog ==
154
 
155
+ = 4.5.3 =
156
+ - removed LinkedIn Share Counts due to LinkedIn removing them completely
157
+ - removed GooglePlus Share Counts due to Google shutting GooglePlus down
158
+ - removed OpenShareCount due to the service having shut down
159
+ - removed NewShareCount due to the service having shut down
160
+ - removed Mastodon temporarily until a new working solution is available
161
+ - deprecated GooglePlus as a service, will be removed with the next release
162
+ - added TwitCount (twitcount.com) as an alternative for Twitter share counts
163
+ - updated to Facebook Graph API v3.2
164
+ - updated to WordPress Coding Standards 2.0
165
+ - corrected minor typos
166
+ - added the new logo thanks to Philipp Wildfeuer (@phil_sauvage)
167
+
168
  = 4.5.2 =
169
  - added support for share count requests of multilingual sites
170
  - updated button translations for Twitter and Pinterest (thanks to Jessica, @jess78)
183
  - updated button languages, now supporting 25 languages
184
  - fixed a bug causing share counts to not being displayed properly
185
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  The complete changelog can be found here: https://plugins.svn.wordpress.org/shariff/trunk/changelog.txt
services/shariff-diaspora.php CHANGED
@@ -1,6 +1,6 @@
1
  <?php
2
  /**
3
- * Will be included in the shariff.php only, when Diaspora is requested as a service.
4
  *
5
  * @package Shariff Wrapper
6
  */
@@ -27,30 +27,30 @@ if ( isset( $frontend ) && 1 === $frontend ) {
27
 
28
  // Button alt label.
29
  $button_title_array = array(
30
- 'bg' => 'Сподели в Diaspora',
31
- 'cs' => 'Sdílet na Diaspora',
32
- 'da' => 'Del på Diaspora',
33
- 'de' => 'Bei Diaspora teilen',
34
- 'en' => 'Share on Diaspora',
35
- 'es' => 'Compartir en Diaspora',
36
- 'fi' => 'Jaa Diasporaissä',
37
- 'fr' => 'Partager sur Diaspora',
38
- 'hr' => 'Podijelite na Diaspora',
39
- 'hu' => 'Megosztás Diaspora',
40
- 'it' => 'Condividi su Diaspora',
41
- 'ja' => 'Diaspora上で共有',
42
- 'ko' => 'Diaspora에서 공유하기',
43
- 'nl' => 'Delen op Diaspora',
44
- 'no' => 'Del på Diaspora',
45
- 'pl' => 'Udostępnij przez Diaspora',
46
- 'pt' => 'Compartilhar no Diaspora',
47
- 'ro' => 'Partajează pe Diaspora',
48
- 'ru' => 'Поделиться на Diaspora',
49
- 'sk' => 'Zdieľať na Diaspora',
50
- 'sl' => 'Deli na Diaspora',
51
- 'sr' => 'Podeli na Diaspora-u',
52
- 'sv' => 'Dela på Diaspora',
53
- 'tr' => 'Diaspora\'ta paylaş',
54
- 'zh' => '分享至Diaspora',
55
  );
56
  }
1
  <?php
2
  /**
3
+ * Will be included in the shariff.php only, when diaspora is requested as a service.
4
  *
5
  * @package Shariff Wrapper
6
  */
27
 
28
  // Button alt label.
29
  $button_title_array = array(
30
+ 'bg' => 'Сподели в diaspora*',
31
+ 'cs' => 'Sdílet na diaspora*',
32
+ 'da' => 'Del på diaspora*',
33
+ 'de' => 'Bei diaspora* teilen',
34
+ 'en' => 'Share on diaspora*',
35
+ 'es' => 'Compartir en diaspora*',
36
+ 'fi' => 'Jaa diaspora*issä',
37
+ 'fr' => 'Partager sur diaspora*',
38
+ 'hr' => 'Podijelite na diaspora*',
39
+ 'hu' => 'Megosztás diaspora*',
40
+ 'it' => 'Condividi su diaspora*',
41
+ 'ja' => 'diaspora*上で共有',
42
+ 'ko' => 'diaspora*에서 공유하기',
43
+ 'nl' => 'Delen op diaspora*',
44
+ 'no' => 'Del på diaspora*',
45
+ 'pl' => 'Udostępnij przez diaspora*',
46
+ 'pt' => 'Compartilhar no diaspora*',
47
+ 'ro' => 'Partajează pe diaspora*',
48
+ 'ru' => 'Поделиться на diaspora*',
49
+ 'sk' => 'Zdieľať na diaspora*',
50
+ 'sl' => 'Deli na diaspora*',
51
+ 'sr' => 'Podeli na diaspora*-u',
52
+ 'sv' => 'Dela på diaspora*',
53
+ 'tr' => 'diaspora*\'ta paylaş',
54
+ 'zh' => '分享至diaspora*',
55
  );
56
  }
services/shariff-facebook.php CHANGED
@@ -69,7 +69,7 @@ if ( isset( $frontend ) && 1 === $frontend ) {
69
  // Create the FB access token.
70
  $fb_token = $fb_app_id . '|' . $fb_app_secret;
71
  // Use the token to get the share counts.
72
- $facebook = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://graph.facebook.com/v3.0/?access_token=' . $fb_token . '&fields=engagement&id=' . $post_url ) ) );
73
  // Decode the json response.
74
  $facebook_json = json_decode( $facebook, true );
75
  // Set nofbid in case the page has not yet been crawled by Facebook and no ID is provided.
69
  // Create the FB access token.
70
  $fb_token = $fb_app_id . '|' . $fb_app_secret;
71
  // Use the token to get the share counts.
72
+ $facebook = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://graph.facebook.com/v3.2/?access_token=' . $fb_token . '&fields=engagement&id=' . $post_url ) ) );
73
  // Decode the json response.
74
  $facebook_json = json_decode( $facebook, true );
75
  // Set nofbid in case the page has not yet been crawled by Facebook and no ID is provided.
services/shariff-linkedin.php CHANGED
@@ -26,7 +26,7 @@ if ( isset( $frontend ) && 1 === $frontend ) {
26
  $svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27 32"><path fill="' . $main_color . '" d="M6.2 11.2v17.7h-5.9v-17.7h5.9zM6.6 5.7q0 1.3-0.9 2.2t-2.4 0.9h0q-1.5 0-2.4-0.9t-0.9-2.2 0.9-2.2 2.4-0.9 2.4 0.9 0.9 2.2zM27.4 18.7v10.1h-5.9v-9.5q0-1.9-0.7-2.9t-2.3-1.1q-1.1 0-1.9 0.6t-1.2 1.5q-0.2 0.5-0.2 1.4v9.9h-5.9q0-7.1 0-11.6t0-5.3l0-0.9h5.9v2.6h0q0.4-0.6 0.7-1t1-0.9 1.6-0.8 2-0.3q3 0 4.9 2t1.9 6z"/></svg>';
27
 
28
  // Backend available?
29
- $backend_available = 1;
30
 
31
  // Button text label.
32
  $button_text_array = array(
@@ -84,14 +84,4 @@ if ( isset( $frontend ) && 1 === $frontend ) {
84
  'tr' => 'LinkedIn\'ta paylaş',
85
  'zh' => '在LinkedIn上分享',
86
  );
87
- } elseif ( isset( $backend ) && 1 === $backend ) {
88
- // Fetch counts.
89
- $linkedin = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://www.linkedin.com/countserv/count/share?url=' . $post_url . '&format=json' ) ) );
90
- $linkedin_json = json_decode( $linkedin, true );
91
- // Store results, if we have some and record errors, if enabled (e.g. request from the status tab).
92
- if ( isset( $linkedin_json['count'] ) ) {
93
- $share_counts['linkedin'] = intval( $linkedin_json['count'] );
94
- } elseif ( isset( $record_errors ) && 1 === $record_errors ) {
95
- $service_errors['linkedin'] = $linkedin;
96
- }
97
  }
26
  $svg_icon = '<svg width="32px" height="20px" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 27 32"><path fill="' . $main_color . '" d="M6.2 11.2v17.7h-5.9v-17.7h5.9zM6.6 5.7q0 1.3-0.9 2.2t-2.4 0.9h0q-1.5 0-2.4-0.9t-0.9-2.2 0.9-2.2 2.4-0.9 2.4 0.9 0.9 2.2zM27.4 18.7v10.1h-5.9v-9.5q0-1.9-0.7-2.9t-2.3-1.1q-1.1 0-1.9 0.6t-1.2 1.5q-0.2 0.5-0.2 1.4v9.9h-5.9q0-7.1 0-11.6t0-5.3l0-0.9h5.9v2.6h0q0.4-0.6 0.7-1t1-0.9 1.6-0.8 2-0.3q3 0 4.9 2t1.9 6z"/></svg>';
27
 
28
  // Backend available?
29
+ $backend_available = 0;
30
 
31
  // Button text label.
32
  $button_text_array = array(
84
  'tr' => 'LinkedIn\'ta paylaş',
85
  'zh' => '在LinkedIn上分享',
86
  );
 
 
 
 
 
 
 
 
 
 
87
  }
services/shariff-mastodon.php DELETED
@@ -1,56 +0,0 @@
1
- <?php
2
- /**
3
- * Will be included in the shariff.php only, when Mastodon is requested as a service.
4
- *
5
- * @package Shariff Wrapper
6
- */
7
-
8
- // Prevent direct calls.
9
- if ( ! class_exists( 'WP' ) ) {
10
- die();
11
- }
12
-
13
- // Check if we need the frontend or the backend part.
14
- if ( isset( $frontend ) && 1 === $frontend ) {
15
- // Service URL.
16
- $service_url = esc_html( 'web+mastodon://share' );
17
-
18
- // Build the button URL.
19
- $button_url = $service_url . '?text=' . $share_url;
20
-
21
- // Set the Colors (Hexadecimal including the #).
22
- $main_color = '#2b90d9';
23
- $secondary_color = '#9baec8';
24
-
25
- // SVG icon.
26
- $svg_icon = '<svg xmlns="http://www.w3.org/2000/svg" width="32" height="20" viewBox="0 0 200 200"><path fill="' . $main_color . '" d="M155 72q0-15-8-24c-5-6-12-9-20-9-10 0-18 4-23 12l-4 8-5-8c-5-8-13-12-23-12-8 0-15 3-20 9q-8 9-8 24v49h19V73c0-10 5-15 13-15 9 0 14 6 14 18v26h19V76c0-12 5-18 14-18 8 0 13 6 13 15v48h19V72l27 47c-2 13-22 28-46 30l-36 3a216 216 0 0 1-38-5 42 42 0 0 0 1 5c2 21 20 22 37 23a107 107 0 0 0 32-4v15s-11 6-32 7a137 137 0 0 1-43-4c-37-10-43-49-44-88V69c0-40 26-52 26-52 14-6 37-9 60-9h1c24 0 46 3 60 9 0 0 26 12 26 52 0 0 0 30-4 50"/></svg>';
27
-
28
- // Backend available?
29
- $backend_available = 0;
30
-
31
- // Button alt label.
32
- $button_title_array = array(
33
- 'bg' => 'Сподели във Mastodon',
34
- 'da' => 'Del på Mastodon',
35
- 'de' => 'Bei Mastodon teilen',
36
- 'en' => 'Share on Mastodon',
37
- 'es' => 'Compartir en Mastodon',
38
- 'fi' => 'Jaa Mastodon',
39
- 'fr' => 'Partager sur Mastodon',
40
- 'hr' => 'Podijelite na Mastodon',
41
- 'hu' => 'Megosztás Mastodon',
42
- 'it' => 'Condividi su Mastodon',
43
- 'nl' => 'Delen op Mastodon',
44
- 'no' => 'Del på Mastodon',
45
- 'pl' => 'Udostępnij na Mastodon',
46
- 'pt' => 'Compartilhar no Mastodon',
47
- 'ro' => 'Partajează pe Mastodon',
48
- 'ru' => 'Поделиться на Mastodon',
49
- 'sk' => 'Zdieľať na Mastodon',
50
- 'sl' => 'Deli na Mastodon',
51
- 'sr' => 'Podeli na Mastodon',
52
- 'sv' => 'Dela på Mastodon',
53
- 'tr' => 'Mastodon\'ta paylaş',
54
- 'zh' => '在Mastodon上分享',
55
- );
56
- }
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
services/shariff-rss.php CHANGED
@@ -31,13 +31,15 @@ if ( isset( $frontend ) && 1 === $frontend ) {
31
 
32
  // Button text label.
33
  $button_text_array = array(
34
- 'de' => 'rss-feed',
35
- 'en' => 'rss feed',
 
36
  );
37
 
38
  // Button alt label.
39
  $button_title_array = array(
40
- 'de' => 'rss-feed',
41
- 'en' => 'rss feed',
 
42
  );
43
  }
31
 
32
  // Button text label.
33
  $button_text_array = array(
34
+ 'de' => 'RSS-feed',
35
+ 'en' => 'RSS feed',
36
+ 'fr' => 'flux RSS',
37
  );
38
 
39
  // Button alt label.
40
  $button_title_array = array(
41
+ 'de' => 'RSS-feed',
42
+ 'en' => 'RSS feed',
43
+ 'fr' => "S'abonner au flux RSS",
44
  );
45
  }
services/shariff-tumblr.php CHANGED
@@ -16,16 +16,16 @@ if ( isset( $frontend ) && 1 === $frontend ) {
16
  $service_url = esc_url( 'https://www.tumblr.com/widgets/share/tool' );
17
 
18
  // Domain.
19
- $wpurl = get_bloginfo( 'wpurl' );
20
- $domain = trim( $wpurl, '/' );
21
  if ( ! preg_match( '#^http(s)?://#', $domain ) ) {
22
- $domain = 'http://' . $domain;
23
  }
24
- $url_parts = wp_parse_url( $domain );
25
- $domain = preg_replace( '/^www\./', '', $url_parts['host'] );
26
 
27
  // Build button URL.
28
- $button_url = $service_url . '?posttype=link&canonicalUrl=' . $share_url . '&tags=' . rawurlencode( $domain );
29
 
30
  // Colors.
31
  $main_color = '#36465d';
16
  $service_url = esc_url( 'https://www.tumblr.com/widgets/share/tool' );
17
 
18
  // Domain.
19
+ $wpurl = get_bloginfo( 'wpurl' );
20
+ $domainname = trim( $wpurl, '/' );
21
  if ( ! preg_match( '#^http(s)?://#', $domain ) ) {
22
+ $domainname = 'http://' . $domainname;
23
  }
24
+ $url_parts = wp_parse_url( $domain );
25
+ $domainname = preg_replace( '/^www\./', '', $url_parts['host'] );
26
 
27
  // Build button URL.
28
+ $button_url = $service_url . '?posttype=link&canonicalUrl=' . $share_url . '&tags=' . rawurlencode( $domainname );
29
 
30
  // Colors.
31
  $main_color = '#36465d';
services/shariff-twitter.php CHANGED
@@ -78,11 +78,7 @@ if ( isset( $frontend ) && 1 === $frontend ) {
78
  );
79
  } elseif ( isset( $backend ) && 1 === $backend ) {
80
  // Fetch counts.
81
- if ( isset( $shariff3uu['newsharecount'] ) && 1 === $shariff3uu['newsharecount'] ) {
82
- $twitter = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://public.newsharecounts.com/count.json?url=' . $post_url ) ) );
83
- } else {
84
- $twitter = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'http://opensharecount.com/count.json?url=' . $post_url ) ) );
85
- }
86
  $twitter_json = json_decode( $twitter, true );
87
 
88
  // Store results, if we have some and record errors, if enabled (e.g. request from the status tab).
78
  );
79
  } elseif ( isset( $backend ) && 1 === $backend ) {
80
  // Fetch counts.
81
+ $twitter = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://counts.twitcount.com/counts.php?url=' . $post_url ) ) );
 
 
 
 
82
  $twitter_json = json_decode( $twitter, true );
83
 
84
  // Store results, if we have some and record errors, if enabled (e.g. request from the status tab).
shariff.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Shariff Wrapper
4
  * Plugin URI: https://wordpress.org/plugins-wp/shariff/
5
  * Description: Shariff provides share buttons that respect the privacy of your visitors and follow the General Data Protection Regulation (GDPR).
6
- * Version: 4.5.2
7
  * Author: Jan-Peter Lambeck & 3UU
8
  * Author URI: https://wordpress.org/plugins/shariff/
9
  * License: MIT
@@ -33,7 +33,7 @@ $shariff3uu = array_merge( $shariff3uu_basic, $shariff3uu_design, $shariff3uu_ad
33
  */
34
  function shariff3uu_update() {
35
  // Adjust code version.
36
- $code_version = '4.5.1';
37
 
38
  // Get options.
39
  $shariff3uu = $GLOBALS['shariff3uu'];
@@ -51,11 +51,14 @@ add_action( 'admin_init', 'shariff3uu_update' );
51
  */
52
  function shariff3uu_privacy() {
53
  if ( function_exists( 'wp_add_privacy_policy_content' ) ) {
54
- $content = __( '<h2>Social Media Plugin "Shariff Wrapper"</h2>
 
55
 
56
  On our website we offer you the possibility to use so called "Social Media Buttons". To protect your data, we use a solution called "Shariff". Hereby the share buttons are implemented as static images, which contain a link to the corresponding social network site. If you click on such a button, you will be redirected to the respective social network site in the same way, as normal links would do as well. Only in that moment of time the provider of the social network site will get information about you, for example your IP address. If you do not click on such a share button, no data will be transmitted. Information about the collection and usage of your date on the social network sites can be found in the corresponding terms of use of the respective provider. More information about the plugin and the Shariff solution can be found here: <a href="https://wordpress.org/plugins/shariff/">https://wordpress.org/plugins/shariff/</a>
57
 
58
- On our website we offer share buttons for the following services / companies: AddThis, Diaspora, Facebook, Flattr, Flipboard, GooglePlus, LinkedIn, Mastodon, Odnoklassniki, Patreon, PayPal, Pinterest, Pocket, Qzone, Reddit, Stumbleupon, Telegram, TencentWeibo, Threema, Tumblr, Twitter, VK, Wallabag, Weibo, WhatsApp, Xing.', 'shariff' );
 
 
59
  wp_add_privacy_policy_content( 'Shariff Wrapper', wp_kses_post( wpautop( $content, false ) ) );
60
  }
61
  }
@@ -176,26 +179,30 @@ function shariff_init_locale() {
176
 
177
  /** Register the wp rest api route and sanitize the input */
178
  function shariff3uu_sanitize_api() {
179
- register_rest_route( 'shariff/v1', '/share_counts', array(
180
- 'methods' => 'GET',
181
- 'callback' => 'shariff3uu_share_counts',
182
- 'args' => array(
183
- 'url' => array(
184
- 'sanitize_callback' => 'esc_url',
185
- 'required' => true,
186
- 'description' => __( 'URL of the post or page to request share counts for.', 'shariff' ),
187
- ),
188
- 'services' => array(
189
- 'sanitize_callback' => 'sanitize_text_field',
190
- 'required' => true,
191
- 'description' => __( 'A list of services separated by |. Example: twitter|facebook|xing', 'shariff' ),
192
- ),
193
- 'timestamp' => array(
194
- 'sanitize_callback' => 'absint',
195
- 'description' => __( 'Timestamp of the last update of the post. Used for dynamic cache lifespan.', 'shariff' ),
 
 
 
 
196
  ),
197
- ),
198
- ) );
199
  }
200
  add_action( 'rest_api_init', 'shariff3uu_sanitize_api' );
201
 
@@ -450,7 +457,7 @@ function shariff3uu_fill_cache() {
450
 
451
  // Avoid errors if no services are given - instead use the default set of services.
452
  if ( empty( $GLOBALS['shariff3uu']['services'] ) ) {
453
- $services = 'twitter|facebook|googleplus';
454
  } else {
455
  $services = $GLOBALS['shariff3uu']['services'];
456
  }
@@ -654,7 +661,7 @@ function shariff3uu_excerpt( $content ) {
654
  $shariff3uu = $GLOBALS['shariff3uu'];
655
  // Remove headline in post.
656
  if ( isset( $shariff3uu['headline'] ) ) {
657
- $content = str_replace( strip_tags( $shariff3uu['headline'] ), ' ', $content );
658
  }
659
  // Add shariff before the excerpt, if option checked in the admin menu.
660
  if ( isset( $shariff3uu['add_before']['excerpt'] ) && 1 === $shariff3uu['add_before']['excerpt'] ) {
@@ -870,7 +877,7 @@ function shariff3uu_render( $atts ) {
870
 
871
  // Avoids errors if no attributes are given - instead uses the old set of services to make it backward compatible.
872
  if ( empty( $shariff3uu['services'] ) ) {
873
- $shariff3uu['services'] = 'twitter|facebook|googleplus|info';
874
  }
875
 
876
  // Uses the backend option for every option that is not set in the shorttag.
@@ -1099,17 +1106,14 @@ function shariff3uu_render( $atts ) {
1099
  if ( isset( $atts['hidezero'] ) && 1 === $atts['hidezero'] ) {
1100
  $output .= ' data-hidezero="1"';
1101
  }
1102
- // Adds external api if entered.
1103
  if ( isset( $shariff3uu['external_host'] ) && ! empty( $shariff3uu['external_host'] ) && isset( $shariff3uu['external_direct'] ) ) {
1104
  $output .= ' data-backendurl="' . $shariff3uu['external_host'] . '"';
1105
- } // Elseif test the subapi setting.
1106
- elseif ( isset( $shariff3uu['subapi'] ) && 1 === $shariff3uu['subapi'] ) {
1107
  $output .= ' data-backendurl="' . strtok( get_bloginfo( 'wpurl' ), '?' ) . '/wp-json/shariff/v1/share_counts?"';
1108
- } // Elseif pretty permalinks are not activated fall back to manual rest route.
1109
- elseif ( ! get_option( 'permalink_structure' ) ) {
1110
  $output .= ' data-backendurl="?rest_route=/shariff/v1/share_counts&"';
1111
- } // Else use the home url.
1112
- else {
1113
  $output .= ' data-backendurl="' . rtrim( strtok( home_url(), '?' ), '/' ) . '/wp-json/shariff/v1/share_counts?"';
1114
  }
1115
  }
@@ -1297,11 +1301,15 @@ function shariff3uu_render( $atts ) {
1297
  }
1298
 
1299
  // Output title, label and role.
1300
- $output .= 'title="' . $button_title . '" aria-label="' . $button_title . '" role="button" rel="';
1301
- if ( 'facebook' !== $service ) {
1302
- $output .= 'noopener ';
 
 
 
 
1303
  }
1304
- $output .= 'nofollow" class="shariff-link';
1305
 
1306
  // AMP?
1307
  if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
@@ -1575,12 +1583,10 @@ function shariff3uu_purge_transients_deactivation() {
1575
  global $wpdb;
1576
  }
1577
  // Deletes transients.
1578
- // @codingStandardsIgnoreStart
1579
- $sql = 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_timeout_shariff%"';
1580
- $wpdb->query( $sql );
1581
- $sql = 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_shariff%"';
1582
- $wpdb->query( $sql );
1583
- // @codingStandardsIgnoreEnd
1584
- // Clears object cache.
1585
  wp_cache_flush();
1586
  }
3
  * Plugin Name: Shariff Wrapper
4
  * Plugin URI: https://wordpress.org/plugins-wp/shariff/
5
  * Description: Shariff provides share buttons that respect the privacy of your visitors and follow the General Data Protection Regulation (GDPR).
6
+ * Version: 4.5.3
7
  * Author: Jan-Peter Lambeck & 3UU
8
  * Author URI: https://wordpress.org/plugins/shariff/
9
  * License: MIT
33
  */
34
  function shariff3uu_update() {
35
  // Adjust code version.
36
+ $code_version = '4.5.3';
37
 
38
  // Get options.
39
  $shariff3uu = $GLOBALS['shariff3uu'];
51
  */
52
  function shariff3uu_privacy() {
53
  if ( function_exists( 'wp_add_privacy_policy_content' ) ) {
54
+ $content = __(
55
+ '<h2>Social Media Plugin "Shariff Wrapper"</h2>
56
 
57
  On our website we offer you the possibility to use so called "Social Media Buttons". To protect your data, we use a solution called "Shariff". Hereby the share buttons are implemented as static images, which contain a link to the corresponding social network site. If you click on such a button, you will be redirected to the respective social network site in the same way, as normal links would do as well. Only in that moment of time the provider of the social network site will get information about you, for example your IP address. If you do not click on such a share button, no data will be transmitted. Information about the collection and usage of your date on the social network sites can be found in the corresponding terms of use of the respective provider. More information about the plugin and the Shariff solution can be found here: <a href="https://wordpress.org/plugins/shariff/">https://wordpress.org/plugins/shariff/</a>
58
 
59
+ On our website we offer share buttons for the following services / companies: AddThis, Diaspora, Facebook, Flattr, Flipboard, LinkedIn, Odnoklassniki, Patreon, PayPal, Pinterest, Pocket, Qzone, Reddit, Stumbleupon, Telegram, TencentWeibo, Threema, Tumblr, Twitter, VK, Wallabag, Weibo, WhatsApp, Xing.',
60
+ 'shariff'
61
+ );
62
  wp_add_privacy_policy_content( 'Shariff Wrapper', wp_kses_post( wpautop( $content, false ) ) );
63
  }
64
  }
179
 
180
  /** Register the wp rest api route and sanitize the input */
181
  function shariff3uu_sanitize_api() {
182
+ register_rest_route(
183
+ 'shariff/v1',
184
+ '/share_counts',
185
+ array(
186
+ 'methods' => 'GET',
187
+ 'callback' => 'shariff3uu_share_counts',
188
+ 'args' => array(
189
+ 'url' => array(
190
+ 'sanitize_callback' => 'esc_url',
191
+ 'required' => true,
192
+ 'description' => __( 'URL of the post or page to request share counts for.', 'shariff' ),
193
+ ),
194
+ 'services' => array(
195
+ 'sanitize_callback' => 'sanitize_text_field',
196
+ 'required' => true,
197
+ 'description' => __( 'A list of services separated by |. Example: twitter|facebook|xing', 'shariff' ),
198
+ ),
199
+ 'timestamp' => array(
200
+ 'sanitize_callback' => 'absint',
201
+ 'description' => __( 'Timestamp of the last update of the post. Used for dynamic cache lifespan.', 'shariff' ),
202
+ ),
203
  ),
204
+ )
205
+ );
206
  }
207
  add_action( 'rest_api_init', 'shariff3uu_sanitize_api' );
208
 
457
 
458
  // Avoid errors if no services are given - instead use the default set of services.
459
  if ( empty( $GLOBALS['shariff3uu']['services'] ) ) {
460
+ $services = 'twitter|facebook|linkedin';
461
  } else {
462
  $services = $GLOBALS['shariff3uu']['services'];
463
  }
661
  $shariff3uu = $GLOBALS['shariff3uu'];
662
  // Remove headline in post.
663
  if ( isset( $shariff3uu['headline'] ) ) {
664
+ $content = str_replace( wp_strip_all_tags( $shariff3uu['headline'] ), ' ', $content );
665
  }
666
  // Add shariff before the excerpt, if option checked in the admin menu.
667
  if ( isset( $shariff3uu['add_before']['excerpt'] ) && 1 === $shariff3uu['add_before']['excerpt'] ) {
877
 
878
  // Avoids errors if no attributes are given - instead uses the old set of services to make it backward compatible.
879
  if ( empty( $shariff3uu['services'] ) ) {
880
+ $shariff3uu['services'] = 'twitter|facebook|linkedin|info';
881
  }
882
 
883
  // Uses the backend option for every option that is not set in the shorttag.
1106
  if ( isset( $atts['hidezero'] ) && 1 === $atts['hidezero'] ) {
1107
  $output .= ' data-hidezero="1"';
1108
  }
1109
+ // Add external api if entered, elseif test the subapi setting, elseif pretty permalinks are not activated fall back to manual rest route, else use the home url.
1110
  if ( isset( $shariff3uu['external_host'] ) && ! empty( $shariff3uu['external_host'] ) && isset( $shariff3uu['external_direct'] ) ) {
1111
  $output .= ' data-backendurl="' . $shariff3uu['external_host'] . '"';
1112
+ } elseif ( isset( $shariff3uu['subapi'] ) && 1 === $shariff3uu['subapi'] ) {
 
1113
  $output .= ' data-backendurl="' . strtok( get_bloginfo( 'wpurl' ), '?' ) . '/wp-json/shariff/v1/share_counts?"';
1114
+ } elseif ( ! get_option( 'permalink_structure' ) ) {
 
1115
  $output .= ' data-backendurl="?rest_route=/shariff/v1/share_counts&"';
1116
+ } else {
 
1117
  $output .= ' data-backendurl="' . rtrim( strtok( home_url(), '?' ), '/' ) . '/wp-json/shariff/v1/share_counts?"';
1118
  }
1119
  }
1301
  }
1302
 
1303
  // Output title, label and role.
1304
+ $output .= 'title="' . $button_title . '" aria-label="' . $button_title . '" role="button"';
1305
+ if ( 'rss' !== $service ) {
1306
+ $output .= ' rel="';
1307
+ if ( 'facebook' !== $service ) {
1308
+ $output .= 'noopener ';
1309
+ }
1310
+ $output .= 'nofollow"';
1311
  }
1312
+ $output .= ' class="shariff-link';
1313
 
1314
  // AMP?
1315
  if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
1583
  global $wpdb;
1584
  }
1585
  // Deletes transients.
1586
+ // phpcs:disable
1587
+ $wpdb->query( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_timeout_shariff%"' );
1588
+ $wpdb->query( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_shariff%"' );
1589
+ // phpcs:enable
1590
+ // Clears the object cache.
 
 
1591
  wp_cache_flush();
1592
  }
uninstall.php CHANGED
@@ -13,10 +13,8 @@ if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) {
13
  // Delete options (even old ones), remove cron job and clear cache.
14
  if ( is_multisite() ) {
15
  global $wpdb;
16
- $current_blog_id = get_current_blog_id();
17
- // @codingStandardsIgnoreStart
18
  $blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs}", ARRAY_A );
19
- // @codingStandardsIgnoreEnd
20
  if ( $blogs ) {
21
  foreach ( $blogs as $blog ) {
22
  // Switch to each blog.
@@ -72,15 +70,11 @@ function shariff3uu_purge_transients() {
72
  if ( ! isset( $wpdb ) ) {
73
  global $wpdb;
74
  }
75
-
76
  // Delete transients.
77
- // @codingStandardsIgnoreStart
78
- $sql = 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_timeout_shariff%"';
79
- $wpdb->query($sql);
80
- $sql = 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_shariff%"';
81
- $wpdb->query($sql);
82
- // @codingStandardsIgnoreEnd
83
-
84
  // Clear object cache.
85
  wp_cache_flush();
86
  }
13
  // Delete options (even old ones), remove cron job and clear cache.
14
  if ( is_multisite() ) {
15
  global $wpdb;
16
+ // phpcs:ignore
 
17
  $blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs}", ARRAY_A );
 
18
  if ( $blogs ) {
19
  foreach ( $blogs as $blog ) {
20
  // Switch to each blog.
70
  if ( ! isset( $wpdb ) ) {
71
  global $wpdb;
72
  }
 
73
  // Delete transients.
74
+ // phpcs:disable
75
+ $wpdb->query( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_timeout_shariff%"' );
76
+ $wpdb->query( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_shariff%"' );
77
+ // phpcs:enable
 
 
 
78
  // Clear object cache.
79
  wp_cache_flush();
80
  }
updates.php CHANGED
@@ -138,10 +138,8 @@ if ( isset( $GLOBALS['shariff3UU']['version'] ) && -1 === version_compare( $GLOB
138
  // Delete old cache directory and db entry.
139
  if ( is_multisite() ) {
140
  global $wpdb;
141
- $current_blog_id = get_current_blog_id();
142
- // @codingStandardsIgnoreStart
143
  $blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs}", ARRAY_A );
144
- // @codingStandardsIgnoreEnd
145
  if ( $blogs ) {
146
  foreach ( $blogs as $blog ) {
147
  // Switch to each blog.
@@ -177,10 +175,8 @@ function shariff_removeoldcachedir() {
177
  $cache_dir2 = $upload_dir['basedir'] . '/1970';
178
  shariff_removeoldfiles( $cache_dir );
179
  // Remove /1970/01 and /1970 if they are empty.
180
- // @codingStandardsIgnoreStart
181
- @rmdir( $cache_dir );
182
- @rmdir( $cache_dir2 );
183
- // @codingStandardsIgnoreEnd
184
  }
185
 
186
  /**
@@ -193,14 +189,10 @@ function shariff_removeoldfiles( $directory ) {
193
  if ( is_dir( $file ) ) {
194
  shariff_removeoldfiles( $file );
195
  } elseif ( substr( $file, -4 ) === '.dat' ) {
196
- // @codingStandardsIgnoreStart
197
- @unlink($file);
198
- // @codingStandardsIgnoreEnd
199
  }
200
  }
201
- // @codingStandardsIgnoreStart
202
- @rmdir( $directory );
203
- // @codingStandardsIgnoreEnd
204
  }
205
 
206
  /**
@@ -236,10 +228,8 @@ if ( isset( $GLOBALS['shariff3UU']['version'] ) && -1 === version_compare( $GLOB
236
 
237
  // Delete user meta entry shariff3UU_ignore_notice to display update message again after an update (check for multisite).
238
  if ( is_multisite() ) {
239
- $current_blog_id = get_current_blog_id();
240
- // @codingStandardsIgnoreStart
241
  $blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs}", ARRAY_A );
242
- // @codingStandardsIgnoreEnd
243
  if ( $blogs ) {
244
  foreach ( $blogs as $blog ) {
245
  // Switch to each blog.
@@ -247,11 +237,9 @@ if ( isset( $GLOBALS['shariff3UU']['version'] ) && -1 === version_compare( $GLOB
247
  // Delete user meta entry shariff3UU_ignore_notice.
248
  $users = get_users( 'role=administrator' );
249
  foreach ( $users as $user ) {
250
- // @codingStandardsIgnoreStart
251
  if ( get_user_meta( $user->ID, 'shariff3UU_ignore_notice', true ) ) {
252
  delete_user_meta( $user->ID, 'shariff3UU_ignore_notice' );
253
  }
254
- // @codingStandardsIgnoreEnd
255
  }
256
  // Switch back to main.
257
  restore_current_blog();
@@ -261,11 +249,9 @@ if ( isset( $GLOBALS['shariff3UU']['version'] ) && -1 === version_compare( $GLOB
261
  // Delete user meta entry shariff3UU_ignore_notice.
262
  $users = get_users( 'role=administrator' );
263
  foreach ( $users as $user ) {
264
- // @codingStandardsIgnoreStart
265
  if ( get_user_meta( $user->ID, 'shariff3UU_ignore_notice', true ) ) {
266
  delete_user_meta( $user->ID, 'shariff3UU_ignore_notice' );
267
  }
268
- // @codingStandardsIgnoreEnd
269
  }
270
  }
271
  }
@@ -311,10 +297,8 @@ if ( isset( $GLOBALS['shariff3UU']['version'] ) && -1 === version_compare( $GLOB
311
  // Purge transients (check for multisite).
312
  if ( is_multisite() ) {
313
  global $wpdb;
314
- $current_blog_id = get_current_blog_id();
315
- // @codingStandardsIgnoreStart
316
  $blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs}", ARRAY_A );
317
- // @codingStandardsIgnoreEnd
318
  if ( $blogs ) {
319
  foreach ( $blogs as $blog ) {
320
  // Switch to each blog.
@@ -338,15 +322,11 @@ function shariff3uu_purge_transients() {
338
  if ( ! isset( $wpdb ) ) {
339
  global $wpdb;
340
  }
341
-
342
  // Delete transients.
343
- // @codingStandardsIgnoreStart
344
- $sql = 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_timeout_shariff%"';
345
- $wpdb->query($sql);
346
- $sql = 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_shariff%"';
347
- $wpdb->query($sql);
348
- // @codingStandardsIgnoreEnd
349
-
350
  // Clear object cache.
351
  wp_cache_flush();
352
  }
138
  // Delete old cache directory and db entry.
139
  if ( is_multisite() ) {
140
  global $wpdb;
141
+ // phpcs:ignore
 
142
  $blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs}", ARRAY_A );
 
143
  if ( $blogs ) {
144
  foreach ( $blogs as $blog ) {
145
  // Switch to each blog.
175
  $cache_dir2 = $upload_dir['basedir'] . '/1970';
176
  shariff_removeoldfiles( $cache_dir );
177
  // Remove /1970/01 and /1970 if they are empty.
178
+ rmdir( $cache_dir );
179
+ rmdir( $cache_dir2 );
 
 
180
  }
181
 
182
  /**
189
  if ( is_dir( $file ) ) {
190
  shariff_removeoldfiles( $file );
191
  } elseif ( substr( $file, -4 ) === '.dat' ) {
192
+ unlink( $file );
 
 
193
  }
194
  }
195
+ rmdir( $directory );
 
 
196
  }
197
 
198
  /**
228
 
229
  // Delete user meta entry shariff3UU_ignore_notice to display update message again after an update (check for multisite).
230
  if ( is_multisite() ) {
231
+ // phpcs:ignore
 
232
  $blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs}", ARRAY_A );
 
233
  if ( $blogs ) {
234
  foreach ( $blogs as $blog ) {
235
  // Switch to each blog.
237
  // Delete user meta entry shariff3UU_ignore_notice.
238
  $users = get_users( 'role=administrator' );
239
  foreach ( $users as $user ) {
 
240
  if ( get_user_meta( $user->ID, 'shariff3UU_ignore_notice', true ) ) {
241
  delete_user_meta( $user->ID, 'shariff3UU_ignore_notice' );
242
  }
 
243
  }
244
  // Switch back to main.
245
  restore_current_blog();
249
  // Delete user meta entry shariff3UU_ignore_notice.
250
  $users = get_users( 'role=administrator' );
251
  foreach ( $users as $user ) {
 
252
  if ( get_user_meta( $user->ID, 'shariff3UU_ignore_notice', true ) ) {
253
  delete_user_meta( $user->ID, 'shariff3UU_ignore_notice' );
254
  }
 
255
  }
256
  }
257
  }
297
  // Purge transients (check for multisite).
298
  if ( is_multisite() ) {
299
  global $wpdb;
300
+ // phpcs:ignore
 
301
  $blogs = $wpdb->get_results( "SELECT blog_id FROM {$wpdb->blogs}", ARRAY_A );
 
302
  if ( $blogs ) {
303
  foreach ( $blogs as $blog ) {
304
  // Switch to each blog.
322
  if ( ! isset( $wpdb ) ) {
323
  global $wpdb;
324
  }
 
325
  // Delete transients.
326
+ // phpcs:disable
327
+ $wpdb->query( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_timeout_shariff%"' );
328
+ $wpdb->query( 'DELETE FROM ' . $wpdb->options . ' WHERE option_name LIKE "_transient_shariff%"' );
329
+ // phpcs:enable
 
 
 
330
  // Clear object cache.
331
  wp_cache_flush();
332
  }