diff --git a/plausible-analytics.php b/plausible-analytics.php index bdd8b8a6..e5e2f88b 100644 --- a/plausible-analytics.php +++ b/plausible-analytics.php @@ -18,7 +18,7 @@ } // Define plugin version here for convenience. -define( 'PLAUSIBLE_ANALYTICS_VERSION', '2.0.5' ); +define( 'PLAUSIBLE_ANALYTICS_VERSION', '2.0.8' ); define( 'PLAUSIBLE_ANALYTICS_PLUGIN_FILE', __FILE__ ); define( 'PLAUSIBLE_ANALYTICS_PLUGIN_BASENAME', plugin_basename( PLAUSIBLE_ANALYTICS_PLUGIN_FILE ) ); define( 'PLAUSIBLE_ANALYTICS_PLUGIN_DIR', plugin_dir_path( PLAUSIBLE_ANALYTICS_PLUGIN_FILE ) ); diff --git a/src/Actions.php b/src/Actions.php index 321fbef4..ac9250b9 100644 --- a/src/Actions.php +++ b/src/Actions.php @@ -18,10 +18,23 @@ class Actions { * @return void */ public function __construct() { + add_action( 'wp_head', [ $this, 'insert_version_meta_tag' ] ); add_action( 'wp_enqueue_scripts', [ $this, 'maybe_register_assets' ] ); add_action( 'admin_bar_menu', [ $this, 'admin_bar_node' ], 100 ); } + /** + * This tag "tells" the Plausible API which version of the plugin is used, to allow tailored error messages, specific to the plugin + * version. + * + * @return void + */ + public function insert_version_meta_tag() { + $version = PLAUSIBLE_ANALYTICS_VERSION; + + echo "\n"; + } + /** * Register Assets. *