Skip to content

Commit 86ced5e

Browse files
Tsvetan StoychevTsvetan Stoychev
authored andcommitted
Use ASCII hyphens consistently
1 parent cfc166f commit 86ced5e

18 files changed

Lines changed: 43 additions & 41 deletions

AGENTS.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ namespace, PSR-4 Composer autoloading, PHP 7.4+, and WordPress 6.0+.
2121

2222
- Follow WordPress-Core/WPCS. The text domain is `basicrum`.
2323
- Guard PHP files with `ABSPATH`; escape output and sanitize all input.
24+
- Use ASCII hyphens (`-`); do not use typographic dashes in source, comments,
25+
documentation, or user-facing text.
2426
- Prefix hooks with `basicrum_`; use `Assets` handle constants rather than
2527
hard-coded script handles.
2628
- Boomerang lives in `assets/js/boomr/`; standard and consent loaders live in

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ This repository now uses a small monorepo-style layout.
44

55
## Layout
66

7-
- `plugins/basicrum/` the installable WordPress plugin package
8-
- `docker/` Dockerfiles for local development tooling
9-
- `tools/` helper scripts for local development and testing
10-
- `plan-refs/` planning notes and ADRs
11-
- `plugin-references/` external reference implementations kept for study
7+
- `plugins/basicrum/` - the installable WordPress plugin package
8+
- `docker/` - Dockerfiles for local development tooling
9+
- `tools/` - helper scripts for local development and testing
10+
- `plan-refs/` - planning notes and ADRs
11+
- `plugin-references/` - external reference implementations kept for study
1212

1313
## Common Commands
1414

plugins/basicrum/readme.txt

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,13 @@ Basicrum is a free, open source Real User Monitoring (RUM) system. This plugin i
1616

1717
**Features:**
1818

19-
* **Real User Monitoring** Collect page load timing, resource timing, and continuity metrics from actual visitors.
20-
* **Page Type Detection** Automatically tags beacons with the WordPress page type (home, post, page, category, archive, search, 404) and WooCommerce types (product, cart, checkout).
21-
* **Site ID** UUID v4 identifier to distinguish multiple sites reporting to the same beacon endpoint.
22-
* **GDPR Consent Mode** Conditional loading with JavaScript API (`OPT_IN_BASIC_RUM()` / `OPT_OUT_BASIC_RUM()`) for consent banner integration.
23-
* **3-Tier Script Loading** Preload → iframe → direct script loading strategy for optimal performance.
24-
* **Configurable Beacon Delay** Wait after onload before sending the beacon for more complete data collection.
25-
* **Cache Plugin Compatibility** Automatically excluded from optimization by WP Rocket, Autoptimize, LiteSpeed Cache, SG Optimizer, W3 Total Cache, and WP Optimize.
19+
* **Real User Monitoring** - Collect page load timing, resource timing, and continuity metrics from actual visitors.
20+
* **Page Type Detection** - Automatically tags beacons with the WordPress page type (home, post, page, category, archive, search, 404) and WooCommerce types (product, cart, checkout).
21+
* **Site ID** - UUID v4 identifier to distinguish multiple sites reporting to the same beacon endpoint.
22+
* **GDPR Consent Mode** - Conditional loading with JavaScript API (`OPT_IN_BASIC_RUM()` / `OPT_OUT_BASIC_RUM()`) for consent banner integration.
23+
* **3-Tier Script Loading** - Preload → iframe → direct script loading strategy for optimal performance.
24+
* **Configurable Beacon Delay** - Wait after onload before sending the beacon for more complete data collection.
25+
* **Cache Plugin Compatibility** - Automatically excluded from optimization by WP Rocket, Autoptimize, LiteSpeed Cache, SG Optimizer, W3 Total Cache, and WP Optimize.
2626

2727
**How it works:**
2828

@@ -65,9 +65,9 @@ Yes. When WooCommerce is active, the plugin automatically detects shop, product,
6565

6666
== Screenshots ==
6767

68-
1. Admin settings page General settings with beacon URL and Site ID.
69-
2. Privacy settings Consent mode configuration with JS API documentation.
70-
3. Developer settings Script position and debug options.
68+
1. Admin settings page - General settings with beacon URL and Site ID.
69+
2. Privacy settings - Consent mode configuration with JS API documentation.
70+
3. Developer settings - Script position and debug options.
7171

7272
== Changelog ==
7373

plugins/basicrum/src/Admin/Settings/Page.php

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515

1616
/**
17-
* Page class registers the admin menu, settings sections, and fields.
17+
* Page class - registers the admin menu, settings sections, and fields.
1818
*/
1919
class Page {
2020

@@ -33,7 +33,7 @@ class Page {
3333
const SLUG = 'basicrum';
3434

3535
/**
36-
* Constructor hook into admin_menu and admin_init.
36+
* Constructor - hook into admin_menu and admin_init.
3737
*/
3838
public function __construct() {
3939
add_action( 'admin_menu', array( $this, 'add_menu_page' ) );
@@ -482,8 +482,8 @@ public function render_consent_info() {
482482
<div class="basicrum-consent-info" style="background: #f0f0f1; padding: 12px 16px; border-left: 4px solid #2271b1; margin: 8px 0;">
483483
<p><strong><?php esc_html_e( 'Consent JavaScript API', 'basicrum' ); ?></strong></p>
484484
<p><?php esc_html_e( 'When consent mode is enabled, Boomerang will not load until the user gives consent. Use the following JavaScript API in your consent banner or cookie notice:', 'basicrum' ); ?></p>
485-
<p><code>window.OPT_IN_BASIC_RUM()</code> <?php esc_html_e( 'Call this to grant consent and start monitoring. Sets a BRUM_CONSENT cookie (1 year, Strict, Secure).', 'basicrum' ); ?></p>
486-
<p><code>window.OPT_OUT_BASIC_RUM()</code> <?php esc_html_e( 'Call this to revoke consent. Disables Boomerang and removes tracking cookies.', 'basicrum' ); ?></p>
485+
<p><code>window.OPT_IN_BASIC_RUM()</code> - <?php esc_html_e( 'Call this to grant consent and start monitoring. Sets a BRUM_CONSENT cookie (1 year, Strict, Secure).', 'basicrum' ); ?></p>
486+
<p><code>window.OPT_OUT_BASIC_RUM()</code> - <?php esc_html_e( 'Call this to revoke consent. Disables Boomerang and removes tracking cookies.', 'basicrum' ); ?></p>
487487
<p><strong><?php esc_html_e( 'Example:', 'basicrum' ); ?></strong></p>
488488
<pre style="background: #fff; padding: 8px; border: 1px solid #ddd;">&lt;button onclick="OPT_IN_BASIC_RUM()"&gt;Accept&lt;/button&gt;
489489
&lt;button onclick="OPT_OUT_BASIC_RUM()"&gt;Decline&lt;/button&gt;</pre>

plugins/basicrum/src/Admin/Settings/Validate.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414
}
1515

1616
/**
17-
* Validate class sanitize callback for register_setting().
17+
* Validate class - sanitize callback for register_setting().
1818
*
1919
* UUID v4 regex ported from basicrum-magento-1 SiteId.php backend model.
2020
*/
@@ -119,7 +119,7 @@ private function sanitize_beacon_url( $input, $defaults ) {
119119

120120
$url = esc_url_raw( $input['beacon_url'], array( 'https', 'http' ) );
121121

122-
// Enforce HTTPS upgrade HTTP to HTTPS.
122+
// Enforce HTTPS - upgrade HTTP to HTTPS.
123123
if ( 0 === strpos( $url, 'http://' ) ) {
124124
$url = 'https://' . substr( $url, 7 );
125125

plugins/basicrum/src/Admin/Upgrades.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
}
1515

1616
/**
17-
* Upgrades class runs sequential migrations when plugin version changes.
17+
* Upgrades class - runs sequential migrations when plugin version changes.
1818
*
1919
* Pattern from wordpress-plausible/src/Admin/Upgrades.php.
2020
*/
2121
class Upgrades {
2222

2323
/**
24-
* Constructor hook into init to check for pending upgrades.
24+
* Constructor - hook into init to check for pending upgrades.
2525
*/
2626
public function __construct() {
2727
add_action( 'init', array( $this, 'maybe_upgrade' ), 5 );

plugins/basicrum/src/Assets.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313

1414
/**
15-
* Assets class enqueues the Boomerang library and inline configuration
15+
* Assets class - enqueues the Boomerang library and inline configuration
1616
* on the frontend using proper WordPress script APIs.
1717
*
1818
* Replaces the raw heredoc injection from the PoC's core-functions.php.
@@ -34,7 +34,7 @@ class Assets {
3434
const HANDLE_CONFIG = 'basicrum-config';
3535

3636
/**
37-
* Constructor register the enqueue hook.
37+
* Constructor - register the enqueue hook.
3838
*/
3939
public function __construct() {
4040
add_action( 'wp_enqueue_scripts', array( $this, 'maybe_enqueue' ), 1 );

plugins/basicrum/src/Compatibility.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,15 +12,15 @@
1212
}
1313

1414
/**
15-
* Compatibility class excludes Basicrum scripts from optimization by
15+
* Compatibility class - excludes Basicrum scripts from optimization by
1616
* popular caching and performance plugins.
1717
*
1818
* Modeled after wordpress-plausible/src/Compatibility.php
1919
*/
2020
class Compatibility {
2121

2222
/**
23-
* Constructor register exclusion filters.
23+
* Constructor - register exclusion filters.
2424
*/
2525
public function __construct() {
2626
$this->init();

plugins/basicrum/src/Helpers.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313

1414
/**
15-
* Helpers class settings retrieval and utility methods.
15+
* Helpers class - settings retrieval and utility methods.
1616
*/
1717
class Helpers {
1818

plugins/basicrum/src/PageTypeDetector.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
}
1313

1414
/**
15-
* PageTypeDetector class maps WordPress conditional tags to
15+
* PageTypeDetector class - maps WordPress conditional tags to
1616
* human-readable page type labels sent as `p_type` in Boomerang beacons.
1717
*
1818
* Reference: basicrum-magento-1 PageTypeDetector.php (27 page types)
@@ -95,7 +95,7 @@ private function detect_woocommerce_page_type() {
9595
/**
9696
* Detect standard WordPress page types.
9797
*
98-
* Checked in specificity order most specific first.
98+
* Checked in specificity order - most specific first.
9999
*
100100
* @return string|null Page type or null if undetectable.
101101
*/

0 commit comments

Comments
 (0)