Changeset 3306227
- Timestamp:
- 06/04/2025 08:30:40 AM (10 months ago)
- Location:
- productbird
- Files:
-
- 20 added
- 20 deleted
- 44 edited
- 1 copied
-
tags/1.4.0 (copied) (copied from productbird/trunk)
-
tags/1.4.0/assets/dist/css/app-C7v3lRCb.css (deleted)
-
tags/1.4.0/assets/dist/css/app-CnfCsHsY.css (added)
-
tags/1.4.0/assets/dist/css/checkbox-B15nk-DD.css (deleted)
-
tags/1.4.0/assets/dist/css/index-OqxUC7-S.css (deleted)
-
tags/1.4.0/assets/dist/css/index-vSWzvdjc.css (added)
-
tags/1.4.0/assets/dist/css/radio-group-item-BynF7j1K.css (added)
-
tags/1.4.0/assets/dist/dependencies.txt (modified) (2 diffs)
-
tags/1.4.0/assets/dist/js/app-CX74RUEH.js (deleted)
-
tags/1.4.0/assets/dist/js/app-DwG4rGfz.js (added)
-
tags/1.4.0/assets/dist/js/checkbox-CJoO4kYU.js (deleted)
-
tags/1.4.0/assets/dist/js/global-provider-C2FrZl_D.js (added)
-
tags/1.4.0/assets/dist/js/index-BariophB.js (deleted)
-
tags/1.4.0/assets/dist/js/index-CB7qvZ11.js (added)
-
tags/1.4.0/assets/dist/js/index-Dat41SOK.js (added)
-
tags/1.4.0/assets/dist/js/index-DcRCDKm4.js (deleted)
-
tags/1.4.0/assets/dist/js/index-NiypyFDT.js (deleted)
-
tags/1.4.0/assets/dist/js/index-RQtRgZhH.js (added)
-
tags/1.4.0/assets/dist/js/radio-group-item-CrRA829E.js (added)
-
tags/1.4.0/assets/dist/js/sparkles-C5kB6Bc0.js (added)
-
tags/1.4.0/assets/dist/js/sparkles-RBBW0Whr.js (deleted)
-
tags/1.4.0/assets/dist/js/x-DRo50HBZ.js (deleted)
-
tags/1.4.0/assets/dist/manifest.json (modified) (1 diff)
-
tags/1.4.0/productbird.php (modified) (1 diff)
-
tags/1.4.0/readme.txt (modified) (1 diff)
-
tags/1.4.0/src/Admin/Admin.php (modified) (3 diffs)
-
tags/1.4.0/src/Admin/GlobalAdminScript.php (modified) (4 diffs)
-
tags/1.4.0/src/Auth/OidcClient.php (modified) (19 diffs)
-
tags/1.4.0/src/FeatureFlags.php (modified) (2 diffs)
-
tags/1.4.0/src/Logger.php (modified) (8 diffs)
-
tags/1.4.0/src/Plugin.php (modified) (5 diffs)
-
tags/1.4.0/src/Rest/ClearProductMetaEndpoint.php (modified) (2 diffs)
-
tags/1.4.0/src/Rest/ClearQueuedProductsEndpoint.php (modified) (2 diffs)
-
tags/1.4.0/src/Rest/OidcCallbackEndpoint.php (modified) (4 diffs)
-
tags/1.4.0/src/Rest/OrganizationsEndpoint.php (modified) (5 diffs)
-
tags/1.4.0/src/Rest/RestUtils.php (modified) (2 diffs)
-
tags/1.4.0/src/Rest/SettingsEndpoint.php (modified) (3 diffs)
-
tags/1.4.0/src/Rest/ToolMagicDescriptionsEndpoints.php (modified) (4 diffs)
-
tags/1.4.0/src/Traits/ProductDataHelpers.php (modified) (1 diff)
-
tags/1.4.0/src/Traits/ScriptLocalization.php (modified) (1 diff)
-
tags/1.4.0/src/Traits/ToolsConfig.php (modified) (12 diffs)
-
tags/1.4.0/src/Utils.php (modified) (4 diffs)
-
tags/1.4.0/vendor/composer/installed.php (modified) (2 diffs)
-
trunk/assets/dist/css/app-C7v3lRCb.css (deleted)
-
trunk/assets/dist/css/app-CnfCsHsY.css (added)
-
trunk/assets/dist/css/checkbox-B15nk-DD.css (deleted)
-
trunk/assets/dist/css/index-OqxUC7-S.css (deleted)
-
trunk/assets/dist/css/index-vSWzvdjc.css (added)
-
trunk/assets/dist/css/radio-group-item-BynF7j1K.css (added)
-
trunk/assets/dist/dependencies.txt (modified) (2 diffs)
-
trunk/assets/dist/js/app-CX74RUEH.js (deleted)
-
trunk/assets/dist/js/app-DwG4rGfz.js (added)
-
trunk/assets/dist/js/checkbox-CJoO4kYU.js (deleted)
-
trunk/assets/dist/js/global-provider-C2FrZl_D.js (added)
-
trunk/assets/dist/js/index-BariophB.js (deleted)
-
trunk/assets/dist/js/index-CB7qvZ11.js (added)
-
trunk/assets/dist/js/index-Dat41SOK.js (added)
-
trunk/assets/dist/js/index-DcRCDKm4.js (deleted)
-
trunk/assets/dist/js/index-NiypyFDT.js (deleted)
-
trunk/assets/dist/js/index-RQtRgZhH.js (added)
-
trunk/assets/dist/js/radio-group-item-CrRA829E.js (added)
-
trunk/assets/dist/js/sparkles-C5kB6Bc0.js (added)
-
trunk/assets/dist/js/sparkles-RBBW0Whr.js (deleted)
-
trunk/assets/dist/js/x-DRo50HBZ.js (deleted)
-
trunk/assets/dist/manifest.json (modified) (1 diff)
-
trunk/productbird.php (modified) (1 diff)
-
trunk/readme.txt (modified) (1 diff)
-
trunk/src/Admin/Admin.php (modified) (3 diffs)
-
trunk/src/Admin/GlobalAdminScript.php (modified) (4 diffs)
-
trunk/src/Auth/OidcClient.php (modified) (19 diffs)
-
trunk/src/FeatureFlags.php (modified) (2 diffs)
-
trunk/src/Logger.php (modified) (8 diffs)
-
trunk/src/Plugin.php (modified) (5 diffs)
-
trunk/src/Rest/ClearProductMetaEndpoint.php (modified) (2 diffs)
-
trunk/src/Rest/ClearQueuedProductsEndpoint.php (modified) (2 diffs)
-
trunk/src/Rest/OidcCallbackEndpoint.php (modified) (4 diffs)
-
trunk/src/Rest/OrganizationsEndpoint.php (modified) (5 diffs)
-
trunk/src/Rest/RestUtils.php (modified) (2 diffs)
-
trunk/src/Rest/SettingsEndpoint.php (modified) (3 diffs)
-
trunk/src/Rest/ToolMagicDescriptionsEndpoints.php (modified) (4 diffs)
-
trunk/src/Traits/ProductDataHelpers.php (modified) (1 diff)
-
trunk/src/Traits/ScriptLocalization.php (modified) (1 diff)
-
trunk/src/Traits/ToolsConfig.php (modified) (12 diffs)
-
trunk/src/Utils.php (modified) (4 diffs)
-
trunk/vendor/composer/installed.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
productbird/tags/1.4.0/assets/dist/dependencies.txt
r3305783 r3306227 438 438 --- 439 439 440 Name: tabbable 441 Version: 6.2.0 442 License: MIT 443 Private: false 444 Description: Returns an array of all tabbable DOM nodes within a containing node. 445 Repository: git+https://github.com/focus-trap/tabbable.git 446 Homepage: https://github.com/focus-trap/tabbable#readme 447 Author: David Clark (http://davidtheclark.com/) 448 License Copyright: 449 === 450 451 The MIT License (MIT) 452 453 Copyright (c) 2015 David Clark 454 455 Permission is hereby granted, free of charge, to any person obtaining a copy 456 of this software and associated documentation files (the "Software"), to deal 457 in the Software without restriction, including without limitation the rights 458 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 459 copies of the Software, and to permit persons to whom the Software is 460 furnished to do so, subject to the following conditions: 461 462 The above copyright notice and this permission notice shall be included in all 463 copies or substantial portions of the Software. 464 465 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 466 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 467 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 468 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 469 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 470 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 471 SOFTWARE. 472 473 --- 474 475 Name: esm-env 476 Version: 1.2.2 477 License: MIT 478 Private: false 479 Repository: https://github.com/benmccann/esm-env.git 480 Homepage: https://github.com/benmccann/esm-env 481 Author: Ben McCann (https://www.benmccann.com) 482 License Copyright: 483 === 484 485 Copyright 2022 Benjamin McCann 486 487 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 488 489 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 490 491 THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 492 493 --- 494 495 Name: clsx 496 Version: 2.1.1 497 License: MIT 498 Private: false 499 Description: A tiny (239B) utility for constructing className strings conditionally. 500 Repository: undefined 501 Author: Luke Edwards <luke.edwards05@gmail.com> (https://lukeed.com) 502 License Copyright: 503 === 504 505 MIT License 506 507 Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com) 508 509 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 510 511 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 512 513 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 514 515 --- 516 440 517 Name: svelte-sonner 441 518 Version: 0.3.28 … … 631 708 --- 632 709 633 Name: tabbable634 Version: 6.2.0635 License: MIT636 Private: false637 Description: Returns an array of all tabbable DOM nodes within a containing node.638 Repository: git+https://github.com/focus-trap/tabbable.git639 Homepage: https://github.com/focus-trap/tabbable#readme640 Author: David Clark (http://davidtheclark.com/)641 License Copyright:642 ===643 644 The MIT License (MIT)645 646 Copyright (c) 2015 David Clark647 648 Permission is hereby granted, free of charge, to any person obtaining a copy649 of this software and associated documentation files (the "Software"), to deal650 in the Software without restriction, including without limitation the rights651 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell652 copies of the Software, and to permit persons to whom the Software is653 furnished to do so, subject to the following conditions:654 655 The above copyright notice and this permission notice shall be included in all656 copies or substantial portions of the Software.657 658 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR659 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,660 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE661 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER662 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,663 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE664 SOFTWARE.665 666 ---667 668 Name: esm-env669 Version: 1.2.2670 License: MIT671 Private: false672 Repository: https://github.com/benmccann/esm-env.git673 Homepage: https://github.com/benmccann/esm-env674 Author: Ben McCann (https://www.benmccann.com)675 License Copyright:676 ===677 678 Copyright 2022 Benjamin McCann679 680 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:681 682 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.683 684 THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.685 686 ---687 688 Name: clsx689 Version: 2.1.1690 License: MIT691 Private: false692 Description: A tiny (239B) utility for constructing className strings conditionally.693 Repository: undefined694 Author: Luke Edwards <luke.edwards05@gmail.com> (https://lukeed.com)695 License Copyright:696 ===697 698 MIT License699 700 Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)701 702 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:703 704 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.705 706 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.707 708 ---709 710 710 Name: tailwind-merge 711 711 Version: 3.3.0 -
productbird/tags/1.4.0/assets/dist/manifest.json
r3305807 r3306227 1 1 { 2 "_app-C 7v3lRCb.css": {3 "file": "css/app-C 7v3lRCb.css",4 "src": "_app-C 7v3lRCb.css"2 "_app-CnfCsHsY.css": { 3 "file": "css/app-CnfCsHsY.css", 4 "src": "_app-CnfCsHsY.css" 5 5 }, 6 "_app- CX74RUEH.js": {7 "file": "js/app- CX74RUEH.js",6 "_app-DwG4rGfz.js": { 7 "file": "js/app-DwG4rGfz.js", 8 8 "name": "app", 9 9 "css": [ 10 "css/app-C 7v3lRCb.css"10 "css/app-CnfCsHsY.css" 11 11 ] 12 12 }, 13 "_checkbox-B15nk-DD.css": { 14 "file": "css/checkbox-B15nk-DD.css", 15 "src": "_checkbox-B15nk-DD.css" 13 "_global-provider-C2FrZl_D.js": { 14 "file": "js/global-provider-C2FrZl_D.js", 15 "name": "global-provider", 16 "imports": [ 17 "_app-DwG4rGfz.js" 18 ] 16 19 }, 17 "_checkbox-CJoO4kYU.js": { 18 "file": "js/checkbox-CJoO4kYU.js", 19 "name": "checkbox", 20 "_radio-group-item-BynF7j1K.css": { 21 "file": "css/radio-group-item-BynF7j1K.css", 22 "src": "_radio-group-item-BynF7j1K.css" 23 }, 24 "_radio-group-item-CrRA829E.js": { 25 "file": "js/radio-group-item-CrRA829E.js", 26 "name": "radio-group-item", 20 27 "imports": [ 21 "_app- CX74RUEH.js"28 "_app-DwG4rGfz.js" 22 29 ], 23 30 "css": [ 24 "css/ checkbox-B15nk-DD.css"31 "css/radio-group-item-BynF7j1K.css" 25 32 ] 26 33 }, 27 "_sparkles- RBBW0Whr.js": {28 "file": "js/sparkles- RBBW0Whr.js",34 "_sparkles-C5kB6Bc0.js": { 35 "file": "js/sparkles-C5kB6Bc0.js", 29 36 "name": "sparkles", 30 37 "imports": [ 31 "_app-CX74RUEH.js" 32 ] 33 }, 34 "_x-DRo50HBZ.js": { 35 "file": "js/x-DRo50HBZ.js", 36 "name": "x", 37 "imports": [ 38 "_app-CX74RUEH.js" 38 "_app-DwG4rGfz.js" 39 39 ] 40 40 }, 41 41 "assets/ts/admin-settings/index.ts": { 42 "file": "js/index- NiypyFDT.js",42 "file": "js/index-Dat41SOK.js", 43 43 "name": "index", 44 44 "src": "assets/ts/admin-settings/index.ts", 45 45 "isEntry": true, 46 46 "imports": [ 47 "_app- CX74RUEH.js",48 "_ checkbox-CJoO4kYU.js",49 "_sparkles- RBBW0Whr.js"47 "_app-DwG4rGfz.js", 48 "_radio-group-item-CrRA829E.js", 49 "_sparkles-C5kB6Bc0.js" 50 50 ], 51 51 "css": [ 52 "css/index- OqxUC7-S.css"52 "css/index-vSWzvdjc.css" 53 53 ] 54 54 }, 55 55 "assets/ts/product-status-cell/index.ts": { 56 "file": "js/index- DcRCDKm4.js",56 "file": "js/index-CB7qvZ11.js", 57 57 "name": "index", 58 58 "src": "assets/ts/product-status-cell/index.ts", 59 59 "isEntry": true, 60 60 "imports": [ 61 "_app- CX74RUEH.js",62 "_ x-DRo50HBZ.js",63 "_sparkles- RBBW0Whr.js"61 "_app-DwG4rGfz.js", 62 "_global-provider-C2FrZl_D.js", 63 "_sparkles-C5kB6Bc0.js" 64 64 ] 65 65 }, 66 66 "assets/ts/tools/magic-descriptions/index.ts": { 67 "file": "js/index- BariophB.js",67 "file": "js/index-RQtRgZhH.js", 68 68 "name": "index", 69 69 "src": "assets/ts/tools/magic-descriptions/index.ts", 70 70 "isEntry": true, 71 71 "imports": [ 72 "_app- CX74RUEH.js",73 "_ checkbox-CJoO4kYU.js",74 "_ x-DRo50HBZ.js"72 "_app-DwG4rGfz.js", 73 "_radio-group-item-CrRA829E.js", 74 "_global-provider-C2FrZl_D.js" 75 75 ], 76 76 "css": [ -
productbird/tags/1.4.0/productbird.php
r3305836 r3306227 23 23 } 24 24 25 define( 'PRODUCTBIRD_VERSION', '1. 3.3' );25 define( 'PRODUCTBIRD_VERSION', '1.4.0' ); 26 26 define( 'PRODUCTBIRD_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 27 27 -
productbird/tags/1.4.0/readme.txt
r3306226 r3306227 4 4 Requires at least: 5.0 5 5 Tested up to: 6.8 6 Stable tag: 1.4.06 Stable tag: 7 7 Requires PHP: 8.0 8 8 Requires Plugins: woocommerce -
productbird/tags/1.4.0/src/Admin/Admin.php
r3305783 r3306227 13 13 use Productbird\FeatureFlags; 14 14 use Productbird\Traits\ScriptLocalization; 15 use Productbird\Utils; 15 16 16 17 /** … … 65 66 'tone' => 'expert', 66 67 'formality' => 'informal', 68 'language' => Utils::get_locale_language(), 67 69 'selected_org_id' => '', 68 70 'telemetry_opt_out' => false, … … 107 109 $output['tone'] = sanitize_text_field( $input['tone'] ); 108 110 $output['formality'] = sanitize_text_field( $input['formality'] ); 111 $output['language'] = sanitize_text_field( $input['language'] ); 109 112 $output['selected_org_id'] = sanitize_text_field( $input['selected_org_id'] ); 110 113 $output['telemetry_opt_out'] = isset( $input['telemetry_opt_out'] ) ? (bool) $input['telemetry_opt_out'] : false; -
productbird/tags/1.4.0/src/Admin/GlobalAdminScript.php
r3305783 r3306227 13 13 * Handles the global Productbird script that's loaded on all admin pages. 14 14 * 15 * @ since 0.1.015 * @package Productbird\Admin 16 16 */ 17 17 class GlobalAdminScript { … … 22 22 * Initialize hooks. 23 23 * 24 * @since 0.1.025 24 * @return void 26 25 */ … … 32 31 * Enqueue the global Productbird script on all admin pages. 33 32 * 34 * @since 0.1.035 33 * @return void 36 34 */ … … 46 44 wp_enqueue_script( 'productbird-global' ); 47 45 48 // Localize the global data 46 // Localize the global data. 49 47 wp_localize_script( 50 48 'productbird-global', -
productbird/tags/1.4.0/src/Auth/OidcClient.php
r3302180 r3306227 1 1 <?php 2 /** 3 * Handles the OpenID-Connect client flow against the Productbird app. 4 * 5 * @package Productbird\Auth 6 */ 2 7 3 8 namespace Productbird\Auth; … … 7 12 8 13 /** 9 * Handles the OpenID-Connect client flow against the Productbird 10 * app. The flow is as follows: 11 * 12 * 1. "Connect with Productbird" button sends the browser to the Productbird 13 * auth endpoint with the usual OIDC parameters. 14 * 2. After sign-in and/or consent the provider redirects the user back to our 15 * redirect URI ( /wp-json/productbird/v1/oidc/callback ). 16 * 3. We exchange the code for access & refresh tokens and persist them in a 17 * WordPress option. 18 * 4. We call the /userinfo endpoint to get the user's profile information. 14 * Handles the OpenID-Connect client flow against the Productbird app. 19 15 * 20 16 * All data is stored in regular WordPress options so it survives across 21 17 * requests and works for all admins alike. 22 18 * 23 * @ since 0.1.019 * @package Productbird\Auth 24 20 */ 25 21 class OidcClient { 26 22 27 23 /** 28 * Constants 24 * Constants. 29 25 */ 30 26 … … 48 44 49 45 /** 50 * Public bootstrap 46 * Public bootstrap. 51 47 */ 52 48 … … 54 50 * Initializes hooks for the OIDC client. 55 51 * 56 * @since 0.1.057 52 * @return void 58 53 */ … … 71 66 * Returns the Better-Auth base URL depending on local/remote environment. 72 67 * 73 * @since 0.1.074 68 * @return string The base URL for the OIDC provider. 75 69 */ … … 89 83 * Fully-qualified redirect URI that Better-Auth will send the user back to. 90 84 * 91 * @since 0.1.092 85 * @return string The redirect URI. 93 86 */ … … 99 92 * Retrieve the stored client credentials if we already registered. 100 93 * 101 * @since 0.1.0102 94 * @return array<string, string>|null Client credentials or null if not found. 103 95 */ … … 110 102 * Retrieve the stored tokens ( may be expired ). 111 103 * 112 * @since 0.1.0113 104 * @return array<string, mixed>|null Tokens or null if not found. 114 105 */ … … 124 115 * Will attempt to refresh the token if it is expired. 125 116 * 126 * @since 0.1.0127 117 * @return bool True if connected, false otherwise. 128 118 */ … … 147 137 * credentials exist yet. 148 138 * 149 * @since 0.1.0150 139 * @return string|null The authorization URL or null on failure. 151 140 */ … … 186 175 * Registers the WP site as an OAuth client with Better-Auth. 187 176 * 188 * @since 0.1.0189 177 * @return true|WP_Error True on success or WP_Error on failure. 190 178 */ … … 192 180 $body = array( 193 181 'name' => sprintf( 194 // translators: %s is the site name and %s is the site URL 182 // translators: %s is the site name and %s is the site URL. 195 183 __( '%1$s (%2$s)', 'productbird' ), 196 184 wp_specialchars_decode( get_bloginfo( 'name' ) ), … … 246 234 * Make sure we have a client_id / secret. Attempts to register if missing. 247 235 * 248 * @since 0.1.0249 236 * @return bool True if client is registered or registration was successful, false otherwise. 250 237 */ … … 270 257 * page with a status indicator. 271 258 * 272 * @since 0.1.0273 259 * @param WP_REST_Request $request The incoming REST request from the OIDC provider. 274 260 * @return WP_Error|void WP_Error on failure. Redirects on success, so effectively void. … … 352 338 * Returns the updated token array or WP_Error on failure. 353 339 * 354 * @since 0.1.0355 340 * @return array<string, mixed>|WP_Error The new token array or WP_Error on failure. 356 341 */ … … 419 404 * Returns an associative array with the claims or WP_Error on failure. 420 405 * 421 * @since 0.1.0422 406 * @return array<string, mixed>|WP_Error Userinfo claims or WP_Error. 423 407 */ … … 429 413 $tokens = $this->get_tokens(); 430 414 431 // Decode and log ID token if available 415 // Decode and log ID token if available. 432 416 if ( ! empty( $tokens['id_token'] ) ) { 433 // ID tokens are JWT format (header.payload.signature) 417 // ID tokens are JWT format (header.payload.signature). 434 418 $jwt_parts = explode( '.', $tokens['id_token'] ); 435 419 if ( count( $jwt_parts ) === 3 ) { … … 482 466 * and tokens. 483 467 * 484 * @since 0.1.0485 468 * @return void As this method always calls exit. 486 469 */ … … 503 486 * Requires an active OIDC connection. 504 487 * 505 * @since 0.1.0506 488 * @return array<mixed>|WP_Error An array of organization data or WP_Error on failure. 507 489 */ 508 490 public function get_organizations() { 509 491 if ( $this->is_connected() ) { 510 $tokens = $this->get_tokens(); // refresh_access_token() is done in is_connected()492 $tokens = $this->get_tokens(); // refresh_access_token() is done in is_connected(). 511 493 $url = $this->get_base_url() . '/api/v1/organizations/me'; 512 494 -
productbird/tags/1.4.0/src/FeatureFlags.php
r3305783 r3306227 1 1 <?php 2 /** 3 * Feature flags 4 * 5 * @package Productbird 6 */ 2 7 3 8 namespace Productbird; … … 19 24 */ 20 25 private const DEFAULT_FLAGS = array( 21 // OpenID-Connect 26 // OpenID-Connect. 22 27 'oidc' => false, 23 28 24 // Product description bulk modal 29 // Product description bulk modal. 25 30 'product_description_bulk_modal' => true, 26 31 ); -
productbird/tags/1.4.0/src/Logger.php
r3302180 r3306227 1 1 <?php 2 /** 3 * Logger class for Productbird plugin. 4 * 5 * @package Productbird 6 */ 2 7 3 8 namespace Productbird; … … 9 14 * 10 15 * @package Productbird 11 * @since 0.1.012 16 */ 13 17 class Logger { … … 24 28 * Option name for storing logs. 25 29 * 26 * @since 0.1.027 30 * @var string 28 31 */ … … 35 38 */ 36 39 private static function should_log(): bool { 37 // Log if WP_DEBUG is enabled or if running on local site 40 // Log if WP_DEBUG is enabled or if running on local site. 38 41 return ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || Utils::is_local_site(); 39 42 } … … 58 61 ); 59 62 60 // Add context if provided 63 // Add context if provided. 61 64 if ( ! empty( $context ) ) { 62 65 $formatted_message .= ' Context: ' . wp_json_encode( $context ); 63 66 } 64 67 65 // Use WordPress error_log only in development environments 68 // Use WordPress error_log only in development environments. 66 69 if ( defined( 'WP_DEBUG' ) && WP_DEBUG && defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) { 67 70 // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log … … 220 223 * Get all logs. 221 224 * 222 * @since 0.1.0223 225 * @return array 224 226 */ … … 231 233 * Clear all logs. 232 234 * 233 * @since 0.1.0234 235 * @return void 235 236 */ … … 241 242 * Get logs count. 242 243 * 243 * @since 0.1.0244 244 * @return int 245 245 */ -
productbird/tags/1.4.0/src/Plugin.php
r3305807 r3306227 1 1 <?php 2 /** 3 * Main plugin class. 4 * 5 * @package Productbird 6 */ 2 7 3 8 namespace Productbird; … … 30 35 */ 31 36 public function init(): void { 32 // Check if WooCommerce is active.33 if ( ! $this->is_woocommerce_active() ) {34 add_action( 'admin_notices', array( $this, 'woocommerce_missing_notice' ) );35 return;36 }37 38 // Hook text domain loading to the init action.39 37 add_action( 'init', array( $this, 'load_text_domain' ) ); 40 41 // Add Settings link to plugin action links42 38 add_filter( 'plugin_action_links_productbird/productbird.php', array( $this, 'add_settings_link' ) ); 43 44 // Add activation redirect45 39 add_action( 'activated_plugin', array( $this, 'handle_activation_redirect' ) ); 46 40 add_action( 'admin_init', array( $this, 'do_activation_redirect' ) ); 47 41 48 // Initialize plugin components.49 42 $this->init_components(); 50 43 } 51 44 52 /**53 * Check if WooCommerce is active.54 *55 * @return bool56 */57 private function is_woocommerce_active(): bool {58 return class_exists( 'WooCommerce' ) && function_exists( 'wc_get_product' );59 }60 61 /**62 * Display admin notice if WooCommerce is not active.63 *64 * @return void65 */66 public function woocommerce_missing_notice(): void {67 ?>68 <div class="error notice is-dismissible">69 <p><?php esc_html_e( 'Productbird requires WooCommerce to be installed and active.', 'productbird' ); ?></p>70 </div>71 <?php72 }73 45 74 46 /** … … 102 74 ( new ClearProductMetaEndpoint() )->init(); 103 75 ( new ClearQueuedProductsEndpoint() )->init(); 104 105 /**106 * Tool endpoints107 */108 76 ( new ToolMagicDescriptionsEndpoints() )->init(); 109 77 … … 125 93 */ 126 94 public function handle_activation_redirect( string $plugin ): void { 127 // Only redirect if our plugin was activated128 95 if ( 'productbird/productbird.php' !== $plugin ) { 129 96 return; … … 135 102 } 136 103 104 // phpcs:ignore WordPress.WP.Capabilities.Unknown 137 105 if ( ! current_user_can( 'manage_woocommerce' ) ) { 138 106 return; -
productbird/tags/1.4.0/src/Rest/ClearProductMetaEndpoint.php
r3305783 r3306227 49 49 '/clear-product-meta', 50 50 array( 51 'methods' => WP_REST_Server::CREATABLE, // POST51 'methods' => WP_REST_Server::CREATABLE, 52 52 'callback' => array( $this, 'handle_clear' ), 53 53 'permission_callback' => array( $this, 'check_permission' ), … … 63 63 */ 64 64 public function check_permission() { 65 // phpcs:ignore WordPress.WP.Capabilities.Unknown 65 66 return current_user_can( 'manage_woocommerce' ); 66 67 } -
productbird/tags/1.4.0/src/Rest/ClearQueuedProductsEndpoint.php
r3305807 r3306227 61 61 */ 62 62 public function check_permission() { 63 // phpcs:ignore WordPress.WP.Capabilities.Unknown 63 64 return current_user_can( 'manage_woocommerce' ); 64 65 } … … 112 113 113 114 // Build the placeholders for product IDs and meta keys. 114 $product_placeholders = implode( ',', array_fill( 0, count( $queued_product_ids ), '%d' ) );115 $product_placeholders = implode( ',', array_fill( 0, count( $queued_product_ids ), '%d' ) ); 115 116 $meta_key_placeholders = implode( ',', array_fill( 0, count( $meta_keys ), '%s' ) ); 116 117 -
productbird/tags/1.4.0/src/Rest/OidcCallbackEndpoint.php
r3302180 r3306227 1 1 <?php 2 /** 3 * Public endpoint for OIDC callback. 4 * 5 * @package Productbird\Rest 6 */ 2 7 3 8 namespace Productbird\Rest; … … 9 14 10 15 /** 11 * Public endpoint that is used as the redirect_uri for the OIDC 12 * Authorization-Code flow. The provider will call it with 13 * ?code=...&state=... 14 * and we delegate the heavy lifting to the OidcClient helper. 15 * 16 * @since 0.1.0 16 * Public endpoint that is used as the redirect_uri for the OIDC Authorization-Code flow. 17 * The provider will call it with ?code=...&state=... and we delegate the heavy lifting to the OidcClient helper. 17 18 */ 18 19 class OidcCallbackEndpoint { … … 39 40 '/oidc/callback', 40 41 array( 41 'methods' => array( \WP_REST_Server::READABLE ), // GET42 'methods' => array( \WP_REST_Server::READABLE ), 42 43 'callback' => array( $this, 'handle_callback' ), 43 'permission_callback' => '__return_true', // public endpoint44 'permission_callback' => '__return_true', 44 45 'args' => array( 45 46 'code' => array( … … 77 78 } 78 79 79 // process_callback will normally redirect + exit ;80 // process_callback will normally redirect + exit. 80 81 return new WP_REST_Response( array( 'success' => true ) ); 81 82 } -
productbird/tags/1.4.0/src/Rest/OrganizationsEndpoint.php
r3302180 r3306227 1 1 <?php 2 /** 3 * REST endpoint for managing organizations. 4 * 5 * @package Productbird\Rest 6 */ 7 2 8 namespace Productbird\Rest; 3 9 … … 9 15 * REST endpoint for managing organizations. 10 16 * 11 * @ since 0.1.017 * @package Productbird\Rest 12 18 */ 13 19 class OrganizationsEndpoint { … … 15 21 * Initialize hooks. 16 22 * 17 * @since 0.1.018 23 * @return void 19 24 */ … … 25 30 * Register REST routes. 26 31 * 27 * @since 0.1.028 32 * @return void 29 33 */ … … 45 49 * Get organizations for the current user. 46 50 * 47 * @since 0.1.048 51 * @return WP_REST_Response|WP_Error 49 52 */ -
productbird/tags/1.4.0/src/Rest/RestUtils.php
r3302180 r3306227 1 1 <?php 2 /** 3 * Utility class for REST API endpoints. 4 * 5 * @package Productbird\Rest 6 */ 2 7 3 8 namespace Productbird\Rest; … … 87 92 */ 88 93 public static function can_manage_woocommerce_permission() { 94 // phpcs:ignore WordPress.WP.Capabilities.Unknown 89 95 if ( ! current_user_can( 'manage_woocommerce' ) ) { 90 96 return new \WP_Error( -
productbird/tags/1.4.0/src/Rest/SettingsEndpoint.php
r3305783 r3306227 1 1 <?php 2 /**3 * Settings endpoint for the Productbird plugin.4 *5 * @package Productbird6 */2 /** 3 * Settings endpoint for the Productbird plugin. 4 * 5 * @package Productbird 6 */ 7 7 8 8 namespace Productbird\Rest; 9 9 10 10 use Productbird\Admin\Admin; 11 use Productbird\Utils; 11 12 use WP_REST_Request; 12 13 use WP_REST_Response; … … 71 72 'required' => false, 72 73 ), 74 'language' => array( 75 'type' => 'string', 76 'required' => false, 77 ), 73 78 'selected_org_id' => array( 74 79 'type' => 'string', … … 104 109 'tone' => 'expert', 105 110 'formality' => 'informal', 111 'language' => Utils::get_locale_language(), 106 112 'selected_org_id' => '', 107 113 'telemetry_opt_out' => false, 108 114 ); 109 $saved_settings = get_option( 'productbird_settings', array() ); 115 116 $saved_settings = get_option( 'productbird_settings', array() ); 110 117 111 118 // Merge with default settings. -
productbird/tags/1.4.0/src/Rest/ToolMagicDescriptionsEndpoints.php
r3305783 r3306227 426 426 'tone' => $options['tone'] ?? null, 427 427 'formality' => $options['formality'] ?? null, 428 'language' => $options['language'] ?? 'en', 428 429 'callback_url' => rest_url( "productbird/v1/magic-descriptions/callback?mode={$mode}" ), 429 430 ) … … 453 454 454 455 $response = $client->generate_product_description( $payloads ); 455 456 Logger::info( 'RESPONSE', $response );457 456 458 457 if ( is_wp_error( $response ) ) { … … 973 972 return new WP_REST_Response( 974 973 array( 975 'success' => true, 976 'message' => __( 'Description applied successfully.', 'productbird' ), 974 'success' => true, 975 'product_id' => $product_id, 976 'message' => __( 'Description applied successfully.', 'productbird' ), 977 977 ) 978 978 ); … … 1154 1154 'post_status' => 'publish', 1155 1155 'posts_per_page' => -1, 1156 // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query 1156 1157 'meta_query' => array( 1157 1158 'relation' => 'AND', -
productbird/tags/1.4.0/src/Traits/ProductDataHelpers.php
r3302180 r3306227 1 1 <?php 2 /** 3 * Trait containing helper methods for working with WooCommerce product data. 4 * 5 * @package Productbird\Traits 6 */ 2 7 3 8 namespace Productbird\Traits; -
productbird/tags/1.4.0/src/Traits/ScriptLocalization.php
r3302180 r3306227 1 1 <?php 2 /** 3 * Trait for sharing common script localization data between admin classes. 4 * 5 * @package Productbird\Traits 6 */ 2 7 3 8 namespace Productbird\Traits; -
productbird/tags/1.4.0/src/Traits/ToolsConfig.php
r3305783 r3306227 1 1 <?php 2 /** 3 * Trait containing helper methods for working with tools. 4 * 5 * @package Productbird\Traits 6 */ 2 7 3 8 namespace Productbird\Traits; … … 6 11 * Trait containing helper methods for working with tools. 7 12 * 8 * @ since 0.1.013 * @package Productbird\Traits 9 14 */ 10 15 trait ToolsConfig { … … 12 17 * Get the icon to use for the tool. 13 18 * 14 * @since 0.1.015 19 * @return string 16 20 */ … … 22 26 * Get the maximum batch size for bulk operations. 23 27 * 24 * @since 0.1.025 28 * @return int 26 29 */ … … 32 35 * Get shared meta key for global status. 33 36 * 34 * @since 0.1.035 37 * @return string 36 38 */ … … 42 44 * Get shared meta key for last updated. 43 45 * 44 * @since 0.1.045 46 * @return string 46 47 */ … … 52 53 * Get Magic Descriptions meta key for status. 53 54 * 54 * @since 0.1.055 55 * @return string 56 56 */ … … 62 62 * Get Magic Descriptions meta key for status ID. 63 63 * 64 * @since 0.1.065 64 * @return string 66 65 */ … … 72 71 * Get Magic Descriptions meta key for error. 73 72 * 74 * @since 0.1.075 73 * @return string 76 74 */ … … 82 80 * Get Magic Descriptions meta key for draft. 83 81 * 84 * @since 0.1.085 82 * @return string 86 83 */ … … 92 89 * Get Magic Descriptions meta key for delivered. 93 90 * 94 * @since 0.1.095 91 * @return string 96 92 */ … … 102 98 * Get Magic Descriptions meta key for declined. 103 99 * 104 * @since 0.1.0105 100 * @return string 106 101 */ -
productbird/tags/1.4.0/src/Utils.php
r3302180 r3306227 1 1 <?php 2 /** 3 * Utility class for various helper functions. 4 * 5 * @package Productbird\Utils 6 */ 2 7 3 8 namespace Productbird; … … 6 11 * Utility class for various helper functions. 7 12 * 8 * @ since 0.1.013 * @package Productbird\Utils 9 14 */ 10 15 class Utils { … … 12 17 * Detects whether the site is running on a localhost-style domain. 13 18 * 14 * @since 0.1.015 19 * @return bool True if the site URL matches local patterns, false otherwise. 16 20 */ … … 22 26 || strpos( $site_url, '.local' ) !== false; 23 27 } 28 29 /** 30 * Get the language from the get_locale() function. 31 * 32 * @return string The language code. 33 */ 34 public static function get_locale_language(): string { 35 $locale = get_locale(); 36 37 return explode( '_', $locale )[0]; 38 } 24 39 } -
productbird/tags/1.4.0/vendor/composer/installed.php
r3305836 r3306227 2 2 'root' => array( 3 3 'name' => 'productbird/productbird', 4 'pretty_version' => '1. 3.3',5 'version' => '1. 3.3.0',6 'reference' => ' 95d8f5539258458caf75890720ae42eeca97c725',4 'pretty_version' => '1.4.0', 5 'version' => '1.4.0.0', 6 'reference' => '23623f2af20c8d87c3982082dc81b533181aad4f', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 'productbird/productbird' => array( 23 'pretty_version' => '1. 3.3',24 'version' => '1. 3.3.0',25 'reference' => ' 95d8f5539258458caf75890720ae42eeca97c725',23 'pretty_version' => '1.4.0', 24 'version' => '1.4.0.0', 25 'reference' => '23623f2af20c8d87c3982082dc81b533181aad4f', 26 26 'type' => 'wordpress-plugin', 27 27 'install_path' => __DIR__ . '/../../', -
productbird/trunk/assets/dist/dependencies.txt
r3305783 r3306227 438 438 --- 439 439 440 Name: tabbable 441 Version: 6.2.0 442 License: MIT 443 Private: false 444 Description: Returns an array of all tabbable DOM nodes within a containing node. 445 Repository: git+https://github.com/focus-trap/tabbable.git 446 Homepage: https://github.com/focus-trap/tabbable#readme 447 Author: David Clark (http://davidtheclark.com/) 448 License Copyright: 449 === 450 451 The MIT License (MIT) 452 453 Copyright (c) 2015 David Clark 454 455 Permission is hereby granted, free of charge, to any person obtaining a copy 456 of this software and associated documentation files (the "Software"), to deal 457 in the Software without restriction, including without limitation the rights 458 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 459 copies of the Software, and to permit persons to whom the Software is 460 furnished to do so, subject to the following conditions: 461 462 The above copyright notice and this permission notice shall be included in all 463 copies or substantial portions of the Software. 464 465 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 466 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 467 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 468 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 469 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 470 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 471 SOFTWARE. 472 473 --- 474 475 Name: esm-env 476 Version: 1.2.2 477 License: MIT 478 Private: false 479 Repository: https://github.com/benmccann/esm-env.git 480 Homepage: https://github.com/benmccann/esm-env 481 Author: Ben McCann (https://www.benmccann.com) 482 License Copyright: 483 === 484 485 Copyright 2022 Benjamin McCann 486 487 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 488 489 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 490 491 THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 492 493 --- 494 495 Name: clsx 496 Version: 2.1.1 497 License: MIT 498 Private: false 499 Description: A tiny (239B) utility for constructing className strings conditionally. 500 Repository: undefined 501 Author: Luke Edwards <luke.edwards05@gmail.com> (https://lukeed.com) 502 License Copyright: 503 === 504 505 MIT License 506 507 Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com) 508 509 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: 510 511 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 512 513 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 514 515 --- 516 440 517 Name: svelte-sonner 441 518 Version: 0.3.28 … … 631 708 --- 632 709 633 Name: tabbable634 Version: 6.2.0635 License: MIT636 Private: false637 Description: Returns an array of all tabbable DOM nodes within a containing node.638 Repository: git+https://github.com/focus-trap/tabbable.git639 Homepage: https://github.com/focus-trap/tabbable#readme640 Author: David Clark (http://davidtheclark.com/)641 License Copyright:642 ===643 644 The MIT License (MIT)645 646 Copyright (c) 2015 David Clark647 648 Permission is hereby granted, free of charge, to any person obtaining a copy649 of this software and associated documentation files (the "Software"), to deal650 in the Software without restriction, including without limitation the rights651 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell652 copies of the Software, and to permit persons to whom the Software is653 furnished to do so, subject to the following conditions:654 655 The above copyright notice and this permission notice shall be included in all656 copies or substantial portions of the Software.657 658 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR659 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,660 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE661 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER662 LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,663 OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE664 SOFTWARE.665 666 ---667 668 Name: esm-env669 Version: 1.2.2670 License: MIT671 Private: false672 Repository: https://github.com/benmccann/esm-env.git673 Homepage: https://github.com/benmccann/esm-env674 Author: Ben McCann (https://www.benmccann.com)675 License Copyright:676 ===677 678 Copyright 2022 Benjamin McCann679 680 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:681 682 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.683 684 THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.685 686 ---687 688 Name: clsx689 Version: 2.1.1690 License: MIT691 Private: false692 Description: A tiny (239B) utility for constructing className strings conditionally.693 Repository: undefined694 Author: Luke Edwards <luke.edwards05@gmail.com> (https://lukeed.com)695 License Copyright:696 ===697 698 MIT License699 700 Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)701 702 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:703 704 The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.705 706 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.707 708 ---709 710 710 Name: tailwind-merge 711 711 Version: 3.3.0 -
productbird/trunk/assets/dist/manifest.json
r3305807 r3306227 1 1 { 2 "_app-C 7v3lRCb.css": {3 "file": "css/app-C 7v3lRCb.css",4 "src": "_app-C 7v3lRCb.css"2 "_app-CnfCsHsY.css": { 3 "file": "css/app-CnfCsHsY.css", 4 "src": "_app-CnfCsHsY.css" 5 5 }, 6 "_app- CX74RUEH.js": {7 "file": "js/app- CX74RUEH.js",6 "_app-DwG4rGfz.js": { 7 "file": "js/app-DwG4rGfz.js", 8 8 "name": "app", 9 9 "css": [ 10 "css/app-C 7v3lRCb.css"10 "css/app-CnfCsHsY.css" 11 11 ] 12 12 }, 13 "_checkbox-B15nk-DD.css": { 14 "file": "css/checkbox-B15nk-DD.css", 15 "src": "_checkbox-B15nk-DD.css" 13 "_global-provider-C2FrZl_D.js": { 14 "file": "js/global-provider-C2FrZl_D.js", 15 "name": "global-provider", 16 "imports": [ 17 "_app-DwG4rGfz.js" 18 ] 16 19 }, 17 "_checkbox-CJoO4kYU.js": { 18 "file": "js/checkbox-CJoO4kYU.js", 19 "name": "checkbox", 20 "_radio-group-item-BynF7j1K.css": { 21 "file": "css/radio-group-item-BynF7j1K.css", 22 "src": "_radio-group-item-BynF7j1K.css" 23 }, 24 "_radio-group-item-CrRA829E.js": { 25 "file": "js/radio-group-item-CrRA829E.js", 26 "name": "radio-group-item", 20 27 "imports": [ 21 "_app- CX74RUEH.js"28 "_app-DwG4rGfz.js" 22 29 ], 23 30 "css": [ 24 "css/ checkbox-B15nk-DD.css"31 "css/radio-group-item-BynF7j1K.css" 25 32 ] 26 33 }, 27 "_sparkles- RBBW0Whr.js": {28 "file": "js/sparkles- RBBW0Whr.js",34 "_sparkles-C5kB6Bc0.js": { 35 "file": "js/sparkles-C5kB6Bc0.js", 29 36 "name": "sparkles", 30 37 "imports": [ 31 "_app-CX74RUEH.js" 32 ] 33 }, 34 "_x-DRo50HBZ.js": { 35 "file": "js/x-DRo50HBZ.js", 36 "name": "x", 37 "imports": [ 38 "_app-CX74RUEH.js" 38 "_app-DwG4rGfz.js" 39 39 ] 40 40 }, 41 41 "assets/ts/admin-settings/index.ts": { 42 "file": "js/index- NiypyFDT.js",42 "file": "js/index-Dat41SOK.js", 43 43 "name": "index", 44 44 "src": "assets/ts/admin-settings/index.ts", 45 45 "isEntry": true, 46 46 "imports": [ 47 "_app- CX74RUEH.js",48 "_ checkbox-CJoO4kYU.js",49 "_sparkles- RBBW0Whr.js"47 "_app-DwG4rGfz.js", 48 "_radio-group-item-CrRA829E.js", 49 "_sparkles-C5kB6Bc0.js" 50 50 ], 51 51 "css": [ 52 "css/index- OqxUC7-S.css"52 "css/index-vSWzvdjc.css" 53 53 ] 54 54 }, 55 55 "assets/ts/product-status-cell/index.ts": { 56 "file": "js/index- DcRCDKm4.js",56 "file": "js/index-CB7qvZ11.js", 57 57 "name": "index", 58 58 "src": "assets/ts/product-status-cell/index.ts", 59 59 "isEntry": true, 60 60 "imports": [ 61 "_app- CX74RUEH.js",62 "_ x-DRo50HBZ.js",63 "_sparkles- RBBW0Whr.js"61 "_app-DwG4rGfz.js", 62 "_global-provider-C2FrZl_D.js", 63 "_sparkles-C5kB6Bc0.js" 64 64 ] 65 65 }, 66 66 "assets/ts/tools/magic-descriptions/index.ts": { 67 "file": "js/index- BariophB.js",67 "file": "js/index-RQtRgZhH.js", 68 68 "name": "index", 69 69 "src": "assets/ts/tools/magic-descriptions/index.ts", 70 70 "isEntry": true, 71 71 "imports": [ 72 "_app- CX74RUEH.js",73 "_ checkbox-CJoO4kYU.js",74 "_ x-DRo50HBZ.js"72 "_app-DwG4rGfz.js", 73 "_radio-group-item-CrRA829E.js", 74 "_global-provider-C2FrZl_D.js" 75 75 ], 76 76 "css": [ -
productbird/trunk/productbird.php
r3305836 r3306227 23 23 } 24 24 25 define( 'PRODUCTBIRD_VERSION', '1. 3.3' );25 define( 'PRODUCTBIRD_VERSION', '1.4.0' ); 26 26 define( 'PRODUCTBIRD_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); 27 27 -
productbird/trunk/readme.txt
r3306226 r3306227 4 4 Requires at least: 5.0 5 5 Tested up to: 6.8 6 Stable tag: 1.4.06 Stable tag: 7 7 Requires PHP: 8.0 8 8 Requires Plugins: woocommerce -
productbird/trunk/src/Admin/Admin.php
r3305783 r3306227 13 13 use Productbird\FeatureFlags; 14 14 use Productbird\Traits\ScriptLocalization; 15 use Productbird\Utils; 15 16 16 17 /** … … 65 66 'tone' => 'expert', 66 67 'formality' => 'informal', 68 'language' => Utils::get_locale_language(), 67 69 'selected_org_id' => '', 68 70 'telemetry_opt_out' => false, … … 107 109 $output['tone'] = sanitize_text_field( $input['tone'] ); 108 110 $output['formality'] = sanitize_text_field( $input['formality'] ); 111 $output['language'] = sanitize_text_field( $input['language'] ); 109 112 $output['selected_org_id'] = sanitize_text_field( $input['selected_org_id'] ); 110 113 $output['telemetry_opt_out'] = isset( $input['telemetry_opt_out'] ) ? (bool) $input['telemetry_opt_out'] : false; -
productbird/trunk/src/Admin/GlobalAdminScript.php
r3305783 r3306227 13 13 * Handles the global Productbird script that's loaded on all admin pages. 14 14 * 15 * @ since 0.1.015 * @package Productbird\Admin 16 16 */ 17 17 class GlobalAdminScript { … … 22 22 * Initialize hooks. 23 23 * 24 * @since 0.1.025 24 * @return void 26 25 */ … … 32 31 * Enqueue the global Productbird script on all admin pages. 33 32 * 34 * @since 0.1.035 33 * @return void 36 34 */ … … 46 44 wp_enqueue_script( 'productbird-global' ); 47 45 48 // Localize the global data 46 // Localize the global data. 49 47 wp_localize_script( 50 48 'productbird-global', -
productbird/trunk/src/Auth/OidcClient.php
r3302180 r3306227 1 1 <?php 2 /** 3 * Handles the OpenID-Connect client flow against the Productbird app. 4 * 5 * @package Productbird\Auth 6 */ 2 7 3 8 namespace Productbird\Auth; … … 7 12 8 13 /** 9 * Handles the OpenID-Connect client flow against the Productbird 10 * app. The flow is as follows: 11 * 12 * 1. "Connect with Productbird" button sends the browser to the Productbird 13 * auth endpoint with the usual OIDC parameters. 14 * 2. After sign-in and/or consent the provider redirects the user back to our 15 * redirect URI ( /wp-json/productbird/v1/oidc/callback ). 16 * 3. We exchange the code for access & refresh tokens and persist them in a 17 * WordPress option. 18 * 4. We call the /userinfo endpoint to get the user's profile information. 14 * Handles the OpenID-Connect client flow against the Productbird app. 19 15 * 20 16 * All data is stored in regular WordPress options so it survives across 21 17 * requests and works for all admins alike. 22 18 * 23 * @ since 0.1.019 * @package Productbird\Auth 24 20 */ 25 21 class OidcClient { 26 22 27 23 /** 28 * Constants 24 * Constants. 29 25 */ 30 26 … … 48 44 49 45 /** 50 * Public bootstrap 46 * Public bootstrap. 51 47 */ 52 48 … … 54 50 * Initializes hooks for the OIDC client. 55 51 * 56 * @since 0.1.057 52 * @return void 58 53 */ … … 71 66 * Returns the Better-Auth base URL depending on local/remote environment. 72 67 * 73 * @since 0.1.074 68 * @return string The base URL for the OIDC provider. 75 69 */ … … 89 83 * Fully-qualified redirect URI that Better-Auth will send the user back to. 90 84 * 91 * @since 0.1.092 85 * @return string The redirect URI. 93 86 */ … … 99 92 * Retrieve the stored client credentials if we already registered. 100 93 * 101 * @since 0.1.0102 94 * @return array<string, string>|null Client credentials or null if not found. 103 95 */ … … 110 102 * Retrieve the stored tokens ( may be expired ). 111 103 * 112 * @since 0.1.0113 104 * @return array<string, mixed>|null Tokens or null if not found. 114 105 */ … … 124 115 * Will attempt to refresh the token if it is expired. 125 116 * 126 * @since 0.1.0127 117 * @return bool True if connected, false otherwise. 128 118 */ … … 147 137 * credentials exist yet. 148 138 * 149 * @since 0.1.0150 139 * @return string|null The authorization URL or null on failure. 151 140 */ … … 186 175 * Registers the WP site as an OAuth client with Better-Auth. 187 176 * 188 * @since 0.1.0189 177 * @return true|WP_Error True on success or WP_Error on failure. 190 178 */ … … 192 180 $body = array( 193 181 'name' => sprintf( 194 // translators: %s is the site name and %s is the site URL 182 // translators: %s is the site name and %s is the site URL. 195 183 __( '%1$s (%2$s)', 'productbird' ), 196 184 wp_specialchars_decode( get_bloginfo( 'name' ) ), … … 246 234 * Make sure we have a client_id / secret. Attempts to register if missing. 247 235 * 248 * @since 0.1.0249 236 * @return bool True if client is registered or registration was successful, false otherwise. 250 237 */ … … 270 257 * page with a status indicator. 271 258 * 272 * @since 0.1.0273 259 * @param WP_REST_Request $request The incoming REST request from the OIDC provider. 274 260 * @return WP_Error|void WP_Error on failure. Redirects on success, so effectively void. … … 352 338 * Returns the updated token array or WP_Error on failure. 353 339 * 354 * @since 0.1.0355 340 * @return array<string, mixed>|WP_Error The new token array or WP_Error on failure. 356 341 */ … … 419 404 * Returns an associative array with the claims or WP_Error on failure. 420 405 * 421 * @since 0.1.0422 406 * @return array<string, mixed>|WP_Error Userinfo claims or WP_Error. 423 407 */ … … 429 413 $tokens = $this->get_tokens(); 430 414 431 // Decode and log ID token if available 415 // Decode and log ID token if available. 432 416 if ( ! empty( $tokens['id_token'] ) ) { 433 // ID tokens are JWT format (header.payload.signature) 417 // ID tokens are JWT format (header.payload.signature). 434 418 $jwt_parts = explode( '.', $tokens['id_token'] ); 435 419 if ( count( $jwt_parts ) === 3 ) { … … 482 466 * and tokens. 483 467 * 484 * @since 0.1.0485 468 * @return void As this method always calls exit. 486 469 */ … … 503 486 * Requires an active OIDC connection. 504 487 * 505 * @since 0.1.0506 488 * @return array<mixed>|WP_Error An array of organization data or WP_Error on failure. 507 489 */ 508 490 public function get_organizations() { 509 491 if ( $this->is_connected() ) { 510 $tokens = $this->get_tokens(); // refresh_access_token() is done in is_connected()492 $tokens = $this->get_tokens(); // refresh_access_token() is done in is_connected(). 511 493 $url = $this->get_base_url() . '/api/v1/organizations/me'; 512 494 -
productbird/trunk/src/FeatureFlags.php
r3305783 r3306227 1 1 <?php 2 /** 3 * Feature flags 4 * 5 * @package Productbird 6 */ 2 7 3 8 namespace Productbird; … … 19 24 */ 20 25 private const DEFAULT_FLAGS = array( 21 // OpenID-Connect 26 // OpenID-Connect. 22 27 'oidc' => false, 23 28 24 // Product description bulk modal 29 // Product description bulk modal. 25 30 'product_description_bulk_modal' => true, 26 31 ); -
productbird/trunk/src/Logger.php
r3302180 r3306227 1 1 <?php 2 /** 3 * Logger class for Productbird plugin. 4 * 5 * @package Productbird 6 */ 2 7 3 8 namespace Productbird; … … 9 14 * 10 15 * @package Productbird 11 * @since 0.1.012 16 */ 13 17 class Logger { … … 24 28 * Option name for storing logs. 25 29 * 26 * @since 0.1.027 30 * @var string 28 31 */ … … 35 38 */ 36 39 private static function should_log(): bool { 37 // Log if WP_DEBUG is enabled or if running on local site 40 // Log if WP_DEBUG is enabled or if running on local site. 38 41 return ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || Utils::is_local_site(); 39 42 } … … 58 61 ); 59 62 60 // Add context if provided 63 // Add context if provided. 61 64 if ( ! empty( $context ) ) { 62 65 $formatted_message .= ' Context: ' . wp_json_encode( $context ); 63 66 } 64 67 65 // Use WordPress error_log only in development environments 68 // Use WordPress error_log only in development environments. 66 69 if ( defined( 'WP_DEBUG' ) && WP_DEBUG && defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) { 67 70 // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log … … 220 223 * Get all logs. 221 224 * 222 * @since 0.1.0223 225 * @return array 224 226 */ … … 231 233 * Clear all logs. 232 234 * 233 * @since 0.1.0234 235 * @return void 235 236 */ … … 241 242 * Get logs count. 242 243 * 243 * @since 0.1.0244 244 * @return int 245 245 */ -
productbird/trunk/src/Plugin.php
r3305807 r3306227 1 1 <?php 2 /** 3 * Main plugin class. 4 * 5 * @package Productbird 6 */ 2 7 3 8 namespace Productbird; … … 30 35 */ 31 36 public function init(): void { 32 // Check if WooCommerce is active.33 if ( ! $this->is_woocommerce_active() ) {34 add_action( 'admin_notices', array( $this, 'woocommerce_missing_notice' ) );35 return;36 }37 38 // Hook text domain loading to the init action.39 37 add_action( 'init', array( $this, 'load_text_domain' ) ); 40 41 // Add Settings link to plugin action links42 38 add_filter( 'plugin_action_links_productbird/productbird.php', array( $this, 'add_settings_link' ) ); 43 44 // Add activation redirect45 39 add_action( 'activated_plugin', array( $this, 'handle_activation_redirect' ) ); 46 40 add_action( 'admin_init', array( $this, 'do_activation_redirect' ) ); 47 41 48 // Initialize plugin components.49 42 $this->init_components(); 50 43 } 51 44 52 /**53 * Check if WooCommerce is active.54 *55 * @return bool56 */57 private function is_woocommerce_active(): bool {58 return class_exists( 'WooCommerce' ) && function_exists( 'wc_get_product' );59 }60 61 /**62 * Display admin notice if WooCommerce is not active.63 *64 * @return void65 */66 public function woocommerce_missing_notice(): void {67 ?>68 <div class="error notice is-dismissible">69 <p><?php esc_html_e( 'Productbird requires WooCommerce to be installed and active.', 'productbird' ); ?></p>70 </div>71 <?php72 }73 45 74 46 /** … … 102 74 ( new ClearProductMetaEndpoint() )->init(); 103 75 ( new ClearQueuedProductsEndpoint() )->init(); 104 105 /**106 * Tool endpoints107 */108 76 ( new ToolMagicDescriptionsEndpoints() )->init(); 109 77 … … 125 93 */ 126 94 public function handle_activation_redirect( string $plugin ): void { 127 // Only redirect if our plugin was activated128 95 if ( 'productbird/productbird.php' !== $plugin ) { 129 96 return; … … 135 102 } 136 103 104 // phpcs:ignore WordPress.WP.Capabilities.Unknown 137 105 if ( ! current_user_can( 'manage_woocommerce' ) ) { 138 106 return; -
productbird/trunk/src/Rest/ClearProductMetaEndpoint.php
r3305783 r3306227 49 49 '/clear-product-meta', 50 50 array( 51 'methods' => WP_REST_Server::CREATABLE, // POST51 'methods' => WP_REST_Server::CREATABLE, 52 52 'callback' => array( $this, 'handle_clear' ), 53 53 'permission_callback' => array( $this, 'check_permission' ), … … 63 63 */ 64 64 public function check_permission() { 65 // phpcs:ignore WordPress.WP.Capabilities.Unknown 65 66 return current_user_can( 'manage_woocommerce' ); 66 67 } -
productbird/trunk/src/Rest/ClearQueuedProductsEndpoint.php
r3305807 r3306227 61 61 */ 62 62 public function check_permission() { 63 // phpcs:ignore WordPress.WP.Capabilities.Unknown 63 64 return current_user_can( 'manage_woocommerce' ); 64 65 } … … 112 113 113 114 // Build the placeholders for product IDs and meta keys. 114 $product_placeholders = implode( ',', array_fill( 0, count( $queued_product_ids ), '%d' ) );115 $product_placeholders = implode( ',', array_fill( 0, count( $queued_product_ids ), '%d' ) ); 115 116 $meta_key_placeholders = implode( ',', array_fill( 0, count( $meta_keys ), '%s' ) ); 116 117 -
productbird/trunk/src/Rest/OidcCallbackEndpoint.php
r3302180 r3306227 1 1 <?php 2 /** 3 * Public endpoint for OIDC callback. 4 * 5 * @package Productbird\Rest 6 */ 2 7 3 8 namespace Productbird\Rest; … … 9 14 10 15 /** 11 * Public endpoint that is used as the redirect_uri for the OIDC 12 * Authorization-Code flow. The provider will call it with 13 * ?code=...&state=... 14 * and we delegate the heavy lifting to the OidcClient helper. 15 * 16 * @since 0.1.0 16 * Public endpoint that is used as the redirect_uri for the OIDC Authorization-Code flow. 17 * The provider will call it with ?code=...&state=... and we delegate the heavy lifting to the OidcClient helper. 17 18 */ 18 19 class OidcCallbackEndpoint { … … 39 40 '/oidc/callback', 40 41 array( 41 'methods' => array( \WP_REST_Server::READABLE ), // GET42 'methods' => array( \WP_REST_Server::READABLE ), 42 43 'callback' => array( $this, 'handle_callback' ), 43 'permission_callback' => '__return_true', // public endpoint44 'permission_callback' => '__return_true', 44 45 'args' => array( 45 46 'code' => array( … … 77 78 } 78 79 79 // process_callback will normally redirect + exit ;80 // process_callback will normally redirect + exit. 80 81 return new WP_REST_Response( array( 'success' => true ) ); 81 82 } -
productbird/trunk/src/Rest/OrganizationsEndpoint.php
r3302180 r3306227 1 1 <?php 2 /** 3 * REST endpoint for managing organizations. 4 * 5 * @package Productbird\Rest 6 */ 7 2 8 namespace Productbird\Rest; 3 9 … … 9 15 * REST endpoint for managing organizations. 10 16 * 11 * @ since 0.1.017 * @package Productbird\Rest 12 18 */ 13 19 class OrganizationsEndpoint { … … 15 21 * Initialize hooks. 16 22 * 17 * @since 0.1.018 23 * @return void 19 24 */ … … 25 30 * Register REST routes. 26 31 * 27 * @since 0.1.028 32 * @return void 29 33 */ … … 45 49 * Get organizations for the current user. 46 50 * 47 * @since 0.1.048 51 * @return WP_REST_Response|WP_Error 49 52 */ -
productbird/trunk/src/Rest/RestUtils.php
r3302180 r3306227 1 1 <?php 2 /** 3 * Utility class for REST API endpoints. 4 * 5 * @package Productbird\Rest 6 */ 2 7 3 8 namespace Productbird\Rest; … … 87 92 */ 88 93 public static function can_manage_woocommerce_permission() { 94 // phpcs:ignore WordPress.WP.Capabilities.Unknown 89 95 if ( ! current_user_can( 'manage_woocommerce' ) ) { 90 96 return new \WP_Error( -
productbird/trunk/src/Rest/SettingsEndpoint.php
r3305783 r3306227 1 1 <?php 2 /**3 * Settings endpoint for the Productbird plugin.4 *5 * @package Productbird6 */2 /** 3 * Settings endpoint for the Productbird plugin. 4 * 5 * @package Productbird 6 */ 7 7 8 8 namespace Productbird\Rest; 9 9 10 10 use Productbird\Admin\Admin; 11 use Productbird\Utils; 11 12 use WP_REST_Request; 12 13 use WP_REST_Response; … … 71 72 'required' => false, 72 73 ), 74 'language' => array( 75 'type' => 'string', 76 'required' => false, 77 ), 73 78 'selected_org_id' => array( 74 79 'type' => 'string', … … 104 109 'tone' => 'expert', 105 110 'formality' => 'informal', 111 'language' => Utils::get_locale_language(), 106 112 'selected_org_id' => '', 107 113 'telemetry_opt_out' => false, 108 114 ); 109 $saved_settings = get_option( 'productbird_settings', array() ); 115 116 $saved_settings = get_option( 'productbird_settings', array() ); 110 117 111 118 // Merge with default settings. -
productbird/trunk/src/Rest/ToolMagicDescriptionsEndpoints.php
r3305783 r3306227 426 426 'tone' => $options['tone'] ?? null, 427 427 'formality' => $options['formality'] ?? null, 428 'language' => $options['language'] ?? 'en', 428 429 'callback_url' => rest_url( "productbird/v1/magic-descriptions/callback?mode={$mode}" ), 429 430 ) … … 453 454 454 455 $response = $client->generate_product_description( $payloads ); 455 456 Logger::info( 'RESPONSE', $response );457 456 458 457 if ( is_wp_error( $response ) ) { … … 973 972 return new WP_REST_Response( 974 973 array( 975 'success' => true, 976 'message' => __( 'Description applied successfully.', 'productbird' ), 974 'success' => true, 975 'product_id' => $product_id, 976 'message' => __( 'Description applied successfully.', 'productbird' ), 977 977 ) 978 978 ); … … 1154 1154 'post_status' => 'publish', 1155 1155 'posts_per_page' => -1, 1156 // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query 1156 1157 'meta_query' => array( 1157 1158 'relation' => 'AND', -
productbird/trunk/src/Traits/ProductDataHelpers.php
r3302180 r3306227 1 1 <?php 2 /** 3 * Trait containing helper methods for working with WooCommerce product data. 4 * 5 * @package Productbird\Traits 6 */ 2 7 3 8 namespace Productbird\Traits; -
productbird/trunk/src/Traits/ScriptLocalization.php
r3302180 r3306227 1 1 <?php 2 /** 3 * Trait for sharing common script localization data between admin classes. 4 * 5 * @package Productbird\Traits 6 */ 2 7 3 8 namespace Productbird\Traits; -
productbird/trunk/src/Traits/ToolsConfig.php
r3305783 r3306227 1 1 <?php 2 /** 3 * Trait containing helper methods for working with tools. 4 * 5 * @package Productbird\Traits 6 */ 2 7 3 8 namespace Productbird\Traits; … … 6 11 * Trait containing helper methods for working with tools. 7 12 * 8 * @ since 0.1.013 * @package Productbird\Traits 9 14 */ 10 15 trait ToolsConfig { … … 12 17 * Get the icon to use for the tool. 13 18 * 14 * @since 0.1.015 19 * @return string 16 20 */ … … 22 26 * Get the maximum batch size for bulk operations. 23 27 * 24 * @since 0.1.025 28 * @return int 26 29 */ … … 32 35 * Get shared meta key for global status. 33 36 * 34 * @since 0.1.035 37 * @return string 36 38 */ … … 42 44 * Get shared meta key for last updated. 43 45 * 44 * @since 0.1.045 46 * @return string 46 47 */ … … 52 53 * Get Magic Descriptions meta key for status. 53 54 * 54 * @since 0.1.055 55 * @return string 56 56 */ … … 62 62 * Get Magic Descriptions meta key for status ID. 63 63 * 64 * @since 0.1.065 64 * @return string 66 65 */ … … 72 71 * Get Magic Descriptions meta key for error. 73 72 * 74 * @since 0.1.075 73 * @return string 76 74 */ … … 82 80 * Get Magic Descriptions meta key for draft. 83 81 * 84 * @since 0.1.085 82 * @return string 86 83 */ … … 92 89 * Get Magic Descriptions meta key for delivered. 93 90 * 94 * @since 0.1.095 91 * @return string 96 92 */ … … 102 98 * Get Magic Descriptions meta key for declined. 103 99 * 104 * @since 0.1.0105 100 * @return string 106 101 */ -
productbird/trunk/src/Utils.php
r3302180 r3306227 1 1 <?php 2 /** 3 * Utility class for various helper functions. 4 * 5 * @package Productbird\Utils 6 */ 2 7 3 8 namespace Productbird; … … 6 11 * Utility class for various helper functions. 7 12 * 8 * @ since 0.1.013 * @package Productbird\Utils 9 14 */ 10 15 class Utils { … … 12 17 * Detects whether the site is running on a localhost-style domain. 13 18 * 14 * @since 0.1.015 19 * @return bool True if the site URL matches local patterns, false otherwise. 16 20 */ … … 22 26 || strpos( $site_url, '.local' ) !== false; 23 27 } 28 29 /** 30 * Get the language from the get_locale() function. 31 * 32 * @return string The language code. 33 */ 34 public static function get_locale_language(): string { 35 $locale = get_locale(); 36 37 return explode( '_', $locale )[0]; 38 } 24 39 } -
productbird/trunk/vendor/composer/installed.php
r3305836 r3306227 2 2 'root' => array( 3 3 'name' => 'productbird/productbird', 4 'pretty_version' => '1. 3.3',5 'version' => '1. 3.3.0',6 'reference' => ' 95d8f5539258458caf75890720ae42eeca97c725',4 'pretty_version' => '1.4.0', 5 'version' => '1.4.0.0', 6 'reference' => '23623f2af20c8d87c3982082dc81b533181aad4f', 7 7 'type' => 'wordpress-plugin', 8 8 'install_path' => __DIR__ . '/../../', … … 21 21 ), 22 22 'productbird/productbird' => array( 23 'pretty_version' => '1. 3.3',24 'version' => '1. 3.3.0',25 'reference' => ' 95d8f5539258458caf75890720ae42eeca97c725',23 'pretty_version' => '1.4.0', 24 'version' => '1.4.0.0', 25 'reference' => '23623f2af20c8d87c3982082dc81b533181aad4f', 26 26 'type' => 'wordpress-plugin', 27 27 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.