Skip to content

Conversation

@Dan0sz
Copy link
Collaborator

@Dan0sz Dan0sz commented Dec 19, 2025

This PR updates the plugin to leverage all features of Plausible's new JS library. It includes migration scripts for existing users. I've also taken this opportunity to include some code improvements/bugfixes/modernization to make it future proof:

  • Enhanced Measurements and Capabilities are now defined in their own separate class using constants. These classes are a a single source of truth (as opposed to strings spread throughout the code) and behave as enums. I say "behave as", because we can't use enums yet because we still have to support PHP 8.0 and lower. When WP drops support for these PHP versions, we can easily migrate this to enums.
  • A workaround for a "bug" (it might be on intentionally) in WC, that tracks the Start Checkout event on the Thank You-page, leading to double conversions.
  • Cloudflare compatibility is appropriately moved to the Compatibility-class.
  • Download-methods are moved to Cron-class, where it's solely used.
  • The generic Actions and Filters classes are split into more descriptively named classes.

Improved: refactored get_filename Helper to get the Tracked ID.
…sh, outbound links and form submissions logic in new JS.
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