Skip to content

Commit

Permalink
refactor: simplify vulnerability plugin availability check and improv…
Browse files Browse the repository at this point in the history
…e user feedback
  • Loading branch information
lgersman committed Feb 6, 2025
1 parent 4226274 commit b126a14
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<?php

// phpcs:disable WordPress.WP.GlobalVariablesOverride.Prohibited

namespace ionos_wordpress\essentials\dashboard\blocks\deep_links;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -33,9 +33,18 @@
}
}
} else {
if (! in_array('ionos-security/ionos-security.php', array_keys(get_plugins()), true)) {
printf('<h4>%s</h4>', \esc_html__('Please, install the IONOS Security Plugin', 'ionos-essentials'));
} elseif (is_plugin_inactive('ionos-security/ionos-security.php')) {
printf('<h4>%s</h4>', \esc_html__('Please, activate the IONOS Security Plugin', 'ionos-essentials'));
}
// this is problematic : do we need all this stuff or is it enough to reflect to the user that the plugin is not 'available' ?
// if (\current_user_can('manage_options')) {
// if(! \function_exists('get_plugins')) {
// require_once \ABSPATH . 'wp-admin/includes/plugin.php';
// }

// if (! in_array('ionos-security/ionos-security.php', array_keys(\get_plugins()), true)) {
// printf('<h4>%s</h4>', \esc_html__('Please, install the IONOS Security Plugin', 'ionos-essentials'));
// } elseif (\is_plugin_inactive('ionos-security/ionos-security.php')) {
// printf('<h4>%s</h4>', \esc_html__('Please, activate the IONOS Security Plugin', 'ionos-essentials'));
// }
// } else {
printf('<h4>%s</h4>', \esc_html__('IONOS Security Plugin not available', 'ionos-essentials'));
// }
}

0 comments on commit b126a14

Please sign in to comment.