| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: NodeInfo |
| 4 |
* Plugin URI: https://github.com/pfefferle/wordpress-nodeinfo/ |
| 5 |
* Description: NodeInfo is an effort to create a standardized way of exposing metadata about a server running one of the distributed social networks. |
| 6 |
* Version: 3.1.0 |
| 7 |
* Author: Matthias Pfefferle |
| 8 |
* Author URI: https://notiz.blog/ |
| 9 |
* License: MIT |
| 10 |
* License URI: http://opensource.org/licenses/MIT |
| 11 |
* Text Domain: nodeinfo |
| 12 |
* |
| 13 |
* @package Nodeinfo |
| 14 |
*/ |
| 15 |
|
| 16 |
defined( 'ABSPATH' ) || exit; |
| 17 |
|
| 18 |
define( 'NODEINFO_PLUGIN_FILE', __FILE__ ); |
| 19 |
define( 'NODEINFO_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 20 |
|
| 21 |
// Require the autoloader. |
| 22 |
require_once NODEINFO_PLUGIN_DIR . 'includes/class-autoloader.php'; |
| 23 |
|
| 24 |
// Register the autoloader. |
| 25 |
Nodeinfo\Autoloader::register_path( 'Nodeinfo', NODEINFO_PLUGIN_DIR . 'includes' ); |
| 26 |
|
| 27 |
// Require global functions. |
| 28 |
require_once NODEINFO_PLUGIN_DIR . 'includes/functions.php'; |
| 29 |
|
| 30 |
// Require deprecated classes for backwards compatibility. |
| 31 |
require_once NODEINFO_PLUGIN_DIR . 'includes/class-nodeinfo-endpoint.php'; |
| 32 |
|
| 33 |
/** |
| 34 |
* Plugin initialization function. |
| 35 |
* |
| 36 |
* @return Nodeinfo\Nodeinfo The plugin instance. |
| 37 |
*/ |
| 38 |
function nodeinfo_plugin() { |
| 39 |
return Nodeinfo\Nodeinfo::get_instance(); |
| 40 |
} |
| 41 |
|
| 42 |
// Initialize the plugin after all plugins are loaded. |
| 43 |
add_action( |
| 44 |
'plugins_loaded', |
| 45 |
function () { |
| 46 |
nodeinfo_plugin()->init(); |
| 47 |
} |
| 48 |
); |
| 49 |
|
| 50 |
// Register activation and deactivation hooks. |
| 51 |
register_activation_hook( __FILE__, array( Nodeinfo\Nodeinfo::class, 'activate' ) ); |
| 52 |
register_deactivation_hook( __FILE__, array( Nodeinfo\Nodeinfo::class, 'deactivate' ) ); |
| 53 |
|