diff --git a/inc/spbc-admin.php b/inc/spbc-admin.php index 5ac151b28..d03f2a52c 100644 --- a/inc/spbc-admin.php +++ b/inc/spbc-admin.php @@ -1007,7 +1007,6 @@ function spbc_admin__change_plugin_description($all_plugins) return $all_plugins; } - /** * Add the statistics widget to the dashboard. * @return void @@ -1022,7 +1021,16 @@ function spbc_dashboard_statistics_widget() $actual_plugin_name = $spbc->data['wl_brandname']; } - if ( current_user_can('activate_plugins') ) { + /** + * Hook. List of allowed user roles for the Dashboard widget. + * add_filter('spbct_hook_dashboard_widget_allowed_roles_list', function($roles_list) { + * $roles_list[] = 'editor'; + * return $roles_list; + * }); + */ + $roles_list = apply_filters('spbct_hook_dashboard_widget_allowed_roles_list', array('administrator')); + + if ( is_array($roles_list) && spbc_is_user_role_in($roles_list) ) { wp_add_dashboard_widget( 'spbc_dashboard_statistics_widget', $actual_plugin_name, @@ -1051,29 +1059,35 @@ function spbc_dashboard_statistics_widget_output($_post, $_callback_args)
data['display_scanner_warnings']['critical'] > 0) {
+ if ( spbc_is_user_role_in(array('administrator')) && $spbc->data['display_scanner_warnings']['critical'] > 0 ) {
echo (spbc__get_accordion_tab_info_block_html('critical-for-widget'));
}
+ ?>
- echo '
')
- . '' : '',
- $actual_plugin_name,
- ! $spbc->data["wl_mode_enabled"] ? '' : '',
- '' . number_format($brief_data_total_count, 0, ',', ' ') . ''
- )
- . ''
- . (! $spbc->white_label && ! $spbc->data["wl_mode_enabled"]
- ? '
')
+ . ''
+ . sprintf(
+ __('%s has blocked %s attacks for all time. The statistics are automatically updated every 24 hours.', 'security-malware-firewall'),
+ $plugin_name,
+ '' . number_format($brief_data_total_count, 0, ',', ' ') . ''
+ )
+ . '';
+ echo '