We’re going to talk about installing and troubleshooting a popular WordPress plugin called Jetpack. I’ll apologize in advance that this article isn’t full of reasons why you should have a (great) website and a (great) internet marketing plan.
Anyone who has done any support, troubleshooting, or development, could tell you how, many many times, they’ve been rescued from impending doom by a blog article, or forum post, from God-knows-where and posted God-knows-when on the ‘net.
I’ve endured some aggravation and squandered time today to eventually solve this problem. I figured it was my duty (or maybe restitution for the other times that I didn’t pay it forward) to post this last link in the chain to help some poor SOB who will probably run across this. This is practical SEO in action: someone Googles the error code (long tail), this blog article shows up, they read it, they fix their problem, they pass it on, the world keeps turning – everybody wins.
Why Jetpack?
I’ve been interested in trying out Jetpack for a short time now so I thought I’d hook it up on a test site and give it a whirl. It seems like they’re constantly rolling out updates and new features. We do A LOT of WordPress work in Fort Lauderdale and elsewhere and some of what it promised seemed useful: traffic monitoring, security tools, site management (bulk plugin installs/updates/management), CDN image delivery, and so on.
We typically do self-hosted WordPress.org installs but one of our clients brought up WordPress.com, and the shares, subscriptions, traffic referral, and other things that come along with a fully-hosted managed platform like that.
Anyway, I wanted to try it out initially for a silly reason – a directory theme I was using recommended CSS changes be done via Jetpack and not through the child theme style.css
stylesheet.
I researched a little more and decided that now was as good of a time as any to make the account, install it, and see if it was worthwhile – and of course that’s where the fun started.
Installing Jetpack and its requirements
As far as the install of the Jetpack plugin itself there really isn’t much to it – it’s just as easy to download and install as your typical plugin. Here are the system/server requirements to run Jetpack:
- The latest version of WordPress. If you’re running version 2.7 or later, you should get a prompt in your WordPress Dashboard asking you to upgrade. Click the link and follow the prompts to update to the latest version. If you’re using an even older version, or would prefer to update manually, you can download the latest version of WordPress from the WordPress.org downloads page.
- A web host that uses PHP 5. Jetpack follows the WordPress host requirements.
- A WordPress.com account. Sign up for one here.
- A publicly accessible web site that does not require authentication.
- XML-RPC enabled and publicly accessible.
- Legacy WordPress.com/Automattic plugins should be disabled before installing Jetpack (ex. WordPress.com Stats, After the Deadline, Custom CSS).
The easiest way to install the plugin is the most routine and straightforward way to install most WordPress plugins – once logged in to the dashboard:
Click the Plugins
tab on the left admin sidebar and hit Add New
Search for ‘Jetpack‘ and you’ll get the result from Automattic with many million installs. Automattic is the same worldwide open source group who have developed the popular WordPress spam protection service Akismet, Gravatar, and contributed to WooCommerce (our favorite eCommerce platform.)
Mostly likely, if you installed WordPress on a hosting provider like HostGator or GoDaddy you used a deployment script like QuickInstall (or Softaculous or retired Fantastico.)
It’s installed.. now what?
Most likely you’ve run into a problem when you clicked Connect Jetpack There are quite a few possible errors you could encounter.
Please check the known conflict issues list, showing common plugins that will make the connection fail. Also check the error message explanation list if I missed it or you’re having another issue. Common conflicting plugins include iThemes Security, BulletProof Security, and W3 Total Cache.
Recommended next steps:
Here are the recommended troubleshooting steps to take, and if these don’t resolve the problem, and if you are using HostGator like I was, you’ll likely need to make an additional change:
- Check if the error you received is listed on this page. If it is, you can follow the instructions there to solve the issue.
- Disable all other plugins, then try connecting or using Jetpack. If Jetpack starts connecting or working properly, turn your plugins back on one-by-one until you start seeing the error again. Then note the plugin that caused this error and get in touch with us. Sometimes Jetpack and other plugins are incompatible; just let us know and we’ll see what we can do.
- If you are having a display issue, or the plugin step above doesn’t help, try activating Twenty Fifteen or Twenty Sixteen (one of the default WordPress themes) as your theme. Then try again. If your action starts working, something in your theme is likely broken and you should get in touch with your theme’s author. Be sure to let them know the troubleshooting steps that you have tried.
- Check your XMLRPC file. You can do this by going to your web site URL and adding “/xmlrpc.php” to the end (without the quotes). When it loads in your browser, you should see “XML-RPC server accepts POST requests only.” on a line by itself.
- If you see this message, but it is not on a line by itself, a theme or plugin is displaying extra characters when it shouldn’t. See points 2 and 3 above for debugging steps.
- If the XML-RPC appears correct it may be an issue with WordPress Address (URL) and/or Site Address (URL).
- If you get an 404 Error Not Found message, contact your web host. They may have security in place that is blocking XML-RPC.
- Check the Known Issues list and make sure you aren’t using a plugin or theme listed there.
- If you were using Development Mode, check your wp-config.php file and make sure that
define('JETPACK_DEV_DEBUG', true);
is no longer present. - ** If you are using CloudFlare or an SSL it may be worthwhile to check out the Jetpack help page on it or this thread.**
If you’ve made it this far everything you checked seemed to be OK: XML-RPC wasn’t blocked, .htaccess wasn’t blocking request (through a security plugin or otherwise), you disabled every plugin besides Jetpack, and activated Twenty Sixteen it’s probably time to get some debug output information.
Produce debug information to help with troubleshooting
There are a few places to get debug information to try to nail down the exact issue. It can help you troubleshoot it yourself and would also be needed for the Jetpack support team as well.
Error information is given when the Connect Jetpack fails:
“The Jetpack server was unable to communicate with your site”
The first error you may encounter is this: Error Details: The Jetpack server was unable to communicate with your site [HTTP 403]. Ask your web host if they allow connections from WordPress.com. If you need further assistance, contact Jetpack Support: http://jetpack.com/support/
If you’re getting the ‘403′ most likely it is a plugin conflict – see the list from the previous section.
The final one, the one that held me up, was this: cURL error 28: Operation timed out after 1000 milliseconds with 0 bytes received
One option is to visit https://jetpack.com/support/debug/ and input your website URL.
The other is to click ‘Debug
‘ in the footer of the main Jetpack page or visit http://yourdomain.com/wp-admin/admin.php?page=jetpack-debugger
Scroll through the debug information and look for where you see a BAD
response code and the associated error code with each.
For example I was able to determine a specific ‘400‘ error here:
... IDENTITY_CRISIS PASS SELF Array ( [headers] => Requests_Utility_CaseInsensitiveDictionary Object ( [data:protected] => Array ( [server] => nginx [date] => Thu, 03 Nov 2016 08:33:08 GMT [content-type] => text/plain;charset=utf-8 [expires] => Wed, 11 Jan 1984 05:00:00 GMT [cache-control] => no-cache, must-revalidate, max-age=60 [x-hacker] => Jetpack Test [x-ac] => 3.dfw _dfw [strict-transport-security] => max-age=15552000 ) ) [body] => {"error":"Could not validate security token","error_description":"We were unable to validate a security token for Jetpack communication. Please try disconnecting Jetpack from your WordPress.com account, and connecting it again."} [response] => Array ( [co`de] => 400 [message] => Bad Request ) [cookies] => Array ( ) [filename] => [http_response] => WP_HTTP_Requests_Response Object ( [response:protected] => Requests_Response Object ( [body] => {"error":"Could not validate security token","error_description":"We were unable to validate a security token for Jetpack communication. Please try disconnecting Jetpack from your WordPress.com account, and connecting it again."} [raw] => HTTP/1.1 400 Bad Request ...
The specific error information is helpful to continue your troubleshooting.
If you’re using a legacy version before April 10, 2014..
If your configuration prevented you from updating to a more recent version make sure to install the security update explained here.
output_buffering = 2048
You’ve probably already edited your php.ini
to increase your memory limits too, something like this:
memory_limit = 512M upload_max_filesize = 100M post_max_size = 512M max_execution_time = 300 max_input_time = 300
At this point I was stumped – but had a hunch that it was some other php.ini
configurations that needed changes. I Googled ‘jetpack php ini
‘ hoping my intuition was right. The 5th or 6th result was actually a UNIX shared hosting FAQ from networksolutions. The only config change listed there beyond the normal set listed above was output_bufferring=2048
which was set to OFF
in my default php.ini
.
There are multiple ways to edit the file but most likely you will be using a host with cPanel simliar to this guide.
Here is an outline of the steps:
Find ‘PHP Configuration
‘ under ‘Advanced
‘
Browse to /public_html/
and click ‘Edit custom php.ini‘
Make you changes in the text fields (for example output_buffering = 2048
and the others listed above like memory_limit = 512M
) and make sure to hit ‘Apply Changes‘ at the bottom of the page.
If none of the information above helped you’re best off contacting Jetpack support or posting on the plugin support forum.
I hope this was useful for someone out there.