Plugin Directory

Changeset 3306227


Ignore:
Timestamp:
06/04/2025 08:30:40 AM (10 months ago)
Author:
productbird
Message:

Update to version 1.4.0 from GitHub

Location:
productbird
Files:
20 added
20 deleted
44 edited
1 copied

Legend:

Unmodified
Added
Removed
  • productbird/tags/1.4.0/assets/dist/dependencies.txt

    r3305783 r3306227  
    438438---
    439439
     440Name: tabbable
     441Version: 6.2.0
     442License: MIT
     443Private: false
     444Description: Returns an array of all tabbable DOM nodes within a containing node.
     445Repository: git+https://github.com/focus-trap/tabbable.git
     446Homepage: https://github.com/focus-trap/tabbable#readme
     447Author: David Clark (http://davidtheclark.com/)
     448License Copyright:
     449===
     450
     451The MIT License (MIT)
     452
     453Copyright (c) 2015 David Clark
     454
     455Permission is hereby granted, free of charge, to any person obtaining a copy
     456of this software and associated documentation files (the "Software"), to deal
     457in the Software without restriction, including without limitation the rights
     458to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     459copies of the Software, and to permit persons to whom the Software is
     460furnished to do so, subject to the following conditions:
     461
     462The above copyright notice and this permission notice shall be included in all
     463copies or substantial portions of the Software.
     464
     465THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     466IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     467FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     468AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     469LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
     470OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
     471SOFTWARE.
     472
     473---
     474
     475Name: esm-env
     476Version: 1.2.2
     477License: MIT
     478Private: false
     479Repository: https://github.com/benmccann/esm-env.git
     480Homepage: https://github.com/benmccann/esm-env
     481Author: Ben McCann (https://www.benmccann.com)
     482License Copyright:
     483===
     484
     485Copyright 2022 Benjamin McCann
     486
     487Permission 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
     489The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
     490
     491THE 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
     495Name: clsx
     496Version: 2.1.1
     497License: MIT
     498Private: false
     499Description: A tiny (239B) utility for constructing className strings conditionally.
     500Repository: undefined
     501Author: Luke Edwards <luke.edwards05@gmail.com> (https://lukeed.com)
     502License Copyright:
     503===
     504
     505MIT License
     506
     507Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
     508
     509Permission 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
     511The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
     512
     513THE 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
    440517Name: svelte-sonner
    441518Version: 0.3.28
     
    631708---
    632709
    633 Name: tabbable
    634 Version: 6.2.0
    635 License: MIT
    636 Private: false
    637 Description: Returns an array of all tabbable DOM nodes within a containing node.
    638 Repository: git+https://github.com/focus-trap/tabbable.git
    639 Homepage: https://github.com/focus-trap/tabbable#readme
    640 Author: David Clark (http://davidtheclark.com/)
    641 License Copyright:
    642 ===
    643 
    644 The MIT License (MIT)
    645 
    646 Copyright (c) 2015 David Clark
    647 
    648 Permission is hereby granted, free of charge, to any person obtaining a copy
    649 of this software and associated documentation files (the "Software"), to deal
    650 in the Software without restriction, including without limitation the rights
    651 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    652 copies of the Software, and to permit persons to whom the Software is
    653 furnished to do so, subject to the following conditions:
    654 
    655 The above copyright notice and this permission notice shall be included in all
    656 copies or substantial portions of the Software.
    657 
    658 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    659 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    660 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    661 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    662 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 THE
    664 SOFTWARE.
    665 
    666 ---
    667 
    668 Name: esm-env
    669 Version: 1.2.2
    670 License: MIT
    671 Private: false
    672 Repository: https://github.com/benmccann/esm-env.git
    673 Homepage: https://github.com/benmccann/esm-env
    674 Author: Ben McCann (https://www.benmccann.com)
    675 License Copyright:
    676 ===
    677 
    678 Copyright 2022 Benjamin McCann
    679 
    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: clsx
    689 Version: 2.1.1
    690 License: MIT
    691 Private: false
    692 Description: A tiny (239B) utility for constructing className strings conditionally.
    693 Repository: undefined
    694 Author: Luke Edwards <luke.edwards05@gmail.com> (https://lukeed.com)
    695 License Copyright:
    696 ===
    697 
    698 MIT License
    699 
    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 
    710710Name: tailwind-merge
    711711Version: 3.3.0
  • productbird/tags/1.4.0/assets/dist/manifest.json

    r3305807 r3306227  
    11{
    2   "_app-C7v3lRCb.css": {
    3     "file": "css/app-C7v3lRCb.css",
    4     "src": "_app-C7v3lRCb.css"
     2  "_app-CnfCsHsY.css": {
     3    "file": "css/app-CnfCsHsY.css",
     4    "src": "_app-CnfCsHsY.css"
    55  },
    6   "_app-CX74RUEH.js": {
    7     "file": "js/app-CX74RUEH.js",
     6  "_app-DwG4rGfz.js": {
     7    "file": "js/app-DwG4rGfz.js",
    88    "name": "app",
    99    "css": [
    10       "css/app-C7v3lRCb.css"
     10      "css/app-CnfCsHsY.css"
    1111    ]
    1212  },
    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    ]
    1619  },
    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",
    2027    "imports": [
    21       "_app-CX74RUEH.js"
     28      "_app-DwG4rGfz.js"
    2229    ],
    2330    "css": [
    24       "css/checkbox-B15nk-DD.css"
     31      "css/radio-group-item-BynF7j1K.css"
    2532    ]
    2633  },
    27   "_sparkles-RBBW0Whr.js": {
    28     "file": "js/sparkles-RBBW0Whr.js",
     34  "_sparkles-C5kB6Bc0.js": {
     35    "file": "js/sparkles-C5kB6Bc0.js",
    2936    "name": "sparkles",
    3037    "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"
    3939    ]
    4040  },
    4141  "assets/ts/admin-settings/index.ts": {
    42     "file": "js/index-NiypyFDT.js",
     42    "file": "js/index-Dat41SOK.js",
    4343    "name": "index",
    4444    "src": "assets/ts/admin-settings/index.ts",
    4545    "isEntry": true,
    4646    "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"
    5050    ],
    5151    "css": [
    52       "css/index-OqxUC7-S.css"
     52      "css/index-vSWzvdjc.css"
    5353    ]
    5454  },
    5555  "assets/ts/product-status-cell/index.ts": {
    56     "file": "js/index-DcRCDKm4.js",
     56    "file": "js/index-CB7qvZ11.js",
    5757    "name": "index",
    5858    "src": "assets/ts/product-status-cell/index.ts",
    5959    "isEntry": true,
    6060    "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"
    6464    ]
    6565  },
    6666  "assets/ts/tools/magic-descriptions/index.ts": {
    67     "file": "js/index-BariophB.js",
     67    "file": "js/index-RQtRgZhH.js",
    6868    "name": "index",
    6969    "src": "assets/ts/tools/magic-descriptions/index.ts",
    7070    "isEntry": true,
    7171    "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"
    7575    ],
    7676    "css": [
  • productbird/tags/1.4.0/productbird.php

    r3305836 r3306227  
    2323}
    2424
    25 define( 'PRODUCTBIRD_VERSION', '1.3.3' );
     25define( 'PRODUCTBIRD_VERSION', '1.4.0' );
    2626define( 'PRODUCTBIRD_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    2727
  • productbird/tags/1.4.0/readme.txt

    r3306226 r3306227  
    44Requires at least: 5.0
    55Tested up to: 6.8
    6 Stable tag: 1.4.0
     6Stable tag:
    77Requires PHP: 8.0
    88Requires Plugins: woocommerce
  • productbird/tags/1.4.0/src/Admin/Admin.php

    r3305783 r3306227  
    1313use Productbird\FeatureFlags;
    1414use Productbird\Traits\ScriptLocalization;
     15use Productbird\Utils;
    1516
    1617/**
     
    6566                    'tone'              => 'expert',
    6667                    'formality'         => 'informal',
     68                    'language'          => Utils::get_locale_language(),
    6769                    'selected_org_id'   => '',
    6870                    'telemetry_opt_out' => false,
     
    107109        $output['tone']              = sanitize_text_field( $input['tone'] );
    108110        $output['formality']         = sanitize_text_field( $input['formality'] );
     111        $output['language']          = sanitize_text_field( $input['language'] );
    109112        $output['selected_org_id']   = sanitize_text_field( $input['selected_org_id'] );
    110113        $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  
    1313 * Handles the global Productbird script that's loaded on all admin pages.
    1414 *
    15  * @since 0.1.0
     15 * @package Productbird\Admin
    1616 */
    1717class GlobalAdminScript {
     
    2222     * Initialize hooks.
    2323     *
    24      * @since 0.1.0
    2524     * @return void
    2625     */
     
    3231     * Enqueue the global Productbird script on all admin pages.
    3332     *
    34      * @since 0.1.0
    3533     * @return void
    3634     */
     
    4644        wp_enqueue_script( 'productbird-global' );
    4745
    48         // Localize the global data
     46        // Localize the global data.
    4947        wp_localize_script(
    5048            'productbird-global',
  • productbird/tags/1.4.0/src/Auth/OidcClient.php

    r3302180 r3306227  
    11<?php
     2/**
     3 * Handles the OpenID-Connect client flow against the Productbird app.
     4 *
     5 * @package Productbird\Auth
     6 */
    27
    38namespace Productbird\Auth;
     
    712
    813/**
    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.
    1915 *
    2016 * All data is stored in regular WordPress options so it survives across
    2117 * requests and works for all admins alike.
    2218 *
    23  * @since 0.1.0
     19 * @package Productbird\Auth
    2420 */
    2521class OidcClient {
    2622
    2723    /**
    28      * Constants
     24     * Constants.
    2925     */
    3026
     
    4844
    4945    /**
    50      * Public bootstrap
     46     * Public bootstrap.
    5147     */
    5248
     
    5450     * Initializes hooks for the OIDC client.
    5551     *
    56      * @since 0.1.0
    5752     * @return void
    5853     */
     
    7166     * Returns the Better-Auth base URL depending on local/remote environment.
    7267     *
    73      * @since 0.1.0
    7468     * @return string The base URL for the OIDC provider.
    7569     */
     
    8983     * Fully-qualified redirect URI that Better-Auth will send the user back to.
    9084     *
    91      * @since 0.1.0
    9285     * @return string The redirect URI.
    9386     */
     
    9992     * Retrieve the stored client credentials if we already registered.
    10093     *
    101      * @since 0.1.0
    10294     * @return array<string, string>|null Client credentials or null if not found.
    10395     */
     
    110102     * Retrieve the stored tokens ( may be expired ).
    111103     *
    112      * @since 0.1.0
    113104     * @return array<string, mixed>|null Tokens or null if not found.
    114105     */
     
    124115     * Will attempt to refresh the token if it is expired.
    125116     *
    126      * @since 0.1.0
    127117     * @return bool True if connected, false otherwise.
    128118     */
     
    147137     * credentials exist yet.
    148138     *
    149      * @since 0.1.0
    150139     * @return string|null The authorization URL or null on failure.
    151140     */
     
    186175     * Registers the WP site as an OAuth client with Better-Auth.
    187176     *
    188      * @since 0.1.0
    189177     * @return true|WP_Error True on success or WP_Error on failure.
    190178     */
     
    192180        $body = array(
    193181            '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.
    195183                __( '%1$s (%2$s)', 'productbird' ),
    196184                wp_specialchars_decode( get_bloginfo( 'name' ) ),
     
    246234     * Make sure we have a client_id / secret. Attempts to register if missing.
    247235     *
    248      * @since 0.1.0
    249236     * @return bool True if client is registered or registration was successful, false otherwise.
    250237     */
     
    270257     * page with a status indicator.
    271258     *
    272      * @since 0.1.0
    273259     * @param WP_REST_Request $request The incoming REST request from the OIDC provider.
    274260     * @return WP_Error|void WP_Error on failure. Redirects on success, so effectively void.
     
    352338     * Returns the updated token array or WP_Error on failure.
    353339     *
    354      * @since 0.1.0
    355340     * @return array<string, mixed>|WP_Error The new token array or WP_Error on failure.
    356341     */
     
    419404     * Returns an associative array with the claims or WP_Error on failure.
    420405     *
    421      * @since 0.1.0
    422406     * @return array<string, mixed>|WP_Error Userinfo claims or WP_Error.
    423407     */
     
    429413        $tokens = $this->get_tokens();
    430414
    431         // Decode and log ID token if available
     415        // Decode and log ID token if available.
    432416        if ( ! empty( $tokens['id_token'] ) ) {
    433             // ID tokens are JWT format (header.payload.signature)
     417            // ID tokens are JWT format (header.payload.signature).
    434418            $jwt_parts = explode( '.', $tokens['id_token'] );
    435419            if ( count( $jwt_parts ) === 3 ) {
     
    482466     * and tokens.
    483467     *
    484      * @since 0.1.0
    485468     * @return void As this method always calls exit.
    486469     */
     
    503486     * Requires an active OIDC connection.
    504487     *
    505      * @since 0.1.0
    506488     * @return array<mixed>|WP_Error An array of organization data or WP_Error on failure.
    507489     */
    508490    public function get_organizations() {
    509491        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().
    511493            $url    = $this->get_base_url() . '/api/v1/organizations/me';
    512494
  • productbird/tags/1.4.0/src/FeatureFlags.php

    r3305783 r3306227  
    11<?php
     2/**
     3 * Feature flags
     4 *
     5 * @package Productbird
     6 */
    27
    38namespace Productbird;
     
    1924     */
    2025    private const DEFAULT_FLAGS = array(
    21         // OpenID-Connect
     26        // OpenID-Connect.
    2227        'oidc'                           => false,
    2328
    24         // Product description bulk modal
     29        // Product description bulk modal.
    2530        'product_description_bulk_modal' => true,
    2631    );
  • productbird/tags/1.4.0/src/Logger.php

    r3302180 r3306227  
    11<?php
     2/**
     3 * Logger class for Productbird plugin.
     4 *
     5 * @package Productbird
     6 */
    27
    38namespace Productbird;
     
    914 *
    1015 * @package Productbird
    11  * @since 0.1.0
    1216 */
    1317class Logger {
     
    2428     * Option name for storing logs.
    2529     *
    26      * @since 0.1.0
    2730     * @var string
    2831     */
     
    3538     */
    3639    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.
    3841        return ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || Utils::is_local_site();
    3942    }
     
    5861        );
    5962
    60         // Add context if provided
     63        // Add context if provided.
    6164        if ( ! empty( $context ) ) {
    6265            $formatted_message .= ' Context: ' . wp_json_encode( $context );
    6366        }
    6467
    65         // Use WordPress error_log only in development environments
     68        // Use WordPress error_log only in development environments.
    6669        if ( defined( 'WP_DEBUG' ) && WP_DEBUG && defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) {
    6770            // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     
    220223     * Get all logs.
    221224     *
    222      * @since 0.1.0
    223225     * @return array
    224226     */
     
    231233     * Clear all logs.
    232234     *
    233      * @since 0.1.0
    234235     * @return void
    235236     */
     
    241242     * Get logs count.
    242243     *
    243      * @since 0.1.0
    244244     * @return int
    245245     */
  • productbird/tags/1.4.0/src/Plugin.php

    r3305807 r3306227  
    11<?php
     2/**
     3 * Main plugin class.
     4 *
     5 * @package Productbird
     6 */
    27
    38namespace Productbird;
     
    3035     */
    3136    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.
    3937        add_action( 'init', array( $this, 'load_text_domain' ) );
    40 
    41         // Add Settings link to plugin action links
    4238        add_filter( 'plugin_action_links_productbird/productbird.php', array( $this, 'add_settings_link' ) );
    43 
    44         // Add activation redirect
    4539        add_action( 'activated_plugin', array( $this, 'handle_activation_redirect' ) );
    4640        add_action( 'admin_init', array( $this, 'do_activation_redirect' ) );
    4741
    48         // Initialize plugin components.
    4942        $this->init_components();
    5043    }
    5144
    52     /**
    53      * Check if WooCommerce is active.
    54      *
    55      * @return bool
    56      */
    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 void
    65      */
    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         <?php
    72     }
    7345
    7446    /**
     
    10274        ( new ClearProductMetaEndpoint() )->init();
    10375        ( new ClearQueuedProductsEndpoint() )->init();
    104 
    105         /**
    106          * Tool endpoints
    107          */
    10876        ( new ToolMagicDescriptionsEndpoints() )->init();
    10977
     
    12593     */
    12694    public function handle_activation_redirect( string $plugin ): void {
    127         // Only redirect if our plugin was activated
    12895        if ( 'productbird/productbird.php' !== $plugin ) {
    12996            return;
     
    135102        }
    136103
     104        // phpcs:ignore WordPress.WP.Capabilities.Unknown
    137105        if ( ! current_user_can( 'manage_woocommerce' ) ) {
    138106            return;
  • productbird/tags/1.4.0/src/Rest/ClearProductMetaEndpoint.php

    r3305783 r3306227  
    4949            '/clear-product-meta',
    5050            array(
    51                 'methods'             => WP_REST_Server::CREATABLE, // POST
     51                'methods'             => WP_REST_Server::CREATABLE,
    5252                'callback'            => array( $this, 'handle_clear' ),
    5353                'permission_callback' => array( $this, 'check_permission' ),
     
    6363     */
    6464    public function check_permission() {
     65        // phpcs:ignore WordPress.WP.Capabilities.Unknown
    6566        return current_user_can( 'manage_woocommerce' );
    6667    }
  • productbird/tags/1.4.0/src/Rest/ClearQueuedProductsEndpoint.php

    r3305807 r3306227  
    6161     */
    6262    public function check_permission() {
     63        // phpcs:ignore WordPress.WP.Capabilities.Unknown
    6364        return current_user_can( 'manage_woocommerce' );
    6465    }
     
    112113
    113114        // 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' ) );
    115116        $meta_key_placeholders = implode( ',', array_fill( 0, count( $meta_keys ), '%s' ) );
    116117
  • productbird/tags/1.4.0/src/Rest/OidcCallbackEndpoint.php

    r3302180 r3306227  
    11<?php
     2/**
     3 * Public endpoint for OIDC callback.
     4 *
     5 * @package Productbird\Rest
     6 */
    27
    38namespace Productbird\Rest;
     
    914
    1015/**
    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.
    1718 */
    1819class OidcCallbackEndpoint {
     
    3940            '/oidc/callback',
    4041            array(
    41                 'methods'             => array( \WP_REST_Server::READABLE ), // GET
     42                'methods'             => array( \WP_REST_Server::READABLE ),
    4243                'callback'            => array( $this, 'handle_callback' ),
    43                 'permission_callback' => '__return_true', // public endpoint
     44                'permission_callback' => '__return_true',
    4445                'args'                => array(
    4546                    'code'  => array(
     
    7778        }
    7879
    79         // process_callback will normally redirect + exit;
     80        // process_callback will normally redirect + exit.
    8081        return new WP_REST_Response( array( 'success' => true ) );
    8182    }
  • productbird/tags/1.4.0/src/Rest/OrganizationsEndpoint.php

    r3302180 r3306227  
    11<?php
     2/**
     3 * REST endpoint for managing organizations.
     4 *
     5 * @package Productbird\Rest
     6 */
     7
    28namespace Productbird\Rest;
    39
     
    915 * REST endpoint for managing organizations.
    1016 *
    11  * @since 0.1.0
     17 * @package Productbird\Rest
    1218 */
    1319class OrganizationsEndpoint {
     
    1521     * Initialize hooks.
    1622     *
    17      * @since 0.1.0
    1823     * @return void
    1924     */
     
    2530     * Register REST routes.
    2631     *
    27      * @since 0.1.0
    2832     * @return void
    2933     */
     
    4549     * Get organizations for the current user.
    4650     *
    47      * @since 0.1.0
    4851     * @return WP_REST_Response|WP_Error
    4952     */
  • productbird/tags/1.4.0/src/Rest/RestUtils.php

    r3302180 r3306227  
    11<?php
     2/**
     3 * Utility class for REST API endpoints.
     4 *
     5 * @package Productbird\Rest
     6 */
    27
    38namespace Productbird\Rest;
     
    8792     */
    8893    public static function can_manage_woocommerce_permission() {
     94        // phpcs:ignore WordPress.WP.Capabilities.Unknown
    8995        if ( ! current_user_can( 'manage_woocommerce' ) ) {
    9096            return new \WP_Error(
  • productbird/tags/1.4.0/src/Rest/SettingsEndpoint.php

    r3305783 r3306227  
    11<?php
    2 /**
    3  * Settings endpoint for the Productbird plugin.
    4  *
    5  * @package Productbird
    6  */
     2    /**
     3    * Settings endpoint for the Productbird plugin.
     4    *
     5    * @package Productbird
     6    */
    77
    88namespace Productbird\Rest;
    99
    1010use Productbird\Admin\Admin;
     11use Productbird\Utils;
    1112use WP_REST_Request;
    1213use WP_REST_Response;
     
    7172                        'required' => false,
    7273                    ),
     74                    'language'          => array(
     75                        'type'     => 'string',
     76                        'required' => false,
     77                    ),
    7378                    'selected_org_id'   => array(
    7479                        'type'     => 'string',
     
    104109            'tone'              => 'expert',
    105110            'formality'         => 'informal',
     111            'language'          => Utils::get_locale_language(),
    106112            'selected_org_id'   => '',
    107113            'telemetry_opt_out' => false,
    108114        );
    109         $saved_settings   = get_option( 'productbird_settings', array() );
     115
     116        $saved_settings = get_option( 'productbird_settings', array() );
    110117
    111118        // Merge with default settings.
  • productbird/tags/1.4.0/src/Rest/ToolMagicDescriptionsEndpoints.php

    r3305783 r3306227  
    426426                    'tone'         => $options['tone'] ?? null,
    427427                    'formality'    => $options['formality'] ?? null,
     428                    'language'     => $options['language'] ?? 'en',
    428429                    'callback_url' => rest_url( "productbird/v1/magic-descriptions/callback?mode={$mode}" ),
    429430                )
     
    453454
    454455            $response = $client->generate_product_description( $payloads );
    455 
    456             Logger::info( 'RESPONSE', $response );
    457456
    458457            if ( is_wp_error( $response ) ) {
     
    973972        return new WP_REST_Response(
    974973            array(
    975                 'success' => true,
    976                 'message' => __( 'Description applied successfully.', 'productbird' ),
     974                'success'    => true,
     975                'product_id' => $product_id,
     976                'message'    => __( 'Description applied successfully.', 'productbird' ),
    977977            )
    978978        );
     
    11541154            'post_status'    => 'publish',
    11551155            'posts_per_page' => -1,
     1156            // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query
    11561157            'meta_query'     => array(
    11571158                'relation' => 'AND',
  • productbird/tags/1.4.0/src/Traits/ProductDataHelpers.php

    r3302180 r3306227  
    11<?php
     2/**
     3 * Trait containing helper methods for working with WooCommerce product data.
     4 *
     5 * @package Productbird\Traits
     6 */
    27
    38namespace Productbird\Traits;
  • productbird/tags/1.4.0/src/Traits/ScriptLocalization.php

    r3302180 r3306227  
    11<?php
     2/**
     3 * Trait for sharing common script localization data between admin classes.
     4 *
     5 * @package Productbird\Traits
     6 */
    27
    38namespace Productbird\Traits;
  • productbird/tags/1.4.0/src/Traits/ToolsConfig.php

    r3305783 r3306227  
    11<?php
     2/**
     3 * Trait containing helper methods for working with tools.
     4 *
     5 * @package Productbird\Traits
     6 */
    27
    38namespace Productbird\Traits;
     
    611 * Trait containing helper methods for working with tools.
    712 *
    8  * @since 0.1.0
     13 * @package Productbird\Traits
    914 */
    1015trait ToolsConfig {
     
    1217     * Get the icon to use for the tool.
    1318     *
    14      * @since 0.1.0
    1519     * @return string
    1620     */
     
    2226     * Get the maximum batch size for bulk operations.
    2327     *
    24      * @since 0.1.0
    2528     * @return int
    2629     */
     
    3235     * Get shared meta key for global status.
    3336     *
    34      * @since 0.1.0
    3537     * @return string
    3638     */
     
    4244     * Get shared meta key for last updated.
    4345     *
    44      * @since 0.1.0
    4546     * @return string
    4647     */
     
    5253     * Get Magic Descriptions meta key for status.
    5354     *
    54      * @since 0.1.0
    5555     * @return string
    5656     */
     
    6262     * Get Magic Descriptions meta key for status ID.
    6363     *
    64      * @since 0.1.0
    6564     * @return string
    6665     */
     
    7271     * Get Magic Descriptions meta key for error.
    7372     *
    74      * @since 0.1.0
    7573     * @return string
    7674     */
     
    8280     * Get Magic Descriptions meta key for draft.
    8381     *
    84      * @since 0.1.0
    8582     * @return string
    8683     */
     
    9289     * Get Magic Descriptions meta key for delivered.
    9390     *
    94      * @since 0.1.0
    9591     * @return string
    9692     */
     
    10298     * Get Magic Descriptions meta key for declined.
    10399     *
    104      * @since 0.1.0
    105100     * @return string
    106101     */
  • productbird/tags/1.4.0/src/Utils.php

    r3302180 r3306227  
    11<?php
     2/**
     3 * Utility class for various helper functions.
     4 *
     5 * @package Productbird\Utils
     6 */
    27
    38namespace Productbird;
     
    611 * Utility class for various helper functions.
    712 *
    8  * @since 0.1.0
     13 * @package Productbird\Utils
    914 */
    1015class Utils {
     
    1217     * Detects whether the site is running on a localhost-style domain.
    1318     *
    14      * @since 0.1.0
    1519     * @return bool True if the site URL matches local patterns, false otherwise.
    1620     */
     
    2226            || strpos( $site_url, '.local' ) !== false;
    2327    }
     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    }
    2439}
  • productbird/tags/1.4.0/vendor/composer/installed.php

    r3305836 r3306227  
    22    'root' => array(
    33        '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',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        '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',
    2626            'type' => 'wordpress-plugin',
    2727            'install_path' => __DIR__ . '/../../',
  • productbird/trunk/assets/dist/dependencies.txt

    r3305783 r3306227  
    438438---
    439439
     440Name: tabbable
     441Version: 6.2.0
     442License: MIT
     443Private: false
     444Description: Returns an array of all tabbable DOM nodes within a containing node.
     445Repository: git+https://github.com/focus-trap/tabbable.git
     446Homepage: https://github.com/focus-trap/tabbable#readme
     447Author: David Clark (http://davidtheclark.com/)
     448License Copyright:
     449===
     450
     451The MIT License (MIT)
     452
     453Copyright (c) 2015 David Clark
     454
     455Permission is hereby granted, free of charge, to any person obtaining a copy
     456of this software and associated documentation files (the "Software"), to deal
     457in the Software without restriction, including without limitation the rights
     458to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
     459copies of the Software, and to permit persons to whom the Software is
     460furnished to do so, subject to the following conditions:
     461
     462The above copyright notice and this permission notice shall be included in all
     463copies or substantial portions of the Software.
     464
     465THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
     466IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
     467FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
     468AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
     469LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
     470OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
     471SOFTWARE.
     472
     473---
     474
     475Name: esm-env
     476Version: 1.2.2
     477License: MIT
     478Private: false
     479Repository: https://github.com/benmccann/esm-env.git
     480Homepage: https://github.com/benmccann/esm-env
     481Author: Ben McCann (https://www.benmccann.com)
     482License Copyright:
     483===
     484
     485Copyright 2022 Benjamin McCann
     486
     487Permission 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
     489The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
     490
     491THE 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
     495Name: clsx
     496Version: 2.1.1
     497License: MIT
     498Private: false
     499Description: A tiny (239B) utility for constructing className strings conditionally.
     500Repository: undefined
     501Author: Luke Edwards <luke.edwards05@gmail.com> (https://lukeed.com)
     502License Copyright:
     503===
     504
     505MIT License
     506
     507Copyright (c) Luke Edwards <luke.edwards05@gmail.com> (lukeed.com)
     508
     509Permission 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
     511The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
     512
     513THE 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
    440517Name: svelte-sonner
    441518Version: 0.3.28
     
    631708---
    632709
    633 Name: tabbable
    634 Version: 6.2.0
    635 License: MIT
    636 Private: false
    637 Description: Returns an array of all tabbable DOM nodes within a containing node.
    638 Repository: git+https://github.com/focus-trap/tabbable.git
    639 Homepage: https://github.com/focus-trap/tabbable#readme
    640 Author: David Clark (http://davidtheclark.com/)
    641 License Copyright:
    642 ===
    643 
    644 The MIT License (MIT)
    645 
    646 Copyright (c) 2015 David Clark
    647 
    648 Permission is hereby granted, free of charge, to any person obtaining a copy
    649 of this software and associated documentation files (the "Software"), to deal
    650 in the Software without restriction, including without limitation the rights
    651 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
    652 copies of the Software, and to permit persons to whom the Software is
    653 furnished to do so, subject to the following conditions:
    654 
    655 The above copyright notice and this permission notice shall be included in all
    656 copies or substantial portions of the Software.
    657 
    658 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
    659 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
    660 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
    661 AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
    662 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 THE
    664 SOFTWARE.
    665 
    666 ---
    667 
    668 Name: esm-env
    669 Version: 1.2.2
    670 License: MIT
    671 Private: false
    672 Repository: https://github.com/benmccann/esm-env.git
    673 Homepage: https://github.com/benmccann/esm-env
    674 Author: Ben McCann (https://www.benmccann.com)
    675 License Copyright:
    676 ===
    677 
    678 Copyright 2022 Benjamin McCann
    679 
    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: clsx
    689 Version: 2.1.1
    690 License: MIT
    691 Private: false
    692 Description: A tiny (239B) utility for constructing className strings conditionally.
    693 Repository: undefined
    694 Author: Luke Edwards <luke.edwards05@gmail.com> (https://lukeed.com)
    695 License Copyright:
    696 ===
    697 
    698 MIT License
    699 
    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 
    710710Name: tailwind-merge
    711711Version: 3.3.0
  • productbird/trunk/assets/dist/manifest.json

    r3305807 r3306227  
    11{
    2   "_app-C7v3lRCb.css": {
    3     "file": "css/app-C7v3lRCb.css",
    4     "src": "_app-C7v3lRCb.css"
     2  "_app-CnfCsHsY.css": {
     3    "file": "css/app-CnfCsHsY.css",
     4    "src": "_app-CnfCsHsY.css"
    55  },
    6   "_app-CX74RUEH.js": {
    7     "file": "js/app-CX74RUEH.js",
     6  "_app-DwG4rGfz.js": {
     7    "file": "js/app-DwG4rGfz.js",
    88    "name": "app",
    99    "css": [
    10       "css/app-C7v3lRCb.css"
     10      "css/app-CnfCsHsY.css"
    1111    ]
    1212  },
    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    ]
    1619  },
    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",
    2027    "imports": [
    21       "_app-CX74RUEH.js"
     28      "_app-DwG4rGfz.js"
    2229    ],
    2330    "css": [
    24       "css/checkbox-B15nk-DD.css"
     31      "css/radio-group-item-BynF7j1K.css"
    2532    ]
    2633  },
    27   "_sparkles-RBBW0Whr.js": {
    28     "file": "js/sparkles-RBBW0Whr.js",
     34  "_sparkles-C5kB6Bc0.js": {
     35    "file": "js/sparkles-C5kB6Bc0.js",
    2936    "name": "sparkles",
    3037    "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"
    3939    ]
    4040  },
    4141  "assets/ts/admin-settings/index.ts": {
    42     "file": "js/index-NiypyFDT.js",
     42    "file": "js/index-Dat41SOK.js",
    4343    "name": "index",
    4444    "src": "assets/ts/admin-settings/index.ts",
    4545    "isEntry": true,
    4646    "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"
    5050    ],
    5151    "css": [
    52       "css/index-OqxUC7-S.css"
     52      "css/index-vSWzvdjc.css"
    5353    ]
    5454  },
    5555  "assets/ts/product-status-cell/index.ts": {
    56     "file": "js/index-DcRCDKm4.js",
     56    "file": "js/index-CB7qvZ11.js",
    5757    "name": "index",
    5858    "src": "assets/ts/product-status-cell/index.ts",
    5959    "isEntry": true,
    6060    "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"
    6464    ]
    6565  },
    6666  "assets/ts/tools/magic-descriptions/index.ts": {
    67     "file": "js/index-BariophB.js",
     67    "file": "js/index-RQtRgZhH.js",
    6868    "name": "index",
    6969    "src": "assets/ts/tools/magic-descriptions/index.ts",
    7070    "isEntry": true,
    7171    "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"
    7575    ],
    7676    "css": [
  • productbird/trunk/productbird.php

    r3305836 r3306227  
    2323}
    2424
    25 define( 'PRODUCTBIRD_VERSION', '1.3.3' );
     25define( 'PRODUCTBIRD_VERSION', '1.4.0' );
    2626define( 'PRODUCTBIRD_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
    2727
  • productbird/trunk/readme.txt

    r3306226 r3306227  
    44Requires at least: 5.0
    55Tested up to: 6.8
    6 Stable tag: 1.4.0
     6Stable tag:
    77Requires PHP: 8.0
    88Requires Plugins: woocommerce
  • productbird/trunk/src/Admin/Admin.php

    r3305783 r3306227  
    1313use Productbird\FeatureFlags;
    1414use Productbird\Traits\ScriptLocalization;
     15use Productbird\Utils;
    1516
    1617/**
     
    6566                    'tone'              => 'expert',
    6667                    'formality'         => 'informal',
     68                    'language'          => Utils::get_locale_language(),
    6769                    'selected_org_id'   => '',
    6870                    'telemetry_opt_out' => false,
     
    107109        $output['tone']              = sanitize_text_field( $input['tone'] );
    108110        $output['formality']         = sanitize_text_field( $input['formality'] );
     111        $output['language']          = sanitize_text_field( $input['language'] );
    109112        $output['selected_org_id']   = sanitize_text_field( $input['selected_org_id'] );
    110113        $output['telemetry_opt_out'] = isset( $input['telemetry_opt_out'] ) ? (bool) $input['telemetry_opt_out'] : false;
  • productbird/trunk/src/Admin/GlobalAdminScript.php

    r3305783 r3306227  
    1313 * Handles the global Productbird script that's loaded on all admin pages.
    1414 *
    15  * @since 0.1.0
     15 * @package Productbird\Admin
    1616 */
    1717class GlobalAdminScript {
     
    2222     * Initialize hooks.
    2323     *
    24      * @since 0.1.0
    2524     * @return void
    2625     */
     
    3231     * Enqueue the global Productbird script on all admin pages.
    3332     *
    34      * @since 0.1.0
    3533     * @return void
    3634     */
     
    4644        wp_enqueue_script( 'productbird-global' );
    4745
    48         // Localize the global data
     46        // Localize the global data.
    4947        wp_localize_script(
    5048            'productbird-global',
  • productbird/trunk/src/Auth/OidcClient.php

    r3302180 r3306227  
    11<?php
     2/**
     3 * Handles the OpenID-Connect client flow against the Productbird app.
     4 *
     5 * @package Productbird\Auth
     6 */
    27
    38namespace Productbird\Auth;
     
    712
    813/**
    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.
    1915 *
    2016 * All data is stored in regular WordPress options so it survives across
    2117 * requests and works for all admins alike.
    2218 *
    23  * @since 0.1.0
     19 * @package Productbird\Auth
    2420 */
    2521class OidcClient {
    2622
    2723    /**
    28      * Constants
     24     * Constants.
    2925     */
    3026
     
    4844
    4945    /**
    50      * Public bootstrap
     46     * Public bootstrap.
    5147     */
    5248
     
    5450     * Initializes hooks for the OIDC client.
    5551     *
    56      * @since 0.1.0
    5752     * @return void
    5853     */
     
    7166     * Returns the Better-Auth base URL depending on local/remote environment.
    7267     *
    73      * @since 0.1.0
    7468     * @return string The base URL for the OIDC provider.
    7569     */
     
    8983     * Fully-qualified redirect URI that Better-Auth will send the user back to.
    9084     *
    91      * @since 0.1.0
    9285     * @return string The redirect URI.
    9386     */
     
    9992     * Retrieve the stored client credentials if we already registered.
    10093     *
    101      * @since 0.1.0
    10294     * @return array<string, string>|null Client credentials or null if not found.
    10395     */
     
    110102     * Retrieve the stored tokens ( may be expired ).
    111103     *
    112      * @since 0.1.0
    113104     * @return array<string, mixed>|null Tokens or null if not found.
    114105     */
     
    124115     * Will attempt to refresh the token if it is expired.
    125116     *
    126      * @since 0.1.0
    127117     * @return bool True if connected, false otherwise.
    128118     */
     
    147137     * credentials exist yet.
    148138     *
    149      * @since 0.1.0
    150139     * @return string|null The authorization URL or null on failure.
    151140     */
     
    186175     * Registers the WP site as an OAuth client with Better-Auth.
    187176     *
    188      * @since 0.1.0
    189177     * @return true|WP_Error True on success or WP_Error on failure.
    190178     */
     
    192180        $body = array(
    193181            '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.
    195183                __( '%1$s (%2$s)', 'productbird' ),
    196184                wp_specialchars_decode( get_bloginfo( 'name' ) ),
     
    246234     * Make sure we have a client_id / secret. Attempts to register if missing.
    247235     *
    248      * @since 0.1.0
    249236     * @return bool True if client is registered or registration was successful, false otherwise.
    250237     */
     
    270257     * page with a status indicator.
    271258     *
    272      * @since 0.1.0
    273259     * @param WP_REST_Request $request The incoming REST request from the OIDC provider.
    274260     * @return WP_Error|void WP_Error on failure. Redirects on success, so effectively void.
     
    352338     * Returns the updated token array or WP_Error on failure.
    353339     *
    354      * @since 0.1.0
    355340     * @return array<string, mixed>|WP_Error The new token array or WP_Error on failure.
    356341     */
     
    419404     * Returns an associative array with the claims or WP_Error on failure.
    420405     *
    421      * @since 0.1.0
    422406     * @return array<string, mixed>|WP_Error Userinfo claims or WP_Error.
    423407     */
     
    429413        $tokens = $this->get_tokens();
    430414
    431         // Decode and log ID token if available
     415        // Decode and log ID token if available.
    432416        if ( ! empty( $tokens['id_token'] ) ) {
    433             // ID tokens are JWT format (header.payload.signature)
     417            // ID tokens are JWT format (header.payload.signature).
    434418            $jwt_parts = explode( '.', $tokens['id_token'] );
    435419            if ( count( $jwt_parts ) === 3 ) {
     
    482466     * and tokens.
    483467     *
    484      * @since 0.1.0
    485468     * @return void As this method always calls exit.
    486469     */
     
    503486     * Requires an active OIDC connection.
    504487     *
    505      * @since 0.1.0
    506488     * @return array<mixed>|WP_Error An array of organization data or WP_Error on failure.
    507489     */
    508490    public function get_organizations() {
    509491        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().
    511493            $url    = $this->get_base_url() . '/api/v1/organizations/me';
    512494
  • productbird/trunk/src/FeatureFlags.php

    r3305783 r3306227  
    11<?php
     2/**
     3 * Feature flags
     4 *
     5 * @package Productbird
     6 */
    27
    38namespace Productbird;
     
    1924     */
    2025    private const DEFAULT_FLAGS = array(
    21         // OpenID-Connect
     26        // OpenID-Connect.
    2227        'oidc'                           => false,
    2328
    24         // Product description bulk modal
     29        // Product description bulk modal.
    2530        'product_description_bulk_modal' => true,
    2631    );
  • productbird/trunk/src/Logger.php

    r3302180 r3306227  
    11<?php
     2/**
     3 * Logger class for Productbird plugin.
     4 *
     5 * @package Productbird
     6 */
    27
    38namespace Productbird;
     
    914 *
    1015 * @package Productbird
    11  * @since 0.1.0
    1216 */
    1317class Logger {
     
    2428     * Option name for storing logs.
    2529     *
    26      * @since 0.1.0
    2730     * @var string
    2831     */
     
    3538     */
    3639    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.
    3841        return ( defined( 'WP_DEBUG' ) && WP_DEBUG ) || Utils::is_local_site();
    3942    }
     
    5861        );
    5962
    60         // Add context if provided
     63        // Add context if provided.
    6164        if ( ! empty( $context ) ) {
    6265            $formatted_message .= ' Context: ' . wp_json_encode( $context );
    6366        }
    6467
    65         // Use WordPress error_log only in development environments
     68        // Use WordPress error_log only in development environments.
    6669        if ( defined( 'WP_DEBUG' ) && WP_DEBUG && defined( 'WP_DEBUG_LOG' ) && WP_DEBUG_LOG ) {
    6770            // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_error_log
     
    220223     * Get all logs.
    221224     *
    222      * @since 0.1.0
    223225     * @return array
    224226     */
     
    231233     * Clear all logs.
    232234     *
    233      * @since 0.1.0
    234235     * @return void
    235236     */
     
    241242     * Get logs count.
    242243     *
    243      * @since 0.1.0
    244244     * @return int
    245245     */
  • productbird/trunk/src/Plugin.php

    r3305807 r3306227  
    11<?php
     2/**
     3 * Main plugin class.
     4 *
     5 * @package Productbird
     6 */
    27
    38namespace Productbird;
     
    3035     */
    3136    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.
    3937        add_action( 'init', array( $this, 'load_text_domain' ) );
    40 
    41         // Add Settings link to plugin action links
    4238        add_filter( 'plugin_action_links_productbird/productbird.php', array( $this, 'add_settings_link' ) );
    43 
    44         // Add activation redirect
    4539        add_action( 'activated_plugin', array( $this, 'handle_activation_redirect' ) );
    4640        add_action( 'admin_init', array( $this, 'do_activation_redirect' ) );
    4741
    48         // Initialize plugin components.
    4942        $this->init_components();
    5043    }
    5144
    52     /**
    53      * Check if WooCommerce is active.
    54      *
    55      * @return bool
    56      */
    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 void
    65      */
    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         <?php
    72     }
    7345
    7446    /**
     
    10274        ( new ClearProductMetaEndpoint() )->init();
    10375        ( new ClearQueuedProductsEndpoint() )->init();
    104 
    105         /**
    106          * Tool endpoints
    107          */
    10876        ( new ToolMagicDescriptionsEndpoints() )->init();
    10977
     
    12593     */
    12694    public function handle_activation_redirect( string $plugin ): void {
    127         // Only redirect if our plugin was activated
    12895        if ( 'productbird/productbird.php' !== $plugin ) {
    12996            return;
     
    135102        }
    136103
     104        // phpcs:ignore WordPress.WP.Capabilities.Unknown
    137105        if ( ! current_user_can( 'manage_woocommerce' ) ) {
    138106            return;
  • productbird/trunk/src/Rest/ClearProductMetaEndpoint.php

    r3305783 r3306227  
    4949            '/clear-product-meta',
    5050            array(
    51                 'methods'             => WP_REST_Server::CREATABLE, // POST
     51                'methods'             => WP_REST_Server::CREATABLE,
    5252                'callback'            => array( $this, 'handle_clear' ),
    5353                'permission_callback' => array( $this, 'check_permission' ),
     
    6363     */
    6464    public function check_permission() {
     65        // phpcs:ignore WordPress.WP.Capabilities.Unknown
    6566        return current_user_can( 'manage_woocommerce' );
    6667    }
  • productbird/trunk/src/Rest/ClearQueuedProductsEndpoint.php

    r3305807 r3306227  
    6161     */
    6262    public function check_permission() {
     63        // phpcs:ignore WordPress.WP.Capabilities.Unknown
    6364        return current_user_can( 'manage_woocommerce' );
    6465    }
     
    112113
    113114        // 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' ) );
    115116        $meta_key_placeholders = implode( ',', array_fill( 0, count( $meta_keys ), '%s' ) );
    116117
  • productbird/trunk/src/Rest/OidcCallbackEndpoint.php

    r3302180 r3306227  
    11<?php
     2/**
     3 * Public endpoint for OIDC callback.
     4 *
     5 * @package Productbird\Rest
     6 */
    27
    38namespace Productbird\Rest;
     
    914
    1015/**
    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.
    1718 */
    1819class OidcCallbackEndpoint {
     
    3940            '/oidc/callback',
    4041            array(
    41                 'methods'             => array( \WP_REST_Server::READABLE ), // GET
     42                'methods'             => array( \WP_REST_Server::READABLE ),
    4243                'callback'            => array( $this, 'handle_callback' ),
    43                 'permission_callback' => '__return_true', // public endpoint
     44                'permission_callback' => '__return_true',
    4445                'args'                => array(
    4546                    'code'  => array(
     
    7778        }
    7879
    79         // process_callback will normally redirect + exit;
     80        // process_callback will normally redirect + exit.
    8081        return new WP_REST_Response( array( 'success' => true ) );
    8182    }
  • productbird/trunk/src/Rest/OrganizationsEndpoint.php

    r3302180 r3306227  
    11<?php
     2/**
     3 * REST endpoint for managing organizations.
     4 *
     5 * @package Productbird\Rest
     6 */
     7
    28namespace Productbird\Rest;
    39
     
    915 * REST endpoint for managing organizations.
    1016 *
    11  * @since 0.1.0
     17 * @package Productbird\Rest
    1218 */
    1319class OrganizationsEndpoint {
     
    1521     * Initialize hooks.
    1622     *
    17      * @since 0.1.0
    1823     * @return void
    1924     */
     
    2530     * Register REST routes.
    2631     *
    27      * @since 0.1.0
    2832     * @return void
    2933     */
     
    4549     * Get organizations for the current user.
    4650     *
    47      * @since 0.1.0
    4851     * @return WP_REST_Response|WP_Error
    4952     */
  • productbird/trunk/src/Rest/RestUtils.php

    r3302180 r3306227  
    11<?php
     2/**
     3 * Utility class for REST API endpoints.
     4 *
     5 * @package Productbird\Rest
     6 */
    27
    38namespace Productbird\Rest;
     
    8792     */
    8893    public static function can_manage_woocommerce_permission() {
     94        // phpcs:ignore WordPress.WP.Capabilities.Unknown
    8995        if ( ! current_user_can( 'manage_woocommerce' ) ) {
    9096            return new \WP_Error(
  • productbird/trunk/src/Rest/SettingsEndpoint.php

    r3305783 r3306227  
    11<?php
    2 /**
    3  * Settings endpoint for the Productbird plugin.
    4  *
    5  * @package Productbird
    6  */
     2    /**
     3    * Settings endpoint for the Productbird plugin.
     4    *
     5    * @package Productbird
     6    */
    77
    88namespace Productbird\Rest;
    99
    1010use Productbird\Admin\Admin;
     11use Productbird\Utils;
    1112use WP_REST_Request;
    1213use WP_REST_Response;
     
    7172                        'required' => false,
    7273                    ),
     74                    'language'          => array(
     75                        'type'     => 'string',
     76                        'required' => false,
     77                    ),
    7378                    'selected_org_id'   => array(
    7479                        'type'     => 'string',
     
    104109            'tone'              => 'expert',
    105110            'formality'         => 'informal',
     111            'language'          => Utils::get_locale_language(),
    106112            'selected_org_id'   => '',
    107113            'telemetry_opt_out' => false,
    108114        );
    109         $saved_settings   = get_option( 'productbird_settings', array() );
     115
     116        $saved_settings = get_option( 'productbird_settings', array() );
    110117
    111118        // Merge with default settings.
  • productbird/trunk/src/Rest/ToolMagicDescriptionsEndpoints.php

    r3305783 r3306227  
    426426                    'tone'         => $options['tone'] ?? null,
    427427                    'formality'    => $options['formality'] ?? null,
     428                    'language'     => $options['language'] ?? 'en',
    428429                    'callback_url' => rest_url( "productbird/v1/magic-descriptions/callback?mode={$mode}" ),
    429430                )
     
    453454
    454455            $response = $client->generate_product_description( $payloads );
    455 
    456             Logger::info( 'RESPONSE', $response );
    457456
    458457            if ( is_wp_error( $response ) ) {
     
    973972        return new WP_REST_Response(
    974973            array(
    975                 'success' => true,
    976                 'message' => __( 'Description applied successfully.', 'productbird' ),
     974                'success'    => true,
     975                'product_id' => $product_id,
     976                'message'    => __( 'Description applied successfully.', 'productbird' ),
    977977            )
    978978        );
     
    11541154            'post_status'    => 'publish',
    11551155            'posts_per_page' => -1,
     1156            // phpcs:ignore WordPress.DB.SlowDBQuery.slow_db_query_meta_query
    11561157            'meta_query'     => array(
    11571158                'relation' => 'AND',
  • productbird/trunk/src/Traits/ProductDataHelpers.php

    r3302180 r3306227  
    11<?php
     2/**
     3 * Trait containing helper methods for working with WooCommerce product data.
     4 *
     5 * @package Productbird\Traits
     6 */
    27
    38namespace Productbird\Traits;
  • productbird/trunk/src/Traits/ScriptLocalization.php

    r3302180 r3306227  
    11<?php
     2/**
     3 * Trait for sharing common script localization data between admin classes.
     4 *
     5 * @package Productbird\Traits
     6 */
    27
    38namespace Productbird\Traits;
  • productbird/trunk/src/Traits/ToolsConfig.php

    r3305783 r3306227  
    11<?php
     2/**
     3 * Trait containing helper methods for working with tools.
     4 *
     5 * @package Productbird\Traits
     6 */
    27
    38namespace Productbird\Traits;
     
    611 * Trait containing helper methods for working with tools.
    712 *
    8  * @since 0.1.0
     13 * @package Productbird\Traits
    914 */
    1015trait ToolsConfig {
     
    1217     * Get the icon to use for the tool.
    1318     *
    14      * @since 0.1.0
    1519     * @return string
    1620     */
     
    2226     * Get the maximum batch size for bulk operations.
    2327     *
    24      * @since 0.1.0
    2528     * @return int
    2629     */
     
    3235     * Get shared meta key for global status.
    3336     *
    34      * @since 0.1.0
    3537     * @return string
    3638     */
     
    4244     * Get shared meta key for last updated.
    4345     *
    44      * @since 0.1.0
    4546     * @return string
    4647     */
     
    5253     * Get Magic Descriptions meta key for status.
    5354     *
    54      * @since 0.1.0
    5555     * @return string
    5656     */
     
    6262     * Get Magic Descriptions meta key for status ID.
    6363     *
    64      * @since 0.1.0
    6564     * @return string
    6665     */
     
    7271     * Get Magic Descriptions meta key for error.
    7372     *
    74      * @since 0.1.0
    7573     * @return string
    7674     */
     
    8280     * Get Magic Descriptions meta key for draft.
    8381     *
    84      * @since 0.1.0
    8582     * @return string
    8683     */
     
    9289     * Get Magic Descriptions meta key for delivered.
    9390     *
    94      * @since 0.1.0
    9591     * @return string
    9692     */
     
    10298     * Get Magic Descriptions meta key for declined.
    10399     *
    104      * @since 0.1.0
    105100     * @return string
    106101     */
  • productbird/trunk/src/Utils.php

    r3302180 r3306227  
    11<?php
     2/**
     3 * Utility class for various helper functions.
     4 *
     5 * @package Productbird\Utils
     6 */
    27
    38namespace Productbird;
     
    611 * Utility class for various helper functions.
    712 *
    8  * @since 0.1.0
     13 * @package Productbird\Utils
    914 */
    1015class Utils {
     
    1217     * Detects whether the site is running on a localhost-style domain.
    1318     *
    14      * @since 0.1.0
    1519     * @return bool True if the site URL matches local patterns, false otherwise.
    1620     */
     
    2226            || strpos( $site_url, '.local' ) !== false;
    2327    }
     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    }
    2439}
  • productbird/trunk/vendor/composer/installed.php

    r3305836 r3306227  
    22    'root' => array(
    33        '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',
    77        'type' => 'wordpress-plugin',
    88        'install_path' => __DIR__ . '/../../',
     
    2121        ),
    2222        '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',
    2626            'type' => 'wordpress-plugin',
    2727            'install_path' => __DIR__ . '/../../',
Note: See TracChangeset for help on using the changeset viewer.