Protection of WordPress logins

This commit is contained in:
2024-02-26 14:47:51 +01:00
parent bb741539f6
commit 18820c7191
18 changed files with 903 additions and 13 deletions

32
includes/spl.php Normal file
View File

@ -0,0 +1,32 @@
<?php
spl_autoload_register(function ($className) {
if (!str_starts_with($className, 'ProtectLogin\\')) {
return;
}
$fileName = str_replace('\\','/', $className);
$fileName = str_replace('ProtectLogin/Modules/', 'ProtectLogin/modules/', $fileName);
$fileName = str_replace('ProtectLogin/', '', $fileName);
$fileName = BDP_LV_PLUGIN_DIR . $fileName . '.php';
if (!file_exists($fileName)) {
return;
}
require_once $fileName;
});
$modules = ['LimitLoginAttempts', 'PasswordStrength'];
$subdirs = ['includes', 'Controllers', 'Views'];
foreach ($modules as $curModule) {
foreach ($subdirs as $dir) {
$directoryPath = BDP_LV_PLUGIN_DIR . 'modules/' . $curModule . '/' . $dir . '/';
foreach (glob($directoryPath . '*.php') as $file) {
require_once $file;
}
}
}