This repository was archived by the owner on Feb 7, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathwp-magic.php
95 lines (85 loc) · 1.96 KB
/
wp-magic.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
85
86
87
88
89
90
91
92
93
94
95
<?php
/**
* @package Magic
* Plugin Name: Login by Magic
* Plugin URI: https://github.com/magiclabs/wp-magic
* Description: Login by Magic provides passwordless login for your WordPress site.
* Version: 1.0.5
* Author: Magic
* Author URI: https://magic.link/
* Text Domain: wp-magic
*/
if (!defined('ABSPATH')) {
// Exit if accessed directly.
exit;
}
/**
* Main Magic Link Class
*
* The init class that runs the Magic plugin.
* Intended To make sure that the plugin's minimum requirements are met.
*/
class Magic_Link
{
/**
* Plugin Version
*
* @since 1.0.5
* @var string The plugin version.
*/
const VERSION = '1.0.5';
/**
* Minimum PHP Version
*
* @since 7.3.0
* @var string Minimum PHP version required to run the plugin.
*/
const MINIMUM_PHP_VERSION = '7.3';
/**
* Constructor
*
* @since 0.0.0
* @access public
*/
public function __construct()
{
// Load the translation.
add_action('init', array($this, 'i18n'));
// Initialize the plugin.
add_action('plugins_loaded', array($this, 'init'));
}
/**
* Load Textdomain
*
* Load plugin localization files.
* Fired by `init` action hook.
*
* @since 0.0.0
* @access public
*/
public function i18n()
{
load_plugin_textdomain('magic-wp-plugin');
}
/**
* Initialize the plugin
*
* Fired by `plugins_loaded` action hook.
*
* @since 0.0.0
* @access public
*/
public function init()
{
// Once we get here, We have passed all validation checks so we can safely include our widgets.
require_once 'includes/class-admin.php';
if (is_admin()) {
new Magic_Admin();
}
require_once 'vendor/autoload.php';
require_once 'includes/class-login.php';
new Magic_Login();
}
}
// Instantiate Magic Link.
new Magic_Link();