From ec51c8348e2d0f505a6964f09bf3a1fde9b1c4ec Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 9 Aug 2024 09:50:25 +0200 Subject: [PATCH 01/19] Remove example folder --- .distignore | 1 + mollie-payments-for-woocommerce.php | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.distignore b/.distignore index 8c5cb745..32ec1a62 100644 --- a/.distignore +++ b/.distignore @@ -4,6 +4,7 @@ tests/ resources/ vendor/**/test* +vendor/mollie/mollie-api-php/examples/ languages/*.po bin/ *.lock diff --git a/mollie-payments-for-woocommerce.php b/mollie-payments-for-woocommerce.php index b2a83fbf..d129381e 100644 --- a/mollie-payments-for-woocommerce.php +++ b/mollie-payments-for-woocommerce.php @@ -3,7 +3,7 @@ * Plugin Name: Mollie Payments for WooCommerce * Plugin URI: https://www.mollie.com * Description: Accept payments in WooCommerce with the official Mollie plugin - * Version: 7.7.0-beta + * Version: 7.7.0 * Author: Mollie * Author URI: https://www.mollie.com * Requires at least: 5.0 From 5d5c29c3349c748713d33f1f38a5b4e7914d8269 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 9 Aug 2024 12:57:54 +0200 Subject: [PATCH 02/19] Update modularity --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 0fbd7da9..aa3c19e2 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "psr/log":"^1.1.4" }, "require-dev": { - "inpsyde/modularity": "^1.3.0", + "inpsyde/modularity": "^1.8.0", "psr/container": "1.0.0", "phpunit/phpunit": "^8", "brain/monkey": "^2.3", From 347a8cf751455019e084d911279356c1cee56c34 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 9 Aug 2024 12:58:23 +0200 Subject: [PATCH 03/19] Wrap json_encode with wp_json_encode --- .../Capture/Action/CapturePayment.php | 2 +- src/Payment/MollieOrder.php | 2 +- src/Payment/MollieOrderService.php | 16 ++++++++-------- src/Payment/MolliePayment.php | 2 +- src/Payment/PaymentService.php | 6 +++--- src/Subscription/MollieSubscriptionGateway.php | 2 +- 6 files changed, 15 insertions(+), 15 deletions(-) diff --git a/src/MerchantCapture/Capture/Action/CapturePayment.php b/src/MerchantCapture/Capture/Action/CapturePayment.php index 8d50f699..e4124817 100644 --- a/src/MerchantCapture/Capture/Action/CapturePayment.php +++ b/src/MerchantCapture/Capture/Action/CapturePayment.php @@ -40,7 +40,7 @@ public function __invoke() ]; $this->logger->debug( 'SEND AN ORDER CAPTURE, orderId: ' . $this->order->get_id( - ) . ' transactionId: ' . $paymentId . 'Capture data: ' . json_encode($captureData) + ) . ' transactionId: ' . $paymentId . 'Capture data: ' . wp_json_encode($captureData) ); $paymentCapturesApi->createForId($paymentId, $captureData); $this->order->update_meta_data( diff --git a/src/Payment/MollieOrder.php b/src/Payment/MollieOrder.php index 36691581..0cfa540d 100644 --- a/src/Payment/MollieOrder.php +++ b/src/Payment/MollieOrder.php @@ -157,7 +157,7 @@ public function getPaymentRequestData($order, $customerId, $voucherDefaultCatego //phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $applePayToken = wc_clean(wp_unslash($_POST["token"] ?? '')); if ($applePayToken && isset($paymentRequestData['payment'])) { - $encodedApplePayToken = json_encode($applePayToken); + $encodedApplePayToken = wp_json_encode($applePayToken); $paymentRequestData['payment']['applePayPaymentToken'] = $encodedApplePayToken; } $customerBirthdate = $this->getCustomerBirthdate($order); diff --git a/src/Payment/MollieOrderService.php b/src/Payment/MollieOrderService.php index ede0c6d0..235a02e4 100644 --- a/src/Payment/MollieOrderService.php +++ b/src/Payment/MollieOrderService.php @@ -269,7 +269,7 @@ protected function processRefunds(WC_Order $order, $payment) $refundIds = $this->findRefundIds($payment); // Check for new refund $this->logger->debug( - __METHOD__ . " All refund IDs for {$logId}: " . json_encode( + __METHOD__ . " All refund IDs for {$logId}: " . wp_json_encode( $refundIds ) ); @@ -293,7 +293,7 @@ protected function processRefunds(WC_Order $order, $payment) $this->logger->debug( __METHOD__ . " Refunds that need to be processed for {$logId}: " - . json_encode($refundsToProcess) + . wp_json_encode($refundsToProcess) ); $order = wc_get_order($orderId); @@ -348,7 +348,7 @@ protected function processChargebacks(WC_Order $order, $payment) } $this->logger->debug( - __METHOD__ . " All chargeback IDs for {$logId}: " . json_encode( + __METHOD__ . " All chargeback IDs for {$logId}: " . wp_json_encode( $chargebackIds ) ); @@ -365,7 +365,7 @@ protected function processChargebacks(WC_Order $order, $payment) $this->logger->debug( __METHOD__ . " Already processed chargebacks for {$logId}: " - . json_encode($processedChargebackIds) + . wp_json_encode($processedChargebackIds) ); // Order the chargeback arrays by value (chargeback ID) @@ -382,7 +382,7 @@ protected function processChargebacks(WC_Order $order, $payment) $this->logger->debug( __METHOD__ . " Chargebacks that need to be processed for {$logId}: " - . json_encode($chargebacksToProcess) + . wp_json_encode($chargebacksToProcess) ); } else { // No new chargebacks, stop processing. @@ -466,7 +466,7 @@ protected function processChargebacks(WC_Order $order, $payment) $this->logger->debug( __METHOD__ . " Updated, all processed chargebacks for {$logId}: " - . json_encode($processedChargebackIds) + . wp_json_encode($processedChargebackIds) ); $order->save(); @@ -797,7 +797,7 @@ protected function getProcessedRefundIds(WC_Order $order, string $logId) $this->logger->debug( __METHOD__ . " Already processed refunds for {$logId}: " - . json_encode($processedRefundIds) + . wp_json_encode($processedRefundIds) ); return $processedRefundIds; } @@ -836,7 +836,7 @@ protected function notifyProcessedRefunds(array $refundsToProcess, string $logId ); $this->logger->debug( __METHOD__ . " Updated, all processed refunds for {$logId}: " - . json_encode($processedRefundIds) + . wp_json_encode($processedRefundIds) ); return $processedRefundIds; } diff --git a/src/Payment/MolliePayment.php b/src/Payment/MolliePayment.php index 0d319e54..f4dfbab5 100644 --- a/src/Payment/MolliePayment.php +++ b/src/Payment/MolliePayment.php @@ -120,7 +120,7 @@ public function getPaymentRequestData($order, $customerId, $voucherDefaultCatego //phpcs:ignore WordPress.Security.NonceVerification, WordPress.Security.ValidatedSanitizedInput.InputNotSanitized $applePayToken = wc_clean(wp_unslash($_POST["token"] ?? '')); if ($applePayToken) { - $encodedApplePayToken = json_encode($applePayToken); + $encodedApplePayToken = wp_json_encode($applePayToken); $paymentRequestData['applePayPaymentToken'] = $encodedApplePayToken; } $paymentRequestData = $this->addCustomRequestFields($order, $paymentRequestData, $gateway); diff --git a/src/Payment/PaymentService.php b/src/Payment/PaymentService.php index bd7bf82d..c05d7f45 100644 --- a/src/Payment/PaymentService.php +++ b/src/Payment/PaymentService.php @@ -372,10 +372,10 @@ protected function processAsMollieOrder( ? $data['orderNumber'] : '', 'lines' => isset($data['lines']) ? $data['lines'] : '', ]; - $this->logger->debug(json_encode($apiCallLog)); + $this->logger->debug(wp_json_encode($apiCallLog)); $paymentOrder = $paymentObject; $paymentObject = $this->apiHelper->getApiClient($apiKey)->orders->create($data); - $this->logger->debug(json_encode($paymentObject)); + $this->logger->debug(wp_json_encode($paymentObject)); $settingsHelper = $this->settingsHelper; if ($settingsHelper->getOrderStatusCancelledPayments() === 'cancelled') { $orderId = $order->get_id(); @@ -492,7 +492,7 @@ protected function processAsMolliePayment( : '', ]; - $this->logger->debug(json_encode($apiCallLog, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); + $this->logger->debug(wp_json_encode($apiCallLog, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES)); // Try as simple payment $paymentObject = $this->apiHelper->getApiClient( diff --git a/src/Subscription/MollieSubscriptionGateway.php b/src/Subscription/MollieSubscriptionGateway.php index f62a6e83..4db77eee 100644 --- a/src/Subscription/MollieSubscriptionGateway.php +++ b/src/Subscription/MollieSubscriptionGateway.php @@ -322,7 +322,7 @@ public function scheduled_subscription_payment($renewal_total, WC_Order $renewal $this->updateFirstPaymentMethodToRecurringPaymentMethod($renewal_order, $renewal_order_id, $payment); // Log successful creation of payment - $this->logger->debug($this->id . ': Renewal payment ' . $payment->id . ' (' . $payment->mode . ') created for order ' . $renewal_order_id . ' payment json response: ' . json_encode($payment)); + $this->logger->debug($this->id . ': Renewal payment ' . $payment->id . ' (' . $payment->mode . ') created for order ' . $renewal_order_id . ' payment json response: ' . wp_json_encode($payment)); // Unset & set active Mollie payment // Get correct Mollie Payment Object From a0b29486a3a922e61f0446e63c36c7a7173d386d Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 9 Aug 2024 13:15:12 +0200 Subject: [PATCH 04/19] Fix Generic.PHP.DisallowShortOpenTag.EchoFound --- src/MerchantCapture/UI/StatusButton.php | 2 +- src/Notice/AdminNotice.php | 4 ++-- .../BancomatpayFieldsStrategy.php | 6 +++--- .../BillieFieldsStrategy.php | 4 ++-- .../PaymentFieldsStrategies/In3FieldsStrategy.php | 12 ++++++------ .../RivertyFieldsStrategy.php | 14 +++++++------- 6 files changed, 21 insertions(+), 21 deletions(-) diff --git a/src/MerchantCapture/UI/StatusButton.php b/src/MerchantCapture/UI/StatusButton.php index 063217a5..712941d4 100644 --- a/src/MerchantCapture/UI/StatusButton.php +++ b/src/MerchantCapture/UI/StatusButton.php @@ -9,7 +9,7 @@ class StatusButton public function __invoke(string $text, string $status) { ?> - + -
- +
+

-

-

-

-

-

-

Date: Fri, 9 Aug 2024 13:17:38 +0200 Subject: [PATCH 05/19] Fix Generic.PHP.DisallowShortOpenTag.EchoFound --- src/MerchantCapture/UI/OrderActionBlock.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/MerchantCapture/UI/OrderActionBlock.php b/src/MerchantCapture/UI/OrderActionBlock.php index d0fbd656..b8177630 100644 --- a/src/MerchantCapture/UI/OrderActionBlock.php +++ b/src/MerchantCapture/UI/OrderActionBlock.php @@ -11,7 +11,7 @@ public function __invoke(array $paragraphs) echo "
  • "; foreach ($paragraphs as $paragraph) { ?> -

    ['class' => []], 'span' => []]); ?>

    +

    ['class' => []], 'span' => []]); ?>

    '; From 5e13e3b0592ef288a5add3a407a51a1a57f6574c Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 9 Aug 2024 13:22:40 +0200 Subject: [PATCH 06/19] Fix WordPress.WP.AlternativeFunctions.parse_url_parse_url --- src/Buttons/ApplePayButton/AppleAjaxRequests.php | 2 +- src/Payment/MollieObject.php | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Buttons/ApplePayButton/AppleAjaxRequests.php b/src/Buttons/ApplePayButton/AppleAjaxRequests.php index 6643cffe..aed5f155 100644 --- a/src/Buttons/ApplePayButton/AppleAjaxRequests.php +++ b/src/Buttons/ApplePayButton/AppleAjaxRequests.php @@ -116,7 +116,7 @@ public function validateMerchant() //we cannot access the endpoint in testmode, we override it to be testMode = false $apiKey = $this->settingsHelper->getApiKey(false); $validationUrl = $applePayRequestDataObject->validationUrl(); - $completeDomain = parse_url(get_site_url(), PHP_URL_HOST); + $completeDomain = wp_parse_url(get_site_url(), PHP_URL_HOST); $removeHttp = ["https://", "http://"]; $regex = '/.+\.\w+\/?((\w*\/*)*)/i'; $domain = str_replace($removeHttp, "", $completeDomain); diff --git a/src/Payment/MollieObject.php b/src/Payment/MollieObject.php index 7eac75ed..d2f44480 100644 --- a/src/Payment/MollieObject.php +++ b/src/Payment/MollieObject.php @@ -835,7 +835,7 @@ public function getWebhookUrl($order, $gatewayId) */ protected function asciiDomainName($url): string { - $parsed = parse_url($url); + $parsed = wp_parse_url($url); $scheme = isset($parsed['scheme']) ? $parsed['scheme'] : ''; $domain = isset($parsed['host']) ? $parsed['host'] : false; $query = isset($parsed['query']) ? $parsed['query'] : ''; From 87ec7e719938dec294db2ba515575b1de9da754b Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 9 Aug 2024 14:44:53 +0200 Subject: [PATCH 07/19] Fix WordPress.DateTime.RestrictedFunctions.date_date --- src/Assets/AssetsModule.php | 2 +- src/Payment/MollieOrder.php | 2 +- src/PaymentMethods/Banktransfer.php | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Assets/AssetsModule.php b/src/Assets/AssetsModule.php index 8b9f3a96..ff9f5a66 100644 --- a/src/Assets/AssetsModule.php +++ b/src/Assets/AssetsModule.php @@ -247,7 +247,7 @@ protected function registerFrontendScripts(string $pluginUrl, string $pluginPath (string) filemtime($this->getPluginPath($pluginPath, '/public/js/applepayDirectCart.min.js')), true ); - wp_register_script('mollie', 'https://js.mollie.com/v1/mollie.js', [], date("d"), true); + wp_register_script('mollie', 'https://js.mollie.com/v1/mollie.js', [],gmdate("d"), true); wp_register_script( 'mollie-components', $this->getPluginUrl($pluginUrl, '/public/js/mollie-components.min.js'), diff --git a/src/Payment/MollieOrder.php b/src/Payment/MollieOrder.php index 0cfa540d..4b412fc7 100644 --- a/src/Payment/MollieOrder.php +++ b/src/Payment/MollieOrder.php @@ -1014,7 +1014,7 @@ protected function getCustomerBirthdate($order) return null; } $format = "Y-m-d"; - return date($format, (int) strtotime($fieldPosted)); + returngmdate($format, (int) strtotime($fieldPosted)); } return null; } diff --git a/src/PaymentMethods/Banktransfer.php b/src/PaymentMethods/Banktransfer.php index c2750321..6b4a58da 100644 --- a/src/PaymentMethods/Banktransfer.php +++ b/src/PaymentMethods/Banktransfer.php @@ -96,7 +96,7 @@ public function addPaymentArguments(array $args, WC_Order $order) $expiry_days = (int)$this->getProperty(self::EXPIRY_DAYS_OPTION) ?: self::EXPIRY_DEFAULT_DAYS; if ($expiry_days >= self::EXPIRY_MIN_DAYS && $expiry_days <= self::EXPIRY_MAX_DAYS) { - $expiry_date = date("Y-m-d", strtotime(sprintf('+%s days', $expiry_days))); + $expiry_date =gmdate("Y-m-d", strtotime(sprintf('+%s days', $expiry_days))); // Add dueDate at the correct location if ($this->isExpiredDateSettingActivated()) { From ceef8528f7650dc793b1cb25abfb26fc83f33493 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 9 Aug 2024 15:24:16 +0200 Subject: [PATCH 08/19] Update readme --- readme.txt | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/readme.txt b/readme.txt index e7247028..1c061c85 100644 --- a/readme.txt +++ b/readme.txt @@ -2,8 +2,8 @@ Contributors: daanvm, danielhuesken, davdebcom, dinamiko, syde, l.vangunst, ndijkstra, robin-mollie, wido, carmen222, inpsyde-maticluznar Tags: mollie, payments, payment gateway, woocommerce, credit card, apple pay, ideal, bancontact, klarna, sofort, giropay, woocommerce subscriptions Requires at least: 3.8 -Tested up to: 6.5 -Stable tag: 7.5.5 +Tested up to: 6.6 +Stable tag: 7.6.0 Requires PHP: 7.2 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html From 6cf01c38dc6197313c25bac05fe13aa10e97715a Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 16 Aug 2024 09:56:37 +0200 Subject: [PATCH 09/19] fix plugin repo errors --- src/Activation/ActivationModule.php | 20 +---------- src/Gateway/MolliePaymentGateway.php | 2 +- src/Payment/OrderLines.php | 2 +- src/Payment/PaymentModule.php | 2 +- .../CreditcardFieldsStrategy.php | 2 ++ src/PaymentMethods/PaymentMethodsIconUrl.php | 1 + src/Settings/Settings.php | 35 ++++++++++++------- 7 files changed, 29 insertions(+), 35 deletions(-) diff --git a/src/Activation/ActivationModule.php b/src/Activation/ActivationModule.php index 21b75bea..cca3644b 100644 --- a/src/Activation/ActivationModule.php +++ b/src/Activation/ActivationModule.php @@ -83,25 +83,6 @@ public function initDb() public function handleTranslations(): void { add_action('core_upgrade_preamble', 'mollieDeleteWPTranslationFiles'); - add_filter( - 'site_transient_update_plugins', - static function ($value) { - if (isset($value->translations)) { - $i = 0; - foreach ($value->translations as $translation) { - if ( - $translation["slug"] - === "mollie-payments-for-woocommerce" - ) { - unset($value->translations[$i]); - } - $i++; - } - } - - return $value; - } - ); } /** @@ -180,6 +161,7 @@ public function pluginInit() false, dirname(plugin_basename($this->baseFile)) . '/languages/' ); + $this->markUpdatedOrNew(); $this->initDb(); } diff --git a/src/Gateway/MolliePaymentGateway.php b/src/Gateway/MolliePaymentGateway.php index 1ff2cc0c..c096d9e1 100644 --- a/src/Gateway/MolliePaymentGateway.php +++ b/src/Gateway/MolliePaymentGateway.php @@ -887,7 +887,7 @@ public function onOrderReceivedTitle($title, $id = null) ); $order_key = apply_filters( 'woocommerce_thankyou_order_key', - empty($_GET['key']) ? '' : wc_clean(filter_input(INPUT_GET, 'key', FILTER_SANITIZE_SPECIAL_CHARS)) + empty($_GET['key']) ? '' : wc_clean(filter_input(INPUT_GET, 'key', FILTER_SANITIZE_SPECIAL_CHARS))// WPCS: input var ok, CSRF ok. ); if ($order_id > 0) { $order = wc_get_order($order_id); diff --git a/src/Payment/OrderLines.php b/src/Payment/OrderLines.php index 1c76bbf3..7c6957f2 100644 --- a/src/Payment/OrderLines.php +++ b/src/Payment/OrderLines.php @@ -324,7 +324,7 @@ private function get_item_name($cart_item) { $item_name = $cart_item->get_name(); - return html_entity_decode(strip_tags($item_name)); + return html_entity_decode(wp_strip_all_tags($item_name)); } /** diff --git a/src/Payment/PaymentModule.php b/src/Payment/PaymentModule.php index d7c92734..2ea224eb 100644 --- a/src/Payment/PaymentModule.php +++ b/src/Payment/PaymentModule.php @@ -513,7 +513,7 @@ public function IsExpiryDateEnabled($paymentMethods): bool foreach ($paymentMethods as $paymentMethod) { $optionName = "mollie_wc_gateway_{$paymentMethod->getProperty('id')}_settings"; $option = get_option($optionName, false); - if ($option && $option['enabled'] !== 'yes') { + if (!empty($option) && isset($option['enabled']) && $option['enabled'] !== 'yes') { continue; } if (!empty($option["activate_expiry_days_setting"]) && $option["activate_expiry_days_setting"] === 'yes') { diff --git a/src/PaymentMethods/PaymentFieldsStrategies/CreditcardFieldsStrategy.php b/src/PaymentMethods/PaymentFieldsStrategies/CreditcardFieldsStrategy.php index caf56dbf..df682859 100644 --- a/src/PaymentMethods/PaymentFieldsStrategies/CreditcardFieldsStrategy.php +++ b/src/PaymentMethods/PaymentFieldsStrategies/CreditcardFieldsStrategy.php @@ -52,6 +52,7 @@ protected function isMollieComponentsEnabled(PaymentMethodI $paymentMethod): boo protected function lockIcon($dataHelper) { + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- Reading local file is OK. return file_get_contents( $dataHelper->pluginPath() . '/' . 'public/images/lock-icon.svg' ); @@ -59,6 +60,7 @@ protected function lockIcon($dataHelper) protected function mollieLogo($dataHelper) { + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- Reading local file is OK. return file_get_contents( $dataHelper->pluginPath() . '/' . 'public/images/mollie-logo.svg' ); diff --git a/src/PaymentMethods/PaymentMethodsIconUrl.php b/src/PaymentMethods/PaymentMethodsIconUrl.php index 4efba534..11e6e918 100644 --- a/src/PaymentMethods/PaymentMethodsIconUrl.php +++ b/src/PaymentMethods/PaymentMethodsIconUrl.php @@ -189,6 +189,7 @@ public function buildSvgComposed() $cardsWidth ); foreach ($enabledCreditCards as $creditCard) { + // phpcs:ignore WordPress.WP.AlternativeFunctions.file_get_contents_file_get_contents -- Reading local file is OK. $svgString = file_get_contents( $assetsImagesPath . $creditCard ); diff --git a/src/Settings/Settings.php b/src/Settings/Settings.php index eeb7e43f..91cafe02 100644 --- a/src/Settings/Settings.php +++ b/src/Settings/Settings.php @@ -678,24 +678,33 @@ protected function validateUploadedFile(string $fileName, string $fileTempName, protected function processUploadedFile(string $name, string $tempName, WC_Payment_Gateway $gateway) { - $mollieUploadDirectory = trailingslashit(wp_upload_dir()['basedir']) - . 'mollie-uploads/' . $gateway->id; - wp_mkdir_p($mollieUploadDirectory); - $targetLocation = $mollieUploadDirectory . '/'; - $fileName = preg_replace( '#\s+#', '_', $name ); - move_uploaded_file($tempName, $targetLocation . $fileName); - $gatewaySettings["iconFileUrl"] = trailingslashit( - wp_upload_dir()['baseurl'] - ) . 'mollie-uploads/' . $gateway->id . '/' . $fileName; - $gatewaySettings["iconFilePath"] = trailingslashit( - wp_upload_dir()['basedir'] - ) . 'mollie-uploads/' . $gateway->id . '/' . $fileName; - update_option(sprintf('%s_settings', $gateway->id), $gatewaySettings); + if (!function_exists( 'wp_handle_upload')) { + require_once(ABSPATH . 'wp-admin/includes/file.php'); + } + + $upload_overrides = array('test_form' => false); + $file = $_FILES[$gateway->id . '_upload_logo'] ?? []; + if (!empty($file)) { + $file = array( + 'name' => $file['name'], + 'type' => $file['type'], + 'tmp_name' => $file['tmp_name'], + 'error' => $file['error'], + 'size' => $file['size'] + ); + + $movefile = wp_handle_upload($file, $upload_overrides); + if($movefile) { + $gatewaySettings["iconFileUrl"] = $movefile['url']; + $gatewaySettings["iconFilePath"] = $movefile['file']; + update_option(sprintf('%s_settings', $gateway->id), $gatewaySettings); + } + } } } From f7f455a37cc42a03e9e61b04ec03a4970ccfe7f3 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 16 Aug 2024 12:00:38 +0200 Subject: [PATCH 10/19] fix escape output errors --- .../Constraints/AbstractVersionConstraint.php | 2 +- .../Constraints/PluginConstraint.php | 4 ++-- pluginEnvironmentChecker/EnvironmentChecker.php | 2 +- src/Gateway/GatewayModule.php | 3 +-- src/Gateway/MolliePaymentGateway.php | 2 +- src/Log/WcPsrLoggerAdapter.php | 2 +- src/Payment/MollieOrder.php | 4 ++-- src/Payment/OrderItemsRefunder.php | 12 ++++++------ src/Payment/PaymentModule.php | 4 ++-- src/Payment/PaymentService.php | 6 +++--- src/Payment/RefundLineItemsBuilder.php | 11 +++++++++-- src/SDK/Api.php | 4 ++-- src/SDK/WordPressHttpAdapter.php | 12 ++++++------ src/Shared/Data.php | 6 +++--- src/Shared/Status.php | 4 ++-- 15 files changed, 42 insertions(+), 36 deletions(-) diff --git a/pluginEnvironmentChecker/Constraints/AbstractVersionConstraint.php b/pluginEnvironmentChecker/Constraints/AbstractVersionConstraint.php index 80ba90a4..6d36b68b 100644 --- a/pluginEnvironmentChecker/Constraints/AbstractVersionConstraint.php +++ b/pluginEnvironmentChecker/Constraints/AbstractVersionConstraint.php @@ -64,7 +64,7 @@ protected function checkVersion($actualVersion) $this, $actualVersion, [$this->error], - $this->message + esc_html($this->message) ); } } diff --git a/pluginEnvironmentChecker/Constraints/PluginConstraint.php b/pluginEnvironmentChecker/Constraints/PluginConstraint.php index 07634283..259f3680 100644 --- a/pluginEnvironmentChecker/Constraints/PluginConstraint.php +++ b/pluginEnvironmentChecker/Constraints/PluginConstraint.php @@ -38,7 +38,7 @@ public function check() $this, $this->requiredPluginName, [$this->error], - $this->message + esc_html($this->message) ); } @@ -48,7 +48,7 @@ public function check() $this, $this->requiredPluginName, [$this->error], - "Cannot find absolute path to {$this->pluginDisplayName} plugin" + esc_html("Cannot find absolute path to {$this->pluginDisplayName} plugin") ); } if (!function_exists('get_plugin_data')) { diff --git a/pluginEnvironmentChecker/EnvironmentChecker.php b/pluginEnvironmentChecker/EnvironmentChecker.php index d269f73b..1b3da541 100644 --- a/pluginEnvironmentChecker/EnvironmentChecker.php +++ b/pluginEnvironmentChecker/EnvironmentChecker.php @@ -60,6 +60,6 @@ public function check() */ protected function __($string, $params = []) { - return vsprintf($string, $params); + return esc_html(vsprintf($string, $params)); } } diff --git a/src/Gateway/GatewayModule.php b/src/Gateway/GatewayModule.php index 6aaae88b..ed177fec 100644 --- a/src/Gateway/GatewayModule.php +++ b/src/Gateway/GatewayModule.php @@ -833,10 +833,9 @@ public function addBirthdateWhenRest($arrayContext) $context->order->update_meta_data('billing_birthdate', $billingBirthdate); $context->order->save(); } else { - $message = __('Please introduce a valid birthdate number.', 'mollie-payments-for-woocommerce'); throw new RouteException( 'woocommerce_rest_checkout_process_payment_error', - $message, + esc_html__('Please introduce a valid birthdate number.', 'mollie-payments-for-woocommerce'), 402 ); } diff --git a/src/Gateway/MolliePaymentGateway.php b/src/Gateway/MolliePaymentGateway.php index c096d9e1..c8f1343c 100644 --- a/src/Gateway/MolliePaymentGateway.php +++ b/src/Gateway/MolliePaymentGateway.php @@ -688,7 +688,7 @@ protected function activePaymentObject($orderId, $useCache): Payment if ($activePaymentObject === null) { throw new UnexpectedValueException( - "Active Payment Object is not a valid Payment Resource instance. Order ID: {$orderId}" + esc_html__("Active Payment Object is not a valid Payment Resource instance. Order ID: {$orderId}", 'mollie-payments-for-woocommerce') ); } diff --git a/src/Log/WcPsrLoggerAdapter.php b/src/Log/WcPsrLoggerAdapter.php index 781a872f..81b45005 100644 --- a/src/Log/WcPsrLoggerAdapter.php +++ b/src/Log/WcPsrLoggerAdapter.php @@ -80,7 +80,7 @@ public function log($level, $message, array $context = []) } if (\WC_Log_Levels::get_level_severity($wcLevel) < \WC_Log_Levels::get_level_severity($this->loggingLevel)) { - throw new InvalidArgumentException("Unknown log level {$wcLevel}"); + throw new InvalidArgumentException(esc_html__("Unknown log level {$wcLevel}", 'mollie-payments-for-woocommerce')); } if (isset($context['source']) && $context['source'] !== $this-> loggerSource) { diff --git a/src/Payment/MollieOrder.php b/src/Payment/MollieOrder.php index 4b412fc7..40a87a2f 100644 --- a/src/Payment/MollieOrder.php +++ b/src/Payment/MollieOrder.php @@ -713,7 +713,7 @@ public function refund_order_items($order, $orderId, $amount, $items, $paymentOb ); $this->logger->debug(__METHOD__ . " - Order $orderId: " . $noteMessage); - throw new Exception($noteMessage); + throw new Exception(esc_html__($noteMessage, 'mollie-payments-for-woocommerce')); } $this->processOrderItemsRefund( @@ -767,7 +767,7 @@ public function refund_amount($order, $amount, $paymentObject, $reason) ); $order->add_order_note($noteMessage); $this->logger->debug(__METHOD__ . ' - ' . $noteMessage); - throw new Exception($noteMessage); + throw new Exception(esc_html__($noteMessage, 'mollie-payments-for-woocommerce')); } if ($paymentObject->isPaid() || $paymentObject->isShipping() || $paymentObject->isCompleted()) { diff --git a/src/Payment/OrderItemsRefunder.php b/src/Payment/OrderItemsRefunder.php index 330e0c5f..d0330387 100644 --- a/src/Payment/OrderItemsRefunder.php +++ b/src/Payment/OrderItemsRefunder.php @@ -118,7 +118,7 @@ private function normalizedWooCommerceItemsList(array $items) if (!$toRefundItemId) { throw new UnexpectedValueException( - __( + esc_html__( 'One of the WooCommerce order items does not have the refund item ID meta value associated to Mollie Order item.', 'mollie-payments-for-woocommerce' ) @@ -162,12 +162,12 @@ private function normalizedRemoteItems(array $remoteItems) if (!$orderItemId) { throw new UnexpectedValueException( - sprintf( - __( + esc_html__( + sprintf( 'Impossible to retrieve the order item ID related to the remote item: %1$s. Try to do a refund by amount.', - 'mollie-payments-for-woocommerce' + $remoteItem->id ), - $remoteItem->id + 'mollie-payments-for-woocommerce' ) ); } @@ -187,7 +187,7 @@ private function bailIfNoItemsToRefund(array $items, array $remoteItems) { if (empty($items) || empty($remoteItems)) { throw new UnexpectedValueException( - __( + esc_html__( 'Empty WooCommerce order items or mollie order lines.', 'mollie-payments-for-woocommerce' ) diff --git a/src/Payment/PaymentModule.php b/src/Payment/PaymentModule.php index 2ea224eb..661f8999 100644 --- a/src/Payment/PaymentModule.php +++ b/src/Payment/PaymentModule.php @@ -540,14 +540,14 @@ public function orderByRequest() if (!$order) { throw new RuntimeException( - "Could not find order by order Id {$orderId}", + esc_html__("Could not find order by order Id {$orderId}"), 404 ); } if (!$order->key_is_valid($key)) { throw new RuntimeException( - "Invalid key given. Key {$key} does not match the order id: {$orderId}", + esc_html__("Invalid key given. Key {$key} does not match the order id: {$orderId}"), 401 ); } diff --git a/src/Payment/PaymentService.php b/src/Payment/PaymentService.php index c05d7f45..87794c8c 100644 --- a/src/Payment/PaymentService.php +++ b/src/Payment/PaymentService.php @@ -649,7 +649,7 @@ protected function noValidMandateForSubsSwitchFailure($orderId): void ) ); throw new ApiException( - __('Failed switching subscriptions, no valid mandate.', 'mollie-payments-for-woocommerce') + esc_html__('Failed switching subscriptions, no valid mandate.', 'mollie-payments-for-woocommerce') ); } @@ -892,7 +892,7 @@ public function handleMollieOutage(ApiException $e): void ); throw new ApiException( - __( + esc_html__( 'Payment failed due to: Mollie is out of service. Please try again later.', 'mollie-payments-for-woocommerce' ) @@ -915,7 +915,7 @@ public function handleMollieFraudRejection(ApiException $e): void ); throw new ApiException( - __( + esc_html__( 'Payment failed due to: The payment was declined due to suspected fraud.', 'mollie-payments-for-woocommerce' ) diff --git a/src/Payment/RefundLineItemsBuilder.php b/src/Payment/RefundLineItemsBuilder.php index 57ab8914..cc14b1aa 100644 --- a/src/Payment/RefundLineItemsBuilder.php +++ b/src/Payment/RefundLineItemsBuilder.php @@ -59,7 +59,14 @@ public function buildLineItems( if ($toRefundRemoteItem === null) { throw new UnexpectedValueException( - sprintf('Cannot refund %s item because it was not found in Mollie order. Aborting refund process. Try to do a refund by amount.', $toRefundItemId) + esc_html__( + sprintf( + 'Cannot refund %s item because it was not found in Mollie order. Aborting refund process. Try to do a refund by amount.', + $toRefundItemId + + ), + 'mollie-payments-for-woocommerce' + ) ); } @@ -123,7 +130,7 @@ private function buildLineItem( if ($toRefundRemoteItemAmount !== $toRefundItemAmount) { throw new PartialRefundException( - __( + esc_html__( "Mollie doesn't allow a partial refund of the full amount or quantity of at least one order line. Trying to process this as an amount refund instead.", 'mollie-payments-for-woocommerce' ) diff --git a/src/SDK/Api.php b/src/SDK/Api.php index d3526fb7..e7f51468 100644 --- a/src/SDK/Api.php +++ b/src/SDK/Api.php @@ -44,9 +44,9 @@ public function getApiClient($apiKey, $needToUpdateApiKey = false) } if (empty($apiKey)) { - throw new \Mollie\Api\Exceptions\ApiException(__('No API key provided. Please set your Mollie API keys below.', 'mollie-payments-for-woocommerce')); + throw new \Mollie\Api\Exceptions\ApiException(esc_html__('No API key provided. Please set your Mollie API keys below.', 'mollie-payments-for-woocommerce')); } elseif (! preg_match('#^(live|test)_\w{30,}$#', $apiKey)) { - throw new \Mollie\Api\Exceptions\ApiException(sprintf(__("Invalid API key(s). Get them on the %1\$sDevelopers page in the Mollie dashboard%2\$s. The API key(s) must start with 'live_' or 'test_', be at least 30 characters and must not contain any special characters.", 'mollie-payments-for-woocommerce'), '', '')); + throw new \Mollie\Api\Exceptions\ApiException(sprintf(esc_html__("Invalid API key(s). Get them on the %1\$sDevelopers page in the Mollie dashboard%2\$s. The API key(s) must start with 'live_' or 'test_', be at least 30 characters and must not contain any special characters.", 'mollie-payments-for-woocommerce'), '', '')); } if (empty(self::$api_client) || $needToUpdateApiKey) { diff --git a/src/SDK/WordPressHttpAdapter.php b/src/SDK/WordPressHttpAdapter.php index 5337cd0c..aa934640 100644 --- a/src/SDK/WordPressHttpAdapter.php +++ b/src/SDK/WordPressHttpAdapter.php @@ -45,7 +45,7 @@ public function send($httpMethod, $url, $headers, $httpBody) if (is_wp_error($response)) { $message = $response->get_error_message() ?? 'Unknown error'; $code = is_int($response->get_error_code()) ? $response->get_error_code() : 0; - throw new ApiException($message, $code); + throw new ApiException(esc_html__($message), $code); } return $this->parseResponse($response); @@ -70,22 +70,22 @@ protected function parseResponse($response) return null; } - throw new ApiException("No response body found."); + throw new ApiException(esc_html__("No response body found.")); } $body = @json_decode($httpBody); // GUARDS if (json_last_error() !== JSON_ERROR_NONE) { - throw new ApiException("Unable to decode Mollie response: '{$response}'."); + throw new ApiException(esc_html__("Unable to decode Mollie response: '{$response}'.")); } if (isset($body->error)) { - throw new ApiException($body->error->message); + throw new ApiException(esc_html__($body->error->message)); } if ($statusCode >= 400) { - $message = "Error executing API call ({$body->status}: {$body->title}): {$body->detail}"; + $message = esc_html__("Error executing API call ({$body->status}: {$body->title}): {$body->detail}"); $field = null; @@ -101,7 +101,7 @@ protected function parseResponse($response) $message .= ". Request body: {$httpBody}"; } - throw new ApiException($message, $statusCode, $field); + throw new ApiException(esc_html__($message), $statusCode, esc_html__($field)); } return $body; diff --git a/src/Shared/Data.php b/src/Shared/Data.php index cea0c38d..c874942c 100644 --- a/src/Shared/Data.php +++ b/src/Shared/Data.php @@ -270,21 +270,21 @@ public function getFilters( $amountValue = $this->getAmountValue($orderTotal, $currency); if ($amountValue <= 0) { throw new InvalidArgumentException( - sprintf('Amount %s is not valid.', $amountValue) + esc_html__(sprintf('Amount %s is not valid.', $amountValue), 'mollie-payments-for-woocommerce') ); } // Check if currency is in ISO 4217 alpha-3 format (ex: EUR) if (!preg_match('/^[a-zA-Z]{3}$/', $currency)) { throw new InvalidArgumentException( - sprintf('Currency %s is not valid.', $currency) + esc_html__(sprintf('Currency %s is not valid.', $currency), 'mollie-payments-for-woocommerce') ); } // Check if billing country is in ISO 3166-1 alpha-2 format (ex: NL) if (!preg_match('/^[a-zA-Z]{2}$/', $billingCountry)) { throw new InvalidArgumentException( - sprintf('Billing Country %s is not valid.', $billingCountry) + esc_html__(sprintf('Billing Country %s is not valid.', $billingCountry), 'mollie-payments-for-woocommerce') ); } diff --git a/src/Shared/Status.php b/src/Shared/Status.php index e7a9cde1..a20697f8 100644 --- a/src/Shared/Status.php +++ b/src/Shared/Status.php @@ -190,12 +190,12 @@ public function getMollieApiStatus($apiClient) } catch (\Mollie\Api\Exceptions\ApiException $apiException) { if ($apiException->getMessage() === 'Error executing API call (401: Unauthorized Request): Missing authentication, or failed to authenticate. Documentation: https://docs.mollie.com/guides/authentication') { throw new \Mollie\Api\Exceptions\ApiException( - 'incorrect API key or other authentication issue. Please check your API keys!' + esc_html__('incorrect API key or other authentication issue. Please check your API keys!', 'mollie-payments-for-woocommerce') ); } throw new \Mollie\Api\Exceptions\ApiException( - $apiException->getMessage() + esc_html__($apiException->getMessage(), 'mollie-payments-for-woocommerce') ); } } From f88f0056274cc28f1031cca531b14e89d7ab2a8f Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 16 Aug 2024 12:05:08 +0200 Subject: [PATCH 11/19] fix escape output errors --- src/Payment/PaymentModule.php | 4 ++-- src/SDK/Api.php | 13 +++++++++++-- src/SDK/WordPressHttpAdapter.php | 12 ++++++------ 3 files changed, 19 insertions(+), 10 deletions(-) diff --git a/src/Payment/PaymentModule.php b/src/Payment/PaymentModule.php index 661f8999..4d2e8e7d 100644 --- a/src/Payment/PaymentModule.php +++ b/src/Payment/PaymentModule.php @@ -540,14 +540,14 @@ public function orderByRequest() if (!$order) { throw new RuntimeException( - esc_html__("Could not find order by order Id {$orderId}"), + esc_html("Could not find order by order Id {$orderId}"), 404 ); } if (!$order->key_is_valid($key)) { throw new RuntimeException( - esc_html__("Invalid key given. Key {$key} does not match the order id: {$orderId}"), + esc_html("Invalid key given. Key {$key} does not match the order id: {$orderId}"), 401 ); } diff --git a/src/SDK/Api.php b/src/SDK/Api.php index e7f51468..7b50e77a 100644 --- a/src/SDK/Api.php +++ b/src/SDK/Api.php @@ -45,8 +45,17 @@ public function getApiClient($apiKey, $needToUpdateApiKey = false) if (empty($apiKey)) { throw new \Mollie\Api\Exceptions\ApiException(esc_html__('No API key provided. Please set your Mollie API keys below.', 'mollie-payments-for-woocommerce')); - } elseif (! preg_match('#^(live|test)_\w{30,}$#', $apiKey)) { - throw new \Mollie\Api\Exceptions\ApiException(sprintf(esc_html__("Invalid API key(s). Get them on the %1\$sDevelopers page in the Mollie dashboard%2\$s. The API key(s) must start with 'live_' or 'test_', be at least 30 characters and must not contain any special characters.", 'mollie-payments-for-woocommerce'), '', '')); + } elseif (!preg_match('#^(live|test)_\w{30,}$#', $apiKey)) { + throw new \Mollie\Api\Exceptions\ApiException( + esc_html__( + sprintf( + "Invalid API key(s). Get them on the %1\$sDevelopers page in the Mollie dashboard%2\$s. The API key(s) must start with 'live_' or 'test_', be at least 30 characters and must not contain any special characters.", + '', + '' + ), + 'mollie-payments-for-woocommerce' + ) + ); } if (empty(self::$api_client) || $needToUpdateApiKey) { diff --git a/src/SDK/WordPressHttpAdapter.php b/src/SDK/WordPressHttpAdapter.php index aa934640..b39d4ce0 100644 --- a/src/SDK/WordPressHttpAdapter.php +++ b/src/SDK/WordPressHttpAdapter.php @@ -45,7 +45,7 @@ public function send($httpMethod, $url, $headers, $httpBody) if (is_wp_error($response)) { $message = $response->get_error_message() ?? 'Unknown error'; $code = is_int($response->get_error_code()) ? $response->get_error_code() : 0; - throw new ApiException(esc_html__($message), $code); + throw new ApiException(esc_html($message), $code); } return $this->parseResponse($response); @@ -70,22 +70,22 @@ protected function parseResponse($response) return null; } - throw new ApiException(esc_html__("No response body found.")); + throw new ApiException(esc_html("No response body found.")); } $body = @json_decode($httpBody); // GUARDS if (json_last_error() !== JSON_ERROR_NONE) { - throw new ApiException(esc_html__("Unable to decode Mollie response: '{$response}'.")); + throw new ApiException(esc_html("Unable to decode Mollie response: '{$response}'.")); } if (isset($body->error)) { - throw new ApiException(esc_html__($body->error->message)); + throw new ApiException(esc_html($body->error->message)); } if ($statusCode >= 400) { - $message = esc_html__("Error executing API call ({$body->status}: {$body->title}): {$body->detail}"); + $message = esc_html("Error executing API call ({$body->status}: {$body->title}): {$body->detail}"); $field = null; @@ -101,7 +101,7 @@ protected function parseResponse($response) $message .= ". Request body: {$httpBody}"; } - throw new ApiException(esc_html__($message), $statusCode, esc_html__($field)); + throw new ApiException(esc_html($message), $statusCode, esc_html($field)); } return $body; From 456b2a8d12b576a9e1dbe87433e6c47a877e615e Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 16 Aug 2024 12:34:35 +0200 Subject: [PATCH 12/19] fix cs --- src/Assets/AssetsModule.php | 2 +- src/Gateway/GatewayModule.php | 1 + src/Payment/MollieOrder.php | 3 --- src/Payment/OrderLines.php | 2 +- src/Payment/RefundLineItemsBuilder.php | 3 +-- src/PaymentMethods/Banktransfer.php | 2 +- src/SDK/Api.php | 10 +++++----- src/Settings/Settings.php | 15 ++++++++------- src/Shared/Data.php | 8 ++++---- src/Shared/Status.php | 6 ++---- 10 files changed, 24 insertions(+), 28 deletions(-) diff --git a/src/Assets/AssetsModule.php b/src/Assets/AssetsModule.php index ff9f5a66..9cb2e361 100644 --- a/src/Assets/AssetsModule.php +++ b/src/Assets/AssetsModule.php @@ -247,7 +247,7 @@ protected function registerFrontendScripts(string $pluginUrl, string $pluginPath (string) filemtime($this->getPluginPath($pluginPath, '/public/js/applepayDirectCart.min.js')), true ); - wp_register_script('mollie', 'https://js.mollie.com/v1/mollie.js', [],gmdate("d"), true); + wp_register_script('mollie', 'https://js.mollie.com/v1/mollie.js', [], gmdate("d"), true); wp_register_script( 'mollie-components', $this->getPluginUrl($pluginUrl, '/public/js/mollie-components.min.js'), diff --git a/src/Gateway/GatewayModule.php b/src/Gateway/GatewayModule.php index ed177fec..6469639a 100644 --- a/src/Gateway/GatewayModule.php +++ b/src/Gateway/GatewayModule.php @@ -752,6 +752,7 @@ public function addPaymentMethodMandatoryFieldsPhoneVerification( string $fieldLabel, $errors ) { + if ($fields['payment_method'] !== $gatewayName) { return $fields; } diff --git a/src/Payment/MollieOrder.php b/src/Payment/MollieOrder.php index 40a87a2f..55da66c7 100644 --- a/src/Payment/MollieOrder.php +++ b/src/Payment/MollieOrder.php @@ -22,7 +22,6 @@ class MollieOrder extends MollieObject public const ACTION_AFTER_REFUND_AMOUNT_CREATED = 'mollie-payments-for-woocommerce' . '_refund_amount_created'; public const ACTION_AFTER_REFUND_ORDER_CREATED = 'mollie-payments-for-woocommerce' . '_refund_order_created'; - protected static $paymentId; protected static $customerId; protected static $order; @@ -826,8 +825,6 @@ public function updatePaymentDataWithOrderData($order, $orderId) } } - - /** * @param WC_Order $order * @param $newOrderStatus diff --git a/src/Payment/OrderLines.php b/src/Payment/OrderLines.php index 7c6957f2..e70f72ed 100644 --- a/src/Payment/OrderLines.php +++ b/src/Payment/OrderLines.php @@ -75,7 +75,7 @@ private function process_missmatch() { $orderTotal = (float) $this->order->get_total(); $orderTotalRounded = round($orderTotal, 2); - $linesTotal = array_sum(array_map(function ($line) { + $linesTotal = array_sum(array_map(static function ($line) { return $line['totalAmount']['value']; }, $this->order_lines)); $orderTotalDiff = $orderTotalRounded - $linesTotal; diff --git a/src/Payment/RefundLineItemsBuilder.php b/src/Payment/RefundLineItemsBuilder.php index cc14b1aa..b93b2cd8 100644 --- a/src/Payment/RefundLineItemsBuilder.php +++ b/src/Payment/RefundLineItemsBuilder.php @@ -63,8 +63,7 @@ public function buildLineItems( sprintf( 'Cannot refund %s item because it was not found in Mollie order. Aborting refund process. Try to do a refund by amount.', $toRefundItemId - - ), + ), 'mollie-payments-for-woocommerce' ) ); diff --git a/src/PaymentMethods/Banktransfer.php b/src/PaymentMethods/Banktransfer.php index 6b4a58da..93a6f3f1 100644 --- a/src/PaymentMethods/Banktransfer.php +++ b/src/PaymentMethods/Banktransfer.php @@ -96,7 +96,7 @@ public function addPaymentArguments(array $args, WC_Order $order) $expiry_days = (int)$this->getProperty(self::EXPIRY_DAYS_OPTION) ?: self::EXPIRY_DEFAULT_DAYS; if ($expiry_days >= self::EXPIRY_MIN_DAYS && $expiry_days <= self::EXPIRY_MAX_DAYS) { - $expiry_date =gmdate("Y-m-d", strtotime(sprintf('+%s days', $expiry_days))); + $expiry_date = gmdate("Y-m-d", strtotime(sprintf('+%s days', $expiry_days))); // Add dueDate at the correct location if ($this->isExpiredDateSettingActivated()) { diff --git a/src/SDK/Api.php b/src/SDK/Api.php index 7b50e77a..d4726ecd 100644 --- a/src/SDK/Api.php +++ b/src/SDK/Api.php @@ -47,13 +47,13 @@ public function getApiClient($apiKey, $needToUpdateApiKey = false) throw new \Mollie\Api\Exceptions\ApiException(esc_html__('No API key provided. Please set your Mollie API keys below.', 'mollie-payments-for-woocommerce')); } elseif (!preg_match('#^(live|test)_\w{30,}$#', $apiKey)) { throw new \Mollie\Api\Exceptions\ApiException( - esc_html__( - sprintf( + sprintf( + esc_html__( "Invalid API key(s). Get them on the %1\$sDevelopers page in the Mollie dashboard%2\$s. The API key(s) must start with 'live_' or 'test_', be at least 30 characters and must not contain any special characters.", - '', - '' + 'mollie-payments-for-woocommerce' ), - 'mollie-payments-for-woocommerce' + '', + '' ) ); } diff --git a/src/Settings/Settings.php b/src/Settings/Settings.php index 91cafe02..e8335a01 100644 --- a/src/Settings/Settings.php +++ b/src/Settings/Settings.php @@ -684,23 +684,24 @@ protected function processUploadedFile(string $name, string $tempName, WC_Paymen $name ); - if (!function_exists( 'wp_handle_upload')) { + if (!function_exists('wp_handle_upload')) { require_once(ABSPATH . 'wp-admin/includes/file.php'); } - $upload_overrides = array('test_form' => false); - $file = $_FILES[$gateway->id . '_upload_logo'] ?? []; + $upload_overrides = ['test_form' => false]; + // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized + $file = wp_unslash($_FILES[$gateway->id . '_upload_logo']) ?? []; if (!empty($file)) { - $file = array( + $file = [ 'name' => $file['name'], 'type' => $file['type'], 'tmp_name' => $file['tmp_name'], 'error' => $file['error'], - 'size' => $file['size'] - ); + 'size' => $file['size'], + ]; $movefile = wp_handle_upload($file, $upload_overrides); - if($movefile) { + if ($movefile) { $gatewaySettings["iconFileUrl"] = $movefile['url']; $gatewaySettings["iconFilePath"] = $movefile['file']; update_option(sprintf('%s_settings', $gateway->id), $gatewaySettings); diff --git a/src/Shared/Data.php b/src/Shared/Data.php index c874942c..63ea42b3 100644 --- a/src/Shared/Data.php +++ b/src/Shared/Data.php @@ -270,21 +270,21 @@ public function getFilters( $amountValue = $this->getAmountValue($orderTotal, $currency); if ($amountValue <= 0) { throw new InvalidArgumentException( - esc_html__(sprintf('Amount %s is not valid.', $amountValue), 'mollie-payments-for-woocommerce') + sprintf(esc_html__('Amount %s is not valid.', 'mollie-payments-for-woocommerce'), $amountValue) ); } // Check if currency is in ISO 4217 alpha-3 format (ex: EUR) if (!preg_match('/^[a-zA-Z]{3}$/', $currency)) { throw new InvalidArgumentException( - esc_html__(sprintf('Currency %s is not valid.', $currency), 'mollie-payments-for-woocommerce') + sprintf(esc_html__('Currency %s is not valid.','mollie-payments-for-woocommerce'), $currency) ); } // Check if billing country is in ISO 3166-1 alpha-2 format (ex: NL) if (!preg_match('/^[a-zA-Z]{2}$/', $billingCountry)) { throw new InvalidArgumentException( - esc_html__(sprintf('Billing Country %s is not valid.', $billingCountry), 'mollie-payments-for-woocommerce') + sprintf(esc_html__('Billing Country %s is not valid.', 'mollie-payments-for-woocommerce'), $billingCountry) ); } @@ -315,7 +315,7 @@ public function getRegularPaymentMethods($apiKey, $testMode = false, $useCache = $testMode = $this->isTestModeEnabled(); $methods = $this->getAllAvailablePaymentMethods($useCache); // We cannot access allActive for all methods so we filter them out here - $filtered_methods = array_filter($methods, function ($method) use ($testMode) { + $filtered_methods = array_filter($methods, static function ($method) use ($testMode) { if ($testMode === "live") { return $method['status'] === "activated"; } else { diff --git a/src/Shared/Status.php b/src/Shared/Status.php index a20697f8..6120476f 100644 --- a/src/Shared/Status.php +++ b/src/Shared/Status.php @@ -193,10 +193,8 @@ public function getMollieApiStatus($apiClient) esc_html__('incorrect API key or other authentication issue. Please check your API keys!', 'mollie-payments-for-woocommerce') ); } - - throw new \Mollie\Api\Exceptions\ApiException( - esc_html__($apiException->getMessage(), 'mollie-payments-for-woocommerce') - ); + $message = esc_html($apiException->getMessage()); + throw new \Mollie\Api\Exceptions\ApiException($message); } } } From 35af277627c72b982e17fa566de9cde02e3d76e7 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Fri, 16 Aug 2024 12:54:02 +0200 Subject: [PATCH 13/19] fix cs --- src/Gateway/MolliePaymentGateway.php | 2 +- src/Log/WcPsrLoggerAdapter.php | 3 ++- src/Payment/MollieOrder.php | 4 ++-- src/Payment/OrderItemsRefunder.php | 8 ++++---- src/Payment/RefundLineItemsBuilder.php | 8 ++++---- src/Settings/Settings.php | 2 +- src/Shared/Data.php | 2 +- 7 files changed, 15 insertions(+), 14 deletions(-) diff --git a/src/Gateway/MolliePaymentGateway.php b/src/Gateway/MolliePaymentGateway.php index c8f1343c..5f34cf86 100644 --- a/src/Gateway/MolliePaymentGateway.php +++ b/src/Gateway/MolliePaymentGateway.php @@ -688,7 +688,7 @@ protected function activePaymentObject($orderId, $useCache): Payment if ($activePaymentObject === null) { throw new UnexpectedValueException( - esc_html__("Active Payment Object is not a valid Payment Resource instance. Order ID: {$orderId}", 'mollie-payments-for-woocommerce') + esc_html(sprintf("Active Payment Object is not a valid Payment Resource instance. Order ID: %s", $orderId)) ); } diff --git a/src/Log/WcPsrLoggerAdapter.php b/src/Log/WcPsrLoggerAdapter.php index 81b45005..725bed75 100644 --- a/src/Log/WcPsrLoggerAdapter.php +++ b/src/Log/WcPsrLoggerAdapter.php @@ -80,7 +80,8 @@ public function log($level, $message, array $context = []) } if (\WC_Log_Levels::get_level_severity($wcLevel) < \WC_Log_Levels::get_level_severity($this->loggingLevel)) { - throw new InvalidArgumentException(esc_html__("Unknown log level {$wcLevel}", 'mollie-payments-for-woocommerce')); + $message = sprintf("Unknown log level %s", $wcLevel); + throw new InvalidArgumentException(esc_html($message)); } if (isset($context['source']) && $context['source'] !== $this-> loggerSource) { diff --git a/src/Payment/MollieOrder.php b/src/Payment/MollieOrder.php index 55da66c7..db4b95a8 100644 --- a/src/Payment/MollieOrder.php +++ b/src/Payment/MollieOrder.php @@ -712,7 +712,7 @@ public function refund_order_items($order, $orderId, $amount, $items, $paymentOb ); $this->logger->debug(__METHOD__ . " - Order $orderId: " . $noteMessage); - throw new Exception(esc_html__($noteMessage, 'mollie-payments-for-woocommerce')); + throw new Exception(esc_html(sprintf("%s", $noteMessage))); } $this->processOrderItemsRefund( @@ -766,7 +766,7 @@ public function refund_amount($order, $amount, $paymentObject, $reason) ); $order->add_order_note($noteMessage); $this->logger->debug(__METHOD__ . ' - ' . $noteMessage); - throw new Exception(esc_html__($noteMessage, 'mollie-payments-for-woocommerce')); + throw new Exception(esc_html(sprintf("%s", $noteMessage))); } if ($paymentObject->isPaid() || $paymentObject->isShipping() || $paymentObject->isCompleted()) { diff --git a/src/Payment/OrderItemsRefunder.php b/src/Payment/OrderItemsRefunder.php index d0330387..1e4dc808 100644 --- a/src/Payment/OrderItemsRefunder.php +++ b/src/Payment/OrderItemsRefunder.php @@ -162,12 +162,12 @@ private function normalizedRemoteItems(array $remoteItems) if (!$orderItemId) { throw new UnexpectedValueException( - esc_html__( - sprintf( + sprintf( + esc_html__( 'Impossible to retrieve the order item ID related to the remote item: %1$s. Try to do a refund by amount.', - $remoteItem->id + 'mollie-payments-for-woocommerce' ), - 'mollie-payments-for-woocommerce' + $remoteItem->id ) ); } diff --git a/src/Payment/RefundLineItemsBuilder.php b/src/Payment/RefundLineItemsBuilder.php index b93b2cd8..b2755993 100644 --- a/src/Payment/RefundLineItemsBuilder.php +++ b/src/Payment/RefundLineItemsBuilder.php @@ -59,12 +59,12 @@ public function buildLineItems( if ($toRefundRemoteItem === null) { throw new UnexpectedValueException( - esc_html__( - sprintf( + sprintf( + esc_html__( 'Cannot refund %s item because it was not found in Mollie order. Aborting refund process. Try to do a refund by amount.', - $toRefundItemId + 'mollie-payments-for-woocommerce' ), - 'mollie-payments-for-woocommerce' + $toRefundItemId ) ); } diff --git a/src/Settings/Settings.php b/src/Settings/Settings.php index e8335a01..f96afaf9 100644 --- a/src/Settings/Settings.php +++ b/src/Settings/Settings.php @@ -690,7 +690,7 @@ protected function processUploadedFile(string $name, string $tempName, WC_Paymen $upload_overrides = ['test_form' => false]; // phpcs:ignore WordPress.Security.ValidatedSanitizedInput.InputNotSanitized - $file = wp_unslash($_FILES[$gateway->id . '_upload_logo']) ?? []; + $file = isset($_FILES[$gateway->id . '_upload_logo']) ? wp_unslash($_FILES[$gateway->id . '_upload_logo']) : []; if (!empty($file)) { $file = [ 'name' => $file['name'], diff --git a/src/Shared/Data.php b/src/Shared/Data.php index 63ea42b3..7175859a 100644 --- a/src/Shared/Data.php +++ b/src/Shared/Data.php @@ -277,7 +277,7 @@ public function getFilters( // Check if currency is in ISO 4217 alpha-3 format (ex: EUR) if (!preg_match('/^[a-zA-Z]{3}$/', $currency)) { throw new InvalidArgumentException( - sprintf(esc_html__('Currency %s is not valid.','mollie-payments-for-woocommerce'), $currency) + sprintf(esc_html__('Currency %s is not valid.', 'mollie-payments-for-woocommerce'), $currency) ); } From b1053c44a056152b79dfc542dc9aa5696e71f0a7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carmen=20Maym=C3=B3?= <45061744+mmaymo@users.noreply.github.com> Date: Mon, 19 Aug 2024 10:57:34 +0200 Subject: [PATCH 14/19] Update src/Payment/MollieOrder.php MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Moritz Meißelbach --- src/Payment/MollieOrder.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Payment/MollieOrder.php b/src/Payment/MollieOrder.php index db4b95a8..d68aba9f 100644 --- a/src/Payment/MollieOrder.php +++ b/src/Payment/MollieOrder.php @@ -1011,7 +1011,7 @@ protected function getCustomerBirthdate($order) return null; } $format = "Y-m-d"; - returngmdate($format, (int) strtotime($fieldPosted)); + return gmdate($format, (int) strtotime($fieldPosted)); } return null; } From 1743a337be2f9ccdfd453bf59a0d3e78eab591bd Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 19 Aug 2024 11:38:24 +0200 Subject: [PATCH 15/19] Roll back to current modularity version --- composer.json | 2 +- composer.lock | 624 +++++++++++++++++++++++++------------------------- 2 files changed, 317 insertions(+), 309 deletions(-) diff --git a/composer.json b/composer.json index aa3c19e2..0fbd7da9 100644 --- a/composer.json +++ b/composer.json @@ -23,7 +23,7 @@ "psr/log":"^1.1.4" }, "require-dev": { - "inpsyde/modularity": "^1.8.0", + "inpsyde/modularity": "^1.3.0", "psr/container": "1.0.0", "phpunit/phpunit": "^8", "brain/monkey": "^2.3", diff --git a/composer.lock b/composer.lock index f905d204..e9c88ffc 100644 --- a/composer.lock +++ b/composer.lock @@ -8,28 +8,28 @@ "packages": [ { "name": "composer/ca-bundle", - "version": "1.3.6", + "version": "1.5.1", "source": { "type": "git", "url": "https://github.com/composer/ca-bundle.git", - "reference": "90d087e988ff194065333d16bc5cf649872d9cdb" + "reference": "063d9aa8696582f5a41dffbbaf3c81024f0a604a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/ca-bundle/zipball/90d087e988ff194065333d16bc5cf649872d9cdb", - "reference": "90d087e988ff194065333d16bc5cf649872d9cdb", + "url": "https://api.github.com/repos/composer/ca-bundle/zipball/063d9aa8696582f5a41dffbbaf3c81024f0a604a", + "reference": "063d9aa8696582f5a41dffbbaf3c81024f0a604a", "shasum": "" }, "require": { "ext-openssl": "*", "ext-pcre": "*", - "php": "^5.3.2 || ^7.0 || ^8.0" + "php": "^7.2 || ^8.0" }, "require-dev": { - "phpstan/phpstan": "^0.12.55", - "psr/log": "^1.0", + "phpstan/phpstan": "^1.10", + "psr/log": "^1.0 || ^2.0 || ^3.0", "symfony/phpunit-bridge": "^4.2 || ^5", - "symfony/process": "^2.5 || ^3.0 || ^4.0 || ^5.0 || ^6.0" + "symfony/process": "^4.0 || ^5.0 || ^6.0 || ^7.0" }, "type": "library", "extra": { @@ -64,7 +64,7 @@ "support": { "irc": "irc://irc.freenode.org/composer", "issues": "https://github.com/composer/ca-bundle/issues", - "source": "https://github.com/composer/ca-bundle/tree/1.3.6" + "source": "https://github.com/composer/ca-bundle/tree/1.5.1" }, "funding": [ { @@ -80,20 +80,20 @@ "type": "tidelift" } ], - "time": "2023-06-06T12:02:59+00:00" + "time": "2024-07-08T15:28:20+00:00" }, { "name": "mollie/mollie-api-php", - "version": "v2.61.0", + "version": "v2.71.0", "source": { "type": "git", "url": "https://github.com/mollie/mollie-api-php.git", - "reference": "d3ec7a191985aa57bec9b4425a665e95b4ba346a" + "reference": "dff324f0621ff134fbefffa42ee511833a58578f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/d3ec7a191985aa57bec9b4425a665e95b4ba346a", - "reference": "d3ec7a191985aa57bec9b4425a665e95b4ba346a", + "url": "https://api.github.com/repos/mollie/mollie-api-php/zipball/dff324f0621ff134fbefffa42ee511833a58578f", + "reference": "dff324f0621ff134fbefffa42ee511833a58578f", "shasum": "" }, "require": { @@ -170,9 +170,9 @@ ], "support": { "issues": "https://github.com/mollie/mollie-api-php/issues", - "source": "https://github.com/mollie/mollie-api-php/tree/v2.61.0" + "source": "https://github.com/mollie/mollie-api-php/tree/v2.71.0" }, - "time": "2023-07-31T15:37:46+00:00" + "time": "2024-07-17T08:02:14+00:00" }, { "name": "psr/log", @@ -228,16 +228,16 @@ "packages-dev": [ { "name": "amphp/amp", - "version": "v2.6.2", + "version": "v2.6.4", "source": { "type": "git", "url": "https://github.com/amphp/amp.git", - "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb" + "reference": "ded3d9be08f526089eb7ee8d9f16a9768f9dec2d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/amp/zipball/9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", - "reference": "9d5100cebffa729aaffecd3ad25dc5aeea4f13bb", + "url": "https://api.github.com/repos/amphp/amp/zipball/ded3d9be08f526089eb7ee8d9f16a9768f9dec2d", + "reference": "ded3d9be08f526089eb7ee8d9f16a9768f9dec2d", "shasum": "" }, "require": { @@ -249,8 +249,8 @@ "ext-json": "*", "jetbrains/phpstorm-stubs": "^2019.3", "phpunit/phpunit": "^7 | ^8 | ^9", - "psalm/phar": "^3.11@dev", - "react/promise": "^2" + "react/promise": "^2", + "vimeo/psalm": "^3.12" }, "type": "library", "extra": { @@ -305,7 +305,7 @@ "support": { "irc": "irc://irc.freenode.org/amphp", "issues": "https://github.com/amphp/amp/issues", - "source": "https://github.com/amphp/amp/tree/v2.6.2" + "source": "https://github.com/amphp/amp/tree/v2.6.4" }, "funding": [ { @@ -313,20 +313,20 @@ "type": "github" } ], - "time": "2022-02-20T17:52:18+00:00" + "time": "2024-03-21T18:52:26+00:00" }, { "name": "amphp/byte-stream", - "version": "v1.8.1", + "version": "v1.8.2", "source": { "type": "git", "url": "https://github.com/amphp/byte-stream.git", - "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd" + "reference": "4f0e968ba3798a423730f567b1b50d3441c16ddc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/amphp/byte-stream/zipball/acbd8002b3536485c997c4e019206b3f10ca15bd", - "reference": "acbd8002b3536485c997c4e019206b3f10ca15bd", + "url": "https://api.github.com/repos/amphp/byte-stream/zipball/4f0e968ba3798a423730f567b1b50d3441c16ddc", + "reference": "4f0e968ba3798a423730f567b1b50d3441c16ddc", "shasum": "" }, "require": { @@ -342,11 +342,6 @@ "psalm/phar": "^3.11.4" }, "type": "library", - "extra": { - "branch-alias": { - "dev-master": "1.x-dev" - } - }, "autoload": { "files": [ "lib/functions.php" @@ -370,7 +365,7 @@ } ], "description": "A stream abstraction to make working with non-blocking I/O simple.", - "homepage": "http://amphp.org/byte-stream", + "homepage": "https://amphp.org/byte-stream", "keywords": [ "amp", "amphp", @@ -380,9 +375,8 @@ "stream" ], "support": { - "irc": "irc://irc.freenode.org/amphp", "issues": "https://github.com/amphp/byte-stream/issues", - "source": "https://github.com/amphp/byte-stream/tree/v1.8.1" + "source": "https://github.com/amphp/byte-stream/tree/v1.8.2" }, "funding": [ { @@ -390,20 +384,20 @@ "type": "github" } ], - "time": "2021-03-30T17:13:30+00:00" + "time": "2024-04-13T18:00:56+00:00" }, { "name": "antecedent/patchwork", - "version": "2.1.25", + "version": "2.1.28", "source": { "type": "git", "url": "https://github.com/antecedent/patchwork.git", - "reference": "17314e042d45e0dacb0a494c2d1ef50e7621136a" + "reference": "6b30aff81ebadf0f2feb9268d3e08385cebcc08d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/antecedent/patchwork/zipball/17314e042d45e0dacb0a494c2d1ef50e7621136a", - "reference": "17314e042d45e0dacb0a494c2d1ef50e7621136a", + "url": "https://api.github.com/repos/antecedent/patchwork/zipball/6b30aff81ebadf0f2feb9268d3e08385cebcc08d", + "reference": "6b30aff81ebadf0f2feb9268d3e08385cebcc08d", "shasum": "" }, "require": { @@ -424,7 +418,7 @@ } ], "description": "Method redefinition (monkey-patching) functionality for PHP.", - "homepage": "http://patchwork2.org/", + "homepage": "https://antecedent.github.io/patchwork/", "keywords": [ "aop", "aspect", @@ -436,9 +430,9 @@ ], "support": { "issues": "https://github.com/antecedent/patchwork/issues", - "source": "https://github.com/antecedent/patchwork/tree/2.1.25" + "source": "https://github.com/antecedent/patchwork/tree/2.1.28" }, - "time": "2023-02-19T12:51:24+00:00" + "time": "2024-02-06T09:26:11+00:00" }, { "name": "automattic/phpcs-neutron-standard", @@ -684,30 +678,38 @@ }, { "name": "composer/pcre", - "version": "2.1.0", + "version": "2.2.0", "source": { "type": "git", "url": "https://github.com/composer/pcre.git", - "reference": "3fdb2807b31a78a40ad89570e30ec77466c98717" + "reference": "0e455b78ac53637929b29d5ab5bf3c978329c1eb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/pcre/zipball/3fdb2807b31a78a40ad89570e30ec77466c98717", - "reference": "3fdb2807b31a78a40ad89570e30ec77466c98717", + "url": "https://api.github.com/repos/composer/pcre/zipball/0e455b78ac53637929b29d5ab5bf3c978329c1eb", + "reference": "0e455b78ac53637929b29d5ab5bf3c978329c1eb", "shasum": "" }, "require": { "php": "^7.2 || ^8.0" }, + "conflict": { + "phpstan/phpstan": "<1.11.8" + }, "require-dev": { - "phpstan/phpstan": "^1.3", + "phpstan/phpstan": "^1.11.8", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^5" + "phpunit/phpunit": "^8 || ^9" }, "type": "library", "extra": { "branch-alias": { "dev-main": "2.x-dev" + }, + "phpstan": { + "includes": [ + "extension.neon" + ] } }, "autoload": { @@ -735,7 +737,7 @@ ], "support": { "issues": "https://github.com/composer/pcre/issues", - "source": "https://github.com/composer/pcre/tree/2.1.0" + "source": "https://github.com/composer/pcre/tree/2.2.0" }, "funding": [ { @@ -751,20 +753,20 @@ "type": "tidelift" } ], - "time": "2022-11-16T18:32:04+00:00" + "time": "2024-07-25T09:28:32+00:00" }, { "name": "composer/semver", - "version": "3.3.2", + "version": "3.4.2", "source": { "type": "git", "url": "https://github.com/composer/semver.git", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9" + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/semver/zipball/3953f23262f2bff1919fc82183ad9acb13ff62c9", - "reference": "3953f23262f2bff1919fc82183ad9acb13ff62c9", + "url": "https://api.github.com/repos/composer/semver/zipball/c51258e759afdb17f1fd1fe83bc12baaef6309d6", + "reference": "c51258e759afdb17f1fd1fe83bc12baaef6309d6", "shasum": "" }, "require": { @@ -814,9 +816,9 @@ "versioning" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/semver/issues", - "source": "https://github.com/composer/semver/tree/3.3.2" + "source": "https://github.com/composer/semver/tree/3.4.2" }, "funding": [ { @@ -832,20 +834,20 @@ "type": "tidelift" } ], - "time": "2022-04-01T19:23:25+00:00" + "time": "2024-07-12T11:35:52+00:00" }, { "name": "composer/xdebug-handler", - "version": "3.0.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/composer/xdebug-handler.git", - "reference": "ced299686f41dce890debac69273b47ffe98a40c" + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/ced299686f41dce890debac69273b47ffe98a40c", - "reference": "ced299686f41dce890debac69273b47ffe98a40c", + "url": "https://api.github.com/repos/composer/xdebug-handler/zipball/6c1925561632e83d60a44492e0b344cf48ab85ef", + "reference": "6c1925561632e83d60a44492e0b344cf48ab85ef", "shasum": "" }, "require": { @@ -856,7 +858,7 @@ "require-dev": { "phpstan/phpstan": "^1.0", "phpstan/phpstan-strict-rules": "^1.1", - "symfony/phpunit-bridge": "^6.0" + "phpunit/phpunit": "^8.5 || ^9.6 || ^10.5" }, "type": "library", "autoload": { @@ -880,9 +882,9 @@ "performance" ], "support": { - "irc": "irc://irc.freenode.org/composer", + "irc": "ircs://irc.libera.chat:6697/composer", "issues": "https://github.com/composer/xdebug-handler/issues", - "source": "https://github.com/composer/xdebug-handler/tree/3.0.3" + "source": "https://github.com/composer/xdebug-handler/tree/3.0.5" }, "funding": [ { @@ -898,7 +900,7 @@ "type": "tidelift" } ], - "time": "2022-02-25T21:32:43+00:00" + "time": "2024-05-06T16:37:16+00:00" }, { "name": "dealerdirect/phpcodesniffer-composer-installer", @@ -1291,16 +1293,16 @@ }, { "name": "inpsyde/composer-assets-compiler", - "version": "2.5.2", + "version": "2.5.3", "source": { "type": "git", "url": "https://github.com/inpsyde/composer-asset-compiler.git", - "reference": "26a4062c2171ac09492e684eb3e4462ec69cf3a6" + "reference": "3db3bea66088421377b725d110bd16ee23716c05" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/inpsyde/composer-asset-compiler/zipball/26a4062c2171ac09492e684eb3e4462ec69cf3a6", - "reference": "26a4062c2171ac09492e684eb3e4462ec69cf3a6", + "url": "https://api.github.com/repos/inpsyde/composer-asset-compiler/zipball/3db3bea66088421377b725d110bd16ee23716c05", + "reference": "3db3bea66088421377b725d110bd16ee23716c05", "shasum": "" }, "require": { @@ -1314,7 +1316,7 @@ "mikey179/vfsstream": "^1.6.10", "mockery/mockery": "^1.3.5", "phpunit/phpunit": "^8.5.21", - "vimeo/psalm": ">=4.11.2@stable" + "vimeo/psalm": "^4.16.1" }, "type": "composer-plugin", "extra": { @@ -1350,9 +1352,9 @@ "description": "Composer plugin that installs and compile frontend dependencies for installed Composer packages based on configuration.", "support": { "issues": "https://github.com/inpsyde/composer-asset-compiler/issues", - "source": "https://github.com/inpsyde/composer-asset-compiler/tree/2.5.2" + "source": "https://github.com/inpsyde/composer-asset-compiler/tree/2.5.3" }, - "time": "2022-03-07T13:50:29+00:00" + "time": "2024-03-07T12:11:10+00:00" }, { "name": "inpsyde/modularity", @@ -1496,16 +1498,16 @@ }, { "name": "johnpbloch/wordpress-core", - "version": "5.9.7", + "version": "5.9.10", "source": { "type": "git", "url": "https://github.com/johnpbloch/wordpress-core.git", - "reference": "5fdd25a8f28f480bf58e6e75b141e7d428fa19bb" + "reference": "5ca1365f22e0c57e8362ce0dbc735281e304130a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/johnpbloch/wordpress-core/zipball/5fdd25a8f28f480bf58e6e75b141e7d428fa19bb", - "reference": "5fdd25a8f28f480bf58e6e75b141e7d428fa19bb", + "url": "https://api.github.com/repos/johnpbloch/wordpress-core/zipball/5ca1365f22e0c57e8362ce0dbc735281e304130a", + "reference": "5ca1365f22e0c57e8362ce0dbc735281e304130a", "shasum": "" }, "require": { @@ -1513,7 +1515,7 @@ "php": ">=5.6.20" }, "provide": { - "wordpress/core-implementation": "5.9.7" + "wordpress/core-implementation": "5.9.10" }, "type": "wordpress-core", "notification-url": "https://packagist.org/downloads/", @@ -1540,7 +1542,7 @@ "source": "https://core.trac.wordpress.org/browser", "wiki": "https://codex.wordpress.org/" }, - "time": "2023-05-20T04:40:18+00:00" + "time": "2024-06-24T17:31:05+00:00" }, { "name": "mockery/mockery", @@ -1613,16 +1615,16 @@ }, { "name": "myclabs/deep-copy", - "version": "1.11.1", + "version": "1.12.0", "source": { "type": "git", "url": "https://github.com/myclabs/DeepCopy.git", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c" + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", - "reference": "7284c22080590fb39f2ffa3e9057f10a4ddd0e0c", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", + "reference": "3a6b9a42cd8f8771bd4295d13e1423fa7f3d942c", "shasum": "" }, "require": { @@ -1630,11 +1632,12 @@ }, "conflict": { "doctrine/collections": "<1.6.8", - "doctrine/common": "<2.13.3 || >=3,<3.2.2" + "doctrine/common": "<2.13.3 || >=3 <3.2.2" }, "require-dev": { "doctrine/collections": "^1.6.8", "doctrine/common": "^2.13.3 || ^3.2.2", + "phpspec/prophecy": "^1.10", "phpunit/phpunit": "^7.5.20 || ^8.5.23 || ^9.5.13" }, "type": "library", @@ -1660,7 +1663,7 @@ ], "support": { "issues": "https://github.com/myclabs/DeepCopy/issues", - "source": "https://github.com/myclabs/DeepCopy/tree/1.11.1" + "source": "https://github.com/myclabs/DeepCopy/tree/1.12.0" }, "funding": [ { @@ -1668,20 +1671,20 @@ "type": "tidelift" } ], - "time": "2023-03-08T13:26:56+00:00" + "time": "2024-06-12T14:39:25+00:00" }, { "name": "netresearch/jsonmapper", - "version": "v4.2.0", + "version": "v4.4.1", "source": { "type": "git", "url": "https://github.com/cweiske/jsonmapper.git", - "reference": "f60565f8c0566a31acf06884cdaa591867ecc956" + "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/f60565f8c0566a31acf06884cdaa591867ecc956", - "reference": "f60565f8c0566a31acf06884cdaa591867ecc956", + "url": "https://api.github.com/repos/cweiske/jsonmapper/zipball/132c75c7dd83e45353ebb9c6c9f591952995bbf0", + "reference": "132c75c7dd83e45353ebb9c6c9f591952995bbf0", "shasum": "" }, "require": { @@ -1692,7 +1695,7 @@ "php": ">=7.1" }, "require-dev": { - "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0", + "phpunit/phpunit": "~7.5 || ~8.0 || ~9.0 || ~10.0", "squizlabs/php_codesniffer": "~3.5" }, "type": "library", @@ -1717,27 +1720,27 @@ "support": { "email": "cweiske@cweiske.de", "issues": "https://github.com/cweiske/jsonmapper/issues", - "source": "https://github.com/cweiske/jsonmapper/tree/v4.2.0" + "source": "https://github.com/cweiske/jsonmapper/tree/v4.4.1" }, - "time": "2023-04-09T17:37:40+00:00" + "time": "2024-01-31T06:18:54+00:00" }, { "name": "nikic/php-parser", - "version": "v4.17.1", + "version": "v4.19.1", "source": { "type": "git", "url": "https://github.com/nikic/PHP-Parser.git", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d" + "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", - "reference": "a6303e50c90c355c7eeee2c4a8b27fe8dc8fef1d", + "url": "https://api.github.com/repos/nikic/PHP-Parser/zipball/4e1b88d21c69391150ace211e9eaf05810858d0b", + "reference": "4e1b88d21c69391150ace211e9eaf05810858d0b", "shasum": "" }, "require": { "ext-tokenizer": "*", - "php": ">=7.0" + "php": ">=7.1" }, "require-dev": { "ircmaxell/php-yacc": "^0.0.7", @@ -1773,9 +1776,9 @@ ], "support": { "issues": "https://github.com/nikic/PHP-Parser/issues", - "source": "https://github.com/nikic/PHP-Parser/tree/v4.17.1" + "source": "https://github.com/nikic/PHP-Parser/tree/v4.19.1" }, - "time": "2023-08-13T19:53:39+00:00" + "time": "2024-03-17T08:10:35+00:00" }, { "name": "openlss/lib-array2xml", @@ -1832,20 +1835,21 @@ }, { "name": "phar-io/manifest", - "version": "2.0.3", + "version": "2.0.4", "source": { "type": "git", "url": "https://github.com/phar-io/manifest.git", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53" + "reference": "54750ef60c58e43759730615a392c31c80e23176" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/phar-io/manifest/zipball/97803eca37d319dfa7826cc2437fc020857acb53", - "reference": "97803eca37d319dfa7826cc2437fc020857acb53", + "url": "https://api.github.com/repos/phar-io/manifest/zipball/54750ef60c58e43759730615a392c31c80e23176", + "reference": "54750ef60c58e43759730615a392c31c80e23176", "shasum": "" }, "require": { "ext-dom": "*", + "ext-libxml": "*", "ext-phar": "*", "ext-xmlwriter": "*", "phar-io/version": "^3.0.1", @@ -1886,9 +1890,15 @@ "description": "Component for reading phar.io manifest information from a PHP Archive (PHAR)", "support": { "issues": "https://github.com/phar-io/manifest/issues", - "source": "https://github.com/phar-io/manifest/tree/2.0.3" + "source": "https://github.com/phar-io/manifest/tree/2.0.4" }, - "time": "2021-07-20T11:28:43+00:00" + "funding": [ + { + "url": "https://github.com/theseer", + "type": "github" + } + ], + "time": "2024-03-03T12:33:53+00:00" }, { "name": "phar-io/version", @@ -1987,29 +1997,31 @@ }, { "name": "php-stubs/wordpress-stubs", - "version": "v5.9.6", + "version": "v5.9.9", "source": { "type": "git", "url": "https://github.com/php-stubs/wordpress-stubs.git", - "reference": "6a18d938d0aef39d091505a4a35b025fb6c10098" + "reference": "06c51c4863659ea9e9f4c2a23293728a677cb059" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/6a18d938d0aef39d091505a4a35b025fb6c10098", - "reference": "6a18d938d0aef39d091505a4a35b025fb6c10098", + "url": "https://api.github.com/repos/php-stubs/wordpress-stubs/zipball/06c51c4863659ea9e9f4c2a23293728a677cb059", + "reference": "06c51c4863659ea9e9f4c2a23293728a677cb059", "shasum": "" }, "require-dev": { - "nikic/php-parser": "< 4.12.0", - "php": "~7.3 || ~8.0", + "dealerdirect/phpcodesniffer-composer-installer": "^1.0", + "nikic/php-parser": "^4.13", + "php": "^7.4 || ~8.0.0", "php-stubs/generator": "^0.8.3", - "phpdocumentor/reflection-docblock": "^5.3", - "phpstan/phpstan": "^1.10.12", - "phpunit/phpunit": "^9.5" + "phpdocumentor/reflection-docblock": "5.3", + "phpstan/phpstan": "^1.10.49", + "phpunit/phpunit": "^9.5", + "szepeviktor/phpcs-psr-12-neutron-hybrid-ruleset": "^0.11" }, "suggest": { "paragonie/sodium_compat": "Pure PHP implementation of libsodium", - "symfony/polyfill-php73": "Symfony polyfill backporting some PHP 7.3+ features to lower PHP versions", + "symfony/polyfill-php80": "Symfony polyfill backporting some PHP 8.0+ features to lower PHP versions", "szepeviktor/phpstan-wordpress": "WordPress extensions for PHPStan" }, "type": "library", @@ -2026,9 +2038,9 @@ ], "support": { "issues": "https://github.com/php-stubs/wordpress-stubs/issues", - "source": "https://github.com/php-stubs/wordpress-stubs/tree/v5.9.6" + "source": "https://github.com/php-stubs/wordpress-stubs/tree/v5.9.9" }, - "time": "2023-05-18T04:34:27+00:00" + "time": "2024-04-14T17:16:00+00:00" }, { "name": "phpcompatibility/php-compatibility", @@ -2254,16 +2266,16 @@ }, { "name": "phpunit/php-code-coverage", - "version": "7.0.15", + "version": "7.0.17", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "819f92bba8b001d4363065928088de22f25a3a48" + "reference": "40a4ed114a4aea5afd6df8d0f0c9cd3033097f66" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/819f92bba8b001d4363065928088de22f25a3a48", - "reference": "819f92bba8b001d4363065928088de22f25a3a48", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/40a4ed114a4aea5afd6df8d0f0c9cd3033097f66", + "reference": "40a4ed114a4aea5afd6df8d0f0c9cd3033097f66", "shasum": "" }, "require": { @@ -2315,7 +2327,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-code-coverage/issues", - "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.15" + "source": "https://github.com/sebastianbergmann/php-code-coverage/tree/7.0.17" }, "funding": [ { @@ -2323,20 +2335,20 @@ "type": "github" } ], - "time": "2021-07-26T12:20:09+00:00" + "time": "2024-03-02T06:09:37+00:00" }, { "name": "phpunit/php-file-iterator", - "version": "2.0.5", + "version": "2.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-file-iterator.git", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5" + "reference": "69deeb8664f611f156a924154985fbd4911eb36b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", - "reference": "42c5ba5220e6904cbfe8b1a1bda7c0cfdc8c12f5", + "url": "https://api.github.com/repos/sebastianbergmann/php-file-iterator/zipball/69deeb8664f611f156a924154985fbd4911eb36b", + "reference": "69deeb8664f611f156a924154985fbd4911eb36b", "shasum": "" }, "require": { @@ -2375,7 +2387,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-file-iterator/issues", - "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.5" + "source": "https://github.com/sebastianbergmann/php-file-iterator/tree/2.0.6" }, "funding": [ { @@ -2383,7 +2395,7 @@ "type": "github" } ], - "time": "2021-12-02T12:42:26+00:00" + "time": "2024-03-01T13:39:50+00:00" }, { "name": "phpunit/php-text-template", @@ -2432,16 +2444,16 @@ }, { "name": "phpunit/php-timer", - "version": "2.1.3", + "version": "2.1.4", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-timer.git", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662" + "reference": "a691211e94ff39a34811abd521c31bd5b305b0bb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/2454ae1765516d20c4ffe103d85a58a9a3bd5662", - "reference": "2454ae1765516d20c4ffe103d85a58a9a3bd5662", + "url": "https://api.github.com/repos/sebastianbergmann/php-timer/zipball/a691211e94ff39a34811abd521c31bd5b305b0bb", + "reference": "a691211e94ff39a34811abd521c31bd5b305b0bb", "shasum": "" }, "require": { @@ -2479,7 +2491,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/php-timer/issues", - "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.3" + "source": "https://github.com/sebastianbergmann/php-timer/tree/2.1.4" }, "funding": [ { @@ -2487,7 +2499,7 @@ "type": "github" } ], - "time": "2020-11-30T08:20:02+00:00" + "time": "2024-03-01T13:42:41+00:00" }, { "name": "phpunit/php-token-stream", @@ -2551,48 +2563,48 @@ }, { "name": "phpunit/phpunit", - "version": "8.5.33", + "version": "8.5.39", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e" + "reference": "172ba97bcf97ae6ef86ca256adf77aece8a143fe" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e", - "reference": "7d1ff0e8c6b35db78ff13e3e05517d7cbf7aa32e", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/172ba97bcf97ae6ef86ca256adf77aece8a143fe", + "reference": "172ba97bcf97ae6ef86ca256adf77aece8a143fe", "shasum": "" }, "require": { - "doctrine/instantiator": "^1.3.1", + "doctrine/instantiator": "^1.5.0", "ext-dom": "*", "ext-json": "*", "ext-libxml": "*", "ext-mbstring": "*", "ext-xml": "*", "ext-xmlwriter": "*", - "myclabs/deep-copy": "^1.10.0", - "phar-io/manifest": "^2.0.3", - "phar-io/version": "^3.0.2", + "myclabs/deep-copy": "^1.12.0", + "phar-io/manifest": "^2.0.4", + "phar-io/version": "^3.2.1", "php": ">=7.2", - "phpunit/php-code-coverage": "^7.0.12", - "phpunit/php-file-iterator": "^2.0.4", + "phpunit/php-code-coverage": "^7.0.17", + "phpunit/php-file-iterator": "^2.0.6", "phpunit/php-text-template": "^1.2.1", - "phpunit/php-timer": "^2.1.2", + "phpunit/php-timer": "^2.1.4", "sebastian/comparator": "^3.0.5", - "sebastian/diff": "^3.0.2", - "sebastian/environment": "^4.2.3", - "sebastian/exporter": "^3.1.5", - "sebastian/global-state": "^3.0.0", - "sebastian/object-enumerator": "^3.0.3", - "sebastian/resource-operations": "^2.0.1", - "sebastian/type": "^1.1.3", + "sebastian/diff": "^3.0.6", + "sebastian/environment": "^4.2.5", + "sebastian/exporter": "^3.1.6", + "sebastian/global-state": "^3.0.5", + "sebastian/object-enumerator": "^3.0.5", + "sebastian/resource-operations": "^2.0.3", + "sebastian/type": "^1.1.5", "sebastian/version": "^2.0.1" }, "suggest": { - "ext-soap": "*", - "ext-xdebug": "*", - "phpunit/php-invoker": "^2.0.0" + "ext-soap": "To be able to generate mocks based on WSDL files", + "ext-xdebug": "PHP extension that provides line coverage as well as branch and path coverage", + "phpunit/php-invoker": "To allow enforcing time limits" }, "bin": [ "phpunit" @@ -2628,7 +2640,8 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", - "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.33" + "security": "https://github.com/sebastianbergmann/phpunit/security/policy", + "source": "https://github.com/sebastianbergmann/phpunit/tree/8.5.39" }, "funding": [ { @@ -2644,7 +2657,7 @@ "type": "tidelift" } ], - "time": "2023-02-27T13:04:50+00:00" + "time": "2024-07-10T11:43:00+00:00" }, { "name": "psr/container", @@ -2738,16 +2751,16 @@ }, { "name": "sebastian/code-unit-reverse-lookup", - "version": "1.0.2", + "version": "1.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619" + "reference": "92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/1de8cd5c010cb153fcd68b8d0f64606f523f7619", - "reference": "1de8cd5c010cb153fcd68b8d0f64606f523f7619", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54", + "reference": "92a1a52e86d34cde6caa54f1b5ffa9fda18e5d54", "shasum": "" }, "require": { @@ -2781,7 +2794,7 @@ "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", "support": { "issues": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/issues", - "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.2" + "source": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/tree/1.0.3" }, "funding": [ { @@ -2789,7 +2802,7 @@ "type": "github" } ], - "time": "2020-11-30T08:15:22+00:00" + "time": "2024-03-01T13:45:45+00:00" }, { "name": "sebastian/comparator", @@ -2867,16 +2880,16 @@ }, { "name": "sebastian/diff", - "version": "3.0.4", + "version": "3.0.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/diff.git", - "reference": "6296a0c086dd0117c1b78b059374d7fcbe7545ae" + "reference": "98ff311ca519c3aa73ccd3de053bdb377171d7b6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/6296a0c086dd0117c1b78b059374d7fcbe7545ae", - "reference": "6296a0c086dd0117c1b78b059374d7fcbe7545ae", + "url": "https://api.github.com/repos/sebastianbergmann/diff/zipball/98ff311ca519c3aa73ccd3de053bdb377171d7b6", + "reference": "98ff311ca519c3aa73ccd3de053bdb377171d7b6", "shasum": "" }, "require": { @@ -2921,7 +2934,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/diff/issues", - "source": "https://github.com/sebastianbergmann/diff/tree/3.0.4" + "source": "https://github.com/sebastianbergmann/diff/tree/3.0.6" }, "funding": [ { @@ -2929,20 +2942,20 @@ "type": "github" } ], - "time": "2023-05-07T05:30:20+00:00" + "time": "2024-03-02T06:16:36+00:00" }, { "name": "sebastian/environment", - "version": "4.2.4", + "version": "4.2.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0" + "reference": "56932f6049a0482853056ffd617c91ffcc754205" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", - "reference": "d47bbbad83711771f167c72d4e3f25f7fcc1f8b0", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/56932f6049a0482853056ffd617c91ffcc754205", + "reference": "56932f6049a0482853056ffd617c91ffcc754205", "shasum": "" }, "require": { @@ -2984,7 +2997,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/environment/issues", - "source": "https://github.com/sebastianbergmann/environment/tree/4.2.4" + "source": "https://github.com/sebastianbergmann/environment/tree/4.2.5" }, "funding": [ { @@ -2992,24 +3005,24 @@ "type": "github" } ], - "time": "2020-11-30T07:53:42+00:00" + "time": "2024-03-01T13:49:59+00:00" }, { "name": "sebastian/exporter", - "version": "3.1.5", + "version": "3.1.6", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6" + "reference": "1939bc8fd1d39adcfa88c5b35335910869214c56" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/73a9676f2833b9a7c36968f9d882589cd75511e6", - "reference": "73a9676f2833b9a7c36968f9d882589cd75511e6", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/1939bc8fd1d39adcfa88c5b35335910869214c56", + "reference": "1939bc8fd1d39adcfa88c5b35335910869214c56", "shasum": "" }, "require": { - "php": ">=7.0", + "php": ">=7.2", "sebastian/recursion-context": "^3.0" }, "require-dev": { @@ -3061,7 +3074,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/exporter/issues", - "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.5" + "source": "https://github.com/sebastianbergmann/exporter/tree/3.1.6" }, "funding": [ { @@ -3069,20 +3082,20 @@ "type": "github" } ], - "time": "2022-09-14T06:00:17+00:00" + "time": "2024-03-02T06:21:38+00:00" }, { "name": "sebastian/global-state", - "version": "3.0.3", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/global-state.git", - "reference": "66783ce213de415b451b904bfef9dda0cf9aeae0" + "reference": "91c7c47047a971f02de57ed6f040087ef110c5d9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/66783ce213de415b451b904bfef9dda0cf9aeae0", - "reference": "66783ce213de415b451b904bfef9dda0cf9aeae0", + "url": "https://api.github.com/repos/sebastianbergmann/global-state/zipball/91c7c47047a971f02de57ed6f040087ef110c5d9", + "reference": "91c7c47047a971f02de57ed6f040087ef110c5d9", "shasum": "" }, "require": { @@ -3125,7 +3138,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/global-state/issues", - "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.3" + "source": "https://github.com/sebastianbergmann/global-state/tree/3.0.5" }, "funding": [ { @@ -3133,20 +3146,20 @@ "type": "github" } ], - "time": "2023-08-02T09:23:32+00:00" + "time": "2024-03-02T06:13:16+00:00" }, { "name": "sebastian/object-enumerator", - "version": "3.0.4", + "version": "3.0.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-enumerator.git", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2" + "reference": "ac5b293dba925751b808e02923399fb44ff0d541" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", - "reference": "e67f6d32ebd0c749cf9d1dbd9f226c727043cdf2", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/ac5b293dba925751b808e02923399fb44ff0d541", + "reference": "ac5b293dba925751b808e02923399fb44ff0d541", "shasum": "" }, "require": { @@ -3182,7 +3195,7 @@ "homepage": "https://github.com/sebastianbergmann/object-enumerator/", "support": { "issues": "https://github.com/sebastianbergmann/object-enumerator/issues", - "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.4" + "source": "https://github.com/sebastianbergmann/object-enumerator/tree/3.0.5" }, "funding": [ { @@ -3190,20 +3203,20 @@ "type": "github" } ], - "time": "2020-11-30T07:40:27+00:00" + "time": "2024-03-01T13:54:02+00:00" }, { "name": "sebastian/object-reflector", - "version": "1.1.2", + "version": "1.1.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/object-reflector.git", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d" + "reference": "1d439c229e61f244ff1f211e5c99737f90c67def" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", - "reference": "9b8772b9cbd456ab45d4a598d2dd1a1bced6363d", + "url": "https://api.github.com/repos/sebastianbergmann/object-reflector/zipball/1d439c229e61f244ff1f211e5c99737f90c67def", + "reference": "1d439c229e61f244ff1f211e5c99737f90c67def", "shasum": "" }, "require": { @@ -3237,7 +3250,7 @@ "homepage": "https://github.com/sebastianbergmann/object-reflector/", "support": { "issues": "https://github.com/sebastianbergmann/object-reflector/issues", - "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.2" + "source": "https://github.com/sebastianbergmann/object-reflector/tree/1.1.3" }, "funding": [ { @@ -3245,20 +3258,20 @@ "type": "github" } ], - "time": "2020-11-30T07:37:18+00:00" + "time": "2024-03-01T13:56:04+00:00" }, { "name": "sebastian/recursion-context", - "version": "3.0.1", + "version": "3.0.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/recursion-context.git", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb" + "reference": "9bfd3c6f1f08c026f542032dfb42813544f7d64c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/367dcba38d6e1977be014dc4b22f47a484dac7fb", - "reference": "367dcba38d6e1977be014dc4b22f47a484dac7fb", + "url": "https://api.github.com/repos/sebastianbergmann/recursion-context/zipball/9bfd3c6f1f08c026f542032dfb42813544f7d64c", + "reference": "9bfd3c6f1f08c026f542032dfb42813544f7d64c", "shasum": "" }, "require": { @@ -3300,7 +3313,7 @@ "homepage": "http://www.github.com/sebastianbergmann/recursion-context", "support": { "issues": "https://github.com/sebastianbergmann/recursion-context/issues", - "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.1" + "source": "https://github.com/sebastianbergmann/recursion-context/tree/3.0.2" }, "funding": [ { @@ -3308,20 +3321,20 @@ "type": "github" } ], - "time": "2020-11-30T07:34:24+00:00" + "time": "2024-03-01T14:07:30+00:00" }, { "name": "sebastian/resource-operations", - "version": "2.0.2", + "version": "2.0.3", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/resource-operations.git", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3" + "reference": "72a7f7674d053d548003b16ff5a106e7e0e06eee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/31d35ca87926450c44eae7e2611d45a7a65ea8b3", - "reference": "31d35ca87926450c44eae7e2611d45a7a65ea8b3", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/72a7f7674d053d548003b16ff5a106e7e0e06eee", + "reference": "72a7f7674d053d548003b16ff5a106e7e0e06eee", "shasum": "" }, "require": { @@ -3351,8 +3364,7 @@ "description": "Provides a list of PHP built-in functions that operate on resources", "homepage": "https://www.github.com/sebastianbergmann/resource-operations", "support": { - "issues": "https://github.com/sebastianbergmann/resource-operations/issues", - "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.2" + "source": "https://github.com/sebastianbergmann/resource-operations/tree/2.0.3" }, "funding": [ { @@ -3360,20 +3372,20 @@ "type": "github" } ], - "time": "2020-11-30T07:30:19+00:00" + "time": "2024-03-01T13:59:09+00:00" }, { "name": "sebastian/type", - "version": "1.1.4", + "version": "1.1.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/type.git", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4" + "reference": "18f071c3a29892b037d35e6b20ddf3ea39b42874" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/0150cfbc4495ed2df3872fb31b26781e4e077eb4", - "reference": "0150cfbc4495ed2df3872fb31b26781e4e077eb4", + "url": "https://api.github.com/repos/sebastianbergmann/type/zipball/18f071c3a29892b037d35e6b20ddf3ea39b42874", + "reference": "18f071c3a29892b037d35e6b20ddf3ea39b42874", "shasum": "" }, "require": { @@ -3408,7 +3420,7 @@ "homepage": "https://github.com/sebastianbergmann/type", "support": { "issues": "https://github.com/sebastianbergmann/type/issues", - "source": "https://github.com/sebastianbergmann/type/tree/1.1.4" + "source": "https://github.com/sebastianbergmann/type/tree/1.1.5" }, "funding": [ { @@ -3416,7 +3428,7 @@ "type": "github" } ], - "time": "2020-11-30T07:25:11+00:00" + "time": "2024-03-01T14:04:07+00:00" }, { "name": "sebastian/version", @@ -3467,16 +3479,16 @@ }, { "name": "sirbrillig/phpcs-variable-analysis", - "version": "v2.11.17", + "version": "v2.11.19", "source": { "type": "git", "url": "https://github.com/sirbrillig/phpcs-variable-analysis.git", - "reference": "3b71162a6bf0cde2bff1752e40a1788d8273d049" + "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/3b71162a6bf0cde2bff1752e40a1788d8273d049", - "reference": "3b71162a6bf0cde2bff1752e40a1788d8273d049", + "url": "https://api.github.com/repos/sirbrillig/phpcs-variable-analysis/zipball/bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", + "reference": "bc8d7e30e2005bce5c59018b7cdb08e9fb45c0d1", "shasum": "" }, "require": { @@ -3521,19 +3533,19 @@ "source": "https://github.com/sirbrillig/phpcs-variable-analysis", "wiki": "https://github.com/sirbrillig/phpcs-variable-analysis/wiki" }, - "time": "2023-08-05T23:46:11+00:00" + "time": "2024-06-26T20:08:34+00:00" }, { "name": "squizlabs/php_codesniffer", "version": "3.6.2", "source": { "type": "git", - "url": "https://github.com/squizlabs/PHP_CodeSniffer.git", + "url": "https://github.com/PHPCSStandards/PHP_CodeSniffer.git", "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/squizlabs/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", + "url": "https://api.github.com/repos/PHPCSStandards/PHP_CodeSniffer/zipball/5e4e71592f69da17871dba6e80dd51bce74a351a", "reference": "5e4e71592f69da17871dba6e80dd51bce74a351a", "shasum": "" }, @@ -3577,20 +3589,34 @@ "source": "https://github.com/squizlabs/PHP_CodeSniffer", "wiki": "https://github.com/squizlabs/PHP_CodeSniffer/wiki" }, + "funding": [ + { + "url": "https://github.com/PHPCSStandards", + "type": "github" + }, + { + "url": "https://github.com/jrfnl", + "type": "github" + }, + { + "url": "https://opencollective.com/php_codesniffer", + "type": "open_collective" + } + ], "time": "2021-12-12T21:44:58+00:00" }, { "name": "symfony/console", - "version": "v5.4.28", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/console.git", - "reference": "f4f71842f24c2023b91237c72a365306f3c58827" + "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/console/zipball/f4f71842f24c2023b91237c72a365306f3c58827", - "reference": "f4f71842f24c2023b91237c72a365306f3c58827", + "url": "https://api.github.com/repos/symfony/console/zipball/cef62396a0477e94fc52e87a17c6e5c32e226b7f", + "reference": "cef62396a0477e94fc52e87a17c6e5c32e226b7f", "shasum": "" }, "require": { @@ -3660,7 +3686,7 @@ "terminal" ], "support": { - "source": "https://github.com/symfony/console/tree/v5.4.28" + "source": "https://github.com/symfony/console/tree/v5.4.42" }, "funding": [ { @@ -3676,20 +3702,20 @@ "type": "tidelift" } ], - "time": "2023-08-07T06:12:30+00:00" + "time": "2024-07-26T12:21:55+00:00" }, { "name": "symfony/deprecation-contracts", - "version": "v2.5.2", + "version": "v2.5.3", "source": { "type": "git", "url": "https://github.com/symfony/deprecation-contracts.git", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66" + "reference": "80d075412b557d41002320b96a096ca65aa2c98d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/e8b495ea28c1d97b5e0c121748d6f9b53d075c66", - "reference": "e8b495ea28c1d97b5e0c121748d6f9b53d075c66", + "url": "https://api.github.com/repos/symfony/deprecation-contracts/zipball/80d075412b557d41002320b96a096ca65aa2c98d", + "reference": "80d075412b557d41002320b96a096ca65aa2c98d", "shasum": "" }, "require": { @@ -3727,7 +3753,7 @@ "description": "A generic function and convention to trigger deprecation notices", "homepage": "https://symfony.com", "support": { - "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.2" + "source": "https://github.com/symfony/deprecation-contracts/tree/v2.5.3" }, "funding": [ { @@ -3743,20 +3769,20 @@ "type": "tidelift" } ], - "time": "2022-01-02T09:53:40+00:00" + "time": "2023-01-24T14:02:46+00:00" }, { "name": "symfony/polyfill-ctype", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-ctype.git", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb" + "reference": "0424dff1c58f028c451efff2045f5d92410bd540" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", - "reference": "ea208ce43cbb04af6867b4fdddb1bdbf84cc28cb", + "url": "https://api.github.com/repos/symfony/polyfill-ctype/zipball/0424dff1c58f028c451efff2045f5d92410bd540", + "reference": "0424dff1c58f028c451efff2045f5d92410bd540", "shasum": "" }, "require": { @@ -3770,9 +3796,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3809,7 +3832,7 @@ "portable" ], "support": { - "source": "https://github.com/symfony/polyfill-ctype/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-ctype/tree/v1.30.0" }, "funding": [ { @@ -3825,20 +3848,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-grapheme", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-grapheme.git", - "reference": "875e90aeea2777b6f135677f618529449334a612" + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/875e90aeea2777b6f135677f618529449334a612", - "reference": "875e90aeea2777b6f135677f618529449334a612", + "url": "https://api.github.com/repos/symfony/polyfill-intl-grapheme/zipball/64647a7c30b2283f5d49b874d84a18fc22054b7a", + "reference": "64647a7c30b2283f5d49b874d84a18fc22054b7a", "shasum": "" }, "require": { @@ -3849,9 +3872,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3890,7 +3910,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-grapheme/tree/v1.30.0" }, "funding": [ { @@ -3906,20 +3926,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-intl-normalizer", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92" + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", - "reference": "8c4ad05dd0120b6a53c1ca374dca2ad0a1c4ed92", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/a95281b0be0d9ab48050ebd988b967875cdb9fdb", + "reference": "a95281b0be0d9ab48050ebd988b967875cdb9fdb", "shasum": "" }, "require": { @@ -3930,9 +3950,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -3974,7 +3991,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.30.0" }, "funding": [ { @@ -3990,20 +4007,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-mbstring", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-mbstring.git", - "reference": "42292d99c55abe617799667f454222c54c60e229" + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/42292d99c55abe617799667f454222c54c60e229", - "reference": "42292d99c55abe617799667f454222c54c60e229", + "url": "https://api.github.com/repos/symfony/polyfill-mbstring/zipball/fd22ab50000ef01661e2a31d850ebaa297f8e03c", + "reference": "fd22ab50000ef01661e2a31d850ebaa297f8e03c", "shasum": "" }, "require": { @@ -4017,9 +4034,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -4057,7 +4071,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-mbstring/tree/v1.30.0" }, "funding": [ { @@ -4073,20 +4087,20 @@ "type": "tidelift" } ], - "time": "2023-07-28T09:04:16+00:00" + "time": "2024-06-19T12:30:46+00:00" }, { "name": "symfony/polyfill-php73", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php73.git", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5" + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/fe2f306d1d9d346a7fee353d0d5012e401e984b5", - "reference": "fe2f306d1d9d346a7fee353d0d5012e401e984b5", + "url": "https://api.github.com/repos/symfony/polyfill-php73/zipball/ec444d3f3f6505bb28d11afa41e75faadebc10a1", + "reference": "ec444d3f3f6505bb28d11afa41e75faadebc10a1", "shasum": "" }, "require": { @@ -4094,9 +4108,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -4136,7 +4147,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php73/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php73/tree/v1.30.0" }, "funding": [ { @@ -4152,20 +4163,20 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/polyfill-php80", - "version": "v1.28.0", + "version": "v1.30.0", "source": { "type": "git", "url": "https://github.com/symfony/polyfill-php80.git", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5" + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/6caa57379c4aec19c0a12a38b59b26487dcfe4b5", - "reference": "6caa57379c4aec19c0a12a38b59b26487dcfe4b5", + "url": "https://api.github.com/repos/symfony/polyfill-php80/zipball/77fa7995ac1b21ab60769b7323d600a991a90433", + "reference": "77fa7995ac1b21ab60769b7323d600a991a90433", "shasum": "" }, "require": { @@ -4173,9 +4184,6 @@ }, "type": "library", "extra": { - "branch-alias": { - "dev-main": "1.28-dev" - }, "thanks": { "name": "symfony/polyfill", "url": "https://github.com/symfony/polyfill" @@ -4219,7 +4227,7 @@ "shim" ], "support": { - "source": "https://github.com/symfony/polyfill-php80/tree/v1.28.0" + "source": "https://github.com/symfony/polyfill-php80/tree/v1.30.0" }, "funding": [ { @@ -4235,7 +4243,7 @@ "type": "tidelift" } ], - "time": "2023-01-26T09:26:14+00:00" + "time": "2024-05-31T15:07:36+00:00" }, { "name": "symfony/service-contracts", @@ -4318,16 +4326,16 @@ }, { "name": "symfony/string", - "version": "v5.4.26", + "version": "v5.4.42", "source": { "type": "git", "url": "https://github.com/symfony/string.git", - "reference": "1181fe9270e373537475e826873b5867b863883c" + "reference": "909cec913edea162a3b2836788228ad45fcab337" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/string/zipball/1181fe9270e373537475e826873b5867b863883c", - "reference": "1181fe9270e373537475e826873b5867b863883c", + "url": "https://api.github.com/repos/symfony/string/zipball/909cec913edea162a3b2836788228ad45fcab337", + "reference": "909cec913edea162a3b2836788228ad45fcab337", "shasum": "" }, "require": { @@ -4384,7 +4392,7 @@ "utf8" ], "support": { - "source": "https://github.com/symfony/string/tree/v5.4.26" + "source": "https://github.com/symfony/string/tree/v5.4.42" }, "funding": [ { @@ -4400,20 +4408,20 @@ "type": "tidelift" } ], - "time": "2023-06-28T12:46:07+00:00" + "time": "2024-07-20T18:38:32+00:00" }, { "name": "theseer/tokenizer", - "version": "1.2.1", + "version": "1.2.3", "source": { "type": "git", "url": "https://github.com/theseer/tokenizer.git", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e" + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/theseer/tokenizer/zipball/34a41e998c2183e22995f158c581e7b5e755ab9e", - "reference": "34a41e998c2183e22995f158c581e7b5e755ab9e", + "url": "https://api.github.com/repos/theseer/tokenizer/zipball/737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", + "reference": "737eda637ed5e28c3413cb1ebe8bb52cbf1ca7a2", "shasum": "" }, "require": { @@ -4442,7 +4450,7 @@ "description": "A small library for converting tokenized PHP source code into XML and potentially other formats", "support": { "issues": "https://github.com/theseer/tokenizer/issues", - "source": "https://github.com/theseer/tokenizer/tree/1.2.1" + "source": "https://github.com/theseer/tokenizer/tree/1.2.3" }, "funding": [ { @@ -4450,7 +4458,7 @@ "type": "github" } ], - "time": "2021-07-28T10:34:58+00:00" + "time": "2024-03-03T12:36:25+00:00" }, { "name": "vimeo/psalm", @@ -4735,5 +4743,5 @@ "ext-json": "*" }, "platform-dev": [], - "plugin-api-version": "2.3.0" + "plugin-api-version": "2.6.0" } From d5e6e212cbb9c56535c34305f1c089013427a15f Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Mon, 19 Aug 2024 12:03:41 +0200 Subject: [PATCH 16/19] Update tests --- .../ApplePayButton/AjaxRequestsTest.php | 2 +- .../Payment/OrderItemsRefunderTest.php | 16 ++++++++++++++++ .../Functional/Payment/PaymentServiceTest.php | 3 +++ .../Payment/RefundLineItemsBuilderTest.php | 11 +++++++++++ .../php/Functional/Payment/RequestObjectTest.php | 4 +++- tests/php/Functional/SDK/SdkTest.php | 6 ++++++ 6 files changed, 40 insertions(+), 2 deletions(-) diff --git a/tests/php/Functional/ApplePayButton/AjaxRequestsTest.php b/tests/php/Functional/ApplePayButton/AjaxRequestsTest.php index cf0161ba..fff43d73 100644 --- a/tests/php/Functional/ApplePayButton/AjaxRequestsTest.php +++ b/tests/php/Functional/ApplePayButton/AjaxRequestsTest.php @@ -67,7 +67,7 @@ public function testValidateMerchant() stubs( [ 'get_site_url' => 'http://www.testdomain.com', - + 'wp_parse_url' =>null ] ); list($logger, $responsesTemplate) = $this->responsesToApple(); diff --git a/tests/php/Functional/Payment/OrderItemsRefunderTest.php b/tests/php/Functional/Payment/OrderItemsRefunderTest.php index f6f18e89..35356308 100644 --- a/tests/php/Functional/Payment/OrderItemsRefunderTest.php +++ b/tests/php/Functional/Payment/OrderItemsRefunderTest.php @@ -21,6 +21,7 @@ use stdClass; use UnexpectedValueException; use function Brain\Monkey\Actions\expectDone as expectedActionDone; +use function Brain\Monkey\Functions\stubs; use function Brain\Monkey\Functions\when; /** @@ -196,6 +197,11 @@ public function testUnexpectedValueExceptionWhenBuildRefundItems() * Stubs */ $order = new \WC_Order(); + stubs( + [ + 'esc_html__' => null + ] + ); // Passing null is the key here, this will throw the exception because of invalid value. /** @var WC_Order_Item $orderItem */ $orderItem = $this->orderItem(['meta' => null]); @@ -242,6 +248,11 @@ public function testUnexpectedValueExceptionWhenBuildRemoteItems() * Stubs */ $order = new \WC_Order(); + stubs( + [ + 'esc_html__' => null + ] + ); /** @var WC_Order_Item $orderItem */ $orderItem = $this->orderItem(['meta' => uniqid()]); $orderLineItem = $this->orderLineItem( @@ -289,6 +300,11 @@ public function testBailIfNoItemsToRefund() $order = new \WC_Order(); $remoteOrder = $this->remoteOrder([]); $refundReason = uniqid(); + stubs( + [ + 'esc_html__' => null + ] + ); /* * Sut diff --git a/tests/php/Functional/Payment/PaymentServiceTest.php b/tests/php/Functional/Payment/PaymentServiceTest.php index f8107c8e..8e5d0030 100644 --- a/tests/php/Functional/Payment/PaymentServiceTest.php +++ b/tests/php/Functional/Payment/PaymentServiceTest.php @@ -97,6 +97,8 @@ public function processPayment_Order_success(){ 'add_query_arg' => 'https://webshop.example.org/wc-api/mollie_return?order_id=1&key=wc_order_hxZniP1zDcnM8', 'WC' => $this->wooCommerce(), 'wc_clean' => null, + 'wp_parse_url' => null, + 'wp_strip_all_tags' => null ] ); @@ -137,6 +139,7 @@ public function processAsMollieOrder_BailsIf_FraudException() { stubs([ 'array_filter' => [], + 'esc_html__' =>null ]); $mockedException = new TestApiException(); $mockedException->setTestCode(422); diff --git a/tests/php/Functional/Payment/RefundLineItemsBuilderTest.php b/tests/php/Functional/Payment/RefundLineItemsBuilderTest.php index f31c91ef..4c9f9e60 100644 --- a/tests/php/Functional/Payment/RefundLineItemsBuilderTest.php +++ b/tests/php/Functional/Payment/RefundLineItemsBuilderTest.php @@ -13,6 +13,7 @@ use stdClass; use UnexpectedValueException; use function Brain\Monkey\Actions\expectDone as expectedActionDone; +use function Brain\Monkey\Functions\stubs; use function Brain\Monkey\Functions\when; /** @@ -278,6 +279,11 @@ public function testBuildLineItemsThrowPartialRefundExceptionBecauseRefundPriceD */ $reason = uniqid(); $currency = uniqid(); + stubs( + [ + 'esc_html__' => null + ] + ); $toRefundItem = $this->wooCommerceOrderItem(-1, mt_rand(-100, -1), 0); $toRefundRemoteItem = $this->orderLineItem( @@ -332,6 +338,11 @@ public function testBuildLineItemsThrowUnexpectedValueExceptionBecauseRemoteItem */ $reason = uniqid(); $currency = uniqid(); + stubs( + [ + 'esc_html__' => null + ] + ); $toRefundItemId = uniqid(); $toRefundItem = $this->wooCommerceOrderItem(-1, mt_rand(-100, -1), 0); diff --git a/tests/php/Functional/Payment/RequestObjectTest.php b/tests/php/Functional/Payment/RequestObjectTest.php index 221b1698..0f4b5c93 100644 --- a/tests/php/Functional/Payment/RequestObjectTest.php +++ b/tests/php/Functional/Payment/RequestObjectTest.php @@ -115,7 +115,9 @@ public function executeTest($order) 'WC' => $this->wooCommerce(), 'get_option' => ['enabled' => false], 'wc_get_product' => $wrapperMock, - 'wc_clean' => false + 'wc_clean' => false, + 'wp_parse_url' => null, + 'wp_strip_all_tags' => null ]); $apiClientMock = $this->createConfiguredMock( MollieApiClient::class, diff --git a/tests/php/Functional/SDK/SdkTest.php b/tests/php/Functional/SDK/SdkTest.php index d8f141d0..eb2fd5ce 100644 --- a/tests/php/Functional/SDK/SdkTest.php +++ b/tests/php/Functional/SDK/SdkTest.php @@ -19,6 +19,7 @@ use Mollie\WooCommerceTests\TestCase; use function Brain\Monkey\Functions\expect; +use function Brain\Monkey\Functions\stubs; /** @@ -47,6 +48,11 @@ public function __construct($name = null, array $data = [], $dataName = '') */ public function sdkThrows() { + stubs( + [ + 'esc_html' => null + ] + ); $testee = new WordPressHttpAdapter(); expect('wp_remote_request')->once()->andReturn(new \WP_Error()); expect('is_wp_error')->once()->andReturn(true); From 66bfb866b08306e597a9509dcd4b205d8fd00a58 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Thu, 22 Aug 2024 10:30:32 +0200 Subject: [PATCH 17/19] Inspect and fix escape errors --- .../Constraints/AbstractVersionConstraint.php | 8 +++++--- .../Constraints/ExtensionConstraint.php | 9 ++++++--- .../Constraints/PluginConstraint.php | 17 ++++++++++------- .../Constraints/WordPressConstraint.php | 3 ++- pluginEnvironmentChecker/EnvironmentChecker.php | 8 +++++--- src/Payment/OrderItemsRefunder.php | 2 +- src/Payment/RefundLineItemsBuilder.php | 2 +- src/SDK/WordPressHttpAdapter.php | 2 ++ src/Shared/Data.php | 6 +++--- src/Shared/Status.php | 4 ++-- 10 files changed, 37 insertions(+), 24 deletions(-) diff --git a/pluginEnvironmentChecker/Constraints/AbstractVersionConstraint.php b/pluginEnvironmentChecker/Constraints/AbstractVersionConstraint.php index 6d36b68b..4bdb2ed1 100644 --- a/pluginEnvironmentChecker/Constraints/AbstractVersionConstraint.php +++ b/pluginEnvironmentChecker/Constraints/AbstractVersionConstraint.php @@ -36,7 +36,7 @@ abstract class AbstractVersionConstraint implements ConstraintInterface public function __construct($requiredVersion, $requiredPluginName = null) { $this->requiredVersion = $requiredVersion; - $this->requiredPluginName = $requiredPluginName; + $this->requiredPluginName = esc_html($requiredPluginName); $this->error = ''; $this->message = ''; } @@ -60,11 +60,13 @@ protected function checkVersion($actualVersion) if ($result) { return $result; } - throw new ConstraintFailedException( + // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped + throw new ConstraintFailedException( $this, $actualVersion, [$this->error], esc_html($this->message) ); - } + // phpcs:enable WordPress.Security.EscapeOutput.ExceptionNotEscaped + } } diff --git a/pluginEnvironmentChecker/Constraints/ExtensionConstraint.php b/pluginEnvironmentChecker/Constraints/ExtensionConstraint.php index 6a74803e..12eb0f20 100644 --- a/pluginEnvironmentChecker/Constraints/ExtensionConstraint.php +++ b/pluginEnvironmentChecker/Constraints/ExtensionConstraint.php @@ -15,7 +15,7 @@ class ExtensionConstraint extends AbstractVersionConstraint public function __construct($requiredVersion) { parent::__construct($requiredVersion); - $this->error = 'Required Extension not loaded'; + $this->error = esc_html('Required Extension not loaded'); } /** @@ -25,18 +25,21 @@ public function check() { $this->message = $this->requiredVersion . ' extension is required. Enable it in your server or ask your webhoster to enable it for you.'; + $this->message = esc_html($this->message); if (function_exists('extension_loaded') && !extension_loaded( $this->requiredVersion ) ) { - throw new ConstraintFailedException( + // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped + throw new ConstraintFailedException( $this, $this->requiredVersion, [$this->error], $this->message ); - } + // phpcs:enable WordPress.Security.EscapeOutput.ExceptionNotEscaped + } return true; } } diff --git a/pluginEnvironmentChecker/Constraints/PluginConstraint.php b/pluginEnvironmentChecker/Constraints/PluginConstraint.php index 259f3680..ac1b3ae1 100644 --- a/pluginEnvironmentChecker/Constraints/PluginConstraint.php +++ b/pluginEnvironmentChecker/Constraints/PluginConstraint.php @@ -18,7 +18,7 @@ class PluginConstraint extends AbstractVersionConstraint public function __construct($requiredVersion, $requiredPluginName, $pluginDisplayName) { parent::__construct($requiredVersion, $requiredPluginName); - $this->error = 'Plugin incompatibility'; + $this->error = esc_html('Plugin incompatibility'); $this->requiredPluginName = $requiredPluginName; $this->pluginDisplayName = $pluginDisplayName; } @@ -33,23 +33,26 @@ public function check() if (!$isPluginActive) { $this->message = "The {$this->pluginDisplayName} plugin must be active. Please install & activate {$this->pluginDisplayName}"; - + // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped throw new ConstraintFailedException( $this, - $this->requiredPluginName, + esc_html($this->requiredPluginName), [$this->error], esc_html($this->message) ); - } + // phpcs:enable WordPress.Security.EscapeOutput.ExceptionNotEscaped + } $pathToPluginFile = $this->absolutePathToPlugin(); if (!$pathToPluginFile) { - throw new ConstraintFailedException( + // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped + throw new ConstraintFailedException( $this, - $this->requiredPluginName, + esc_html($this->requiredPluginName), [$this->error], esc_html("Cannot find absolute path to {$this->pluginDisplayName} plugin") ); + // phpcs:enable WordPress.Security.EscapeOutput.ExceptionNotEscaped } if (!function_exists('get_plugin_data')) { require_once ABSPATH . 'wp-admin/includes/plugin.php'; @@ -59,7 +62,7 @@ public function check() $this->message = "The {$this->pluginDisplayName} plugin has to be version " . $this->requiredVersion . " or higher. Please update your {$this->pluginDisplayName} version."; - + $this->message = esc_html($this->message); return $this->checkVersion( $currentVersion ); diff --git a/pluginEnvironmentChecker/Constraints/WordPressConstraint.php b/pluginEnvironmentChecker/Constraints/WordPressConstraint.php index 5f7a8b02..29dcf167 100644 --- a/pluginEnvironmentChecker/Constraints/WordPressConstraint.php +++ b/pluginEnvironmentChecker/Constraints/WordPressConstraint.php @@ -12,7 +12,7 @@ class WordPressConstraint extends AbstractVersionConstraint public function __construct($requiredVersion) { parent::__construct($requiredVersion); - $this->error = 'Wordpress version incompatibility'; + $this->error = esc_html('Wordpress version incompatibility'); } /** @@ -24,6 +24,7 @@ public function check() $this->message = 'WordPress version has to be ' . $this->requiredVersion . ' or higher. Please update your WordPress version'; + $this->message = esc_html($this->message); return $this->checkVersion( $WPCurrentVersion diff --git a/pluginEnvironmentChecker/EnvironmentChecker.php b/pluginEnvironmentChecker/EnvironmentChecker.php index 1b3da541..bb0ae235 100644 --- a/pluginEnvironmentChecker/EnvironmentChecker.php +++ b/pluginEnvironmentChecker/EnvironmentChecker.php @@ -42,13 +42,15 @@ public function check() $errCount = count($this->errors); if ($errCount) { - throw new ConstraintFailedException( + // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped + throw new ConstraintFailedException( $this, 'General Checker', $this->errors, - $this->__('Validation failed with %1$d errors', [$errCount]) + $this->esc_html__('Validation failed with %1$d errors', [$errCount]) ); - } + // phpcs:enable WordPress.Security.EscapeOutput.ExceptionNotEscaped + } } /** diff --git a/src/Payment/OrderItemsRefunder.php b/src/Payment/OrderItemsRefunder.php index 1e4dc808..0008b7f3 100644 --- a/src/Payment/OrderItemsRefunder.php +++ b/src/Payment/OrderItemsRefunder.php @@ -167,7 +167,7 @@ private function normalizedRemoteItems(array $remoteItems) 'Impossible to retrieve the order item ID related to the remote item: %1$s. Try to do a refund by amount.', 'mollie-payments-for-woocommerce' ), - $remoteItem->id + esc_html($remoteItem->id) ) ); } diff --git a/src/Payment/RefundLineItemsBuilder.php b/src/Payment/RefundLineItemsBuilder.php index b2755993..cdcec51b 100644 --- a/src/Payment/RefundLineItemsBuilder.php +++ b/src/Payment/RefundLineItemsBuilder.php @@ -64,7 +64,7 @@ public function buildLineItems( 'Cannot refund %s item because it was not found in Mollie order. Aborting refund process. Try to do a refund by amount.', 'mollie-payments-for-woocommerce' ), - $toRefundItemId + esc_html($toRefundItemId) ) ); } diff --git a/src/SDK/WordPressHttpAdapter.php b/src/SDK/WordPressHttpAdapter.php index b39d4ce0..185adf0d 100644 --- a/src/SDK/WordPressHttpAdapter.php +++ b/src/SDK/WordPressHttpAdapter.php @@ -45,7 +45,9 @@ public function send($httpMethod, $url, $headers, $httpBody) if (is_wp_error($response)) { $message = $response->get_error_message() ?? 'Unknown error'; $code = is_int($response->get_error_code()) ? $response->get_error_code() : 0; + // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped throw new ApiException(esc_html($message), $code); + // phpcs:enable WordPress.Security.EscapeOutput.ExceptionNotEscaped } return $this->parseResponse($response); diff --git a/src/Shared/Data.php b/src/Shared/Data.php index 7175859a..4334ee6c 100644 --- a/src/Shared/Data.php +++ b/src/Shared/Data.php @@ -270,21 +270,21 @@ public function getFilters( $amountValue = $this->getAmountValue($orderTotal, $currency); if ($amountValue <= 0) { throw new InvalidArgumentException( - sprintf(esc_html__('Amount %s is not valid.', 'mollie-payments-for-woocommerce'), $amountValue) + sprintf(esc_html__('Amount %s is not valid.', 'mollie-payments-for-woocommerce'), esc_html($amountValue)) ); } // Check if currency is in ISO 4217 alpha-3 format (ex: EUR) if (!preg_match('/^[a-zA-Z]{3}$/', $currency)) { throw new InvalidArgumentException( - sprintf(esc_html__('Currency %s is not valid.', 'mollie-payments-for-woocommerce'), $currency) + sprintf(esc_html__('Currency %s is not valid.', 'mollie-payments-for-woocommerce'), esc_html($currency)) ); } // Check if billing country is in ISO 3166-1 alpha-2 format (ex: NL) if (!preg_match('/^[a-zA-Z]{2}$/', $billingCountry)) { throw new InvalidArgumentException( - sprintf(esc_html__('Billing Country %s is not valid.', 'mollie-payments-for-woocommerce'), $billingCountry) + sprintf(esc_html__('Billing Country %s is not valid.', 'mollie-payments-for-woocommerce'), esc_html($billingCountry)) ); } diff --git a/src/Shared/Status.php b/src/Shared/Status.php index 6120476f..69cfc199 100644 --- a/src/Shared/Status.php +++ b/src/Shared/Status.php @@ -193,8 +193,8 @@ public function getMollieApiStatus($apiClient) esc_html__('incorrect API key or other authentication issue. Please check your API keys!', 'mollie-payments-for-woocommerce') ); } - $message = esc_html($apiException->getMessage()); - throw new \Mollie\Api\Exceptions\ApiException($message); + $message = $apiException->getMessage(); + throw new \Mollie\Api\Exceptions\ApiException(esc_html($message)); } } } From 7fa4eb8486aa4c9d984d7c75301ca3c0e4bba256 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Thu, 22 Aug 2024 11:17:00 +0200 Subject: [PATCH 18/19] Fix translators messages --- inc/settings/mollie_advanced_settings.php | 19 ++++--- inc/settings/mollie_applepay_settings.php | 18 +++---- src/Activation/ActivationModule.php | 4 +- src/Activation/ConstraintsChecker.php | 8 ++- .../ApplePayButton/AppleAjaxRequests.php | 4 +- .../ApplePayButton/ApplePayDirectHandler.php | 8 +-- .../PayPalButton/PayPalAjaxRequests.php | 8 +-- src/Gateway/GatewayModule.php | 1 + src/Gateway/MolliePaymentGateway.php | 1 + src/Gateway/Surcharge.php | 4 +- .../Capture/Action/CapturePayment.php | 3 +- src/Payment/MollieOrder.php | 16 +++--- src/Payment/MollieOrderService.php | 8 +-- src/Payment/OrderItemsRefunder.php | 1 + src/Payment/PaymentModule.php | 7 +-- src/Payment/RefundLineItemsBuilder.php | 3 +- src/PaymentMethods/Creditcard.php | 2 +- src/PaymentMethods/Giftcard.php | 6 ++- src/PaymentMethods/Giropay.php | 3 +- .../MybankInstructionStrategy.php | 4 +- src/SDK/WordPressHttpAdapter.php | 3 +- .../General/MollieGeneralSettings.php | 50 +++++++++---------- src/Settings/Settings.php | 4 +- src/Shared/Data.php | 18 +++++-- .../MollieSubscriptionGateway.php | 22 +++++++- 25 files changed, 133 insertions(+), 92 deletions(-) diff --git a/inc/settings/mollie_advanced_settings.php b/inc/settings/mollie_advanced_settings.php index 553eb31c..e2c67aa3 100644 --- a/inc/settings/mollie_advanced_settings.php +++ b/inc/settings/mollie_advanced_settings.php @@ -71,7 +71,8 @@ 'lt_LT' => __('Lithuanian', 'mollie-payments-for-woocommerce'), ], 'desc' => sprintf( - __('Sending a language (or locale) is required. The option \'Automatically send WordPress language\' will try to get the customer\'s language in WordPress (and respects multilanguage plugins) and convert it to a format Mollie understands. If this fails, or if the language is not supported, it will fall back to American English. You can also select one of the locales currently supported by Mollie, that will then be used for all customers.', 'mollie-payments-for-woocommerce'), + /* translators: Placeholder 1: link tag Placeholder 2: closing tag */ + __('Sending a language (or locale) is required. The option \'Automatically send WordPress language\' will try to get the customer\'s language in WordPress (and respects multilanguage plugins) and convert it to a format Mollie understands. If this fails, or if the language is not supported, it will fall back to American English. You can also select one of the locales currently supported by Mollie, that will then be used for all customers.', 'mollie-payments-for-woocommerce'), '', '' ), @@ -80,8 +81,8 @@ [ 'id' => $pluginName . '_customer_details', 'title' => __('Store customer details at Mollie', 'mollie-payments-for-woocommerce'), - /* translators: Placeholder 1: enabled or disabled */ 'desc' => sprintf( + /* translators: Placeholder 1: enabled or disabled Placeholder 2: translated string */ __( 'Should Mollie store customers name and email address for Single Click Payments? Default %1$s. Required if WooCommerce Subscriptions is being used! Read more about %2$s and how it improves your conversion.', 'mollie-payments-for-woocommerce' @@ -110,9 +111,9 @@ ), ], 'default' => PaymentService::PAYMENT_METHOD_TYPE_ORDER, - /* translators: Placeholder 1: opening link tag, placeholder 2: closing link tag */ 'desc' => sprintf( - __( + /* translators: Placeholder 1: opening link tag, placeholder 2: closing link tag */ + __( 'Click %1$shere%2$s to read more about the differences between the Payments and Orders API', 'mollie-payments-for-woocommerce' ), @@ -160,9 +161,9 @@ class="mollie-settings-advanced-payment-desc-label button button-secondary butto array_keys($api_payment_description_labels), $api_payment_description_labels )), - /* translators: Placeholder 1: Opening paragraph tag, placeholder 2: Closing paragraph tag */ sprintf( - __( + /* translators: Placeholder 1: Opening paragraph tag, placeholder 2: Closing paragraph tag */ + __( 'Select among the available variables the description to be used for this transaction.%1$s(Note: this only works when the method is set to Payments API)%2$s', 'mollie-payments-for-woocommerce' ), @@ -180,12 +181,10 @@ class="mollie-settings-advanced-payment-desc-label button button-secondary butto 'type' => 'text', 'custom_attributes' => ['maxlength' => '30'], 'default' => __('Gateway Fee', 'mollie-payments-for-woocommerce'), - 'desc' => sprintf( - __( + 'desc' => __( 'This is the label will appear in frontend when the surcharge applies', 'mollie-payments-for-woocommerce' - ) - ), + ), ], [ 'id' => $pluginName . '_removeOptionsAndTransients', diff --git a/inc/settings/mollie_applepay_settings.php b/inc/settings/mollie_applepay_settings.php index 77346314..eeb804f5 100644 --- a/inc/settings/mollie_applepay_settings.php +++ b/inc/settings/mollie_applepay_settings.php @@ -27,8 +27,8 @@ [ 'id' => 'title', 'title' => __('Title', 'mollie-payments-for-woocommerce'), - /* translators: Placeholder 1: Gateway title */ 'desc' => sprintf( + /* translators: Placeholder 1: Gateway title */ __( 'This controls the title which the user sees during checkout. Default %s', 'mollie-payments-for-woocommerce' @@ -44,12 +44,10 @@ [ 'id' => 'display_logo', 'title' => __('Display logo', 'mollie-payments-for-woocommerce'), - 'desc' => sprintf( - __( + 'desc' => __( 'Display logo', 'mollie-payments-for-woocommerce' - ) - ), + ), 'desc_tip' => true, 'type' => 'checkbox', 'default' => 'yes', @@ -59,8 +57,8 @@ [ 'id' => 'description', 'title' => __('Description', 'mollie-payments-for-woocommerce'), - /* translators: Placeholder 1: Gateway description */ 'desc' => sprintf( + /* translators: Placeholder 1: Gateway description */ __( 'Payment method description that the customer will see on your checkout. Default %s', 'mollie-payments-for-woocommerce' @@ -88,9 +86,9 @@ [ 'id' => 'mollie_apple_pay_button_enabled_cart', 'title' => __('Enable Apple Pay Button on Cart page', 'mollie-payments-for-woocommerce'), - /* translators: Placeholder 1: enabled or disabled */ 'desc' => sprintf( - __( + /* translators: Placeholder 1: enabled or disabled */ + __( 'Enable the Apple Pay direct buy button on the Cart page', 'mollie-payments-for-woocommerce' ), @@ -104,9 +102,9 @@ [ 'id' => 'mollie_apple_pay_button_enabled_product', 'title' => __('Enable Apple Pay Button on Product page', 'mollie-payments-for-woocommerce'), - /* translators: Placeholder 1: enabled or disabled */ 'desc' => sprintf( - __( + /* translators: Placeholder 1: enabled or disabled */ + __( 'Enable the Apple Pay direct buy button on the Product page', 'mollie-payments-for-woocommerce' ), diff --git a/src/Activation/ActivationModule.php b/src/Activation/ActivationModule.php index cca3644b..7fb243c9 100644 --- a/src/Activation/ActivationModule.php +++ b/src/Activation/ActivationModule.php @@ -117,9 +117,9 @@ public function mollieWcNoticeApiKeyMissing() } $notice = new AdminNotice(); - /* translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag to settings. Placeholder 4: Closing link tag.*/ $message = sprintf( - esc_html__( + /* translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag to settings. Placeholder 4: Closing link tag.*/ + esc_html__( '%1$sMollie Payments for WooCommerce: API keys missing%2$s Please%3$s set your API keys here%4$s.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Activation/ConstraintsChecker.php b/src/Activation/ConstraintsChecker.php index ed257e29..861233f8 100644 --- a/src/Activation/ConstraintsChecker.php +++ b/src/Activation/ConstraintsChecker.php @@ -103,11 +103,15 @@ public function maybeShowWarning($constraint, $warning) protected function showNotice(array $errors) { - $message = sprintf(__('%1$sMollie Payments for WooCommerce is inactive:%2$s', 'mollie-payments-for-woocommerce'), '

    ', '

    '); + $message = sprintf( + /* translators: Placeholder 1: opening tags Placeholder 2: closing tags */ + __('%1$sMollie Payments for WooCommerce is inactive:%2$s', 'mollie-payments-for-woocommerce'), '

    ', '

    '); foreach ($errors as $error) { $message .= sprintf('

    %s

    ', $error); } - $message .= sprintf(__('%1$sCorrect the above errors to use Mollie Payments for Woocommerce%2$s', 'mollie-payments-for-woocommerce'), '

    ', '

    '); + $message .= sprintf( + /* translators: Placeholder 1: opening tags Placeholder 2: closing tags */ + __('%1$sCorrect the above errors to use Mollie Payments for Woocommerce%2$s', 'mollie-payments-for-woocommerce'), '

    ', '

    '); $errorLevel = 'notice-error'; $this->notice->addNotice($errorLevel, $message); } diff --git a/src/Buttons/ApplePayButton/AppleAjaxRequests.php b/src/Buttons/ApplePayButton/AppleAjaxRequests.php index aed5f155..1c441b41 100644 --- a/src/Buttons/ApplePayButton/AppleAjaxRequests.php +++ b/src/Buttons/ApplePayButton/AppleAjaxRequests.php @@ -695,9 +695,9 @@ function ($result, $order_id) { ) ); } else { - /* translators: Placeholder 1: Payment method title */ $message = sprintf( - __( + /* translators: Placeholder 1: Payment method title */ + __( 'Could not create %s payment.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Buttons/ApplePayButton/ApplePayDirectHandler.php b/src/Buttons/ApplePayButton/ApplePayDirectHandler.php index bf80e8bb..d945f956 100644 --- a/src/Buttons/ApplePayButton/ApplePayDirectHandler.php +++ b/src/Buttons/ApplePayButton/ApplePayDirectHandler.php @@ -37,9 +37,9 @@ public function __construct(AdminNotice $notice, AppleAjaxRequests $ajaxRequests public function bootstrap($buttonEnabledProduct, $buttonEnabledCart) { if (!$this->isApplePayCompatible()) { - /* translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag to documentation. Placeholder 4: Closing link tag.*/ $message = sprintf( - esc_html__( + /* translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag to documentation. Placeholder 4: Closing link tag.*/ + esc_html__( '%1$sServer not compliant with Apple requirements%2$s Check %3$sApple Server requirements page%4$s to fix it in order to make the Apple Pay button work', 'mollie-payments-for-woocommerce' ), @@ -53,9 +53,9 @@ public function bootstrap($buttonEnabledProduct, $buttonEnabledCart) } if (!$this->merchantValidated()) { - /* translators: Placeholder 1: Opening link tag to documentation. Placeholder 2: Closing link tag.*/ $message = sprintf( - esc_html__( + /* translators: Placeholder 1: Opening link tag to documentation. Placeholder 2: Closing link tag.*/ + esc_html__( 'Apple Pay Validation Error: Please review the %1$sApple Server requirements%2$s. If everything appears correct, click the Apple Pay button to retry validation.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Buttons/PayPalButton/PayPalAjaxRequests.php b/src/Buttons/PayPalButton/PayPalAjaxRequests.php index 17f231bc..d041780c 100644 --- a/src/Buttons/PayPalButton/PayPalAjaxRequests.php +++ b/src/Buttons/PayPalButton/PayPalAjaxRequests.php @@ -108,9 +108,9 @@ public function createWcOrder() ) { wp_send_json_success($result); } else { - /* translators: Placeholder 1: Payment method title */ $message = sprintf( - __( + /* translators: Placeholder 1: Payment method title */ + __( 'Could not create %s payment.', 'mollie-payments-for-woocommerce' ), @@ -152,9 +152,9 @@ public function createWcOrderFromCart() ) { wp_send_json_success($result); } else { - /* translators: Placeholder 1: Payment method title */ $message = sprintf( - __( + /* translators: Placeholder 1: Payment method title */ + __( 'Could not create %s payment.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Gateway/GatewayModule.php b/src/Gateway/GatewayModule.php index 6469639a..0004ef09 100644 --- a/src/Gateway/GatewayModule.php +++ b/src/Gateway/GatewayModule.php @@ -735,6 +735,7 @@ public function addPaymentMethodMandatoryFields($fields, string $gatewayName, st $errors->add( 'validation', sprintf( + /* translators: Placeholder 1: field name. */ __('%s is a required field.', 'woocommerce'), "$fieldLabel" ) diff --git a/src/Gateway/MolliePaymentGateway.php b/src/Gateway/MolliePaymentGateway.php index 5f34cf86..e880f483 100644 --- a/src/Gateway/MolliePaymentGateway.php +++ b/src/Gateway/MolliePaymentGateway.php @@ -649,6 +649,7 @@ protected function noOrderPaymentFailure($orderId): array $this->notice->addNotice( 'error', sprintf( + /* translators: Placeholder 1: order id. */ __( 'Could not load order %s', 'mollie-payments-for-woocommerce' diff --git a/src/Gateway/Surcharge.php b/src/Gateway/Surcharge.php index 6b2f8829..1e3fde3f 100644 --- a/src/Gateway/Surcharge.php +++ b/src/Gateway/Surcharge.php @@ -298,9 +298,9 @@ protected function name_fixed_fee_percentage($paymentMethod) $amountFix = $paymentMethod->getProperty(self::FIXED_FEE); $currency = get_woocommerce_currency_symbol(); $amountPercent = $paymentMethod->getProperty(self::PERCENTAGE); - /* translators: Placeholder 1: Fee amount tag. Placeholder 2: Currency. Placeholder 3: Percentage amount. */ return sprintf( - __(' + %1$s %2$s + %3$s%% fee might apply', 'mollie-payments-for-woocommerce'), + /* translators: Placeholder 1: Fee amount tag. Placeholder 2: Currency. Placeholder 3: Percentage amount. */ + __(' + %1$s %2$s + %3$s%% fee might apply', 'mollie-payments-for-woocommerce'), $currency, $amountFix, $amountPercent diff --git a/src/MerchantCapture/Capture/Action/CapturePayment.php b/src/MerchantCapture/Capture/Action/CapturePayment.php index e4124817..5d1e2b25 100644 --- a/src/MerchantCapture/Capture/Action/CapturePayment.php +++ b/src/MerchantCapture/Capture/Action/CapturePayment.php @@ -49,7 +49,8 @@ public function __invoke() ); $this->order->add_order_note( sprintf( - __( + /* translators: Placeholder 1: Order price */ + __( 'The payment capture of %s has been sent successfully, and we are currently awaiting confirmation.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Payment/MollieOrder.php b/src/Payment/MollieOrder.php index d68aba9f..2155092e 100644 --- a/src/Payment/MollieOrder.php +++ b/src/Payment/MollieOrder.php @@ -755,9 +755,9 @@ public function refund_amount($order, $amount, $paymentObject, $reason) $apiKey = $this->settingsHelper->getApiKey(); if ($paymentObject->isCreated() || $paymentObject->isAuthorized() || $paymentObject->isShipping()) { - /* translators: Placeholder 1: payment status.*/ $noteMessage = sprintf( - _x( + /* translators: Placeholder 1: payment status.*/ + _x( 'Can not refund order amount that has status %1$s at Mollie.', 'Order note error', 'mollie-payments-for-woocommerce' @@ -777,9 +777,9 @@ public function refund_amount($order, $amount, $paymentObject, $reason) ], 'description' => $reason, ]); - /* translators: Placeholder 1: Currency. Placeholder 2: Refund amount. Placeholder 3: Reason. Placeholder 4: Refund id.*/ $noteMessage = sprintf( - __('Amount refund of %1$s%2$s refunded in WooCommerce and at Mollie.%3$s Refund ID: %4$s.', 'mollie-payments-for-woocommerce'), + /* translators: Placeholder 1: Currency. Placeholder 2: Refund amount. Placeholder 3: Reason. Placeholder 4: Refund id.*/ + __('Amount refund of %1$s%2$s refunded in WooCommerce and at Mollie.%3$s Refund ID: %4$s.', 'mollie-payments-for-woocommerce'), $this->dataHelper->getOrderCurrency($order), $amount, ( ! empty($reason) ? ' Reason: ' . $reason . '.' : '' ), @@ -934,9 +934,9 @@ protected function processOrderItemsRefund( ); if ($refund === null) { - /* translators: Placeholder 1: Number of items. Placeholder 2: Name of item. Placeholder 3: Currency. Placeholder 4: Amount.*/ $noteMessage = sprintf( - __( + /* translators: Placeholder 1: Number of items. Placeholder 2: Name of item. Placeholder 3: Currency. Placeholder 4: Amount.*/ + __( '%1$sx %2$s cancelled for %3$s%4$s in WooCommerce and at Mollie.', 'mollie-payments-for-woocommerce' ), @@ -958,9 +958,9 @@ protected function processOrderItemsRefund( $order ) . wc_format_decimal($itemRefundAmount) . (!empty($reason) ? ', reason: ' . $reason : '') ); - /* translators: Placeholder 1: Number of items. Placeholder 2: Name of item. Placeholder 3: Currency. Placeholder 4: Amount. Placeholder 5: Reason. Placeholder 6: Refund Id. */ $noteMessage = sprintf( - __( + /* translators: Placeholder 1: Number of items. Placeholder 2: Name of item. Placeholder 3: Currency. Placeholder 4: Amount. Placeholder 5: Reason. Placeholder 6: Refund Id. */ + __( '%1$sx %2$s refunded for %3$s%4$s in WooCommerce and at Mollie.%5$s Refund ID: %6$s.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Payment/MollieOrderService.php b/src/Payment/MollieOrderService.php index 235a02e4..1b0c85d0 100644 --- a/src/Payment/MollieOrderService.php +++ b/src/Payment/MollieOrderService.php @@ -402,10 +402,10 @@ protected function processChargebacks(WC_Order $order, $payment) __METHOD__ . " New chargeback {$chargebackToProcess} for {$logId}. Order note and order status updated." ); - /* translators: Placeholder 1: Chargeback to process id. */ $order->add_order_note( sprintf( - __( + /* translators: Placeholder 1: Chargeback to process id. */ + __( 'New chargeback %s processed! Order note and order status updated.', 'mollie-payments-for-woocommerce' ), @@ -816,10 +816,10 @@ protected function notifyProcessedRefunds(array $refundsToProcess, string $logId __METHOD__ . " New refund {$refundToProcess} processed in Mollie Dashboard for {$logId} Order note added, but order not updated." ); - /* translators: Placeholder 1: Refund to process id. */ $order->add_order_note( sprintf( - __( + /* translators: Placeholder 1: Refund to process id. */ + __( 'New refund %s processed in Mollie Dashboard! Order note added, but order not updated.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Payment/OrderItemsRefunder.php b/src/Payment/OrderItemsRefunder.php index 0008b7f3..09a9a01c 100644 --- a/src/Payment/OrderItemsRefunder.php +++ b/src/Payment/OrderItemsRefunder.php @@ -163,6 +163,7 @@ private function normalizedRemoteItems(array $remoteItems) if (!$orderItemId) { throw new UnexpectedValueException( sprintf( + /* translators: Placeholder 1: item id. */ esc_html__( 'Impossible to retrieve the order item ID related to the remote item: %1$s. Try to do a refund by amount.', 'mollie-payments-for-woocommerce' diff --git a/src/Payment/PaymentModule.php b/src/Payment/PaymentModule.php index 4d2e8e7d..b0bad152 100644 --- a/src/Payment/PaymentModule.php +++ b/src/Payment/PaymentModule.php @@ -215,9 +215,9 @@ public function addOrderNoteForRefundCreated( WC_Order $order, array $data ) { - $orderNote = sprintf( - __( + /* translators: Placeholder 1: number of items. */ + __( '%1$s items refunded in WooCommerce and at Mollie.', 'mollie-payments-for-woocommerce' ), @@ -235,7 +235,8 @@ public function addOrderNoteForRefundCreated( public function addOrderNoteForCancelledLineItems(array $data, WC_Order $order) { $orderNote = sprintf( - __( + /* translators: Placeholder 1: number of items. */ + __( '%1$s items cancelled in WooCommerce and at Mollie.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Payment/RefundLineItemsBuilder.php b/src/Payment/RefundLineItemsBuilder.php index cdcec51b..5aa071a2 100644 --- a/src/Payment/RefundLineItemsBuilder.php +++ b/src/Payment/RefundLineItemsBuilder.php @@ -60,7 +60,8 @@ public function buildLineItems( if ($toRefundRemoteItem === null) { throw new UnexpectedValueException( sprintf( - esc_html__( + /* translators: Placeholder 1: item id. */ + esc_html__( 'Cannot refund %s item because it was not found in Mollie order. Aborting refund process. Try to do a refund by amount.', 'mollie-payments-for-woocommerce' ), diff --git a/src/PaymentMethods/Creditcard.php b/src/PaymentMethods/Creditcard.php index 4ef1a9ae..237ad4ce 100644 --- a/src/PaymentMethods/Creditcard.php +++ b/src/PaymentMethods/Creditcard.php @@ -50,8 +50,8 @@ protected function includeMollieComponentsFields($generalFormFields) 'mollie_components_enabled' => [ 'type' => 'checkbox', 'title' => __('Enable Mollie Components', 'mollie-payments-for-woocommerce'), - /* translators: Placeholder 1: Mollie Components.*/ 'description' => sprintf( + /* translators: Placeholder 1: Mollie Components.*/ __( 'Use the Mollie Components for this Gateway. Read more about %s and how it improves your conversion.', 'mollie-payments-for-woocommerce' diff --git a/src/PaymentMethods/Giftcard.php b/src/PaymentMethods/Giftcard.php index dbbd3895..742454d4 100644 --- a/src/PaymentMethods/Giftcard.php +++ b/src/PaymentMethods/Giftcard.php @@ -27,7 +27,8 @@ public function debugGiftcardDetails( $orderNoteLine = ""; foreach ($details->giftcards as $giftcard) { $orderNoteLine .= sprintf( - esc_html_x( + /* translators: Placeholder 1: giftcard issuer, Placeholder 2: amount value, Placeholder 3: currency */ + esc_html_x( 'Mollie - Giftcard details: %1$s %2$s %3$s.', 'Placeholder 1: giftcard issuer, Placeholder 2: amount value, Placeholder 3: currency', 'mollie-payments-for-woocommerce' @@ -39,7 +40,8 @@ public function debugGiftcardDetails( } if ($details->remainderMethod) { $orderNoteLine .= sprintf( - esc_html_x( + /* translators: Placeholder 1: Method Placeholder 2: Value Placeholder 3: currency */ + esc_html_x( ' Remainder: %1$s %2$s %3$s.', 'Placeholder 1: remainder method, Placeholder 2: amount value, Placeholder 3: currency', 'mollie-payments-for-woocommerce' diff --git a/src/PaymentMethods/Giropay.php b/src/PaymentMethods/Giropay.php index f7e700fe..825bfe0d 100644 --- a/src/PaymentMethods/Giropay.php +++ b/src/PaymentMethods/Giropay.php @@ -31,7 +31,8 @@ public function getFormFields($generalFormFields): array 'notice' => [ 'title' => sprintf( - __( + /* translators: Placeholder 1: paragraph opening tag Placeholder 2: link url Placeholder 3: closing tags */ + __( '%1$s Paydirekt, the owner of Giropay, has decided to deprecate Giropay. On Monday, 24 June 2024, Mollie was informed that Giropay would cease onboarding new merchants and processing new payments after 30 June 2024. No action is needed from your side. Mollie will automatically remove Giropay as a payment option from your Checkout by 30 June. Subscription renewals and refunds will continue to be processed as usual beyond June 30. More details can be found in the %2$s Giropay Deprecation FAQ. %3$s', 'mollie-payments-for-woocommerce' diff --git a/src/PaymentMethods/InstructionStrategies/MybankInstructionStrategy.php b/src/PaymentMethods/InstructionStrategies/MybankInstructionStrategy.php index 13f8deb0..7980e530 100644 --- a/src/PaymentMethods/InstructionStrategies/MybankInstructionStrategy.php +++ b/src/PaymentMethods/InstructionStrategies/MybankInstructionStrategy.php @@ -15,8 +15,8 @@ public function execute( if ($payment->isPaid() && $payment->details) { return sprintf( - __( - /* translators: Placeholder 1: Mollie_WC_Gateway_MyBank consumer name, placeholder 2: Consumer Account number */ + /* translators: Placeholder 1: Mollie_WC_Gateway_MyBank consumer name, placeholder 2: Consumer Account number */ + __( 'Payment completed by %1$s - %2$s', 'mollie-payments-for-woocommerce' ), diff --git a/src/SDK/WordPressHttpAdapter.php b/src/SDK/WordPressHttpAdapter.php index 185adf0d..53aa5825 100644 --- a/src/SDK/WordPressHttpAdapter.php +++ b/src/SDK/WordPressHttpAdapter.php @@ -102,8 +102,9 @@ protected function parseResponse($response) if ($httpBody) { $message .= ". Request body: {$httpBody}"; } - + // phpcs:disable WordPress.Security.EscapeOutput.ExceptionNotEscaped throw new ApiException(esc_html($message), $statusCode, esc_html($field)); + // phpcs:enable WordPress.Security.EscapeOutput.ExceptionNotEscaped } return $body; diff --git a/src/Settings/General/MollieGeneralSettings.php b/src/Settings/General/MollieGeneralSettings.php index d92ea402..b346516f 100644 --- a/src/Settings/General/MollieGeneralSettings.php +++ b/src/Settings/General/MollieGeneralSettings.php @@ -21,8 +21,8 @@ public function gatewayFormFields( 'mollie-payments-for-woocommerce' ), 'type' => 'checkbox', - /* translators: Placeholder 1: Gateway title */ 'label' => sprintf( + /* translators: Placeholder 1: Gateway title */ __('Enable %s', 'mollie-payments-for-woocommerce'), $defaultTitle ), @@ -49,8 +49,8 @@ public function gatewayFormFields( 'title' => [ 'title' => __('Title', 'mollie-payments-for-woocommerce'), 'type' => 'text', - /* translators: Placeholder 1: Gateway title */ 'description' => sprintf( + /* translators: Placeholder 1: Gateway title */ __( 'This controls the title which the user sees during checkout. Default %s', 'mollie-payments-for-woocommerce' @@ -92,19 +92,17 @@ public function gatewayFormFields( 'default' => null, 'type' => 'file', 'custom_attributes' => ['accept' => '.png, .jpeg, .svg, image/png, image/jpeg'], - 'description' => sprintf( - __( + 'description' => __( 'Upload a custom icon for this gateway. The feature must be enabled.', 'mollie-payments-for-woocommerce' - ) - ), + ), 'desc_tip' => true, ], 'description' => [ 'title' => __('Description', 'mollie-payments-for-woocommerce'), 'type' => 'textarea', - /* translators: Placeholder 1: Gateway description */ 'description' => sprintf( + /* translators: Placeholder 1: Gateway description */ __( 'Payment method description that the customer will see on your checkout. Default %s', 'mollie-payments-for-woocommerce' @@ -116,10 +114,10 @@ public function gatewayFormFields( ], 'sales' => [ 'id' => $defaultTitle . '_' . 'title', - 'title' => sprintf(__( + 'title' => __( 'Sales countries', 'mollie-payments-for-woocommerce' - )), + ), 'type' => 'title', ], 'allowed_countries' => [ @@ -192,19 +190,20 @@ public function gatewayFormFields( 'percentage' => [ 'title' => __('Payment surcharge percentage amount %', 'mollie-payments-for-woocommerce'), 'type' => 'number', - 'description' => sprintf( - __( + 'description' => __( 'Control the percentage fee added on checkout. Default 0.00', 'mollie-payments-for-woocommerce' - ) - ), + ), 'custom_attributes' => ['step' => '0.01', 'min' => '0.00', 'max' => '999'], 'default' => '0.00', 'desc_tip' => true, ], 'surcharge_limit' => [ + 'title' => sprintf( /* translators: Placeholder 1: currency */ - 'title' => sprintf(__('Payment surcharge limit in %s', 'mollie-payments-for-woocommerce'), html_entity_decode(get_woocommerce_currency_symbol())), + __('Payment surcharge limit in %s', 'mollie-payments-for-woocommerce'), + html_entity_decode(get_woocommerce_currency_symbol()) + ), 'type' => 'number', 'description' => sprintf( __( @@ -217,15 +216,16 @@ public function gatewayFormFields( 'desc_tip' => true, ], 'maximum_limit' => [ + 'title' => sprintf( /* translators: Placeholder 1: currency */ - 'title' => sprintf(__('Surcharge only under this limit, in %s', 'mollie-payments-for-woocommerce'), html_entity_decode(get_woocommerce_currency_symbol())), + __('Surcharge only under this limit, in %s', 'mollie-payments-for-woocommerce'), + html_entity_decode(get_woocommerce_currency_symbol()) + ), 'type' => 'number', - 'description' => sprintf( - __( + 'description' => __( 'Maximum order amount to apply surcharge. If the order is above this number the surcharge will not apply. Default 0, means no maximum', 'mollie-payments-for-woocommerce' - ) - ), + ), 'custom_attributes' => ['step' => '0.01', 'min' => '0.00', 'max' => '999'], 'default' => '0.00', 'desc_tip' => true, @@ -258,9 +258,9 @@ public function gatewayFormFields( ), ], 'default' => SharedDataDictionary::STATUS_ON_HOLD, - /* translators: Placeholder 1: Default order status, placeholder 2: Link to 'Hold Stock' setting */ 'description' => sprintf( - __( + /* translators: Placeholder 1: Default order status, placeholder 2: Link to 'Hold Stock' setting */ + __( 'Some payment methods take longer than a few hours to complete. The initial order state is then set to \'%1$s\'. This ensures the order is not cancelled when the setting %2$s is used. This will also prevent the order to be canceled when expired.', 'mollie-payments-for-woocommerce' ), @@ -285,15 +285,13 @@ public function gatewayFormFields( 'default' => 'no', ]; $formFields['order_dueDate'] = [ - 'title' => sprintf(__('Expiry time', 'mollie-payments-for-woocommerce')), + 'title' => __('Expiry time', 'mollie-payments-for-woocommerce'), 'type' => 'number', 'custom_attributes' => ['step' => '1', 'min' => '10', 'max' => '526000'], - 'description' => sprintf( - __( + 'description' => __( 'Number of MINUTES after the order will expire and will be canceled at Mollie and WooCommerce.', 'mollie-payments-for-woocommerce' - ) - ), + ), 'default' => '10', 'desc_tip' => false, ]; diff --git a/src/Settings/Settings.php b/src/Settings/Settings.php index f96afaf9..58e2203b 100644 --- a/src/Settings/Settings.php +++ b/src/Settings/Settings.php @@ -650,6 +650,7 @@ protected function validateUploadedFile(string $fileName, string $fileTempName, $notice = new AdminNotice(); if ($extensionNotAllowed || $fileIsNotAnImage) { $message = sprintf( + /* translators: Placeholder 1: opening tag Placeholder 2: closing tag */ esc_html__( '%1$sMollie Payments for WooCommerce%2$s Unable to upload the file. Only jpg, jpeg, png and gif files are allowed.', 'mollie-payments-for-woocommerce' @@ -663,7 +664,8 @@ protected function validateUploadedFile(string $fileName, string $fileTempName, if ($invalidFileSize) { $message = sprintf( - esc_html__( + /* translators: Placeholder 1: opening tag Placeholder 2: closing tag */ + esc_html__( '%1$sMollie Payments for WooCommerce%2$s Unable to upload the file. Size must be under 500kb.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Shared/Data.php b/src/Shared/Data.php index 4334ee6c..1a12ff5a 100644 --- a/src/Shared/Data.php +++ b/src/Shared/Data.php @@ -270,21 +270,33 @@ public function getFilters( $amountValue = $this->getAmountValue($orderTotal, $currency); if ($amountValue <= 0) { throw new InvalidArgumentException( - sprintf(esc_html__('Amount %s is not valid.', 'mollie-payments-for-woocommerce'), esc_html($amountValue)) + sprintf( + /* translators: Placeholder 1: amount value */ + esc_html__('Amount %s is not valid.', 'mollie-payments-for-woocommerce'), + esc_html($amountValue) + ) ); } // Check if currency is in ISO 4217 alpha-3 format (ex: EUR) if (!preg_match('/^[a-zA-Z]{3}$/', $currency)) { throw new InvalidArgumentException( - sprintf(esc_html__('Currency %s is not valid.', 'mollie-payments-for-woocommerce'), esc_html($currency)) + sprintf( + /* translators: Placeholder 1: currency */ + esc_html__('Currency %s is not valid.', 'mollie-payments-for-woocommerce'), + esc_html($currency) + ) ); } // Check if billing country is in ISO 3166-1 alpha-2 format (ex: NL) if (!preg_match('/^[a-zA-Z]{2}$/', $billingCountry)) { throw new InvalidArgumentException( - sprintf(esc_html__('Billing Country %s is not valid.', 'mollie-payments-for-woocommerce'), esc_html($billingCountry)) + sprintf( + /* translators: Placeholder 1: billing country */ + esc_html__('Billing Country %s is not valid.', 'mollie-payments-for-woocommerce'), + esc_html($billingCountry) + ) ); } diff --git a/src/Subscription/MollieSubscriptionGateway.php b/src/Subscription/MollieSubscriptionGateway.php index 4db77eee..ec3d17fa 100644 --- a/src/Subscription/MollieSubscriptionGateway.php +++ b/src/Subscription/MollieSubscriptionGateway.php @@ -282,7 +282,16 @@ public function scheduled_subscription_payment($renewal_total, WC_Order $renewal ); } } catch (ApiException $e) { - throw new ApiException(sprintf(__('The customer (%s) could not be used or found. ', 'mollie-payments-for-woocommerce') . $e->getMessage(), $customer_id)); + throw new ApiException( + sprintf( + /* translators: Placeholder 1: customer id. */ + __( + 'The customer (%s) could not be used or found. ', + 'mollie-payments-for-woocommerce' + ) . $e->getMessage(), + $customer_id + ) + ); } // Check that there is at least one valid mandate @@ -312,7 +321,16 @@ public function scheduled_subscription_payment($renewal_total, WC_Order $renewal $mandateId = $payment->mandateId; } } else { - throw new ApiException(sprintf(__('The customer (%s) does not have a valid mandate.', 'mollie-payments-for-woocommerce-mandate-problem'), $customer_id)); + throw new ApiException( + sprintf( + /* translators: Placeholder 1: customer id. */ + __( + 'The customer (%s) does not have a valid mandate.', + 'mollie-payments-for-woocommerce-mandate-problem' + ), + $customer_id + ) + ); } } catch (ApiException $e) { throw $e; From 240aaedf23c0f359a2e45ab6c67220772cb434f6 Mon Sep 17 00:00:00 2001 From: carmenmaymo Date: Thu, 22 Aug 2024 11:23:59 +0200 Subject: [PATCH 19/19] Fix cs and tests --- inc/settings/mollie_advanced_settings.php | 12 ++++----- inc/settings/mollie_applepay_settings.php | 10 +++---- src/Activation/ActivationModule.php | 2 +- src/Activation/ConstraintsChecker.php | 10 +++++-- .../ApplePayButton/AppleAjaxRequests.php | 2 +- .../ApplePayButton/ApplePayDirectHandler.php | 4 +-- .../PayPalButton/PayPalAjaxRequests.php | 4 +-- src/Gateway/Surcharge.php | 2 +- .../Capture/Action/CapturePayment.php | 2 +- src/Payment/MollieOrder.php | 8 +++--- src/Payment/MollieOrderService.php | 4 +-- src/Payment/PaymentModule.php | 5 ++-- src/Payment/RefundLineItemsBuilder.php | 2 +- src/PaymentMethods/Giftcard.php | 4 +-- src/PaymentMethods/Giropay.php | 2 +- .../MybankInstructionStrategy.php | 2 +- .../General/MollieGeneralSettings.php | 26 +++++++++---------- src/Settings/Settings.php | 2 +- src/Shared/Data.php | 4 +-- .../Payment/OrderItemsRefunderTest.php | 5 ++-- .../Payment/RefundLineItemsBuilderTest.php | 3 ++- 21 files changed, 62 insertions(+), 53 deletions(-) diff --git a/inc/settings/mollie_advanced_settings.php b/inc/settings/mollie_advanced_settings.php index e2c67aa3..e108e62d 100644 --- a/inc/settings/mollie_advanced_settings.php +++ b/inc/settings/mollie_advanced_settings.php @@ -72,7 +72,7 @@ ], 'desc' => sprintf( /* translators: Placeholder 1: link tag Placeholder 2: closing tag */ - __('Sending a language (or locale) is required. The option \'Automatically send WordPress language\' will try to get the customer\'s language in WordPress (and respects multilanguage plugins) and convert it to a format Mollie understands. If this fails, or if the language is not supported, it will fall back to American English. You can also select one of the locales currently supported by Mollie, that will then be used for all customers.', 'mollie-payments-for-woocommerce'), + __('Sending a language (or locale) is required. The option \'Automatically send WordPress language\' will try to get the customer\'s language in WordPress (and respects multilanguage plugins) and convert it to a format Mollie understands. If this fails, or if the language is not supported, it will fall back to American English. You can also select one of the locales currently supported by Mollie, that will then be used for all customers.', 'mollie-payments-for-woocommerce'), '', '' ), @@ -113,7 +113,7 @@ 'default' => PaymentService::PAYMENT_METHOD_TYPE_ORDER, 'desc' => sprintf( /* translators: Placeholder 1: opening link tag, placeholder 2: closing link tag */ - __( + __( 'Click %1$shere%2$s to read more about the differences between the Payments and Orders API', 'mollie-payments-for-woocommerce' ), @@ -163,7 +163,7 @@ class="mollie-settings-advanced-payment-desc-label button button-secondary butto )), sprintf( /* translators: Placeholder 1: Opening paragraph tag, placeholder 2: Closing paragraph tag */ - __( + __( 'Select among the available variables the description to be used for this transaction.%1$s(Note: this only works when the method is set to Payments API)%2$s', 'mollie-payments-for-woocommerce' ), @@ -182,9 +182,9 @@ class="mollie-settings-advanced-payment-desc-label button button-secondary butto 'custom_attributes' => ['maxlength' => '30'], 'default' => __('Gateway Fee', 'mollie-payments-for-woocommerce'), 'desc' => __( - 'This is the label will appear in frontend when the surcharge applies', - 'mollie-payments-for-woocommerce' - ), + 'This is the label will appear in frontend when the surcharge applies', + 'mollie-payments-for-woocommerce' + ), ], [ 'id' => $pluginName . '_removeOptionsAndTransients', diff --git a/inc/settings/mollie_applepay_settings.php b/inc/settings/mollie_applepay_settings.php index eeb804f5..2ef1c3fa 100644 --- a/inc/settings/mollie_applepay_settings.php +++ b/inc/settings/mollie_applepay_settings.php @@ -45,9 +45,9 @@ 'id' => 'display_logo', 'title' => __('Display logo', 'mollie-payments-for-woocommerce'), 'desc' => __( - 'Display logo', - 'mollie-payments-for-woocommerce' - ), + 'Display logo', + 'mollie-payments-for-woocommerce' + ), 'desc_tip' => true, 'type' => 'checkbox', 'default' => 'yes', @@ -88,7 +88,7 @@ 'title' => __('Enable Apple Pay Button on Cart page', 'mollie-payments-for-woocommerce'), 'desc' => sprintf( /* translators: Placeholder 1: enabled or disabled */ - __( + __( 'Enable the Apple Pay direct buy button on the Cart page', 'mollie-payments-for-woocommerce' ), @@ -104,7 +104,7 @@ 'title' => __('Enable Apple Pay Button on Product page', 'mollie-payments-for-woocommerce'), 'desc' => sprintf( /* translators: Placeholder 1: enabled or disabled */ - __( + __( 'Enable the Apple Pay direct buy button on the Product page', 'mollie-payments-for-woocommerce' ), diff --git a/src/Activation/ActivationModule.php b/src/Activation/ActivationModule.php index 7fb243c9..ec70f8c7 100644 --- a/src/Activation/ActivationModule.php +++ b/src/Activation/ActivationModule.php @@ -119,7 +119,7 @@ public function mollieWcNoticeApiKeyMissing() $notice = new AdminNotice(); $message = sprintf( /* translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag to settings. Placeholder 4: Closing link tag.*/ - esc_html__( + esc_html__( '%1$sMollie Payments for WooCommerce: API keys missing%2$s Please%3$s set your API keys here%4$s.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Activation/ConstraintsChecker.php b/src/Activation/ConstraintsChecker.php index 861233f8..27a662d0 100644 --- a/src/Activation/ConstraintsChecker.php +++ b/src/Activation/ConstraintsChecker.php @@ -105,13 +105,19 @@ protected function showNotice(array $errors) { $message = sprintf( /* translators: Placeholder 1: opening tags Placeholder 2: closing tags */ - __('%1$sMollie Payments for WooCommerce is inactive:%2$s', 'mollie-payments-for-woocommerce'), '

    ', '

    '); + __('%1$sMollie Payments for WooCommerce is inactive:%2$s', 'mollie-payments-for-woocommerce'), + '

    ', + '

    ' + ); foreach ($errors as $error) { $message .= sprintf('

    %s

    ', $error); } $message .= sprintf( /* translators: Placeholder 1: opening tags Placeholder 2: closing tags */ - __('%1$sCorrect the above errors to use Mollie Payments for Woocommerce%2$s', 'mollie-payments-for-woocommerce'), '

    ', '

    '); + __('%1$sCorrect the above errors to use Mollie Payments for Woocommerce%2$s', 'mollie-payments-for-woocommerce'), + '

    ', + '

    ' + ); $errorLevel = 'notice-error'; $this->notice->addNotice($errorLevel, $message); } diff --git a/src/Buttons/ApplePayButton/AppleAjaxRequests.php b/src/Buttons/ApplePayButton/AppleAjaxRequests.php index 1c441b41..59a82fb9 100644 --- a/src/Buttons/ApplePayButton/AppleAjaxRequests.php +++ b/src/Buttons/ApplePayButton/AppleAjaxRequests.php @@ -697,7 +697,7 @@ function ($result, $order_id) { } else { $message = sprintf( /* translators: Placeholder 1: Payment method title */ - __( + __( 'Could not create %s payment.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Buttons/ApplePayButton/ApplePayDirectHandler.php b/src/Buttons/ApplePayButton/ApplePayDirectHandler.php index d945f956..71a9e4af 100644 --- a/src/Buttons/ApplePayButton/ApplePayDirectHandler.php +++ b/src/Buttons/ApplePayButton/ApplePayDirectHandler.php @@ -39,7 +39,7 @@ public function bootstrap($buttonEnabledProduct, $buttonEnabledCart) if (!$this->isApplePayCompatible()) { $message = sprintf( /* translators: Placeholder 1: Opening strong tag. Placeholder 2: Closing strong tag. Placeholder 3: Opening link tag to documentation. Placeholder 4: Closing link tag.*/ - esc_html__( + esc_html__( '%1$sServer not compliant with Apple requirements%2$s Check %3$sApple Server requirements page%4$s to fix it in order to make the Apple Pay button work', 'mollie-payments-for-woocommerce' ), @@ -55,7 +55,7 @@ public function bootstrap($buttonEnabledProduct, $buttonEnabledCart) if (!$this->merchantValidated()) { $message = sprintf( /* translators: Placeholder 1: Opening link tag to documentation. Placeholder 2: Closing link tag.*/ - esc_html__( + esc_html__( 'Apple Pay Validation Error: Please review the %1$sApple Server requirements%2$s. If everything appears correct, click the Apple Pay button to retry validation.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Buttons/PayPalButton/PayPalAjaxRequests.php b/src/Buttons/PayPalButton/PayPalAjaxRequests.php index d041780c..30e65bc3 100644 --- a/src/Buttons/PayPalButton/PayPalAjaxRequests.php +++ b/src/Buttons/PayPalButton/PayPalAjaxRequests.php @@ -110,7 +110,7 @@ public function createWcOrder() } else { $message = sprintf( /* translators: Placeholder 1: Payment method title */ - __( + __( 'Could not create %s payment.', 'mollie-payments-for-woocommerce' ), @@ -154,7 +154,7 @@ public function createWcOrderFromCart() } else { $message = sprintf( /* translators: Placeholder 1: Payment method title */ - __( + __( 'Could not create %s payment.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Gateway/Surcharge.php b/src/Gateway/Surcharge.php index 1e3fde3f..bc966623 100644 --- a/src/Gateway/Surcharge.php +++ b/src/Gateway/Surcharge.php @@ -300,7 +300,7 @@ protected function name_fixed_fee_percentage($paymentMethod) $amountPercent = $paymentMethod->getProperty(self::PERCENTAGE); return sprintf( /* translators: Placeholder 1: Fee amount tag. Placeholder 2: Currency. Placeholder 3: Percentage amount. */ - __(' + %1$s %2$s + %3$s%% fee might apply', 'mollie-payments-for-woocommerce'), + __(' + %1$s %2$s + %3$s%% fee might apply', 'mollie-payments-for-woocommerce'), $currency, $amountFix, $amountPercent diff --git a/src/MerchantCapture/Capture/Action/CapturePayment.php b/src/MerchantCapture/Capture/Action/CapturePayment.php index 5d1e2b25..215fcca4 100644 --- a/src/MerchantCapture/Capture/Action/CapturePayment.php +++ b/src/MerchantCapture/Capture/Action/CapturePayment.php @@ -50,7 +50,7 @@ public function __invoke() $this->order->add_order_note( sprintf( /* translators: Placeholder 1: Order price */ - __( + __( 'The payment capture of %s has been sent successfully, and we are currently awaiting confirmation.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Payment/MollieOrder.php b/src/Payment/MollieOrder.php index 2155092e..f64e5d86 100644 --- a/src/Payment/MollieOrder.php +++ b/src/Payment/MollieOrder.php @@ -757,7 +757,7 @@ public function refund_amount($order, $amount, $paymentObject, $reason) if ($paymentObject->isCreated() || $paymentObject->isAuthorized() || $paymentObject->isShipping()) { $noteMessage = sprintf( /* translators: Placeholder 1: payment status.*/ - _x( + _x( 'Can not refund order amount that has status %1$s at Mollie.', 'Order note error', 'mollie-payments-for-woocommerce' @@ -779,7 +779,7 @@ public function refund_amount($order, $amount, $paymentObject, $reason) ]); $noteMessage = sprintf( /* translators: Placeholder 1: Currency. Placeholder 2: Refund amount. Placeholder 3: Reason. Placeholder 4: Refund id.*/ - __('Amount refund of %1$s%2$s refunded in WooCommerce and at Mollie.%3$s Refund ID: %4$s.', 'mollie-payments-for-woocommerce'), + __('Amount refund of %1$s%2$s refunded in WooCommerce and at Mollie.%3$s Refund ID: %4$s.', 'mollie-payments-for-woocommerce'), $this->dataHelper->getOrderCurrency($order), $amount, ( ! empty($reason) ? ' Reason: ' . $reason . '.' : '' ), @@ -936,7 +936,7 @@ protected function processOrderItemsRefund( if ($refund === null) { $noteMessage = sprintf( /* translators: Placeholder 1: Number of items. Placeholder 2: Name of item. Placeholder 3: Currency. Placeholder 4: Amount.*/ - __( + __( '%1$sx %2$s cancelled for %3$s%4$s in WooCommerce and at Mollie.', 'mollie-payments-for-woocommerce' ), @@ -960,7 +960,7 @@ protected function processOrderItemsRefund( ); $noteMessage = sprintf( /* translators: Placeholder 1: Number of items. Placeholder 2: Name of item. Placeholder 3: Currency. Placeholder 4: Amount. Placeholder 5: Reason. Placeholder 6: Refund Id. */ - __( + __( '%1$sx %2$s refunded for %3$s%4$s in WooCommerce and at Mollie.%5$s Refund ID: %6$s.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Payment/MollieOrderService.php b/src/Payment/MollieOrderService.php index 1b0c85d0..369dae46 100644 --- a/src/Payment/MollieOrderService.php +++ b/src/Payment/MollieOrderService.php @@ -405,7 +405,7 @@ protected function processChargebacks(WC_Order $order, $payment) $order->add_order_note( sprintf( /* translators: Placeholder 1: Chargeback to process id. */ - __( + __( 'New chargeback %s processed! Order note and order status updated.', 'mollie-payments-for-woocommerce' ), @@ -819,7 +819,7 @@ protected function notifyProcessedRefunds(array $refundsToProcess, string $logId $order->add_order_note( sprintf( /* translators: Placeholder 1: Refund to process id. */ - __( + __( 'New refund %s processed in Mollie Dashboard! Order note added, but order not updated.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Payment/PaymentModule.php b/src/Payment/PaymentModule.php index b0bad152..31c721da 100644 --- a/src/Payment/PaymentModule.php +++ b/src/Payment/PaymentModule.php @@ -215,9 +215,10 @@ public function addOrderNoteForRefundCreated( WC_Order $order, array $data ) { + $orderNote = sprintf( /* translators: Placeholder 1: number of items. */ - __( + __( '%1$s items refunded in WooCommerce and at Mollie.', 'mollie-payments-for-woocommerce' ), @@ -236,7 +237,7 @@ public function addOrderNoteForCancelledLineItems(array $data, WC_Order $order) { $orderNote = sprintf( /* translators: Placeholder 1: number of items. */ - __( + __( '%1$s items cancelled in WooCommerce and at Mollie.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Payment/RefundLineItemsBuilder.php b/src/Payment/RefundLineItemsBuilder.php index 5aa071a2..2815fad7 100644 --- a/src/Payment/RefundLineItemsBuilder.php +++ b/src/Payment/RefundLineItemsBuilder.php @@ -61,7 +61,7 @@ public function buildLineItems( throw new UnexpectedValueException( sprintf( /* translators: Placeholder 1: item id. */ - esc_html__( + esc_html__( 'Cannot refund %s item because it was not found in Mollie order. Aborting refund process. Try to do a refund by amount.', 'mollie-payments-for-woocommerce' ), diff --git a/src/PaymentMethods/Giftcard.php b/src/PaymentMethods/Giftcard.php index 742454d4..812e3cd7 100644 --- a/src/PaymentMethods/Giftcard.php +++ b/src/PaymentMethods/Giftcard.php @@ -28,7 +28,7 @@ public function debugGiftcardDetails( foreach ($details->giftcards as $giftcard) { $orderNoteLine .= sprintf( /* translators: Placeholder 1: giftcard issuer, Placeholder 2: amount value, Placeholder 3: currency */ - esc_html_x( + esc_html_x( 'Mollie - Giftcard details: %1$s %2$s %3$s.', 'Placeholder 1: giftcard issuer, Placeholder 2: amount value, Placeholder 3: currency', 'mollie-payments-for-woocommerce' @@ -41,7 +41,7 @@ public function debugGiftcardDetails( if ($details->remainderMethod) { $orderNoteLine .= sprintf( /* translators: Placeholder 1: Method Placeholder 2: Value Placeholder 3: currency */ - esc_html_x( + esc_html_x( ' Remainder: %1$s %2$s %3$s.', 'Placeholder 1: remainder method, Placeholder 2: amount value, Placeholder 3: currency', 'mollie-payments-for-woocommerce' diff --git a/src/PaymentMethods/Giropay.php b/src/PaymentMethods/Giropay.php index 825bfe0d..440b8f0b 100644 --- a/src/PaymentMethods/Giropay.php +++ b/src/PaymentMethods/Giropay.php @@ -32,7 +32,7 @@ public function getFormFields($generalFormFields): array 'title' => sprintf( /* translators: Placeholder 1: paragraph opening tag Placeholder 2: link url Placeholder 3: closing tags */ - __( + __( '%1$s Paydirekt, the owner of Giropay, has decided to deprecate Giropay. On Monday, 24 June 2024, Mollie was informed that Giropay would cease onboarding new merchants and processing new payments after 30 June 2024. No action is needed from your side. Mollie will automatically remove Giropay as a payment option from your Checkout by 30 June. Subscription renewals and refunds will continue to be processed as usual beyond June 30. More details can be found in the %2$s Giropay Deprecation FAQ. %3$s', 'mollie-payments-for-woocommerce' diff --git a/src/PaymentMethods/InstructionStrategies/MybankInstructionStrategy.php b/src/PaymentMethods/InstructionStrategies/MybankInstructionStrategy.php index 7980e530..631e998e 100644 --- a/src/PaymentMethods/InstructionStrategies/MybankInstructionStrategy.php +++ b/src/PaymentMethods/InstructionStrategies/MybankInstructionStrategy.php @@ -16,7 +16,7 @@ public function execute( if ($payment->isPaid() && $payment->details) { return sprintf( /* translators: Placeholder 1: Mollie_WC_Gateway_MyBank consumer name, placeholder 2: Consumer Account number */ - __( + __( 'Payment completed by %1$s - %2$s', 'mollie-payments-for-woocommerce' ), diff --git a/src/Settings/General/MollieGeneralSettings.php b/src/Settings/General/MollieGeneralSettings.php index b346516f..e6ef5457 100644 --- a/src/Settings/General/MollieGeneralSettings.php +++ b/src/Settings/General/MollieGeneralSettings.php @@ -93,9 +93,9 @@ public function gatewayFormFields( 'type' => 'file', 'custom_attributes' => ['accept' => '.png, .jpeg, .svg, image/png, image/jpeg'], 'description' => __( - 'Upload a custom icon for this gateway. The feature must be enabled.', - 'mollie-payments-for-woocommerce' - ), + 'Upload a custom icon for this gateway. The feature must be enabled.', + 'mollie-payments-for-woocommerce' + ), 'desc_tip' => true, ], 'description' => [ @@ -191,9 +191,9 @@ public function gatewayFormFields( 'title' => __('Payment surcharge percentage amount %', 'mollie-payments-for-woocommerce'), 'type' => 'number', 'description' => __( - 'Control the percentage fee added on checkout. Default 0.00', - 'mollie-payments-for-woocommerce' - ), + 'Control the percentage fee added on checkout. Default 0.00', + 'mollie-payments-for-woocommerce' + ), 'custom_attributes' => ['step' => '0.01', 'min' => '0.00', 'max' => '999'], 'default' => '0.00', 'desc_tip' => true, @@ -223,9 +223,9 @@ public function gatewayFormFields( ), 'type' => 'number', 'description' => __( - 'Maximum order amount to apply surcharge. If the order is above this number the surcharge will not apply. Default 0, means no maximum', - 'mollie-payments-for-woocommerce' - ), + 'Maximum order amount to apply surcharge. If the order is above this number the surcharge will not apply. Default 0, means no maximum', + 'mollie-payments-for-woocommerce' + ), 'custom_attributes' => ['step' => '0.01', 'min' => '0.00', 'max' => '999'], 'default' => '0.00', 'desc_tip' => true, @@ -260,7 +260,7 @@ public function gatewayFormFields( 'default' => SharedDataDictionary::STATUS_ON_HOLD, 'description' => sprintf( /* translators: Placeholder 1: Default order status, placeholder 2: Link to 'Hold Stock' setting */ - __( + __( 'Some payment methods take longer than a few hours to complete. The initial order state is then set to \'%1$s\'. This ensures the order is not cancelled when the setting %2$s is used. This will also prevent the order to be canceled when expired.', 'mollie-payments-for-woocommerce' ), @@ -289,9 +289,9 @@ public function gatewayFormFields( 'type' => 'number', 'custom_attributes' => ['step' => '1', 'min' => '10', 'max' => '526000'], 'description' => __( - 'Number of MINUTES after the order will expire and will be canceled at Mollie and WooCommerce.', - 'mollie-payments-for-woocommerce' - ), + 'Number of MINUTES after the order will expire and will be canceled at Mollie and WooCommerce.', + 'mollie-payments-for-woocommerce' + ), 'default' => '10', 'desc_tip' => false, ]; diff --git a/src/Settings/Settings.php b/src/Settings/Settings.php index 58e2203b..c9358964 100644 --- a/src/Settings/Settings.php +++ b/src/Settings/Settings.php @@ -665,7 +665,7 @@ protected function validateUploadedFile(string $fileName, string $fileTempName, if ($invalidFileSize) { $message = sprintf( /* translators: Placeholder 1: opening tag Placeholder 2: closing tag */ - esc_html__( + esc_html__( '%1$sMollie Payments for WooCommerce%2$s Unable to upload the file. Size must be under 500kb.', 'mollie-payments-for-woocommerce' ), diff --git a/src/Shared/Data.php b/src/Shared/Data.php index 1a12ff5a..54230c6d 100644 --- a/src/Shared/Data.php +++ b/src/Shared/Data.php @@ -272,8 +272,8 @@ public function getFilters( throw new InvalidArgumentException( sprintf( /* translators: Placeholder 1: amount value */ - esc_html__('Amount %s is not valid.', 'mollie-payments-for-woocommerce'), - esc_html($amountValue) + esc_html__('Amount %s is not valid.', 'mollie-payments-for-woocommerce'), + esc_html($amountValue) ) ); } diff --git a/tests/php/Functional/Payment/OrderItemsRefunderTest.php b/tests/php/Functional/Payment/OrderItemsRefunderTest.php index 35356308..15e04b90 100644 --- a/tests/php/Functional/Payment/OrderItemsRefunderTest.php +++ b/tests/php/Functional/Payment/OrderItemsRefunderTest.php @@ -250,7 +250,8 @@ public function testUnexpectedValueExceptionWhenBuildRemoteItems() $order = new \WC_Order(); stubs( [ - 'esc_html__' => null + 'esc_html__' => null, + 'esc_html' => null ] ); /** @var WC_Order_Item $orderItem */ @@ -302,7 +303,7 @@ public function testBailIfNoItemsToRefund() $refundReason = uniqid(); stubs( [ - 'esc_html__' => null + 'esc_html__' => null, ] ); diff --git a/tests/php/Functional/Payment/RefundLineItemsBuilderTest.php b/tests/php/Functional/Payment/RefundLineItemsBuilderTest.php index 4c9f9e60..b5924f04 100644 --- a/tests/php/Functional/Payment/RefundLineItemsBuilderTest.php +++ b/tests/php/Functional/Payment/RefundLineItemsBuilderTest.php @@ -340,7 +340,8 @@ public function testBuildLineItemsThrowUnexpectedValueExceptionBecauseRemoteItem $currency = uniqid(); stubs( [ - 'esc_html__' => null + 'esc_html__' => null, + 'esc_html' => null ] );