Skip to content

Commit 8549301

Browse files
authored
Bump to version 1.2.0 (#51)
* Test matrix for PHP added * Yoast polyfills added * Polyfill for str_starts_with integrated * Yoast polyfill removed * Codestyle adjusted
1 parent 02f780c commit 8549301

File tree

7 files changed

+42
-4
lines changed

7 files changed

+42
-4
lines changed

.github/workflows/unit-tests.yml

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,21 @@ name: Unit Tests
22
on: [push]
33
jobs:
44
unit-tests:
5+
name: Unit Tests (PHP ${{ matrix.php-version }})
56
runs-on: ubuntu-latest
7+
strategy:
8+
matrix:
9+
php-version: ['7.4', '8.3', '8.4']
610
steps:
711
- name: Checkout
812
uses: actions/checkout@v4
13+
- name: Setup PHP
14+
uses: shivammathur/setup-php@v2
15+
with:
16+
php-version: ${{ matrix.php-version }}
17+
tools: composer
18+
coverage: none
919
- name: Composer dependencies
10-
run: composer install
20+
run: composer install --no-interaction --no-progress --prefer-dist
1121
- name: PHPUnit Tests
1222
run: vendor/bin/phpunit

.phpcs.xml.dist

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22
<ruleset name="CS">
33
<description>PHPCS example</description>
44
<config name="testVersion" value="7.4-"/>
5+
<exclude-pattern>node_modules/*</exclude-pattern>
56
<exclude-pattern>vendor/*</exclude-pattern>
67

78
<arg value="ps"/>

composer.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,6 @@
4242
"wp-coding-standards/wpcs": "^3.0",
4343
"szepeviktor/phpstan-wordpress": "^2.0",
4444
"phpstan/extension-installer": "^1.4",
45-
"yoast/phpunit-polyfills": "^3.1",
4645
"phpunit/phpunit": "^9.6",
4746
"brain/monkey": "^2.0@dev",
4847
"phpstan/phpstan-mockery": "^2.0"

modules/README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,6 @@ This plugin provides various improvements for WordPress multisite installations.
1414
| [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) |
1515
| [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) |
1616
| [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) |
17+
| [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) |
1718

1819
_Made with ❤️ by [Syde](https://syde.com)._

multisyde.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
* Plugin Name: MultiSyde
44
* Plugin URI: https://github.com/inpsyde/multisyde
55
* Description: A WordPress plugin that explores potential improvements for WordPress Multisite.
6-
* Version: 1.1.1
6+
* Version: 1.2.0
77
* Requires at least: 6.8
88
* Requires PHP: 7.4
99
* Author: Syde

readme.txt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ Tags: multisite, network admin, enhancements, usability, admin tools
55
Requires at least: 6.8
66
Tested up to: 6.8
77
Requires PHP: 7.4
8-
Stable tag: 1.1.1
8+
Stable tag: 1.2.0
99
License: GPLv2 or later
1010
License URI: http://www.gnu.org/licenses/gpl-2.0.html
1111

@@ -29,6 +29,8 @@ MultiSyde follows a modular architecture where each feature addresses specific p
2929

3030
**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"))
3131

32+
**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"))
33+
3234
The feature set continues to expand based on community contributions and real-world needs.
3335

3436
== Installation ==
@@ -136,6 +138,9 @@ Update for the latest enhancements and improvements. MultiSyde evolves continuou
136138

137139
== Changelog ==
138140

141+
= 1.2.0 =
142+
* 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.
143+
139144
= 1.1.1 =
140145
* MultiSyde is now network-wide activatable only.
141146

tests/php/unit/bootstrap.php

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,3 +6,25 @@
66
*
77
* @package multisyde-unit-tests
88
*/
9+
10+
if ( ! function_exists( 'str_starts_with' ) ) {
11+
/**
12+
* Polyfill for `str_starts_with()` function added in PHP 8.0.
13+
*
14+
* Performs a case-sensitive check indicating if
15+
* the haystack begins with needle.
16+
*
17+
* @since 5.9.0
18+
*
19+
* @param string $haystack The string to search in.
20+
* @param string $needle The substring to search for in the `$haystack`.
21+
* @return bool True if `$haystack` starts with `$needle`, otherwise false.
22+
*/
23+
function str_starts_with( $haystack, $needle ) {
24+
if ( '' === $needle ) {
25+
return true;
26+
}
27+
28+
return 0 === strpos( $haystack, $needle );
29+
}
30+
}

0 commit comments

Comments
 (0)