diff --git a/composer.lock b/composer.lock index 34aa66d..0945301 100644 --- a/composer.lock +++ b/composer.lock @@ -210,23 +210,23 @@ }, { "name": "barn2/barn2-lib", - "version": "2.2.0", + "version": "2.2.4", "source": { "type": "git", "url": "git@github.com:barn2plugins/barn2-lib.git", - "reference": "a3050f716819dd957f644291d4ed745ce2b4472a" + "reference": "cc582efc9e95f63b0291777808e183b958e05d6d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/barn2plugins/barn2-lib/zipball/a3050f716819dd957f644291d4ed745ce2b4472a", - "reference": "a3050f716819dd957f644291d4ed745ce2b4472a", + "url": "https://api.github.com/repos/barn2plugins/barn2-lib/zipball/cc582efc9e95f63b0291777808e183b958e05d6d", + "reference": "cc582efc9e95f63b0291777808e183b958e05d6d", "shasum": "" }, "require": { "wptrt/admin-notices": "^1.0" }, "require-dev": { - "barn2/php-standards": "dev-master" + "barn2/php-standards": "^1.0.0" }, "type": "library", "autoload": { @@ -245,10 +245,10 @@ ], "description": "Barn2 Libary code", "support": { - "source": "https://github.com/barn2plugins/barn2-lib/tree/2.2.0", + "source": "https://github.com/barn2plugins/barn2-lib/tree/2.2.4", "issues": "https://github.com/barn2plugins/barn2-lib/issues" }, - "time": "2024-10-22T04:58:48+00:00" + "time": "2024-11-25T09:22:34+00:00" }, { "name": "barn2/php-scoper-excludes", diff --git a/dependencies/barn2/barn2-lib/build/css/wc-settings-styles.css b/dependencies/barn2/barn2-lib/build/css/wc-settings-styles.css index 955b4dd..e65e753 100644 --- a/dependencies/barn2/barn2-lib/build/css/wc-settings-styles.css +++ b/dependencies/barn2/barn2-lib/build/css/wc-settings-styles.css @@ -1 +1,2 @@ +.woocommerce .barn2-settings .form-table .with-suffix{margin-right:6px;vertical-align:middle}.image-size-field .separator{display:inline-block;font-size:1.2em;padding-left:4px;padding-right:4px}.image-size-field .suffix{padding-left:8px}.image-size-field .separator,.image-size-field .suffix{padding-top:9px}@media screen and (min-width:783px){.image-size-field .separator,.image-size-field .suffix{padding-top:4px}}.color-picker-field .wp-picker-container,.color-size-field .wp-picker-container{vertical-align:top}.color-picker-field .wp-picker-container input[type=text].wp-color-picker,.color-size-field .wp-picker-container input[type=text].wp-color-picker{width:5rem}.color-size-field input[type=number]{width:60px}.woocommerce .form-table .color-size-field input[type=number]{vertical-align:top;width:6em}.color-size-field .wp-picker-active{margin-right:3px}.color-size-field .description{display:inline-block;margin-left:10px;margin-top:1px}.color-size-field .description img{display:inline-block;margin:3px 6px 3px 0;vertical-align:middle}.form-table .radio-image-boxes{display:grid;gap:20px;grid-template-columns:200px 200px 200px 200px;margin-top:25px}@media(max-width:1180px){.form-table .radio-image-boxes{grid-template-columns:1fr 1fr 1fr 1fr}}@media(max-width:820px){.form-table .radio-image-boxes{grid-template-columns:200px 200px 200px}.form-table .radio-image-boxes label{margin:0!important;max-width:200px}}@media(max-width:680px){.form-table .radio-image-boxes{grid-template-columns:1fr 1fr 1fr}.form-table .radio-image-boxes label{margin:0!important;max-width:200px}}@media(max-width:520px){.form-table .radio-image-boxes{grid-template-columns:1fr 1fr}.form-table .radio-image-boxes label{max-width:200px}}.form-table .radio-image-boxes .radio-image{position:relative}.form-table .radio-image-boxes .radio-image>img{border-radius:16px 16px 0 0;height:100%;max-width:200px;width:100%}.form-table .radio-image-boxes .radio-image .image-hover{align-items:center;background:rgba(34,113,177,.8);border-radius:16px 16px 0 0;display:flex;height:100%;justify-content:center;left:0;opacity:1;position:absolute;top:0;visibility:hidden;width:100%}.form-table .radio-image-boxes .radio-image .image-hover img{width:40px}.form-table .radio-image-boxes .radio-image:hover .image-hover{opacity:1;visibility:visible}.form-table .radio-image-boxes .barn2-lightbox-image{display:none}.form-table .radio-image-boxes label{background-color:#fff;border-radius:16px;display:flex!important;flex-direction:column}.form-table .radio-image-boxes label:hover{cursor:pointer}.form-table .radio-image-boxes label span{border-top:1px solid #d9d9d9;box-sizing:border-box;display:inline-block;padding:10px 20px;width:100%} .woocommerce .barn2-settings .form-table .with-suffix{margin-right:6px;vertical-align:middle}.image-size-field .separator{display:inline-block;font-size:1.2em;padding-left:4px;padding-right:4px}.image-size-field .suffix{padding-left:8px}.image-size-field .separator,.image-size-field .suffix{padding-top:9px}@media screen and (min-width:783px){.image-size-field .separator,.image-size-field .suffix{padding-top:4px}}.color-picker-field .wp-picker-container,.color-size-field .wp-picker-container{vertical-align:top}.color-picker-field .wp-picker-container input[type=text].wp-color-picker,.color-size-field .wp-picker-container input[type=text].wp-color-picker{width:5rem}.woocommerce .form-table .color-size-field input[type=number]{vertical-align:top;width:6em}.color-size-field .wp-picker-active{margin-right:3px}.color-size-field .description{display:inline-block;margin-left:10px;margin-top:1px}.color-size-field .description img{display:inline-block;margin:3px 6px 3px 0;vertical-align:middle} diff --git a/dependencies/barn2/barn2-lib/src/Admin/Notice.php b/dependencies/barn2/barn2-lib/src/Admin/Notice.php new file mode 100644 index 0000000..bfe936d --- /dev/null +++ b/dependencies/barn2/barn2-lib/src/Admin/Notice.php @@ -0,0 +1,314 @@ + + * @license GPL-3.0 + * @copyright Barn2 Media Ltd + * @version 1.0 + * @internal + */ +class Notice +{ + /** + * The notice-ID. + * + * @var string + */ + private $id; + /** + * The notice title. + * + * @var string + */ + private $title; + /** + * The notice message. + * + * @var string + */ + private $message; + /** + * The notice options. + * + * @var array + */ + private $options = ['type' => 'info', 'alt_style' => \false, 'additional_classes' => [], 'attributes' => [], 'paragraph_wrap' => \true, 'buttons' => [], 'capability' => 'edit_theme_options', 'screens' => [], 'dismissible' => \true, 'scope' => 'global', 'option_prefix' => 'barn2_notice_dismissed', 'dissmiss_callback' => null]; + /** + * Constructor. + * + * @param string $id A unique notice ID. Should contain lowercase characters and underscores. + * @param string $title The title of the notice. + * @param string $message The notice message. + * @param array $options { + * Optional. An array of additional options to change the defaults for this notice. + * + * @type string $type The type of admin notice. Default 'info'. Accepts 'info', 'success', 'warning', 'error'. + * @type bool $alt_style Whether we want to use alt styles or not. Default false. + * @type array $additional_classes A string array of class names. + * @type array $attributes Additional attributes for the notice div. + * @type bool $paragraph_wrap Whether to wrap the message in paragraph tags. Default true. + * @type array $buttons Associative array with buttons attributes and values. Default []. + * @type string $capability The user capability required to see the notice. Default 'edit_theme_options'. + * @type array $screens An array of screens where the notice will be displayed. Default is empty to always show. + * @type bool $dismissible Whether the admin notice is dismissible. Default true. + * @type string $scope Saves the dismissed status as an option or user-meta. Accepts 'global', 'user'. Default 'global'. + * @type string $option_prefix The prefix that will be used to build the option (or post-meta) name. Should contain lowercase characters and underscores. + * @type callable $dissmiss_callback Function called before dismissing a notice. The arguments are $id, $title, $message, $options, $notice_obj. + * } + */ + public function __construct($id, $title, $message, $options = []) + { + $this->id = \sanitize_key($id); + $this->title = $title; + $this->message = $message; + $this->options = \wp_parse_args($options, $this->options); + if (!$this->id || !$this->message) { + return; + } + if ($this->options['dismissible'] === \true && !$this->is_dismissed()) { + // Enqueue notices script to handle dismissables notices. + \add_action('admin_enqueue_scripts', [$this, 'load_scripts']); + // Handle AJAX requests to dismiss the notice. + \add_action('wp_ajax_barn2_dismiss_admin_notice', [$this, 'ajax_maybe_dismiss_notice']); + } + } + /** + * Enqueues barn2-notices script. + */ + public function load_scripts() + { + \wp_enqueue_script('barn2-notices'); + } + /** + * Gets the notice markup. + * + * @return string + */ + public function get_notice() + { + // Use a deprecated notice function if WP is older than 6.4.0. + if (!\function_exists('wp_get_admin_notice')) { + return $this->get_notice_deprecated(); + } + $title = $this->get_title(); + $message = $this->message; + $buttons = $this->get_buttons(); + $additional_classes = \array_merge(['barn2-notice'], $this->options['additional_classes']); + $attributes = $this->options['attributes']; + $paragraph_wrap = $this->options['paragraph_wrap']; + // Adds a nonce to the notice data attribute to be used on the AJAX cal if the notice is dismissible. + if ($this->options['dismissible'] === \true && !$this->is_dismissed()) { + $attributes = \array_merge($attributes, ['data-nonce' => \wp_create_nonce('barn2_dismiss_admin_notice_' . $this->id)]); + } + if ($title !== '' && $this->options['paragraph_wrap'] === \true) { + $message = \wpautop($message); + $paragraph_wrap = \false; + } + // Adds the title and the buttons to the message. + $message = $title . $message . $buttons; + // Gets the notice markup. + $notice = \wp_get_admin_notice($message, ['id' => $this->id, 'type' => $this->options['type'], 'dismissible' => $this->options['dismissible'], 'additional_classes' => $additional_classes, 'attributes' => $attributes, 'paragraph_wrap' => $paragraph_wrap]); + return $notice; + } + /** + * Gets the notice markup. + * + * @return string + * @deprecated 6.4.0 Use Notice->get_notice() instead that uses wp_get_admin_notice() function. + */ + public function get_notice_deprecated() + { + $classes = 'notice barn2-notice'; + $attributes = ''; + $message = $this->message; + if (\is_string($this->options['type'])) { + $type = \trim($this->options['type']); + if ($type !== '') { + $classes .= ' notice-' . $type; + } + } + if ($this->options['dismissible'] === \true) { + $classes .= ' is-dismissible'; + } + if ($this->options['alt_style'] === \true) { + $classes .= ' notice-alt'; + } + if (\is_array($this->options['additional_classes']) && !empty($this->options['additional_classes'])) { + $classes .= ' ' . \implode(' ', $this->options['additional_classes']); + } + // Adds a nonce to the notice data attribute to be used on the AJAX cal if the notice is dismissible. + if ($this->options['dismissible'] === \true && !$this->is_dismissed()) { + $attributes = ' data-nonce="' . \wp_create_nonce('barn2_dismiss_admin_notice_' . $this->id) . '"'; + } + if (\is_array($this->options['attributes']) && !empty($this->options['attributes'])) { + foreach ($this->options['attributes'] as $attr => $val) { + if (\is_bool($val)) { + $attributes .= $val ? ' ' . $attr : ''; + } elseif (\is_int($attr)) { + $attributes .= ' ' . \esc_attr(\trim($val)); + } elseif ($val) { + $attributes .= ' ' . $attr . '="' . \esc_attr(\trim($val)) . '"'; + } + } + } + if ($this->options['paragraph_wrap'] === \true) { + $message = \wpautop($message); + } + // Adds the title and the buttons to the message. + $message = $this->get_title() . $message . $this->get_buttons(); + // Gets the notice markup. + $notice = \sprintf('
%4$s
', $this->id, $classes, $attributes, $message); + return $notice; + } + /** + * Returns the title markup. + * + * @return string + */ + public function get_title() + { + if (!$this->title) { + return ''; + } + return \sprintf('

%s

', \wp_strip_all_tags($this->title)); + } + /** + * Returns the buttons markup. + * + * @return string + */ + public function get_buttons() + { + if (empty($this->options['buttons'])) { + return ''; + } + $buttons = ''; + foreach ($this->options['buttons'] as $key => $button) { + if (empty($button)) { + continue; + } + $attributes = ''; + foreach ($button as $attr => $val) { + if ($attr === 'value') { + $attributes .= ''; + } elseif (\is_bool($val)) { + $attributes .= $val ? ' ' . $attr : ''; + } elseif (\is_int($attr)) { + $attributes .= ' ' . \esc_attr(\trim($val)); + } elseif ($val) { + $attributes .= ' ' . $attr . '="' . \esc_attr(\trim($val)) . '"'; + } + } + $buttons .= '' . $button['value'] . ''; + } + return '

' . $buttons . '

'; + } + /** + * Prints the notice. + */ + public function the_notice() + { + // Early exit if we don't want to show this notice. + if (!$this->show()) { + return; + } + echo \wp_kses_post($this->get_notice()); + } + /** + * Determine if the notice should be shown or not. + * + * @return bool + */ + public function show() + { + // Don't show if the user doesn't have the required capability. + if (!\current_user_can($this->options['capability'])) { + return \false; + } + // Don't show if we're not on the right screen. + if (!$this->is_screen()) { + return \false; + } + // Don't show if notice has been dismissed. + if ($this->options['dismissible'] === \true && $this->is_dismissed()) { + return \false; + } + return \true; + } + /** + * Evaluate if we're on the right place depending on the "screens" argument. + * + * @return bool + */ + private function is_screen() + { + // If screen is empty we want this shown on all screens. + if (!$this->options['screens'] || empty($this->options['screens'])) { + return \true; + } + // Make sure the get_current_screen function exists. + if (!\function_exists('get_current_screen')) { + require_once \ABSPATH . 'wp-admin/includes/screen.php'; + } + /** @var \WP_Screen $current_screen */ + $current_screen = \get_current_screen(); + // Check if we're on one of the defined screens. + return \in_array($current_screen->id, $this->options['screens'], \true); + } + /** + * Run check to see if we need to dismiss the notice. + * If all tests are successful then call the dismiss_notice() method. + * + * @return void + */ + public function ajax_maybe_dismiss_notice() + { + // If dissmiss_callback is set. + if (\is_callable($this->options['dissmiss_callback'])) { + \call_user_func($this->options['dissmiss_callback'], $this->id, $this->title, $this->message, $this->options, $this); + } + // Early exit if we're not on a barn2_dismiss_admin_notice action. + if (!isset($_POST['action']) || 'barn2_dismiss_admin_notice' !== $_POST['action']) { + return; + } + // Early exit if the ID of the notice is not the one from this object. + if (!isset($_POST['id']) || $this->id !== $_POST['id']) { + return; + } + // Make sure nonce is OK. + \check_ajax_referer('barn2_dismiss_admin_notice_' . $this->id, 'nonce', \true); + // Dismisses the notice. + $this->dismiss_notice(); + } + /** + * Dismisses the notice. + * + * @return void + */ + public function dismiss_notice() + { + if ($this->options['scope'] === 'user') { + \update_user_meta(\get_current_user_id(), $this->options['option_prefix'] . '_' . $this->id, \true); + return; + } + \update_option($this->options['option_prefix'] . '_' . $this->id, \true, \false); + } + /** + * Checks if the notice has been dismissed or not. + * + * @return bool + */ + public function is_dismissed() + { + // Check if the notice has been dismissed when using user-meta. + if ($this->options['scope'] === 'user') { + return \get_user_meta(\get_current_user_id(), $this->options['option_prefix'] . '_' . $this->id, \true); + } + return \get_option($this->options['option_prefix'] . '_' . $this->id); + } +} diff --git a/dependencies/barn2/barn2-lib/src/Admin/Notices.php b/dependencies/barn2/barn2-lib/src/Admin/Notices.php index 04bccc2..005a34d 100644 --- a/dependencies/barn2/barn2-lib/src/Admin/Notices.php +++ b/dependencies/barn2/barn2-lib/src/Admin/Notices.php @@ -2,34 +2,98 @@ namespace Barn2\Plugin\WC_Product_Tabs_Free\Dependencies\Lib\Admin; -use Barn2\Plugin\WC_Product_Tabs_Free\Dependencies\WPTRT\AdminNotices\Notices as AdminNoticesNotices; /** - * Extends the WPTRT Notices class to allow additional HTML in the admin notice. + * Manages admin notices. * * @package Barn2\barn2-lib * @author Barn2 Plugins * @license GPL-3.0 * @copyright Barn2 Media Ltd + * @version 1.0 * @internal */ -class Notices extends AdminNoticesNotices +class Notices { /** - * Constructor. + * An array of notices. + * + * @var array + */ + private $notices = []; + /** + * Boot all added admin notices. + */ + public function boot() + { + \add_action('admin_notices', [$this, 'the_notices']); + } + /** + * Adds a notice. + * + * @param string $id A unique notice ID. Should contain lowercase characters and underscores. + * @param string $title The title of the notice. + * @param string $message The notice message. + * @param array $options { + * Optional. An array of additional options to change the defaults for this notice. + * + * @type string $type The type of admin notice. Default 'info'. Accepts 'info', 'success', 'warning', 'error'. + * @type bool $alt_style Whether we want to use alt styles or not. Default false. + * @type array $additional_classes A string array of class names. + * @type array $attributes Additional attributes for the notice div. + * @type bool $paragraph_wrap Whether to wrap the message in paragraph tags. Default true. + * @type array $buttons Associative array with buttons attributes and values. Default []. + * @type string $capability The user capability required to see the notice. Default 'edit_theme_options'. + * @type array $screens An array of screens where the notice will be displayed. Default is empty to always show. + * @type bool $dismissible Whether the admin notice is dismissible. Default true. + * @type string $scope Saves the dismissed status as an option or user-meta. Accepts 'global', 'user'. Default 'global'. + * @type string $option_prefix The prefix that will be used to build the option (or post-meta) name. Should contain lowercase characters and underscores. + * @type callable $dissmiss_callback Function called before dismissing a notice. The arguments are $id, $title, $message, $options, $notice_obj. + * } + */ + public function add($id, $title, $message, $options = []) + { + $this->notices[$id] = new Notice($id, $title, $message, $options); + } + /** + * Removes a notice. + * + * @param string $id The unique ID of the notice we want to remove. */ - public function __construct() + public function remove($id) { - \add_filter('wptrt_admin_notices_allowed_html', [__CLASS__, 'filter_allowed_html']); + unset($this->notices[$id]); } /** - * Filter allowed html in notices. + * Gets a single notice. + * + * @param string $id The unique ID of the notice we want to retrieve. + * + * @return Notice|null + */ + public function get($id) + { + if (isset($this->notices[$id])) { + return $this->notices[$id]; + } + return null; + } + /** + * Gets all notices. * - * @param array $allowed_html * @return array */ - public static function filter_allowed_html($allowed_html) + public function get_all() + { + return $this->notices; + } + /** + * Prints all visible notices. + */ + public function the_notices() { - $allowed_html['a']['target'] = []; - return $allowed_html; + $notices = $this->get_all(); + foreach ($notices as $notice) { + $notice->the_notice(); + } } } diff --git a/dependencies/barn2/barn2-lib/src/Admin/Settings_API_Helper.php b/dependencies/barn2/barn2-lib/src/Admin/Settings_API_Helper.php index 63eb1c1..40b2fe8 100644 --- a/dependencies/barn2/barn2-lib/src/Admin/Settings_API_Helper.php +++ b/dependencies/barn2/barn2-lib/src/Admin/Settings_API_Helper.php @@ -221,6 +221,49 @@ class=" + + + /> + +
+ + +
+ $label) { + ?> +
+ + value="" /> + + + + + +
+ -
+
+
/> diff --git a/dependencies/barn2/barn2-lib/src/Plugin/I18n.php b/dependencies/barn2/barn2-lib/src/Plugin/I18n.php index bf78757..e721edd 100644 --- a/dependencies/barn2/barn2-lib/src/Plugin/I18n.php +++ b/dependencies/barn2/barn2-lib/src/Plugin/I18n.php @@ -37,7 +37,7 @@ public function __construct(Plugin $plugin) */ public function register() { - \add_action('after_setup_scheme', array($this, 'load_textdomain')); + \add_action('after_setup_theme', array($this, 'load_textdomain')); } /** * Load the plugin's textdomain. @@ -46,6 +46,6 @@ public function register() */ public function load_textdomain() { - \load_plugin_textdomain($this->plugin->plugin_data()->get_textdomain(), \false, $this->plugin->get_dir_path() . '/languages'); + \load_plugin_textdomain($this->plugin->plugin_data()->get_textdomain(), \false, \dirname(\plugin_basename($this->plugin->get_file())) . '/languages'); } } diff --git a/dependencies/barn2/barn2-lib/src/Plugin/License/Admin/License_Notices.php b/dependencies/barn2/barn2-lib/src/Plugin/License/Admin/License_Notices.php index d048dd9..9ec2a8c 100644 --- a/dependencies/barn2/barn2-lib/src/Plugin/License/Admin/License_Notices.php +++ b/dependencies/barn2/barn2-lib/src/Plugin/License/Admin/License_Notices.php @@ -33,6 +33,7 @@ public function __construct(Licensed_Plugin $plugin) public function register() { \add_action('admin_init', [$this, 'add_notices'], 50); + \add_action('admin_enqueue_scripts', [$this, 'register_scripts']); \add_action('barn2_license_activated_' . $this->plugin->get_id(), [$this, 'cleanup_transients']); \add_action('wp_ajax_barn2_dismiss_notice', [$this, 'ajax_dismiss_notice']); } @@ -177,11 +178,14 @@ public function cleanup_transients() \delete_transient($this->get_notice_dismissed_transient_name(self::DISABLED)); \delete_transient($this->get_notice_dismissed_transient_name(self::SITE_MOVED)); } - public function load_scripts() + public function register_scripts() { if (!\wp_script_is('barn2-notices', 'registered')) { \wp_register_script('barn2-notices', \plugins_url('dependencies/barn2/barn2-lib/build/js/admin/barn2-notices.js', $this->plugin->get_file()), ['jquery'], $this->plugin->get_version(), \true); } + } + public function load_scripts() + { \wp_enqueue_script('barn2-notices'); } public function ajax_dismiss_notice() diff --git a/dependencies/barn2/barn2-lib/src/Plugin/License/Plugin_License.php b/dependencies/barn2/barn2-lib/src/Plugin/License/Plugin_License.php index 61c1397..5d8f972 100644 --- a/dependencies/barn2/barn2-lib/src/Plugin/License/Plugin_License.php +++ b/dependencies/barn2/barn2-lib/src/Plugin/License/Plugin_License.php @@ -144,7 +144,7 @@ public function activate($license_key) if (isset($response->bonus_downloads)) { $license_data['bonus_downloads'] = $response->bonus_downloads; } - \do_action('barn2_license_activated_' . $this->item_id, $license_key, $url_to_activate); + \do_action("barn2_license_activated_{$this->item_id}", $license_key, $url_to_activate); } else { // Invalid license. $license_data['error_code'] = isset($response->error) ? $response->error : 'error'; @@ -159,6 +159,15 @@ public function activate($license_key) $license_data['error_message'] = $api_result->response; } $this->set_license_data($license_data); + /** + * Fires after the activation process has completed. + * + * @param string $license_key The license key that was activated. + * @param string $url_to_activate The URL that was used to activate the license. + * @param array $license_data The license data after activation. + * @param boolean $result Whether the activation was successful. + */ + \do_action("barn2_license_after_activate_{$this->item_id}", $license_key, $url_to_activate, $license_data, $result); return $result; } /** @@ -183,8 +192,9 @@ public function deactivate() } $result = \false; $license_data = []; + $license_key = $this->get_license_key(); $url_to_deactivate = $this->get_active_url(); - $api_result = $this->license_api->deactivate_license($this->get_license_key(), $this->item_id, $url_to_deactivate); + $api_result = $this->license_api->deactivate_license($license_key, $this->item_id, $url_to_deactivate); if ($api_result->success) { // Successful response - now check whether license is valid. $response = $api_result->response; @@ -201,13 +211,22 @@ public function deactivate() // In this case we refresh license data to ensure we have correct state stored in database. $this->refresh(); } - \do_action('barn2_license_deactivated_' . $this->item_id, $this->get_license_key(), $url_to_deactivate); + \do_action("barn2_license_deactivated_{$this->item_id}", $license_key, $url_to_deactivate); } else { // API error $license_data['error_code'] = 'error'; $license_data['error_message'] = $api_result->response; $this->update_license_data($license_data); } + /** + * Fires after the deactivation process has completed. + * + * @param string $license_key The license key that was deactivated. + * @param string $url_to_deactivate The URL that was used to deactivate the license. + * @param array $license_data The license data after deactivation. + * @param boolean $result Whether the deactivation was successful. + */ + \do_action("barn2_license_after_deactivate_{$this->item_id}", $license_key, $url_to_deactivate, $license_data, $result); return $result; } /** @@ -218,18 +237,22 @@ public function deactivate() */ public function refresh() { + $license_key = $this->get_license_key(); // No point refreshing if license doesn't exist. - if (!$this->get_license_key()) { + if (!$license_key) { return; } // If license is overridden, we shouldn't refresh as it will lose override state. if ($this->is_license_overridden()) { return; } - $license_data = ['license' => $this->get_license_key()]; + $result = \false; + $url_to_refresh = $this->get_home_url(); + $license_data = ['license' => $license_key]; // We use the home url when checking the license, as the license result should reflect the current site, not any previous site. - $api_result = $this->license_api->check_license($this->get_license_key(), $this->item_id, $this->get_home_url()); + $api_result = $this->license_api->check_license($license_key, $this->item_id, $url_to_refresh); if ($api_result->success) { + $result = \true; // Successful response returned. $response = $api_result->response; if ('valid' === $response->license) { @@ -245,21 +268,50 @@ public function refresh() } // Store returned license info. $license_data['license_info'] = $this->format_license_info($response); - \do_action('barn2_license_refreshed_' . $this->item_id, $this->get_license_key(), $this->get_home_url()); + \do_action("barn2_license_refreshed_{$this->item_id}", $license_key, $url_to_refresh); } else { // API error - store the error but don't change license status (e.g. temporary communication error). $license_data['error_code'] = 'error'; $license_data['error_message'] = $api_result->response; } $this->update_license_data($license_data); + /** + * Fires after the refresh process has completed. + * + * When refreshing a license, the result only indicates + * whether the refresh was successful, not whether the license is valid. + * Use the license status in the `$license_data` parameter to determine the license validity. + * + * @param string $license_key The license key that was refreshed. + * @param string $url_to_refresh The URL that was used to refresh the license. + * @param array $license_data The license data after refresh. + * @param boolean $result Whether the refresh was successful. + */ + \do_action("barn2_license_after_refresh_{$this->item_id}", $license_key, $url_to_refresh, $license_data, $result); } public function override($license_key, $status) { if (!$license_key || !$this->is_valid_status($status)) { return; } - $this->set_license_data(['license' => $license_key, 'url' => $this->get_home_url(), 'status' => $status, 'override' => \true]); - \do_action('barn2_license_activated_' . $this->item_id, $license_key, $this->get_home_url()); + $url_to_activate = $this->get_home_url(); + $license_data = ['license' => $license_key, 'url' => $url_to_activate, 'status' => $status, 'override' => \true]; + $this->set_license_data($license_data); + \do_action("barn2_license_activated_{$this->item_id}", $license_key, $url_to_activate); + /** + * Fires after the license has been overridden. + * + * The fourth parameter is always true as the override is always successful. + * It is provided here for consistency with the other license actions. + * Also, although override is effectively activating a license, we use the 'after_override' action + * right after the 'activated' action to differentiate between the two actions. + * + * @param string $license_key The license key that was overridden. + * @param string $url_to_activate The URL that was used to activate the license. + * @param array $license_data The license data after override. + * @param bool $result Whether the override was successful. Always true + */ + \do_action("barn2_license_after_override_{$this->item_id}", $license_key, $url_to_activate, $license_data, \true); } public function get_setting_name() { diff --git a/dependencies/barn2/barn2-lib/src/Plugin/Plugin_Data.php b/dependencies/barn2/barn2-lib/src/Plugin/Plugin_Data.php index 1918eb1..08b16a9 100644 --- a/dependencies/barn2/barn2-lib/src/Plugin/Plugin_Data.php +++ b/dependencies/barn2/barn2-lib/src/Plugin/Plugin_Data.php @@ -51,7 +51,7 @@ public function get_plugin_data(string $property = null) if (!\function_exists('get_plugin_data')) { require_once \ABSPATH . 'wp-admin/includes/plugin.php'; } - $this->plugin_data = \get_plugin_data($this->plugin->get_file()); + $this->plugin_data = \get_plugin_data($this->plugin->get_file(), \false, \false); } if (!\is_null($property)) { return $this->plugin_data[$property] ?? ''; diff --git a/dependencies/barn2/barn2-lib/src/Plugin/Simple_Plugin.php b/dependencies/barn2/barn2-lib/src/Plugin/Simple_Plugin.php index 154518b..ed9ad82 100644 --- a/dependencies/barn2/barn2-lib/src/Plugin/Simple_Plugin.php +++ b/dependencies/barn2/barn2-lib/src/Plugin/Simple_Plugin.php @@ -297,6 +297,15 @@ public function get_settings_page_url() { return !empty($this->data['settings_path']) ? \admin_url($this->data['settings_path']) : ''; } + /** + * Get the design page URL in the WordPress admin. + * + * @return string (URL) + */ + public function get_design_page_url() + { + return !empty($this->data['design_path']) ? \admin_url($this->data['design_path']) : ''; + } /** * Get the plugin data service. * diff --git a/dependencies/barn2/barn2-lib/src/Service/Updater.php b/dependencies/barn2/barn2-lib/src/Service/Updater.php new file mode 100644 index 0000000..7d137bc --- /dev/null +++ b/dependencies/barn2/barn2-lib/src/Service/Updater.php @@ -0,0 +1,323 @@ + + * @license GPL-3.0 + * @copyright Barn2 Media Ltd + * @version 1.0 + * @internal + */ +abstract class Updater implements Standard_Service, Conditional, Registerable +{ + /** + * Callbacks functions that are called on a plugin update. + * + * Please note that these functions are invoked when a plugin is updated from a previous version, + * but NOT when the plugin is newly installed. + * + * The array keys should contain the version number, and it MUST be sorted from low to high. + * + * Example: + * + * '1.11.0' => [ + * 'update_1_11_0_do_something', + * 'update_1_11_0_do_something_else', + * ], + * '1.23.0' => [ + * 'update_1_23_0_do_something', + * ], + * + * @var array + */ + public static $updates = []; + /** + * Plugin instance. + * + * @var Plugin + */ + protected $plugin; + /** + * The class options. + * + * See the get_default_options method to verify the array structure. + * + * @var string + */ + public $options = []; + /** + * Constructor. + * + * @param Plugin $plugin + * @param array $options { + * Optional. An array of additional options to change the default values. + * + * @type string $version_option_name Option name to store the version value on the options DB table. Default '_version'. + * @type array $needs_update_db_notice Needs update database admin notice array options. Accepts 'title', 'message', 'buttons' array keys. + * @type array $updating_db_notice Updating database admin notice options. Accepts 'title', 'message', 'buttons' array keys. + * @type array $update_db_complete_notice Update database complete admin notice options. Accepts 'title', 'message', 'buttons' array keys. + * } + */ + public function __construct(Plugin $plugin, $options = null) + { + $this->plugin = $plugin; + $this->set_options($options); + return $this; + } + /** + * {@inheritdoc} + */ + public function is_required() + { + return \is_admin() && $this->needs_update(); + } + /** + * {@inheritdoc} + */ + public function register() + { + // Check the plugin's version and show the update admin notice message. + \add_action('admin_init', [$this, 'check_version']); + // Print the script after common.js. + \add_action('admin_enqueue_scripts', [$this, 'add_script']); + // Handle AJAX requests to dismiss the notice. + \add_action('wp_ajax_' . $this->plugin->get_slug() . '_update_db', [$this, 'ajax_start_update']); + \add_action('wp_ajax_' . $this->plugin->get_slug() . '_check_update_db', [$this, 'ajax_check_update_db']); + } + /** + * Gets the default options. + * + * @return array + */ + public function get_default_options() + { + return ['version_option_name' => $this->plugin->get_slug() . '_version', 'needs_update_db_notice' => ['title' => \sprintf(__('%1$s database update required'), $this->plugin->get_name()), 'message' => \sprintf(__('

%1$s has been updated! To keep things running smoothly, we have to update your database to the newest version. The database update process runs in the background and may take a little while, so please be patient.

'), $this->plugin->get_name()), 'buttons' => ['update-db' => ['value' => 'Update Database', 'href' => \wp_nonce_url(\add_query_arg($this->plugin->get_slug() . '_update_db', 'true', \admin_url('admin.php?page=wc-settings')), 'wc_db_update', 'wc_db_update_nonce'), 'id' => $this->plugin->get_slug() . '-update-db', 'class' => 'button-primary'], 'learn-more' => ['value' => 'Learn more about updates', 'href' => 'https://barn2.com/kb/learn-more-about-updates/', 'target' => '_blank', 'class' => 'button-secondary', 'style' => 'margin-left: 8px;']]], 'updating_db_notice' => ['title' => \sprintf(__('%1$s database update'), $this->plugin->get_name()), 'message' => \sprintf(__('

%1$s is updating the database in the background. The database update process may take a little while, so please be patient.

'), $this->plugin->get_name())], 'update_db_complete_notice' => ['title' => \sprintf(__('%1$s database update done'), $this->plugin->get_name()), 'message' => \sprintf(__('

%1$s database update complete. Thank you for updating to the latest version!

'), $this->plugin->get_name())]]; + } + /** + * Sets the final options. + */ + public function set_options($options) + { + $this->options = \array_replace_recursive($this->get_default_options(), $options); + } + /** + * Checks the plugin's version and shows the update admin notice message if an update is required. + */ + public function check_version() + { + if ($this->needs_update() && !\defined('IFRAME_REQUEST')) { + $this->show_notice(); + } + } + /** + * Show the update admin notice message. + */ + public function show_notice() + { + // Removes all old dismissed admin notice messages status. + \delete_option('barn2_notice_dismissed_' . $this->plugin->get_slug() . '_updating_db_notice'); + \delete_option('barn2_notice_dismissed_' . $this->plugin->get_slug() . '_update_db_complete_notice'); + $admin_notice = new Notices(); + // If it needs to update. + if ($this->needs_update() && !$this->is_updating()) { + $admin_notice->add($this->plugin->get_slug() . '_needs_update_db_notice', $this->options['needs_update_db_notice']['title'], $this->options['needs_update_db_notice']['message'], ['type' => 'warning', 'capability' => 'install_plugins', 'dismissible' => \false, 'buttons' => $this->options['needs_update_db_notice']['buttons'] ?? null]); + } + // If it is updating. + if ($this->needs_update() || $this->is_updating()) { + $admin_notice->add($this->plugin->get_slug() . '_updating_db_notice', $this->options['updating_db_notice']['title'], $this->options['updating_db_notice']['message'], ['type' => 'info', 'capability' => 'install_plugins', 'additional_classes' => $this->is_updating() ? [] : ['hidden'], 'buttons' => $this->options['updating_db_notice']['buttons'] ?? null]); + } + // If the update is complete. + if ($this->needs_update() || $this->update_is_complete()) { + $admin_notice->add($this->plugin->get_slug() . '_update_db_complete_notice', $this->options['update_db_complete_notice']['title'], $this->options['update_db_complete_notice']['message'], ['type' => 'success', 'capability' => 'install_plugins', 'additional_classes' => $this->needs_update() ? ['hidden'] : [], 'buttons' => $this->options['update_db_complete_notice']['buttons'] ?? null]); + } + $admin_notice->boot(); + } + /** + * Runs all the required update callback functions. + */ + private function update() + { + // Deletes previous updating status. + \delete_transient($this->plugin->get_slug() . '_updating_db'); + \delete_transient($this->plugin->get_slug() . '_update_db_complete'); + // Set updating DB status. + \set_transient($this->plugin->get_slug() . '_updating_db', \true); + $db_version = $this->get_current_database_version(); + $code_version = $this->get_current_code_version(); + // Runs the required updates. + foreach (self::get_update_callbacks() as $version => $update_callbacks) { + if (\version_compare($db_version, $version, '<')) { + self::update_version($version); + if ($this->update_db_version($version)) { + $db_version = $version; + } + } + } + if (\version_compare($code_version, $db_version, '>')) { + $this->update_db_version($code_version); + } + // Deletes updating DB status. + \delete_transient($this->plugin->get_slug() . '_updating_db'); + // Set update DB complete status. + \set_transient($this->plugin->get_slug() . '_update_db_complete', \true); + /** + * Fires after the plugin is updated. + * + * @param string $db_version The version of the plugin as stored in the database. + * @param string $code_version The version of the plugin as stored in the code. + */ + \do_action($this->plugin->get_slug() . '_updated', $db_version, $code_version, $this->plugin); + } + /** + * Updates a specific version. + */ + public static function update_version($version = '') + { + if (isset(static::$updates[$version])) { + foreach (static::$updates[$version] as $function) { + if (\method_exists(\get_called_class(), $function)) { + static::$function(); + } + } + } + } + /** + * Updates the version on the DB. + * + * @param string|null $version Version number or null to use the current plugin version. + * + * @return bool + */ + public function update_db_version($version = null) : bool + { + return \update_option($this->options['version_option_name'], \is_null($version) ? $this->get_current_code_version() : $version); + } + /** + * Prints the script for handling the update process. + */ + public function add_script() + { + // If it needs an update. + if ($this->needs_update() && !$this->is_updating()) { + $script = "( function( \$, window, document, undefined ) {\n\n\t\$( function() {\n\n\t\t\$( '#" . $this->plugin->get_slug() . "-update-db' ).on( 'click', function( e ) {\n e.preventDefault();\n\n \$( '#" . $this->plugin->get_slug() . "_needs_update_db_notice' ).hide();\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).show();\n\n\t\t\tvar data = \$( this ).data();\n\t\t\tdata.action = '" . $this->plugin->get_slug() . "_update_db';\n\t\t\tdata.nonce = '" . \wp_create_nonce($this->plugin->get_slug() . '_update_db') . "';\n\n\t\t\t\$.ajax( {\n\t\t\t\turl: ajaxurl, // always defined when running in WP Admin\n\t\t\t\ttype: 'POST',\n\t\t\t\tdata: data,\n\t\t\t\txhrFields: {\n\t\t\t\t\twithCredentials: true\n\t\t\t\t}\n\t\t\t} ).done(function (out) {\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\n \$( '#" . $this->plugin->get_slug() . "_update_db_complete_notice' ).show();\n\t\t\t}).fail(function (out) {\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\n \$( '#" . $this->plugin->get_slug() . "_update_db_error_notice' ).show();\n\t\t\t});\n\t\t} );\n\t} );\n\n} )( jQuery, window, document );"; + } + // If it's already updating. + if ($this->needs_update() && $this->is_updating()) { + $script = "( function( \$, window, document, undefined ) {\n\n\t\$( function() {\n\n var data = {};\n data.action = '" . $this->plugin->get_slug() . "_check_update_db';\n data.nonce = '" . \wp_create_nonce($this->plugin->get_slug() . '_check_update_db') . "';\n\n \$.ajax( {\n url: ajaxurl, // always defined when running in WP Admin\n type: 'POST',\n data: data,\n xhrFields: {\n withCredentials: true\n }\n } ).done(function (out) {\n console.log('CHECKED');\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\n \$( '#" . $this->plugin->get_slug() . "_update_db_complete_notice' ).show();\n }).fail(function (out) {\n \$( '#" . $this->plugin->get_slug() . "_updating_db_notice' ).hide();\n \$( '#" . $this->plugin->get_slug() . "_update_db_error_notice' ).show();\n });\n\n\t} );\n\n} )( jQuery, window, document );"; + } + if (isset($script)) { + \wp_add_inline_script('common', $script, 'after'); + } + } + /** + * Starts the update process through AJAX. + */ + public function ajax_start_update() + { + if (!isset($_POST['action']) || $_POST['action'] !== $this->plugin->get_slug() . '_update_db') { + return; + } + \check_ajax_referer($this->plugin->get_slug() . '_update_db', 'nonce', \true); + $this->update(); + exit; + } + /** + * Check if the plugin is updating through AJAX. + */ + public function ajax_check_update_db() + { + global $wpdb; + if (!isset($_POST['action']) || $_POST['action'] !== $this->plugin->get_slug() . '_check_update_db') { + return; + } + \check_ajax_referer($this->plugin->get_slug() . '_check_update_db', 'nonce', \true); + // Using a query to get the transient value otherwise WordPress will use the first cached values instead. + $query = "SELECT option_value FROM wp_options WHERE option_name ='" . '_transient_' . $this->plugin->get_slug() . '_updating_db' . "';"; + while ($wpdb->get_var($query) !== null) { + \sleep(1); + } + exit; + } + /** + * Get the list of update callbacks from the plugin Update class. + * + * @return array + */ + public static function get_update_callbacks() : array + { + return static::$updates; + } + /** + * Gets the latest update version from the plugin Update class. + * + * @return string + */ + public function get_latest_update_version() + { + return \array_key_last(self::get_update_callbacks()); + } + /** + * Gets the current plugin version as stored in the database. + * + * @return string + */ + public function get_current_database_version() + { + return \get_option($this->options['version_option_name']); + } + /** + * Gets the current plugin version as stored in the code. + * + * @return string + */ + public function get_current_code_version() : string + { + return $this->plugin->get_version(); + } + /** + * Condition to verify if it's a new plugin installation and not an update. + * + * @return bool + */ + public function is_new_install() : bool + { + return \false; + } + /** + * Verifies if it needs to update. + * + * @return bool + */ + public function needs_update() + { + $db_version = $this->get_current_database_version(); + $latest_update_version = $this->get_latest_update_version(); + return !$this->is_new_install() && $latest_update_version !== null && \version_compare($db_version, $latest_update_version, '<'); + } + /** + * Verifies if the plugin is updating. + * + * @return string|bool + */ + public function is_updating() + { + return \get_transient($this->plugin->get_slug() . '_updating_db'); + } + /** + * Verifies if the update is complete. + * + * @return string|bool + */ + public function update_is_complete() + { + return \get_transient($this->plugin->get_slug() . '_update_db_complete'); + } +} diff --git a/dependencies/barn2/barn2-lib/src/Util.php b/dependencies/barn2/barn2-lib/src/Util.php index 50de4eb..38133a7 100644 --- a/dependencies/barn2/barn2-lib/src/Util.php +++ b/dependencies/barn2/barn2-lib/src/Util.php @@ -359,7 +359,7 @@ public static function get_plugin_data(Plugin $plugin) if (!\function_exists('get_plugin_data')) { require_once \ABSPATH . 'wp-admin/includes/plugin.php'; } - return \get_plugin_data($plugin->get_file()); + return \get_plugin_data($plugin->get_file(), \false, \false); } /** * Loops through all active plugins on the user's website and returns ones that are authored by Barn2 @@ -568,7 +568,7 @@ public static function install_bonus_plugins($bonus_plugins) if ($plugin && \current_user_can('activate_plugin', $plugin)) { $cache_plugins = \wp_cache_get('plugins', 'plugins'); if (!empty($cache_plugins)) { - $new_plugin = \get_plugin_data(\WP_PLUGIN_DIR . '/' . $plugin); + $new_plugin = \get_plugin_data(\WP_PLUGIN_DIR . '/' . $plugin, \false, \false); $cache_plugins[''][$plugin] = $new_plugin; \wp_cache_set('plugins', $cache_plugins, 'plugins'); } diff --git a/package.json b/package.json index 4e59990..796c404 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "woocommerce-product-tabs", "title": "WooCommerce Product Tabs (Free)", - "version": "2.1.7", + "version": "2.1.8", "license": "GPL-2.0+", "main_file": "woocommerce-product-tabs.php", "author": "Barn2 Plugins ", diff --git a/readme.txt b/readme.txt index 2305ff9..a676011 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: woocommerce product tabs, woocommerce custom tabs, woocommerce tabs, wooco Requires PHP: 7.4 Requires at least: 6.1 Tested up to: 6.7 -Stable tag: 2.1.7 +Stable tag: 2.1.8 License: GNU General Public License v3.0 License URI: http://www.gnu.org/licenses/gpl-3.0.html Donate link: https://barn2.com @@ -130,6 +130,14 @@ Please report any security bugs through the [Patchstack Vulnerability Disclosure == Changelog == += 2.1.8 = +Release date 26 November 2024 + +* Dev: Tested up to WordPress 6.7.1 +* Dev: Updated the internal libraries + + + = 2.1.7 = Release date 18 November 2024 @@ -137,8 +145,6 @@ Release date 18 November 2024 * Dev: Changed the way the tab slug is saved * Dev: Added the uninstall file - - = 2.1.6 = Release date 24 September 2024 diff --git a/vendor/composer/autoload_classmap.php b/vendor/composer/autoload_classmap.php index 598dfed..392dd88 100644 --- a/vendor/composer/autoload_classmap.php +++ b/vendor/composer/autoload_classmap.php @@ -7,6 +7,7 @@ return array( 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Admin\\Abstract_Plugin_Promo' => $baseDir . '/dependencies/barn2/barn2-lib/src/Admin/Abstract_Plugin_Promo.php', + 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Admin\\Notice' => $baseDir . '/dependencies/barn2/barn2-lib/src/Admin/Notice.php', 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Admin\\Notices' => $baseDir . '/dependencies/barn2/barn2-lib/src/Admin/Notices.php', 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Admin\\Plugin_Promo' => $baseDir . '/dependencies/barn2/barn2-lib/src/Admin/Plugin_Promo.php', 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Admin\\Settings_API_Helper' => $baseDir . '/dependencies/barn2/barn2-lib/src/Admin/Settings_API_Helper.php', @@ -49,6 +50,7 @@ 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Service\\Service_Container' => $baseDir . '/dependencies/barn2/barn2-lib/src/Service/Service_Container.php', 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Service\\Service_Provider' => $baseDir . '/dependencies/barn2/barn2-lib/src/Service/Service_Provider.php', 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Service\\Standard_Service' => $baseDir . '/dependencies/barn2/barn2-lib/src/Service/Standard_Service.php', + 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Service\\Updater' => $baseDir . '/dependencies/barn2/barn2-lib/src/Service/Updater.php', 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Template_Loader' => $baseDir . '/dependencies/barn2/barn2-lib/src/Template_Loader.php', 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Traits\\Plugin_Aware' => $baseDir . '/dependencies/barn2/barn2-lib/src/Traits/Plugin_Aware.php', 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Translatable' => $baseDir . '/dependencies/barn2/barn2-lib/src/Translatable.php', diff --git a/vendor/composer/autoload_static.php b/vendor/composer/autoload_static.php index 5c931a4..9062417 100644 --- a/vendor/composer/autoload_static.php +++ b/vendor/composer/autoload_static.php @@ -22,6 +22,7 @@ class ComposerStaticInitdf4e5f2eb664b9ee609626af6b1cda76 public static $classMap = array ( 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Admin\\Abstract_Plugin_Promo' => __DIR__ . '/../..' . '/dependencies/barn2/barn2-lib/src/Admin/Abstract_Plugin_Promo.php', + 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Admin\\Notice' => __DIR__ . '/../..' . '/dependencies/barn2/barn2-lib/src/Admin/Notice.php', 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Admin\\Notices' => __DIR__ . '/../..' . '/dependencies/barn2/barn2-lib/src/Admin/Notices.php', 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Admin\\Plugin_Promo' => __DIR__ . '/../..' . '/dependencies/barn2/barn2-lib/src/Admin/Plugin_Promo.php', 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Admin\\Settings_API_Helper' => __DIR__ . '/../..' . '/dependencies/barn2/barn2-lib/src/Admin/Settings_API_Helper.php', @@ -64,6 +65,7 @@ class ComposerStaticInitdf4e5f2eb664b9ee609626af6b1cda76 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Service\\Service_Container' => __DIR__ . '/../..' . '/dependencies/barn2/barn2-lib/src/Service/Service_Container.php', 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Service\\Service_Provider' => __DIR__ . '/../..' . '/dependencies/barn2/barn2-lib/src/Service/Service_Provider.php', 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Service\\Standard_Service' => __DIR__ . '/../..' . '/dependencies/barn2/barn2-lib/src/Service/Standard_Service.php', + 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Service\\Updater' => __DIR__ . '/../..' . '/dependencies/barn2/barn2-lib/src/Service/Updater.php', 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Template_Loader' => __DIR__ . '/../..' . '/dependencies/barn2/barn2-lib/src/Template_Loader.php', 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Traits\\Plugin_Aware' => __DIR__ . '/../..' . '/dependencies/barn2/barn2-lib/src/Traits/Plugin_Aware.php', 'Barn2\\Plugin\\WC_Product_Tabs_Free\\Dependencies\\Lib\\Translatable' => __DIR__ . '/../..' . '/dependencies/barn2/barn2-lib/src/Translatable.php', diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 37706db..50ff8df 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => 'barn2plugins/woocommerce-product-tabs', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '250213cafb01234ad365dfb36dac383b9883cb01', + 'reference' => 'b37ecd13a2378efefd90684207f3a00ef3febc16', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ 'barn2plugins/woocommerce-product-tabs' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '250213cafb01234ad365dfb36dac383b9883cb01', + 'reference' => 'b37ecd13a2378efefd90684207f3a00ef3febc16', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), diff --git a/woocommerce-product-tabs.php b/woocommerce-product-tabs.php index f2bad66..a7de0a8 100644 --- a/woocommerce-product-tabs.php +++ b/woocommerce-product-tabs.php @@ -11,7 +11,7 @@ * Plugin Name: WooCommerce Product Tabs (Free) * Plugin URI: https://barn2.com/wordpress-plugins/woocommerce-product-tabs/ * Description: Boost your product pages by adding custom tabs containing extra information. - * Version: 2.1.7 + * Version: 2.1.8 * Author: Barn2 Plugins * Author URI: https://barn2.com * Text Domain: woocommerce-product-tabs @@ -20,7 +20,7 @@ * Requires PHP: 7.4 * Requires at least: 6.1 * WC requires at least: 7.2 - * WC tested up to: 9.4.1 + * WC tested up to: 9.4.2 * * Copyright: Barn2 Media Ltd * License: GNU General Public License v3.0 @@ -34,7 +34,7 @@ exit; } -const PLUGIN_VERSION = '2.1.7'; +const PLUGIN_VERSION = '2.1.8'; const PLUGIN_FILE = __FILE__; // Autoloader.