-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathplagiarism-checker.php
45 lines (37 loc) · 1.16 KB
/
plagiarism-checker.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
declare( strict_types = 1 );
/**
* Plugin Name: Plagiarism Checker
* Plugin URI:
* Description: Checks lyrics for plagiarism.
* Author: Max Garceau
* Author URI: https://resume.maxgarceau.com/
* Text Domain: plagiarism-checker
* Domain Path: /languages
* Version: 1.0.0
* Requires at least: 6.6
* Requires PHP: 8.1
*
* @package Plagiarism_Checker
*/
use Max_Garceau\Plagiarism_Checker\Includes\DI_Container;
use Max_Garceau\Plagiarism_Checker\Main;
// Include the Composer autoloader.
require_once plugin_dir_path( __FILE__ ) . 'vendor/autoload.php';
add_action(
'plugins_loaded',
function (): void {
// Bail early if the user is not logged in.
if ( ! is_user_logged_in() ) {
return;
}
// Initialize the plugin.
$container = DI_Container::build_container();
// Use the container to initialize the main plugin class
$container->get( Main::class )->init();
}
);
// Register activation hook for creating the database table.
register_activation_hook( __FILE__, function() {
DI_Container::get_container()->get( \Max_Garceau\Plagiarism_Checker\Admin\Table_Manager::class )->create_table();
});