AI Verified
Display External Server IP
This WordPress code snippet enhances the admin dashboard by adding a custom item to the WordPress admin bar labeled "Check External IP". This feature allows administrators to fetch and display the external IP address of the server hosting the WordPress site with a simple click. It's designed to provide convenience for administrators, especially useful in scenarios where knowing the external IP address is necessary for troubleshooting, configuration, or security purposes.
PHP
Voted: 1 by 1 user(s)
Viewing the External IP: Once implemented, administrators will see a "Check External IP" item in the WordPress admin bar. Clicking this item will trigger an alert dialogue that displays the current external IP address of the server. Security and Privacy: This feature is secure and respects privacy by limiting access to administrators and not displaying the IP address until explicitly requested. The code snippet utilizes api.ipify.org, a simple and straightforward external service, to fetch the external IP address of the server where the WordPress site is hosted. This is a free API and you should visit their website for more information.
Scroll down to see more snippets from this codevault.
The author has indicated that this snippet is compatable up to wordpress version: 6.4
Our AI bot has checked this snippet is compatable up to wordpress version: 6.1
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.
Last modified:
29/03/2024
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 : 51
Code : echo(esc_html($data->ip)
Vulnerable line : 51
Code : $data = json_decode($body));
Found 1 vulnerabilities
1
Please see some snippets below related to this snippet..
WordPress Admin
AI Verified
Added: 1 year ago
Last Updated: 1 year ago
Function for post duplication. Dups appear as drafts. User is redirected to the edit screen
WordPress Admin
AI Verified
Added: 1 year ago
Last Updated: 1 year ago
This code will redirect a specific page based on the user role NOT being met.
WordPress Admin
AI Verified
Added: 1 year ago
Last Updated: 1 year ago
Based on work by platypus424 and germankiwi, this snippet will allow you to see code on a particular line number from all of your snippets, allowing you to track down exactly where an error might be o...
These are some popular snippets from this users codevault..
General
AI Verified
Added: 6 months ago
Last Updated: 5 months ago
Display the estimated read time of a post with a shortcode. This code snippet produces a shortcode to display the estimated reading time for a post. It strips HTML tags, counts the words, and divi...
WordPress Admin
AI Verified
Added: 4 months ago
Last Updated: 3 months ago
This WordPress code snippet enhances the admin dashboard by adding a custom item to the WordPress admin bar labeled "Check External IP". This feature allows administrators to fetch and display the ext...
General
AI Verified
Added: 4 months ago
Last Updated: 4 months ago
Display the users current IP address with shortcode [my-ip]
Category
Snippet Status