Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
97 changes: 36 additions & 61 deletions .github/workflows-config/typos.toml
Original file line number Diff line number Diff line change
@@ -1,34 +1,45 @@
[default]
check-comments = true
check-docs = true
check-filenames = true
binary = false
ignore-non-words = false

type = ["de", "en"]
locale = "en"
[files]
extend-exclude = [
".git/",
".psalm/stubs.php",
".psalm/wcs.php",
"modules/ppcp-order-tracking/carriers.php",
# German
"modules/ppcp-wc-gateway/src/Gateway/PayUponInvoice/PayUponInvoice.php",
# Files outside the repository
"node_modules/",
"vendor/",
"*.min.js",
"*.min.css",
]
ignore-hidden = false

# Ignore API keys and two character IDs like 'FO' or "FO"
[default]
extend-ignore-re = [
"\\b[0-9A-Za-z+/_-]{50,}(=|==)?\\b",
"'[A-Za-z0-9]{2}'",
"\"[A-Za-z0-9]{2}\"",
"\\bBig Sur\\b",
"[0-9A-Za-z/+]{64}",
"'PN',",
"'AU' => '[^']+'",
"define\\( 'CONNECT_WOO_SANDBOX_CLIENT_ID', '[^']+'",
# German
"Unter den .*",
"Die Kombination .*",
"Die gewählte .*",
# Lorem ipsum
"Lorem ipsum .*",
"Id cursus metus .*",
"Urna et pharetra .*",
"Mattis nunc sed .*",
"Vestibulum lectus .*",
]

# Known good words
[default.extend-words]
paypal = "paypal"
PayPal = "PayPal"
woocommerce = "woocommerce"
[default.extend-identifiers]
Automattic = "Automattic"
automattic = "automattic"
Sie = "Sie"
sie = "sie"
oder = "oder"
als = "als"

# Define known typos to catch
[default.extend-corrections]
# Typos
Github = "GitHub"
Wordpress = "WordPress"
Woocommerce = "WooCommerce"
Fatslane = "Fastlane"
Fastalne = "Fastlane"
Faslane = "Fastlane"
Expand All @@ -38,39 +49,3 @@ Fastlan = "Fastlane"
Fastlanne = "Fastlane"
Fatstlane = "Fastlane"
Fstlane = "Fastlane"

# Explicit identifier corrections
[default.extend-identifiers]
"Fatslane" = "Fastlane"
"Fastalne" = "Fastlane"
"Faslane" = "Fastlane"
"Fastlain" = "Fastlane"
"Fasltane" = "Fastlane"
"Fastlan" = "Fastlane"
"Fastlanne" = "Fastlane"
"Fatstlane" = "Fastlane"
"Fstlane" = "Fastlane"

# Type-specific configurations
[type.php]
check-comments = true
check-docs = true

[type.js]
extend-glob = []
binary = false
check-filename = true
check-file = true
unicode = true
ignore-hex = true
identifier-leading-digits = false

[files]
extend-exclude = [
"vendor/*",
"node_modules/*",
"*.min.js",
"*.min.css",
"modules/ppcp-order-tracking/*",
"/tests/*"
]
2 changes: 1 addition & 1 deletion changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -579,7 +579,7 @@
* Fix - Error while syncing tracking data to PayPal -> Sync GZD Tracking #1020
* Fix - Fix product price retrieval for variable product buttons #1000
* Fix - All tabs hidden on OXXO tab visit #1048
* Fix - Woocommerce Germanized Invoice bug #1017
* Fix - WooCommerce Germanized Invoice bug #1017
* Fix - Fix shipping address validation #1047
* Fix - Trigger WC JS validation on button click to highlight empty fields #1004
* Fix - Fix PHP 8.1 deprecated error #1009
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ class CheckoutActionHandler {
.then( function ( data ) {
if ( ! data.success ) {
spinner.unblock();
//handle both messages sent from Woocommerce (data.messages) and this plugin (data.data.message)
//handle both messages sent from WooCommerce (data.messages) and this plugin (data.data.message)
if ( typeof data.messages !== 'undefined' ) {
const domParser = new DOMParser();
errorHandler.appendPreparedErrorMessageElement(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function render( array $order_actions, \WC_Order $wc_order ) : array {
/**
* Whether the action should be rendered for a certain WooCommerce order.
*
* @param \WC_Order $order The Woocommerce order.
* @param \WC_Order $order The WooCommerce order.
*
* @return bool
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ public function render( array $order_actions, \WC_Order $wc_order ) : array {
/**
* Whether the action should be rendered for a certain WooCommerce order.
*
* @param \WC_Order $order The Woocommerce order.
* @param \WC_Order $order The WooCommerce order.
*
* @return bool
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -295,7 +295,7 @@ public function previous_transaction( WC_Subscription $subscription, string $vau
return '';
}

// Sort orders by oder ID descending.
// Sort orders by order ID descending.
rsort( $orders );
$current_order = wc_get_order( array_shift( $orders ) );
if ( ! $current_order instanceof WC_Order ) {
Expand Down
2 changes: 1 addition & 1 deletion readme.txt
Original file line number Diff line number Diff line change
Expand Up @@ -735,7 +735,7 @@ If you encounter issues with the PayPal buttons not appearing after an update, p
* Fix - Error while syncing tracking data to PayPal -> Sync GZD Tracking #1020
* Fix - Fix product price retrieval for variable product buttons #1000
* Fix - All tabs hidden on OXXO tab visit #1048
* Fix - Woocommerce Germanized Invoice bug #1017
* Fix - WooCommerce Germanized Invoice bug #1017
* Fix - Fix shipping address validation #1047
* Fix - Trigger WC JS validation on button click to highlight empty fields #1004
* Fix - Fix PHP 8.1 deprecated error #1009
Expand Down
10 changes: 5 additions & 5 deletions tests/PHPUnit/Api/CreateOrderForWcOrderTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,24 +11,24 @@

class CreateOrderForWcOrderTest extends ModularTestCase
{
private $orderProcesor;
private $orderProcessor;

public function setUp(): void {
parent::setUp();

$this->orderProcesor = Mockery::mock(OrderProcessor::class);
$this->orderProcessor = Mockery::mock(OrderProcessor::class);

$this->bootstrapModule([
'wcgateway.order-processor' => function () {
return $this->orderProcesor;
return $this->orderProcessor;
},
]);
}

public function testSuccess(): void {
$wcOrder = Mockery::mock(WC_Order::class);
$ret = Mockery::mock(Order::class);
$this->orderProcesor
$this->orderProcessor
->expects('create_order')
->with($wcOrder)
->andReturn($ret)
Expand All @@ -39,7 +39,7 @@ public function testSuccess(): void {

public function testFailure(): void {
$wcOrder = Mockery::mock(WC_Order::class);
$this->orderProcesor
$this->orderProcessor
->expects('create_order')
->with($wcOrder)
->andThrow(new RuntimeException())
Expand Down
2 changes: 1 addition & 1 deletion tests/PHPUnit/ApiClient/Entity/AuthorizationStatusTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ public function testInvalidStatusProvided()
new AuthorizationStatus('invalid');
}

public function testStatusComparision()
public function testStatusComparison()
{
$authorizationStatus = new AuthorizationStatus('CREATED');

Expand Down
4 changes: 2 additions & 2 deletions tests/PHPUnit/ApiClient/Factory/PurchaseUnitFactoryTest.php
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ public function testWcCartDefault()
$this->assertEquals($shipping, $unit->shipping());
}

public function testWcCartShippingGetsDroppendWhenNoCustomer()
public function testWcCartShippingGetsDroppedWhenNoCustomer()
{
expect('WC')
->andReturn((object) ['customer' => null, 'session' => null]);
Expand Down Expand Up @@ -311,7 +311,7 @@ public function testWcCartShippingGetsDroppendWhenNoCustomer()
$this->assertNull($unit->shipping());
}

public function testWcCartShippingGetsDroppendWhenNoCountryCode()
public function testWcCartShippingGetsDroppedWhenNoCountryCode()
{
expect('WC')
->andReturn((object) ['customer' => Mockery::mock(\WC_Customer::class), 'session' => null]);
Expand Down