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

Develop [ebps-meetings] shortcode to replace the Events calendar upcoming meetings widget #1

Open
7 of 9 tasks
bobbingwide opened this issue Nov 23, 2021 · 3 comments
Assignees
Labels
enhancement New feature or request

Comments

@bobbingwide
Copy link
Owner

bobbingwide commented Nov 23, 2021

The purpose of this plugin is to improve the overall performance of the EBPS website.
One proposal is to deactivate the Events Calendar plugin on every page that doesn't really need it
and replace the Upcoming Events widget with equivalent code that's faster and uses fewer resources.

Requirements

Code to replace the widget that looks like this
image

Proposed solution

  • Implemented as a shortcode: [ebps-meetings]
  • Similar logic to the Events Calendar widget
  • But without the overhead of JavaScript
  • Use transients to cache the output of the middle section
  • Updates cached content each day
  • Styled the same as the Events Calendar widget
  • cache busting when events change

Nice to have

  • Implemented as a Widget
  • Implemented as a Gutenberg block
@bobbingwide
Copy link
Owner Author

Here's the output from 0.0.2
image

  • Upcoming Meetings SC is the header for the widget
  • Generated HTML mimics the Events calendar widget ; hardly any CSS styling required
  • Except for the View Calendar link, which is simpler

In normal content, since the Day, Month and Times are styled with white text this is invisible on a normal background.
Workaround. Embed in a group with a black background.

image

@bobbingwide bobbingwide changed the title Develop [ebps-meetings] shortcode to replace the Events calendar upcoming meetings widget Develop [ebps-meetings] shortcode to replace the Events calendar upcoming meetings widget Nov 24, 2021
@bobbingwide
Copy link
Owner Author

eBPS currently use an extension plugin to rename Events to Meetings.
The title attribute for the View Calendar link needs to be "View more meetings".

@bobbingwide
Copy link
Owner Author

Use transients to cache the output of the middle section
Updates cached content each day

The current caching logic caches the data for 86400 seconds ie 24 hrs = 1 day.
But this means that at midnight the current day's meeting will become yesterdays.
So, if there's an event that ends before the end of the day then the cache should be cleared earlier
Either at midnight or just after the end of the meeting.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant