Skip to content

Clear Plugin Check findings while retaining WordPress 4.7 compatibility - #308

Open
CodyReichert wants to merge 2 commits into
masterfrom
codex_plugin-check-cleanup
Open

CodyReichert wants to merge 2 commits into
masterfrom
codex_plugin-check-cleanup

Conversation

@CodyReichert

@CodyReichert CodyReichert commented Oct 12, 2026 •

Copy link
Copy Markdown
Member

The released plugin declared WordPress 3.0.1 support despite using newer core APIs, and Plugin Check reported 74 errors and 2 warnings. This change clears those findings while preserving rendered markup, filters, settings, shortcode behavior, and PHP 7.0.27 support.

Changes

  • Declare WordPress 4.7 as the minimum and add an open-house timezone fallback for WordPress 4.7–5.2.
  • Escape the six flagged heading-tag outputs while retaining existing filters and default tags.
  • Bundle the exact existing fallback listing photo, preserving the public photo override and gallery behavior.
  • Use cached WordPress post counts for Legacy Pages, with invalidation for post deletion and post-type changes registered on every request, including non-admin writes. Admin notice/settings hooks remain admin-only; the existing public admin invalidator delegates to the always-loaded implementation.
  • Repair the PHPUnit bootstrap, install test-only polyfills in CI, and add PHP 7.0 syntax coverage. Release metadata remains at 3.3.0; the new minimum is documented in unreleased notes.

Validation

  • GitHub Actions CI: all six jobs passed on the non-admin cache fix, including PHP 7.0/7.4/8.1 syntax checks, quality checks, and WordPress 6.7/latest tests on PHP 8.1.
  • Plugin Check 2.1.0: every static check against a release-shaped package passed with 0 errors and 0 warnings, without new suppressions. The package follows the release script's exclusion of tests and phpunit.xml and excludes local editor/test artifacts.
  • WordPress 6.7 and 7.1.3 / PHP 8.0.6: 29 tests, 174 assertions on each target. The existing sample test remains flagged as risky because it contains no assertions.
  • WordPress 4.7 / PHP 7.0.33 with production dependencies: 83 runtime assertions, including the pre-5.3 timezone fallback, heading filters, photo overrides, and Legacy Pages cache invalidation. PHP 7.0.27 specifically was not run.
  • Additional WordPress 4.7 / PHP 7.0.33 smoke check: 11 non-admin startup/cache assertions passed with the admin class absent during writes. A regression test reproduced the stale count before the fix and now verifies unchanged-status post-type changes and deletion without manually registering the cache hook.
  • PHP 7.0.33 syntax checks and changed-file PHP 8.5 syntax checks passed; Composer validation and Docker Compose configuration passed. Composer retains its pre-existing advisory warnings.
  • Before/after browser checks on WordPress 7.1.3 with OceanWP 4.1.6, Twenty Twenty 3.2, and Twenty Twenty-Five 1.5 at 1280px and 390px found matching public form attributes and element/section dimensions across six fixture views. The local placeholder loads successfully. Five affected renderers also retain identical generated HTML after normalizing the photo URL and random map identifiers.

Follow-up

A broader runtime/performance scan reports 27 existing warnings about global asset loading and scripts in the page head. These were absent from the supplied report. Changing asset-loading behavior requires separate compatibility review and is outside this cleanup. Live map interactions were not validated; map code is unchanged.

The commits were created through GitHub's automatically signed API; their valid GitHub signatures were verified.

@CodyReichert
CodyReichert marked this pull request as ready for review October 12, 2026 00:49
@CodyReichert CodyReichert added enhancement This is an enhancement or new feature plugin-check Addresses Plugin Check warnings or errors and removed enhancement This is an enhancement or new feature labels Oct 12, 2026
@creichert
creichert requested a balanced review from Copilot October 12, 2026 13:42

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

🟡 Changes recommended

Legacy-page count invalidation is not registered for non-admin post updates, allowing stale persistent counts.

1 open finding
What changed in this PR

Clears Plugin Check findings while preserving PHP 7.0.27 and WordPress 4.7 compatibility.

Changes:

  • Adds legacy timezone handling, escaped headings, and a bundled fallback image.
  • Replaces direct Legacy Pages queries with cached post counts.
  • Expands compatibility tests and CI syntax coverage.

The linked six-job CI run passed, but cache invalidation misses non-admin write paths.

File Description
.github/​workflows/​ci.yml Adds PHP 7.0 syntax coverage and test polyfills.
CHANGELOG Documents unreleased compatibility changes.
src/​assets/​img/​default-property.jpg Adds the local fallback listing image.
src/​phpunit.xml Names the PHPUnit test suite.
src/​readme.txt Updates requirements and release notes.
src/​simply-rets-admin.php Uses cached post counts and adds invalidation.
src/​simply-rets-openhouses.php Adds legacy timezone support and heading escaping.
src/​simply-rets-renderer.php Escapes search heading tags.
src/​simply-rets-utils.php Configures the bundled fallback image URL.
src/​simply-rets.php Updates plugin compatibility headers.
src/​tests/​bootstrap.php Repairs WordPress test initialization.
src/​tests/​test-legacy-pages.php Tests count-cache behavior.
src/​tests/​test-plugin-check-compatibility.php Tests timezone, headings, and fallback images.

🧠 Review effort: Balanced


💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/simply-rets-admin.php Outdated
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

plugin-check Addresses Plugin Check warnings or errors

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants