Skip to content

Make: Stop showing “Page not found” to people with no posts or mentions yet - #1259

Open
obenland wants to merge 2 commits into
WordPress:trunkfrom
obenland:fix/make-empty-author-mentions-404
Open

obenland wants to merge 2 commits into
WordPress:trunkfrom
obenland:fix/make-empty-author-mentions-404

Conversation

@obenland

@obenland obenland commented Nov 12, 2026 •

Copy link
Copy Markdown
Member

Fixes https://meta.trac.wordpress.org/ticket/3781

The “My Posts” and “My @Mentions” links in the Make sidebar filter go to the current user’s author archive (/author/<login>/) and mentions archive (?mentions=<login>). When someone hasn’t posted or been mentioned on that site yet, both return a 404 “Page not found”, which reads as a broken link rather than an empty list. Core only keeps an empty author archive as a 200 for site members, and most Make users aren’t members; a mentions archive has no term until the first mention, so it always 404s.

This adds a pre_handle_404 callback to wporg-breathe-2024 that keeps author and mentions archives as a 200 when the user exists, and a no-results-archive.php template part (picked up by the parent theme’s archive.php) that shows “No posts yet” / “No mentions yet” in the same style as the empty search results page, as suggested in comment:1. o2 replaces the server-rendered content when it loads and only draws an empty state for search and 404 views, so an o2_options filter gives these empty archives o2’s search view with the same message in place of “could not find any results”. Unknown users, paged requests, the To Do/Done filters (?resolved=) and other archives behave as before. Both archive types are already noindexed by wporg-seo.

Testing

  1. Log in on a Make site where you have no posts and haven’t been mentioned, e.g. https://make.wordpress.org/core/ with a test account.
  2. Click “My Posts” in the sidebar filter (https://make.wordpress.org/core/author/<your-login>/). Before: 404 “Page not found”. After: 200 with “No posts yet” and “ hasn’t published any posts here yet.”
  3. Click “My @Mentions” (https://make.wordpress.org/core/?mentions=<your-login>). Before: 404. After: 200 with “No mentions yet” and “No posts here mention @ yet.”
  4. On either view, click “To Do” or “Done” in the filter widget and check that nothing changed there.
  5. Check that https://make.wordpress.org/core/author/no-such-user-zzz/ and ?mentions=no-such-user-zzz still return a 404, and that an author with posts still lists them.

I checked the status codes with a script that runs the main query and handle_404() in a multisite wp-env, on a site where the user isn’t a member (before: 404 for both; after: 200 for existing users, 404 for unknown users, paged requests and array query vars), and rendered the template part for both cases. The page itself needs a visual check on a Make site, since the p2-breathe parent theme and o2 aren’t in a local environment.

Props garrett-eclipse (no linked GitHub account).

🤖 Generated with Claude Code

Summary by CodeRabbit

  • Bug Fixes
    • Empty author and mentions archives now load successfully instead of returning a 404 when applicable.
    • Empty author archives display “No posts yet,” while empty mentions archives display “No mentions yet.”
    • Empty archive views now show a message appropriate to the archive type.

…ns yet

The “My Posts” and “My @Mentions” views in the sidebar filter link to the
current user's author and mentions archives. For anyone who hasn't
posted or been mentioned on a site yet, WordPress treats those empty
archives as a 404, so the view reads as broken rather than empty. Core
only spares author archives for site members, and most Make users aren't
members.

Keep those archives as a 200 when the user exists and show a “No posts
yet” or “No mentions yet” message, like the empty search results page.
Unknown users and paged requests still 404.

Fixes #3781.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Copilot AI lite review requested due to automatic review settings November 12, 2026 23:44

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota.

@github-actions

github-actions Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs.

Core Committers: Use this line as a base for the props when committing in SVN:

Props obenland, dd32.

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


Props Bot commands

You can trigger Props Bot actions by commenting on this PR:

  • @propsbot add <username> to give props to a GitHub or WordPress.org user. Requires write access.
  • @propsbot remove <username> to leave a user out of the props. Requires write access.
  • @propsbot refresh to refresh this list. Adding the props-bot label works too.

@coderabbitai

coderabbitai Bot commented Nov 12, 2026 •

Copy link
Copy Markdown

Explain Change →

No actionable comments were generated in the recent review.

Walkthrough

The theme identifies users on author and mentions archives, handles eligible empty archives with HTTP 200 and archive-specific o2 options, and renders archive-specific no-results text. If no user resolves, the template uses the generic no-results template.

Changes: User archive handling

Layer / File(s) Summary
User resolution and empty archive handling
wordpress.org/public_html/wp-content/themes/pub/wporg-breathe-2024/functions.php
get_archive_user() identifies users for author and nonempty mentions queries. Eligible empty user archives receive HTTP 200. The o2 empty state uses an archive-specific message.
Archive-specific no-results output
wordpress.org/public_html/wp-content/themes/pub/wporg-breathe-2024/no-results-archive.php
The template loads the generic no-results template when no user resolves. Otherwise, it displays an escaped heading and message for the archive type.

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix

Suggested labels: [Type] Bug

Merge Risk: Minimal · up to bb971

This change makes empty author and mentions archives return 200 with a clear empty-state message instead of a 404 page. No actionable merge-blocking risk was identified.

Pre-merge checks: Passed 4

Check name Status Explanation
Title check Passed The title names the main change: author and mentions archives for users with no posts or mentions stop returning "Page not found" (404). The raw summary and PR objectives both describe this change: a …
Linked Issues check Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check Passed Check skipped because no linked issues were found for this pull request.
Description Check Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Full details: Title check

Explanation

The title names the main change: author and mentions archives for users with no posts or mentions stop returning "Page not found" (404). The raw summary and PR objectives both describe this change: a pre_handle_404 callback returns 200 for existing users, and a no-results-archive.php template part renders the empty states. The title is specific and matches the changeset.

Finishing Touches

Generate unit tests (beta)

  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

Recent review info

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: ce094223-1445-4afa-98ff-67eb3089f3cf
Commits

Reviewing files that changed from the base of the PR and between 5d22430 and bb97197.

Files selected for processing: 2

  • wordpress.org/public_html/wp-content/themes/pub/wporg-breathe-2024/functions.php
  • wordpress.org/public_html/wp-content/themes/pub/wporg-breathe-2024/no-results-archive.php

Included review availability: This review used your included allowance. Your plan provides up to 2 included reviews per hour; 0 remain after this review.

o2 empties the page content when it loads and only draws an empty state
for search and 404 views, so the “No posts yet” and “No mentions yet”
message never showed on Make sites. Pass the message to o2 as its search
empty state instead.

The To Do and Done filters narrow an author or mentions archive, so an
empty one there doesn't mean the user has no posts. Leave those as they
were.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@obenland

Copy link
Copy Markdown
Member Author

@propsbot add dd32

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants