fix: centralize network site status filtering - #453
Conversation
|
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @Junaid-PK. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. Core Committers: Use this line as a base for the props when committing in SVN: To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
🛝 WordPress PlaygroundsBuilt from 68d15ce
|
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #453 +/- ##
============================================
+ Coverage 95.74% 95.79% +0.05%
Complexity 255 255
============================================
Files 21 21
Lines 3076 3066 -10
============================================
- Hits 2945 2937 -8
+ Misses 131 129 -2
Flags with carried forward coverage won't be shown. Click here to find out more. 🚀 New features to boost your workflow:
|
f20da09 to
7e7f059
Compare
|
Hey @Junaid-PK, nice first contribution! When you get a moment, please connect a WordPress.org account so that you get proper attribution once this merges. See comment |
|
Thanks for the reminder, Joe. I’ll link my WordPress.org profile before the PR is merged so the attribution is picked up correctly. |
Co-authored-by: Joe Fusco <6676674+josephfusco@users.noreply.github.com>
7e7f059 to
1d4e8a3
Compare
josephfusco
left a comment
There was a problem hiding this comment.
LGTM! Drop a comment here once your .org account is linked up so we can run the props-bot again and get this merged in.
The network snapshot already removes archived, spam, and deleted sites before downstream callers receive it. This change keeps the status filter at that single source of truth, removes the duplicate arguments from the user-site lookup and hydration queries, and removes the three unreachable
is_array()guards aroundget_sites()results.The two other
is_array()checks in this file remain because they validate option and decoded JSON data rather thanget_sites()return values.Joe Fusco is credited as a co-author for the mutation-tested diagnosis and implementation design in the issue.
Fixes #398
Testing
php -l includes/network-functions.php./vendor/bin/phpcs --standard=phpcs.xml.dist includes/network-functions.php./vendor/bin/phpstan analyse --configuration=phpstan.neon.dist --memory-limit=2G --no-progressThe multisite PHPUnit group could not be run locally because a Docker daemon was unavailable; the existing CI matrix covers it.
Use of AI Tools
AI assistance: Yes
Tool(s): OpenAI coding assistant
Model(s): GPT-5
Used for: Implementing the focused change, rebasing it onto current
main, and running the static checks listed above.