Limited time sale! Use the code LIFETIME at checkout and get 20% off our limited-time lifetime plans.

How to get the PHP, WordPress, and plugins versions using WPCodeBox

Ovidiu
Founder of WPCodeBox

When debugging a piece of code or contacting support about a plugin, it's helpful to provide some minimum data about the stack you are running.

This info includes the PHP version, WP version, and even what plugins and at which versions you have them installed.

Getting this info is super easy using WPCodeBox, it being the only code snippet plugin that allows you to run snippets manually and see the output directly.

A snippet that would allow you to see the php version, plugin version and installed plugins is this:

<?php
$plugins = get_plugins();
global $wp_version;

echo "PHP Version: " . phpversion() . "\n";
echo "WordPress Version: " . $wp_version . "\n";
echo "\n\nPlugin Name -> Plugin Version\n\n";

foreach( $plugins as $plugin ) {
echo "$plugin[Name] -> $plugin[Version] \n";
}
?>

The next steps will show you how to createa a manually running snippet.

To get the info, we will create a new snippet and select "Manual (On Demand)" as its run type. Then, in the toolbar, you will have a run button. WPCodeBox will show the code output under the editor. This snippet won't run automatically, only when you click the "Run" button.

After you created the snippet, you can add the code, save the snippet and click run. Don't forget to save the snippet before running it, if there are unsaved changes, the SAVE button will be orange.

The output, at the bottom of the editor, would look like this:

Caution: Don't share this data with people you don't trust, as some WP Plugins can have vulnerabilities at specific versions, and that data shouldn't be public.

This snippet is a useful one to save to your cloud account, so you have it ready on any site you need it.

Customizing your WordPress site using 
Code Snippets is really easy.

Try WPCodeBox today. There's a 30-day money back guarantee.
Get WPCodeBox
WPCodeBox
Complete WordPress Code Snippets Manager with Cloud Support
Copyright © 2022 WPCodeBox SRL. All other trademarks are the property of their respective owners
linkedin facebook pinterest youtube rss twitter instagram facebook-blank rss-blank linkedin-blank pinterest youtube twitter instagram