Skip to content

Code Quality: Remove conditions identified as always false - #13676

Open
arshidkv12 wants to merge 2 commits into
WordPress:trunkfrom
arshidkv12:if.alwaysFalse
Open

arshidkv12 wants to merge 2 commits into
WordPress:trunkfrom
arshidkv12:if.alwaysFalse

Conversation

@arshidkv12

@arshidkv12 arshidkv12 commented Sep 23, 2026 •

Copy link
Copy Markdown

Remove several conditions identified by PHPStan as always false.

  • Remove the unreachable confidence check in wp-admin/install.php.
  • Remove the unused exception state handling in wp-includes/template.php.
  • Remove the always-true interim-login conditional in wp-login.php.
  • Remove the corresponding PHPStan baseline entries.

Trac ticket: https://core.trac.wordpress.org/ticket/65817

Use of AI Tools

AI assistance: Yes
Tool(s): ChatGPT
Model(s): GPT-5.6 Luna
Used for: Reviewing the changes and drafting the commit message and pull request description. The final implementation was reviewed and edited by me.

@github-actions

github-actions Bot commented Sep 23, 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. You can also manually ask me to refresh this list by adding the props-bot label.

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

Props arshidkv12, sergeybiryukov.

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

@github-actions

Copy link
Copy Markdown

Test using WordPress Playground

The changes in this pull request can previewed and tested using a WordPress Playground instance.

WordPress Playground is an experimental project that creates a full WordPress instance entirely within the browser.

Some things to be aware of

  • All changes will be lost when closing a tab with a Playground instance.
  • All changes will be lost when refreshing the page.
  • A fresh instance is created each time the link below is clicked.
  • Every time this pull request is updated, a new ZIP file containing all changes is created. If changes are not reflected in the Playground instance,
    it's possible that the most recent build failed, or has not completed. Check the list of workflow runs to be sure.

For more details about these limitations and more, check out the Limitations page in the WordPress Playground documentation.

Test this pull request with WordPress Playground.

@arshidkv12
arshidkv12 marked this pull request as draft September 23, 2026 08:27
@arshidkv12
arshidkv12 marked this pull request as ready for review September 23, 2026 08:57
wporg-sync pushed a commit that referenced this pull request Sep 25, 2026
The `if ( $interim_login )` check was located inside an `if ( ! $interim_login && ... )` block, so it would always be `false`.

Developed in #13676.

Follow-up to r52058.

Props arshidkv12, SergeyBiryukov.
See #65817.

git-svn-id: https://develop.svn.wordpress.org/trunk@63930 602fd350-edb4-49c9-b593-d223f7449a82
wporg-sync pushed a commit to WordPress/WordPress that referenced this pull request Sep 25, 2026
The `if ( $interim_login )` check was located inside an `if ( ! $interim_login && ... )` block, so it would always be `false`.

Developed in WordPress/wordpress-develop#13676.

Follow-up to r52058.

Props arshidkv12, SergeyBiryukov.
See #65817.
Built from https://develop.svn.wordpress.org/trunk@63930


git-svn-id: http://core.svn.wordpress.org/trunk@63096 1a063a9b-81f0-0310-95a4-ce76da25c4cd
@SergeyBiryukov

Copy link
Copy Markdown
Member

Thanks for the PR!

  • The conditional in wp-admin/install.php should not be removed, it's intentionally there to check if PHP is running, see r13428.
  • The change in wp-includes/template.php is not quite clear to me at the moment, could use some more investigation.
  • Good catch on the interim-login conditional in wp-login.php, committed in r63930.

P.S. Please include a Trac ticket URL in the PR description, so that it is linked to the correct ticket for easier review. I've edited this PR as an example. Thanks!

@arshidkv12

Copy link
Copy Markdown
Author

Thank you. I’ll add the tracking URL in the next PR.

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