Articles of errors

Warning: in_array() expects parameter 2 to be array, null given

On a freshly built site running version 3.1.3 with the twentyten theme active and no plugins, when I click on “Media” to go the media manager, I’m getting this error: Warning: explode() expects parameter 2 to be string, array given in C:\xampplite\htdocs\testsite\wp-includes\query.php on line 2390 Warning: in_array() expects parameter 2 to be array, null given […]

Remove type attribute from script and style tags added by WordPress

Warning: The type attribute is unnecessary for JavaScript resources. From line 10, column 146; to line 10, column 176 feed/” /> <script type=”text/javascript”>window Warning: The type attribute for the style element is not needed and should be omitted. From line 11, column 1798; to line 11, column 1820 </script> <style type=”text/css”>img.wp Warning: The type attribute […]

Error handling a plugin with exceptions

I’m creating a new plugin and I want to handle errors cleanly. I find the WP_Error class unwieldy so have decided to use exceptions. I am not bothered about lack of PHP 4 support. $error = true; if ($error) { // Throw an error throw new CustomException(‘A custom exception’); } What I really want to […]

What does this error mean? WordPress database error:

WordPress database error: [MySQL server has gone away] I did not make any changes, and the host says that there is no problem with MySQL. Can anyone explain what the error means? and how to troubleshoot? This is a shared hosting environment, and no recent changes where made to the site. Also other wordpress sites […]

Can a plugin still effect a site even after deletion?

I haven’t been able to find an answer on whether or not this can happen. If there is a poorly built plugin that hasn’t been updated in two years, and I make the poor decision to install it anyway – is it possible that even after complete deletion in the FTP this plugin could still […]

No Error Log File, no debug info

My error when writing a plugin for uploads and yes, I can debug. But it just jumps directly from this line to destruct the end of my wp-config.php EDIT: // Enable WP_DEBUG mode define(‘WP_DEBUG’, true); // Enable Debug logging to the /wp-content/debug.log file define(‘WP_DEBUG_LOG’, true); /** Sets up WordPress vars and included files. */ require_once(ABSPATH […]

Unexpected Output: register_activation_hook with namespace

I encounter a weird error while using the register_activation_hook and namespace. The plugin generated 236 characters of unexpected output during activation. If you notice “headers already sent” messages, problems with syndication feeds or other issues, try deactivating or removing this plugin. I get this error even with this simple plugin: <?php /** * Plugin Name: […]

wp is not defined error using to create a custom image uploader

I’m trying to create a custom media uploader in a custom meta box on a custom post type. That’s a lot of custom. I have a javascript file enqueued which runs the class when the Add Image button is clicked. When I tested the button I receive the following error: “Uncaught ReferenceError: wp is […]

Debugging with functions.php

I’m trying to check the output of a variable in my functions.php file that runs after a new woocommerce order. The code will get the order time from a new order and store it in a variable for me to use elsewhere the code being: $meeting_time = wc_get_order_item_meta($order_id, ‘Time’); print_r($meeting_time); I’ve tried a few ways […]

File available but giving 404 in wordpress

Hey, im not sure why but php files other then wordpress either redirects to homepage or gives a 404. for example i have a timthumb.php in directory /js/ it was working fine and generating thumnails for me.. but it started to give 404 on even running the direct url. You can take a look here […]