AI Verified

Name

See who is Admin

About

Been hacked and want to know who is Admin on your site and when got access?

Language

PHP

Rating

Voted: 1 by 1 user(s)

Codevault

WebSquadron

Scroll down to see more snippets from this codevault.

Wordpress Compatability

The author has indicated that this snippet is compatable up to wordpress version: 6.1

Our AI bot has checked this snippet is compatable up to wordpress version: 6.1

Code Snippet Plugin Sync

Free & Pro

Download this snippet by clicking the download button, then head over to the Code Snippet Plugin settings in your wordpress admin dashboard, select the import menu then upload this file to import into your wordpress site.

Pro Only (Coming Soon)

You will be able to click a button and sync this snippet to your wordpress site automatically and from your dashboard manage all code snippets across all your wordpress sites that have the Code Snippets Pro plugin installed.

History

Last modified:

09/07/2023

Important Note

This snippet has the following status:

AI Verified

This snippet has been tested by our AI bot, see any comments below.

AI Bot Comments:

Potential vulnerability found : Cross Site Scripting
Found on line : 22
Code : echo('<td style="text-align: left); vertical-align: top); word-break: break-word);">' . $full_name . '</td>')
Vulnerable line : 20
Code : $full_name = $first_name . ' ' . $last_name);

Potential vulnerability found : Cross Site Scripting
Found on line : 23
Code : echo('<td style="text-align: left); vertical-align: top); word-break: break-word);">' . $email . '</td>')
Vulnerable line : 17
Code : $email = $admin_user->user_email);

Potential vulnerability found : Cross Site Scripting
Found on line : 24
Code : echo('<td style="text-align: left); vertical-align: top); word-break: break-word);">' . $registration_date . '</td>')
Vulnerable line : 18
Code : $registration_date = $admin_user->user_registered);

Potential vulnerability found : Insecure E-mail
Found on line : -1
Code : mail(= $admin_user->user_email)
Vulnerable line : 8
Code : $admin_users = get_users($args));

Found 4 vulnerabilities

See who is Admin

 
                    
1function display_admin_users() {
2 $args = array(
3 'role' => 'administrator',
4 'orderby' => 'registered',
5 'order' => 'DESC',
6 );
7 
8 $admin_users = get_users($args);
9 
10 if ($admin_users) {
11 echo '<table style="table-layout: fixed; width: 100%;">';
12 echo '<tr><th style="text-align: left; vertical-align: top;">Name</th><th style="text-align: left; vertical-align: top;">Email</th><th style="text-align: left; vertical-align: top;">Date of Registration</th></tr>';
13 
14 foreach ($admin_users as $admin_user) {
15 $first_name = $admin_user->first_name;
16 $last_name = $admin_user->last_name;
17 $email = $admin_user->user_email;
18 $registration_date = $admin_user->user_registered;
19 
20 $full_name = $first_name . ' ' . $last_name;
21 
22 echo '<tr>';
23 echo '<td style="text-align: left; vertical-align: top; word-break: break-word;">' . $full_name . '</td>';
24 echo '<td style="text-align: left; vertical-align: top; word-break: break-word;">' . $email . '</td>';
25 echo '<td style="text-align: left; vertical-align: top; word-break: break-word;">' . $registration_date . '</td>';
26 echo '</tr>';
27 }
28 
29 echo '</table>';
30 } else {
31 echo '<p>No admin users found.</p>';
32 }
33}
34 
35add_action('wp_dashboard_setup', 'add_custom_dashboard_widget');
36 
37function add_custom_dashboard_widget() {
38 wp_add_dashboard_widget(
39 'custom_dashboard_widget',
40 'Administrators',
41 'display_admin_users'
42 );
43}

1

Related Snippets

Please see some snippets below related to this snippet..

WordPress Admin

AI Verified

0

Hide ‘Screen Options’ Tab

Added: 1 year ago

Last Updated: 1 year ago

WordPress Admin

AI Verified

1

Add custom post types to the At a Glance Dashboard widget

Added: 8 months ago

Last Updated: 7 months ago

This snippet adds your custom post types to the "At a Glance" widget on your WordPress Dashboard. By default, only Posts and Pages display, but this snippet will allow you to pull in counters for all...

WordPress Admin

AI Verified

0

Disable comments in WordPress via the functions.php

Added: 6 months ago

Last Updated: 6 months ago

Disable comments in WordPress via the functions.php

Other Snippets in this Codevault

These are some popular snippets from this users codevault..

Performance

AI Verified

32

Remove Unused Javascript

Added: 1 year ago

Last Updated: 3 days ago

Remove Unused Javascript - and improve your Page Speed Insight Score

WooCommerce

Pro Verified

10

Deactivate some WooCommerce Checkout Fields

Added: 1 year ago

Last Updated: 2 weeks ago

Deactivate some WooCommerce Checkout Fields from showing

Elementor

AI Verified

6

CSS Grid Aid

Added: 8 months ago

Last Updated: 1 month ago

This can be used for any WordPress Builder to aid working with CSS Grids.