Skip to content

Conversation

@Crabcyborg
Copy link
Contributor

@Crabcyborg Crabcyborg commented Jan 14, 2026

Summary by CodeRabbit

Chores

  • Internal code cleanup and optimization for database operations across form and entry management functions.

✏️ Tip: You can customize this high-level summary in your review settings.

@coderabbitai
Copy link
Contributor

coderabbitai bot commented Jan 14, 2026

Note

.coderabbit.yaml has unrecognized properties

CodeRabbit is using all valid settings from your configuration. Unrecognized properties (listed below) have been ignored and may indicate typos or deprecated fields that can be removed.

⚠️ Parsing warnings (1)
Validation error: Unrecognized key(s) in object: 'path_instructions'
⚙️ Configuration instructions
  • Please see the configuration documentation for more information.
  • You can also validate your configuration using the online YAML validator.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json
📝 Walkthrough

Walkthrough

A new PHP CodeSniffer sniff is introduced to detect and automatically fix redundant $wpdb->prefix usage in FrmDb method calls. The sniff is applied across three database query files to remove explicit table prefixes, consolidating table name handling.

Changes

Cohort / File(s) Summary
Database Query Updates
classes/models/FrmEntry.php, classes/models/FrmForm.php, classes/views/xml/forms_xml.php
Removed explicit $wpdb->prefix concatenation from FrmDb method calls (get_var, get_col, get_results), replacing patterns like $wpdb->prefix . 'frm_items' with bare table names like 'frm_items' (6 instances across 3 files)
Code Analysis Sniff
phpcs-sniffs/Formidable/Sniffs/CodeAnalysis/RemoveRedundantWpdbPrefixSniff.php
New sniff class implementing detection and auto-fix for redundant $wpdb->prefix usage in FrmDb calls; includes register() and process() methods with token-based pattern matching and removal logic
PHPCS Configuration
phpcs.xml
Registered new sniff rule Formidable.CodeAnalysis.RemoveRedundantWpdbPrefix in ruleset

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~12 minutes

Suggested labels

run analysis, run tests

Poem

🐰 A sniff hops through the code with glee,
Removing prefixes, wild and free,
Where \$wpdb once danced with strings so long,
Now simple names sing out their song,
Clean and lean, the tables align! ✨

🚥 Pre-merge checks | ✅ 3
✅ Passed checks (3 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
Title check ✅ Passed The pull request title accurately describes the main objective: introducing a new CodeSniffer sniff that detects and removes redundant wpdb prefix usage in FrmDb functions.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing touches
  • 📝 Generate docstrings

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.

@Crabcyborg Crabcyborg changed the title Add new sniff to remove wpdb prefix from frmdb functions Add new sniff to remove wpdb prefix from FrmDb functions Jan 14, 2026
@Crabcyborg Crabcyborg merged commit c4fadbb into master Jan 14, 2026
16 checks passed
@Crabcyborg Crabcyborg deleted the add_new_sniff_to_remove_wpdb_prefix_from_frmdb_functions branch January 14, 2026 01:50
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.

2 participants