-
-
Notifications
You must be signed in to change notification settings - Fork 30
/
Copy pathwebmention.php
executable file
·84 lines (72 loc) · 2.23 KB
/
webmention.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
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
81
82
83
84
<?php
/**
* Plugin Name: Webmention
* Plugin URI: https://github.com/pfefferle/wordpress-webmention
* Description: Webmention support for WordPress posts
* Author: Matthias Pfefferle
* Author URI: https://notiz.blog/
* Version: 5.3.3
* License: MIT
* License URI: https://opensource.org/licenses/MIT
* Text Domain: webmention
* Domain Path: /languages
*/
namespace Webmention;
\define( 'WEBMENTION_VERSION', '5.3.3' );
\define( 'WEBMENTION_PLUGIN_DIR', \plugin_dir_path( __FILE__ ) );
\define( 'WEBMENTION_PLUGIN_BASENAME', \plugin_basename( __FILE__ ) );
\define( 'WEBMENTION_PLUGIN_FILE', \plugin_dir_path( __FILE__ ) . '/' . \basename( __FILE__ ) );
\define( 'WEBMENTION_PLUGIN_URL', \plugin_dir_url( __FILE__ ) );
require_once WEBMENTION_PLUGIN_DIR . '/includes/class-autoloader.php';
require_once WEBMENTION_PLUGIN_DIR . '/includes/functions.php';
if ( \WP_DEBUG ) {
require_once WEBMENTION_PLUGIN_DIR . '/includes/debug.php';
}
// Register the autoloader.
Autoloader::register_path( __NAMESPACE__, WEBMENTION_PLUGIN_DIR . '/includes' );
// Initialize the plugin.
$webmention = Webmention::get_instance();
$webmention->init();
/**
* Plugin Version Number used for caching.
*/
function version() {
return Webmention::get_instance()->get_version();
}
/**
* Activation Hook
*
* Migrate DB if needed
*/
function activation() {
\Webmention\Upgrade::maybe_upgrade();
}
register_activation_hook( __FILE__, '\Webmention\activation' );
/**
* `get_plugin_data` wrapper
*
* @return array the plugin metadata array
*/
function get_plugin_meta( $default_headers = array() ) {
if ( ! $default_headers ) {
$default_headers = array(
'Name' => 'Plugin Name',
'PluginURI' => 'Plugin URI',
'Version' => 'Version',
'Description' => 'Description',
'Author' => 'Author',
'AuthorURI' => 'Author URI',
'TextDomain' => 'Text Domain',
'DomainPath' => 'Domain Path',
'Network' => 'Network',
'RequiresWP' => 'Requires at least',
'RequiresPHP' => 'Requires PHP',
'UpdateURI' => 'Update URI',
);
}
return \get_file_data( __FILE__, $default_headers, 'plugin' );
}
// Check for CLI env, to add the CLI commands
if ( \defined( 'WP_CLI' ) && \WP_CLI ) {
\WP_CLI::add_command( 'webmention', Cli::class );
}