Skip to content

Conversation

@galbus
Copy link
Contributor

@galbus galbus commented Nov 26, 2025

This pull request refactors the removal of BeyondWords metadata from posts to make it more maintainable and robust. The main change is to use a centralized method for retrieving all relevant metadata keys, instead of hardcoding them. Additionally, a new unit test ensures this removal process works correctly and does not affect unrelated metadata.

Refactoring and maintainability:

  • Updated PostMetaUtils::removeAllBeyondwordsMetadata to use CoreUtils::getPostMetaKeys('all') for retrieving all BeyondWords-related post meta keys, replacing the previous hardcoded list. This change makes it easier to update supported keys in the future and reduces the risk of missing keys.

Testing improvements:

  • Added a comprehensive PHPUnit test (removeAllBeyondwordsMetadata) to verify that all BeyondWords keys are removed from a post while unrelated custom meta keys remain untouched. This test increases confidence in the correctness of the metadata removal logic.
  • Included the necessary import for CoreUtils in the test file to support the new test.

@galbus galbus added the bug label Nov 26, 2025
@linear
Copy link

linear bot commented Nov 26, 2025

@galbus galbus added the php Pull requests that update Php code label Nov 26, 2025
@galbus galbus self-assigned this Nov 26, 2025
@galbus galbus requested a review from nklhtv November 26, 2025 10:58
@galbus galbus merged commit ac7af3c into main Nov 26, 2025
10 checks passed
@galbus galbus deleted the s-7766-wordpress-magic-embed-inspect-panel branch November 26, 2025 11:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug php Pull requests that update Php code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants