Category Archives: Wordpress

An Unexpected HTTP Error occurred during the API request.

I recently configured a VPS with WHM and Cpanel installed. I created an account and installed wordpress on that account. However, when I tried to install new themes or plugins I ran into the following error message:

“An Unexpected HTTP Error occurred during the API request.”

I googled and searched and found lots of useless advice such as changing timeout limit in wordpress configuration or playing around with different transport modes in core files. Turns out the problem was all me and how I had configured the resolvers in WHM. I had cleared out the default ip addresses and entered my host’s internal nameservers. After changing resolvers to Google’s public DNS IP addresses in the whm backend it all started working properly.

Google’s Public DNS ip addresses:

Others ip addresses that can be used are the Open DNS ones:

The best thing would probably have been to leave the default values as they were (presumably provided by the IPS of my host). Lesson learned.

Installing and configuring WordPress

Seeing as I live and breathe wordpress sites I thought to make a little list of how I go about installing and configuring them.

1. Upload wordpress zip file to server and extract to appropriate folder, typically public_html.
2. Update wp-config.php with correct database info and desired table prefix.
3. Go to url of my website and enter requested installation information.
4. Login to wordpress admin panel, go to Settings->General and add tagline and www in front of domain name in wordpress url and site url fields.
5. Go to Settings->Discussion and disable comments as well as ping notifications to other blogs.
6. Go to Settings->Permalinks and mark custom structure radio button and fill out field with value /%category%/%postname%/
7. Install plugin CBNet Ping Optimizer and disable pinging and set to max once in 15 minutes.
8. Install additional plugins, add all pages to site (set edit mode to html and enable custom fields) and finalize layout/ design.
9. Enable pinging again and finish by writing my first newspost.

Displaying WordPress shortcode in widget

The other day I struggled getting a WordPress plugin “WP Customer Reviews” to display properly in a sidebar widget. You are supposed to enter a shortcode where you want the reviews displayed. Unfortunately wordpress and most of the themes that come with it do not natively support shortcode in widgets. To get this functionality you must add the following code in the theme file functions.php:

add_filter('widget_text', 'do_shortcode');

You must also make sure you enter the shortcode in the plain text / html widget. I tried it in a widget with php parsing capability and that did not work at all (for obvious reasons in hindsight).