Tuesday, 29 March 2016

Wordpress All Import (WP All Import) WooCommerce - 403 Forbidden when importing

Continuing my Wordpress work, I needed to import a large amount of data into a Woo Commerce based store so decided to use WP All Import with the Woo Commerce add on to do this.

However, when I tried to import from my first CSV I kept getting a 403 Forbidden error. Naturally, I assumed that i'd done something wrong with the .htaccess access file but all seemed OK.

I decided to check the settings, and made a minor change of no consequence but when I tried to save it I again received the 403 Forbidden error.

Now realizing that it wasn't something to do with the import itself, but rather the plugin I turned to the support forums and setup guides for help - but nothing seemed to mention this.

Looking around the settings page, I this time noticed a box  called "Add port to URL" which allows you to change port that your webserver uses. I do all of my development work on a server running Apache on port 8080 and suddenly my problem was clear - the plugin wasn't capable of changing ports, it had to be informed of the port the web-server was using.

After enter 8080 in the box and saving the settings (which actually saved this time!) everything started to work as expected.

Wednesday, 23 March 2016

WordPress, Contact Form 7 and recpatcha causing "failed to send your message" when submitting forms

I've recently started using the recaptcha plugin for contact form 7 in my WordPress sites. When I made a recent site live, none of the forms were sending.

Upon investigation, the issue was related to having the recaptcha present on the form as if I removed it they would send straight away.

When I originally added it I remember setting up the API key and yet it still wasn't working. On closer examination, the secret key was wrong and resetting the API keys solved the issue.

The reason the key was wrong is because when you highlight the secret key on Googles API page and copy and paste it, it doesn't just select the key - it takes the text description of it too! So you end up pasting the key with extra text at the end which I never noticed when originally adding it.

Bottom line - if the form won't submit and you've got recaptcha running I would double check your API keys as you may have made the same mistake as me :)

One more thing to remember (although not directly related to the above) is that the codes for the contact form objects, such as  [your-name] are case sensitive! So [your-name] is not the same as [Your-Name]