From cfc10ff0d9fc9db562b1fdae69efc948389e7575 Mon Sep 17 00:00:00 2001 From: Alex P Date: Tue, 21 Dec 2021 17:01:11 +0200 Subject: [PATCH 01/14] Add "View logs" link in settings --- modules/ppcp-wc-gateway/services.php | 3 ++- tests/PHPUnit/ModularTestCase.php | 1 + 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/modules/ppcp-wc-gateway/services.php b/modules/ppcp-wc-gateway/services.php index cb6d3b604..29996a486 100644 --- a/modules/ppcp-wc-gateway/services.php +++ b/modules/ppcp-wc-gateway/services.php @@ -729,7 +729,8 @@ return array( 'title' => __( 'Logging', 'woocommerce-paypal-payments' ), 'type' => 'checkbox', 'desc_tip' => true, - 'label' => __( 'Enable logging', 'woocommerce-paypal-payments' ), + 'label' => __( 'Enable logging. ', 'woocommerce-paypal-payments' ) . + ' ' . __( 'View logs', 'woocommerce-paypal-payments' ) . '', 'description' => __( 'Enable logging of unexpected behavior. This can also log private data and should only be enabled in a development or stage environment.', 'woocommerce-paypal-payments' ), 'default' => false, 'screens' => array( diff --git a/tests/PHPUnit/ModularTestCase.php b/tests/PHPUnit/ModularTestCase.php index be813085f..9756108ef 100644 --- a/tests/PHPUnit/ModularTestCase.php +++ b/tests/PHPUnit/ModularTestCase.php @@ -19,6 +19,7 @@ class ModularTestCase extends TestCase parent::setUp(); when('get_option')->justReturn(null); + when('admin_url')->returnArg(); when('plugins_url')->returnArg(); when('plugin_dir_path')->alias(function ($file) { return trailingslashit(dirname($file)); }); when('get_current_blog_id')->justReturn(42); From b93d0acfcc4f4f2d38e46e486a689021d376427b Mon Sep 17 00:00:00 2001 From: Alex P Date: Tue, 21 Dec 2021 17:51:28 +0200 Subject: [PATCH 02/14] Use translation from WC for "Place order" / "Pay for order" --- modules/ppcp-button/src/Assets/SmartButton.php | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/modules/ppcp-button/src/Assets/SmartButton.php b/modules/ppcp-button/src/Assets/SmartButton.php index 62ec1aa90..ccfa66d62 100644 --- a/modules/ppcp-button/src/Assets/SmartButton.php +++ b/modules/ppcp-button/src/Assets/SmartButton.php @@ -570,7 +570,8 @@ class SmartButton implements SmartButtonInterface { return; } - $label = 'checkout' === $this->context() ? __( 'Place order', 'woocommerce-paypal-payments' ) : __( 'Pay for order', 'woocommerce-paypal-payments' ); + // phpcs:ignore WordPress.WP.I18n.TextDomainMismatch + $label = 'checkout' === $this->context() ? apply_filters( 'woocommerce_order_button_text', __( 'Place order', 'woocommerce' ) ) : __( 'Pay for order', 'woocommerce' ); printf( '