-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcleanor-tools.php
More file actions
80 lines (67 loc) · 2.76 KB
/
Copy pathcleanor-tools.php
File metadata and controls
80 lines (67 loc) · 2.76 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
<?php
/**
* Plugin Name: Cleanor: Image Compressor & Converter
* Description: Automatically compress and convert Media Library images to WebP or AVIF via Cleanor Labs. Faster pages, better Core Web Vitals, less storage. Bulk-optimize existing images in one click.
* Version: 0.6.0
* Requires at least: 6.0
* Requires PHP: 7.4
* Author: Cleanor Labs
* Author URI: https://cleanor.app/
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: cleanor-tools
* Domain Path: /languages
*
* @package Cleanor_Tools
*/
if ( ! defined( 'ABSPATH' ) ) {
exit; // No direct access.
}
define( 'CLEANOR_TOOLS_VERSION', '0.6.0' );
define( 'CLEANOR_TOOLS_FILE', __FILE__ );
define( 'CLEANOR_TOOLS_DIR', plugin_dir_path( __FILE__ ) );
define( 'CLEANOR_TOOLS_URL', plugin_dir_url( __FILE__ ) );
/** Default REST endpoint. Overridable in Settings (or via the filter below). */
define( 'CLEANOR_TOOLS_DEFAULT_ENDPOINT', 'https://mcp.cleanor.app' );
require_once CLEANOR_TOOLS_DIR . 'includes/class-cleanor-settings.php';
require_once CLEANOR_TOOLS_DIR . 'includes/class-cleanor-api.php';
require_once CLEANOR_TOOLS_DIR . 'includes/class-cleanor-local.php';
require_once CLEANOR_TOOLS_DIR . 'includes/class-cleanor-optimizer.php';
require_once CLEANOR_TOOLS_DIR . 'includes/class-cleanor-bulk.php';
require_once CLEANOR_TOOLS_DIR . 'includes/class-cleanor-restore.php';
require_once CLEANOR_TOOLS_DIR . 'includes/class-cleanor-serve.php';
require_once CLEANOR_TOOLS_DIR . 'includes/class-cleanor-cleanup.php';
require_once CLEANOR_TOOLS_DIR . 'includes/class-cleanor-admin.php';
/**
* Boot the plugin once all plugins are loaded.
*/
function cleanor_tools_init() {
$settings = new Cleanor_Settings();
$settings->hooks();
$api = new Cleanor_API( $settings );
$api->hooks();
$local = new Cleanor_Local();
$optimizer = new Cleanor_Optimizer( $settings, $api, $local );
$optimizer->hooks();
$bulk = new Cleanor_Bulk( $settings, $optimizer );
$bulk->hooks();
$restore = new Cleanor_Restore( $settings );
$restore->hooks();
// Front-end <picture> delivery for non-destructive ("keep") mode.
$serve = new Cleanor_Serve( $settings );
$serve->hooks();
// CleanUp: tidy sibling files on delete + reclaim-space tools.
$cleanup = new Cleanor_Cleanup( $settings );
$cleanup->hooks();
// Branded cabinet: owns the top-level menu + shared assets for all screens.
$admin = new Cleanor_Admin( $settings, $bulk, $restore, $cleanup );
$admin->hooks();
}
add_action( 'plugins_loaded', 'cleanor_tools_init' );
/**
* On activation, seed default options.
*/
function cleanor_tools_activate() {
Cleanor_Settings::seed_defaults();
}
register_activation_hook( __FILE__, 'cleanor_tools_activate' );