Skip to content

[PCP] Phase 1: wp_function_not_compatible_with_requires_wp#236

Open
faisalahammad wants to merge 1 commit into
WordPress:trunkfrom
faisalahammad:fix/pcp-phase-1-wp-function-compat
Open

[PCP] Phase 1: wp_function_not_compatible_with_requires_wp#236
faisalahammad wants to merge 1 commit into
WordPress:trunkfrom
faisalahammad:fix/pcp-phase-1-wp-function-compat

Conversation

@faisalahammad

@faisalahammad faisalahammad commented Jun 11, 2026

Copy link
Copy Markdown
Contributor

Fix: wp_function_not_compatible_with_requires_wp (lines 378, 758, 1030)

Changes

  • Line 1030: Wrap wp_scripts_get_suffix() in function_exists() guard with WP 4.9-compatible fallback using defined('SCRIPT_DEBUG') && SCRIPT_DEBUG to default to .min or empty string
  • Lines 378, 758: Already have function_exists() guards — these are PCP false-positives (static analysis flags the call site even with runtime guards)

Rule code

wp_function_not_compatible_with_requires_wp

Verification

  • PHPCS scan with WordPress,PHPCompatibility standards shows zero new violations
  • CodeRabbit review: validated SCRIPT_DEBUG constant guard with defined() check
  • Plugin declares Requires at least: 4.9 — fallback preserves backward compat

Wrap wp_scripts_get_suffix() in function_exists() guard with 4.9-compatible SCRIPT_DEBUG fallback.
CodeRabbit review: add defined() guard for SCRIPT_DEBUG constant.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant