Skip to content

feat(calendar) | expose SDK options and restore card image widgets SPW-20290 - #77

Open
amir-faghihi wants to merge 4 commits into
masterfrom
SPW-20290-wordpress-calendar-sdk-options
Open

amir-faghihi wants to merge 4 commits into
masterfrom
SPW-20290-wordpress-calendar-sdk-options

Conversation

@amir-faghihi

@amir-faghihi amir-faghihi commented Aug 26, 2026

Copy link
Copy Markdown

Functional Changes

Local QA sign-off

Not applicable by Codex (automated checks passed; PHPUnit and a live WordPress smoke test were not available)

What is the change?

  • Expose the current calendar SDK options through both WordPress calendar shortcodes.
  • Map WordPress snake_case attributes to typed SDK camelCase options.
  • Support display pricing, hidden pricing, direct date and timeslot targets, special-event keys (including all), initial Special Events view, and multi-day start-date-only highlighting.
  • Restore widget click handling on event grid, event list, and membership grid card images.
  • Preserve external-link, detail-page, and sold-out event-image behavior.
  • Add shortcode documentation and focused PHP/JavaScript coverage.

Why the change is important?

  • Keeps the WordPress calendar integrations aligned with the current Showpass calendar SDK.
  • Allows WordPress embeds and modal calendars to use the same calendar targeting and presentation options as the frontend.
  • Makes card images behave consistently with their titles and purchase buttons after the responsive-image refactor removed the event image widget bindings.

How to test?

  • npm run test:calendar
  • npm run test:card-images
  • node --check plugin/js/showpass-calendar-params.js
  • node --check plugin/js/showpass-custom.js
  • php -l plugin/showpass-wordpress-plugin-shortcode.php
  • php -l plugin/inc/default-grid.php
  • php -l plugin/inc/default-list.php
  • php -l plugin/inc/default-membership-grid.php
  • php -l tests/CalendarShortcodeTest.php
  • Exercise both [showpass_calendar_widget] and [showpass_embed_calendar] in WordPress with the documented attributes.
  • Verify calendar_open_state="special-events" and calendar_special_event="all" separately and together; verify omitted/invalid open-state values and returning to Calendar.
  • Confirm event grid/list and membership grid images open the same widget as their title/button.
  • Confirm external-link, detail-page, and sold-out event images retain their existing behavior.

Database Migrations

What is the reason for the migration(s) and impact on the database?

No database migrations.

Migration Approval

Not applicable by Codex (no migrations).

Additional Notes

The JavaScript calendar and card-image suites, PHP syntax checks, and direct PHP smoke checks for both calendar shortcodes passed. The plugin ZIP matches the updated source. PHPUnit is not installed; live WordPress QA is pending.

Deployment dependency: https://github.com/showpass/showpass-frontend/pull/7283 must be deployed with its rebuilt SDK before releasing this plugin update. The new options require the canonical calendar route; existing legacy routes do not implement them.

@amir-faghihi amir-faghihi self-assigned this Aug 26, 2026
@marc-thomas marc-thomas changed the title feat(calendar) | expose current SDK options in WordPress SPW-20290 feat(calendar) | expose SDK options and restore card image widgets SPW-20290 Sep 1, 2026

@marc-thomas marc-thomas left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Requesting changes before this is merge/release-ready. The repository contributing guide and the WordPress Plugin release documentation require the release metadata and installable artifact to move with the code change.

Please complete the following:

  1. Bump the plugin version (expected next patch version: 4.0.9, unless another release version has been agreed) by running node update-version.js <version>. This must update all three release identifiers:

    • Version in plugin/showpass-wordpress-plugin.php
    • SHOWPASS_PLUGIN_VERSION in plugin/showpass-wordpress-plugin.php
    • Stable tag in plugin/readme.txt

    This is also required to invalidate cached copies of the changed showpass-custom.js; leaving it at 4.0.8 could cause updated sites to keep the old JavaScript and silently ignore the new shortcode parameters.

  2. Add the corresponding changelog entry to plugin/readme.txt, covering both the calendar shortcode options and the card-image widget fixes now included in this PR.

  3. Regenerate and commit the root-level installable showpass.zip after the final source changes, following CONTRIBUTING.md:

    git archive -o showpass.zip --prefix=showpass-wordpress-plugin/ HEAD:plugin

    Please verify the archive contains the new plugin/js/showpass-calendar-params.js file and all updated templates.

  4. Add actual validation evidence. This PR currently has no GitHub status/check runs. The checked-in Circle job only runs PHPUnit when Circle triggers; it does not run npm run test:calendar or npm run test:card-images, and Circle has not created a build for either commit on this PR.

  5. WordPress.org/SVN deployment prerequisite: Amir needs to create a WordPress.org account and send Marc the WordPress.org username (not a password or credential). Marc can then add that account as a developer for the Showpass plugin so Amir can perform the documented SVN deployment: copy plugin/ to SVN trunk, create the matching tags/<version> directory, add new files, and commit the release.

References:

  • Repository CONTRIBUTING.md, sections “Make .zip file for plugin” and “Release to Wordpress SVN”
  • Technical Docs → WordPress Plugin → “Updating the Wordpress plugin”

@marc-thomas

Copy link
Copy Markdown
Collaborator

One more release/CI item for this PR: CircleCI is running successfully on the branch, but the build now warns that config version 2.0 has reached end of life and will stop being supported.

Could you please update the CircleCI config to version 2.1 in this PR and verify the PR pipeline still runs successfully? While updating it, please preserve the existing Composer/PHPUnit job and add the two JavaScript suites introduced/used here to CI:

  • npm run test:calendar
  • npm run test:card-images

An explicit 2.1 workflow containing the PHP and JavaScript test jobs would make it clear which checks are expected on every PR. Please include the successful CircleCI run in the PR verification notes afterward.

@marc-thomas

Copy link
Copy Markdown
Collaborator

Scope note: I piggybacked the card-image widget changes onto this PR to fix the issue reported in this Slack support thread. Event and membership card images appeared clickable but did nothing; these changes make the image open the same purchase widget as the title and “Buy Tickets” action while preserving external-link, detail-page, and sold-out behavior.

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.

2 participants