Skip to content

jcamenisch/wp-debug-util

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

9 Commits
 
 
 
 
 
 

Repository files navigation

WpDebugUtil WordPress Plugin

Poke around the WordPress environment from the comfort of your Javascript console. Everything in here is pretty dangerous, and not for use in production.

Installation

First, download into your plugins directory via your server's shell prompt:

cd /path/to/Wordpress/plugins/directory
git clone git://github.com/jcamenisch/wp-debug-util.git

Then activate the plugin via the WordPress admin panel.

Usage

First, log in to your WordPress site as an administrator. Because of the dangerous nature of the functions in this plugin, they will not work for a non-admin user.

From any Page in WordPress, open the JavaScript console in your browser of choice. From there, enter the following commands to interact with the server-side WordPress environment.

WpDebug.print_r(phpExpression);

Send a PHP expression to the server, where it will be evaluated with eval and then output with print_r. The result is then displayed in the console.

Examples:

WpDebug.print_r('2 + 2');

Returns '4'

WpDebug.print_r('is_admin()');

Returns '1'

WpDebug.eval(phpStatements);

Send any PHP code to the server, where it will be run with eval. With this, you can create, edit, and delete data, modify the session—and anything else that you could do from PHP code in WordPress.

Example:

WpDebug.eval('phpinfo();');

Displays the entire output of phpinfo() to the console.

Known issue

Because of some odd issues with PHP's handling of quotation marks, this plugin strips slashes from submitted code strings. To send a legitimate slash, enter two in your string.

For example, the following will raise a parse error:

WpDebug.eval("'This won\'t work.'");

However the following works fine:

WpDebug.eval("'This isn\\'t a problem.'");

About

Utilities for WordPress debugging

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published