Test WordPress Plugin Functionality

Test Plugin Functionality

When creating new WordPress plugins, some authors just dump their code into the wp-config.php file to “test” it without fully coding out the required plugin structure. This is a bad idea and can easily be prevented by simply creating a test.php file and placing it in the root directory of the WordPress installation.

<?php
//Load the WordPress Environment
define('WP_DEBUG', true); /* comment out to turn off debugging */
require('./wp-load.php');
//require_once ('./wp-admin/admin.php'); /* uncomment for is_admin() */
?>
<pre>
<?php
/* insert test stuff here */
var_dump( is_admin() );

?>
</pre>

About the Author

Chad

Freelance web developer and designer residing in Pittsburgh, PA I enjoy creating custom applications and websites to solve real-world problems. When I am not coding away I enjoy trying new craft beers from around the world.

Leave a Reply

New Blog Post: MySQL Using the JOIN Operand Within a Query - http://goo.gl/KHUij