- Timestamp:
- 04/29/2018 07:44:22 PM (8 years ago)
- Location:
- shariff/trunk
- Files:
-
- 6 edited
-
changelog.txt (modified) (1 diff)
-
css/shariff.css (modified) (8 diffs)
-
css/shariff.min.css (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
services/shariff-twitter.php (modified) (1 diff)
-
shariff.php (modified) (13 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shariff/trunk/changelog.txt
r1861436 r1866097 2 2 3 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 4 11 5 12 = 4.4.2 = -
shariff/trunk/css/shariff.css
r1861436 r1866097 32 32 background-image: none !important; 33 33 text-align: left; 34 box-shadow: none; 35 cursor: pointer; 34 36 } 35 37 .shariff a:hover { … … 68 70 .shariff-button::before { 69 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; 70 78 } 71 79 /* theme default */ … … 152 160 } 153 161 /* buttonsize small */ 154 .shariff . buttonsize-small li {162 .shariff .shariff-buttons.buttonsize-small li { 155 163 height: 25px !important; 156 164 } 157 .shariff . buttonsize-small a {165 .shariff .shariff-buttons.buttonsize-small a { 158 166 height: 25px !important; 159 167 } 160 .shariff . buttonsize-small.orientation-vertical li {168 .shariff .shariff-buttons.buttonsize-small.orientation-vertical li { 161 169 width: 115px; 162 170 } 163 .shariff . buttonsize-small .shariff-icon svg {171 .shariff .shariff-buttons.buttonsize-small .shariff-icon svg { 164 172 width: 22px; 165 173 height: 15px; 166 174 padding: 5px 1px; 167 175 } 168 .shariff . buttonsize-small .shariff-text,169 .shariff . buttonsize-small .shariff-count {176 .shariff .shariff-buttons.buttonsize-small .shariff-text, 177 .shariff .shariff-buttons.buttonsize-small .shariff-count { 170 178 font-size: 11px; 171 179 line-height: 25px; … … 173 181 height: 23px; 174 182 } 175 .shariff . buttonsize-small .shariff-text {183 .shariff .shariff-buttons.buttonsize-small .shariff-text { 176 184 padding-left: 1px !important; 177 185 } 178 .shariff . buttonsize-small.theme-round li {186 .shariff .shariff-buttons.buttonsize-small.theme-round li { 179 187 width: 25px !important; 180 188 } 181 .shariff . buttonsize-small.theme-round a {189 .shariff .shariff-buttons.buttonsize-small.theme-round a { 182 190 width: 25px !important; 183 191 } 184 .shariff . buttonsize-small.theme-round .shariff-count {192 .shariff .shariff-buttons.buttonsize-small.theme-round .shariff-count { 185 193 padding: 0 !important; 186 194 height: 25px !important; 187 195 } 188 .shariff . theme-round.buttonsize-small.orientation-horizontal li {196 .shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li { 189 197 margin: 5px 7px 190 198 } 191 .shariff . theme-round.buttonsize-small.orientation-horizontal li:first-child {199 .shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li:first-child { 192 200 margin-left: 5px 193 201 } 194 .shariff . theme-round.buttonsize-small.orientation-horizontal li:last-child {202 .shariff .shariff-buttons.theme-round.buttonsize-small.orientation-horizontal li:last-child { 195 203 margin-right: 5px 196 204 } … … 220 228 padding-left: 1px !important; 221 229 } 222 .shariff . buttonsize-large.theme-round li {230 .shariff .shariff-buttons.buttonsize-large.theme-round li { 223 231 width: 45px !important; 232 height: 45px !important; 224 233 } 225 234 .shariff .buttonsize-large.theme-round a { … … 231 240 } 232 241 /* orientation vertical */ 233 /*noinspection CssUnusedSymbol*/234 242 .shariff .orientation-vertical { 235 243 flex-direction: column; … … 272 280 } 273 281 /* 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; 282 .widget .shariff li { 283 border: none; 279 284 font-weight: 400; 280 285 } … … 338 343 /* media queries */ 339 344 @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 .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; } 345 351 } 346 352 @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; } 353 .shariff .shariff-buttons li { width: 90px; } 354 .shariff .shariff-buttons.buttonsize-large li { width: 130px; } 350 355 } 351 356 @media only screen and (min-width: 768px) { 352 .shariff . orientation-horizontalli { width: 130px; }353 .shariff . orientation-horizontal.buttonsize-small li { width: 105px; }354 .shariff . orientation-horizontal.buttonsize-large li { width: 155px; }355 .shariff . orientation-horizontalli .shariff-text { display: inline; }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; } 356 361 } 357 362 @media only screen and (min-device-width: 1025px) { -
shariff/trunk/css/shariff.min.css
r1861436 r1866097 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-horizontalli .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}} -
shariff/trunk/readme.txt
r1861441 r1866097 5 5 Requires PHP: 5.6 6 6 Tested up to: 4.9 7 Stable tag: 4.4. 27 Stable tag: 4.4.3 8 8 License: MIT 9 9 License URI: http://opensource.org/licenses/mit … … 168 168 169 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 170 177 171 178 = 4.4.2 = -
shariff/trunk/services/shariff-twitter.php
r1851328 r1866097 78 78 // Fetch counts. 79 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 ) ) );80 $twitter = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'https://public.newsharecounts.com/count.json?url=' . $post_url ) ) ); 81 81 } else { 82 82 $twitter = sanitize_text_field( wp_remote_retrieve_body( wp_remote_get( 'http://opensharecount.com/count.json?url=' . $post_url ) ) ); -
shariff/trunk/shariff.php
r1861436 r1866097 4 4 * Plugin URI: https://wordpress.org/plugins-wp/shariff/ 5 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. 26 * Version: 4.4.3 7 7 * Author: Jan-Peter Lambeck & 3UU 8 8 * Author URI: https://wordpress.org/plugins/shariff/ … … 34 34 function shariff3uu_update() { 35 35 // Adjust code version. 36 $code_version = '4.4. 2';36 $code_version = '4.4.3'; 37 37 38 38 // Get options. … … 225 225 226 226 // Encode the shareurl. 227 $post_url = rawurlencode( esc_url( $url ));227 $post_url = rawurlencode( $url ); 228 228 $post_url_raw = $url; 229 229 … … 702 702 */ 703 703 function shariff3uu_amp_css() { 704 // Get options. 705 $shariff3uu = $GLOBALS['shariff3uu']; 706 // Output CSS. 704 707 ob_start(); 705 include plugins_url( '/css/shariff.min.css', __FILE__ );708 include dirname( __FILE__ ) . '/css/shariff.min.css'; 706 709 $shariff_css = ob_get_clean(); 707 710 if ( false !== $shariff_css ) { 708 711 echo esc_html( str_replace( '!important', '', $shariff_css ) ); 709 712 } else { 710 include plugins_url( '/css/shariff.min.css', __FILE__ ); 711 } 712 // Hide print button on AMP pages. 713 echo '.shariff .printer { display: none };'; 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 } 714 718 } 715 719 add_action( 'amp_post_template_css', 'shariff3uu_amp_css' ); … … 728 732 // Get options. 729 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 } 730 739 731 740 // Stops all further actions if we are on an admin page. … … 813 822 if ( array_key_exists( 'headline', $atts ) ) { 814 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' ); 815 829 } 816 830 … … 941 955 } 942 956 $output .= '"'; 957 943 958 // Hides buttons until css is loaded. 944 if ( array_key_exists( 'hideuntilcss', $atts ) && 1 === $atts['hideuntilcss'] ) {959 if ( array_key_exists( 'hideuntilcss', $atts ) && 1 === $atts['hideuntilcss'] && ( ! function_exists( 'is_amp_endpoint' ) || ( function_exists( 'is_amp_endpoint' ) && false === is_amp_endpoint() ) ) ) { 945 960 $output .= ' style="display:none"'; 946 961 } … … 1012 1027 $mobile_only = ''; 1013 1028 $button_url = ''; 1014 $ no_custom_color= '';1029 $border_radius = ''; 1015 1030 1016 1031 // Explodes services. … … 1053 1068 include $path_service_file; 1054 1069 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 1070 // Info button for default theme. 1073 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 ) ) ) { … … 1076 1074 } 1077 1075 1078 // Start li. 1079 $output .= '<li class="shariff-button ' . $no_custom_color . $service; 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 1080 1084 // Mobile only. 1081 1085 if ( 1 === $mobile_only ) { 1082 1086 $output .= ' shariff-mobile'; 1083 1087 } 1084 $output .= '" style="background-color:' . $secondary_color . $border_radius . '">'; 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 .= '">'; 1085 1127 1086 1128 // Uses default button share text, if $button_text_array is empty. … … 1106 1148 $button_text_array = ''; 1107 1149 1108 // Build the actual button. 1109 $output .= '<a href="' . $button_url . '" title="' . $button_title . '" aria-label="' . $button_title . '" role="button" rel="'; 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="'; 1110 1164 if ( 'facebook' !== $service ) { 1111 1165 $output .= 'noopener '; 1112 1166 } 1113 $output .= 'nofollow" class="shariff-link" '; 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 1114 1219 // Same window? 1115 1220 if ( ! isset( $same_window ) || isset( $same_window ) && 1 !== $same_window ) { 1116 $output .= ' target="_blank"';1221 $output .= ' target="_blank"'; 1117 1222 } 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; 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 } 1122 1244 } else { 1123 $output .= '; color:#fff'; 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 } 1124 1254 } 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; 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 } 1135 1283 } 1136 1284 $output .= '">' . $button_text . '</span> '; 1285 1137 1286 // Share counts? 1138 1287 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 ) ) ) { 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 ) ) ) { 1141 1312 $output .= '"> ' . $share_counts[ $service ]; 1142 1313 } else { 1143 $output .= ' ;opacity:0">';1314 $output .= ' shariff-hidezero">'; 1144 1315 } 1145 1316 $output .= '</span> '; … … 1147 1318 $output .= '</a>'; 1148 1319 $output .= '</li>'; 1320 1149 1321 // Adds service to backend service, if available. 1150 1322 if ( 1 === $backend_available && ! isset( $shariff3uu['disable'][ $service ] ) ) { 1151 1323 $backend_service_array[] = $service; 1152 1324 } 1325 1153 1326 // Resets the $backend, $mobile_only and $same_window variables. 1154 1327 $backend_available = ''; … … 1171 1344 if ( array_key_exists( 'style', $atts ) || array_key_exists( 'cssclass', $atts ) ) { 1172 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 ); 1173 1354 } 1174 1355
Note: See TracChangeset
for help on using the changeset viewer.