I just installed the jetpack plugin on my localhost version of WordPress 4.2.2 however after activating it—when I click on ‘Connect to WordPress.com’, I get the following error:
Your website needs to be publicly accessible to use Jetpack: site_inaccessible Error Details: The Jetpack server was unable to communicate with your site
http://wordpress.local
[IXR -32300: transport error: http_request_failed Couldn’t resolve host ‘wordpress.local’]
Is there any way to work around this running on localhost?
1
Add this to your wp-config.php
:
const JETPACK_DEV_DEBUG = TRUE;
This makes it possible to use features on localhost that don’t require a connection to wordpress.com. See the announcement post on jetpack.me for the background.
For your own plugins, learn that lesson: Do not rely on working outgoing connections. Respect your users privacy, and explain in clear words why such a connection is necessary, what data will be sent, and how to work with the plugin when the connection fails. In other words: Don’t do it the Jetpack way.