Skip to content

Commit 6498290

Browse files
author
Woo
committed
Updates to 1.9.5
1 parent e737146 commit 6498290

File tree

707 files changed

+722
-714
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

707 files changed

+722
-714
lines changed

changelog.txt

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,11 @@
11
*** Xero Integration ***
22

3+
2025-03-17 - version 1.9.5
4+
* Dev - Bump WooCommerce "tested up to" version 9.8.
5+
* Dev - Bump WooCommerce minimum supported version to 9.6.
6+
* Dev - Add the WordPress Plugin Check GitHub Action and fix all errors it found.
7+
* Dev - Use the `@woocommerce/e2e-utils-playwright` NPM package for E2E tests.
8+
39
2025-02-10 - version 1.9.4
410
* Fix - Improve logging around `refresh_access_token` to avoid invalid request connection status errors.
511
* Dev - Bump WooCommerce "tested up to" version 9.7.

includes/class-wc-xr-invoice-manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -175,7 +175,7 @@ private function send_invoice_core( $order_id, $force = true ) {
175175

176176
$logger->write( 'INVOICE HAS NOT CHANGED, NOT SENDING ORDER WITH ID ' . $order_id );
177177

178-
$order->add_order_note( __( 'Skipping sending Xero Invoice update since there are no changes. Invoice ID: ' . $xero_invoice_id, 'woocommerce-xero' ) );
178+
$order->add_order_note( __( 'Skipping sending Xero Invoice update since there are no changes. Invoice ID: ' . $xero_invoice_id, 'woocommerce-xero' ) ); // phpcs:ignore WordPress.WP.I18n
179179

180180
return false;
181181
}

includes/class-wc-xr-invoice.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -424,7 +424,7 @@ public function to_xml() {
424424
$path = '/post.php?post=' . esc_attr( intval( $order_id ) ) . '&action=edit';
425425
$url = admin_url( $path );
426426
// Check for port number (port numbers in URLs are not allowed by Xero)
427-
$port = parse_url( $url, PHP_URL_PORT );
427+
$port = wp_parse_url( $url, PHP_URL_PORT );
428428
// Only add the Url to the XML if a port number is NOT present
429429
if ( empty( $port ) ) {
430430
$xml .= '<Url>' . esc_url( $url ) . '</Url>';

includes/class-wc-xr-line-item-manager.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -136,7 +136,7 @@ public function build_products( $order ) {
136136
* @return string
137137
*/
138138
public static function detexturize( $string ) {
139-
$string = strip_tags( $string );
139+
$string = wp_strip_all_tags( $string );
140140

141141
$replacements = array(
142142
'&#8211;' => '-',

includes/class-wc-xr-oauth20.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -222,13 +222,13 @@ public static function get_xero_tenant_id() {
222222
* Prevent cloning.
223223
*/
224224
public function __clone() {
225-
wc_doing_it_wrong( __FUNCTION__, __( 'Cloning instances of this class is forbidden.', 'woocommerce' ) );
225+
wc_doing_it_wrong( __FUNCTION__, __( 'Cloning instances of this class is forbidden.', 'woocommerce-xero' ) );
226226
}
227227

228228
/**
229229
* Prevent unserialize.
230230
*/
231231
public function __wakeup() {
232-
wc_doing_it_wrong( __FUNCTION__, __( 'Unserializing instances of this class is forbidden.', 'woocommerce' ) );
232+
wc_doing_it_wrong( __FUNCTION__, __( 'Unserializing instances of this class is forbidden.', 'woocommerce-xero' ) );
233233
}
234234
}

includes/class-wc-xr-payment-manager.php

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -184,6 +184,7 @@ public function send_payment( $order_id ) {
184184
$error_num = (string) $xml_response->ErrorNumber;
185185
$error_msg = (string) $xml_response->Elements->DataContractBase->ValidationErrors->ValidationError->Message;
186186
$order->add_order_note( sprintf(
187+
// translators: Error number and message from Xero.
187188
__( 'ERROR creating Xero payment. ErrorNumber: %1$s | Error Message: %2$s', 'woocommerce-xero' ),
188189
$error_num,
189190
$error_msg

includes/class-wc-xr-privacy.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ protected function maybe_handle_subscription( $order ) {
235235
*/
236236
if ( $subscription->has_status( apply_filters( 'wc_xero_privacy_eraser_subs_statuses', array( 'on-hold', 'active' ) ) ) ) {
237237
/* translators: %d: Order id */
238-
return array( false, true, array( sprintf( __( 'Order ID %d contains an active Subscription' ), $order->get_id() ) ) );
238+
return array( false, true, array( sprintf( __( 'Order ID %d contains an active Subscription', 'woocommerce-xero' ), $order->get_id() ) ) );
239239
}
240240

241241
$renewal_orders = WC_Subscriptions_Renewal_Order::get_renewal_orders( $order->get_id() );

includes/class-wc-xr-settings.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -351,7 +351,7 @@ public function register_settings() {
351351
);
352352

353353
// Register setting
354-
register_setting( 'woocommerce_xero', self::OPTION_PREFIX . $key );
354+
register_setting( 'woocommerce_xero', self::OPTION_PREFIX . $key ); // phpcs:ignore PluginCheck.CodeAnalysis.SettingSanitization.register_settingMissing
355355

356356
}
357357

@@ -632,7 +632,7 @@ public function input_oauth( $args ) {
632632
echo '<div class="wc-xero-oauth-data-complete">';
633633
// Redirect the user to the authorization URL.
634634
echo '<span data-xero-sso data-href="' . esc_url( $authorization_url ) . '" data-label="' . esc_html__( 'Sign in with Xero', 'woocommerce-xero' ) . '"></span>';
635-
echo '<script src="https://edge.xero.com/platform/sso/xero-sso.js" async defer></script>';
635+
echo '<script src="https://edge.xero.com/platform/sso/xero-sso.js" async defer></script>'; // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
636636
echo '</div>';
637637
} else {
638638
/* translators: %1$s: line break tag; %2$s: opening anchor tag; %3$s: closing anchor tag; */

includes/requests/class-wc-xr-request.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -305,7 +305,7 @@ public function do_request_oauth20() {
305305
$oauth_advise = ( ( isset( $oauth_error['oauth_problem_advice'] ) ) ? $oauth_error['oauth_problem_advice'] : '' );
306306

307307
// Throw new exception.
308-
throw new Exception( sprintf( 'Request failed due OAuth error: %s | %s', $oauth_error['oauth_problem'], $oauth_advise ) );
308+
throw new Exception( sprintf( 'Request failed due OAuth error: %s | %s', $oauth_error['oauth_problem'], $oauth_advise ) ); // phpcs:ignore WordPress.Security.EscapeOutput
309309
}
310310

311311
// Check for 401 (Unauthorized), 403 (Forbidden) and 429 (too many requests) error.
@@ -315,7 +315,7 @@ public function do_request_oauth20() {
315315

316316
// Throw new exception.
317317
// translators: %1$d - response code, %2$s - response message.
318-
throw new Exception( sprintf( __( 'Xero request failed due to error: %1$d (%2$s)', 'woocommerce-xero' ), absint( $response_code ), esc_attr( $response_message ) ) );
318+
throw new Exception( sprintf( __( 'Xero request failed due to error: %1$d (%2$s)', 'woocommerce-xero' ), absint( $response_code ), esc_attr( $response_message ) ) ); // phpcs:ignore WordPress.Security.EscapeOutput
319319
}
320320

321321
return true;

languages/woocommerce-xero.pot

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@
22
# This file is distributed under the same license as the WooCommerce Xero Integration package.
33
msgid ""
44
msgstr ""
5-
"Project-Id-Version: WooCommerce Xero Integration 1.9.4\n"
5+
"Project-Id-Version: WooCommerce Xero Integration 1.9.5\n"
66
"Report-Msgid-Bugs-To: https://wordpress.org/support/plugin/woocommerce-xero\n"
7-
"POT-Creation-Date: 2025-02-10 14:38:49+00:00\n"
7+
"POT-Creation-Date: 2025-03-17 13:42:02+00:00\n"
88
"MIME-Version: 1.0\n"
99
"Content-Type: text/plain; charset=utf-8\n"
1010
"Content-Transfer-Encoding: 8bit\n"
@@ -64,7 +64,7 @@ msgstr ""
6464

6565
#: includes/class-wc-xr-invoice-manager.php:246
6666
#: includes/class-wc-xr-invoice-manager.php:327
67-
#: includes/class-wc-xr-payment-manager.php:199
67+
#: includes/class-wc-xr-payment-manager.php:200
6868
msgid "API Rate limit exceeded."
6969
msgstr ""
7070

@@ -111,7 +111,8 @@ msgstr ""
111111
msgid "Xero Payment created. Payment ID: %s"
112112
msgstr ""
113113

114-
#: includes/class-wc-xr-payment-manager.php:187
114+
#: includes/class-wc-xr-payment-manager.php:188
115+
#. translators: Error number and message from Xero.
115116
msgid "ERROR creating Xero payment. ErrorNumber: %1$s | Error Message: %2$s"
116117
msgstr ""
117118

0 commit comments

Comments
 (0)