Shariff Wrapper - Version 4.4.3

Version Description

  • new support for additional manual AMP integrations
  • fixed a PHP error on certain server configurations
  • new support for the print button on AMP pages
  • fixed a markup typo
  • minor css improvements
Download this release

Release Info

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

Code changes from version 4.4.2 to 4.4.3

changelog.txt CHANGED
@@ -2,6 +2,13 @@
2
 
3
  == Changelog ==
4
 
 
 
 
 
 
 
 
5
  = 4.4.2 =
6
  - new support for the "AMP for WP" plugin by Ahmed and Mohammed Kaludi
7
  - improved support for the "AMP for WordPress" plugin by Automattic
2
 
3
  == Changelog ==
4
 
5
+ = 4.4.3 =
6
+ - new support for additional manual AMP integrations
7
+ - new support for the print button on AMP pages
8
+ - fixed a php error on certain server configurations
9
+ - fixed a markup typo
10
+ - minor css improvements
11
+
12
  = 4.4.2 =
13
  - new support for the "AMP for WP" plugin by Ahmed and Mohammed Kaludi
14
  - improved support for the "AMP for WordPress" plugin by Automattic
css/shariff.css CHANGED
@@ -31,6 +31,8 @@
31
  text-decoration: none;
32
  background-image: none !important;
33
  text-align: left;
 
 
34
  }
35
  .shariff a:hover {
36
  color: #fff;
@@ -68,6 +70,12 @@
68
  .shariff-button::before {
69
  content: none !important;
70
  }
 
 
 
 
 
 
71
  /* theme default */
72
  .shariff .theme-default a {
73
  color: #fff !important;
@@ -151,47 +159,47 @@
151
  fill: #fff;
152
  }
153
  /* buttonsize small */
154
- .shariff .buttonsize-small li {
155
  height: 25px !important;
156
  }
157
- .shariff .buttonsize-small a {
158
  height: 25px !important;
159
  }
160
- .shariff .buttonsize-small.orientation-vertical li {
161
  width: 115px;
162
  }
163
- .shariff .buttonsize-small .shariff-icon svg {
164
  width: 22px;
165
  height: 15px;
166
  padding: 5px 1px;
167
  }
168
- .shariff .buttonsize-small .shariff-text,
169
- .shariff .buttonsize-small .shariff-count {
170
  font-size: 11px;
171
  line-height: 25px;
172
  padding: 0 5px;
173
  height: 23px;
174
  }
175
- .shariff .buttonsize-small .shariff-text {
176
  padding-left: 1px !important;
177
  }
178
- .shariff .buttonsize-small.theme-round li {
179
  width: 25px !important;
180
  }
181
- .shariff .buttonsize-small.theme-round a {
182
  width: 25px !important;
183
  }
184
- .shariff .buttonsize-small.theme-round .shariff-count {
185
  padding: 0 !important;
186
  height: 25px !important;
187
  }
188
- .shariff .theme-round.buttonsize-small.orientation-horizontal li {
189
  margin: 5px 7px
190
  }
191
- .shariff .theme-round.buttonsize-small.orientation-horizontal li:first-child {
192
  margin-left: 5px
193
  }
194
- .shariff .theme-round.buttonsize-small.orientation-horizontal li:last-child {
195
  margin-right: 5px
196
  }
197
  /* buttonsize large */
@@ -219,8 +227,9 @@
219
  .shariff .buttonsize-large .shariff-text {
220
  padding-left: 1px !important;
221
  }
222
- .shariff .buttonsize-large.theme-round li {
223
  width: 45px !important;
 
224
  }
225
  .shariff .buttonsize-large.theme-round a {
226
  width: 45px !important;
@@ -230,7 +239,6 @@
230
  height: 45px !important;
231
  }
232
  /* orientation vertical */
233
- /*noinspection CssUnusedSymbol*/
234
  .shariff .orientation-vertical {
235
  flex-direction: column;
236
  }
@@ -271,11 +279,8 @@
271
  width: 100% !important;
272
  }
273
  /* widget */
274
- .widget .shariff .theme-default li,
275
- .widget .shariff .theme-color li,
276
- .widget .shariff .theme-grey li,
277
- .widget .shariff .theme-round li {
278
- border: medium none;
279
  font-weight: 400;
280
  }
281
  .widget .shariff .theme-default a,
@@ -337,22 +342,22 @@
337
  }
338
  /* media queries */
339
  @media only screen and (max-width: 360px) {
340
- .shariff .orientation-horizontal li { width: 35px; }
341
- .shariff .orientation-horizontal.buttonsize-small li { width: 25px; }
342
- .shariff .orientation-horizontal.buttonsize-large li { width: 45px; }
343
- .shariff .orientation-horizontal .shariff-icon svg { display: block; margin: auto; }
344
- .shariff .orientation-horizontal .shariff-count { display: none; }
 
345
  }
346
  @media only screen and (min-width: 361px) {
347
- .shariff .orientation-horizontal li { width: 80px; }
348
- .shariff .orientation-horizontal li .shariff-text { display: block; }
349
- .shariff .orientation-horizontal li .shariff-count { display: block; }
350
  }
351
  @media only screen and (min-width: 768px) {
352
- .shariff .orientation-horizontal li { width: 130px; }
353
- .shariff .orientation-horizontal.buttonsize-small li { width: 105px; }
354
- .shariff .orientation-horizontal.buttonsize-large li { width: 155px; }
355
- .shariff .orientation-horizontal li .shariff-text { display: inline; }
356
  }
357
  @media only screen and (min-device-width: 1025px) {
358
  /*noinspection CssUnusedSymbol*/
31
  text-decoration: none;
32
  background-image: none !important;
33
  text-align: left;
34
+ box-shadow: none;
35
+ cursor: pointer;
36
  }
37
  .shariff a:hover {
38
  color: #fff;
70
  .shariff-button::before {
71
  content: none !important;
72
  }
73
+ .shariff .shariff-buttons .shariff-text-white {
74
+ color: #fff;
75
+ }
76
+ .shariff .shariff-buttons .shariff-hidezero {
77
+ opacity: 0;
78
+ }
79
  /* theme default */
80
  .shariff .theme-default a {
81
  color: #fff !important;
159
  fill: #fff;
160
  }
161
  /* buttonsize small */
162
+ .shariff .shariff-buttons.buttonsize-small li {
163
  height: 25px !important;
164
  }
165
+ .shariff .shariff-buttons.buttonsize-small a {
166
  height: 25px !important;
167
  }
168
+ .shariff .shariff-buttons.buttonsize-small.orientation-vertical li {
169
  width: 115px;
170
  }
171
+ .shariff .shariff-buttons.buttonsize-small .shariff-icon svg {
172
  width: 22px;
173
  height: 15px;
174
  padding: 5px 1px;
175
  }
176
+ .shariff .shariff-buttons.buttonsize-small .shariff-text,
177
+ .shariff .shariff-buttons.buttonsize-small .shariff-count {
178
  font-size: 11px;
179
  line-height: 25px;
180
  padding: 0 5px;
181
  height: 23px;
182
  }
183
+ .shariff .shariff-buttons.buttonsize-small .shariff-text {
184
  padding-left: 1px !important;
185
  }
186
+ .shariff .shariff-buttons.buttonsize-small.theme-round li {
187
  width: 25px !important;
188
  }
189
+ .shariff .shariff-buttons.buttonsize-small.theme-round a {
190
  width: 25px !important;
191
  }
192
+ .shariff .shariff-buttons.buttonsize-small.theme-round .shariff-count {
193
  padding: 0 !important;
194
  height: 25px !important;
195
  }
196
+ .shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li {
197
  margin: 5px 7px
198
  }
199
+ .shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li:first-child {
200
  margin-left: 5px
201
  }
202
+ .shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li:last-child {
203
  margin-right: 5px
204
  }
205
  /* buttonsize large */
227
  .shariff .buttonsize-large .shariff-text {
228
  padding-left: 1px !important;
229
  }
230
+ .shariff .shariff-buttons.buttonsize-large.theme-round li {
231
  width: 45px !important;
232
+ height: 45px !important;
233
  }
234
  .shariff .buttonsize-large.theme-round a {
235
  width: 45px !important;
239
  height: 45px !important;
240
  }
241
  /* orientation vertical */
 
242
  .shariff .orientation-vertical {
243
  flex-direction: column;
244
  }
279
  width: 100% !important;
280
  }
281
  /* widget */
282
+ .widget .shariff li {
283
+ border: none;
 
 
 
284
  font-weight: 400;
285
  }
286
  .widget .shariff .theme-default a,
342
  }
343
  /* media queries */
344
  @media only screen and (max-width: 360px) {
345
+ .shariff .shariff-buttons li { width: 35px; }
346
+ .shariff .shariff-buttons.buttonsize-small li { width: 25px; }
347
+ .shariff .shariff-buttons.buttonsize-large li { width: 45px; }
348
+ .shariff .shariff-buttons .shariff-icon svg { display: block; margin: auto; }
349
+ .shariff .shariff-buttons .shariff-count { display: none; }
350
+ .shariff .shariff-buttons .shariff-text { display: none; }
351
  }
352
  @media only screen and (min-width: 361px) {
353
+ .shariff .shariff-buttons li { width: 90px; }
354
+ .shariff .shariff-buttons.buttonsize-large li { width: 130px; }
 
355
  }
356
  @media only screen and (min-width: 768px) {
357
+ .shariff .shariff-buttons li { width: 130px; }
358
+ .shariff .shariff-buttons.buttonsize-small li { width: 105px; }
359
+ .shariff .shariff-buttons.buttonsize-large li { width: 155px; }
360
+ .shariff .shariff-buttons li .shariff-text { display: inline; }
361
  }
362
  @media only screen and (min-device-width: 1025px) {
363
  /*noinspection CssUnusedSymbol*/
css/shariff.min.css CHANGED
@@ -1 +1 @@
1
- .shariff{display:block !important;clear:both}.shariff ul{display:flex;flex-direction:row;flex-flow:row wrap;padding:0 !important;margin:0 !important}.shariff li{height:35px;box-sizing:border-box;list-style:none !important;overflow:hidden !important;margin:5px !important;padding:0 !important;text-indent:0 !important;border-left:0 none !important}.shariff a{position:relative;display:block !important;height:35px;padding:0;margin:0;box-sizing:border-box;border:0;text-decoration:none;background-image:none !important;text-align:left}.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 .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 .buttonsize-small li{height:25px !important}.shariff .buttonsize-small a{height:25px !important}.shariff .buttonsize-small.orientation-vertical li{width:115px}.shariff .buttonsize-small .shariff-icon svg{width:22px;height:15px;padding:5px 1px}.shariff .buttonsize-small .shariff-text,.shariff .buttonsize-small .shariff-count{font-size:11px;line-height:25px;padding:0 5px;height:23px}.shariff .buttonsize-small .shariff-text{padding-left:1px !important}.shariff .buttonsize-small.theme-round li{width:25px !important}.shariff .buttonsize-small.theme-round a{width:25px !important}.shariff .buttonsize-small.theme-round .shariff-count{padding:0 !important;height:25px !important}.shariff .theme-round.buttonsize-small.orientation-horizontal li{margin:5px 7px}.shariff .theme-round.buttonsize-small.orientation-horizontal li:first-child{margin-left:5px}.shariff .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 .buttonsize-large.theme-round li{width:45px !important}.shariff .buttonsize-large.theme-round a{width:45px !important}.shariff .buttonsize-large.theme-round .shariff-count{padding:0 !important;height:45px !important}.shariff .orientation-vertical{flex-direction:column}.shariff .orientation-vertical li{width:135px}.shariff.shariff-align-flex-start ul{justify-content:flex-start;align-items:flex-start}.shariff.shariff-align-center ul{justify-content:center;align-items:center}.shariff.shariff-align-flex-end ul{justify-content:flex-end;align-items:flex-end}.widget .shariff.shariff-widget-align-flex-start ul{justify-content:flex-start;align-items:flex-start}.widget .shariff.shariff-widget-align-center ul{justify-content:center;align-items:center}.widget .shariff.shariff-widget-align-flex-end ul{justify-content:flex-end;align-items:flex-end}.shariff.shariff-buttonstretch li{flex:1 0 auto !important}.shariff.shariff-buttonstretch .orientation-vertical li{width:100% !important}.widget .shariff .theme-default li,.widget .shariff .theme-color li,.widget .shariff .theme-grey li,.widget .shariff .theme-round li{border:medium none;font-weight:400}.widget .shariff .theme-default a,.widget .shariff .theme-color a,.widget .shariff .theme-grey a,.widget .shariff .theme-round a{color:#fff;display:block;font-weight:400}.widget .shariff .theme-default a:hover,.widget .shariff .theme-color a:hover,.widget .shariff .theme-grey a:hover,.widget .shariff .theme-round a:hover{color:#fff;font-weight:400}.shariff-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 .orientation-horizontal li{width:35px}.shariff .orientation-horizontal.buttonsize-small li{width:25px}.shariff .orientation-horizontal.buttonsize-large li{width:45px}.shariff .orientation-horizontal .shariff-icon svg{display:block;margin:auto}.shariff .orientation-horizontal .shariff-count{display:none}}@media only screen and (min-width:361px){.shariff .orientation-horizontal li{width:80px}.shariff .orientation-horizontal li .shariff-text{display:block}.shariff .orientation-horizontal li .shariff-count{display:block}}@media only screen and (min-width:768px){.shariff .orientation-horizontal li{width:130px}.shariff .orientation-horizontal.buttonsize-small li{width:105px}.shariff .orientation-horizontal.buttonsize-large li{width:155px}.shariff .orientation-horizontal li .shariff-text{display:inline}}@media only screen and (min-device-width:1025px){.shariff .shariff-mobile{display:none !important}}
1
+ .shariff{display:block !important;clear:both}.shariff ul{display:flex;flex-direction:row;flex-flow:row wrap;padding:0 !important;margin:0 !important}.shariff li{height:35px;box-sizing:border-box;list-style:none !important;overflow:hidden !important;margin:5px !important;padding:0 !important;text-indent:0 !important;border-left:0 none !important}.shariff a{position:relative;display:block !important;height:35px;padding:0;margin:0;box-sizing:border-box;border:0;text-decoration:none;background-image:none !important;text-align:left;box-shadow:none;cursor:pointer}.shariff a:hover{color:#fff;background-color:inherit !important;text-decoration:none !important}.shariff a:visited{color:inherit}.shariff .shariff-count{position:absolute;height:33px;top:0;right:0;margin:1px;padding:0 8px;background-color:rgba(255,255,255,0.5)}.shariff .shariff-count,.shariff .shariff-text{font-family:Arial,Helvetica,sans-serif;font-size:12px;line-height:36px;vertical-align:top}.shariff .shariff-text{padding-left:3px}.shariff .shariff-icon svg{width:32px;height:20px;padding:7px 1px;box-sizing:content-box}.shariff-button::before{content:none !important}.shariff .shariff-buttons .shariff-text-white{color:#fff}.shariff .shariff-buttons .shariff-hidezero{opacity:0}.shariff .theme-default a{color:#fff !important}.shariff .theme-default .shariff-icon svg path{fill:#fff}.shariff .theme-color .shariff-count{background-color:transparent !important;color:#fff !important}.shariff .theme-color .shariff-icon svg path{fill:#fff}.shariff .theme-grey a{background-color:#b0b0b0 !important}.shariff .theme-grey a:hover{background-color:inherit !important}.shariff .theme-grey .shariff-count{background-color:transparent;color:#fff !important}.shariff .theme-grey .shariff-icon svg path{fill:#fff}.shariff .theme-white a{background-color:#fff !important;border:1px solid #ddd}.shariff .theme-white a:hover{background-color:#eee !important;color:inherit}.shariff .theme-white svg{fill:currentColor}.shariff .theme-white .shariff-count{background-color:transparent;margin:0}.shariff .shariff-buttons.theme-round li{width:35px !important;height:35px;border-radius:50%;margin:5px}.shariff .theme-round a{position:relative;height:35px;border-radius:50%}.shariff .theme-round .shariff-icon svg{display:block;margin:auto;padding:8px 1px}.shariff .theme-round .shariff-text{display:block}.shariff .theme-round .shariff-count{display:inline;padding:0;right:0;left:0;top:0;background-color:transparent;color:transparent !important;text-align:center}.shariff .theme-round .shariff-count:hover{background-color:inherit !important;color:#fff !important}.shariff .theme-round .shariff-icon svg path{fill:#fff}.shariff .shariff-buttons.buttonsize-small li{height:25px !important}.shariff .shariff-buttons.buttonsize-small a{height:25px !important}.shariff .shariff-buttons.buttonsize-small.orientation-vertical li{width:115px}.shariff .shariff-buttons.buttonsize-small .shariff-icon svg{width:22px;height:15px;padding:5px 1px}.shariff .shariff-buttons.buttonsize-small .shariff-text,.shariff .shariff-buttons.buttonsize-small .shariff-count{font-size:11px;line-height:25px;padding:0 5px;height:23px}.shariff .shariff-buttons.buttonsize-small .shariff-text{padding-left:1px !important}.shariff .shariff-buttons.buttonsize-small.theme-round li{width:25px !important}.shariff .shariff-buttons.buttonsize-small.theme-round a{width:25px !important}.shariff .shariff-buttons.buttonsize-small.theme-round .shariff-count{padding:0 !important;height:25px !important}.shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li{margin:5px 7px}.shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li:first-child{margin-left:5px}.shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li:last-child{margin-right:5px}.shariff .buttonsize-large li{height:45px !important}.shariff .buttonsize-large a{height:45px !important}.shariff .buttonsize-large.orientation-vertical li{width:155px}.shariff .buttonsize-large .shariff-icon svg{width:40px;height:28px;padding:9px 2px}.shariff .buttonsize-large .shariff-text,.shariff .buttonsize-large .shariff-count{font-size:14px;line-height:45px;padding:0 10px;height:43px}.shariff .buttonsize-large .shariff-text{padding-left:1px !important}.shariff .shariff-buttons.buttonsize-large.theme-round li{width:45px !important;height:45px !important}.shariff .buttonsize-large.theme-round a{width:45px !important}.shariff .buttonsize-large.theme-round .shariff-count{padding:0 !important;height:45px !important}.shariff .orientation-vertical{flex-direction:column}.shariff .orientation-vertical li{width:135px}.shariff.shariff-align-flex-start ul{justify-content:flex-start;align-items:flex-start}.shariff.shariff-align-center ul{justify-content:center;align-items:center}.shariff.shariff-align-flex-end ul{justify-content:flex-end;align-items:flex-end}.widget .shariff.shariff-widget-align-flex-start ul{justify-content:flex-start;align-items:flex-start}.widget .shariff.shariff-widget-align-center ul{justify-content:center;align-items:center}.widget .shariff.shariff-widget-align-flex-end ul{justify-content:flex-end;align-items:flex-end}.shariff.shariff-buttonstretch li{flex:1 0 auto !important}.shariff.shariff-buttonstretch .orientation-vertical li{width:100% !important}.widget .shariff li{border:0;font-weight:400}.widget .shariff .theme-default a,.widget .shariff .theme-color a,.widget .shariff .theme-grey a,.widget .shariff .theme-round a{color:#fff;display:block;font-weight:400}.widget .shariff .theme-default a:hover,.widget .shariff .theme-color a:hover,.widget .shariff .theme-grey a:hover,.widget .shariff .theme-round a:hover{color:#fff;font-weight:400}.shariff-warning{background-color:red;color:#fff;font-size:20px;font-weight:700;padding:10px;text-align:center;margin:0 auto;line-height:1.5}.shariff .info a{border:1px solid #ddd;width:35px}.shariff .shariff-button.info{width:35px;flex:0 0 auto !important}.shariff .theme-default .shariff-button.shariff-nocustomcolor.info svg path{fill:#999}.shariff .theme-round .shariff-button.shariff-nocustomcolor.info svg path{fill:#999}.shariff .buttonsize-small .shariff-button.info{width:25px}.shariff .buttonsize-small .info a{width:25px}.shariff .buttonsize-large .shariff-button.info{width:45px}.shariff .buttonsize-large .info a{width:45px}.shariff .info .shariff-icon svg{display:block;margin:auto}@media only screen and (max-width:360px){.shariff .shariff-buttons li{width:35px}.shariff .shariff-buttons.buttonsize-small li{width:25px}.shariff .shariff-buttons.buttonsize-large li{width:45px}.shariff .shariff-buttons .shariff-icon svg{display:block;margin:auto}.shariff .shariff-buttons .shariff-count{display:none}.shariff .shariff-buttons .shariff-text{display:none}}@media only screen and (min-width:361px){.shariff .shariff-buttons li{width:90px}.shariff .shariff-buttons.buttonsize-large li{width:130px}}@media only screen and (min-width:768px){.shariff .shariff-buttons li{width:130px}.shariff .shariff-buttons.buttonsize-small li{width:105px}.shariff .shariff-buttons.buttonsize-large li{width:155px}.shariff .shariff-buttons li .shariff-text{display:inline}}@media only screen and (min-device-width:1025px){.shariff .shariff-mobile{display:none !important}}
readme.txt CHANGED
@@ -1,10 +1,10 @@
1
  === Shariff Wrapper ===
2
  Contributors: starguide, 3UU
3
  Tags: Shariff, GDPR, DSGVO, share buttons, sharing
4
- Requires at least: 4.9
5
  Requires PHP: 5.6
6
  Tested up to: 4.9
7
- Stable tag: 4.4.2
8
  License: MIT
9
  License URI: http://opensource.org/licenses/mit
10
 
@@ -168,6 +168,13 @@ These are bugs or unexpected glitches that we know of, but that do not have an i
168
 
169
  == Changelog ==
170
 
 
 
 
 
 
 
 
171
  = 4.4.2 =
172
  - new support for the "AMP for WP" plugin by Ahmed and Mohammed Kaludi
173
  - improved support for the "AMP for WordPress" plugin by Automattic
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.4.3
8
  License: MIT
9
  License URI: http://opensource.org/licenses/mit
10
 
168
 
169
  == Changelog ==
170
 
171
+ = 4.4.3 =
172
+ - new support for additional manual AMP integrations
173
+ - fixed a PHP error on certain server configurations
174
+ - new support for the print button on AMP pages
175
+ - fixed a markup typo
176
+ - minor css improvements
177
+
178
  = 4.4.2 =
179
  - new support for the "AMP for WP" plugin by Ahmed and Mohammed Kaludi
180
  - improved support for the "AMP for WordPress" plugin by Automattic
services/shariff-twitter.php CHANGED
@@ -77,7 +77,7 @@ if ( isset( $frontend ) && 1 === $frontend ) {
77
  } elseif ( isset( $backend ) && 1 === $backend ) {
78
  // Fetch counts.
79
  if ( isset( $shariff3uu['newsharecount'] ) && 1 === $shariff3uu['newsharecount'] ) {
80
- $twitter = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'http://public.newsharecounts.com/count.json?url=' . $post_url ) ) );
81
  } else {
82
  $twitter = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'http://opensharecount.com/count.json?url=' . $post_url ) ) );
83
  }
77
  } elseif ( isset( $backend ) && 1 === $backend ) {
78
  // Fetch counts.
79
  if ( isset( $shariff3uu['newsharecount'] ) && 1 === $shariff3uu['newsharecount'] ) {
80
+ $twitter = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://public.newsharecounts.com/count.json?url=' . $post_url ) ) );
81
  } else {
82
  $twitter = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'http://opensharecount.com/count.json?url=' . $post_url ) ) );
83
  }
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.4.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.4.2';
37
 
38
  // Get options.
39
  $shariff3uu = $GLOBALS['shariff3uu'];
@@ -224,7 +224,7 @@ function shariff3uu_share_counts( WP_REST_Request $request ) {
224
  }
225
 
226
  // Encode the shareurl.
227
- $post_url = rawurlencode( esc_url( $url ) );
228
  $post_url_raw = $url;
229
 
230
  // Set transient name.
@@ -701,16 +701,20 @@ add_action( 'bbp_theme_after_reply_content', 'shariff3uu_bbp_add_shariff_after_r
701
  * We need to strip out all !important in order to pass AMP test.
702
  */
703
  function shariff3uu_amp_css() {
 
 
 
704
  ob_start();
705
- include plugins_url( '/css/shariff.min.css', __FILE__ );
706
  $shariff_css = ob_get_clean();
707
  if ( false !== $shariff_css ) {
708
  echo esc_html( str_replace( '!important', '', $shariff_css ) );
709
  } else {
710
- include plugins_url( '/css/shariff.min.css', __FILE__ );
 
 
 
711
  }
712
- // Hide print button on AMP pages.
713
- echo '.shariff .printer { display: none };';
714
  }
715
  add_action( 'amp_post_template_css', 'shariff3uu_amp_css' );
716
 
@@ -727,6 +731,11 @@ add_shortcode( 'shariff', 'shariff3uu_render' );
727
  function shariff3uu_render( $atts ) {
728
  // Get options.
729
  $shariff3uu = $GLOBALS['shariff3uu'];
 
 
 
 
 
730
 
731
  // Stops all further actions if we are on an admin page.
732
  if ( is_admin() ) {
@@ -814,6 +823,11 @@ function shariff3uu_render( $atts ) {
814
  $atts['headline'] = wp_kses( $atts['headline'], $GLOBALS['allowed_tags'] );
815
  }
816
 
 
 
 
 
 
817
  // Enqueues the stylesheet (loading it here makes sure that it is only loaded on pages that actually contain shariff buttons).
818
  // If SCRIPT_DEBUG is set to true, the non minified version will be loaded.
819
  if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG === true ) {
@@ -940,8 +954,9 @@ function shariff3uu_render( $atts ) {
940
  $output .= ' shariff-buttonstretch';
941
  }
942
  $output .= '"';
 
943
  // Hides buttons until css is loaded.
944
- if ( array_key_exists( 'hideuntilcss', $atts ) && 1 === $atts['hideuntilcss'] ) {
945
  $output .= ' style="display:none"';
946
  }
947
  // Adds information for share count request.
@@ -1011,7 +1026,7 @@ function shariff3uu_render( $atts ) {
1011
  $backend_available = '';
1012
  $mobile_only = '';
1013
  $button_url = '';
1014
- $no_custom_color = '';
1015
 
1016
  // Explodes services.
1017
  $service_array = explode( '|', $atts['services'] );
@@ -1052,36 +1067,63 @@ function shariff3uu_render( $atts ) {
1052
  // Includes service file.
1053
  include $path_service_file;
1054
 
1055
- // Overwrites service specific colors, if custom colors are set.
1056
- if ( array_key_exists( 'maincolor', $atts ) ) {
1057
- $main_color = $atts['maincolor'];
1058
- } else {
1059
- $no_custom_color = 'shariff-nocustomcolor ';
1060
- }
1061
- if ( array_key_exists( 'secondarycolor', $atts ) ) {
1062
- $secondary_color = $atts['secondarycolor'];
1063
- }
1064
-
1065
- // Sets the border radius for the round theme.
1066
- if ( array_key_exists( 'borderradius', $atts ) && array_key_exists( 'theme', $atts ) && 'round' === $atts['theme'] ) {
1067
- $border_radius = '; border-radius:' . $atts['borderradius'] . '%';
1068
- } else {
1069
- $border_radius = '';
1070
- }
1071
-
1072
  // Info button for default theme.
1073
  if ( ! array_key_exists( 'maincolor', $atts ) && 'info' === $service && ( ( array_key_exists( 'theme', $atts ) && 'default' === $atts['theme'] || ( array_key_exists( 'theme', $atts ) && 'round' === $atts['theme'] ) ) || ! array_key_exists( 'theme', $atts ) ) ) {
1074
  $main_color = '#fff';
1075
  $secondary_color = '#eee';
1076
  }
1077
 
1078
- // Start li.
1079
- $output .= '<li class="shariff-button ' . $no_custom_color . $service;
 
 
 
 
 
 
1080
  // Mobile only.
1081
  if ( 1 === $mobile_only ) {
1082
  $output .= ' shariff-mobile';
1083
  }
1084
- $output .= '" style="background-color:' . $secondary_color . $border_radius . '">';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1085
 
1086
  // Uses default button share text, if $button_text_array is empty.
1087
  if ( empty( $button_text_array ) ) {
@@ -1105,51 +1147,182 @@ function shariff3uu_render( $atts ) {
1105
  // Resets $button_text_array.
1106
  $button_text_array = '';
1107
 
1108
- // Build the actual button.
1109
- $output .= '<a href="' . $button_url . '" title="' . $button_title . '" aria-label="' . $button_title . '" role="button" rel="';
 
 
 
 
 
 
 
 
 
 
 
 
1110
  if ( 'facebook' !== $service ) {
1111
  $output .= 'noopener ';
1112
  }
1113
- $output .= 'nofollow" class="shariff-link" ';
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1114
  // Same window?
1115
  if ( ! isset( $same_window ) || isset( $same_window ) && 1 !== $same_window ) {
1116
- $output .= 'target="_blank" ';
1117
  }
1118
- $output .= 'style="background-color:' . $main_color . $border_radius;
1119
- // Theme white?
1120
- if ( isset( $atts['theme'] ) && 'white' === $atts['theme'] ) {
1121
- $output .= '; color:' . $main_color;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1122
  } else {
1123
- $output .= '; color:#fff';
1124
- }
1125
- $output .= '">';
1126
- $output .= '<span class="shariff-icon"';
1127
- // Theme white?
1128
- if ( isset( $atts['theme'] ) && 'white' === $atts['theme'] ) {
1129
- $output .= ' style="fill:' . $main_color . '"';
 
 
1130
  }
1131
- $output .= '>' . $svg_icon . '</span>';
1132
- $output .= '<span class="shariff-text"';
1133
- if ( isset( $atts['theme'] ) && 'white' === $atts['theme'] ) {
1134
- $output .= ' style="color:' . $main_color;
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1135
  }
1136
  $output .= '">' . $button_text . '</span>&nbsp;';
 
1137
  // Share counts?
1138
  if ( array_key_exists( 'sharecounts', $atts ) && 1 === $atts['sharecounts'] && 1 === $backend_available && ! isset( $shariff3uu['disable'][ $service ] ) ) {
1139
- $output .= '<span class="shariff-count" data-service="' . $service . '" style="color:' . $main_color;
1140
- if ( true === array_key_exists( $service, $share_counts ) && null !== $share_counts[ $service ] && '-1' !== $share_counts[ $service ] && ( ! isset( $atts['hidezero'] ) || ( isset( $atts['hidezero'] ) && '-1' !== $atts['hidezero'] ) || ( isset( $atts['hidezero'] ) && 1 === $atts['hidezero'] && $share_counts[ $service ] > 0 ) ) ) {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1141
  $output .= '"> ' . $share_counts[ $service ];
1142
  } else {
1143
- $output .= ';opacity:0">';
1144
  }
1145
  $output .= '</span>&nbsp;';
1146
  }
1147
  $output .= '</a>';
1148
  $output .= '</li>';
 
1149
  // Adds service to backend service, if available.
1150
  if ( 1 === $backend_available && ! isset( $shariff3uu['disable'][ $service ] ) ) {
1151
  $backend_service_array[] = $service;
1152
  }
 
1153
  // Resets the $backend, $mobile_only and $same_window variables.
1154
  $backend_available = '';
1155
  $mobile_only = '';
@@ -1172,6 +1345,14 @@ function shariff3uu_render( $atts ) {
1172
  $output .= '</div>';
1173
  }
1174
 
 
 
 
 
 
 
 
 
1175
  // Displays a warning to admins if flattr is set, but no flattr username was provided.
1176
  if ( 1 === $flattr_error && current_user_can( 'manage_options' ) ) {
1177
  $output .= '<div class="shariff-warning">' . __( 'Username for Flattr is missing!', 'shariff' ) . '</div>';
3
  * Plugin Name: Shariff Wrapper
4
  * Plugin URI: https://wordpress.org/plugins-wp/shariff/
5
  * Description: Shariff provides share buttons that respect the privacy of your visitors and follow the General Data Protection Regulation (GDPR).
6
+ * Version: 4.4.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.4.3';
37
 
38
  // Get options.
39
  $shariff3uu = $GLOBALS['shariff3uu'];
224
  }
225
 
226
  // Encode the shareurl.
227
+ $post_url = rawurlencode( $url );
228
  $post_url_raw = $url;
229
 
230
  // Set transient name.
701
  * We need to strip out all !important in order to pass AMP test.
702
  */
703
  function shariff3uu_amp_css() {
704
+ // Get options.
705
+ $shariff3uu = $GLOBALS['shariff3uu'];
706
+ // Output CSS.
707
  ob_start();
708
+ include dirname( __FILE__ ) . '/css/shariff.min.css';
709
  $shariff_css = ob_get_clean();
710
  if ( false !== $shariff_css ) {
711
  echo esc_html( str_replace( '!important', '', $shariff_css ) );
712
  } else {
713
+ include dirname( __FILE__ ) . '/css/shariff.min.css';
714
+ }
715
+ if ( array_key_exists( 'dynamic_css', $shariff3uu ) && ! empty( $shariff3uu['dynamic_css'] ) ) {
716
+ echo esc_html( $shariff3uu['dynamic_css'] );
717
  }
 
 
718
  }
719
  add_action( 'amp_post_template_css', 'shariff3uu_amp_css' );
720
 
731
  function shariff3uu_render( $atts ) {
732
  // Get options.
733
  $shariff3uu = $GLOBALS['shariff3uu'];
734
+ if ( array_key_exists( 'dynamic_css', $shariff3uu ) && ! empty( $shariff3uu['dynamic_css'] ) ) {
735
+ $dynamic_css = $shariff3uu['dynamic_css'];
736
+ } else {
737
+ $dynamic_css = '';
738
+ }
739
 
740
  // Stops all further actions if we are on an admin page.
741
  if ( is_admin() ) {
823
  $atts['headline'] = wp_kses( $atts['headline'], $GLOBALS['allowed_tags'] );
824
  }
825
 
826
+ // Remove previous added inline styles to prevent duplications.
827
+ if ( wp_style_is( 'shariffcss', 'enqueued' ) ) {
828
+ wp_deregister_style( 'shariffcss' );
829
+ }
830
+
831
  // Enqueues the stylesheet (loading it here makes sure that it is only loaded on pages that actually contain shariff buttons).
832
  // If SCRIPT_DEBUG is set to true, the non minified version will be loaded.
833
  if ( defined( 'SCRIPT_DEBUG' ) && SCRIPT_DEBUG === true ) {
954
  $output .= ' shariff-buttonstretch';
955
  }
956
  $output .= '"';
957
+
958
  // Hides buttons until css is loaded.
959
+ if ( array_key_exists( 'hideuntilcss', $atts ) && 1 === $atts['hideuntilcss'] && ( ! function_exists( 'is_amp_endpoint' ) || ( function_exists( 'is_amp_endpoint' ) && false === is_amp_endpoint() ) ) ) {
960
  $output .= ' style="display:none"';
961
  }
962
  // Adds information for share count request.
1026
  $backend_available = '';
1027
  $mobile_only = '';
1028
  $button_url = '';
1029
+ $border_radius = '';
1030
 
1031
  // Explodes services.
1032
  $service_array = explode( '|', $atts['services'] );
1067
  // Includes service file.
1068
  include $path_service_file;
1069
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1070
  // Info button for default theme.
1071
  if ( ! array_key_exists( 'maincolor', $atts ) && 'info' === $service && ( ( array_key_exists( 'theme', $atts ) && 'default' === $atts['theme'] || ( array_key_exists( 'theme', $atts ) && 'round' === $atts['theme'] ) ) || ! array_key_exists( 'theme', $atts ) ) ) {
1072
  $main_color = '#fff';
1073
  $secondary_color = '#eee';
1074
  }
1075
 
1076
+ // Start <li.
1077
+ $output .= '<li class="shariff-button ' . $service;
1078
+
1079
+ // No custom colors.
1080
+ if ( ! array_key_exists( 'maincolor', $atts ) ) {
1081
+ $output .= ' shariff-nocustomcolor';
1082
+ }
1083
+
1084
  // Mobile only.
1085
  if ( 1 === $mobile_only ) {
1086
  $output .= ' shariff-mobile';
1087
  }
1088
+
1089
+ // AMP?
1090
+ if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
1091
+ // Custom colors?
1092
+ if ( array_key_exists( 'secondarycolor', $atts ) ) {
1093
+ $output .= ' shariff-secondary-color';
1094
+ $css = '.shariff-secondary-color{background-color:' . $atts['secondarycolor'] . '}';
1095
+ } else {
1096
+ $output .= ' shariff-' . $service . '-secondary-color';
1097
+ $css = '.shariff-' . $service . '-secondary-color{background-color:' . $secondary_color . '}';
1098
+ }
1099
+ if ( false === strpos( $dynamic_css, $css ) ) {
1100
+ $dynamic_css .= $css;
1101
+ }
1102
+ // Border radius?
1103
+ if ( array_key_exists( 'borderradius', $atts ) && array_key_exists( 'theme', $atts ) && 'round' === $atts['theme'] ) {
1104
+ $output .= ' shariff-borderradius';
1105
+ $css = '.shariff .shariff-buttons.theme-round .shariff-borderradius{border-radius:' . $atts['borderradius'] . '%}';
1106
+ if ( false === strpos( $dynamic_css, $css ) ) {
1107
+ $dynamic_css .= $css;
1108
+ }
1109
+ }
1110
+ } else {
1111
+ $output .= '" style="';
1112
+ // Custom colors?
1113
+ if ( array_key_exists( 'secondarycolor', $atts ) ) {
1114
+ $output .= 'background-color:' . $atts['secondarycolor'];
1115
+ } else {
1116
+ $output .= 'background-color:' . $secondary_color;
1117
+ }
1118
+ // Border radius?
1119
+ if ( array_key_exists( 'borderradius', $atts ) && array_key_exists( 'theme', $atts ) && 'round' === $atts['theme'] ) {
1120
+ $output .= ';border-radius:' . $atts['borderradius'] . '%';
1121
+ $border_radius = ';border-radius:' . $atts['borderradius'] . '%';
1122
+ }
1123
+ }
1124
+
1125
+ // End li>.
1126
+ $output .= '">';
1127
 
1128
  // Uses default button share text, if $button_text_array is empty.
1129
  if ( empty( $button_text_array ) ) {
1147
  // Resets $button_text_array.
1148
  $button_text_array = '';
1149
 
1150
+ /** Build the actual button. */
1151
+
1152
+ // Begin <a.
1153
+ $output .= '<a ';
1154
+
1155
+ // Check if we are on an AMP page and the print button is requested.
1156
+ if ( 'printer' === $service && function_exists( 'is_amp_endpoint' ) && true === is_amp_endpoint() ) {
1157
+ $output .= 'on="tap:AMP.print" ';
1158
+ } else {
1159
+ $output .= 'href="' . $button_url . '" ';
1160
+ }
1161
+
1162
+ // Output title, label and role.
1163
+ $output .= 'title="' . $button_title . '" aria-label="' . $button_title . '" role="button" rel="';
1164
  if ( 'facebook' !== $service ) {
1165
  $output .= 'noopener ';
1166
  }
1167
+ $output .= 'nofollow" class="shariff-link';
1168
+
1169
+ // AMP?
1170
+ if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
1171
+ $output .= ' shariff-borderradius';
1172
+ // Custom color?
1173
+ if ( array_key_exists( 'maincolor', $atts ) ) {
1174
+ $output .= ' shariff-main-color';
1175
+ $css = '.shariff-main-color{background-color:' . $atts['maincolor'] . '}';
1176
+ } else {
1177
+ $output .= ' shariff-' . $service . '-main-color';
1178
+ $css = '.shariff-' . $service . '-main-color{background-color:' . $main_color . '}';
1179
+ }
1180
+ if ( false === strpos( $dynamic_css, $css ) ) {
1181
+ $dynamic_css .= $css;
1182
+ }
1183
+ // Theme white?
1184
+ if ( isset( $atts['theme'] ) && 'white' === $atts['theme'] ) {
1185
+ if ( array_key_exists( 'maincolor', $atts ) ) {
1186
+ $output .= ' shariff-text-color"';
1187
+ $css = '.shariff-text-color{color:' . $atts['maincolor'] . '}';
1188
+ } else {
1189
+ $output .= ' shariff-' . $service . '-text-color"';
1190
+ $css = '.shariff-' . $service . '-text-color{color:' . $main_color . '}';
1191
+ }
1192
+ if ( false === strpos( $dynamic_css, $css ) ) {
1193
+ $dynamic_css .= $css;
1194
+ }
1195
+ } else {
1196
+ $output .= ' shariff-text-white"';
1197
+ }
1198
+ } else {
1199
+ // Border radius.
1200
+ $output .= '" style="' . $border_radius;
1201
+ // Custom color?
1202
+ if ( array_key_exists( 'maincolor', $atts ) ) {
1203
+ $output .= '; background-color:' . $atts['maincolor'];
1204
+ } else {
1205
+ $output .= '; background-color:' . $main_color;
1206
+ }
1207
+ // Theme white?
1208
+ if ( isset( $atts['theme'] ) && 'white' === $atts['theme'] ) {
1209
+ if ( array_key_exists( 'maincolor', $atts ) ) {
1210
+ $output .= '; color:' . $atts['maincolor'] . '"';
1211
+ } else {
1212
+ $output .= '; color:' . $main_color . '"';
1213
+ }
1214
+ } else {
1215
+ $output .= '; color:#fff"';
1216
+ }
1217
+ }
1218
+
1219
  // Same window?
1220
  if ( ! isset( $same_window ) || isset( $same_window ) && 1 !== $same_window ) {
1221
+ $output .= ' target="_blank"';
1222
  }
1223
+
1224
+ // End a>.
1225
+ $output .= '>';
1226
+
1227
+ // Shariff icon.
1228
+ $output .= '<span class="shariff-icon';
1229
+ // AMP?
1230
+ if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
1231
+ // Theme white?
1232
+ if ( isset( $atts['theme'] ) && 'white' === $atts['theme'] ) {
1233
+ if ( array_key_exists( 'maincolor', $atts ) ) {
1234
+ $output .= ' shariff-svg-color';
1235
+ $css = '.shariff-svg-color{fill:' . $atts['maincolor'] . '}';
1236
+ } else {
1237
+ $output .= ' shariff-' . $service . '-svg-color';
1238
+ $css = '.shariff-' . $service . '-svg-color{fill:' . $main_color . '}';
1239
+ }
1240
+ if ( false === strpos( $dynamic_css, $css ) ) {
1241
+ $dynamic_css .= $css;
1242
+ }
1243
+ }
1244
  } else {
1245
+ $output .= '" style="';
1246
+ // Theme white?
1247
+ if ( isset( $atts['theme'] ) && 'white' === $atts['theme'] ) {
1248
+ if ( array_key_exists( 'maincolor', $atts ) ) {
1249
+ $output .= 'fill:' . $atts['maincolor'];
1250
+ } else {
1251
+ $output .= 'fill:' . $main_color;
1252
+ }
1253
+ }
1254
  }
1255
+ $output .= '">' . $svg_icon . '</span>';
1256
+
1257
+ // Shariff text.
1258
+ $output .= '<span class="shariff-text';
1259
+ // AMP?
1260
+ if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
1261
+ // Theme white?
1262
+ if ( isset( $atts['theme'] ) && 'white' === $atts['theme'] ) {
1263
+ if ( array_key_exists( 'maincolor', $atts ) ) {
1264
+ $output .= ' shariff-text-color';
1265
+ $css = '.shariff-text-color{color:' . $atts['maincolor'] . '}';
1266
+ } else {
1267
+ $output .= ' shariff-' . $service . '-text-color';
1268
+ $css = '.shariff-' . $service . '-text-color{color:' . $main_color . '}';
1269
+ }
1270
+ if ( false === strpos( $dynamic_css, $css ) ) {
1271
+ $dynamic_css .= $css;
1272
+ }
1273
+ }
1274
+ } else {
1275
+ // Theme white?
1276
+ if ( isset( $atts['theme'] ) && 'white' === $atts['theme'] ) {
1277
+ if ( array_key_exists( 'maincolor', $atts ) ) {
1278
+ $output .= '" style="color:' . $atts['maincolor'];
1279
+ } else {
1280
+ $output .= '" style="color:' . $main_color;
1281
+ }
1282
+ }
1283
  }
1284
  $output .= '">' . $button_text . '</span>&nbsp;';
1285
+
1286
  // Share counts?
1287
  if ( array_key_exists( 'sharecounts', $atts ) && 1 === $atts['sharecounts'] && 1 === $backend_available && ! isset( $shariff3uu['disable'][ $service ] ) ) {
1288
+ $output .= '<span data-service="' . $service . '"';
1289
+ // AMP?
1290
+ if ( function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() ) {
1291
+ if ( array_key_exists( 'maincolor', $atts ) ) {
1292
+ $output .= ' class="shariff-count shariff-text-color"';
1293
+ $css = '.shariff-text-color{color:#fff}';
1294
+ } else {
1295
+ $output .= ' class="shariff-count shariff-' . $service . '-text-color';
1296
+ $css = '.shariff-' . $service . '-text-color{color:' . $main_color . '}';
1297
+ }
1298
+ if ( false === strpos( $dynamic_css, $css ) ) {
1299
+ $dynamic_css .= $css;
1300
+ }
1301
+ } else {
1302
+ if ( array_key_exists( 'maincolor', $atts ) ) {
1303
+ $output .= ' style="color:#fff" class="shariff-count';
1304
+
1305
+ } else {
1306
+ $output .= ' style="color:' . $main_color . '" class="shariff-count';
1307
+
1308
+ }
1309
+ }
1310
+ // Hide zero?
1311
+ if ( true === array_key_exists( $service, $share_counts ) && null !== $share_counts[ $service ] && '-1' !== $share_counts[ $service ] && ( ! isset( $atts['hidezero'] ) || ( isset( $atts['hidezero'] ) && 1 !== $atts['hidezero'] ) || ( isset( $atts['hidezero'] ) && 1 === $atts['hidezero'] && $share_counts[ $service ] > 0 ) ) ) {
1312
  $output .= '"> ' . $share_counts[ $service ];
1313
  } else {
1314
+ $output .= ' shariff-hidezero">';
1315
  }
1316
  $output .= '</span>&nbsp;';
1317
  }
1318
  $output .= '</a>';
1319
  $output .= '</li>';
1320
+
1321
  // Adds service to backend service, if available.
1322
  if ( 1 === $backend_available && ! isset( $shariff3uu['disable'][ $service ] ) ) {
1323
  $backend_service_array[] = $service;
1324
  }
1325
+
1326
  // Resets the $backend, $mobile_only and $same_window variables.
1327
  $backend_available = '';
1328
  $mobile_only = '';
1345
  $output .= '</div>';
1346
  }
1347
 
1348
+ // Update the dynamic css db entry if needed.
1349
+ if ( ( array_key_exists( 'dynamic_css', $shariff3uu ) && $shariff3uu['dynamic_css'] !== $dynamic_css ) || ! array_key_exists( 'dynamic_css', $shariff3uu ) ) {
1350
+ $shariff3uu_design = array_filter( $GLOBALS['shariff3uu_design'] );
1351
+ $shariff3uu_design['dynamic_css'] = $dynamic_css;
1352
+ $GLOBALS['shariff3uu']['dynamic_css'] = $dynamic_css;
1353
+ update_option( 'shariff3uu_design', $shariff3uu_design );
1354
+ }
1355
+
1356
  // Displays a warning to admins if flattr is set, but no flattr username was provided.
1357
  if ( 1 === $flattr_error && current_user_can( 'manage_options' ) ) {
1358
  $output .= '<div class="shariff-warning">' . __( 'Username for Flattr is missing!', 'shariff' ) . '</div>';