From 57bc4fa4922bfa93d6cf743a0b3265d570178aec Mon Sep 17 00:00:00 2001 From: Dennis Ploetner Date: Tue, 21 Oct 2025 15:57:57 +0200 Subject: [PATCH 1/5] Test matrix for PHP added --- .github/workflows/unit-tests.yml | 12 +++++++++++- modules/README.md | 1 + multisyde.php | 2 +- readme.txt | 7 ++++++- 4 files changed, 19 insertions(+), 3 deletions(-) diff --git a/.github/workflows/unit-tests.yml b/.github/workflows/unit-tests.yml index 78e5c8f..9ff0f4b 100644 --- a/.github/workflows/unit-tests.yml +++ b/.github/workflows/unit-tests.yml @@ -2,11 +2,21 @@ name: Unit Tests on: [push] jobs: unit-tests: + name: Unit Tests (PHP ${{ matrix.php-version }}) runs-on: ubuntu-latest + strategy: + matrix: + php-version: ['7.4', '8.3', '8.4'] steps: - name: Checkout uses: actions/checkout@v4 + - name: Setup PHP + uses: shivammathur/setup-php@v2 + with: + php-version: ${{ matrix.php-version }} + tools: composer + coverage: none - name: Composer dependencies - run: composer install + run: composer install --no-interaction --no-progress --prefer-dist - name: PHPUnit Tests run: vendor/bin/phpunit diff --git a/modules/README.md b/modules/README.md index 79f20e7..8bb2642 100644 --- a/modules/README.md +++ b/modules/README.md @@ -14,5 +14,6 @@ This plugin provides various improvements for WordPress multisite installations. | [Introduce `get_site_by()` function for multisite](./GetSiteBy/README.md) | Provides a utility function to retrieve a site object from the multisite network using a specific field such as ID, slug, domain, path, or full URL. This makes it easier to locate subsites without relying on raw SQL or manual loops. | [#40180](https://core.trac.wordpress.org/ticket/40180) | | [Last User login](./LastUserLogin/README.md) | This module enhances the Network Admin Users screen in WordPress Multisite by adding a “Last Login” column. It automatically records the timestamp each time a user logs in and displays it in a readable, timezone-aware format. | [#11](https://github.com/inpsyde/multisyde/issues/11) | | [Site Active Theme](./SiteActiveTheme/README.md) | Displays the active theme (and its version) for each site in the Network Admin > Sites dashboard. This makes it easy for network administrators to quickly audit which themes are used across the network. | [#56458](https://core.trac.wordpress.org/ticket/56458) | +| [Permalink Cleanup](./PermalinkCleanup/README.md) | Automatically removes the `/blog` prefix from the main site's permalink structure in multisite installations to deliver cleaner primary site URLs. | [#24](https://github.com/inpsyde/multisyde/issues/24) | _Made with ❤️ by [Syde](https://syde.com)._ diff --git a/multisyde.php b/multisyde.php index caeb1f4..a443085 100644 --- a/multisyde.php +++ b/multisyde.php @@ -3,7 +3,7 @@ * Plugin Name: MultiSyde * Plugin URI: https://github.com/inpsyde/multisyde * Description: A WordPress plugin that explores potential improvements for WordPress Multisite. - * Version: 1.1.1 + * Version: 1.2.0 * Requires at least: 6.8 * Requires PHP: 7.4 * Author: Syde diff --git a/readme.txt b/readme.txt index 0fa26d3..5dd08b9 100644 --- a/readme.txt +++ b/readme.txt @@ -5,7 +5,7 @@ Tags: multisite, network admin, enhancements, usability, admin tools Requires at least: 6.8 Tested up to: 6.8 Requires PHP: 7.4 -Stable tag: 1.1.1 +Stable tag: 1.2.0 License: GPLv2 or later License URI: http://www.gnu.org/licenses/gpl-2.0.html @@ -29,6 +29,8 @@ MultiSyde follows a modular architecture where each feature addresses specific p **Site Active Theme** - Displays the active theme for each site in the Network Admin dashboard, making it easier to manage themes across the network (addresses Trac [#56458](https://core.trac.wordpress.org/ticket/56458/ "WordPress Trac Ticket #56458")) +**Permalink Cleanup** - Automatically removes the `/blog` prefix from the main site's permalink structure in multisite networks for cleaner URLs (addresses GitHub issue [#24](https://github.com/inpsyde/multisyde/issues/24 "MultiSyde GitHub Issue #24")) + The feature set continues to expand based on community contributions and real-world needs. == Installation == @@ -136,6 +138,9 @@ Update for the latest enhancements and improvements. MultiSyde evolves continuou == Changelog == += 1.2.0 = +* Enhancement: Added [Permalink Cleanup](https://github.com/inpsyde/multisyde/blob/main/modules/PermalinkCleanup/README.md "MultiSyde Permalink Cleanup Module") to automatically remove the `/blog` prefix from the main site's permalink structure in multisite networks. + = 1.1.1 = * MultiSyde is now network-wide activatable only. From aeefc53ecb64a06d88b014d51d3567c9bc21f23f Mon Sep 17 00:00:00 2001 From: Dennis Ploetner Date: Tue, 21 Oct 2025 16:04:53 +0200 Subject: [PATCH 2/5] Yoast polyfills added --- composer.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/composer.json b/composer.json index 6f90d52..9287c73 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,7 @@ "wp-coding-standards/wpcs": "^3.0", "szepeviktor/phpstan-wordpress": "^2.0", "phpstan/extension-installer": "^1.4", - "yoast/phpunit-polyfills": "^3.1", + "yoast/phpunit-polyfills": "^4.0", "phpunit/phpunit": "^9.6", "brain/monkey": "^2.0@dev", "phpstan/phpstan-mockery": "^2.0" From ff987746503186498d9cfd7022f676beeadaa1aa Mon Sep 17 00:00:00 2001 From: Dennis Ploetner Date: Tue, 21 Oct 2025 16:55:10 +0200 Subject: [PATCH 3/5] Polyfill for str_starts_with integrated --- tests/php/unit/bootstrap.php | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/tests/php/unit/bootstrap.php b/tests/php/unit/bootstrap.php index 5880663..e34171e 100644 --- a/tests/php/unit/bootstrap.php +++ b/tests/php/unit/bootstrap.php @@ -6,3 +6,25 @@ * * @package multisyde-unit-tests */ + +if ( ! function_exists( 'str_starts_with' ) ) { + /** + * Polyfill for `str_starts_with()` function added in PHP 8.0. + * + * Performs a case-sensitive check indicating if + * the haystack begins with needle. + * + * @since 5.9.0 + * + * @param string $haystack The string to search in. + * @param string $needle The substring to search for in the `$haystack`. + * @return bool True if `$haystack` starts with `$needle`, otherwise false. + */ + function str_starts_with( $haystack, $needle ) { + if ( '' === $needle ) { + return true; + } + + return 0 === strpos( $haystack, $needle ); + } +} \ No newline at end of file From 8108abbb2417fcb796515f8f3937fde0154c6678 Mon Sep 17 00:00:00 2001 From: Dennis Ploetner Date: Tue, 21 Oct 2025 16:57:06 +0200 Subject: [PATCH 4/5] Yoast polyfill removed --- composer.json | 1 - 1 file changed, 1 deletion(-) diff --git a/composer.json b/composer.json index 9287c73..f20924b 100644 --- a/composer.json +++ b/composer.json @@ -42,7 +42,6 @@ "wp-coding-standards/wpcs": "^3.0", "szepeviktor/phpstan-wordpress": "^2.0", "phpstan/extension-installer": "^1.4", - "yoast/phpunit-polyfills": "^4.0", "phpunit/phpunit": "^9.6", "brain/monkey": "^2.0@dev", "phpstan/phpstan-mockery": "^2.0" From 0abf0343b3af0ab1e830c7ac8a5ceb6a3ab6d368 Mon Sep 17 00:00:00 2001 From: Dennis Ploetner Date: Tue, 21 Oct 2025 17:00:14 +0200 Subject: [PATCH 5/5] Codestyle adjusted --- .phpcs.xml.dist | 1 + tests/php/unit/bootstrap.php | 38 ++++++++++++++++++------------------ 2 files changed, 20 insertions(+), 19 deletions(-) diff --git a/.phpcs.xml.dist b/.phpcs.xml.dist index 94d0411..c0809bc 100644 --- a/.phpcs.xml.dist +++ b/.phpcs.xml.dist @@ -2,6 +2,7 @@ PHPCS example + node_modules/* vendor/* diff --git a/tests/php/unit/bootstrap.php b/tests/php/unit/bootstrap.php index e34171e..6ce1957 100644 --- a/tests/php/unit/bootstrap.php +++ b/tests/php/unit/bootstrap.php @@ -8,23 +8,23 @@ */ if ( ! function_exists( 'str_starts_with' ) ) { - /** - * Polyfill for `str_starts_with()` function added in PHP 8.0. - * - * Performs a case-sensitive check indicating if - * the haystack begins with needle. - * - * @since 5.9.0 - * - * @param string $haystack The string to search in. - * @param string $needle The substring to search for in the `$haystack`. - * @return bool True if `$haystack` starts with `$needle`, otherwise false. - */ - function str_starts_with( $haystack, $needle ) { - if ( '' === $needle ) { - return true; - } + /** + * Polyfill for `str_starts_with()` function added in PHP 8.0. + * + * Performs a case-sensitive check indicating if + * the haystack begins with needle. + * + * @since 5.9.0 + * + * @param string $haystack The string to search in. + * @param string $needle The substring to search for in the `$haystack`. + * @return bool True if `$haystack` starts with `$needle`, otherwise false. + */ + function str_starts_with( $haystack, $needle ) { + if ( '' === $needle ) { + return true; + } - return 0 === strpos( $haystack, $needle ); - } -} \ No newline at end of file + return 0 === strpos( $haystack, $needle ); + } +}