PluginProbe
FluentAuth – The Ultimate Authorization & Security Plugin for WordPress / 1.0.0
FluentAuth – The Ultimate Authorization & Security Plugin for WordPress v1.0.0
trunk 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.1.0 2.0.0 2.0.1 2.0.2 2.0.3 2.1.0 2.1.1 2.1.2
fluent-security / fluent-security.php

fluent-security.php in FluentAuth – The Ultimate Authorization & Security Plugin for WordPress 1.0.0, at fluent-security.php

94 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 defined('ABSPATH') or die;
3
4 /*
5 Plugin Name: FluentAuth - Auth Security Plugin
6 Plugin URI: https://fluentauth.com
7 Description: Super Simple Login & Signup Security and Social Login Plugin for WordPress
8 Version: 1.0.0
9 Author: Fluent Auth Team
10 Author URI: https://fluentauth.com
11 License: GPLv2 or later
12 License URI: https://www.gnu.org/licenses/gpl-2.0.html
13 Text Domain: fluent-security
14 Domain Path: /language/
15 */
16
17 define('FLUENT_AUTH_PLUGIN_PATH', plugin_dir_path(__FILE__));
18 define('FLUENT_AUTH_PLUGIN_URL', plugin_dir_url(__FILE__));
19 define('FLUENT_AUTH_VERSION', '1.0.0');
20
21 class FluentAuthPlugin
22 {
23 public function init()
24 {
25 $this->autoLoad();
26
27 register_activation_hook(__FILE__, [$this, 'activatePlugin']);
28 register_deactivation_hook(__FILE__, [$this, 'deactivatePlugin']);
29
30 load_plugin_textdomain('fluent-security', false, dirname(plugin_basename(__FILE__)) . '/language');
31
32 $plugin_file = plugin_basename(__FILE__);
33 add_filter("plugin_action_links_{$plugin_file}", [$this, 'addContextLinks'], 10, 1);
34 }
35
36 public function activatePlugin($siteWide = false)
37 {
38 \FluentAuth\App\Helpers\Activator::activate($siteWide);
39 }
40
41 public function deactivatePlugin()
42 {
43 wp_clear_scheduled_hook('fluent_auth_daily_tasks');
44 }
45
46 private function autoLoad()
47 {
48 require_once FLUENT_AUTH_PLUGIN_PATH . 'app/libs/wpfluent/wpfluent.php';
49
50 spl_autoload_register(function($class) {
51 $match = 'FluentAuth';
52
53 if (!preg_match("/\b{$match}\b/", $class)) {
54 return;
55 }
56
57 $path = plugin_dir_path(__FILE__);
58
59 $file = str_replace(
60 ['FluentAuth', '\\', '/App/'],
61 ['', DIRECTORY_SEPARATOR, 'app/'],
62 $class
63 );
64
65 require(trailingslashit($path) . trim($file, '/') . '.php');
66 });
67
68 add_action('rest_api_init', function () {
69 require_once FLUENT_AUTH_PLUGIN_PATH . 'app/Http/routes.php';
70 });
71
72 require_once FLUENT_AUTH_PLUGIN_PATH . 'app/Hooks/hooks.php';
73 }
74
75 public function addContextLinks($actions)
76 {
77 $actions['settings'] = sprintf(
78 '<a href="%s">%s</a>',
79 esc_url(admin_url('admin.php?page=fluent-auth#/settings')),
80 esc_html__('Settings', 'fluent-security')
81 );
82
83 $actions['dashboard_page'] = sprintf(
84 '<a href="%s">%s</a>',
85 esc_url(admin_url('admin.php?page=fluent-auth#/')),
86 esc_html__('Dashboard', 'fluent-security')
87 );
88
89 return $actions;
90 }
91 }
92
93 (new FluentAuthPlugin())->init();
94