=== MetricPoints Browser Beacon ===
Contributors: michaelloeffler
Tags: error tracking, javascript errors, performance monitoring, csp monitoring, security headers
Requires at least: 5.8
Tested up to: 6.8
Requires PHP: 7.4
Stable tag: 1.0.0
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 errors, 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 Error Tracking** - Automatically captures unhandled errors, 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 error data to 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 errors by environment (production, staging, development)

**Perfect For:**

* WordPress site owners who want to monitor JavaScript errors
* 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 errors, 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 errors 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 error generation feature

== Changelog ==

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

== Upgrade Notice ==

= 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
