This commit is contained in:
Javier Casares 2026-08-18 16:26:15 +00:00
commit 8a85a4d9af

View file

@ -0,0 +1,56 @@
<?php
/**
* Main plugin bootstrap.
*
* @package RobotstxtTelemetry
*/
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! class_exists( 'Robotstxt_Telemetry' ) ) {
/**
* Class Robotstxt_Telemetry
*/
class Robotstxt_Telemetry {
/**
* Initialize the plugin.
*/
public static function init(): void {
$instance = new self();
$instance->register_hooks();
}
/**
* Register hooks.
*/
private function register_hooks(): void {
add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
add_action( 'init', array( 'Robotstxt_Telemetry_DB', 'maybe_upgrade' ) );
$logger = new Robotstxt_Telemetry_Logger();
$logger->register();
if ( is_admin() ) {
$notice = new Robotstxt_Telemetry_Manager_Notice();
$notice->register();
$admin = new Robotstxt_Telemetry_Admin();
$admin->register();
}
}
/**
* Load plugin translations.
*/
public function load_textdomain(): void {
load_plugin_textdomain(
'robotstxt-telemetry',
false,
dirname( plugin_basename( ROBOTSTXT_TELEMETRY_PLUGIN_FILE ) ) . '/languages'
);
}
}
}