Skip to content

Commit e8cc3d5

Browse files
authored
PFW-1940 - Fix Function _load_textdomain_just_in_time was called incorrectly error (#2108)
* PFW-1939 - Fix onboarding fatal error; add retry logic and SSL error handling * PFW-1940 - Fix Function _load_textdomain_just_in_time was called incorrectly error * PFW-1939 - Fixed the typed variable initialization error
1 parent 129572c commit e8cc3d5

File tree

3 files changed

+25
-23
lines changed

3 files changed

+25
-23
lines changed

paypal-for-woocommerce.php

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ private function initialize_actions() {
102102
add_action('init', array($this, 'load_plugin_textdomain'));
103103
add_action('wp_loaded', array($this, 'load_cartflow_pro_plugin'), 20);
104104
add_action('add_meta_boxes', array($this, 'add_meta_boxes'), 32);
105-
add_action('plugins_loaded', array($this, 'init'), 103);
105+
add_action('init', array($this, 'init'), 103);
106106
add_action('plugins_loaded', array($this, 'load_funnelkit_pro_plugin_compatible_gateways'), 5);
107107
add_action('admin_notices', array($this, 'admin_notices'));
108108
add_action('admin_init', array($this, 'set_ignore_tag'));
@@ -1305,7 +1305,7 @@ public function angelleye_synce_braintree_save_payment_methods($list, $customer_
13051305
}
13061306
}
13071307
} catch (Exception $ex) {
1308-
1308+
13091309
}
13101310
return $list;
13111311
}
@@ -1401,7 +1401,7 @@ public function own_angelleye_pppc_seller_onboard_html($post_id) {
14011401
$seller_onboard = AngellEYE_PayPal_PPCP_Seller_Onboarding::instance();
14021402
$seller_onboard->angelleye_ppcp_multi_account_generate_signup_link($post_id);
14031403
} catch (Exception $ex) {
1404-
1404+
14051405
}
14061406
}
14071407

@@ -1418,7 +1418,7 @@ public function angelleye_redirect_to_onboard() {
14181418
public function load_funnelkit_pro_plugin_compatible_gateways() {
14191419
try {
14201420
// Check for Funnel Builder Pro Plugin Activation
1421-
if (defined('WFFN_PRO_FILE')) {
1421+
if (defined('WFFN_PRO_FILE')) {
14221422
require_once plugin_dir_path(__FILE__) . 'ppcp-gateway/funnelkit/class-wfocu-paypal-for-wc-gateway-angelleye-ppcp.php';
14231423
require_once plugin_dir_path(__FILE__) . 'ppcp-gateway/funnelkit/class-wfocu-paypal-for-wc-gateway-angelleye-ppcp-cc.php';
14241424
}
@@ -1461,13 +1461,13 @@ public function add_meta_boxes() {
14611461
require_once(PAYPAL_FOR_WOOCOMMERCE_PLUGIN_DIR . '/ppcp-gateway/checkout-block/angelleye-ppcp-checkout-block.php');
14621462
require_once(PAYPAL_FOR_WOOCOMMERCE_PLUGIN_DIR . '/ppcp-gateway/checkout-block/angelleye-ppcp-cc-block.php');
14631463
add_action(
1464-
'woocommerce_blocks_payment_method_type_registration',
1465-
function (Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry) {
1466-
$payment_method_registry->register(new AngellEYE_PPCP_Checkout_Block);
1467-
$payment_method_registry->register(new AngellEYE_PPCP_CC_Block);
1468-
}
1464+
'woocommerce_blocks_payment_method_type_registration',
1465+
function (Automattic\WooCommerce\Blocks\Payments\PaymentMethodRegistry $payment_method_registry) {
1466+
$payment_method_registry->register(new AngellEYE_PPCP_Checkout_Block);
1467+
$payment_method_registry->register(new AngellEYE_PPCP_CC_Block);
1468+
}
14691469
);
14701470
} catch (Exception $ex) {
1471-
1471+
14721472
}
1473-
});
1473+
});

ppcp-gateway/checkout-block/angelleye-ppcp-cc-block.php

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,18 @@ final class AngellEYE_PPCP_CC_Block extends AbstractPaymentMethodType {
1212
public function initialize() {
1313
$this->version = VERSION_PFW;
1414
$this->settings = get_option('woocommerce_angelleye_ppcp_settings', []);
15-
$this->gateway = new WC_Gateway_CC_AngellEYE();
16-
if (!class_exists('AngellEYE_PayPal_PPCP_Pay_Later')) {
17-
include_once ( PAYPAL_FOR_WOOCOMMERCE_PLUGIN_DIR . '/ppcp-gateway/class-angelleye-paypal-ppcp-pay-later-messaging.php');
18-
}
19-
$this->pay_later = AngellEYE_PayPal_PPCP_Pay_Later::instance();
2015
}
2116

2217
public function is_active() {
18+
$this->gateway = new WC_Gateway_CC_AngellEYE();
2319
return $this->gateway->is_available();
2420
}
2521

2622
public function get_payment_method_script_handles() {
23+
if (!class_exists('AngellEYE_PayPal_PPCP_Pay_Later')) {
24+
include_once ( PAYPAL_FOR_WOOCOMMERCE_PLUGIN_DIR . '/ppcp-gateway/class-angelleye-paypal-ppcp-pay-later-messaging.php');
25+
}
26+
$this->pay_later = AngellEYE_PayPal_PPCP_Pay_Later::instance();
2727
wp_register_style('angelleye_ppcp', PAYPAL_FOR_WOOCOMMERCE_ASSET_URL . 'ppcp-gateway/css/wc-gateway-ppcp-angelleye-public.css', array(), $this->version, 'all');
2828
wp_register_script('angelleye_ppcp_cc-blocks-integration', PAYPAL_FOR_WOOCOMMERCE_ASSET_URL . 'ppcp-gateway/checkout-block/ppcp-cc.js', array(), VERSION_PFW, true);
2929
if (angelleye_ppcp_has_active_session()) {
@@ -56,7 +56,7 @@ public function get_payment_method_script_handles() {
5656
'settins' => $this->settings,
5757
'page' => $page
5858
));
59-
59+
6060
if (function_exists('wp_set_script_translations')) {
6161
wp_set_script_translations('angelleye_ppcp_cc-blocks-integration', 'paypal-for-woocommerce');
6262
}

ppcp-gateway/checkout-block/angelleye-ppcp-checkout-block.php

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,18 +12,20 @@ final class AngellEYE_PPCP_Checkout_Block extends AbstractPaymentMethodType {
1212
public function initialize() {
1313
$this->version = VERSION_PFW;
1414
$this->settings = get_option('woocommerce_angelleye_ppcp_settings', []);
15-
$this->gateway = new WC_Gateway_PPCP_AngellEYE();
16-
if (!class_exists('AngellEYE_PayPal_PPCP_Pay_Later')) {
17-
include_once ( PAYPAL_FOR_WOOCOMMERCE_PLUGIN_DIR . '/ppcp-gateway/class-angelleye-paypal-ppcp-pay-later-messaging.php');
18-
}
19-
$this->pay_later = AngellEYE_PayPal_PPCP_Pay_Later::instance();
2015
}
2116

2217
public function is_active() {
18+
$this->gateway = new WC_Gateway_PPCP_AngellEYE();
2319
return $this->gateway->is_available();
2420
}
2521

2622
public function get_payment_method_script_handles() {
23+
if (!class_exists('AngellEYE_PayPal_PPCP_Pay_Later')) {
24+
include_once ( PAYPAL_FOR_WOOCOMMERCE_PLUGIN_DIR . '/ppcp-gateway/class-angelleye-paypal-ppcp-pay-later-messaging.php');
25+
}
26+
27+
$this->pay_later = AngellEYE_PayPal_PPCP_Pay_Later::instance();
28+
2729
wp_register_style('angelleye_ppcp', PAYPAL_FOR_WOOCOMMERCE_ASSET_URL . 'ppcp-gateway/css/wc-gateway-ppcp-angelleye-public.css', array(), $this->version, 'all');
2830
wp_register_script('angelleye_ppcp-blocks-integration', PAYPAL_FOR_WOOCOMMERCE_ASSET_URL . 'ppcp-gateway/checkout-block/ppcp-checkout.js', array('jquery', 'react', 'wc-blocks-registry', 'wc-settings', 'wp-element', 'wp-i18n', 'wp-polyfill', 'wp-element', 'wp-plugins'), VERSION_PFW, true);
2931
if (angelleye_ppcp_has_active_session()) {
@@ -56,7 +58,7 @@ public function get_payment_method_script_handles() {
5658
'settins' => $this->settings,
5759
'page' => $page
5860
));
59-
61+
6062
if (function_exists('wp_set_script_translations')) {
6163
wp_set_script_translations('angelleye_ppcp-blocks-integration', 'paypal-for-woocommerce');
6264
}

0 commit comments

Comments
 (0)