Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OpenLab package should fetch items from external site RSS feed as scheduled task #347

Open
boonebgorges opened this issue Mar 31, 2021 · 8 comments
Assignees

Comments

@boonebgorges
Copy link
Member

See https://commonsinabox.org/groups/openlab-help-support/forum/topic/replacing-the-wordpress-cron#post-8858

@boonebgorges boonebgorges added this to the 1.3.0 milestone Mar 31, 2021
@boonebgorges boonebgorges self-assigned this Mar 31, 2021
@boonebgorges boonebgorges modified the milestones: 1.3.0, 1.3.1 Aug 3, 2021
@boonebgorges
Copy link
Member Author

I've done some testing on various configurations and I can't reproduce the reported issue. When I activate the external-group-blogs plugin, either manually or via the CBOX plugin installation process, the bp_groupblogs_cron event is properly scheduled.

@beckej13820
Copy link

Hi Boone,

Can I try to help you reproduce this issue? I see it on two OpenLab sites that I am involved with- oneonta.sunycreate.cloud and geneseo.sunycreate.cloud

Currently running CBOX Openlab 1.4.0

Ed

@boonebgorges
Copy link
Member Author

Perhaps you can provide more info about exactly how you activated external-group-blogs. Can you walk through the process? How was it installed into your environment - via Commons In A Box, or did you install it yourself somehow? How was it activated on the site in question?

@boonebgorges boonebgorges reopened this Feb 21, 2023
@beckej13820
Copy link

Hi Boone,

I don't see a plugin in CBOX Openlab called "external-group-blogs." Just with the default functionality of CBOX OpenLab, I was able to connect external sites, but there was never any cron job that pulled information from those external sites unless we went to a page.

Am I missing a plugin that I should install?

Does Commons in a Box OpenLab need a helper plugin to use the external blogs feature? Because even without the BuddyPress External Blogs plugin, when creating groups, the option for an external site is available.

Is this one of those cases where the plugin wasn't included in the CBOX OpenLab package, but for the full features to work another plugin needs to be installed?

@boonebgorges boonebgorges changed the title external-group-blogs cron job not created on activation OpenLab package should fetch items from external site RSS feed and insert into activity stream Feb 22, 2023
@boonebgorges boonebgorges modified the milestones: 1.3.1, Future Release Feb 22, 2023
@boonebgorges
Copy link
Member Author

Thanks for the details, Ed. Reading back through our exchange here and on the commonsinabox.org forum, I think I see a couple source of misunderstanding. You said:

CBOX is supposed to check the RSS feeds and send out emails on a cron job.

And then you went into some explorations about how WP's cron system works, which I followed up with. But this starting assumption is not, in fact, correct. If you are running the Classic version of CBOX, you have the option to install the external-group-blogs plugin, which does what you describe: uses a WP scheduled event to fetch RSS feeds, and then inserts items from those feeds into the activity feed of the corresponding RSS feed. But the OpenLab package does not do this. It doesn't fetch items on a scheduled task, and it doesn't create RSS-linked activity items, which is why no email notifications are triggered.

CBOX OpenLab does have some light feed-fetching, in the form of the 'Recent Posts' widget on a group page when that group is associated with an external blog. See https://github.com/cuny-academic-commons/openlab-theme/blob/524d3ce7b2ac96851c892a8fcbc7e678883b4d01/lib/group-funcs.php#L1832, https://github.com/cuny-academic-commons/cbox-openlab-core/blob/3c917d3e1d3b28d729e78b667068d9649f7fc18c/includes/group-sites.php#L1060, https://github.com/cuny-academic-commons/cbox-openlab-core/blob/3c917d3e1d3b28d729e78b667068d9649f7fc18c/includes/group-sites.php#L1116 But, again, this is just for display under Recent Posts - no activity items are created.

I've changed the title of this ticket to reflect this corrected understanding. What you are suggesting, I think, is that the OpenLab package should fetch RSS items and insert into the activity stream, thus triggering email notifications. This is a reasonable feature request. I've added @bree-z and @jennaspevack as watchers to this ticket so that they can weigh in with any thoughts they might have about it.

@beckej13820
Copy link

Very clarifying. Thank you Boone.

I like that external sites can be connected, and that the RSS feeds trigger emails. The only missing feature to me is to have that happen on a schedule. This is a good solution for me, who has some faculty creating their own standalone wordpress pages because they require advanced plugins that I don't want on my main site.

I'm not sure I really understand your last answer, because to my eyes, on a vanilla CBOX OpenLab running 1.4, OpenLab is already pulling recent posts, recent comments, sending emails, and displaying on the homepage. The only thing that it doesn't do is check those RSS feeds on a schedule.

ed-beck.com is an external blog from geneseo.sunycreate.cloud. When creating a portfolio, instead of creating a new OpenLab child site, I connected it to an existing site hosted elsewhere. Both recent commends and recent posts are being displayed on the group homepage. In addition, activity is appearing on the front-page as recent activity, and emails are being generated.
Screenshot 2023-02-22 at 11 28 29 AM
^Screenshot of group page on geneseo.sunycreate.cloud
Screenshot 2023-02-22 at 11 29 55 AM
^Screenshot of recent blog post showing up on frontpage activity feed
Screenshot 2023-02-22 at 11 30 50 AM
^Screenshot of email notification sent to group members.

So that's why I was a little confused, because out of the box (lol) OpenLab does 99% of what I wanted it to do anyway.

@boonebgorges boonebgorges changed the title OpenLab package should fetch items from external site RSS feed and insert into activity stream OpenLab package should fetch items from external site RSS feed as scheduled task Feb 22, 2023
@boonebgorges
Copy link
Member Author

Thanks for all this, Ed. You are right - CBOX OpenLab does do what you've described. After fetching from the remote RSS feed, it creates activity items, which is what triggers the email notifications. https://github.com/cuny-academic-commons/cbox-openlab-core/blob/3c917d3e1d3b28d729e78b667068d9649f7fc18c/includes/group-sites.php#L1142

The fetch only takes place in the following two circumstances:

  1. The Recent Posts section on the group home is loaded, and the transient is past its expiry date. (By default, these transients are good for 10 minutes.) https://github.com/cuny-academic-commons/cbox-openlab-core/blob/3c917d3e1d3b28d729e78b667068d9649f7fc18c/includes/group-sites.php#L1078
  2. You click the 'Refresh now' link that appears next to 'Recent Posts' if logged in as a group admin. See https://github.com/cuny-academic-commons/cbox-openlab-core/blob/3c917d3e1d3b28d729e78b667068d9649f7fc18c/includes/group-sites.php#L1329

So this is not precisely what you described in your original post - the case of a WP cron job not being run - but it has a similar cause: feeds belonging to a group will only be refreshed when the group is visited, which doesn't happen very often for many groups.

Unfortunately, it's not trivial to set up group-specific cron jobs. We could end up overloading the system with scheduled tasks on networks with many such sites. So we might need a central queue for checks.

@beckej13820
Copy link

Thanks for being patient through the multiple of layers of misunderstanding. The feature request now says what I wanted!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

4 participants