Skip to content

Conversation

@sorinmarta
Copy link
Contributor

Ticket: https://secure.helpscout.net/conversation/3145750052/242235/

This was requested by a customer so they can add shortcodes to their listings.

@sorinmarta sorinmarta added run analysis Run the phpcs run tests Run the unit tests labels Nov 25, 2025
@coderabbitai
Copy link

coderabbitai bot commented Nov 25, 2025

Walkthrough

Added an early filter check (awpcp_disable_listing_shortcode_stripping) in the filter_content_with_shortcodes method that allows bypassing shortcode stripping when the filter returns true, returning content unchanged after verifying the current post is a single listing page.

Changes

Cohort / File(s) Summary
Shortcode Stripping Filter Gate
includes/listings/class-listings-content.php
Added conditional early return in filter_content_with_shortcodes using awpcp_disable_listing_shortcode_stripping filter to allow disabling shortcode stripping on single listing pages

Estimated code review effort

🎯 1 (Trivial) | ⏱️ ~3 minutes

  • Straightforward filter check insertion with minimal logic complexity
  • Single localized change to existing method
  • Clear conditional bypass mechanism

Possibly related PRs

  • Fix content insertion vulnerability #80: Introduced the filter_content_with_shortcodes method to strip shortcodes on single listing pages; this PR adds a filter control point to disable that behavior.

Pre-merge checks and finishing touches

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately summarizes the main change: adding a filter to disable shortcode stripping in single listings.
Description check ✅ Passed The description is relevant to the changeset, providing context about the customer request and linking to the support ticket.
Docstring Coverage ✅ Passed Docstring coverage is 100.00% which is sufficient. The required threshold is 80.00%.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch raw-shortcode-filter

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.

Copy link

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 1

📜 Review details

Configuration used: CodeRabbit UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 5672487 and dca9ff8.

📒 Files selected for processing (1)
  • includes/listings/class-listings-content.php (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: stephywells
Repo: Strategy11/another-wordpress-classifieds-plugin PR: 65
File: functions.php:0-0
Timestamp: 2024-10-09T10:56:30.627Z
Learning: The `awpcp_table_exists` function now uses `$wpdb->esc_like($table)` within `$wpdb->prepare()` to sanitize the `$table` variable, addressing the SQL injection vulnerability.
Learnt from: stephywells
Repo: Strategy11/another-wordpress-classifieds-plugin PR: 65
File: functions.php:0-0
Timestamp: 2024-06-19T18:34:58.093Z
Learning: The `awpcp_table_exists` function now uses `$wpdb->esc_like($table)` within `$wpdb->prepare()` to sanitize the `$table` variable, addressing the SQL injection vulnerability.

@sorinmarta sorinmarta merged commit 48cba9c into master Nov 25, 2025
5 checks passed
@sorinmarta sorinmarta deleted the raw-shortcode-filter branch November 25, 2025 08:23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

run analysis Run the phpcs run tests Run the unit tests

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants