Skip to content

Commit

Permalink
v 0.96.0
Browse files Browse the repository at this point in the history
- Fix behavior when updating a plugin with lang files.
- Check if 2FA is installed for admins.
  • Loading branch information
Darklg committed Jun 23, 2024
1 parent 3b655c7 commit d3d5980
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 3 deletions.
1 change: 0 additions & 1 deletion bin/update.sh
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,6 @@ function wputools__update_plugin() {
if [[ "${_PLUGIN_VERSION_OLD}" == "${_PLUGIN_VERSION}" ]];then
local _PLUGIN_COMMIT_TEXT="Update Plugin ${_PLUGIN_TITLE}";
fi;
git add "${_PLUGIN_LANG}";
if [[ -d "${_PLUGIN_LANG}" ]];then
git add "${_PLUGIN_LANG}";
fi;
Expand Down
17 changes: 16 additions & 1 deletion tools/diagnostic/inc/40-wordpress.php
Original file line number Diff line number Diff line change
Expand Up @@ -382,14 +382,29 @@ function wputools_test_rss_feed($rss_url) {
}

/* ----------------------------------------------------------
Check number of admins
Check admins
---------------------------------------------------------- */

$admins = get_users(array(
'role' => 'administrator',
'fields' => array('user_nicename')
));

/* Check 2FA */
if (!$is_debug_env) {
if (!in_array('two-factor/two-factor.php', get_option('active_plugins'))) {
$wputools_errors[] = 'You should have an active 2FA plugin.';
} else {
foreach ($admins as $user) {
$two_fa_user = get_user_meta($user->ID, '_two_factor_enabled', true);
if (!$two_fa_user) {
$wputools_errors[] = sprintf('You should have 2FA enabled for the user “%s”.', $user->user_nicename);
}
}
}
}

/* Check user name */
if (count($admins) > 1) {
$admins = array_map(function ($c) {
return $c->user_nicename;
Expand Down
2 changes: 1 addition & 1 deletion wputools.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

WPUTools(){

local _WPUTOOLS_VERSION='0.95.0';
local _WPUTOOLS_VERSION='0.96.0';
local _PHP_VERSIONS=(7.0 7.1 7.2 7.3 7.4 8.0 8.1 8.2 8.3 8.4 8.5 9.0)
local _PHP_VERSIONS_OBSOLETES=(7.0 7.1 7.2 7.3 7.4)
local _PHP_VERSIONS_ADVANCED=(8.2 8.3 8.4 8.5 9.0)
Expand Down

0 comments on commit d3d5980

Please sign in to comment.