AI Verified

Name

Wordpress Updates

About

See a list of Updates for Wordpress, Plugins, and Themes in the Dashboard.

Language

PHP

Rating

Voted: 0 by 0 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:

18/06/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 : 21
Code : echo('<li>' . $plugin_data['Name'] . ' (' . $plugin_update->new_version . ')
Vulnerable line : 21
Code : $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_file));

Found 1 vulnerabilities

Wordpress Updates

 
                    
1function display_update_list() {
2 $updates = get_core_updates();
3 $plugin_updates = get_plugin_updates();
4 $theme_updates = get_theme_updates();
5 
6 // Display WordPress Core updates
7 if (!empty($updates)) {
8 echo '<h3>WordPress Core</h3>';
9 echo '<ul>';
10 foreach ($updates as $update) {
11 echo '<li>' . $update->current . ' - ' . $update->locale . '</li>';
12 }
13 echo '</ul>';
14 }
15 
16 // Display Plugin updates
17 if (!empty($plugin_updates)) {
18 echo '<h3>Plugins</h3>';
19 echo '<ul>';
20 foreach ($plugin_updates as $plugin_file => $plugin_update) {
21 $plugin_data = get_plugin_data(WP_PLUGIN_DIR . '/' . $plugin_file);
22 echo '<li>' . $plugin_data['Name'] . ' (' . $plugin_update->new_version . ')' . '</li>';
23 }
24 echo '</ul>';
25 }
26 
27 // Display Theme updates
28 if (!empty($theme_updates)) {
29 echo '<h3>Themes</h3>';
30 echo '<ul>';
31 foreach ($theme_updates as $theme_directory => $theme_update) {
32 $theme = wp_get_theme($theme_directory);
33 echo '<li>' . $theme->get('Name') . ' (' . $theme_update->new_version . ')' . '</li>';
34 }
35 echo '</ul>';
36 }
37}
38 
39add_action('wp_dashboard_setup', 'add_custom_update_dashboard_widget');
40 
41function add_custom_update_dashboard_widget() {
42 wp_add_dashboard_widget(
43 'custom_update_dashboard_widget',
44 'Updates',
45 'display_update_list'
46 );
47}

0

Related Snippets

Please see some snippets below related to this snippet..

WordPress Admin

Pro Verified

3

Add your Name, Email and Address to the Wordpress Dashboard

Added: 1 year ago

Last Updated: 5 months ago

Show your Name, Email and Address for future support to Wordpress Dashboard.

WordPress Admin

AI Verified

0

Reduce WooCommerce Product Admin Column Widths

Added: 4 months ago

Last Updated: 4 months ago

If you're adding new columns to your Woo Admin Screen, then reducing the size of fields such as Name can be great.

WordPress Admin

AI Verified

0

remove options menu e snipettcode menu

Added: 1 year ago

Last Updated: 1 year ago

remove the options and code snippets menu for non-admin users if they have "manage_options" capability.

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.