PluginProbe
DoLogin Security / 4.4
DoLogin Security v4.4
5.0.10 4.8.3 trunk 1.0 1.1 1.1.1 1.2 1.2.1 1.2.2 1.3 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.4 1.4.1 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.5 1.6 All 64 releases
dologin / dologin.php

dologin.php in DoLogin Security 4.4, at dologin.php

82 lines 2.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Plugin Name: DoLogin Security
5 * Description: Passwordless login. 2FA verification login. GeoLocation (Continent/Country/City) or IP range to limit login attempts. Support Whitelist and Blacklist. Support WooCommerce. Login attempt limit. CLI supported for generating passwordless login.
6 * Version: 4.4
7 * Author: WPDO
8 * License: GPLv3
9 * License URI: http://www.gnu.org/licenses/gpl.html
10 * Text Domain: dologin
11 * Domain Path: /lang
12 *
13 * Copyright (C) 2025-2026 WPDO
14 *
15 * This program is free software: you can redistribute it and/or modify
16 * it under the terms of the GNU General Public License as published by
17 * the Free Software Foundation, either version 3 of the License, or
18 * (at your option) any later version.
19 *
20 * This program is distributed in the hope that it will be useful,
21 * but WITHOUT ANY WARRANTY; without even the implied warranty of
22 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 * GNU General Public License for more details.
24 *
25 * You should have received a copy of the GNU General Public License
26 * along with this program. If not, see <http://www.gnu.org/licenses/>.
27
28 */
29 defined('WPINC') || exit;
30
31 if (defined('DOLOGIN_V')) {
32 return;
33 }
34
35 define('DOLOGIN_V', '4.4');
36
37 !defined('DOLOGIN_DIR') && define('DOLOGIN_DIR', __DIR__ . '/'); // Full absolute path '/usr/local/***/wp-content/plugins/dologin/' or MU
38 !defined('DOLOGIN_PLUGIN_URL') && define('DOLOGIN_PLUGIN_URL', plugin_dir_url(__FILE__)); // Full URL path '//example.com/wp-content/plugins/dologin/'
39
40 !defined('DOLOGIN_LOGO') && define('DOLOGIN_LOGO', '<img src="' . DOLOGIN_PLUGIN_URL . 'assets/shield.svg" class="dologin-logo" style="max-width:50px;max-height:37px;"> ');
41
42 require_once DOLOGIN_DIR . 'autoload.php';
43
44 // Define CLI
45 if ((defined('WP_CLI') && WP_CLI) || PHP_SAPI == 'cli') {
46 !defined('DOLOGIN_CLI') && define('DOLOGIN_CLI', true);
47
48 // Register CLI cmd
49 if (method_exists('WP_CLI', 'add_command')) {
50 WP_CLI::add_command('dologin', 'dologin\CLI');
51 }
52 }
53
54 /**
55 * API for external plugin usage
56 * @since 1.4.1
57 */
58 if (!function_exists('dologin_gen_link')) {
59 function dologin_gen_link($src, $uid = false)
60 {
61 if (!$uid) {
62 $user = wp_get_current_user();
63 } else {
64 $user = get_user_by('id', (int) $uid);
65 }
66
67 $uid = $user->ID;
68 $src .= '-' . $user->display_name;
69
70 return \dologin\Pswdless::cls()->gen_link($src, $uid, true);
71 }
72 }
73
74 // Declare WooCommerce HPOS (High-Performance Order Storage) compatibility. This plugin only hooks the login form and never touches order data, so it is fully compatible.
75 add_action('before_woocommerce_init', function () {
76 if (class_exists('\Automattic\WooCommerce\Utilities\FeaturesUtil')) {
77 \Automattic\WooCommerce\Utilities\FeaturesUtil::declare_compatibility('custom_order_tables', __FILE__, true);
78 }
79 });
80
81 \dologin\Core::cls();
82