Skip to content

Commit

Permalink
v2.9.1
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-sg-pacheco committed Nov 12, 2024
1 parent c0b637d commit 2671b86
Show file tree
Hide file tree
Showing 6 changed files with 72 additions and 14 deletions.
71 changes: 64 additions & 7 deletions email-verification-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down Expand Up @@ -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
*
Expand All @@ -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
*/
Expand All @@ -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' );
Expand All @@ -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.
*
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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 );
}
} );
2 changes: 1 addition & 1 deletion langs/emails-verification-for-woocommerce-fr_FR.po
Original file line number Diff line number Diff line change
Expand Up @@ -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"

Expand Down
2 changes: 1 addition & 1 deletion langs/emails-verification-for-woocommerce-pt_BR.po
Original file line number Diff line number Diff line change
Expand Up @@ -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 ""

Expand Down
4 changes: 2 additions & 2 deletions langs/emails-verification-for-woocommerce.pot
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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 ""

Expand Down
3 changes: 2 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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 =
Expand Down
4 changes: 2 additions & 2 deletions vendor/composer/installed.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
'name' => '__root__',
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '902fb6c19a156787ad70a524792690adcf7890c8',
'reference' => '3bffcf506e2be7f8c3e66c884d3448d348e6682f',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand All @@ -13,7 +13,7 @@
'__root__' => array(
'pretty_version' => 'dev-master',
'version' => 'dev-master',
'reference' => '902fb6c19a156787ad70a524792690adcf7890c8',
'reference' => '3bffcf506e2be7f8c3e66c884d3448d348e6682f',
'type' => 'library',
'install_path' => __DIR__ . '/../../',
'aliases' => array(),
Expand Down

0 comments on commit 2671b86

Please sign in to comment.