diff --git a/email-verification-for-woocommerce.php b/email-verification-for-woocommerce.php index 00aae19..8c50a4f 100644 --- a/email-verification-for-woocommerce.php +++ b/email-verification-for-woocommerce.php @@ -39,6 +39,12 @@ function alg_wc_ev_is_plugin_active( $plugin ) { ! alg_wc_ev_is_plugin_active( 'woocommerce/woocommerce.php' ) || ( 'email-verification-for-woocommerce.php' === basename( __FILE__ ) && alg_wc_ev_is_plugin_active( 'email-verification-for-woocommerce-pro/email-verification-for-woocommerce-pro.php' ) ) ) { + if ( function_exists( 'alg_wc_ev' ) ) { + $plugin = alg_wc_ev(); + if ( method_exists( $plugin, 'set_free_version_filesystem_path' ) ) { + $plugin->set_free_version_filesystem_path( __FILE__ ); + } + } return; } @@ -80,6 +86,13 @@ final class Alg_WC_Email_Verification { */ public $core; + /** + * $free_version_file_system_path. + * + * @since 2.9.1 + */ + protected $free_version_file_system_path; + /** * Main Alg_WC_Email_Verification Instance * @@ -100,7 +113,7 @@ public static function instance() { /** * Initializes the plugin. * - * @version 2.9.0 + * @version 2.9.1 * @since 1.0.0 * @access public */ @@ -114,6 +127,14 @@ function init() { // Localization. add_action( 'init', array( $this, 'localize' ) ); + // Adds compatibility with HPOS. + add_action( 'before_woocommerce_init', function () { + $this->declare_compatibility_with_hpos( $this->get_filesystem_path() ); + if ( ! empty( $this->get_free_version_filesystem_path() ) ) { + $this->declare_compatibility_with_hpos( $this->get_free_version_filesystem_path() ); + } + } ); + // Pro. if ( 'email-verification-for-woocommerce-pro.php' === basename( __FILE__ ) ) { require_once( 'includes/pro/class-alg-wc-ev-pro.php' ); @@ -131,6 +152,24 @@ function init() { add_filter( 'wpfpdh_documentation_params_' . plugin_basename( $this->get_filesystem_path() ), array( $this, 'handle_documentation_params' ), 10 ); } + /** + * Declare compatibility with custom order tables for WooCommerce. + * + * @version 2.9.1 + * @since 2.9.1 + * + * @param $filesystem_path + * + * @return void + * @link https://github.com/woocommerce/woocommerce/wiki/High-Performance-Order-Storage-Upgrade-Recipe-Book#declaring-extension-incompatibility + * + */ + function declare_compatibility_with_hpos( $filesystem_path ) { + if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { + \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', $filesystem_path, true ); + } + } + /** * add_cross_selling_library. * @@ -314,6 +353,30 @@ function get_filesystem_path() { return __FILE__; } + /** + * get_free_version_filesystem_path. + * + * @version 2.9.1 + * @since 2.9.1 + * + * @return mixed + */ + public function get_free_version_filesystem_path() { + return $this->free_version_file_system_path; + } + + /** + * set_free_version_filesystem_path. + * + * @version 2.9.1 + * @since 2.9.1 + * + * @param mixed $free_version_file_system_path + */ + public function set_free_version_filesystem_path( $free_version_file_system_path ) { + $this->free_version_file_system_path = $free_version_file_system_path; + } + } endif; @@ -351,10 +414,4 @@ function alg_wc_ev() { delete_option( $activation_hook ); do_action( $activation_hook ); } -} ); - -add_action( 'before_woocommerce_init', function() { - if ( class_exists( \Automattic\WooCommerce\Utilities\FeaturesUtil::class ) ) { - \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility( 'custom_order_tables', dirname(__FILE__), true ); - } } ); \ No newline at end of file diff --git a/langs/emails-verification-for-woocommerce-fr_FR.po b/langs/emails-verification-for-woocommerce-fr_FR.po index 5de5ea9..df49c0f 100644 --- a/langs/emails-verification-for-woocommerce-fr_FR.po +++ b/langs/emails-verification-for-woocommerce-fr_FR.po @@ -15,7 +15,7 @@ msgstr "" "X-Loco-Parser: loco_parse_po\n" "X-Generator: Loco https://localise.biz/\n" -#: email-verification-for-woocommerce-pro.php:244 +#: email-verification-for-woocommerce-pro.php:283 msgid "Go Pro" msgstr "Passez en version Pro" diff --git a/langs/emails-verification-for-woocommerce-pt_BR.po b/langs/emails-verification-for-woocommerce-pt_BR.po index a600d24..b3f51a8 100644 --- a/langs/emails-verification-for-woocommerce-pt_BR.po +++ b/langs/emails-verification-for-woocommerce-pt_BR.po @@ -30,7 +30,7 @@ msgstr "" msgid "https://wpfactory.com" msgstr "" -#: email-verification-for-woocommerce-pro.php:244 +#: email-verification-for-woocommerce-pro.php:283 msgid "Go Pro" msgstr "" diff --git a/langs/emails-verification-for-woocommerce.pot b/langs/emails-verification-for-woocommerce.pot index 52a31dd..bc30a86 100644 --- a/langs/emails-verification-for-woocommerce.pot +++ b/langs/emails-verification-for-woocommerce.pot @@ -9,7 +9,7 @@ msgstr "" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-11-12T21:15:42+01:00\n" +"POT-Creation-Date: 2024-11-12T21:30:42+01:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.7.1\n" "X-Domain: emails-verification-for-woocommerce\n" @@ -35,7 +35,7 @@ msgstr "" msgid "https://wpfactory.com" msgstr "" -#: email-verification-for-woocommerce-pro.php:244 +#: email-verification-for-woocommerce-pro.php:283 msgid "Go Pro" msgstr "" diff --git a/readme.txt b/readme.txt index 52e1638..6b485b3 100644 --- a/readme.txt +++ b/readme.txt @@ -353,11 +353,12 @@ Params for the `[alg_wc_ev_email_content_placeholder]` shortcode: **Post-Activation:** Once activated, access the plugin's settings by navigating to “WooCommerce > Settings” and look for the relevant tab. - == Changelog == = 2.9.1 - 12/11/2024 = +* Fix - HPOS compatibility fixed. * Dev - Email - Activation email - Disabled editing in read-only mode. +* Dev - Updated cross-selling library. * WC tested up to: 9.4. = 2.9.0 - 22/10/2024 = diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index d6bb5a6..4a7adb2 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -3,7 +3,7 @@ 'name' => '__root__', 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '902fb6c19a156787ad70a524792690adcf7890c8', + 'reference' => '3bffcf506e2be7f8c3e66c884d3448d348e6682f', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -13,7 +13,7 @@ '__root__' => array( 'pretty_version' => 'dev-master', 'version' => 'dev-master', - 'reference' => '902fb6c19a156787ad70a524792690adcf7890c8', + 'reference' => '3bffcf506e2be7f8c3e66c884d3448d348e6682f', 'type' => 'library', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),