PluginProbe
WebFinger / 4.0.0
WebFinger v4.0.0
4.1.0 trunk 0.5 0.7 0.9 0.9.1 1.0 1.0.1 1.1 1.2 1.3 1.3.1 2.0.0 2.0.1 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 All 36 releases
webfinger / webfinger.php

webfinger.php in WebFinger 4.0.0, at webfinger.php

57 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Plugin Name: WebFinger
4 * Plugin URI: https://github.com/pfefferle/wordpress-webfinger
5 * Description: WebFinger for WordPress
6 * Version: 4.0.0
7 * Author: Matthias Pfefferle
8 * Author URI: https://notiz.blog/
9 * License: MIT
10 * License URI: https://opensource.org/licenses/MIT
11 *
12 * @package Webfinger
13 */
14
15 namespace Webfinger;
16
17 \defined( 'WEBFINGER_LEGACY' ) || \define( 'WEBFINGER_LEGACY', false );
18
19 // Plugin related constants.
20 \define( 'WEBFINGER_PLUGIN_DIR', \plugin_dir_path( __FILE__ ) );
21 \define( 'WEBFINGER_PLUGIN_BASENAME', \plugin_basename( __FILE__ ) );
22 \define( 'WEBFINGER_PLUGIN_FILE', WEBFINGER_PLUGIN_DIR . \basename( __FILE__ ) );
23 \define( 'WEBFINGER_PLUGIN_URL', \plugin_dir_url( __FILE__ ) );
24
25 // Require the autoloader.
26 require_once WEBFINGER_PLUGIN_DIR . 'includes/class-autoloader.php';
27 Autoloader::register_path( 'Webfinger\\', WEBFINGER_PLUGIN_DIR . 'includes/' );
28
29 /**
30 * Initialize plugin.
31 */
32 function init() {
33 // List of various public helper functions.
34 require_once WEBFINGER_PLUGIN_DIR . 'includes/functions.php';
35 require_once WEBFINGER_PLUGIN_DIR . 'includes/deprecated.php';
36
37 Webfinger::init();
38 Admin::init();
39 Health_Check::init();
40
41 // Add legacy WebFinger class.
42 if ( WEBFINGER_LEGACY && ! \class_exists( '\WebFingerLegacy_Plugin' ) ) {
43 Legacy::init();
44 }
45 }
46 \add_action( 'plugins_loaded', '\Webfinger\init' );
47
48 /**
49 * Flush rewrite rules.
50 */
51 function flush_rewrite_rules() {
52 Webfinger::generate_rewrite_rules();
53 \flush_rewrite_rules();
54 }
55 \register_activation_hook( __FILE__, '\Webfinger\flush_rewrite_rules' );
56 \register_deactivation_hook( __FILE__, '\flush_rewrite_rules' );
57