Skip to content

Cleanup TOTP Provider: Remove legacy PHP 5.6 compatibility logic & duplicate autocomplete attribute#808

Merged
masteradhoc merged 6 commits intoWordPress:masterfrom
masteradhoc:remove-php-version-compare
Feb 28, 2026
Merged

Cleanup TOTP Provider: Remove legacy PHP 5.6 compatibility logic & duplicate autocomplete attribute#808
masteradhoc merged 6 commits intoWordPress:masterfrom
masteradhoc:remove-php-version-compare

Conversation

@masteradhoc
Copy link
Collaborator

What?

Refactors pack64() to remove outdated PHP <5.6 compatibility code while retaining 32-bit support.

  • remove duplicated autocomplete attribute

Why?

PHP 5.6 is no longer supported. The previous implementation contained unnecessary version checks and redundant branching, increasing complexity without benefit.

How?

  • Removed version_compare logic.
  • Simplified to a single early-return structure.
  • Retained 32-bit fallback using manual high/low 32-bit packing.
  • Kept PHP_INT_SIZE >= 8 for defensive architecture handling.

Changelog Entry

Changed - Simplified pack64() implementation by removing legacy PHP compatibility logic while retaining 32-bit support.
Changed - Remove duplicated data attribute for autocomplete

@github-actions
Copy link

github-actions bot commented Feb 23, 2026

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.

If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.

Co-authored-by: masteradhoc <masteradhoc@git.wordpress.org>
Co-authored-by: georgestephanis <georgestephanis@git.wordpress.org>
Co-authored-by: kasparsd <kasparsd@git.wordpress.org>

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

@masteradhoc masteradhoc added this to the 0.16.0 milestone Feb 23, 2026
Copy link
Collaborator

@georgestephanis georgestephanis left a comment

Choose a reason for hiding this comment

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

Some whitespace issues that need tidying for core styles. PHPCS can probably catch them automatically?

$lower = $value & $lowmap;

return pack( 'NN', $higher, $lower );
public static function pack64(int $value): string
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should there be a space before the type declaration here after the opening parens?

public static function pack64(int $value): string
{
// Native 64-bit support (modern PHP on 64-bit builds)
if (PHP_INT_SIZE === 8) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Missing whitespace / core style guides here and following.

@masteradhoc masteradhoc self-assigned this Feb 24, 2026
Co-authored-by: George Stephanis <daljo628@gmail.com>
@masteradhoc masteradhoc merged commit 34428d7 into WordPress:master Feb 28, 2026
28 checks passed
@masteradhoc masteradhoc deleted the remove-php-version-compare branch February 28, 2026 21:09
@github-project-automation github-project-automation bot moved this from In review to Done in Two Factor project board Feb 28, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

3 participants