How do you debug plugins?
Go into wp-config.php and change define(‘WP_DEBUG’, false); to define(‘WP_DEBUG’, true);. Also, install Andrew Nacin’s Log Deprecated Notices plugin.
Go into wp-config.php and change define(‘WP_DEBUG’, false); to define(‘WP_DEBUG’, true);. Also, install Andrew Nacin’s Log Deprecated Notices plugin.
Hi @Sruly: You’ve pretty much answered your own question, but I’ll elaborate a bit. Action Hooks Actions Hooks are intended for use when WordPress core or some plugin or theme is giving you the opportunity to insert your code at a certain point and do one or more of the following: Use echo to inject … Read more
Well what a coincidence that you ask this, Jan! Just today I had time on a long train journey and decided to write a Rewrite Analyzer plugin, one that parses your rewrite rules and highlights the query variables. You can test URLs right there and see what query variables will be set. You can find … Read more
For anyone who wants to know more about file uploading, here’s a quick primer covering the major topics and pain points. This is written with WordPress 3.0 on a Linux box in mind, and the code is just a basic overview to teach the concepts. I’m sure some folks here could offer advice for improvement … Read more
OS Windows 7 x64 Using PhpStorm excellent non-free IDE, a lot of focus on speed and productivity Xdebug debugger, a lot of useful functions to dump, trace stack, profile WinSCP secure file transfer, folders sync, remote editing, backup Uniform Server WAMP stack, portable, up to date components Internet Explorer Collection easy way to have multiple … Read more
Rewrite analyzer Description Making sense of the rewrite mess. Display and play with your rewrite rules. Type Plug and play Screenshot Download link WordPress.org Plugin Directory Related Question A tool to analyze rewrite rules? and all linked to it 🙂
Coming in late to this party, but here’s the “WordPress” way: use plugin_dir_path( __FILE__ ), e.g.: <?php include( plugin_dir_path( __FILE__ ) . ‘ipn/paypal-ipn.php’); ?> Note that the function does return the trailing slash for the filepath.
Okay, I’ve had two big projects where I’ve been in control of the server enough to namespace and rely on autoloading. First up. Autoloading is awesome. Not worrying about requires is a relatively good thing. Here’s a loader I’ve been using on a few projects. Checks to make sure the class is in the current … Read more
I would start with this question: Is the functionality related to presentation of content, or with generation/management of content, or of the site, or of the user identity? If the functionality is not related specifically to presentation of content, then it is squarely within Plugin Territory. This list is long: Modifying core WP filters (wp_head … Read more
Good question, there are a number of approaches and it depends on what you want to achieve. I often do; add_action( ‘plugins_loaded’, array( ‘someClassy’, ‘init’ )); class someClassy { public static function init() { $class = __CLASS__; new $class; } public function __construct() { //construct what you see fit here… } //etc… } A more … Read more