Skip to content

GH#839: test: remove redundant unserialize() calls on get_post_meta() results (GH#839)#845

Merged
superdav42 merged 1 commit intomainfrom
feature/auto-20260414-092624
Apr 14, 2026
Merged

GH#839: test: remove redundant unserialize() calls on get_post_meta() results (GH#839)#845
superdav42 merged 1 commit intomainfrom
feature/auto-20260414-092624

Conversation

@superdav42
Copy link
Copy Markdown
Collaborator

Summary

Removed two remaining redundant unserialize() calls on get_post_meta() results in Site_Duplicator_Postmeta_Test.php. WordPress get_post_meta($id, $key, true) already applies maybe_unserialize() internally, so wrapping with unserialize() fails in PHP 8+ when the returned value is already an array. Commit dd3461d fixed one of three occurrences; this commit fixes the other two in verify_attachment_backfill() and verify_elementor_backfill().

Files Changed

tests/WP_Ultimo/Helpers/Site_Duplicator_Postmeta_Test.php

Runtime Testing

  • Risk level: Low (agent prompts / infrastructure scripts)
  • Verification: self-assessed: test-only change, removes double-unserialize on already-unserialized values; no logic change to production code

Resolves #839


aidevops.sh v3.8.24 plugin for OpenCode v1.4.3 with claude-sonnet-4-6 spent 1m and 2,895 tokens on this as a headless worker.

@superdav42 superdav42 added the origin:interactive Created by interactive user session label Apr 14, 2026
@superdav42
Copy link
Copy Markdown
Collaborator Author

Completion Summary

  • What: Removed two remaining redundant unserialize() calls on get_post_meta() results in Site_Duplicator_Postmeta_Test.php. WordPress get_post_meta($id, $key, true) already applies maybe_unserialize() internally, so wrapping with unserialize() fails in PHP 8+ when the returned value is already an array. Commit dd3461d fixed one of three occurrences; this commit fixes the other two in verify_attachment_backfill() and verify_elementor_backfill().
  • Issue: quality-debt: tests/WP_Ultimo/Helpers/Site_Duplicator_Postmeta_Test.php — PR #825 review feedback (high) #839
  • Files changed: tests/WP_Ultimo/Helpers/Site_Duplicator_Postmeta_Test.php
  • Testing: self-assessed: test-only change, removes double-unserialize on already-unserialized values; no logic change to production code
  • Key decisions: none

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai bot commented Apr 14, 2026

Warning

Rate limit exceeded

@superdav42 has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 54 minutes and 5 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 54 minutes and 5 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Pro

Run ID: 6b21f824-41a3-4b8c-8ec3-bc914efc8f49

📥 Commits

Reviewing files that changed from the base of the PR and between 09a8977 and 1bd9d4c.

📒 Files selected for processing (1)
  • tests/WP_Ultimo/Helpers/Site_Duplicator_Postmeta_Test.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/auto-20260414-092624

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

Comment @coderabbitai help to get the list of available commands and usage tips.

@github-actions
Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

… (GH#839)

get_post_meta($id, $key, true) already applies maybe_unserialize() internally,
so calling unserialize() again on the returned value fails in PHP 8+ because the
value is already an array, not a serialized string.

Two remaining occurrences in verify_attachment_backfill() and
verify_elementor_backfill() were missed by commit dd3461d. This removes them,
completing the fix for all three instances flagged in PR #825 review.

Fixes #839
@superdav42 superdav42 force-pushed the feature/auto-20260414-092624 branch from 2bb772d to 1bd9d4c Compare April 14, 2026 15:33
@superdav42 superdav42 merged commit 0769195 into main Apr 14, 2026
4 of 6 checks passed
@github-actions
Copy link
Copy Markdown

github-actions bot commented Apr 14, 2026

Performance Test Results

Performance test results for 9f3e31a are in 🛎️!

Note: the numbers in parentheses show the difference to the previous (baseline) test run. Differences below 2% or 0.5 in absolute values are not shown.

URL: /

Run DB Queries Memory Before Template Template WP Total LCP TTFB LCP - TTFB
0 40 (+2 / +4% ) 37.73 MB 839.50 ms 162.00 ms 1039.50 ms (-45.00 ms / -4% ) 1950.00 ms (-92.00 ms / -5% ) 1861.70 ms (-87.80 ms / -5% ) 90.10 ms
1 56 49.02 MB 912.50 ms (-21.00 ms / -2% ) 143.00 ms (-6.50 ms / -5% ) 1058.00 ms (-25.00 ms / -2% ) 2022.00 ms (-56.00 ms / -3% ) 1941.40 ms (-51.80 ms / -3% ) 81.55 ms

@github-actions
Copy link
Copy Markdown

🔨 Build Complete - Ready for Testing!

📦 Download Build Artifact (Recommended)

Download the zip build, upload to WordPress and test:

🌐 Test in WordPress Playground (Very Experimental)

Click the link below to instantly test this PR in your browser - no installation needed!
Playground support for multisite is very limitied, hopefully it will get better in the future.

🚀 Launch in Playground

Login credentials: admin / password

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

Labels

origin:interactive Created by interactive user session

Projects

None yet

Development

Successfully merging this pull request may close these issues.

quality-debt: tests/WP_Ultimo/Helpers/Site_Duplicator_Postmeta_Test.php — PR #825 review feedback (high)

1 participant