Tweets and email notifications are not being generated from posts on OpenAtCUNY site
Madeline Cohen reports that since mid June, no tweets or email notifications on her site. She is using JetPack. I became an admin and set up Jetpack and successfully connected to Twitter via Publicize.
I copied her last post to see if it was working now and received this: "Post published, sending emails to subscribers and sharing post on Twitter (@OPENatCUNY)."
But nothing was generated.
#1 Updated by Boone Gorges 7 months ago
- Assignee set to Raymond Hoh
Ray, could you have a look? I have a feeling that there may be a connection between this problem at wp-content/mu-plugins/assets/jetpack.php, where I've blocked Jetpack's sync-via-cron tool. In theory, the sync should be happening anyway via one of the post-publish hooks, but it could be that this is getting blocked for some reason or other. Another possibility is that there's an xml-rpc issue.
#2 Updated by Raymond Hoh 7 months ago
I checked the Jetpack Publicize settings for OPENatCUNY and it doesn't seem like they have set up Jetpack with a WordPress.com account, which is required for the Publicize feature to work correctly.
See attached screenshot:
Has Madeline ever set up a WordPress.com account and configured Jetpack for this feature to work before? If she did, this could be another case of #9974.
#3 Updated by scott voth 7 months ago
Interesting. Madeline said she set up the connection and when I looked at it, it was not connected. So I connected it and set up the sharing to her Twitter account. But now when you look at it is disconnected again. I just signed on and I see this:
#4 Updated by scott voth 7 months ago
Any update on this? Should we install a plugin like WP to Twitter (https://wordpress.org/plugins/wp-to-twitter/) if JetPack Publicize is not working?
For the second issue - I'm not actually sure what controls email notifications to members of a site. Is that part of WordPress core? Or Jetpack? Just wondering if the two issues are related.
#5 Updated by Raymond Hoh 7 months ago
About the screenshots, apologizes as it appears to be a Jetpack UX / UI problem here:
The site looks to be configured correctly, but the UX messaging is confusing.
Anyway, I took a look at Jetpack's debug screen at:
And this info stuck out to me:
Sync Queue size: 1142 Sync Queue lag: 5 weeks, 6 days, 21 hours, 14 minutes, 25 seconds
This is roughly the same timespan that OPENatCUNY has experienced this problem.
Email notifications might be tied to Jetpack, but I'm not sure at the moment. If OPENatCUNY needs WP posts to sync to Twitter, then try the WP To Twitter plugin until we can sort this out.
Boone, I looked through the Jetpack codebase and it's a labyrinth of code. The Publicize feature is tied to Jetpack's Sync module, which relies on wp-cron:
After manually running Jetpack's incremental sync with
Jetpack_Sync_Actions::do_cron_sync() several times in wp-cli, the queue cleared itself, however I do not see the posts on OPENatCUNY's Twitter account...
How do you feel about removing the sync-on-cron code snippet in
/wp-content/mu-plugins/assets/jetpack.php, but limiting the schedules to every half hour or hour instead of the default of Jetpack's five minutes in
#7 Updated by Raymond Hoh 7 months ago
- Target version set to 1.13.7
Boone, I've added a commit based on what I mentioned above here - https://github.com/cuny-academic-commons/cac/commit/5553257e481153d066dfd9684e5515c57d6da06e. I've re-enabled the sync-on-cron, but limited the interval to every 30 minutes instead of every 5 minutes.
Let me know if we should deploy this as a hotfix so we can test.
#8 Updated by Boone Gorges 7 months ago
Yup, this looks fine, Ray - I'd say go ahead with it. You may have to manually schedule the sync cron jobs, I can't recall.
The previous problem with Jetpack sync was that the routines ran frequent as well as long. Your commit takes care of the frequency bit, and the fact that Cavalcade handles the sync in a separate process should mitigate the long-running bit. So let's give it a try as a hotfix.
#9 Updated by Raymond Hoh 6 months ago
I've been monitoring the Jetpack's Debugger results page located at
openatcuny.commons.gc.cuny.edu/wp-admin/admin.php?page=jetpack-debugger over the past two weeks and the "Sync Queue lag" is under 30 minutes, which matches the custom interval we set for sync-on-cron. So the frequency bit appears to be fixed.
However, OPENatCUNY hasn't made a post recently, so we can't tell if the Twitter Publicize feature is working yet. Let's leave this one open for now until a post is made on OPENatCUNY.