Repository navigation
Expand file tree
/
Copy pathwordpress-fetch.php
More file actions
55 lines (49 loc) · 1.61 KB
/
Copy pathwordpress-fetch.php
File metadata and controls
55 lines (49 loc) · 1.61 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
<?php
/**
* Plugin Name: WordPress Fetch
* Plugin URI: https://github.com/ildrm/wordpress-fetch
* Description: Secure feed syndication, transformation, editorial, SEO, and monitoring for WordPress.
* Version: 1.0.0
* Requires at least: 6.6
* Requires PHP: 8.1
* Author: Shahin Ilderemi
* Author URI: https://ildrm.com
* License: GPL-2.0-or-later
* License URI: https://www.gnu.org/licenses/gpl-2.0.html
* Text Domain: wordpress-fetch
* Domain Path: /languages
*/
declare(strict_types=1);
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
define( 'WPFETCH_VERSION', '1.0.0' );
define( 'WPFETCH_SCHEMA_VERSION', '1.0.0' );
define( 'WPFETCH_FILE', __FILE__ );
define( 'WPFETCH_DIR', plugin_dir_path( __FILE__ ) );
define( 'WPFETCH_URL', plugin_dir_url( __FILE__ ) );
$wpfetch_autoload = WPFETCH_DIR . 'vendor/autoload.php';
if ( is_readable( $wpfetch_autoload ) ) {
require $wpfetch_autoload;
} else {
spl_autoload_register(
static function ( string $class_name ): void {
$prefix = 'WordPressFetch\\';
if ( 0 !== strpos( $class_name, $prefix ) ) {
return;
}
$file = WPFETCH_DIR . 'src/' . str_replace( '\\', '/', substr( $class_name, strlen( $prefix ) ) ) . '.php';
if ( is_readable( $file ) ) {
require $file;
}
}
);
}
register_activation_hook( __FILE__, array( WordPressFetch\Core\Activator::class, 'activate' ) );
register_deactivation_hook( __FILE__, array( WordPressFetch\Core\Activator::class, 'deactivate' ) );
add_action(
'plugins_loaded',
static function (): void {
WordPressFetch\Core\Plugin::instance()->boot();
}
);