vivelohoy / vivelohoy-3.0

The next generation site for Hoy Chicago.
http://www.vivelohoy.com/
5 stars 4 forks source link

Fix JetPack Publicize integration #187

Open nrrb opened 9 years ago

nrrb commented 9 years ago

The JetPack meta-plugin pack is installed mainly for the use of the Publicize plugin, but it is not working. Using the JetPack Debugger module, we get this diagnostic information:

Testing your site's compatibility with Jetpack...

There seems to be a problem with your site’s ability to communicate with Jetpack!

It looks like your site can not communicate properly with Jetpack.

SELF:
    Array
(
    [headers] => Array
        (
            [server] => nginx
            [date] => Tue, 11 Nov 2014 20:44:19 GMT
            [content-type] => text/plain;charset=utf-8
            [connection] => close
            [x-pingback] => https://jetpack.wordpress.com/xmlrpc.php
            [expires] => Wed, 11 Jan 1984 05:00:00 GMT
            [cache-control] => no-cache, must-revalidate, max-age=60
            [pragma] => no-cache
            [x-hacker] => Jetpack Test
        )

    [body] => {"error":"Could not fetch your site data","error_description":"We were unable to fetch the data from your Jetpack-powered site, the communication channel seems to be broken."}
    [response] => Array
        (
            [code] => 400
            [message] => Bad Request
        )

    [cookies] => Array
        (
        )

    [filename] => 
)

JetPack is connected through the admin account to the wordpress.com account holavivelohoy and we are able to connect Twitter and Facebook accounts from there (although we don't leave it because we're just using it for individual users at the moment).

Octavio and Leticia are both able to connect JetPack to their wordpress.com accounts and apparently connect to their respective Facebook and Twitter accounts, but after publishing a new article they find that nothing gets published to their Facebook or Twitter feeds.

Using the public Debug Tool on vivelohoy.com says:

Could not fetch your site data

We were unable to fetch the data from your Jetpack-powered site, the communication channel seems to be broken.

I'm leery of testing on our production site, so I'm testing against vivelohoy3.staging.wpengine.com too; with staging we get the same message.

nrrb commented 9 years ago

I'm following the debugging recommendations in the Official JetPack Support Resources stickied thread on the JetPack support forums.

In particular, the Troubleshooting Tips page suggests the following:

  1. Check if the error you received is listed on this page. If it is, you can follow the instructions there to solve the issue.
  2. 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.
  3. If you are having a display issue, or the plugin step above doesn’t help, try activating Twenty Eleven or Twenty Twelve (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.
  4. 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 you get an 404 Error Not Found message, contact your web host. They may have security in place that is blocking XML-RPC.
  5. If you’ve installed an SSL certificate on your domain and if WordPress.com can’t access your site via HTTPS, start by checking the status of your domain’s SSL certificate. If you can’t fix the SSL issues on your site, try adding the following to your site’s wp-config.php file to bypass the HTTPS check during the connection:

    define( 'JETPACK_CLIENT__HTTPS', 'NEVER' );
  6. Check the Known Issues list and make sure you aren’t using a plugin or theme listed there.
  7. 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.

nrrb commented 9 years ago

In response to the troubleshooting steps above:

  1. Error Message We don't get an explicit error message, it just doesn't work. We do get the message Could not fetch your site data but that doesn't appear specifically on the error message list.
  2. Conflict with other plugin? By eliminating the other possibilities, this is the most likely culprit.
  3. Display Issue? Not a display issue.
  4. Check your XMLRPC file Checking http://vivelohoy.com/xmlrpc.php I do get the expected one line response of XML-RPC server accepts POST requests only.
  5. SSL certificate installed? Not applicable, we don't have an SSL certificate installed.
  6. Known Issues We have none of the incompatible plugins or settings listed.
  7. Development Mode? Not applicable, we've never had this enabled.
nrrb commented 9 years ago

I tried disabling all other plugins except JetPack on the staging server, and still the error persists. I also tried pushing a commit to remove support for Publicize from the Enfoque and Patrocinado custom post types and no dice there either.

There's an issue in the JetPack repository on github that suggests that the error Could not fetch your site data is fallacious and always occurs if the Wordpress.com Stats module is not enabled. When I enable the Stats module, I get this message on the debugger (Your Jetpack setup looks a-okay!):

image

I get the same success message when I enable the Stats module in JetPack on production. Testing against the public Debug Tool I get another success message for production:

image

nrrb commented 9 years ago

Sadly, enabling the Stats module doesn't actually fix our issue. While Publicize options do appear when I'm adding a post, and the account I linked does show up, when I Publish I don't actually get a corresponding tweet on the linked Twitter account:

image

The latest tweet in the linked account remains one from 4 hours ago that was made manually:

image

nrrb commented 9 years ago

Publicize does work when I link the @vivelohoydev Twitter account while logged in to staging as admin:

image

image

I thought this might trick Publicize into working if I were then to log in to the Nick Bennett account on staging while leaving @vivelohoydev connected under admin, but it still doesn't work there.

nrrb commented 9 years ago

Now I'm trying to isolate when this works and doesn't work.

Site: gabo.wpengine.com Theme: twentythirteen Plugins: JetPack with only Publicize activated User account: gabo (main admin) Linked Twitter account: @vivelohoydev Result: publishing works

Site: gabo.wpengine.com Theme: twentythirteen Plugins: JetPack with only Publicize activated User account: nick (admin created by gabo) Linked Twitter account: @vivelohoydev Result: publishing does NOT work

Site: gabo.wpengine.com Theme: twentythirteen Plugins: JetPack with only Publicize activated User account: nick (Editor created by gabo) Linked Twitter account: @vivelohoydev Result: publishing does NOT work

Site: pods.goggl.es Theme: twentythirteen Plugins: JetPack with only Publicize activated User account: admin (default admin) Linked Twitter account: @vivelohoydev Result: publishing works

Site: pods.goggl.es Theme: twentythirteen Plugins: JetPack with only Publicize activated User account: nick (Editor created by admin) Linked Twitter account: @vivelohoydev Result: publishing works

nrrb commented 9 years ago

Output from the JetPack Compatibility Test:

Site info

SITE_URL: http://gabo.wpengine.com
HOME_URL: http://gabo.wpengine.com

TEST: HTTP Connection
Array
(
    [headers] => Array
        (
            [server] => nginx
            [date] => Tue, 18 Nov 2014 17:10:33 GMT
            [content-type] => text/plain;charset=utf-8
            [connection] => close
            [vary] => Cookie
            [x-pingback] => http://jetpack.wordpress.com/xmlrpc.php
            [expires] => Wed, 11 Jan 1984 05:00:00 GMT
            [cache-control] => no-cache, must-revalidate, max-age=60
            [pragma] => no-cache
            [x-hacker] => Jetpack Test
        )

    [body] => OK
    [response] => Array
        (
            [code] => 200
            [message] => OK
        )

    [cookies] => Array
        (
        )

    [filename] => 
)

TEST: HTTPS Connection
Array
(
    [headers] => Array
        (
            [server] => nginx
            [date] => Tue, 18 Nov 2014 17:10:33 GMT
            [content-type] => text/plain;charset=utf-8
            [connection] => close
            [vary] => Cookie
            [x-pingback] => https://jetpack.wordpress.com/xmlrpc.php
            [expires] => Wed, 11 Jan 1984 05:00:00 GMT
            [cache-control] => no-cache, must-revalidate, max-age=60
            [pragma] => no-cache
            [x-hacker] => Jetpack Test
        )

    [body] => OK
    [response] => Array
        (
            [code] => 200
            [message] => OK
        )

    [cookies] => Array
        (
        )

    [filename] => 
)

TEST: Self Connection
Array
(
    [headers] => Array
        (
            [server] => nginx
            [vary] => Accept-Encoding,Cookie
            [x-cacheable] => SHORT
            [cache-control] => max-age=600, must-revalidate
            [x-cache] => MISS
            [content-type] => text/plain
            [x-cache-group] => normal
            [date] => Tue, 18 Nov 2014 17:10:33 GMT
            [x-type] => default
            [connection] => close
            [x-pass-why] => 
            [set-cookie] => X-Mapping-fjhppofk=F7DA487139A6E42ACFBFAF9E8807471F; path=/
        )

    [body] => XML-RPC server accepts POST requests only.
    [response] => Array
        (
            [code] => 200
            [message] => OK
        )

    [cookies] => Array
        (
            [0] => WP_Http_Cookie Object
                (
                    [name] => X-Mapping-fjhppofk
                    [value] => F7DA487139A6E42ACFBFAF9E8807471F
                    [expires] => 
                    [path] => /
                    [domain] => gabo.wpengine.com
                )

        )

    [filename] => 
)
nrrb commented 9 years ago

This closed issue on the Jetpack repo seems to be related, we should try to replicate what they report.

nrrb commented 9 years ago

Here are some more screenshots documenting the setup.

Here's the list of users on gabo.wpengine.com, limited to an Admin user named gabo, an Editor user named nick, and the administrative account wpengine added by WP Engine:

user list on gabo wpengine com

gabo (Admin) on gabo.wpengine.com

Linked Twitter account: @vivelohoydev Linked Wordpress.com account: wordpress-dev@hoylabs.com (vivelohoydev)

Here's the output of the JetPack Debugging Center showing the linking to the wordpress.com account wordpress-dev@hoylabs.com:

jetpack debugging center - linked to wordpress-dev hoylabs com wordpress account

To this account I've successfully connected the @vivelohoydev Twitter account:

gabo admin on gabo wpengine com - jetpack publicize sharing settings - vivelohoydev linked

I created a test post with the title "gabo as admin on gabo.wpengine.com to @vivelohoydev" with Publicize set to publish to the Twitter account @vivelohoydev:

gabo admin on gabo wpengine com - published test post that publicized to vivelohoydev twitter account

The corresponding tweet on the @vivelohoydev Twitter account:

gabo admin on gabo wpengine com - corresponding tweet on vivelohoydev

nick (Editor) on gabo.wpengine.com

Linked Twitter account: @yoyoohrho Linked Wordpress.com account: nick@goggl.es

I don't have a screen to confirm that the Wordpress.com account nick@goggl.es is linked under my account as I don't have access to the JetPack Debugging Center as an Editor.

To this account I've linked the Twitter account @yoyoohrho:

nick editor on gabo wpengine com - jetpack publicize sharing settings - yoyoohrho linked

I created a test post with the title "nick as Editor on gabo.wpengine.com @yoyoohrho" with Publicize set to publish to the Twitter account @yoyoohrho:

nick editor on gabo wpengine com - published test post set to publicize failed to yoyoohrho twitter account

You can see in my latest posts on Twitter that I haven't published anything since November 12:

nick editor - latest twitter posts on yoyoohrho