-
Notifications
You must be signed in to change notification settings - Fork 4
/
bh-wp-autologin-urls.php
executable file
·75 lines (65 loc) · 2.12 KB
/
bh-wp-autologin-urls.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
<?php
/**
* The plugin bootstrap file
*
* @link https://BrianHenry.ie
* @since 1.0.0
* @package brianhenryie/bh-wp-autologin-urls
*
* @wordpress-plugin
* Plugin Name: Magic Emails & Autologin URLs
* Plugin URI: https://wordpress.org/BrianHenryIE/bh-wp-autologin-urls
* Description: Log in users via emails sent from WordPress.
* Version: 2.5.0
* Tested up to: 6.6
* Requires PHP: 7.4
* Author: BrianHenryIE
* Author URI: https://BrianHenry.ie
* License: GPL-2.0+
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt
* Text Domain: bh-wp-autologin-urls
* Domain Path: /languages
*
* GitHub Plugin URI: https://github.com/BrianHenryIE/bh-wp-autologin-urls
* Release Asset: true
*/
namespace BH_WP_Autologin_URLs;
use BrianHenryIE\WP_Autologin_URLs\API\API;
use BrianHenryIE\WP_Autologin_URLs\API\Data_Stores\DB_Data_Store;
use BrianHenryIE\WP_Autologin_URLs\BH_WP_Autologin_URLs;
use BrianHenryIE\WP_Autologin_URLs\API\Settings;
use BrianHenryIE\WP_Autologin_URLs\WP_Logger\Logger;
use Exception;
// If this file is called directly, abort.
if ( ! defined( 'ABSPATH' ) ) {
throw new Exception();
}
require_once plugin_dir_path( __FILE__ ) . 'autoload.php';
/**
* Currently plugin version.
*/
define( 'BH_WP_AUTOLOGIN_URLS_VERSION', '2.5.0' );
define( 'BH_WP_AUTOLOGIN_URLS_BASENAME', plugin_basename( __FILE__ ) );
/**
* Function to keep the loader and settings objects out of the namespace.
*
* @return API
*/
function instantiate_bh_wp_autologin_urls(): API {
$settings = new Settings();
$logger = Logger::instance( $settings );
$datastore = new DB_Data_Store( $logger );
$api = new API( $settings, $logger, $datastore );
new BH_WP_Autologin_URLs( $api, $settings, $logger );
return $api;
}
/**
* Begins execution of the plugin.
*
* Since everything within the plugin is registered via hooks,
* then kicking off the plugin from this point in the file does
* not affect the page life cycle.
*
* @since 1.0.0
*/
$GLOBALS['bh-wp-autologin-urls'] = instantiate_bh_wp_autologin_urls();