Fix code quality issues and improve test framework

This commit is contained in:
2025-04-21 21:23:23 +01:00
parent ed160ed51b
commit 051bc763f8
11 changed files with 155 additions and 75 deletions

View File

@@ -43,9 +43,6 @@ class Admin {
*
* This method is hooked into 'admin_enqueue_scripts'. It checks if the current
* screen is relevant to the plugin before enqueueing assets.
*
*/
public function enqueue_admin_assets(): void {

View File

@@ -21,4 +21,4 @@ if ( is_multisite() ) {
## Testing
For information on testing your plugin in a multisite environment, see the [Testing Framework](.wiki/Testing-Framework.md) documentation.
For information on testing your plugin in a multisite environment, see the [Testing Framework](../../.wiki/Testing-Framework.md) documentation.

View File

@@ -36,7 +36,7 @@ class Multisite {
*
* @return bool Always returns true.
*/
public function is_multisite_compatible() {
public function isMultisiteCompatible() {
return true;
}
@@ -45,9 +45,9 @@ class Multisite {
*
* @return array An empty array as this is just a placeholder.
*/
public function get_network_sites() {
public function getNetworkSites() {
// This is just a placeholder method.
// In a real implementation, you might use get_sites() or a custom query.
return array();
return function_exists('get_sites') ? get_sites(['public' => 1]) : array();
}
}