From 4fbcfe2c21288ae1d2a1912225012bac721c37bb Mon Sep 17 00:00:00 2001 From: Woo Date: Tue, 25 Jun 2024 10:15:44 +0000 Subject: [PATCH] Updates to 6.0.27 --- automatewoo.php | 4 +- changelog.txt | 4 + includes/Actions/Memberships_Abstract.php | 11 +- includes/Actions/Memberships_Change_Plan.php | 96 ++++++++++------ .../Memberships_Delete_User_Membership.php | 43 ++++--- includes/Actions/Send_Email.php | 35 +++--- includes/Actions/Send_Email_Raw.php | 34 ++++-- includes/DataTypes/Membership.php | 24 ++-- includes/Mailer.php | 108 ++++++++++-------- includes/Mailer_Abstract.php | 2 +- includes/Mailer_Raw_HTML.php | 8 +- includes/Memberships_Helper.php | 11 +- .../Customer_Active_Membership_Plans.php | 32 ++++-- includes/Triggers/Abstract_Memberships.php | 19 +-- includes/Triggers/Membership_Created.php | 52 +++++---- .../Triggers/Membership_Status_Changed.php | 72 +++++++----- includes/WC_Emails.php | 33 ++---- includes/Workflow_Email.php | 56 ++++----- languages/automatewoo.pot | 102 +++++++++-------- vendor/composer/installed.php | 12 +- 20 files changed, 431 insertions(+), 327 deletions(-) diff --git a/automatewoo.php b/automatewoo.php index e5b00fe..39b3330 100644 --- a/automatewoo.php +++ b/automatewoo.php @@ -3,7 +3,7 @@ * Plugin Name: AutomateWoo * Plugin URI: https://automatewoo.com * Description: Powerful marketing automation for your WooCommerce store. - * Version: 6.0.26 + * Version: 6.0.27 * Author: WooCommerce * Author URI: https://woocommerce.com * License: GPLv3 @@ -37,7 +37,7 @@ defined( 'ABSPATH' ) || exit; define( 'AUTOMATEWOO_SLUG', 'automatewoo' ); -define( 'AUTOMATEWOO_VERSION', '6.0.26' ); // WRCS: DEFINED_VERSION. +define( 'AUTOMATEWOO_VERSION', '6.0.27' ); // WRCS: DEFINED_VERSION. define( 'AUTOMATEWOO_FILE', __FILE__ ); define( 'AUTOMATEWOO_PATH', __DIR__ ); define( 'AUTOMATEWOO_MIN_PHP_VER', '7.4.0' ); diff --git a/changelog.txt b/changelog.txt index 856b300..c55afa5 100644 --- a/changelog.txt +++ b/changelog.txt @@ -1,5 +1,9 @@ *** AutomateWoo Changelog *** +2024-06-25 - version 6.0.27 +* Dev - PHPCS for Memberships. +* Dev - PHPCS for Send Email actions. + 2024-06-18 - version 6.0.26 * Dev - fix unit tests for protecting admin roles. * Tweak - Replace woo.com references with woocommerce.com. diff --git a/includes/Actions/Memberships_Abstract.php b/includes/Actions/Memberships_Abstract.php index 252c7d0..3d3ccc4 100644 --- a/includes/Actions/Memberships_Abstract.php +++ b/includes/Actions/Memberships_Abstract.php @@ -1,9 +1,10 @@ group = __( 'Membership', 'automatewoo' ); } - } diff --git a/includes/Actions/Memberships_Change_Plan.php b/includes/Actions/Memberships_Change_Plan.php index cde7a28..69e2852 100644 --- a/includes/Actions/Memberships_Change_Plan.php +++ b/includes/Actions/Memberships_Change_Plan.php @@ -1,9 +1,10 @@ title = __( "Create / Change Membership Plan For User", 'automatewoo' ); + $this->title = __( 'Create / Change Membership Plan For User', 'automatewoo' ); $this->description = __( "Changes the plan of a user's active membership. If no active membership exists a new membership can optionally be created.", 'automatewoo' ); } - - function load_fields() { + /** + * Method to load the action's fields. + **/ + public function load_fields() { $plans = Memberships_Helper::get_membership_plans(); @@ -46,17 +56,19 @@ function load_fields() { $this->add_field( $from_plan ); $this->add_field( $to_plan ); $this->add_field( $allow_create ); - } - function run() { + /** + * Runs the action + */ + public function run() { - $customer = $this->workflow->data_layer()->get_customer(); + $customer = $this->workflow->data_layer()->get_customer(); $existing_plan_id = absint( $this->get_option( 'from_plan' ) ); - $new_plan_id = absint( $this->get_option( 'to_plan' ) ); - $allow_create = $this->get_option( 'allow_create' ); - $new_plan = $new_plan_id ? wc_memberships_get_membership_plan( $new_plan_id ) : false; + $new_plan_id = absint( $this->get_option( 'to_plan' ) ); + $allow_create = $this->get_option( 'allow_create' ); + $new_plan = $new_plan_id ? wc_memberships_get_membership_plan( $new_plan_id ) : false; if ( ! $customer->is_registered() || ! $new_plan ) { return; @@ -73,13 +85,11 @@ function run() { $membership = $existing_plan_id ? wc_memberships_get_user_membership( $customer->get_user_id(), $existing_plan_id ) : false; if ( $membership ) { - $this->change_membership_plan( $membership, $new_plan ); - } - elseif ( $allow_create ) { + $this->change_membership_plan( $membership, $new_plan ); + } elseif ( $allow_create ) { // if no existing plan and allow create is checked, create a new plan for the user $this->create_membership( $customer, $new_plan ); } - } @@ -87,30 +97,39 @@ function run() { * @param Customer $customer * @param \WC_Memberships_Membership_Plan $new_plan * - * @throws \Exception + * @throws \Exception If an error happens creating the membership. */ - function create_membership( $customer, $new_plan ) { + public function create_membership( $customer, $new_plan ) { - $membership = wc_memberships_create_user_membership([ - 'user_id' => $customer->get_user_id(), - 'plan_id' => $new_plan->get_id(), - ]); + $membership = wc_memberships_create_user_membership( + [ + 'user_id' => $customer->get_user_id(), + 'plan_id' => $new_plan->get_id(), + ] + ); if ( is_wp_error( $membership ) ) { - throw new \Exception( $membership->get_error_message() ); + throw new \Exception( esc_attr( $membership->get_error_message() ) ); } $membership->add_note( - sprintf( - __( 'Membership created by AutomateWoo workflow #%s', 'automatewoo' ), - $this->workflow->get_id() + esc_textarea( + sprintf( + // translators: The Workflow ID + __( 'Membership created by AutomateWoo workflow #%s', 'automatewoo' ), + $this->workflow->get_id() + ) ) ); - $this->workflow->log_action_note( $this, sprintf( - __( 'Membership #%s successfully created.', 'automatewoo' ), - $membership->get_id() - )); + $this->workflow->log_action_note( + $this, + sprintf( + // translators: The Membership ID + __( 'Membership #%s successfully created.', 'automatewoo' ), + $membership->get_id() + ) + ); } @@ -118,20 +137,23 @@ function create_membership( $customer, $new_plan ) { * @param \WC_Memberships_User_Membership $membership * @param \WC_Memberships_Membership_Plan $new_plan */ - function change_membership_plan( $membership, $new_plan ) { + public function change_membership_plan( $membership, $new_plan ) { $membership->add_note( sprintf( - __( 'Membership plan changed from %s to %s by AutomateWoo workflow:#%s', 'automatewoo' ), + // translators: %1$s The Membership plan name, %2$s the new plan name, %3$s The Workflow ID + __( 'Membership plan changed from %1$s to %2$s by AutomateWoo workflow:#%3$s', 'automatewoo' ), $membership->get_plan()->get_name(), $new_plan->get_name(), $this->workflow->get_id() ) ); - wp_update_post([ - 'ID' => $membership->get_id(), - 'post_parent' => $new_plan->get_id() - ]); + wp_update_post( + [ + 'ID' => $membership->get_id(), + 'post_parent' => $new_plan->get_id(), + ] + ); } } diff --git a/includes/Actions/Memberships_Delete_User_Membership.php b/includes/Actions/Memberships_Delete_User_Membership.php index a55fbf8..0685122 100644 --- a/includes/Actions/Memberships_Delete_User_Membership.php +++ b/includes/Actions/Memberships_Delete_User_Membership.php @@ -1,9 +1,9 @@ title = __( "Delete Membership For User", 'automatewoo' ); + $this->title = __( 'Delete Membership For User', 'automatewoo' ); } - - function load_fields() { + /** + * Method to load the action's fields. + */ + public function load_fields() { $plans = Memberships_Helper::get_membership_plans(); @@ -31,17 +43,18 @@ function load_fields() { ->set_required(); $this->add_field( $plan ); - } /** - * @throws \Exception + * Run the action + * + * @throws \Exception When an error happens. */ - function run() { + public function run() { $customer = $this->workflow->data_layer()->get_customer(); - $plan_id = absint( $this->get_option( 'plan' ) ); + $plan_id = absint( $this->get_option( 'plan' ) ); if ( ! $customer->is_registered() || ! $plan_id ) { return; @@ -59,11 +72,11 @@ function run() { $success = wp_delete_post( $membership_id, true ); if ( $success ) { + // translators: The Membership ID $this->workflow->log_action_note( $this, sprintf( __( 'Deleted membership #%s', 'automatewoo' ), $membership_id ) ); - } - else { - throw new \Exception( sprintf( __( 'Failed deleting membership #%s', 'automatewoo' ), $membership_id ) ); + } else { + // translators: The Membership ID + throw new \Exception( esc_textarea( sprintf( __( 'Failed deleting membership #%s', 'automatewoo' ), $membership_id ) ) ); } } - } diff --git a/includes/Actions/Send_Email.php b/includes/Actions/Send_Email.php index 33aebbe..90dd031 100644 --- a/includes/Actions/Send_Email.php +++ b/includes/Actions/Send_Email.php @@ -1,5 +1,4 @@ title = __( 'Send Email', 'automatewoo' ); $this->description = sprintf( - __( "This action sends an HTML email using a template. The default template matches the style of your WooCommerce transactional emails. <%s>View email templates documentation<%s>.", 'automatewoo' ), + // translators: %1$s anchor tag with the link to the documentation link, %2$s closing tag for the anchor + __( 'This action sends an HTML email using a template. The default template matches the style of your WooCommerce transactional emails. <%1$s>View email templates documentation<%2$s>.', 'automatewoo' ), 'a href="' . Admin::get_docs_link( 'email/templates', 'action-description' ) . '" target="_blank"', '/a' ); } - - function load_fields() { + /** + * Method to load the action's fields. + */ + public function load_fields() { parent::load_fields(); $heading = ( new Fields\Text() ) ->set_name( 'email_heading' ) - ->set_title( __('Email heading', 'automatewoo' ) ) + ->set_title( __( 'Email heading', 'automatewoo' ) ) ->set_variable_validation() ->set_description( __( 'The appearance will depend on your email template. Not all templates support this field.', 'automatewoo' ) ); $preheader = ( new Fields\Text() ) ->set_name( 'preheader' ) - ->set_title( __('Email preheader', 'automatewoo' ) ) + ->set_title( __( 'Email preheader', 'automatewoo' ) ) ->set_variable_validation() ->set_description( __( 'A preheader is a short text summary that follows the subject line when an email is viewed in the inbox. If no preheader is set the first text found in the email is used.', 'automatewoo' ) ); $template = ( new Fields\Select( false ) ) - ->set_name('template') + ->set_name( 'template' ) ->set_title( __( 'Template', 'automatewoo' ) ) ->set_description( __( 'Select which template to use when formatting the email. If you select \'None\', the email will have no template but the email will still be sent as an HTML email.', 'automatewoo' ) ) ->set_options( Emails::get_email_templates() ); @@ -67,6 +73,7 @@ function load_fields() { /** * Generates the HTML content for the email + * * @return string|\WP_Error */ public function get_preview() { @@ -79,7 +86,7 @@ public function get_preview() { wp_set_current_user( 0 ); return $this->get_workflow_email_object( - $current_user->get('user_email'), + $current_user->get( 'user_email' ), $this->get_option( 'email_content', true, true ) ) ->set_heading( $this->get_option( 'email_heading', true ) ) @@ -122,8 +129,10 @@ public function run_test( array $args = [] ) { return true; } - - function run() { + /** + * Run the action + */ + public function run() { $recipients = $this->get_option( 'to', true ); $heading = $this->get_option( 'email_heading', true ); $content = $this->get_option( 'email_content', true, true ); @@ -147,6 +156,4 @@ function run() { $this->add_send_email_result_to_workflow_log( $sent ); } } - - } diff --git a/includes/Actions/Send_Email_Raw.php b/includes/Actions/Send_Email_Raw.php index 67afb34..a18c77e 100644 --- a/includes/Actions/Send_Email_Raw.php +++ b/includes/Actions/Send_Email_Raw.php @@ -1,5 +1,4 @@ title = __( 'Send Email - Raw HTML', 'automatewoo' ); + $this->title = __( 'Send Email - Raw HTML', 'automatewoo' ); $this->description = __( "This action sends emails with only the HTML/CSS entered in the action's HTML field and is designed for advanced use only. This is different from the standard Send Email action, which inserts the email content into a template. Some variables may display unexpectedly due to the different CSS. Please note that you should include an unsubscribe link by using the variable {{ unsubscribe_url }}.", 'automatewoo' ); } - - function load_fields() { + /** + * Method to load the action's fields. + */ + public function load_fields() { parent::load_fields(); $include_aw_css = new Fields\Checkbox(); @@ -54,14 +60,19 @@ function load_fields() { /** * Generates the HTML content for the email + * * @return string|\WP_Error */ public function get_preview() { - $html = $this->get_option('email_html', true, true ); - $include_aw_css = $this->get_option('include_aw_css' ); + $html = $this->get_option( 'email_html', true, true ); + $include_aw_css = $this->get_option( 'include_aw_css' ); $current_user = wp_get_current_user(); - wp_set_current_user( 0 ); // no user should be logged in + // no user should be logged in + // When the user_id value is 0, it's a session for a logged-out user + // see https://wordpress.org/support/topic/sessions-with-user-id-0/ + // phpcs:ignore Generic.PHP.ForbiddenFunctions.Found + wp_set_current_user( 0 ); return $this->get_workflow_email_object( $current_user->get( 'user_email' ), $html ) ->set_include_automatewoo_styles( $include_aw_css ) @@ -98,8 +109,10 @@ public function run_test( array $args = [] ) { return true; } - - function run() { + /** + * Run the action. + */ + public function run() { $recipients = $this->get_option( 'to', true ); $html = $this->get_option( 'email_html', true, true ); $include_aw_css = $this->get_option( 'include_aw_css' ); @@ -120,5 +133,4 @@ function run() { $this->add_send_email_result_to_workflow_log( $sent ); } } - } diff --git a/includes/DataTypes/Membership.php b/includes/DataTypes/Membership.php index e5c47ef..88162c0 100644 --- a/includes/DataTypes/Membership.php +++ b/includes/DataTypes/Membership.php @@ -1,12 +1,13 @@ get_id(); } /** - * @param $compressed_item - * @param $compressed_data_layer + * Get the full item from its stored format. + * + * @param int|string|null $compressed_item + * @param array $compressed_data_layer + * * @return mixed */ - function decompress( $compressed_item, $compressed_data_layer ) { + public function decompress( $compressed_item, $compressed_data_layer ) { $id = Clean::id( $compressed_item ); if ( ! Integrations::is_memberships_enabled() || ! $id ) { @@ -53,5 +60,4 @@ function decompress( $compressed_item, $compressed_data_layer ) { return $membership; } - } diff --git a/includes/Mailer.php b/includes/Mailer.php index 12a2452..5003f15 100644 --- a/includes/Mailer.php +++ b/includes/Mailer.php @@ -1,5 +1,4 @@ email = $email; - $this->subject = $subject; - $this->content = $content; + $this->email = $email; + $this->subject = $subject; + $this->content = $content; $this->template = $template; do_action( 'automatewoo/mailer/init' ); @@ -60,9 +59,9 @@ function __construct( $subject = false, $email = false, $content = false, $templ /** - * @param $heading + * @param string $heading */ - function set_heading( $heading ) { + public function set_heading( $heading ) { $this->heading = $heading; } @@ -70,7 +69,7 @@ function set_heading( $heading ) { /** * @param string $preheader */ - function set_preheader( $preheader ) { + public function set_preheader( $preheader ) { $this->preheader = $preheader; } @@ -78,19 +77,19 @@ function set_preheader( $preheader ) { /** * @param string $template */ - function set_template( $template ) { + public function set_template( $template ) { $this->template = $template; // Must reset from props after template is changed. $this->from_email = null; - $this->from_name = null; + $this->from_name = null; } /** * @param bool $include */ - function set_include_automatewoo_styles( $include ) { + public function set_include_automatewoo_styles( $include ) { $this->include_automatewoo_styles = $include; } @@ -100,7 +99,7 @@ function set_include_automatewoo_styles( $include ) { * * @return string */ - function get_from_email() { + public function get_from_email() { if ( ! isset( $this->from_email ) ) { $this->from_email = Emails::get_from_address( $this->template ); } @@ -113,7 +112,7 @@ function get_from_email() { * * @return string */ - function get_from_name() { + public function get_from_name() { if ( ! isset( $this->from_name ) ) { $this->from_name = Emails::get_from_name( $this->template ); } @@ -128,7 +127,7 @@ function get_from_name() { * * @return string */ - function get_email_body() { + public function get_email_body() { $html = $this->get_content_wrapped_in_template(); return apply_filters( 'woocommerce_mail_content', $this->prepare_html( $html ) ); } @@ -137,7 +136,7 @@ function get_email_body() { /** * @return string */ - function get_content_wrapped_in_template() { + public function get_content_wrapped_in_template() { $content = $this->content; add_filter( 'woocommerce_email_footer_text', [ $this, 'add_extra_footer_text' ] ); @@ -150,10 +149,14 @@ function get_content_wrapped_in_template() { // Buffer ob_start(); - $this->get_template_part( 'email-header.php', [ - 'email_heading' => $this->heading - ] ); + $this->get_template_part( + 'email-header.php', + [ + 'email_heading' => $this->heading, + ] + ); + // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped echo $content; $this->get_template_part( 'email-footer.php' ); @@ -186,7 +189,7 @@ function get_content_wrapped_in_template() { * @param string $html * @return string */ - function prepare_html( $html ) { + public function prepare_html( $html ) { if ( $this->preheader ) { $html = $this->inject_preheader( $html ); } @@ -217,7 +220,7 @@ function prepare_html( $html ) { * @param string $html The contents of the email * @return string */ - function fix_wrapper_for_mailpoet( $html ) { + public function fix_wrapper_for_mailpoet( $html ) { return str_replace( 'id="wrapper"', 'id="mailpoet_woocommerce_container"', $html ); } @@ -228,7 +231,7 @@ function fix_wrapper_for_mailpoet( $html ) { * @param string $content * @return string */ - function fix_links_with_double_http( $content ) { + public function fix_links_with_double_http( $content ) { $content = str_replace( '"http://http://', '"http://', $content ); $content = str_replace( '"https://https://', '"https://', $content ); $content = str_replace( '"http://https://', '"https://', $content ); @@ -243,7 +246,7 @@ function fix_links_with_double_http( $content ) { * @param string|null $content * @return string */ - function style_inline( $content ) { + public function style_inline( $content ) { ob_start(); if ( $this->include_automatewoo_styles ) { @@ -259,17 +262,18 @@ function style_inline( $content ) { /** - * @param $text + * @param string $text * @return string */ - function add_extra_footer_text( $text ) { + public function add_extra_footer_text( $text ) { - if ( ! $this->extra_footer_text ) + if ( ! $this->extra_footer_text ) { return $text; + } // add separator if there is footer text if ( trim( $text ) ) { - $text .= apply_filters( 'automatewoo_email_footer_separator', ' - ' ); + $text .= apply_filters( 'automatewoo_email_footer_separator', ' - ' ); } $text .= $this->extra_footer_text; @@ -285,7 +289,7 @@ function add_extra_footer_text( $text ) { * @param array $variables Array of variables for use in the template file. */ public function get_template_part( $file_name, $variables = [] ) { - switch( $this->template ) { + switch ( $this->template ) { // default is the woocommerce template case 'default': @@ -307,7 +311,7 @@ public function get_template_part( $file_name, $variables = [] ) { if ( is_array( $template_data ) && isset( $template_data['path'] ) ) { $template_path = untrailingslashit( $template_data['path'] ); } else { - $template_path = 'automatewoo/custom-email-templates/'. $this->template; + $template_path = 'automatewoo/custom-email-templates/' . $this->template; } break; } @@ -345,6 +349,7 @@ public function get_template_part( $file_name, $variables = [] ) { */ public function load_template_part( $_template_file, $_variables ) { if ( is_array( $_variables ) ) { + // phpcs:ignore WordPress.PHP.DontExtract.extract_extract extract( $_variables, EXTR_SKIP ); } @@ -356,10 +361,10 @@ public function load_template_part( $_template_file, $_variables ) { /** * Maybe replace URLs with trackable URLs * - * @param $content string + * @param string $content * @return string */ - function replace_urls_in_content( $content ) { + public function replace_urls_in_content( $content ) { if ( ! $this->replace_content_urls_callback ) { return $content; } @@ -372,34 +377,44 @@ function replace_urls_in_content( $content ) { /** * Injects preheader HTML after opening tag * - * @param $html + * @param string $html * @return string */ - function inject_preheader( $html ) { - return preg_replace_callback( "/]*>/", function( $matches ) { - $preheader = '
' . esc_html( $this->preheader ) . '
'; - return $matches[0] . $preheader; - }, $html, 1 ); + public function inject_preheader( $html ) { + return preg_replace_callback( + '/]*>/', + function ( $matches ) { + $preheader = '
' . esc_html( $this->preheader ) . '
'; + return $matches[0] . $preheader; + }, + $html, + 1 + ); } /** * Injects tracking pixel before closing tag * - * @param $html + * @param string $html * @return string */ - function inject_tracking_pixel( $html ) { - return preg_replace_callback( "/<\/body[^>]*>/", function( $matches ) { - return $this->get_tracking_pixel_img() . $matches[0] ; - }, $html, 1 ); + public function inject_tracking_pixel( $html ) { + return preg_replace_callback( + '/<\/body[^>]*>/', + function ( $matches ) { + return $this->get_tracking_pixel_img() . $matches[0]; + }, + $html, + 1 + ); } /** * @return string */ - function get_tracking_pixel_img() { + public function get_tracking_pixel_img() { return ''; } @@ -457,5 +472,4 @@ public function emogrify( $html, $css, $parse_html_style_blocks = false ) { return $html; } - } diff --git a/includes/Mailer_Abstract.php b/includes/Mailer_Abstract.php index 241c3c3..9976500 100644 --- a/includes/Mailer_Abstract.php +++ b/includes/Mailer_Abstract.php @@ -259,7 +259,7 @@ public function process_email_variables( $content ) { /** - * Callback function to process email variables. + * Callback function to process email variables * * @param string $variable * diff --git a/includes/Mailer_Raw_HTML.php b/includes/Mailer_Raw_HTML.php index 60a5b75..160c74f 100644 --- a/includes/Mailer_Raw_HTML.php +++ b/includes/Mailer_Raw_HTML.php @@ -1,5 +1,4 @@ include_automatewoo_styles ) { @@ -27,7 +26,7 @@ function style_inline( $content ) { $css = ob_get_clean(); } - $css = apply_filters( 'automatewoo/mailer_raw/styles', $css , $this ); + $css = apply_filters( 'automatewoo/mailer_raw/styles', $css, $this ); return $this->emogrify( $content, $css, true ); } @@ -36,9 +35,8 @@ function style_inline( $content ) { /** * @return string */ - function get_email_body() { + public function get_email_body() { $html = $this->content; return $this->prepare_html( $html ); } - } diff --git a/includes/Memberships_Helper.php b/includes/Memberships_Helper.php index 9490a8a..94af4f8 100644 --- a/includes/Memberships_Helper.php +++ b/includes/Memberships_Helper.php @@ -1,5 +1,4 @@ get_id() ] = $plan->get_name(); } @@ -25,17 +24,17 @@ static function get_membership_plans() { /** * Get statuses without status prefix + * * @return array */ - static function get_membership_statuses() { + public static function get_membership_statuses() { $statuses = []; foreach ( wc_memberships_get_user_membership_statuses() as $status => $value ) { - $status = 0 === strpos( $status, 'wcm-' ) ? substr( $status, 4 ) : $status; + $status = 0 === strpos( $status, 'wcm-' ) ? substr( $status, 4 ) : $status; $statuses[ $status ] = $value['label']; } return $statuses; } - } diff --git a/includes/Rules/Customer_Active_Membership_Plans.php b/includes/Rules/Customer_Active_Membership_Plans.php index 2b3fc6e..4f0bb7e 100644 --- a/includes/Rules/Customer_Active_Membership_Plans.php +++ b/includes/Rules/Customer_Active_Membership_Plans.php @@ -1,5 +1,4 @@ title = __( "Customer - Active Memberships Plans", 'automatewoo' ); + $this->title = __( 'Customer - Active Memberships Plans', 'automatewoo' ); } /** * @return array */ - function load_select_choices() { + public function load_select_choices() { return Memberships_Helper::get_membership_plans(); } /** - * @param $customer \AutomateWoo\Customer - * @param $compare - * @param $value + * @param \AutomateWoo\Customer $customer + * @param string $compare + * @param array|string $value + * * @return bool */ - function validate( $customer, $compare, $value ) { + public function validate( $customer, $compare, $value ) { $active_plans = []; if ( $customer->is_registered() ) { - foreach( wc_memberships_get_user_active_memberships( $customer->get_user_id() ) as $membership ) { + foreach ( wc_memberships_get_user_active_memberships( $customer->get_user_id() ) as $membership ) { $active_plans[] = $membership->get_plan_id(); } } return $this->validate_select( $active_plans, $compare, $value ); } - } diff --git a/includes/Triggers/Abstract_Memberships.php b/includes/Triggers/Abstract_Memberships.php index a1290f5..88290de 100644 --- a/includes/Triggers/Abstract_Memberships.php +++ b/includes/Triggers/Abstract_Memberships.php @@ -1,9 +1,10 @@ group = __( 'Memberships', 'automatewoo' ); } @@ -22,16 +26,15 @@ function load_admin_details() { /** * @return Fields\Select */ - function get_field_membership_plans() { + public function get_field_membership_plans() { $plans = Memberships_Helper::get_membership_plans(); return ( new Fields\Select() ) ->set_name( 'membership_plans' ) - ->set_title( __( 'Membership plans', 'automatewoo' ) ) - ->set_placeholder( __( 'Select which membership plans to trigger for. Leave blank to apply for all plans.', 'automatewoo' ) ) + ->set_title( __( 'Membership plans', 'automatewoo' ) ) + ->set_placeholder( __( 'Select which membership plans to trigger for. Leave blank to apply for all plans.', 'automatewoo' ) ) ->set_options( $plans ) ->set_multiple(); } - } diff --git a/includes/Triggers/Membership_Created.php b/includes/Triggers/Membership_Created.php index e57eb10..09fe749 100644 --- a/includes/Triggers/Membership_Created.php +++ b/includes/Triggers/Membership_Created.php @@ -1,11 +1,12 @@ title = __( 'Membership Created', 'automatewoo' ); } - - function load_fields() { + /** + * Registers any fields used on for a trigger + */ + public function load_fields() { $plans_field = $this->get_field_membership_plans(); $this->add_field( $plans_field ); } - function register_hooks() { + /** + * Register the hooks when this trigger should run + */ + public function register_hooks() { if ( is_admin() ) { add_action( 'transition_post_status', [ $this, 'transition_post_status' ], 50, 3 ); } @@ -49,14 +61,14 @@ function register_hooks() { /** - * @param $new_status - * @param $old_status + * @param string $new_status + * @param string $old_status * @param \WP_Post $post */ - function transition_post_status( $new_status, $old_status, $post ) { + public function transition_post_status( $new_status, $old_status, $post ) { if ( $old_status === 'auto-draft' && $post->post_type === 'wc_user_membership' ) { // don't trigger now as post transition happens before data is saved - $this->_membership_created_via_admin = $post->ID; + $this->membership_created_via_admin = $post->ID; add_action( 'wc_memberships_user_membership_saved', [ $this, 'membership_created_via_admin' ], 100, 2 ); } } @@ -64,15 +76,15 @@ function transition_post_status( $new_status, $old_status, $post ) { /** * @param \WC_Memberships_Membership_Plan $plan - * @param $args + * @param array $args */ - function membership_created_via_admin( $plan, $args ) { + public function membership_created_via_admin( $plan, $args ) { // check the created membership is a match - if ( $this->_membership_created_via_admin == $args['user_membership_id'] ) { + if ( $this->membership_created_via_admin === $args['user_membership_id'] ) { $this->maybe_run_for_membership( (int) $args['user_membership_id'] ); } } - + /** * Handle async membership created event. * @@ -96,7 +108,7 @@ protected function maybe_run_for_membership( int $membership_id ) { $this->maybe_run( [ 'membership' => $membership, - 'customer' => Customer_Factory::get_by_user_id( $membership->get_user_id() ) + 'customer' => Customer_Factory::get_by_user_id( $membership->get_user_id() ), ] ); } @@ -107,22 +119,20 @@ protected function maybe_run_for_membership( int $membership_id ) { * * @return bool */ - function validate_workflow( $workflow ) { + public function validate_workflow( $workflow ) { $membership = $workflow->data_layer()->get_membership(); - $plans = $workflow->get_trigger_option( 'membership_plans' ); + $plans = $workflow->get_trigger_option( 'membership_plans' ); if ( ! $membership ) { return false; } if ( ! empty( $plans ) ) { - if ( ! in_array( $membership->get_plan_id(), $plans ) ) { + if ( ! in_array( $membership->get_plan_id(), array_map( 'intval', $plans ), true ) ) { return false; } } return true; } - - } diff --git a/includes/Triggers/Membership_Status_Changed.php b/includes/Triggers/Membership_Status_Changed.php index 2548b1e..21063f8 100644 --- a/includes/Triggers/Membership_Status_Changed.php +++ b/includes/Triggers/Membership_Status_Changed.php @@ -1,9 +1,10 @@ title = __( 'Membership Status Changed', 'automatewoo' ); } - - function load_fields() { + /** + * Registers any fields used on for a trigger + */ + public function load_fields() { $statuses = Memberships_Helper::get_membership_statuses(); @@ -35,14 +40,14 @@ function load_fields() { $placeholder = __( 'Leave blank for any status', 'automatewoo' ); $from = ( new Fields\Select() ) - ->set_title( __( 'Status changes from', 'automatewoo' ) ) + ->set_title( __( 'Status changes from', 'automatewoo' ) ) ->set_name( 'membership_status_from' ) ->set_options( $statuses ) ->set_placeholder( $placeholder ) ->set_multiple(); $to = ( new Fields\Select() ) - ->set_title( __( 'Status changes to', 'automatewoo' ) ) + ->set_title( __( 'Status changes to', 'automatewoo' ) ) ->set_name( 'membership_status_to' ) ->set_options( $statuses ) ->set_placeholder( $placeholder ) @@ -54,45 +59,57 @@ function load_fields() { } - function register_hooks() { + /** + * The hooks when this trigger should run. + */ + public function register_hooks() { add_action( 'automatewoo/membership_status_changed_async', [ $this, 'handle_async_event' ], 10, 3 ); } /** - * @param int $membership_id + * @param int $membership_id * @param string $old_status * @param string $new_status */ - function handle_async_event( $membership_id, $old_status, $new_status ) { - if ( ! $membership_id || ! $membership = wc_memberships_get_user_membership( $membership_id ) ) { + public function handle_async_event( $membership_id, $old_status, $new_status ) { + if ( ! $membership_id ) { + return; + } + + $membership = wc_memberships_get_user_membership( $membership_id ); + + if ( ! $membership ) { return; } Temporary_Data::set( 'membership_old_status', $membership->get_id(), $old_status ); Temporary_Data::set( 'membership_new_status', $membership->get_id(), $new_status ); - $this->maybe_run([ - 'membership' => $membership, - 'customer' => Customer_Factory::get_by_user_id( $membership->get_user_id() ) - ]); + $this->maybe_run( + [ + 'membership' => $membership, + 'customer' => Customer_Factory::get_by_user_id( $membership->get_user_id() ), + ] + ); } /** - * @param $workflow Workflow + * @param Workflow $workflow * @return bool */ - function validate_workflow( $workflow ) { - if ( ! $membership = $workflow->data_layer()->get_membership() ) { + public function validate_workflow( $workflow ) { + $membership = $workflow->data_layer()->get_membership(); + if ( ! $membership ) { return false; } $status_from = $workflow->get_trigger_option( 'membership_status_from' ); - $status_to = $workflow->get_trigger_option( 'membership_status_to' ); - $plans = $workflow->get_trigger_option( 'membership_plans' ); - $old_status = Temporary_Data::get( 'membership_old_status', $membership->get_id() ); - $new_status = Temporary_Data::get( 'membership_new_status', $membership->get_id() ); + $status_to = $workflow->get_trigger_option( 'membership_status_to' ); + $plans = $workflow->get_trigger_option( 'membership_plans' ); + $old_status = Temporary_Data::get( 'membership_old_status', $membership->get_id() ); + $new_status = Temporary_Data::get( 'membership_new_status', $membership->get_id() ); if ( ! $this->validate_status_field( $status_from, $old_status ) ) { return false; @@ -103,7 +120,7 @@ function validate_workflow( $workflow ) { } if ( ! empty( $plans ) ) { - if ( ! in_array( $membership->get_plan_id(), $plans ) ) { + if ( ! in_array( $membership->get_plan_id(), array_map( 'intval', $plans ), true ) ) { return false; } } @@ -115,12 +132,12 @@ function validate_workflow( $workflow ) { /** * Ensures 'to' status has not changed while sitting in queue * - * @param $workflow + * @param Workflow $workflow * @return bool */ - function validate_before_queued_event( $workflow ) { + public function validate_before_queued_event( $workflow ) { $membership = $workflow->data_layer()->get_membership(); - $status_to = $workflow->get_trigger_option( 'membership_status_to' ); + $status_to = $workflow->get_trigger_option( 'membership_status_to' ); if ( ! $membership ) { return false; @@ -132,5 +149,4 @@ function validate_before_queued_event( $workflow ) { return true; } - } diff --git a/includes/WC_Emails.php b/includes/WC_Emails.php index 73b2175..a52e42a 100644 --- a/includes/WC_Emails.php +++ b/includes/WC_Emails.php @@ -1,5 +1,4 @@ recipient; } @@ -74,15 +63,13 @@ static function get_current_recipient() { /** * Returns the email of the current recipient + * * @return string|false */ - static function is_customer_email() { + public static function is_customer_email() { if ( self::is_email() ) { return self::$current_email->is_customer_email(); } return false; } - - - } diff --git a/includes/Workflow_Email.php b/includes/Workflow_Email.php index 1e8e065..24b1cb9 100644 --- a/includes/Workflow_Email.php +++ b/includes/Workflow_Email.php @@ -1,5 +1,4 @@ recipient = $recipient; return $this; @@ -132,7 +131,7 @@ function set_recipient( $recipient ) { * * @return $this */ - function set_subject( $subject ) { + public function set_subject( $subject ) { $this->subject = $subject; return $this; @@ -148,7 +147,7 @@ function set_subject( $subject ) { * * @return $this */ - function set_content( $content ) { + public function set_content( $content ) { $this->content = $content; return $this; @@ -160,7 +159,7 @@ function set_content( $content ) { * * @return $this */ - function set_heading( $heading ) { + public function set_heading( $heading ) { $this->heading = $heading; return $this; @@ -172,7 +171,7 @@ function set_heading( $heading ) { * * @return $this */ - function set_preheader( $preheader ) { + public function set_preheader( $preheader ) { $this->preheader = $preheader; return $this; @@ -184,7 +183,7 @@ function set_preheader( $preheader ) { * * @return $this */ - function set_template( $template ) { + public function set_template( $template ) { $this->template = $template; return $this; @@ -196,7 +195,7 @@ function set_template( $template ) { * * @return $this */ - function set_tracking_enabled( $enabled ) { + public function set_tracking_enabled( $enabled ) { $this->tracking_enabled = $enabled; return $this; @@ -208,7 +207,7 @@ function set_tracking_enabled( $enabled ) { * * @return $this */ - function set_include_automatewoo_styles( $include ) { + public function set_include_automatewoo_styles( $include ) { $this->include_automatewoo_styles = $include; return $this; @@ -233,17 +232,15 @@ public function set_reply_to( $reply_to ) { /** * @return Mailer|Mailer_Raw_HTML|Mailer_Plain_Text */ - function get_mailer() { + public function get_mailer() { if ( $this->is_type( 'plain-text' ) ) { $mailer = new Mailer_Plain_Text(); $mailer->set_content( $this->get_content_with_appended_plain_text_footer() ); - } - else { + } else { if ( $this->is_type( 'html-raw' ) ) { $mailer = new Mailer_Raw_HTML(); - } - else { + } else { $mailer = new Mailer(); $mailer->set_template( $this->template ); $mailer->set_heading( $this->heading ); @@ -258,7 +255,7 @@ function get_mailer() { $mailer->set_include_automatewoo_styles( $this->include_automatewoo_styles ); if ( $this->tracking_enabled ) { - $mailer->tracking_pixel_url = Tracking::get_open_tracking_url( $this->workflow ); + $mailer->tracking_pixel_url = Tracking::get_open_tracking_url( $this->workflow ); $mailer->replace_content_urls_callback = [ $this, 'replace_content_urls_callback' ]; } } @@ -276,8 +273,8 @@ function get_mailer() { * * @return bool|string */ - function get_unsubscribe_link() { - $url = $this->get_unsubscribe_url(); + public function get_unsubscribe_link() { + $url = $this->get_unsubscribe_url(); $text = $this->get_unsubscribe_text(); if ( ! $url || ! $text ) { @@ -294,7 +291,7 @@ function get_unsubscribe_link() { * * @return bool|string */ - function get_unsubscribe_url() { + public function get_unsubscribe_url() { $customer = Customer_Factory::get_by_email( $this->recipient ); return $this->workflow->get_unsubscribe_url( $customer ); } @@ -306,7 +303,7 @@ function get_unsubscribe_url() { * * @return string */ - function get_unsubscribe_text() { + public function get_unsubscribe_text() { return apply_filters( 'automatewoo_email_unsubscribe_text', __( 'Unsubscribe', 'automatewoo' ), $this, $this->workflow ); } @@ -319,8 +316,8 @@ function get_unsubscribe_text() { * * @return bool|string */ - function get_plain_text_unsubscribe_footer() { - $url = $this->get_unsubscribe_url(); + public function get_plain_text_unsubscribe_footer() { + $url = $this->get_unsubscribe_url(); $text = $this->get_unsubscribe_text(); if ( ! $url || ! $text ) { @@ -337,7 +334,7 @@ function get_plain_text_unsubscribe_footer() { * * @return string */ - function get_content_with_appended_plain_text_footer() { + public function get_content_with_appended_plain_text_footer() { $footer = $this->get_plain_text_unsubscribe_footer(); if ( $footer ) { return $this->content . $footer; @@ -350,11 +347,8 @@ function get_content_with_appended_plain_text_footer() { * @param string $url * @return string */ - function replace_content_urls_callback( $url ) { - if ( strstr( $url, 'aw-action=unsubscribe' ) ) { - // don't count unsubscribe clicks - } - else { + public function replace_content_urls_callback( $url ) { + if ( ! strstr( $url, 'aw-action=unsubscribe' ) ) { $url = html_entity_decode( $url ); $url = $this->workflow->append_ga_tracking_to_url( $url ); $url = Tracking::get_click_tracking_url( $this->workflow, $url ); @@ -367,7 +361,7 @@ function replace_content_urls_callback( $url ) { /** * @return bool|\WP_Error */ - function send() { + public function send() { $mailer = $this->get_mailer(); @@ -385,14 +379,13 @@ function send() { $customer = Customer_Factory::get_by_email( $this->recipient ); if ( $this->workflow->is_customer_unsubscribed( $customer ) ) { - return new \WP_Error( 'email_unsubscribed', __( "The recipient is not opted-in to this workflow.", 'automatewoo' ) ); + return new \WP_Error( 'email_unsubscribed', __( 'The recipient is not opted-in to this workflow.', 'automatewoo' ) ); } if ( ! $this->workflow->is_transactional() ) { $mailer->set_one_click_unsubscribe( Frontend::get_communication_page_permalink( $customer, 'unsubscribe' ) ); } - \AW_Mailer_API::setup( $mailer, $this->workflow ); $sent = $mailer->send(); @@ -408,12 +401,11 @@ function send() { * * @return string */ - function get_email_body() { + public function get_email_body() { $mailer = $this->get_mailer(); \AW_Mailer_API::setup( $mailer, $this->workflow ); $html = $mailer->get_email_body(); \AW_Mailer_API::cleanup(); return $html; } - } diff --git a/languages/automatewoo.pot b/languages/automatewoo.pot index ccdf48b..bf01a0c 100644 --- a/languages/automatewoo.pot +++ b/languages/automatewoo.pot @@ -2,14 +2,14 @@ # This file is distributed under the GPLv3. msgid "" msgstr "" -"Project-Id-Version: AutomateWoo 6.0.26\n" +"Project-Id-Version: AutomateWoo 6.0.27\n" "Report-Msgid-Bugs-To: https://woocommerce.com/my-account/contact-support/\n" "Last-Translator: \n" "Language-Team: \n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"POT-Creation-Date: 2024-06-18T08:14:43+00:00\n" +"POT-Creation-Date: 2024-06-25T01:58:52+00:00\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "X-Generator: WP-CLI 2.7.1\n" "X-Domain: automatewoo\n" @@ -739,7 +739,7 @@ msgid "Subscription" msgstr "" #: admin/data-layer-formatter.php:101 -#: includes/Actions/Memberships_Abstract.php:15 +#: includes/Actions/Memberships_Abstract.php:19 #: includes/Privacy_Exporters.php:370 msgid "Membership" msgstr "" @@ -2296,7 +2296,7 @@ msgid "If delete is selected the subscriber's email will not be added to the sup msgstr "" #: includes/Actions/Campaign_Monitor_Remove_Subscriber.php:35 -#: includes/Workflow_Email.php:310 +#: includes/Workflow_Email.php:307 msgid "Unsubscribe" msgstr "" @@ -2468,53 +2468,56 @@ msgstr "" msgid "Remove customer from list" msgstr "" -#: includes/Actions/Memberships_Change_Plan.php:19 +#: includes/Actions/Memberships_Change_Plan.php:27 msgid "Create / Change Membership Plan For User" msgstr "" -#: includes/Actions/Memberships_Change_Plan.php:20 +#: includes/Actions/Memberships_Change_Plan.php:28 msgid "Changes the plan of a user's active membership. If no active membership exists a new membership can optionally be created." msgstr "" -#: includes/Actions/Memberships_Change_Plan.php:31 +#: includes/Actions/Memberships_Change_Plan.php:41 msgid "Existing plan" msgstr "" -#: includes/Actions/Memberships_Change_Plan.php:32 +#: includes/Actions/Memberships_Change_Plan.php:42 #: includes/Actions/Memberships_Change_Status.php:47 msgid "[None]" msgstr "" -#: includes/Actions/Memberships_Change_Plan.php:33 +#: includes/Actions/Memberships_Change_Plan.php:43 msgid "Leave this blank to only create new memberships." msgstr "" -#: includes/Actions/Memberships_Change_Plan.php:38 +#: includes/Actions/Memberships_Change_Plan.php:48 msgid "New plan" msgstr "" -#: includes/Actions/Memberships_Change_Plan.php:43 +#: includes/Actions/Memberships_Change_Plan.php:53 msgid "Allow membership creation?" msgstr "" -#: includes/Actions/Memberships_Change_Plan.php:44 +#: includes/Actions/Memberships_Change_Plan.php:54 msgid "If checked a new membership will be created for the user if they are not a member of the existing plan." msgstr "" -#: includes/Actions/Memberships_Change_Plan.php:69 +#: includes/Actions/Memberships_Change_Plan.php:81 msgid "Plan could not be changed or created because the user already has a membership using the new plan." msgstr "" -#: includes/Actions/Memberships_Change_Plan.php:105 +#. translators: The Workflow ID +#: includes/Actions/Memberships_Change_Plan.php:119 msgid "Membership created by AutomateWoo workflow #%s" msgstr "" -#: includes/Actions/Memberships_Change_Plan.php:111 +#. translators: The Membership ID +#: includes/Actions/Memberships_Change_Plan.php:129 msgid "Membership #%s successfully created." msgstr "" -#: includes/Actions/Memberships_Change_Plan.php:125 -msgid "Membership plan changed from %s to %s by AutomateWoo workflow:#%s" +#. translators: %1$s The Membership plan name, %2$s the new plan name, %3$s The Workflow ID +#: includes/Actions/Memberships_Change_Plan.php:145 +msgid "Membership plan changed from %1$s to %2$s by AutomateWoo workflow:#%3$s" msgstr "" #: includes/Actions/Memberships_Change_Status.php:24 @@ -2559,23 +2562,25 @@ msgstr "" msgid "Membership status doesn't match value specified in Action settings." msgstr "" -#: includes/Actions/Memberships_Delete_User_Membership.php:19 +#: includes/Actions/Memberships_Delete_User_Membership.php:29 msgid "Delete Membership For User" msgstr "" -#: includes/Actions/Memberships_Delete_User_Membership.php:29 +#: includes/Actions/Memberships_Delete_User_Membership.php:41 msgid "Plan" msgstr "" -#: includes/Actions/Memberships_Delete_User_Membership.php:53 +#: includes/Actions/Memberships_Delete_User_Membership.php:66 msgid "The user did not have membership that matched the selected plan." msgstr "" -#: includes/Actions/Memberships_Delete_User_Membership.php:62 +#. translators: The Membership ID +#: includes/Actions/Memberships_Delete_User_Membership.php:76 msgid "Deleted membership #%s" msgstr "" -#: includes/Actions/Memberships_Delete_User_Membership.php:65 +#. translators: The Membership ID +#: includes/Actions/Memberships_Delete_User_Membership.php:79 msgid "Failed deleting membership #%s" msgstr "" @@ -2688,35 +2693,36 @@ msgstr "" msgid "Remove Points" msgstr "" -#: includes/Actions/Send_Email.php:29 +#: includes/Actions/Send_Email.php:32 msgid "Send Email" msgstr "" -#: includes/Actions/Send_Email.php:31 -msgid "This action sends an HTML email using a template. The default template matches the style of your WooCommerce transactional emails. <%s>View email templates documentation<%s>." +#. translators: %1$s anchor tag with the link to the documentation link, %2$s closing tag for the anchor +#: includes/Actions/Send_Email.php:35 +msgid "This action sends an HTML email using a template. The default template matches the style of your WooCommerce transactional emails. <%1$s>View email templates documentation<%2$s>." msgstr "" -#: includes/Actions/Send_Email.php:43 +#: includes/Actions/Send_Email.php:49 msgid "Email heading" msgstr "" -#: includes/Actions/Send_Email.php:45 +#: includes/Actions/Send_Email.php:51 msgid "The appearance will depend on your email template. Not all templates support this field." msgstr "" -#: includes/Actions/Send_Email.php:49 +#: includes/Actions/Send_Email.php:55 msgid "Email preheader" msgstr "" -#: includes/Actions/Send_Email.php:51 +#: includes/Actions/Send_Email.php:57 msgid "A preheader is a short text summary that follows the subject line when an email is viewed in the inbox. If no preheader is set the first text found in the email is used." msgstr "" -#: includes/Actions/Send_Email.php:55 +#: includes/Actions/Send_Email.php:61 msgid "Template" msgstr "" -#: includes/Actions/Send_Email.php:56 +#: includes/Actions/Send_Email.php:62 msgid "Select which template to use when formatting the email. If you select 'None', the email will have no template but the email will still be sent as an HTML email." msgstr "" @@ -2765,27 +2771,27 @@ msgstr "" msgid "All HTML will be removed from this field when sending. Variables that use HTML may display unexpectedly because of this." msgstr "" -#: includes/Actions/Send_Email_Raw.php:28 +#: includes/Actions/Send_Email_Raw.php:32 msgid "Send Email - Raw HTML" msgstr "" -#: includes/Actions/Send_Email_Raw.php:29 +#: includes/Actions/Send_Email_Raw.php:33 msgid "This action sends emails with only the HTML/CSS entered in the action's HTML field and is designed for advanced use only. This is different from the standard Send Email action, which inserts the email content into a template. Some variables may display unexpectedly due to the different CSS. Please note that you should include an unsubscribe link by using the variable {{ unsubscribe_url }}." msgstr "" -#: includes/Actions/Send_Email_Raw.php:38 +#: includes/Actions/Send_Email_Raw.php:44 msgid "Include AutomateWoo CSS" msgstr "" -#: includes/Actions/Send_Email_Raw.php:40 +#: includes/Actions/Send_Email_Raw.php:46 msgid "Checking this box adds the basic AutomateWoo CSS that is used to style variables to your custom HTML." msgstr "" -#: includes/Actions/Send_Email_Raw.php:44 +#: includes/Actions/Send_Email_Raw.php:50 msgid "Email HTML" msgstr "" -#: includes/Actions/Send_Email_Raw.php:45 +#: includes/Actions/Send_Email_Raw.php:51 msgid "Any CSS included in the HTML will be automatically inlined." msgstr "" @@ -2830,7 +2836,7 @@ msgid "No valid recipients" msgstr "" #: includes/Actions/Send_SMS_Twilio.php:105 -#: includes/Workflow_Email.php:388 +#: includes/Workflow_Email.php:382 msgid "The recipient is not opted-in to this workflow." msgstr "" @@ -4808,7 +4814,7 @@ msgstr "" msgid "Customer - Account Created Date" msgstr "" -#: includes/Rules/Customer_Active_Membership_Plans.php:24 +#: includes/Rules/Customer_Active_Membership_Plans.php:36 msgid "Customer - Active Memberships Plans" msgstr "" @@ -5579,15 +5585,15 @@ msgstr "" msgid "Select files here to have this workflow trigger only for those specific items. Leave blank to run for all downloadable files of the selected product." msgstr "" -#: includes/Triggers/Abstract_Memberships.php:18 +#: includes/Triggers/Abstract_Memberships.php:22 msgid "Memberships" msgstr "" -#: includes/Triggers/Abstract_Memberships.php:31 +#: includes/Triggers/Abstract_Memberships.php:35 msgid "Membership plans" msgstr "" -#: includes/Triggers/Abstract_Memberships.php:32 +#: includes/Triggers/Abstract_Memberships.php:36 msgid "Select which membership plans to trigger for. Leave blank to apply for all plans." msgstr "" @@ -5608,7 +5614,7 @@ msgid "This trigger fires when a booking status changes. Notice a valid customer msgstr "" #: includes/Triggers/BookingStatusChanged.php:66 -#: includes/Triggers/Membership_Status_Changed.php:38 +#: includes/Triggers/Membership_Status_Changed.php:43 #: includes/Triggers/Order_Status_Changes.php:29 #: includes/Triggers/Subscription_Status_Changed.php:44 msgid "Status changes from" @@ -5619,7 +5625,7 @@ msgid "Select valid previous booking status values to trigger this workflow. Lea msgstr "" #: includes/Triggers/BookingStatusChanged.php:73 -#: includes/Triggers/Membership_Status_Changed.php:45 +#: includes/Triggers/Membership_Status_Changed.php:50 #: includes/Triggers/Order_Status_Changes.php:35 #: includes/Triggers/Subscription_Status_Changed.php:51 msgid "Status changes to" @@ -5778,15 +5784,15 @@ msgstr "" msgid "Choose which MailChimp for WordPress form this workflow should trigger for." msgstr "" -#: includes/Triggers/Membership_Created.php:29 +#: includes/Triggers/Membership_Created.php:36 msgid "Membership Created" msgstr "" -#: includes/Triggers/Membership_Status_Changed.php:25 +#: includes/Triggers/Membership_Status_Changed.php:28 msgid "Membership Status Changed" msgstr "" -#: includes/Triggers/Membership_Status_Changed.php:35 +#: includes/Triggers/Membership_Status_Changed.php:40 msgid "Leave blank for any status" msgstr "" @@ -7460,7 +7466,7 @@ msgctxt "timing option" msgid "Checked daily at %s" msgstr "" -#: includes/Workflow_Email.php:375 +#: includes/Workflow_Email.php:369 msgid "Workflow was not defined for email." msgstr "" diff --git a/vendor/composer/installed.php b/vendor/composer/installed.php index 797acf1..7680033 100644 --- a/vendor/composer/installed.php +++ b/vendor/composer/installed.php @@ -1,9 +1,9 @@ array( 'name' => 'woocommerce/automatewoo', - 'pretty_version' => 'dev-release/6.0.26', - 'version' => 'dev-release/6.0.26', - 'reference' => '6300227784b13f4bc4d587e40da82adbeb4f1db4', + 'pretty_version' => 'dev-release/6.0.27', + 'version' => 'dev-release/6.0.27', + 'reference' => '932d017e52cf2e2189136f42dff27ef5ab5b8a4d', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(), @@ -11,9 +11,9 @@ ), 'versions' => array( 'woocommerce/automatewoo' => array( - 'pretty_version' => 'dev-release/6.0.26', - 'version' => 'dev-release/6.0.26', - 'reference' => '6300227784b13f4bc4d587e40da82adbeb4f1db4', + 'pretty_version' => 'dev-release/6.0.27', + 'version' => 'dev-release/6.0.27', + 'reference' => '932d017e52cf2e2189136f42dff27ef5ab5b8a4d', 'type' => 'wordpress-plugin', 'install_path' => __DIR__ . '/../../', 'aliases' => array(),