Fix WordPress 6.8.2 compatibility and PHP 8.0+ compatibility issues #15
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix WordPress 6.8.2 compatibility and PHP 8.0+ compatibility issues
Summary
This PR resolves critical compatibility issues preventing the Cal.com WordPress plugin from working with modern WordPress installations:
Primary Fix: Replaced
str_contains()
function (PHP 8.0+) withstrpos() !== false
for backward compatibility. The plugin was claiming PHP 5.2.4+ support but using PHP 8.0+ functions, causing fatal errors on many WordPress sites still running older PHP versions.Version Updates: Updated WordPress compatibility from 6.0.1 to 6.8.2 (latest) and PHP requirement from unrealistic 5.2.4 to more practical 5.6.
Review & Testing Checklist for Human
str_contains()
doesn't exist (this was the original failure case)[cal url="/username/meeting"]
type="1"
) and popup (type="2"
) embeds render correctlystrpos($string, $needle) !== false
behaves identically tostr_contains($string, $needle)
in all edge casesRecommended Test Plan: Set up WordPress on PHP 7.4, install plugin, create test page with
[cal url="/test/30min" type="1"]
and[cal url="/test/30min" type="2" text="Book Now"]
shortcodes, verify both render without PHP errors.Diagram
Notes
str_contains()
function was introduced in PHP 8.0, but plugin claimed PHP 5.2.4+ support