From d558868f7178367f004721aa5d7c12b68dcf5421 Mon Sep 17 00:00:00 2001 From: vsolovei-smartling Date: Fri, 20 Feb 2026 12:36:32 +0100 Subject: [PATCH 1/2] fix settings page (WP-987) --- .../WP/Table/QueueManagerTableWidget.php | 2 +- .../WP/Table/QueueManagerTableWidgetTest.php | 138 ++++++++++++++++++ 2 files changed, 139 insertions(+), 1 deletion(-) create mode 100644 tests/Smartling/WP/Table/QueueManagerTableWidgetTest.php diff --git a/inc/Smartling/WP/Table/QueueManagerTableWidget.php b/inc/Smartling/WP/Table/QueueManagerTableWidget.php index 206b0ea6..61a6e7d2 100644 --- a/inc/Smartling/WP/Table/QueueManagerTableWidget.php +++ b/inc/Smartling/WP/Table/QueueManagerTableWidget.php @@ -264,7 +264,7 @@ private function getRunningMessage(SmartlingApiException $e): string return self::MESSAGE_RUNNING; } - throw $e; + return '' . __('API error (check credentials)') . ': ' . esc_html($e->getMessage()); } /** diff --git a/tests/Smartling/WP/Table/QueueManagerTableWidgetTest.php b/tests/Smartling/WP/Table/QueueManagerTableWidgetTest.php new file mode 100644 index 00000000..bd9896e8 --- /dev/null +++ b/tests/Smartling/WP/Table/QueueManagerTableWidgetTest.php @@ -0,0 +1,138 @@ +createMock(ConfigurationProfileEntity::class); + $profile->method('getProjectId')->willReturn('testProject'); + + $sourceLocale = $this->createMock(Locale::class); + $sourceLocale->method('getBlogId')->willReturn(1); + $profile->method('getSourceLocale')->willReturn($sourceLocale); + + $settingsManager = $this->createMock(SettingsManager::class); + $settingsManager->method('getActiveProfile')->willReturn($profile); + + $queue = $this->createMock(QueueInterface::class); + $queue->method('stats')->willReturn([ + QueueInterface::QUEUE_NAME_LAST_MODIFIED_CHECK_QUEUE => 0, + QueueInterface::QUEUE_NAME_DOWNLOAD_QUEUE => 0, + ]); + + $uploadQueueManager = $this->createMock(UploadQueueManager::class); + $uploadQueueManager->method('count')->willReturn($uploadQueueCount); + + $submissionManager = $this->createMock(SubmissionManager::class); + $submissionManager->method('getTotalInCheckStatusHelperQueue')->willReturn(0); + $submissionManager->method('findSubmissionForCloning')->willReturn(null); + + $wpProxy = $this->createMock(WordpressFunctionProxyHelper::class); + $wpProxy->method('get_current_blog_id')->willReturn(1); + + return new QueueManagerTableWidget( + $api, + $queue, + $settingsManager, + $submissionManager, + $uploadQueueManager, + $wpProxy, + ); + } + + public function testPrepareItemsDoesNotThrowWhenApiCredentialsAreInvalid(): void + { + $authError = new SmartlingApiException( + [['key' => 'authentication.failed', 'message' => 'Invalid credentials']], + 401, + ); + + $api = $this->createMock(ApiWrapperInterface::class); + $api->method('acquireLock')->willThrowException($authError); + + $widget = $this->buildWidget($api, uploadQueueCount: 3); + + $widget->prepare_items(); + + $this->assertNotEmpty($widget->items); + $uploadRow = $widget->items[0]; + $this->assertStringContainsString('API error', $uploadRow['run_cron']); + $this->assertStringContainsString('Invalid credentials', $uploadRow['run_cron']); + } + + public function testPrepareItemsShowsRunningMessageWhenLockHeld(): void + { + $lockError = new SmartlingApiException( + [['key' => 'resource.locked', 'message' => 'Resource is locked']], + 423, + ); + + $api = $this->createMock(ApiWrapperInterface::class); + $api->method('acquireLock')->willThrowException($lockError); + + $widget = $this->buildWidget($api, uploadQueueCount: 3); + + $widget->prepare_items(); + + $uploadRow = $widget->items[0]; + $this->assertStringContainsString('Running', $uploadRow['run_cron']); + } + } +} From ee16e2a21f2f7aa474eb26d706fe9ae96a32d1a4 Mon Sep 17 00:00:00 2001 From: vsolovei-smartling Date: Mon, 23 Feb 2026 09:41:37 +0100 Subject: [PATCH 2/2] fix tests, bump version, add readme (WP-987) --- composer.json | 2 +- composer.lock | 534 ++++++++++-------- .../WP/Table/QueueManagerTableWidget.php | 12 +- readme.txt | 5 +- smartling-connector.php | 2 +- .../WP/Table/QueueManagerTableWidgetTest.php | 19 +- 6 files changed, 319 insertions(+), 255 deletions(-) diff --git a/composer.json b/composer.json index ae287b9a..0f19e724 100644 --- a/composer.json +++ b/composer.json @@ -1,7 +1,7 @@ { "name": "smartling/wordpress-connector", "license": "GPL-2.0-or-later", - "version": "5.3.0", + "version": "5.3.1", "description": "", "type": "wordpress-plugin", "repositories": [ diff --git a/composer.lock b/composer.lock index dd1e93a1..f9951ba5 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies", "This file is @generated automatically" ], - "content-hash": "5504d9f0a6e6ec4fb046431bf5d8ed86", + "content-hash": "8a8c1a7d119e18868dd7b10aae0a31e3", "packages": [ { "name": "composer/semver", @@ -136,37 +136,47 @@ }, { "name": "guzzlehttp/guzzle", - "version": "6.5.8", + "version": "7.10.0", "source": { "type": "git", "url": "https://github.com/guzzle/guzzle.git", - "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981" + "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/guzzle/zipball/a52f0440530b54fa079ce76e8c5d196a42cad981", - "reference": "a52f0440530b54fa079ce76e8c5d196a42cad981", + "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", + "reference": "b51ac707cfa420b7bfd4e4d5e510ba8008e822b4", "shasum": "" }, "require": { "ext-json": "*", - "guzzlehttp/promises": "^1.0", - "guzzlehttp/psr7": "^1.9", - "php": ">=5.5", - "symfony/polyfill-intl-idn": "^1.17" + "guzzlehttp/promises": "^2.3", + "guzzlehttp/psr7": "^2.8", + "php": "^7.2.5 || ^8.0", + "psr/http-client": "^1.0", + "symfony/deprecation-contracts": "^2.2 || ^3.0" + }, + "provide": { + "psr/http-client-implementation": "1.0" }, "require-dev": { + "bamarni/composer-bin-plugin": "^1.8.2", "ext-curl": "*", - "phpunit/phpunit": "^4.8.35 || ^5.7 || ^6.4 || ^7.0", - "psr/log": "^1.1" + "guzzle/client-integration-tests": "3.0.2", + "php-http/message-factory": "^1.1", + "phpunit/phpunit": "^8.5.39 || ^9.6.20", + "psr/log": "^1.1 || ^2.0 || ^3.0" }, "suggest": { + "ext-curl": "Required for CURL handler support", + "ext-intl": "Required for Internationalized Domain Name (IDN) support", "psr/log": "Required for using the Log middleware" }, "type": "library", "extra": { - "branch-alias": { - "dev-master": "6.5-dev" + "bamarni-bin": { + "bin-links": true, + "forward-command": false } }, "autoload": { @@ -219,19 +229,20 @@ } ], "description": "Guzzle is a PHP HTTP client library", - "homepage": "http://guzzlephp.org/", "keywords": [ "client", "curl", "framework", "http", "http client", + "psr-18", + "psr-7", "rest", "web service" ], "support": { "issues": "https://github.com/guzzle/guzzle/issues", - "source": "https://github.com/guzzle/guzzle/tree/6.5.8" + "source": "https://github.com/guzzle/guzzle/tree/7.10.0" }, "funding": [ { @@ -247,33 +258,37 @@ "type": "tidelift" } ], - "time": "2022-06-20T22:16:07+00:00" + "time": "2025-08-23T22:36:01+00:00" }, { "name": "guzzlehttp/promises", - "version": "1.5.3", + "version": "2.3.0", "source": { "type": "git", "url": "https://github.com/guzzle/promises.git", - "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e" + "reference": "481557b130ef3790cf82b713667b43030dc9c957" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/promises/zipball/67ab6e18aaa14d753cc148911d273f6e6cb6721e", - "reference": "67ab6e18aaa14d753cc148911d273f6e6cb6721e", + "url": "https://api.github.com/repos/guzzle/promises/zipball/481557b130ef3790cf82b713667b43030dc9c957", + "reference": "481557b130ef3790cf82b713667b43030dc9c957", "shasum": "" }, "require": { - "php": ">=5.5" + "php": "^7.2.5 || ^8.0" }, "require-dev": { - "symfony/phpunit-bridge": "^4.4 || ^5.1" + "bamarni/composer-bin-plugin": "^1.8.2", + "phpunit/phpunit": "^8.5.44 || ^9.6.25" }, "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\Promise\\": "src/" } @@ -310,7 +325,7 @@ ], "support": { "issues": "https://github.com/guzzle/promises/issues", - "source": "https://github.com/guzzle/promises/tree/1.5.3" + "source": "https://github.com/guzzle/promises/tree/2.3.0" }, "funding": [ { @@ -326,42 +341,48 @@ "type": "tidelift" } ], - "time": "2023-05-21T12:31:43+00:00" + "time": "2025-08-22T14:34:08+00:00" }, { "name": "guzzlehttp/psr7", - "version": "1.9.1", + "version": "2.8.0", "source": { "type": "git", "url": "https://github.com/guzzle/psr7.git", - "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b" + "reference": "21dc724a0583619cd1652f673303492272778051" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/guzzle/psr7/zipball/e4490cabc77465aaee90b20cfc9a770f8c04be6b", - "reference": "e4490cabc77465aaee90b20cfc9a770f8c04be6b", + "url": "https://api.github.com/repos/guzzle/psr7/zipball/21dc724a0583619cd1652f673303492272778051", + "reference": "21dc724a0583619cd1652f673303492272778051", "shasum": "" }, "require": { - "php": ">=5.4.0", - "psr/http-message": "~1.0", - "ralouphie/getallheaders": "^2.0.5 || ^3.0.0" + "php": "^7.2.5 || ^8.0", + "psr/http-factory": "^1.0", + "psr/http-message": "^1.1 || ^2.0", + "ralouphie/getallheaders": "^3.0" }, "provide": { + "psr/http-factory-implementation": "1.0", "psr/http-message-implementation": "1.0" }, "require-dev": { - "ext-zlib": "*", - "phpunit/phpunit": "~4.8.36 || ^5.7.27 || ^6.5.14 || ^7.5.20 || ^8.5.8 || ^9.3.10" + "bamarni/composer-bin-plugin": "^1.8.2", + "http-interop/http-factory-tests": "0.9.0", + "phpunit/phpunit": "^8.5.44 || ^9.6.25" }, "suggest": { "laminas/laminas-httphandlerrunner": "Emit PSR-7 responses" }, "type": "library", + "extra": { + "bamarni-bin": { + "bin-links": true, + "forward-command": false + } + }, "autoload": { - "files": [ - "src/functions_include.php" - ], "psr-4": { "GuzzleHttp\\Psr7\\": "src/" } @@ -400,6 +421,11 @@ "name": "Tobias Schultze", "email": "webmaster@tubo-world.de", "homepage": "https://github.com/Tobion" + }, + { + "name": "Márk Sági-Kazár", + "email": "mark.sagikazar@gmail.com", + "homepage": "https://sagikazarmark.hu" } ], "description": "PSR-7 message implementation that also provides common utility methods", @@ -415,7 +441,7 @@ ], "support": { "issues": "https://github.com/guzzle/psr7/issues", - "source": "https://github.com/guzzle/psr7/tree/1.9.1" + "source": "https://github.com/guzzle/psr7/tree/2.8.0" }, "funding": [ { @@ -431,7 +457,7 @@ "type": "tidelift" } ], - "time": "2023-04-17T16:00:37+00:00" + "time": "2025-08-23T21:21:41+00:00" }, { "name": "jralph/retry", @@ -662,18 +688,125 @@ }, "time": "2021-11-05T16:50:12+00:00" }, + { + "name": "psr/http-client", + "version": "1.0.3", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-client.git", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-client/zipball/bb5906edc1c324c9a05aa0873d40117941e5fa90", + "reference": "bb5906edc1c324c9a05aa0873d40117941e5fa90", + "shasum": "" + }, + "require": { + "php": "^7.0 || ^8.0", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Client\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "Common interface for HTTP clients", + "homepage": "https://github.com/php-fig/http-client", + "keywords": [ + "http", + "http-client", + "psr", + "psr-18" + ], + "support": { + "source": "https://github.com/php-fig/http-client" + }, + "time": "2023-09-23T14:17:50+00:00" + }, + { + "name": "psr/http-factory", + "version": "1.1.0", + "source": { + "type": "git", + "url": "https://github.com/php-fig/http-factory.git", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/php-fig/http-factory/zipball/2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "reference": "2b4765fddfe3b508ac62f829e852b1501d3f6e8a", + "shasum": "" + }, + "require": { + "php": ">=7.1", + "psr/http-message": "^1.0 || ^2.0" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "psr-4": { + "Psr\\Http\\Message\\": "src/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "PHP-FIG", + "homepage": "https://www.php-fig.org/" + } + ], + "description": "PSR-17: Common interfaces for PSR-7 HTTP message factories", + "keywords": [ + "factory", + "http", + "message", + "psr", + "psr-17", + "psr-7", + "request", + "response" + ], + "support": { + "source": "https://github.com/php-fig/http-factory" + }, + "time": "2024-04-15T12:06:14+00:00" + }, { "name": "psr/http-message", - "version": "1.1", + "version": "2.0", "source": { "type": "git", "url": "https://github.com/php-fig/http-message.git", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba" + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/http-message/zipball/cb6ce4845ce34a8ad9e68117c10ee90a29919eba", - "reference": "cb6ce4845ce34a8ad9e68117c10ee90a29919eba", + "url": "https://api.github.com/repos/php-fig/http-message/zipball/402d35bcb92c70c026d1a6a9883f06b2ead23d71", + "reference": "402d35bcb92c70c026d1a6a9883f06b2ead23d71", "shasum": "" }, "require": { @@ -682,7 +815,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.1.x-dev" + "dev-master": "2.0.x-dev" } }, "autoload": { @@ -697,7 +830,7 @@ "authors": [ { "name": "PHP-FIG", - "homepage": "http://www.php-fig.org/" + "homepage": "https://www.php-fig.org/" } ], "description": "Common interface for HTTP messages", @@ -711,9 +844,9 @@ "response" ], "support": { - "source": "https://github.com/php-fig/http-message/tree/1.1" + "source": "https://github.com/php-fig/http-message/tree/2.0" }, - "time": "2023-04-04T09:50:52+00:00" + "time": "2023-04-04T09:54:51+00:00" }, { "name": "psr/log", @@ -859,16 +992,16 @@ }, { "name": "symfony/cache", - "version": "v6.4.31", + "version": "v6.4.33", "source": { "type": "git", "url": "https://github.com/symfony/cache.git", - "reference": "a1b306757c34b96fe97c0c586f50dceed05c7adb" + "reference": "5b088fa41eb9568748dc255c45e4054c387ba73b" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/cache/zipball/a1b306757c34b96fe97c0c586f50dceed05c7adb", - "reference": "a1b306757c34b96fe97c0c586f50dceed05c7adb", + "url": "https://api.github.com/repos/symfony/cache/zipball/5b088fa41eb9568748dc255c45e4054c387ba73b", + "reference": "5b088fa41eb9568748dc255c45e4054c387ba73b", "shasum": "" }, "require": { @@ -935,7 +1068,7 @@ "psr6" ], "support": { - "source": "https://github.com/symfony/cache/tree/v6.4.31" + "source": "https://github.com/symfony/cache/tree/v6.4.33" }, "funding": [ { @@ -955,7 +1088,7 @@ "type": "tidelift" } ], - "time": "2025-12-27T18:26:25+00:00" + "time": "2026-01-27T15:05:20+00:00" }, { "name": "symfony/cache-contracts", @@ -1484,178 +1617,6 @@ ], "time": "2024-09-09T11:45:10+00:00" }, - { - "name": "symfony/polyfill-intl-idn", - "version": "v1.33.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-idn.git", - "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-idn/zipball/9614ac4d8061dc257ecc64cba1b140873dce8ad3", - "reference": "9614ac4d8061dc257ecc64cba1b140873dce8ad3", - "shasum": "" - }, - "require": { - "php": ">=7.2", - "symfony/polyfill-intl-normalizer": "^1.10" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Idn\\": "" - } - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Laurent Bassin", - "email": "laurent@bassin.info" - }, - { - "name": "Trevor Rowbotham", - "email": "trevor.rowbotham@pm.me" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's idn_to_ascii and idn_to_utf8 functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "idn", - "intl", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-idn/tree/v1.33.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-10T14:38:51+00:00" - }, - { - "name": "symfony/polyfill-intl-normalizer", - "version": "v1.33.0", - "source": { - "type": "git", - "url": "https://github.com/symfony/polyfill-intl-normalizer.git", - "reference": "3833d7255cc303546435cb650316bff708a1c75c" - }, - "dist": { - "type": "zip", - "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", - "reference": "3833d7255cc303546435cb650316bff708a1c75c", - "shasum": "" - }, - "require": { - "php": ">=7.2" - }, - "suggest": { - "ext-intl": "For best performance" - }, - "type": "library", - "extra": { - "thanks": { - "url": "https://github.com/symfony/polyfill", - "name": "symfony/polyfill" - } - }, - "autoload": { - "files": [ - "bootstrap.php" - ], - "psr-4": { - "Symfony\\Polyfill\\Intl\\Normalizer\\": "" - }, - "classmap": [ - "Resources/stubs" - ] - }, - "notification-url": "https://packagist.org/downloads/", - "license": [ - "MIT" - ], - "authors": [ - { - "name": "Nicolas Grekas", - "email": "p@tchwork.com" - }, - { - "name": "Symfony Community", - "homepage": "https://symfony.com/contributors" - } - ], - "description": "Symfony polyfill for intl's Normalizer class and related functions", - "homepage": "https://symfony.com", - "keywords": [ - "compatibility", - "intl", - "normalizer", - "polyfill", - "portable", - "shim" - ], - "support": { - "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" - }, - "funding": [ - { - "url": "https://symfony.com/sponsor", - "type": "custom" - }, - { - "url": "https://github.com/fabpot", - "type": "github" - }, - { - "url": "https://github.com/nicolas-grekas", - "type": "github" - }, - { - "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", - "type": "tidelift" - } - ], - "time": "2024-09-09T11:45:10+00:00" - }, { "name": "symfony/polyfill-mbstring", "version": "v1.33.0", @@ -2772,16 +2733,16 @@ }, { "name": "phpunit/phpunit", - "version": "9.6.31", + "version": "9.6.34", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "945d0b7f346a084ce5549e95289962972c4272e5" + "reference": "b36f02317466907a230d3aa1d34467041271ef4a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/945d0b7f346a084ce5549e95289962972c4272e5", - "reference": "945d0b7f346a084ce5549e95289962972c4272e5", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/b36f02317466907a230d3aa1d34467041271ef4a", + "reference": "b36f02317466907a230d3aa1d34467041271ef4a", "shasum": "" }, "require": { @@ -2803,7 +2764,7 @@ "phpunit/php-timer": "^5.0.3", "sebastian/cli-parser": "^1.0.2", "sebastian/code-unit": "^1.0.8", - "sebastian/comparator": "^4.0.9", + "sebastian/comparator": "^4.0.10", "sebastian/diff": "^4.0.6", "sebastian/environment": "^5.1.5", "sebastian/exporter": "^4.0.8", @@ -2855,7 +2816,7 @@ "support": { "issues": "https://github.com/sebastianbergmann/phpunit/issues", "security": "https://github.com/sebastianbergmann/phpunit/security/policy", - "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.31" + "source": "https://github.com/sebastianbergmann/phpunit/tree/9.6.34" }, "funding": [ { @@ -2879,7 +2840,7 @@ "type": "tidelift" } ], - "time": "2025-12-06T07:45:52+00:00" + "time": "2026-01-27T05:45:00+00:00" }, { "name": "sebastian/cli-parser", @@ -3050,16 +3011,16 @@ }, { "name": "sebastian/comparator", - "version": "4.0.9", + "version": "4.0.10", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/comparator.git", - "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5" + "reference": "e4df00b9b3571187db2831ae9aada2c6efbd715d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/67a2df3a62639eab2cc5906065e9805d4fd5dfc5", - "reference": "67a2df3a62639eab2cc5906065e9805d4fd5dfc5", + "url": "https://api.github.com/repos/sebastianbergmann/comparator/zipball/e4df00b9b3571187db2831ae9aada2c6efbd715d", + "reference": "e4df00b9b3571187db2831ae9aada2c6efbd715d", "shasum": "" }, "require": { @@ -3112,7 +3073,7 @@ ], "support": { "issues": "https://github.com/sebastianbergmann/comparator/issues", - "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.9" + "source": "https://github.com/sebastianbergmann/comparator/tree/4.0.10" }, "funding": [ { @@ -3132,7 +3093,7 @@ "type": "tidelift" } ], - "time": "2025-08-10T06:51:50+00:00" + "time": "2026-01-24T09:22:56+00:00" }, { "name": "sebastian/complexity", @@ -4136,6 +4097,91 @@ ], "time": "2025-06-27T09:58:17+00:00" }, + { + "name": "symfony/polyfill-intl-normalizer", + "version": "v1.33.0", + "source": { + "type": "git", + "url": "https://github.com/symfony/polyfill-intl-normalizer.git", + "reference": "3833d7255cc303546435cb650316bff708a1c75c" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/symfony/polyfill-intl-normalizer/zipball/3833d7255cc303546435cb650316bff708a1c75c", + "reference": "3833d7255cc303546435cb650316bff708a1c75c", + "shasum": "" + }, + "require": { + "php": ">=7.2" + }, + "suggest": { + "ext-intl": "For best performance" + }, + "type": "library", + "extra": { + "thanks": { + "url": "https://github.com/symfony/polyfill", + "name": "symfony/polyfill" + } + }, + "autoload": { + "files": [ + "bootstrap.php" + ], + "psr-4": { + "Symfony\\Polyfill\\Intl\\Normalizer\\": "" + }, + "classmap": [ + "Resources/stubs" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "authors": [ + { + "name": "Nicolas Grekas", + "email": "p@tchwork.com" + }, + { + "name": "Symfony Community", + "homepage": "https://symfony.com/contributors" + } + ], + "description": "Symfony polyfill for intl's Normalizer class and related functions", + "homepage": "https://symfony.com", + "keywords": [ + "compatibility", + "intl", + "normalizer", + "polyfill", + "portable", + "shim" + ], + "support": { + "source": "https://github.com/symfony/polyfill-intl-normalizer/tree/v1.33.0" + }, + "funding": [ + { + "url": "https://symfony.com/sponsor", + "type": "custom" + }, + { + "url": "https://github.com/fabpot", + "type": "github" + }, + { + "url": "https://github.com/nicolas-grekas", + "type": "github" + }, + { + "url": "https://tidelift.com/funding/github/packagist/symfony/symfony", + "type": "tidelift" + } + ], + "time": "2024-09-09T11:45:10+00:00" + }, { "name": "symfony/polyfill-php73", "version": "v1.33.0", @@ -4361,12 +4407,12 @@ "source": { "type": "git", "url": "https://github.com/vsolovei-smartling/namespacer.git", - "reference": "6cd96678866d91b4fb0a15e03285fd6ecc128d82" + "reference": "34f5b44f5af676f606e77016780f50991d15228f" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/vsolovei-smartling/namespacer/zipball/6cd96678866d91b4fb0a15e03285fd6ecc128d82", - "reference": "6cd96678866d91b4fb0a15e03285fd6ecc128d82", + "url": "https://api.github.com/repos/vsolovei-smartling/namespacer/zipball/34f5b44f5af676f606e77016780f50991d15228f", + "reference": "34f5b44f5af676f606e77016780f50991d15228f", "shasum": "" }, "require": { @@ -4404,7 +4450,7 @@ "support": { "source": "https://github.com/vsolovei-smartling/namespacer/tree/master" }, - "time": "2021-12-27T15:30:26+00:00" + "time": "2026-01-14T10:32:20+00:00" } ], "aliases": [], diff --git a/inc/Smartling/WP/Table/QueueManagerTableWidget.php b/inc/Smartling/WP/Table/QueueManagerTableWidget.php index 61a6e7d2..7a7333a0 100644 --- a/inc/Smartling/WP/Table/QueueManagerTableWidget.php +++ b/inc/Smartling/WP/Table/QueueManagerTableWidget.php @@ -32,12 +32,12 @@ public function register(): void } public function __construct( - private ApiWrapperInterface $api, - private QueueInterface $queue, - private SettingsManager $settingsManager, - private SubmissionManager $submissionManager, - private UploadQueueManager $uploadQueueManager, - private WordpressFunctionProxyHelper $wpProxy, + protected ApiWrapperInterface $api, + protected QueueInterface $queue, + protected SettingsManager $settingsManager, + protected SubmissionManager $submissionManager, + protected UploadQueueManager $uploadQueueManager, + protected WordpressFunctionProxyHelper $wpProxy, ) { $this->setSource($_REQUEST); diff --git a/readme.txt b/readme.txt index 1602dd9f..148422fb 100755 --- a/readme.txt +++ b/readme.txt @@ -4,7 +4,7 @@ Tags: translation, localization, multilingual, internationalization, smartling Requires at least: 5.5 Tested up to: 6.9 Requires PHP: 8.0 -Stable tag: 5.3.0 +Stable tag: 5.3.1 License: GPLv2 or later Translate content in WordPress quickly and seamlessly with Smartling, the industry-leading Translation Management System. @@ -62,6 +62,9 @@ Additional information on the Smartling Connector for WordPress can be found [he 3. Track translation status within WordPress from the Submissions Board. View overall progress of submitted translation requests as well as resend updated content. == Changelog == += 5.3.1 = +* Fixed invalid credentials preventing settings page from loading + = 5.3.0 = * Added support for instant machine translation diff --git a/smartling-connector.php b/smartling-connector.php index 2249b1e8..d789fba7 100755 --- a/smartling-connector.php +++ b/smartling-connector.php @@ -11,7 +11,7 @@ * Plugin Name: Smartling Connector * Plugin URI: https://www.smartling.com/products/automate/integrations/wordpress/ * Description: Integrate your WordPress site with Smartling to upload your content and download translations. - * Version: 5.3.0 + * Version: 5.3.1 * Author: Smartling * Author URI: https://www.smartling.com * License: GPL-2.0+ diff --git a/tests/Smartling/WP/Table/QueueManagerTableWidgetTest.php b/tests/Smartling/WP/Table/QueueManagerTableWidgetTest.php index bd9896e8..76749311 100644 --- a/tests/Smartling/WP/Table/QueueManagerTableWidgetTest.php +++ b/tests/Smartling/WP/Table/QueueManagerTableWidgetTest.php @@ -87,14 +87,29 @@ private function buildWidget( $wpProxy = $this->createMock(WordpressFunctionProxyHelper::class); $wpProxy->method('get_current_blog_id')->willReturn(1); - return new QueueManagerTableWidget( + // Use an anonymous subclass to bypass WP_List_Table::__construct(), which + // calls convert_to_screen() / get_current_screen() and requires a fully + // initialised WordPress admin environment that is unavailable in unit tests. + return new class( $api, $queue, $settingsManager, $submissionManager, $uploadQueueManager, $wpProxy, - ); + ) extends QueueManagerTableWidget { + /** @noinspection PhpMissingParentConstructorInspection */ + public function __construct( + protected ApiWrapperInterface $api, + protected QueueInterface $queue, + protected SettingsManager $settingsManager, + protected SubmissionManager $submissionManager, + protected UploadQueueManager $uploadQueueManager, + protected WordpressFunctionProxyHelper $wpProxy, + ) { + $this->setSource([]); + } + }; } public function testPrepareItemsDoesNotThrowWhenApiCredentialsAreInvalid(): void