Skip to content

Optimize entry meta logic - #3267

Merged
Crabcyborg merged 3 commits into
masterfrom
optimize_entry_meta_logic
Aug 21, 2026
Merged

Optimize entry meta logic#3267
Crabcyborg merged 3 commits into
masterfrom
optimize_entry_meta_logic

Conversation

@Crabcyborg

@Crabcyborg Crabcyborg commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Summary by CodeRabbit

  • Improvements
    • Improved entry metadata updates by preserving field context during save operations.
    • Reduced unnecessary field loading when field information is already available.
    • Maintained compatibility for existing metadata operations through optional field support.

@coderabbitai

coderabbitai Bot commented Aug 21, 2026

Copy link
Copy Markdown
Contributor

Review Change Stack

Warning

Review limit reached

@Crabcyborg, you've reached your PR review limit, so we couldn't start this review.

Next review available in: 33 minutes

Limit details: You’ve used the included review currently available.

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

How can I continue?

Wait for the limit to reset, then comment @coderabbitai review or push new commits to the PR.

An organization admin can change what happens after included review limits in Billing.

How do review limits work?

CodeRabbit enforces per-developer PR review limits within each organization.

For paid Pro and Pro+ reviews, CodeRabbit uses a developer's included PR review attempts over the past 7 days to set the current hourly allowance. At typical activity levels, the full plan allowance applies. Higher sustained activity can lower the allowance until earlier attempts leave the 7-day window.

Please refer docs for additional details.

Review details
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: f709cdd4-fe93-4887-861d-c7aafb6b7fea

📥 Commits

Reviewing files that changed from the base of the PR and between c94c28a and 5d6903e.

📒 Files selected for processing (1)
  • tests/phpunit/entries/test_FrmEntryMeta.php

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro Plus

Run ID: 624b8876-540b-4b8c-b162-8ca4f85b268e

📥 Commits

Reviewing files that changed from the base of the PR and between 83b374e and c94c28a.

📒 Files selected for processing (1)
  • classes/models/FrmEntryMeta.php

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

FrmEntryMeta now accepts an optional field object for metadata creation and updates. The field object flows through bulk updates and prevents repeated field loading when it is already available.

Changes

Entry metadata field reuse

Layer / File(s) Summary
Metadata API and field conversion
classes/models/FrmEntryMeta.php
add_entry_meta() and update_entry_meta() accept an optional field object. set_value_before_save() reuses the object or loads the field when absent.
Bulk metadata propagation
classes/models/FrmEntryMeta.php
update_entry_metas() passes its resolved field object when creating or updating metadata.

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

Merge Risk: ⚪ Minimal · up to c94c2

This localized change has no identified merge-blocking risk and is merge-ready after normal checks and review.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately summarizes the optimization to entry meta handling and is concise enough for the primary change.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 4 functions across 1 files.
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.
✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch optimize_entry_meta_logic

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.

@deepsource-io

deepsource-io Bot commented Aug 21, 2026

Copy link
Copy Markdown

DeepSource Code Review

We reviewed changes in cba4554...5d6903e on this pull request. Below is the summary for the review, and you can see the individual issues we found as inline review comments.

See full review on DeepSource ↗

Important

Some issues found as part of this review are outside of the diff in this pull request and aren't shown in the inline review comments due to GitHub's API limitations. You can see those issues on the DeepSource dashboard.

PR Report Card

Overall Grade   Security  

Reliability  

Complexity  

Hygiene  

Code Review Summary

Analyzer Status Updated (UTC) Details
PHP Aug 21, 2026 12:32a.m. Review ↗
JavaScript Aug 21, 2026 12:32a.m. Review ↗

Important

AI Review is run only on demand for your team. We're only showing results of static analysis review right now. To trigger AI Review, comment @deepsourcebot review on this thread.

'meta_value' => 'abc',
);
$this->run_private_method( array( 'FrmEntryMeta', 'set_value_before_save' ), array( &$values, $as_number ) );
$this->assertEqualsWithDelta( 0.0, $values['meta_value'], PHP_FLOAT_EPSILON, 'The passed number field should coerce a non-numeric value to a float.' );

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Call to an undefined method test_FrmEntryMeta::assertEqualsWithDelta()


The method you are trying to call is not defined, which can result in a fatal error.

'meta_value' => 'abc',
);
$this->run_private_method( array( 'FrmEntryMeta', 'set_value_before_save' ), array( &$values, null ) );
$this->assertSame( 'abc', $values['meta_value'], 'With no field passed the stored text field should be looked up and leave the value alone.' );

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Call to an undefined method test_FrmEntryMeta::assertSame()


The method you are trying to call is not defined, which can result in a fatal error.

@Crabcyborg
Crabcyborg merged commit faa3000 into master Aug 21, 2026
21 of 22 checks passed
@Crabcyborg
Crabcyborg deleted the optimize_entry_meta_logic branch August 21, 2026 00:37
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant