Skip to content

Commit

Permalink
v2.2.8
Browse files Browse the repository at this point in the history
  • Loading branch information
pablo-sg-pacheco committed Mar 2, 2022
1 parent 682fc96 commit 7203dea
Show file tree
Hide file tree
Showing 7 changed files with 117 additions and 25 deletions.
6 changes: 3 additions & 3 deletions email-verification-for-woocommerce.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@
Plugin Name: Email Verification for WooCommerce
Plugin URI: https://wpfactory.com/item/email-verification-for-woocommerce/
Description: Verify user emails in WooCommerce. Beautifully.
Version: 2.2.7
Version: 2.2.8
Author: WPFactory
Author URI: https://wpfactory.com
Text Domain: emails-verification-for-woocommerce
Domain Path: /langs
Copyright: © 2022 WPFactory
WC tested up to: 6.1
WC tested up to: 6.2
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html
*/
Expand Down Expand Up @@ -62,7 +62,7 @@ final class Alg_WC_Email_Verification {
* @var string
* @since 1.0.0
*/
public $version = '2.2.7';
public $version = '2.2.8';

/**
* @var Alg_WC_Email_Verification The single instance of the class
Expand Down
29 changes: 25 additions & 4 deletions includes/class-alg-wc-ev-core.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Email Verification for WooCommerce - Core Class
*
* @version 2.2.6
* @version 2.2.8
* @since 1.0.0
* @author WPFactory
*/
Expand Down Expand Up @@ -337,11 +337,33 @@ function output_success_activation_message() {
/**
* redirect_on_success_activation.
*
* @version 2.2.6
* @version 2.2.8
* @since 2.0.0
*
*/
function redirect_on_success_activation( $user_id, $args ) {
if ( false !== ( $redirect_url = $this->get_redirect_url_on_success_activation( $args ) ) ) {
$redirect_url = add_query_arg( array( 'alg_wc_ev_success_activation_message' => 1 ), $redirect_url );
wp_redirect( $redirect_url );
exit;
}
}

/**
* get_redirect_url_on_success_activation.
*
* @version 2.2.8
* @since 2.2.8
*
* @param null $args
*
* @return bool|string
*/
function get_redirect_url_on_success_activation( $args = null ) {
$args = wp_parse_args( $args, array(
'directly' => true
) );
$redirect_url = false;
if (
'no' !== ( $redirect = get_option( 'alg_wc_ev_redirect_to_my_account_on_success', 'yes' ) ) &&
$args['directly']
Expand All @@ -360,9 +382,8 @@ function redirect_on_success_activation( $user_id, $args ) {
$redirect_url = wc_get_page_permalink( 'myaccount' );
}
$redirect_url = add_query_arg( array( 'alg_wc_ev_success_activation_message' => 1 ), $redirect_url );
wp_redirect( $redirect_url );
exit;
}
return $redirect_url;
}

/**
Expand Down
10 changes: 7 additions & 3 deletions includes/class-alg-wc-ev-logouts.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Email Verification for WooCommerce - Logouts Class
*
* @version 2.2.6
* @version 2.2.8
* @since 1.6.0
* @author WPFactory
*/
Expand Down Expand Up @@ -202,7 +202,7 @@ function logout_and_redirect_user_myaccount() {
/**
* block_unverified_user_login.
*
* @version 2.1.5
* @version 2.2.8
* @since 1.0.0
*
* @param $user
Expand All @@ -225,7 +225,11 @@ function block_unverified_user_login( $user ) {
! alg_wc_ev()->core->is_user_verified( $check_user )
) {
$error_msg = apply_filters( 'alg_wc_ev_block_unverified_user_login_error_message', alg_wc_ev()->core->messages->get_error_message( $check_user->ID ), $check_user );
$user = new WP_Error( 'alg_wc_ev_email_verified_error', $error_msg );
if ( is_a( $user, 'WP_User' ) ) {
$user = new WP_Error( 'alg_wc_ev_email_verified_error', $error_msg );
} elseif ( is_wp_error( $user ) ) {
$user->add( 'alg_wc_ev_email_verified_error', $error_msg );
}
}
}
return $user;
Expand Down
10 changes: 5 additions & 5 deletions includes/settings/class-alg-wc-ev-settings-admin.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Email Verification for WooCommerce - Admin Section Settings
*
* @version 2.2.0
* @version 2.2.8
* @since 1.3.0
* @author WPFactory
*/
Expand Down Expand Up @@ -44,7 +44,7 @@ function get_allowed_user_roles_option() {
/**
* get_settings.
*
* @version 2.2.0
* @version 2.2.8
* @since 1.3.0
* @todo [next] Delete users (automatically): better description
* @todo [next] Email: better description(s) and default value(s)
Expand All @@ -60,9 +60,9 @@ function get_settings() {
'id' => 'alg_wc_ev_admin_options',
),
array(
'title' => __( 'Allowed user roles', 'cost-of-goods-for-woocommerce' ),
'desc' => __( 'User roles allowed to see and interact with the admin interface from the Email Verification plugin.', 'cost-of-goods-for-woocommerce' ),
'desc_tip' => __( 'The administrator can\'t be removed', 'cost-of-goods-for-woocommerce' ),
'title' => __( 'Allowed user roles', 'emails-verification-for-woocommerce' ),
'desc' => __( 'User roles allowed to see and interact with the admin interface from the Email Verification plugin.', 'emails-verification-for-woocommerce' ),
'desc_tip' => __( 'The administrator can\'t be removed', 'emails-verification-for-woocommerce' ),
'id' => 'alg_wc_ev_admin_allowed_user_roles',
'default' => array( 'administrator' ),
'type' => 'multiselect',
Expand Down
28 changes: 25 additions & 3 deletions includes/settings/class-alg-wc-ev-settings-compatibility.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
/**
* Email Verification for WooCommerce - Compatibility Section Settings.
*
* @version 2.2.7
* @version 2.2.8
* @since 2.1.3
* @author WPFactory
*/
Expand All @@ -28,7 +28,7 @@ function __construct() {
/**
* get_settings.
*
* @version 2.2.7
* @version 2.2.8
* @since 2.1.3
* @todo (maybe) remove `alg_wc_ev_prevent_login_after_checkout_notice` (i.e. make it always enabled)
*/
Expand Down Expand Up @@ -133,8 +133,30 @@ function get_settings() {
'id' => 'alg_wc_ev_compatibility_email_customizer_options',
),
);
$elementor_essential_addons_opts = array(
array(
'title' => __( 'Essential Addons for Elementor', 'emails-verification-for-woocommerce' ),
'type' => 'title',
'desc' => sprintf( __( 'Compatibility with %s plugin.', 'emails-verification-for-woocommerce' ), sprintf( '<a href="%s" target="_blank">%s</a>', 'https://essential-addons.com/elementor/', __( __( 'Essential Addons for Elementor', 'emails-verification-for-woocommerce' ), 'emails-verification-for-woocommerce' ) ) ),
'id' => 'alg_wc_ev_compatibility_elementor_ea_options',
),
array(
'title' => __( 'Login Register form', 'emails-verification-for-woocommerce' ),
'desc' => sprintf( __( 'Verify users who register or log in from %s element', 'emails-verification-for-woocommerce' ), '<strong>' . __( 'Login Register form', 'emails-verification-for-woocommerce' ) . '</strong>' ),
'desc_tip' => sprintf( __( 'If you have issues, try to enable %s and set the %s option as %s.', 'emails-verification-for-woocommerce' ), '<strong>' . __( 'General > Account verification > Verify account for current users', 'emails-verification-for-woocommerce' ) . '</strong>','<strong>'.__( 'Advanced > Authenticate filter', 'emails-verification-for-woocommerce' ) . '</strong>', '<strong>'.__( 'Authenticate', 'emails-verification-for-woocommerce' ) . '</strong>' ) . '<br />' .
$this->separate_email_option_msg( 'enabled' ),
'id' => 'alg_wc_ev_compatibility_elementor_ea_login_register_form',
'default' => 'no',
'type' => 'checkbox',
'custom_attributes' => apply_filters( 'alg_wc_ev_settings', array( 'disabled' => 'disabled' ) ),
),
array(
'type' => 'sectionend',
'id' => 'alg_wc_ev_compatibility_elementor_ea_options',
),
);
return array_merge(
$general, $email_customizer_themehigh_opts
$general, $elementor_essential_addons_opts, $email_customizer_themehigh_opts
);
}

Expand Down
52 changes: 46 additions & 6 deletions langs/emails-verification-for-woocommerce.pot
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,14 @@
# This file is distributed under the GNU General Public License v3.0.
msgid ""
msgstr ""
"Project-Id-Version: Email Verification for WooCommerce 2.2.7\n"
"Project-Id-Version: Email Verification for WooCommerce 2.2.8\n"
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/emails-verification-for-woocommerce\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
"POT-Creation-Date: 2022-01-31T19:20:02+01:00\n"
"POT-Creation-Date: 2022-03-02T15:37:15+01:00\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"X-Generator: WP-CLI 2.4.0\n"
"X-Domain: emails-verification-for-woocommerce\n"
Expand Down Expand Up @@ -83,7 +83,7 @@ msgid "User %s: activation link resent."
msgstr ""

#: includes/class-alg-wc-ev-admin.php:432
#: includes/class-alg-wc-ev-core.php:685
#: includes/class-alg-wc-ev-core.php:706
msgid "Verified"
msgstr ""

Expand Down Expand Up @@ -124,15 +124,15 @@ msgid "You can resend the email with verification link by clicking <a href=\"%re
msgstr ""

#: includes/class-alg-wc-ev-core.php:186
#: includes/class-alg-wc-ev-core.php:684
#: includes/class-alg-wc-ev-core.php:705
msgid "Verification status: "
msgstr ""

#: includes/class-alg-wc-ev-core.php:653
#: includes/class-alg-wc-ev-core.php:674
msgid "You can resend the email with verification link by clicking <a href=\"{resend_verification_url}\">here</a>."
msgstr ""

#: includes/class-alg-wc-ev-core.php:686
#: includes/class-alg-wc-ev-core.php:707
msgid "Unverified"
msgstr ""

Expand Down Expand Up @@ -209,6 +209,18 @@ msgstr ""
msgid "Admin options"
msgstr ""

#: includes/settings/class-alg-wc-ev-settings-admin.php:63
msgid "Allowed user roles"
msgstr ""

#: includes/settings/class-alg-wc-ev-settings-admin.php:64
msgid "User roles allowed to see and interact with the admin interface from the Email Verification plugin."
msgstr ""

#: includes/settings/class-alg-wc-ev-settings-admin.php:65
msgid "The administrator can't be removed"
msgstr ""

#: includes/settings/class-alg-wc-ev-settings-admin.php:78
#: includes/settings/class-alg-wc-ev-settings-admin.php:84
#: includes/settings/class-alg-wc-ev-settings-admin.php:99
Expand Down Expand Up @@ -857,6 +869,7 @@ msgid "Advanced > Block auth cookies"
msgstr ""

#: includes/settings/class-alg-wc-ev-settings-compatibility.php:43
#: includes/settings/class-alg-wc-ev-settings-compatibility.php:146
msgid "Advanced > Authenticate filter"
msgstr ""

Expand Down Expand Up @@ -958,6 +971,7 @@ msgid "Email Customizer for WooCommerce"
msgstr ""

#: includes/settings/class-alg-wc-ev-settings-compatibility.php:117
#: includes/settings/class-alg-wc-ev-settings-compatibility.php:140
msgid "Compatibility with %s plugin."
msgstr ""

Expand All @@ -977,6 +991,32 @@ msgstr ""
msgid "Custom Hook"
msgstr ""

#: includes/settings/class-alg-wc-ev-settings-compatibility.php:138
#: includes/settings/class-alg-wc-ev-settings-compatibility.php:140
msgid "Essential Addons for Elementor"
msgstr ""

#: includes/settings/class-alg-wc-ev-settings-compatibility.php:144
#: includes/settings/class-alg-wc-ev-settings-compatibility.php:145
msgid "Login Register form"
msgstr ""

#: includes/settings/class-alg-wc-ev-settings-compatibility.php:145
msgid "Verify users who register or log in from %s element"
msgstr ""

#: includes/settings/class-alg-wc-ev-settings-compatibility.php:146
msgid "If you have issues, try to enable %s and set the %s option as %s."
msgstr ""

#: includes/settings/class-alg-wc-ev-settings-compatibility.php:146
msgid "General > Account verification > Verify account for current users"
msgstr ""

#: includes/settings/class-alg-wc-ev-settings-compatibility.php:146
msgid "Authenticate"
msgstr ""

#: includes/settings/class-alg-wc-ev-settings-email.php:24
#: includes/settings/class-alg-wc-ev-settings-section.php:104
msgid "Email"
Expand Down
7 changes: 6 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ Contributors: wpcodefactory, Karzin
Tags: woocommerce, email, verification, email verification, woo commerce
Requires at least: 4.4
Tested up to: 5.9
Stable tag: 2.2.7
Stable tag: 2.2.8
License: GNU General Public License v3.0
License URI: http://www.gnu.org/licenses/gpl-3.0.html

Expand Down Expand Up @@ -201,6 +201,11 @@ Params for the `[alg_wc_ev_email_content_placeholder]` shortcode:

== Changelog ==

= 2.2.8 - 02/03/2022 =
* Dev - Improve `Alg_WC_Email_Verification_Logouts::block_unverified_user_login()`.
* Dev - Compatibility - Essential Addons for Elementor - Add option to Verify users who register or log in from Login Register form element.
* WC tested up to: 6.2.

= 2.2.7 - 31/01/2022 =
* Dev - Compatibility - Email Customizer - Create option that allows a `alg_wc_ev_ec_email_content` action hook display the activation email content.
* Dev - Add more strings to `wpml-config.xml`.
Expand Down

0 comments on commit 7203dea

Please sign in to comment.