All violations were present in v0.1.0 and hidden by continue-on-error. Now that PHPCS gates the build (P2-B), they must be fixed. - Add file-level @package doc comment to all PHP files (file doc requirement) - Add short descriptions to @var and constructor docblocks throughout - Fix @param type spacing throughout (PHPCS alignment rules) - Expand phpcs:ignore lines to include NoCaching where DirectQuery is already suppressed (uninstall.php, cost-ledger, table-manager, collector) - Suppress EscapeOutput.ExceptionNotEscaped on RuntimeException messages (exception strings are not HTML output) - Suppress error_log_error_log on the probe-runner failure log - Replace date() with gmdate() in panel (timezone-aware per WP standard) - Convert inline associative arrays to multi-line in config (WP array style) - Fix double-arrow alignment in probe-runner counts and insert arrays - Fix double-space before ?? in provider constructors - Expand phpcs:ignore for reads to include MissingUnslash - Fix $counts++ to ++$counts (prefix increment per WP standard) - Fix V1/v1 capitalisation in interface doc long description Agent-Session: pr-vision rename v0.1.1
43 lines
1.1 KiB
PHP
43 lines
1.1 KiB
PHP
<?php
|
|
/** @package PrVision */
|
|
declare(strict_types=1);
|
|
|
|
/**
|
|
* Main orchestrator for the PR Vision plugin.
|
|
*
|
|
* Boots sub-systems in the correct order, hooks into WP, and keeps
|
|
* the top-level file under the 300-line limit by delegating all logic
|
|
* to specialist classes.
|
|
*
|
|
* Who triggers: plugins_loaded action (pr-vision.php).
|
|
* Dependencies: PRV_Cron, PRV_Admin_Page, PRV_Collector_Registry.
|
|
*
|
|
* @see ARCHITECTURE.md — Boot sequence diagram.
|
|
* @package PrVision
|
|
*/
|
|
class PRV_Plugin {
|
|
|
|
/**
|
|
* Wire up all WordPress hooks.
|
|
*
|
|
* Side effects: Registers admin menus, enqueues assets, and registers the
|
|
* collector/panel registry.
|
|
*
|
|
* @return void
|
|
*/
|
|
public function init(): void {
|
|
$cron = new PRV_Cron();
|
|
$cron->register_hooks();
|
|
|
|
if ( is_admin() ) {
|
|
$page = new PRV_Admin_Page();
|
|
$page->register_hooks();
|
|
}
|
|
|
|
// Register the v1 AI-visibility collector + panel.
|
|
$registry = PRV_Collector_Registry::instance();
|
|
$registry->register_collector( new PRV_Ai_Visibility_Collector() );
|
|
$registry->register_panel( 'ai_visibility', new PRV_Ai_Visibility_Panel() );
|
|
}
|
|
}
|