Skip to content

Fix wp checks +semver: major#23

Merged
guibranco merged 5 commits intomainfrom
feature/fix-wp-checks
Apr 23, 2026
Merged

Fix wp checks +semver: major#23
guibranco merged 5 commits intomainfrom
feature/fix-wp-checks

Conversation

@guibranco
Copy link
Copy Markdown
Owner

@guibranco guibranco commented Apr 23, 2026

📑 Description

✅ Checks

  • My pull request adheres to the code style of this project
  • My code requires changes to the documentation
  • I have updated the documentation as required
  • All the tests have passed

☢️ Does this introduce a breaking change?

  • Yes
  • No

Summary by Sourcery

Chores:

  • Extend PHPCS ignore rules on direct database queries to include PluginCheck.Security.DirectDB.UnescapedDBParameter for visitor query methods.

@sourcery-ai
Copy link
Copy Markdown

sourcery-ai Bot commented Apr 23, 2026

Reviewer's guide (collapsed on small PRs)

Reviewer's Guide

Updates PHPCS ignore annotations for direct database queries to include a PluginCheck sniff, without changing the query logic or behavior.

File-Level Changes

Change Details Files
Extend PHPCS ignore rules for direct WordPress database queries to cover new PluginCheck security sniff.
  • Keep existing prepared SELECT queries for visitor rows and total count unchanged
  • Augment phpcs:ignore annotations on get_results and get_var calls to add PluginCheck.Security.DirectDB.UnescapedDBParameter to the ignored sniffs
  • Preserve existing safety guarantees by continuing to use $wpdb->prepare with validated SQL fragments and value placeholders
includes/class-ipquery-db.php

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 23, 2026

Warning

Rate limit exceeded

@guibranco has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 7 minutes and 59 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 7 minutes and 59 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: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 67147b7f-2818-47ae-9b35-cb331c57d035

📥 Commits

Reviewing files that changed from the base of the PR and between 1091c02 and 73457e9.

📒 Files selected for processing (2)
  • admin/views/dashboard.php
  • includes/class-ipquery-db.php
✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch feature/fix-wp-checks

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.

@guibranco guibranco enabled auto-merge (squash) April 23, 2026 15:41
@gstraccini gstraccini Bot added the ☑️ auto-merge Automatic merging of pull requests (gstraccini-bot) label Apr 23, 2026
@penify-dev
Copy link
Copy Markdown

penify-dev Bot commented Apr 23, 2026

Failed to generate code suggestions for PR

Copy link
Copy Markdown

@sourcery-ai sourcery-ai Bot left a comment

Choose a reason for hiding this comment

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

Hey - I've left some high level feedback:

  • Instead of expanding the PHPCS ignore list to include PluginCheck.Security.DirectDB.UnescapedDBParameter, consider addressing the root issue (e.g., explicitly escaping or documenting why the parameters are safe) so the security sniff can remain effective.
  • The PR title includes +semver: major but the checklist marks "breaking change" as No; it would be helpful to align these signals so consumers can clearly understand whether this is a breaking change.
Prompt for AI Agents
Please address the comments from this code review:

## Overall Comments
- Instead of expanding the PHPCS ignore list to include `PluginCheck.Security.DirectDB.UnescapedDBParameter`, consider addressing the root issue (e.g., explicitly escaping or documenting why the parameters are safe) so the security sniff can remain effective.
- The PR title includes `+semver: major` but the checklist marks "breaking change" as No; it would be helpful to align these signals so consumers can clearly understand whether this is a breaking change.

Sourcery is free for open source - if you like our reviews please consider sharing them ✨
Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 23, 2026

🔍 WordPress Plugin Check Report

⚠️ Status: Passed with warnings

📊 Report

🎯 Total Issues ❌ Errors ⚠️ Warnings
10 0 10

⚠️ Warnings (10)

📁 admin/views/dashboard.php (10 warnings)
📍 Line 🔖 Check 💬 Message
18 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$total_visits".
19 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$unique_ips".
20 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$risk_counts".
21 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$top_countries".
22 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$top_cities".
52 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$risky_pct".
106 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$row".
145 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$row".
173 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$risk_items".
205 WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedVariableFound Global variables defined by a theme/plugin should start with the theme/plugin prefix. Found: "$item".

🤖 Generated by WordPress Plugin Check Action • Learn more about Plugin Check

@guibranco guibranco merged commit f9bcf5c into main Apr 23, 2026
13 checks passed
@guibranco guibranco deleted the feature/fix-wp-checks branch April 23, 2026 15:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

☑️ auto-merge Automatic merging of pull requests (gstraccini-bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants