I am using a great WordPress plugin, WP Spell Check, that takes care of spell checking of the content on my website: pages, posts, title, custom fields etc. The plugin comes in two versions, Free and Pro. I stumbled upon a small hiccup when trying to activate a Pro licence that I purchased for WP Spell Check installation on my website.
The activation process sounded easy:
- Purchase a licence that suits you (it’s a yearly subscription with auto-renew)
- Download the Pro version of the plugin and install/activate it on your website
- Login to your Profile on the WP Spell Check website
- Enter the domain name of your website against the generated API key
- Copy/paste the API key into the plugin’s settings page in the WordPress administration section of your website
For me, the process was breaking at step 5. The API key check kept bouncing back as invalid.
After looking into the code of the plugin and checking out the debug output I quickly found out that the details my website was sending for a check (my website’s URL and API key) were in fact getting rejected. Below is the POST that was sent to WP Spell Check website:
[body] => Array
[auth_key] => <my-api-key>
[current_site] => <my-domain.com>/wp
[timeout] => 5
[redirection] => 5
[httpversion] => 1.0
[blocking] => 1
[headers] => Array
[cookies] => Array()
The interesting part id the “/wp” bit at the end of the “
current_site" array element. And this is where it had struck me – my website uses a custom directory structure where I separate the WordPress core like from content (themes, plugins, uploads) so the structure is similar to:
In the Profile section of WP Spell Check website I entered “<my-domain.com>” and totally forgot about the “
/wp” at the end. Once I updated the setting to “<my-domain.com>/wp” the validation of the API key was successful.