v0.2.0
This commit is contained in:
commit
8a85a4d9af
1 changed files with 3258 additions and 0 deletions
56
includes/class-robotstxt-telemetry.php
Normal file
56
includes/class-robotstxt-telemetry.php
Normal 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'
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
Loading…
Reference in a new issue