Publish to Discourse and scheduling

So we have a problem when posts are created or published by other plugins, the value specified for ‘publish to discourse’ is always ignored.

Discussing the issue with one author of such a plugin the response was:

their plugin may be using filters that are not triggered upon an anonymous update

and

In some cases we aren’t able to accommodate for plugins that don’t trigger filters/actions in a global manner.

Is this a possibility? Raised this on github a while back with @benword and thought it was worth checking before I reopen the issue.

The plugin uses the transition_post_status filter so it should be fine. Maybe something in the publish_post_to_discourse function needs to be updated.

Could you provide us with which plugins aren’t working for you so that I can try to reproduce?

The big one at the moment is CoSchedule:

It’s tied to a subscription service, so if you can’t figure out what they’re doing from the code let me know, I might be able to give you access to a site where it’s implemented.

1 Like

Did you need anything from us to look at this one @benword?

1 Like

I’m able to use wp-discourse with the WordPress scheduled post functionality, so if a plugin is causing a conflict it would be helpful to reach out to that plugin author (especially since you’re paying for a subscription from them).

I’m having this same issue.
Posts that are scheduled (using native WordPress) don’t publish to Discourse automatically. I have to go back once they are published and hit the Update button in order to publish. Any ideas what I could try @benword?

3 Likes

In my development environment scheduled posts are published without any problem. Are there any plugins on your site that deal with scheduling posts?

Edit: I’ve tried this on a live site as well. It’s working, but I noticed a strange behaviour when the ‘Auto Publish’ setting is not enabled. For some reason when a scheduled post is saved the ‘Publish Post to Discourse’ meta-box value is not updated. This means that if a post is scheduled and then later updated, it will loose the ‘Publish post to Discourse’ value. I’ll sort this out right away.

1 Like

I’ve sorted out the problem I was finding. The Discourse meta-boxes weren’t being updated with their saved values for scheduled posts. I’ll update the plugin early tomorrow. Hopefully this will solve the problem you are having with scheduled posts.

Thanks for reporting that!

3 Likes

Thanks Simon, I appreciate the quick response!

Will this mean that I need to reinstall the plugin?
(Unfortunately I can’t do that as it overwrites vital functionality every time.)

Yes, you would need to update it to get these changes. If the problem you are having is the one I fixed, then you are probably seeing behaviour something like this:

  • create a post
  • select ‘Publish post to Discourse’
  • schedule the post
  • click ‘Publish’
  • the ‘Publish post to Discourse’ checkbox becomes unchecked
  • if you’ve set the publish category to one other than your default category, the category will revert to the default category

If, at this point, you don’t update the post again, it will be published to Discourse with the values that you initially set. If you do update the post before it’s scheduled to be published, you’ll need to recheck the ‘Publish post to Discourse’ checkbox and also make sure that the correct publish category is selected before you click ‘Update.’ Those values will again appear to revert to your default ones - the correct values are saved to the database, but they aren’t being used to populate the meta-boxes for scheduled posts, so they’re being overwritten when a scheduled post is updated.

Thanks for the clarification.

That isn’t quite the issue that I’m experiencing.

  • create post
  • select ‘Publish post to Discourse’ is already selected because it’s set to publish posts automatically
  • schedule the post
  • click ‘Publish’
  • the checkbox remains ticked but the post doesn’t publish
  • the behaviour around reverting to default does happen in the same way as yours does

Which plugins are you using?

Is this self-hosted or are you using a WordPress host? If so, which?

1 Like

As in, all the plugins? Or for this particular issue (in which case the answer is the official WP-Discourse plugin)?

Discourse is hosted by Discourse, WP is with WPEngine

Do you have WP Engine Alternate Cron enabled?

I suspect not, as I just found this [below] in the support docs and I’ve never requested it. Are you suggesting I do?

This is not enabled on your server by default, so you will have to request to have it enabled via Support.

No, I was just curious if anything is affecting how scheduled posts are published on you site.

A number of plugins alter aspects of automated publishing. The old Editorial plugin and Coschedule are good examples of this.

A list would be very helpful, yes.

You’ve prompted me to deactivate a few plugins that I don’t think we need – I was overdue for a clean up.

I’ll do that now and if nothing changes in terms of the scheduled post issue I’ll come back to you with a list.

I appreciate the help - thanks to you both.

Actually, while going through the above process I found both these, which may have an impact.

Thoughts on disabling these? I’m not sure that they’re necessary.

1 Like

Using those two plugins makes sense, but it’s also quite likely the cause of the problem. There’s a small change that can be made to the wp-discourse plugin that should make it compatible with the Missed Schedule plugin.

1 Like