=== MetricPoints Browser Beacon ===
Contributors: michaelloeffler
Tags: event tracking, javascript events, performance monitoring, csp monitoring, security headers
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.1.2
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

Install the MetricPoints browser beacon on WordPress and optionally connect CSP monitoring without editing your theme.

== Description ==

MetricPoints Browser Beacon is the unified WordPress plugin for MetricPoints. It installs browser telemetry for JavaScript events, performance, network health, and user sessions. It can also help with Content Security Policy monitoring when you want WordPress to provide a reporting endpoint or write CSP headers.

**Key Features:**

* **JavaScript Event Tracking** - Automatically captures unhandled browser events, promise rejections, and runtime exceptions
* **Performance Monitoring** - Tracks Core Web Vitals (LCP, FCP, CLS, FID) and memory usage
* **User Session Tracking** - Monitors user behavior, sessions, and interactions
* **Real-time Reporting** - Sends event data to the MetricPoints dashboard instantly
* **Optional CSP Monitoring** - Keep CSP managed externally, write report-only headers, or opt into WordPress-managed CSP
* **Admin Configuration** - Easy-to-use WordPress admin interface
* **Privacy-Friendly** - Configurable tracking options with privacy controls
* **Environment Support** - Tag events by environment (production, staging, development)

**Perfect For:**

* WordPress site owners who want to monitor JavaScript events
* Developers debugging frontend issues
* Site administrators tracking performance metrics
* Teams managing multiple WordPress sites
* Site owners who want CSP visibility without editing theme files

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/metricpoints-browser-beacon` directory, or install the plugin through the WordPress plugins screen directly.
2. Activate the plugin through the 'Plugins' screen in WordPress.
3. Go to Settings → MetricPoints Browser Beacon.
4. Enter your MetricPoints API key (get one at https://metricpoints.com).
5. Configure tracking options and save.

== Frequently Asked Questions ==

= Do I need a MetricPoints account? =

Yes, you need a free MetricPoints account to use this plugin. Sign up at https://metricpoints.com.

= What data is collected? =

The plugin collects JavaScript events, performance metrics, and optional user session data. All data collection can be configured in the plugin settings.

= Is this plugin GDPR compliant? =

Yes, the plugin includes privacy controls and can be configured to comply with GDPR requirements. User tracking can be disabled if needed.

= Does this affect site performance? =

No, the plugin loads asynchronously and has minimal impact on page load times.

= Can I track events in the WordPress admin? =

Yes, you can enable admin tracking in the plugin settings.

= Does the plugin have to manage my CSP? =

No. CSP has an external-owner mode where WordPress does not write CSP headers. Use that when CSP is already managed by your host, CDN, server config, or another security plugin.

= What is the safest CSP mode? =

Start with external-owner mode or report-only mode. Only use enforcing mode after your policy has been tested.

== Screenshots ==

1. Plugin settings page with connection status
2. Browser beacon configuration options
3. Optional CSP monitoring settings
4. Test event generation feature

== Changelog ==

= 1.1.2 =
* Make MetricPoints the source of environment truth. Use plugin setting only as the default/fallback.

= 1.1.1 =
* Fixed test-event generation when the hosted browser beacon is still loading or blocked in wp-admin.
* Synced the displayed plugin environment from the connected MetricPoints site after verification and made it read-only once connected.
* Fixed shared browser/CSP API keys so the main WordPress connector key verifies as browser/event tracking.
* Removed CORS-triggering script attributes from the WordPress connector loader.

= 1.1.0 =
* Added privacy-safe WordPress health snapshots for application context, search visibility, form health, mail dispatch, change events, cron, cache, WooCommerce, and runtime compatibility.
* Added signed, explicit-approval action support for low-risk connector actions.
* Added explicit connector self-check and controlled mail diagnostic actions for test-site validation.
* Added action result reporting so MetricPoints can record completed, failed, and rejected WordPress connector actions as operational evidence.

= 1.0.0 =
* Initial release
* JavaScript event tracking
* Performance monitoring (Core Web Vitals)
* User session tracking
* Optional CSP monitoring and WordPress-managed CSP modes
* Admin configuration panel
* Real-time event reporting
* Privacy controls and GDPR compliance options

== Upgrade Notice ==

= 1.1.0 =
Adds connected-site health evidence and explicit-approval connector actions for MetricPoints assurance testing.

= 1.0.0 =
Initial release of MetricPoints Browser Beacon. Install and configure your API key to start tracking browser health.

== Support ==

For support, visit https://metricpoints.com or email hello@metricpoints.com

== Credits ==

Developed by Michael Loeffler at Main Street Web Developer (https://mainstreetwebdeveloper.com) for MetricPoints.com
