├── .github ├── ISSUE_TEMPLATE │ ├── 1-Bug-report.md │ └── 2-Enhancement.md └── pull_request_template.md ├── .gitignore ├── assets └── css │ ├── style.css │ └── style.scss ├── config.codekit ├── index.php ├── languages └── storefront-product-sharing.pot ├── readme.txt └── storefront-product-sharing.php /.github/ISSUE_TEMPLATE/1-Bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "\U0001F41E Bug report" 3 | about: Report a bug if something isn't working as expected. 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Describe the bug 11 | Clearly describe the issue. Please be as descriptive as possible; issues lacking detail, or for any other reason than to report a bug, may be closed without action. 12 | 13 | Isolating the problem (mark completed items with an [x]): 14 | - [ ] I have deactivated other plugins and themes and confirmed this bug occurs when only WooCommerce + Storefront + this extension are active. 15 | - [ ] I can reproduce this bug consistently using the steps below. 16 | 17 | ## To Reproduce 18 | Steps to reproduce the behavior: 19 | 1. Go to '...' 20 | 2. Click on '....' 21 | 3. Scroll down to '....' 22 | 4. See error 23 | 24 | ## Screenshots 25 | If applicable, add screenshots to help explain your problem. 26 | 27 | ## Expected behavior 28 | A clear and concise description of what you expected to happen. 29 | 30 | ### Browser Environment 31 | Please provide as much detail as possible about your testing environment. 32 | 33 | - Platform: e.g. macOS, Windows, iOS 34 | - Browser(s): 35 | 36 | ### WordPress Environment 37 | Please provide relevant details of your WordPress setup and server environment. 38 | 39 |
40 | ``` 41 | Copy and paste the system status report from WooCommerce > System Status in WordPress admin. 42 | ``` 43 |
44 | 45 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/2-Enhancement.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: "✨ Enhancement" 3 | about: If you have idea about how we can improve this product please let us know – or submit a Pull Request! 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | ## Is your feature request related to a problem? Please describe. 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | ## Describe the solution you'd like 14 | A clear and concise description of what you want to happen. 15 | 16 | ## Describe alternatives you've considered 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | ## Additional context 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/pull_request_template.md: -------------------------------------------------------------------------------- 1 | 2 | Fixes # 3 | 4 | 5 | 6 | 7 | 8 | ### Screenshots 9 | 10 | 11 | ### How to test the changes in this Pull Request: 12 | 13 | 14 | 1. 15 | 2. 16 | 3. 17 | 18 | ### Changelog 19 | 20 | > Add suggested changelog entry here. 21 | 22 | ### Tests 23 | 24 | - [ ] I've tested [browser support](https://make.wordpress.org/core/handbook/best-practices/browser-support/) to ensure compatibility with >= IE11 25 | - [ ] I've tested using only a keyboard (no mouse) 26 | - [ ] I've tested using a screen reader 27 | - [ ] All animations respect [`prefers-reduced-motion`](https://developer.mozilla.org/en-US/docs/Web/CSS/@media/prefers-reduced-motion) 28 | - [ ] All text has [at least a 4.5 color contrast with its background](https://webaim.org/resources/contrastchecker/) 29 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .sass-cache 2 | .codekit-cache 3 | .DS_Store -------------------------------------------------------------------------------- /assets/css/style.css: -------------------------------------------------------------------------------- 1 | .storefront-product-sharing { 2 | clear: both; } 3 | .storefront-product-sharing ul { 4 | margin-left: 0; } 5 | .storefront-product-sharing ul li { 6 | list-style: none; } 7 | .storefront-product-sharing ul li a:before { 8 | font-family: "FontAwesome"; 9 | font-weight: 400; 10 | margin-right: 1em; } 11 | .storefront-product-sharing ul li.facebook a:before { 12 | content: "\f230"; 13 | color: #3b5998; } 14 | .storefront-product-sharing ul li.twitter a:before { 15 | content: "\f081"; 16 | color: #00aced; } 17 | .storefront-product-sharing ul li.pinterest a:before { 18 | content: "\f0d3"; 19 | color: #cb2027; } 20 | .storefront-product-sharing ul li.email a:before { 21 | content: "\f199"; } 22 | 23 | .storefront-2-3 .storefront-product-sharing ul li a:before { 24 | font-family: "Font Awesome 5 Brands"; } 25 | 26 | .storefront-2-3 .storefront-product-sharing ul li.facebook a:before { 27 | content: "\f09a"; } 28 | 29 | .storefront-2-3 .storefront-product-sharing ul li.twitter a:before { 30 | content: "\f099"; } 31 | 32 | .storefront-2-3 .storefront-product-sharing ul li.pinterest a:before { 33 | content: "\f0d2"; } 34 | 35 | .storefront-2-3 .storefront-product-sharing ul li.email a:before { 36 | font-weight: 900; 37 | font-family: "Font Awesome 5 Free"; 38 | content: "\f0e0"; } 39 | 40 | @media screen and (min-width: 768px) { 41 | .storefront-product-sharing { 42 | padding: 1.618em 0; } 43 | .storefront-product-sharing ul { 44 | margin: 0; } 45 | .storefront-product-sharing ul::before, .storefront-product-sharing ul::after { 46 | content: ''; 47 | display: table; } 48 | .storefront-product-sharing ul::after { 49 | clear: both; } 50 | .storefront-product-sharing ul li { 51 | width: 25%; 52 | float: left; 53 | text-align: center; 54 | border-right: 1px solid rgba(0, 0, 0, 0.05); } 55 | .storefront-product-sharing ul li:last-child { 56 | border-right: 0; } 57 | .storefront-product-sharing ul li a { 58 | display: block; } 59 | .storefront-product-sharing ul li a:before { 60 | display: block; 61 | margin: 0 auto .007em; 62 | font-size: 2.618em; 63 | transition: all, ease, .2s; } 64 | .storefront-product-sharing ul li a:hover:before { 65 | transform: translateY(-0.236em); } } 66 | -------------------------------------------------------------------------------- /assets/css/style.scss: -------------------------------------------------------------------------------- 1 | @import '../../../../themes/storefront/assets/css/sass/utils/mixins'; 2 | @import '../../../../themes/storefront/assets/css/sass/utils/variables'; 3 | @import '../../../../themes/storefront/assets/css/sass/vendors/font-awesome/variables'; 4 | 5 | // Styles for mobile 6 | .storefront-product-sharing { 7 | clear: both; 8 | 9 | ul { 10 | margin-left: 0; 11 | 12 | li { 13 | list-style: none; 14 | 15 | a:before { 16 | font-family: "FontAwesome"; 17 | font-weight: 400; 18 | margin-right: 1em; 19 | } 20 | 21 | &.facebook { 22 | a:before { 23 | content: "\f230"; 24 | color: #3b5998; 25 | } 26 | } 27 | 28 | &.twitter { 29 | a:before { 30 | content: "\f081"; 31 | color: #00aced; 32 | } 33 | } 34 | 35 | &.pinterest { 36 | a:before { 37 | content: "\f0d3"; 38 | color: #cb2027; 39 | } 40 | } 41 | 42 | &.email { 43 | a:before { 44 | content: "\f199"; 45 | } 46 | } 47 | } 48 | } 49 | } 50 | 51 | .storefront-2-3 { 52 | .storefront-product-sharing { 53 | ul { 54 | li { 55 | a:before { 56 | font-family: "Font Awesome 5 Brands"; 57 | } 58 | 59 | &.facebook { 60 | a:before { 61 | content: fa-content( $fa-var-facebook ); 62 | } 63 | } 64 | 65 | &.twitter { 66 | a:before { 67 | content: fa-content( $fa-var-twitter ); 68 | } 69 | } 70 | 71 | &.pinterest { 72 | a:before { 73 | content: fa-content( $fa-var-pinterest ); 74 | } 75 | } 76 | 77 | &.email { 78 | a:before { 79 | font-weight: 900; 80 | font-family: "Font Awesome 5 Free"; 81 | content: fa-content( $fa-var-envelope ); 82 | } 83 | } 84 | } 85 | } 86 | } 87 | } 88 | 89 | @media screen and (min-width: 768px) { 90 | 91 | // Styles for desktop 92 | .storefront-product-sharing { 93 | padding: 1.618em 0; 94 | 95 | ul { 96 | @include clearfix; 97 | margin: 0; 98 | 99 | li { 100 | width: 25%; 101 | float: left; 102 | text-align: center; 103 | border-right: 1px solid $color_border; 104 | 105 | &:last-child { 106 | border-right: 0; 107 | } 108 | 109 | a { 110 | display: block; 111 | 112 | &:before { 113 | display: block; 114 | margin: 0 auto .007em; 115 | font-size: 2.618em; 116 | transition: all, ease, .2s; 117 | } 118 | 119 | &:hover { 120 | &:before { 121 | transform: translateY(-.236em); 122 | } 123 | } 124 | } 125 | } 126 | } 127 | } 128 | } -------------------------------------------------------------------------------- /config.codekit: -------------------------------------------------------------------------------- 1 | { 2 | "CodeKitInfo": "This is a CodeKit 2.x project configuration file. It is designed to sync project settings across multiple machines. MODIFYING THE CONTENTS OF THIS FILE IS A POOR LIFE DECISION. If you do so, you will likely cause CodeKit to crash. This file is not useful unless accompanied by the project that created it in CodeKit 2. This file is not backwards-compatible with CodeKit 1.x. For more information, see: http:\/\/incident57.com\/codekit", 3 | "creatorBuild": "19115", 4 | "files": { 5 | "\/assets\/css\/style.css": { 6 | "fileType": 16, 7 | "ignore": 1, 8 | "ignoreWasSetByUser": 0, 9 | "inputAbbreviatedPath": "\/assets\/css\/style.css", 10 | "outputAbbreviatedPath": "No Output Path", 11 | "outputPathIsOutsideProject": 0, 12 | "outputPathIsSetByUser": 0 13 | }, 14 | "\/assets\/css\/style.scss": { 15 | "createSourceMap": 0, 16 | "debugStyle": 0, 17 | "decimalPrecision": 10, 18 | "fileType": 4, 19 | "ignore": 0, 20 | "ignoreWasSetByUser": 0, 21 | "inputAbbreviatedPath": "\/assets\/css\/style.scss", 22 | "outputAbbreviatedPath": "\/assets\/css\/style.css", 23 | "outputPathIsOutsideProject": 0, 24 | "outputPathIsSetByUser": 0, 25 | "outputStyle": 0, 26 | "shouldRunAutoprefixer": 0, 27 | "shouldRunBless": 0, 28 | "useLibsass": 0 29 | }, 30 | "\/index.php": { 31 | "fileType": 8192, 32 | "ignore": 0, 33 | "ignoreWasSetByUser": 0, 34 | "inputAbbreviatedPath": "\/index.php", 35 | "outputAbbreviatedPath": "No Output Path", 36 | "outputPathIsOutsideProject": 0, 37 | "outputPathIsSetByUser": 0 38 | }, 39 | "\/storefront-product-sharing.php": { 40 | "fileType": 8192, 41 | "ignore": 0, 42 | "ignoreWasSetByUser": 0, 43 | "inputAbbreviatedPath": "\/storefront-product-sharing.php", 44 | "outputAbbreviatedPath": "No Output Path", 45 | "outputPathIsOutsideProject": 0, 46 | "outputPathIsSetByUser": 0 47 | } 48 | }, 49 | "hooks": [ 50 | ], 51 | "lastSavedByUser": "James Koster", 52 | "manualImportLinks": { 53 | }, 54 | "projectAttributes": { 55 | "bowerAbbreviatedPath": "", 56 | "displayValue": "storefront-product-sharing", 57 | "displayValueWasSetByUser": 0, 58 | "iconImageName": "globe_orange" 59 | }, 60 | "projectSettings": { 61 | "alwaysUseExternalServer": 0, 62 | "animateCSSInjections": 1, 63 | "autoApplyPSLanguageSettingsStyle": 0, 64 | "autoprefixerBrowserString": "> 1%, last 2 versions, Firefox ESR, Opera 12.1", 65 | "autoSyncProjectSettingsFile": 1, 66 | "browserRefreshDelay": 0, 67 | "coffeeAutoOutputPathEnabled": 1, 68 | "coffeeAutoOutputPathFilenamePattern": "*.js", 69 | "coffeeAutoOutputPathRelativePath": "", 70 | "coffeeAutoOutputPathReplace1": "", 71 | "coffeeAutoOutputPathReplace2": "", 72 | "coffeeAutoOutputPathStyle": 0, 73 | "coffeeCreateSourceMap": 0, 74 | "coffeeLintFlags2": { 75 | "arrow_spacing": { 76 | "active": 0, 77 | "flagValue": -1 78 | }, 79 | "camel_case_classes": { 80 | "active": 1, 81 | "flagValue": -1 82 | }, 83 | "colon_assignment_spacing": { 84 | "active": 0, 85 | "flagValue": 1 86 | }, 87 | "cyclomatic_complexity": { 88 | "active": 0, 89 | "flagValue": 10 90 | }, 91 | "duplicate_key": { 92 | "active": 1, 93 | "flagValue": -1 94 | }, 95 | "empty_constructor_needs_parens": { 96 | "active": 0, 97 | "flagValue": -1 98 | }, 99 | "ensure_comprehensions": { 100 | "active": 1, 101 | "flagValue": -1 102 | }, 103 | "indentation": { 104 | "active": 1, 105 | "flagValue": 2 106 | }, 107 | "line_endings": { 108 | "active": 0, 109 | "flagValue": 0 110 | }, 111 | "max_line_length": { 112 | "active": 0, 113 | "flagValue": 150 114 | }, 115 | "missing_fat_arrows": { 116 | "active": 0, 117 | "flagValue": -1 118 | }, 119 | "newlines_after_classes": { 120 | "active": 0, 121 | "flagValue": 3 122 | }, 123 | "no_backticks": { 124 | "active": 1, 125 | "flagValue": -1 126 | }, 127 | "no_debugger": { 128 | "active": 1, 129 | "flagValue": -1 130 | }, 131 | "no_empty_functions": { 132 | "active": 0, 133 | "flagValue": -1 134 | }, 135 | "no_empty_param_list": { 136 | "active": 0, 137 | "flagValue": -1 138 | }, 139 | "no_implicit_braces": { 140 | "active": 1, 141 | "flagValue": -1 142 | }, 143 | "no_implicit_parens": { 144 | "active": 0, 145 | "flagValue": -1 146 | }, 147 | "no_interpolation_in_single_quotes": { 148 | "active": 0, 149 | "flagValue": -1 150 | }, 151 | "no_nested_string_interpolation": { 152 | "active": 1, 153 | "flagValue": -1 154 | }, 155 | "no_plusplus": { 156 | "active": 0, 157 | "flagValue": -1 158 | }, 159 | "no_private_function_fat_arrows": { 160 | "active": 1, 161 | "flagValue": -1 162 | }, 163 | "no_stand_alone_at": { 164 | "active": 1, 165 | "flagValue": -1 166 | }, 167 | "no_tabs": { 168 | "active": 1, 169 | "flagValue": -1 170 | }, 171 | "no_this": { 172 | "active": 0, 173 | "flagValue": -1 174 | }, 175 | "no_throwing_strings": { 176 | "active": 1, 177 | "flagValue": -1 178 | }, 179 | "no_trailing_semicolons": { 180 | "active": 1, 181 | "flagValue": -1 182 | }, 183 | "no_trailing_whitespace": { 184 | "active": 1, 185 | "flagValue": -1 186 | }, 187 | "no_unnecessary_double_quotes": { 188 | "active": 0, 189 | "flagValue": -1 190 | }, 191 | "no_unnecessary_fat_arrows": { 192 | "active": 1, 193 | "flagValue": -1 194 | }, 195 | "non_empty_constructor_needs_parens": { 196 | "active": 0, 197 | "flagValue": -1 198 | }, 199 | "prefer_english_operator": { 200 | "active": 0, 201 | "flagValue": -1 202 | }, 203 | "space_operators": { 204 | "active": 0, 205 | "flagValue": -1 206 | }, 207 | "spacing_after_comma": { 208 | "active": 1, 209 | "flagValue": -1 210 | } 211 | }, 212 | "coffeeMinifyOutput": 1, 213 | "coffeeOutputStyle": 0, 214 | "coffeeSyntaxCheckerStyle": 1, 215 | "externalServerAddress": "http:\/\/localhost:8888", 216 | "externalServerPreviewPathAddition": "", 217 | "genericWebpageFileExtensionsString": "html, htm, shtml, shtm, xhtml, php, jsp, asp, aspx, erb, ctp", 218 | "hamlAutoOutputPathEnabled": 1, 219 | "hamlAutoOutputPathFilenamePattern": "*.html", 220 | "hamlAutoOutputPathRelativePath": "", 221 | "hamlAutoOutputPathReplace1": "", 222 | "hamlAutoOutputPathReplace2": "", 223 | "hamlAutoOutputPathStyle": 0, 224 | "hamlEscapeHTMLCharacters": 0, 225 | "hamlNoEscapeInAttributes": 0, 226 | "hamlOutputFormat": 2, 227 | "hamlOutputStyle": 0, 228 | "hamlUseCDATA": 0, 229 | "hamlUseDoubleQuotes": 0, 230 | "hamlUseUnixNewlines": 0, 231 | "jadeAutoOutputPathEnabled": 1, 232 | "jadeAutoOutputPathFilenamePattern": "*.html", 233 | "jadeAutoOutputPathRelativePath": "", 234 | "jadeAutoOutputPathReplace1": "", 235 | "jadeAutoOutputPathReplace2": "", 236 | "jadeAutoOutputPathStyle": 0, 237 | "jadeCompileDebug": 1, 238 | "jadeOutputStyle": 0, 239 | "javascriptAutoOutputPathEnabled": 1, 240 | "javascriptAutoOutputPathFilenamePattern": "*-min.js", 241 | "javascriptAutoOutputPathRelativePath": "\/min", 242 | "javascriptAutoOutputPathReplace1": "", 243 | "javascriptAutoOutputPathReplace2": "", 244 | "javascriptAutoOutputPathStyle": 2, 245 | "javascriptCreateSourceMap": 1, 246 | "javascriptOutputStyle": 1, 247 | "javascriptSyntaxCheckerStyle": 1, 248 | "jsCheckerReservedNamesString": "", 249 | "jsHintFlags2": { 250 | "asi": { 251 | "active": 0, 252 | "flagValue": -1 253 | }, 254 | "bitwise": { 255 | "active": 1, 256 | "flagValue": -1 257 | }, 258 | "boss": { 259 | "active": 0, 260 | "flagValue": -1 261 | }, 262 | "browser": { 263 | "active": 1, 264 | "flagValue": -1 265 | }, 266 | "browserify": { 267 | "active": 0, 268 | "flagValue": -1 269 | }, 270 | "camelcase": { 271 | "active": 0, 272 | "flagValue": -1 273 | }, 274 | "couch": { 275 | "active": 0, 276 | "flagValue": -1 277 | }, 278 | "curly": { 279 | "active": 1, 280 | "flagValue": -1 281 | }, 282 | "debug": { 283 | "active": 0, 284 | "flagValue": -1 285 | }, 286 | "devel": { 287 | "active": 0, 288 | "flagValue": -1 289 | }, 290 | "dojo": { 291 | "active": 0, 292 | "flagValue": -1 293 | }, 294 | "elision": { 295 | "active": 1, 296 | "flagValue": -1 297 | }, 298 | "eqeqeq": { 299 | "active": 1, 300 | "flagValue": -1 301 | }, 302 | "eqnull": { 303 | "active": 0, 304 | "flagValue": -1 305 | }, 306 | "es3": { 307 | "active": 0, 308 | "flagValue": -1 309 | }, 310 | "esnext": { 311 | "active": 0, 312 | "flagValue": -1 313 | }, 314 | "evil": { 315 | "active": 0, 316 | "flagValue": -1 317 | }, 318 | "expr": { 319 | "active": 0, 320 | "flagValue": -1 321 | }, 322 | "forin": { 323 | "active": 0, 324 | "flagValue": -1 325 | }, 326 | "freeze": { 327 | "active": 1, 328 | "flagValue": -1 329 | }, 330 | "funcscope": { 331 | "active": 0, 332 | "flagValue": -1 333 | }, 334 | "futurehostile": { 335 | "active": 0, 336 | "flagValue": -1 337 | }, 338 | "globalstrict": { 339 | "active": 0, 340 | "flagValue": -1 341 | }, 342 | "immed": { 343 | "active": 0, 344 | "flagValue": -1 345 | }, 346 | "indent": { 347 | "active": 0, 348 | "flagValue": 4 349 | }, 350 | "iterator": { 351 | "active": 0, 352 | "flagValue": -1 353 | }, 354 | "jasmine": { 355 | "active": 0, 356 | "flagValue": -1 357 | }, 358 | "jquery": { 359 | "active": 1, 360 | "flagValue": -1 361 | }, 362 | "lastsemic": { 363 | "active": 0, 364 | "flagValue": -1 365 | }, 366 | "latedef": { 367 | "active": 1, 368 | "flagValue": -1 369 | }, 370 | "laxbreak": { 371 | "active": 0, 372 | "flagValue": -1 373 | }, 374 | "laxcomma": { 375 | "active": 0, 376 | "flagValue": -1 377 | }, 378 | "loopfunc": { 379 | "active": 0, 380 | "flagValue": -1 381 | }, 382 | "maxcomplexity": { 383 | "active": 0, 384 | "flagValue": 10 385 | }, 386 | "maxdepth": { 387 | "active": 0, 388 | "flagValue": 3 389 | }, 390 | "maxlen": { 391 | "active": 0, 392 | "flagValue": 150 393 | }, 394 | "maxparams": { 395 | "active": 0, 396 | "flagValue": 3 397 | }, 398 | "maxstatements": { 399 | "active": 0, 400 | "flagValue": 4 401 | }, 402 | "mocha": { 403 | "active": 0, 404 | "flagValue": -1 405 | }, 406 | "mootools": { 407 | "active": 0, 408 | "flagValue": -1 409 | }, 410 | "moz": { 411 | "active": 0, 412 | "flagValue": -1 413 | }, 414 | "multistr": { 415 | "active": 0, 416 | "flagValue": -1 417 | }, 418 | "newcap": { 419 | "active": 1, 420 | "flagValue": -1 421 | }, 422 | "noarg": { 423 | "active": 1, 424 | "flagValue": -1 425 | }, 426 | "nocomma": { 427 | "active": 0, 428 | "flagValue": -1 429 | }, 430 | "node": { 431 | "active": 0, 432 | "flagValue": -1 433 | }, 434 | "noempty": { 435 | "active": 0, 436 | "flagValue": -1 437 | }, 438 | "nonbsp": { 439 | "active": 0, 440 | "flagValue": -1 441 | }, 442 | "nonew": { 443 | "active": 1, 444 | "flagValue": -1 445 | }, 446 | "nonstandard": { 447 | "active": 0, 448 | "flagValue": -1 449 | }, 450 | "notypeof": { 451 | "active": 1, 452 | "flagValue": -1 453 | }, 454 | "noyield": { 455 | "active": 0, 456 | "flagValue": -1 457 | }, 458 | "onecase": { 459 | "active": 0, 460 | "flagValue": -1 461 | }, 462 | "phantom": { 463 | "active": 0, 464 | "flagValue": -1 465 | }, 466 | "plusplus": { 467 | "active": 0, 468 | "flagValue": -1 469 | }, 470 | "proto": { 471 | "active": 0, 472 | "flagValue": -1 473 | }, 474 | "prototypejs": { 475 | "active": 0, 476 | "flagValue": -1 477 | }, 478 | "qunit": { 479 | "active": 0, 480 | "flagValue": -1 481 | }, 482 | "regexp": { 483 | "active": 1, 484 | "flagValue": -1 485 | }, 486 | "rhino": { 487 | "active": 0, 488 | "flagValue": -1 489 | }, 490 | "scripturl": { 491 | "active": 0, 492 | "flagValue": -1 493 | }, 494 | "shadow": { 495 | "active": 0, 496 | "flagValue": -1 497 | }, 498 | "shelljs": { 499 | "active": 0, 500 | "flagValue": -1 501 | }, 502 | "singleGroups": { 503 | "active": 0, 504 | "flagValue": -1 505 | }, 506 | "strict": { 507 | "active": 0, 508 | "flagValue": -1 509 | }, 510 | "sub": { 511 | "active": 0, 512 | "flagValue": -1 513 | }, 514 | "supernew": { 515 | "active": 0, 516 | "flagValue": -1 517 | }, 518 | "typed": { 519 | "active": 0, 520 | "flagValue": -1 521 | }, 522 | "undef": { 523 | "active": 1, 524 | "flagValue": -1 525 | }, 526 | "unused": { 527 | "active": 1, 528 | "flagValue": -1 529 | }, 530 | "varstmt": { 531 | "active": 0, 532 | "flagValue": -1 533 | }, 534 | "withstmt": { 535 | "active": 0, 536 | "flagValue": -1 537 | }, 538 | "worker": { 539 | "active": 0, 540 | "flagValue": -1 541 | }, 542 | "wsh": { 543 | "active": 0, 544 | "flagValue": -1 545 | }, 546 | "yui": { 547 | "active": 0, 548 | "flagValue": -1 549 | } 550 | }, 551 | "jsLintFlags2": { 552 | "bitwise": { 553 | "active": 0, 554 | "flagValue": -1 555 | }, 556 | "browser": { 557 | "active": 1, 558 | "flagValue": -1 559 | }, 560 | "couch": { 561 | "active": 0, 562 | "flagValue": -1 563 | }, 564 | "devel": { 565 | "active": 0, 566 | "flagValue": -1 567 | }, 568 | "es6": { 569 | "active": 0, 570 | "flagValue": -1 571 | }, 572 | "eval": { 573 | "active": 0, 574 | "flagValue": -1 575 | }, 576 | "for": { 577 | "active": 0, 578 | "flagValue": -1 579 | }, 580 | "maxlen": { 581 | "active": 0, 582 | "flagValue": 150 583 | }, 584 | "node": { 585 | "active": 0, 586 | "flagValue": -1 587 | }, 588 | "this": { 589 | "active": 0, 590 | "flagValue": -1 591 | }, 592 | "white": { 593 | "active": 0, 594 | "flagValue": -1 595 | } 596 | }, 597 | "jsonAutoOutputPathEnabled": 0, 598 | "jsonAutoOutputPathFilenamePattern": "*-min.json", 599 | "jsonAutoOutputPathRelativePath": "", 600 | "jsonAutoOutputPathReplace1": "", 601 | "jsonAutoOutputPathReplace2": "", 602 | "jsonAutoOutputPathStyle": 0, 603 | "jsonOrderOutput": 0, 604 | "jsonOutputStyle": 1, 605 | "kitAutoOutputPathEnabled": 1, 606 | "kitAutoOutputPathFilenamePattern": "*.html", 607 | "kitAutoOutputPathRelativePath": "", 608 | "kitAutoOutputPathReplace1": "", 609 | "kitAutoOutputPathReplace2": "", 610 | "kitAutoOutputPathStyle": 0, 611 | "lessAllowInsecureImports": 0, 612 | "lessAutoOutputPathEnabled": 1, 613 | "lessAutoOutputPathFilenamePattern": "*.css", 614 | "lessAutoOutputPathRelativePath": "..\/css", 615 | "lessAutoOutputPathReplace1": "less", 616 | "lessAutoOutputPathReplace2": "css", 617 | "lessAutoOutputPathStyle": 2, 618 | "lessCreateSourceMap": 0, 619 | "lessDisableJavascript": 0, 620 | "lessIeCompatibility": 1, 621 | "lessOutputStyle": 0, 622 | "lessRelativeURLS": 0, 623 | "lessStrictImports": 0, 624 | "lessStrictMath": 0, 625 | "lessStrictUnits": 0, 626 | "markdownAutoOutputPathEnabled": 1, 627 | "markdownAutoOutputPathFilenamePattern": "*.html", 628 | "markdownAutoOutputPathRelativePath": "", 629 | "markdownAutoOutputPathReplace1": "", 630 | "markdownAutoOutputPathReplace2": "", 631 | "markdownAutoOutputPathStyle": 0, 632 | "markdownCriticStyle": 0, 633 | "markdownEnableFootnotes": 0, 634 | "markdownEnableLabels": 1, 635 | "markdownEnableSmartQuotes": 1, 636 | "markdownEscapeLineBreaks": 0, 637 | "markdownMaskEmailAddresses": 1, 638 | "markdownOutputFormat": 0, 639 | "markdownOutputStyle": 0, 640 | "markdownParseMetadata": 1, 641 | "markdownProcessHTML": 0, 642 | "markdownRandomFootnoteNumbers": 0, 643 | "markdownUseCompatibilityMode": 0, 644 | "reloadFileURLs": 0, 645 | "sassAutoOutputPathEnabled": 1, 646 | "sassAutoOutputPathFilenamePattern": "*.css", 647 | "sassAutoOutputPathRelativePath": "..\/css", 648 | "sassAutoOutputPathReplace1": "sass", 649 | "sassAutoOutputPathReplace2": "css", 650 | "sassAutoOutputPathStyle": 2, 651 | "sassCreateSourceMap": 0, 652 | "sassDebugStyle": 0, 653 | "sassDecimalPrecision": 10, 654 | "sassOutputStyle": 0, 655 | "sassUseLibsass": 0, 656 | "shouldRunAutoprefixer": 0, 657 | "shouldRunBless": 0, 658 | "skippedItemsString": ".svn, .git, .hg, log, _logs, _cache, cache, logs, node_modules", 659 | "slimAutoOutputPathEnabled": 1, 660 | "slimAutoOutputPathFilenamePattern": "*.html", 661 | "slimAutoOutputPathRelativePath": "", 662 | "slimAutoOutputPathReplace1": "", 663 | "slimAutoOutputPathReplace2": "", 664 | "slimAutoOutputPathStyle": 0, 665 | "slimCompileOnly": 0, 666 | "slimLogicless": 0, 667 | "slimOutputFormat": 0, 668 | "slimOutputStyle": 1, 669 | "slimRailsCompatible": 0, 670 | "stylusAutoOutputPathEnabled": 1, 671 | "stylusAutoOutputPathFilenamePattern": "*.css", 672 | "stylusAutoOutputPathRelativePath": "..\/css", 673 | "stylusAutoOutputPathReplace1": "stylus", 674 | "stylusAutoOutputPathReplace2": "css", 675 | "stylusAutoOutputPathStyle": 2, 676 | "stylusCreateSourceMap": 0, 677 | "stylusDebugStyle": 0, 678 | "stylusImportCSS": 0, 679 | "stylusOutputStyle": 0, 680 | "stylusResolveRelativeURLS": 0, 681 | "typescriptAutoOutputPathEnabled": 1, 682 | "typescriptAutoOutputPathFilenamePattern": "*.js", 683 | "typescriptAutoOutputPathRelativePath": "\/js", 684 | "typescriptAutoOutputPathReplace1": "", 685 | "typescriptAutoOutputPathReplace2": "", 686 | "typescriptAutoOutputPathStyle": 2, 687 | "typescriptCreateDeclarationFile": 0, 688 | "typescriptCreateSourceMap": 0, 689 | "typescriptJSXMode": 0, 690 | "typescriptMinifyOutput": 0, 691 | "typescriptModuleResolutionType": 0, 692 | "typescriptModuleType": 0, 693 | "typescriptNoImplicitAny": 0, 694 | "typescriptPreserveConstEnums": 0, 695 | "typescriptRemoveComments": 0, 696 | "typescriptSuppressImplicitAnyIndexErrors": 0, 697 | "typescriptTargetECMAVersion": 0, 698 | "uglifyDefinesString": "", 699 | "uglifyFlags2": { 700 | "ascii-only": { 701 | "active": 0, 702 | "flagValue": -1 703 | }, 704 | "bare-returns": { 705 | "active": 0, 706 | "flagValue": -1 707 | }, 708 | "booleans": { 709 | "active": 1, 710 | "flagValue": -1 711 | }, 712 | "bracketize": { 713 | "active": 0, 714 | "flagValue": -1 715 | }, 716 | "cascade": { 717 | "active": 1, 718 | "flagValue": -1 719 | }, 720 | "comments": { 721 | "active": 1, 722 | "flagValue": -1 723 | }, 724 | "comparisons": { 725 | "active": 1, 726 | "flagValue": -1 727 | }, 728 | "compress": { 729 | "active": 1, 730 | "flagValue": -1 731 | }, 732 | "conditionals": { 733 | "active": 1, 734 | "flagValue": -1 735 | }, 736 | "dead_code": { 737 | "active": 0, 738 | "flagValue": -1 739 | }, 740 | "drop_console": { 741 | "active": 0, 742 | "flagValue": -1 743 | }, 744 | "drop_debugger": { 745 | "active": 1, 746 | "flagValue": -1 747 | }, 748 | "eval": { 749 | "active": 0, 750 | "flagValue": -1 751 | }, 752 | "evaluate": { 753 | "active": 1, 754 | "flagValue": -1 755 | }, 756 | "hoist_funs": { 757 | "active": 1, 758 | "flagValue": -1 759 | }, 760 | "hoist_vars": { 761 | "active": 0, 762 | "flagValue": -1 763 | }, 764 | "if_return": { 765 | "active": 1, 766 | "flagValue": -1 767 | }, 768 | "indent-level": { 769 | "active": 0, 770 | "flagValue": 4 771 | }, 772 | "indent-start": { 773 | "active": 0, 774 | "flagValue": 0 775 | }, 776 | "inline-script": { 777 | "active": 0, 778 | "flagValue": -1 779 | }, 780 | "join_vars": { 781 | "active": 1, 782 | "flagValue": -1 783 | }, 784 | "keep_fargs": { 785 | "active": 0, 786 | "flagValue": -1 787 | }, 788 | "keep_fnames": { 789 | "active": 0, 790 | "flagValue": -1 791 | }, 792 | "loops": { 793 | "active": 1, 794 | "flagValue": -1 795 | }, 796 | "mangle": { 797 | "active": 1, 798 | "flagValue": -1 799 | }, 800 | "max-line-len": { 801 | "active": 1, 802 | "flagValue": 32000 803 | }, 804 | "negate_iife": { 805 | "active": 1, 806 | "flagValue": -1 807 | }, 808 | "properties": { 809 | "active": 1, 810 | "flagValue": -1 811 | }, 812 | "pure_getters": { 813 | "active": 0, 814 | "flagValue": -1 815 | }, 816 | "quote-keys": { 817 | "active": 0, 818 | "flagValue": -1 819 | }, 820 | "screw-ie8": { 821 | "active": 0, 822 | "flagValue": -1 823 | }, 824 | "semicolons": { 825 | "active": 1, 826 | "flagValue": -1 827 | }, 828 | "sequences": { 829 | "active": 1, 830 | "flagValue": -1 831 | }, 832 | "sort": { 833 | "active": 0, 834 | "flagValue": -1 835 | }, 836 | "space-colon": { 837 | "active": 1, 838 | "flagValue": -1 839 | }, 840 | "toplevel": { 841 | "active": 0, 842 | "flagValue": -1 843 | }, 844 | "unsafe": { 845 | "active": 0, 846 | "flagValue": -1 847 | }, 848 | "unused": { 849 | "active": 0, 850 | "flagValue": -1 851 | }, 852 | "warnings": { 853 | "active": 0, 854 | "flagValue": -1 855 | }, 856 | "width": { 857 | "active": 1, 858 | "flagValue": 80 859 | } 860 | }, 861 | "uglifyReservedNamesString": "$", 862 | "websiteRelativeRoot": "" 863 | }, 864 | "settingsFileVersion": "2" 865 | } -------------------------------------------------------------------------------- /index.php: -------------------------------------------------------------------------------- 1 | -------------------------------------------------------------------------------- /languages/storefront-product-sharing.pot: -------------------------------------------------------------------------------- 1 | # Copyright (C) 2017 Storefront Product Sharing 2 | # This file is distributed under the same license as the Storefront Product Sharing package. 3 | msgid "" 4 | msgstr "" 5 | "Project-Id-Version: Storefront Product Sharing 1.0.4\n" 6 | "Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/storefront-" 7 | "product-sharing\n" 8 | "POT-Creation-Date: 2017-06-15 11:16:49+00:00\n" 9 | "MIME-Version: 1.0\n" 10 | "Content-Type: text/plain; charset=UTF-8\n" 11 | "Content-Transfer-Encoding: 8bit\n" 12 | "PO-Revision-Date: 2017-MO-DA HO:MI+ZONE\n" 13 | "Last-Translator: FULL NAME \n" 14 | "Language-Team: LANGUAGE \n" 15 | 16 | #: storefront-product-sharing.php:128 storefront-product-sharing.php:137 17 | msgid "Cheatin’ huh?" 18 | msgstr "" 19 | 20 | #: storefront-product-sharing.php:190 21 | msgid "" 22 | "Storefront Product Sharing requires that you use Storefront as your parent " 23 | "theme." 24 | msgstr "" 25 | 26 | #: storefront-product-sharing.php:190 27 | msgid "Install Storefront now" 28 | msgstr "" 29 | 30 | #: storefront-product-sharing.php:218 31 | msgid "Share on Twitter" 32 | msgstr "" 33 | 34 | #: storefront-product-sharing.php:219 35 | msgid "Share on Facebook" 36 | msgstr "" 37 | 38 | #: storefront-product-sharing.php:220 39 | msgid "Pin this product" 40 | msgstr "" 41 | 42 | #: storefront-product-sharing.php:221 43 | msgid "Share via Email" 44 | msgstr "" 45 | 46 | #. Plugin Name of the plugin/theme 47 | msgid "Storefront Product Sharing" 48 | msgstr "" 49 | 50 | #. Plugin URI of the plugin/theme 51 | msgid "https://woocommerce.com/products/storefront-product-sharing/" 52 | msgstr "" 53 | 54 | #. Description of the plugin/theme 55 | msgid "" 56 | "Add attractive social sharing icons for Facebook, Twitter, Pinterest and " 57 | "Email to your product pages." 58 | msgstr "" 59 | 60 | #. Author of the plugin/theme 61 | msgid "WooThemes" 62 | msgstr "" 63 | 64 | #. Author URI of the plugin/theme 65 | msgid "https://woocommerce.com/" 66 | msgstr "" 67 | -------------------------------------------------------------------------------- /readme.txt: -------------------------------------------------------------------------------- 1 | === Storefront Product Sharing === 2 | Contributors: woocommerce,automattic,jameskoster,woothemes,tiagonoronha 3 | Tags: woocommerce, ecommerce, storefront, social, sharing, seo 4 | Requires at least: 4.0 5 | Tested up to: 5.2 6 | Stable tag: 1.0.6 7 | License: GPLv2 or later 8 | License URI: http://www.gnu.org/licenses/gpl-2.0.html 9 | 10 | Add attractive social sharing icons for Facebook, Twitter, Pinterest and Email to your product pages. 11 | 12 | == Description == 13 | 14 | A simple plugin that adds an attractive sharing component to product pages. Prompt visitors to share your products on Facebook, Twitter, Pinterest or via Email. 15 | 16 | This plugin requires the Storefront theme and WooCommerce plugin to be installed. 17 | 18 | == Installation == 19 | 20 | 1. Upload `storefront-product-sharing` to the `/wp-content/plugins/` directory 21 | 2. Activate the plugin through the 'Plugins' menu in WordPress 22 | 3. Done! 23 | 24 | == Frequently Asked Questions == 25 | 26 | = I installed the plugin but cannot see the sharing buttons = 27 | 28 | This plugin will only work with the [Storefront](http://wordpress.org/themes/storefront/) theme and the [WooCommerce](http://wordpress.org/plugins/woocommerce/) plugin. 29 | 30 | == Screenshots == 31 | 32 | 1. The sharing buttons in action. 33 | 34 | == Changelog == 35 | 36 | = 1.0.6 - 05.06.2018 = 37 | * Fix - Compatibility with Storefront 2.3. 38 | 39 | = 1.0.5 - 04.19.2018 = 40 | * Tweak - Add `noopener noreferrer` to social media links. 41 | 42 | = 1.0.4 - 06.15.2017 = 43 | * Tweak - Open social media links in a new browser tab. 44 | 45 | = 1.0.3 - 05.11.2016 = 46 | * Tweak - Adjusted design to better suit Storefront 2.0. 47 | 48 | = 1.0.2 - 06.23.2015 = 49 | * Fix - Storefront install prompt no longer installs a child theme. 50 | 51 | = 1.0.1 - 05.21.2015 = 52 | * Fix - Properly encode spaces when adding the product title to the url. 53 | 54 | = 1.0.0 - 04.01.2015 = 55 | Initial release. 56 | -------------------------------------------------------------------------------- /storefront-product-sharing.php: -------------------------------------------------------------------------------- 1 | token = 'storefront-product-sharing'; 85 | $this->plugin_url = plugin_dir_url( __FILE__ ); 86 | $this->plugin_path = plugin_dir_path( __FILE__ ); 87 | $this->version = '1.0.6'; 88 | 89 | register_activation_hook( __FILE__, array( $this, 'install' ) ); 90 | 91 | add_action( 'init', array( $this, 'sps_load_plugin_textdomain' ) ); 92 | 93 | add_action( 'init', array( $this, 'sps_setup' ) ); 94 | } 95 | 96 | /** 97 | * Main Storefront_Product_Sharing Instance 98 | * 99 | * Ensures only one instance of Storefront_Product_Sharing is loaded or can be loaded. 100 | * 101 | * @since 1.0.0 102 | * @static 103 | * @see Storefront_Product_Sharing() 104 | * @return Main Storefront_Product_Sharing instance 105 | */ 106 | public static function instance() { 107 | if ( is_null( self::$_instance ) ) 108 | self::$_instance = new self(); 109 | return self::$_instance; 110 | } // End instance() 111 | 112 | /** 113 | * Load the localisation file. 114 | * @access public 115 | * @since 1.0.0 116 | * @return void 117 | */ 118 | public function sps_load_plugin_textdomain() { 119 | load_plugin_textdomain( 'storefront-product-sharing', false, dirname( plugin_basename( __FILE__ ) ) . '/languages/' ); 120 | } 121 | 122 | /** 123 | * Cloning is forbidden. 124 | * 125 | * @since 1.0.0 126 | */ 127 | public function __clone() { 128 | _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?' ), '1.0.0' ); 129 | } 130 | 131 | /** 132 | * Unserializing instances of this class is forbidden. 133 | * 134 | * @since 1.0.0 135 | */ 136 | public function __wakeup() { 137 | _doing_it_wrong( __FUNCTION__, __( 'Cheatin’ huh?' ), '1.0.0' ); 138 | } 139 | 140 | /** 141 | * Installation. 142 | * Runs on activation. Logs the version number and assigns a notice message to a WordPress option. 143 | * @access public 144 | * @since 1.0.0 145 | * @return void 146 | */ 147 | public function install() { 148 | $this->_log_version_number(); 149 | } 150 | 151 | /** 152 | * Log the plugin version number. 153 | * @access private 154 | * @since 1.0.0 155 | * @return void 156 | */ 157 | private function _log_version_number() { 158 | // Log the version number. 159 | update_option( $this->token . '-version', $this->version ); 160 | } 161 | 162 | /** 163 | * Setup all the things. 164 | * Only executes if Storefront or a child theme using Storefront as a parent is active and the extension specific filter returns true. 165 | * Child themes can disable this extension using the storefront_extension_boilerplate_enabled filter 166 | * @return void 167 | */ 168 | public function sps_setup() { 169 | $theme = wp_get_theme(); 170 | 171 | if ( 'Storefront' == $theme->name || 'storefront' == $theme->template && apply_filters( 'storefront_extension_boilerplate_supported', true ) ) { 172 | add_action( 'wp_enqueue_scripts', array( $this, 'sps_styles' ), 999 ); 173 | add_action( 'woocommerce_after_single_product_summary', array( $this, 'sps_product_sharing' ), 5 ); 174 | add_filter( 'body_class', array( $this, 'body_classes' ) ); 175 | 176 | // Hide the 'More' section in the customizer 177 | add_filter( 'storefront_customizer_more', '__return_false' ); 178 | } else { 179 | add_action( 'admin_notices', array( $this, 'sps_install_storefront_notice' ) ); 180 | } 181 | } 182 | 183 | /** 184 | * Adds custom classes to the array of body classes. 185 | * 186 | * @since 1.0.6 187 | * @param array $classes Classes for the body element. 188 | * @return array 189 | */ 190 | public function body_classes( $classes ) { 191 | global $storefront_version; 192 | 193 | if ( version_compare( $storefront_version, '2.3.0', '>=' ) ) { 194 | $classes[] = 'storefront-2-3'; 195 | } 196 | 197 | return $classes; 198 | } 199 | 200 | /** 201 | * Storefront install 202 | * If the user activates the plugin while having a different parent theme active, prompt them to install Storefront. 203 | * @since 1.0.0 204 | * @return void 205 | */ 206 | public function sps_install_storefront_notice() { 207 | echo '
208 |

' . __( 'Storefront Product Sharing requires that you use Storefront as your parent theme.', 'storefront-product-sharing' ) . ' ' . __( 'Install Storefront now', 'storefront-product-sharing' ) . '

209 |
'; 210 | } 211 | 212 | /** 213 | * Enqueue CSS. 214 | * @since 1.0.0 215 | * @return void 216 | */ 217 | public function sps_styles() { 218 | global $storefront_version; 219 | 220 | if ( version_compare( $storefront_version, '2.5.6', '<=') ) { 221 | wp_enqueue_style( 'font-awesome-5-brands', '//use.fontawesome.com/releases/v5.0.13/css/brands.css' ); 222 | } 223 | 224 | wp_enqueue_style( 'sps-styles', plugins_url( '/assets/css/style.css', __FILE__ ) ); 225 | } 226 | 227 | /** 228 | * Product sharing links 229 | */ 230 | public function sps_product_sharing() { 231 | $product_title = get_the_title(); 232 | $product_url = get_permalink(); 233 | $product_img = wp_get_attachment_url( get_post_thumbnail_id() ); 234 | 235 | $facebook_url = 'https://www.facebook.com/sharer/sharer.php?u=' . $product_url; 236 | $twitter_url = 'https://twitter.com/intent/tweet?text=' . rawurlencode( $product_title ) . '&url=' . $product_url; 237 | $pinterest_url = 'https://pinterest.com/pin/create/bookmarklet/?media=' . $product_img . '&url=' . $product_url . '&is_video=false&description=' . rawurlencode( $product_title ); 238 | $email_url = 'mailto:?subject=' . rawurlencode( $product_title ) . '&body=' . $product_url; 239 | ?> 240 |
241 |
    242 | 243 | 244 |
  • 245 | 246 |
247 |
248 |