Plugin Directory

Changeset 3226839


Ignore:
Timestamp:
01/22/2025 12:34:55 PM (14 months ago)
Author:
SkyVerge
Message:

Committing 1.9.1 to trunk

Location:
woocommerce-custom-product-tabs-lite/trunk
Files:
3 added
3 edited

Legend:

Unmodified
Added
Removed
  • woocommerce-custom-product-tabs-lite/trunk/i18n/languages/woocommerce-custom-product-tabs-lite.pot

    r3178158 r3226839  
    1 # Copyright (C) 2024 SkyVerge
     1# Copyright (C) 2025 SkyVerge
    22# This file is distributed under the GNU General Public License v3.0.
    33msgid ""
    44msgstr ""
    5 "Project-Id-Version: Custom Product Tabs Lite for WooCommerce 1.9.0\n"
     5"Project-Id-Version: Custom Product Tabs Lite for WooCommerce 1.9.1\n"
    66"Report-Msgid-Bugs-To: https://woocommerce.com/my-account/marketplace-ticket-form/\n"
    77"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
     
    1010"Content-Type: text/plain; charset=UTF-8\n"
    1111"Content-Transfer-Encoding: 8bit\n"
    12 "POT-Creation-Date: 2024-10-29T15:26:46+00:00\n"
     12"POT-Creation-Date: 2025-01-22T12:33:59+00:00\n"
    1313"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
    14 "X-Generator: WP-CLI 2.6.0\n"
     14"X-Generator: WP-CLI 2.11.0\n"
    1515"X-Domain: woocommerce-custom-product-tabs-lite\n"
    1616
    1717#. Plugin Name of the plugin
     18#: woocommerce-custom-product-tabs-lite.php
    1819msgid "Custom Product Tabs Lite for WooCommerce"
    1920msgstr ""
    2021
    2122#. Plugin URI of the plugin
     23#: woocommerce-custom-product-tabs-lite.php
    2224msgid "https://www.skyverge.com/product/woocommerce-custom-product-tabs-lite/"
    2325msgstr ""
    2426
    2527#. Description of the plugin
     28#: woocommerce-custom-product-tabs-lite.php
    2629msgid "Extends WooCommerce to add a custom product view page tab"
    2730msgstr ""
    2831
    2932#. Author of the plugin
     33#: woocommerce-custom-product-tabs-lite.php
    3034msgid "SkyVerge"
    3135msgstr ""
    3236
    3337#. Author URI of the plugin
     38#: woocommerce-custom-product-tabs-lite.php
    3439msgid "http://www.skyverge.com/"
    3540msgstr ""
    3641
    3742#. translators: Placeholders: %s - plugin name
    38 #: woocommerce-custom-product-tabs-lite.php:102
     43#: woocommerce-custom-product-tabs-lite.php:131
    3944msgid "You cannot clone instances of %s."
    4045msgstr ""
    4146
    4247#. translators: Placeholders: %s - plugin name
    43 #: woocommerce-custom-product-tabs-lite.php:113
     48#: woocommerce-custom-product-tabs-lite.php:142
    4449msgid "You cannot unserialize instances of %s."
    4550msgstr ""
    4651
    47 #: woocommerce-custom-product-tabs-lite.php:225
     52#: woocommerce-custom-product-tabs-lite.php:254
    4853msgid "Custom Tab"
    4954msgstr ""
    5055
    51 #: woocommerce-custom-product-tabs-lite.php:259
     56#: woocommerce-custom-product-tabs-lite.php:288
    5257msgid "Tab Title"
    5358msgstr ""
    5459
    55 #: woocommerce-custom-product-tabs-lite.php:260
     60#: woocommerce-custom-product-tabs-lite.php:289
    5661msgid "Required for tab to be visible"
    5762msgstr ""
    5863
    59 #: woocommerce-custom-product-tabs-lite.php:266
     64#: woocommerce-custom-product-tabs-lite.php:295
    6065msgid "Content"
    6166msgstr ""
    6267
    63 #: woocommerce-custom-product-tabs-lite.php:267
     68#: woocommerce-custom-product-tabs-lite.php:296
    6469msgid "HTML and text to display."
    6570msgstr ""
    6671
    6772#. translators: Placeholders: %1$s - <strong>, %2$s - </strong>, %3$s - version number, %4$s + %6$s - <a> tags, %5$s - </a>
    68 #: woocommerce-custom-product-tabs-lite.php:427
     73#: woocommerce-custom-product-tabs-lite.php:455
    6974msgid "%1$sCustom Product Tabs Lite for WooCommerce is inactive.%2$s This plugin requires WooCommerce %3$s or newer. Please %4$sinstall WooCommerce %3$s or newer%5$s, or %6$srun the WooCommerce database upgrade%5$s."
    7075msgstr ""
  • woocommerce-custom-product-tabs-lite/trunk/readme.txt

    r3197253 r3226839  
    44Requires at least: 5.6
    55Requires PHP: 7.4
    6 Tested up to: 6.7
    7 Stable tag: 1.9.0
     6Tested up to: 6.7.1
     7Stable tag: 1.9.1
    88License: GPLv3 or later
    99License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    8484== Changelog ==
    8585
     86= 2025.01.22 - version 1.9.1 =
     87* Misc - Standardize product tabs meta storage
     88
    8689= 2024.10.29 - version 1.9.0 =
    8790* Fix - Ensure PHP 8.2+ compatibility
  • woocommerce-custom-product-tabs-lite/trunk/woocommerce-custom-product-tabs-lite.php

    r3178158 r3226839  
    66 * Author: SkyVerge
    77 * Author URI: http://www.skyverge.com/
    8  * Version: 1.9.0
    9  * Tested up to: 6.6.2
     8 * Version: 1.9.1
     9 * Tested up to: 6.7.1
    1010 * Text Domain: woocommerce-custom-product-tabs-lite
    1111 * Domain Path: /i18n/languages/
     
    2121 *
    2222 * WC requires at least: 3.9.4
    23  * WC tested up to: 9.3.3
     23 * WC tested up to: 9.6.0
    2424 */
     25use WooCommerceCustomProductTabsLite\Helpers\ProductTabsMetaHandler;
    2526
    2627defined( 'ABSPATH' ) or exit;
     
    4142
    4243    /** plugin version number */
    43     const VERSION = '1.9.0';
     44    const VERSION = '1.9.1';
    4445
    4546    /** required WooCommerce version number */
     
    5152    /** @var bool|array tab data */
    5253    private $tab_data = false;
     54
     55    private ProductTabsMetaHandler $productTabsMetaHandler;
    5356
    5457    /** @var WooCommerceCustomProductTabsLite single instance of this plugin */
     
    6770            $this->install();
    6871        }
     72
     73        $this->includes();
     74        $this->addHooks();
     75    }
     76
     77    /**
     78     * Loads required files.
     79     *
     80     * @return void
     81     */
     82    public function includes()
     83    {
     84        require_once(__DIR__ . '/src/Helpers/ProductTabsMetaHandler.php');
     85
     86        $this->productTabsMetaHandler = new ProductTabsMetaHandler;
     87    }
     88
     89
     90    /**
     91     * Registers hook callbacks to bootstrap the plugin.
     92     *
     93     * @return void
     94     */
     95    public function addHooks()
     96    {
     97        $this->productTabsMetaHandler->addHooks();
    6998
    7099        add_action( 'init',             array( $this, 'load_translation' ) );
     
    238267
    239268        // pull the custom tab data out of the database
    240         $tab_data = $product->get_meta( 'frs_woo_product_tabs', true, 'edit' );
     269        $tab_data = $this->productTabsMetaHandler->getMeta($product);
    241270
    242271        if ( empty( $tab_data ) ) {
     
    275304
    276305    /**
    277      * Saves the data input into the product boxes, as post meta data
    278      * identified by the name 'frs_woo_product_tabs'
     306     * Saves the data input into the product boxes, as post meta data.
    279307     *
    280308     * @since 1.0.0
     
    290318        $product     = wc_get_product( $post_id );
    291319
    292         if ( empty( $tab_title ) && empty( $tab_content ) && $product->get_meta( 'frs_woo_product_tabs', true, 'edit' ) ) {
     320        if ( empty( $tab_title ) && empty( $tab_content ) && $this->productTabsMetaHandler->getMeta($product) ) {
    293321
    294322            // clean up if the custom tabs are removed
    295             $product->delete_meta_data( 'frs_woo_product_tabs' );
     323            $this->productTabsMetaHandler->deleteMeta($product);
    296324            $product->save();
    297325
    298326        } elseif ( ! empty( $tab_title ) || ! empty( $tab_content ) ) {
    299327
    300             $tab_data = array();
    301             $tab_id   = '';
     328            $tab_id = '';
    302329
    303330            if ( $tab_title ) {
     
    327354            }
    328355
    329             // save the serialized data to the database
    330             $tab_data[] = array(
    331                 'title'   => $tab_title,
    332                 'id'      => $tab_id,
    333                 'content' => $tab_content,
    334             );
    335 
    336             $product->update_meta_data( 'frs_woo_product_tabs', $tab_data );
     356            $tab_data = [
     357                [
     358                    'title'   => $tab_title,
     359                    'id'      => $tab_id,
     360                    'content' => $tab_content,
     361                ]
     362            ];
     363
     364            $this->productTabsMetaHandler->updateMeta($product, $tab_data);
    337365            $product->save();
    338366        }
     
    370398
    371399        if ( false === $this->tab_data ) {
    372             $this->tab_data = maybe_unserialize( $product->get_meta( 'frs_woo_product_tabs', true, 'edit' ) );
     400            $this->tab_data = $this->productTabsMetaHandler->getMeta($product);
    373401        }
    374402
Note: See TracChangeset for help on using the changeset viewer.