Skip to content

fix: centralize network site status filtering - #453

Merged
josephfusco merged 5 commits into
WordPress:mainfrom
Junaid-PK:fix/network-status-filter
Sep 18, 2026
Merged

josephfusco merged 5 commits into
WordPress:mainfrom
Junaid-PK:fix/network-status-filter

Conversation

@Junaid-PK

Copy link
Copy Markdown
Contributor

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 around get_sites() results.

The two other is_array() checks in this file remain because they validate option and decoded JSON data rather than get_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-progress

The 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.

@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

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 props-bot label.

Unlinked Accounts

The 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:

Props joefusco.

To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook.

@github-actions github-actions Bot added the Needs WP.org Link Author hasn't linked a WordPress.org account yet — confirm before merging so props credit correctly label Sep 2, 2026
@github-actions

github-actions Bot commented Sep 2, 2026

Copy link
Copy Markdown
Contributor

🛝 WordPress Playgrounds

Built from 68d15ce

5 users 40 users
Single site Launch single site, 5 users Launch single site, 40 users
Multisite Launch multisite, 5 users Launch multisite, 40 users

@codecov

codecov Bot commented Sep 2, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.79%. Comparing base (4129ccf) to head (68d15ce).

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     
Flag Coverage Δ
multisite 95.79% <100.00%> (+0.05%) ⬆️
phpunit 71.20% <0.00%> (+0.23%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@josephfusco
josephfusco force-pushed the fix/network-status-filter branch from f20da09 to 7e7f059 Compare September 2, 2026 17:03
github-actions Bot added a commit that referenced this pull request Sep 2, 2026
@josephfusco

Copy link
Copy Markdown
Collaborator

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

@Junaid-PK

Copy link
Copy Markdown
Contributor Author

Thanks for the reminder, Joe. I’ll link my WordPress.org profile before the PR is merged so the attribution is picked up correctly.

@josephfusco josephfusco added the props-bot Manually runs the Props Bot to update the contributor list. label Sep 3, 2026
@github-actions github-actions Bot removed the props-bot Manually runs the Props Bot to update the contributor list. label Sep 3, 2026
Co-authored-by: Joe Fusco <6676674+josephfusco@users.noreply.github.com>
@josephfusco
josephfusco force-pushed the fix/network-status-filter branch from 7e7f059 to 1d4e8a3 Compare September 3, 2026 13:11
github-actions Bot added a commit that referenced this pull request Sep 3, 2026
@josephfusco josephfusco added the props-bot Manually runs the Props Bot to update the contributor list. label Sep 4, 2026
@github-actions github-actions Bot removed the props-bot Manually runs the Props Bot to update the contributor list. label Sep 4, 2026

@josephfusco josephfusco left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

@josephfusco josephfusco added the [Area] Multisite Network-wide presence, aggregation, and Network Admin surfaces label Sep 4, 2026
github-actions Bot added a commit that referenced this pull request Sep 6, 2026
@josephfusco josephfusco added the props-bot Manually runs the Props Bot to update the contributor list. label Sep 8, 2026
@github-actions github-actions Bot removed the props-bot Manually runs the Props Bot to update the contributor list. label Sep 8, 2026
github-actions Bot added a commit that referenced this pull request Sep 9, 2026
github-actions Bot added a commit that referenced this pull request Sep 11, 2026
github-actions Bot added a commit that referenced this pull request Sep 18, 2026
@josephfusco
josephfusco merged commit bbb5e08 into WordPress:main Sep 18, 2026
21 checks passed
@josephfusco josephfusco added this to the 0.6.0 milestone Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

[Area] Multisite Network-wide presence, aggregation, and Network Admin surfaces Needs WP.org Link Author hasn't linked a WordPress.org account yet — confirm before merging so props credit correctly

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Only one of the three network site-status filters is reachable

2 participants