Skip to content

Commit

Permalink
Merge pull request #35 from soderlind/remove/duplicats
Browse files Browse the repository at this point in the history
Remove duplicate code
  • Loading branch information
soderlind authored Jan 11, 2025
2 parents 23d2238 + e005fe2 commit c0d1d4a
Show file tree
Hide file tree
Showing 7 changed files with 18 additions and 17 deletions.
11 changes: 8 additions & 3 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,29 @@
# Changelog

### 1.8.0
### 1.8.1

- Remove duplicate code.

### 1.8.0

> REQUIRE PHP 8.0 OR HIGHER
#### Added

- New Config class to manage plugin constants
- Constructor property promotion for better code organization
- Strict type declarations throughout the codebase

#### Changed

- Increased default search threshold from 2 to 20 sites
- Refactored main class to use modern PHP 8.0+ features
- Improved error handling and null checks
- Better type safety with more specific type declarations
- Simplified plugin initialization

#### Developer Notes

- The Config class now centralizes all plugin constants
- Removed redundant property declarations in favor of constructor property promotion
- Added strict typing for better code reliability
Expand Down Expand Up @@ -281,5 +288,3 @@
### 1.0.x

- Initial release.


2 changes: 1 addition & 1 deletion build/index.asset.php
Original file line number Diff line number Diff line change
@@ -1 +1 @@
<?php return array('dependencies' => array('wp-api-fetch', 'wp-i18n'), 'version' => '8a8e912db6e7c0137fcb');
<?php return array('dependencies' => array('wp-api-fetch', 'wp-i18n'), 'version' => '1ebd4f27cd4018d342f4');
2 changes: 1 addition & 1 deletion build/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "soderlind/super-admin-all-sites-menu",
"description": "For the super admin, replace WP Admin Bar My Sites menu with an All Sites menu.",
"version": "1.8.0",
"version": "1.8.1",
"keywords": [
"wordpress",
"multisite",
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "super-admin-all-sites-menu",
"version": "1.8.0",
"version": "1.8.1",
"description": "For the super admin, replace WP Admin Bar My Sites menu with an All Sites menu.",
"main": "index.js",
"scripts": {
Expand Down
6 changes: 5 additions & 1 deletion readme.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
=== Super Admin All Sites Menu ===
Stable tag: 1.8.0
Stable tag: 1.8.1
Requires at least: 5.6
Tested up to: 6.7
Requires PHP: 8.0
Expand Down Expand Up @@ -108,6 +108,10 @@ You can use the following filters to override the defaults:

== Changelog ==

= 1.8.1 =

* Remove duplicate code

= 1.8.0 =

REQUIRE PHP 8.0 OR HIGHER
Expand Down
10 changes: 1 addition & 9 deletions super-admin-all-sites-menu.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
* Plugin URI: https://github.com/soderlind/super-admin-all-sites-menu
* GitHub Plugin URI: https://github.com/soderlind/super-admin-all-sites-menu
* Description: For the super admin, replace WP Admin Bar My Sites menu with an All Sites menu.
* Version: 1.8.0
* Version: 1.8.1
* Author: Per Soderlind
* Network: true
* Author URI: https://soderlind.no
Expand Down Expand Up @@ -93,14 +93,6 @@ public function action_admin_bar_init(): void {
add_action( 'admin_enqueue_scripts', [ $this, 'action_enqueue_scripts' ] );
add_action( 'wp_enqueue_scripts', [ $this, 'action_enqueue_scripts' ] );
}
add_action( 'wp_insert_site', [ $this, 'update_local_storage' ] );
add_action( 'wp_update_site', [ $this, 'update_local_storage' ] );
add_action( 'wp_delete_site', [ $this, 'update_local_storage' ] );

add_action( 'update_option_blogname', [ $this, 'action_update_option_blogname' ], 10, 3 );

add_action( 'activated_plugin', [ $this, 'plugin_update_local_storage' ], 10, 1 );
add_action( 'deactivated_plugin', [ $this, 'plugin_update_local_storage' ], 10, 1 );

$this->number_of_sites = $this->get_number_of_sites();
}
Expand Down

0 comments on commit c0d1d4a

Please sign in to comment.