-
Notifications
You must be signed in to change notification settings - Fork 23
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
Rethink the data model #318
Comments
This is great. The crux of the current data model's challenge is the ordering mechanism for productions and events. Both entities utilize the
This meta-field's purpose is two-fold:
The production value is recalibrated hourly via WP-Cron, given that the nearest event may change as time progresses. Additionally, any save operation on an event or production triggers this recalibration. Such frequent recalibrations are computationally intensive and are complicated by the opaque nature of background processing. In search of performance improvements, I considered the |
I like the concept of the shadow taxonomy. |
Let's see if I understand correctly. Developers can optionally specify existing post types using filters, in which case we do not register our own post type. We use the existing post types instead. Do we still provide basic functionality to add information about venues, prices, ticket status? Maybe make it possible to deactivate this using filters as well? And how this this work with the HTML output or with the Gutenberg blocks? |
Cool you like the idea. Thank you.
This sounds indeed like one of the most important and tricky aspects to refactor.
Let‘s see how much of these jobs are still needed after we refactored the event data.
Unsure what to do about this. |
The only gain from using the existing |
Me too. As I came across this kind of implementation the first time, it really hitted me hard as it is so nice, simple and super-close to core.
Having an additional taxonomy for some of the existing post_meta data makes sense (to me) when you are able to group some posts by this exact same post_meta data. |
Yes, we register two post_types: production & event
I’m unsure about this because it seems to be the more difficult aspect, which we will have to discuss and decide, on how to handle the event-data at all.
Yes. 100%
This paragraph could be several new issues also, but for now I would say, that all of what you mentioned should be part of separate extensions. I can imagine different scenarios where the one or the other might be needed or even not. |
We need some UI in the admin to let the user see all events that are tied to a production. Also, there needs to be a way to create a new event for a production. I don't think we should let the user mess around with the default taxonomy meta box. |
We will have the default sorting & filtering within the
Yes, you are right. I can think of an extra Button, a Command Palette command or an enhanced default taxonomy meta box.
Let it be a good starting point, ok? |
To better understand the necessary steps to go, I wrote down this first draft of a migration-roadmap for the production-event-relations. Maybe we can create some more helpful tracking issue out of it. Current data modell (version 0.18.3)
Proposed NEW data modell (maybe version 1.0.0)
1. New dependencies & needed preparation ❗
2. Changes to the existing codebase
3. Upgrade routines neededIs there any version-checking-upgrade-or-migrate-data function in place, I haven't found? Otherwise we'd need something like this to have our migration run only once per site. 3.1. for existing Productions
3.2. for existing Events
All this could also be done for Seasons, but I suggest separating all seasons-related code into an extension. |
We are mainly interested in the concept of shadow taxonomies. Not necessarily the code, which is not that complex. |
I did some more tests and I think the shadow taxonomy plugin fails if two events have the exact same name. This is because the current code bases the title of the shadow term on the title of the parent post: https://github.com/mrbobbybryant/shadow-taxonomy/blob/master/includes/shadow-taxonomy.php#L96 |
I‘m sorry for being late …. But how should it be possible within WordPress, that two posts of the same |
As far as I understand the code, it provides the post_title AND the slug, where the latter is covered by the mentioned I unfortunately don’t see the problem, yet. |
Nevertheless, we don’t have to rely on mrbobbybriants implementation. In the last couple of weeks I saw two nice implementations of shadow-taxonomies in the wild. Both were covering the relation between a venue-post_type and a venue-shadow-taxonomy. Both are worth reading the code.
|
I haven't finished my research (#317) on the current implementation yet, but would like to start the discussion on this anyway.
I think we should prepare a data model that follows known best-practices and is close to core, which means in the big picture we use post_types for singular data and taxonomies to group these data. By doing so we can make use of the endless built-in features like performant queries, caching, contextual pagination, backend UI, blocks, etc., that WordPress already provides. So when we follow for example ...
1. we should register two new taxonomies.
2. register production & event post_type only if needed
All this should be kept most generic, portable and site-agnostic as it could. By that I mean, we should register the necessary post_types only if there aren't already post_types in place that could or should be used instead. When we only provide the meaningful, semantic connection between those post_types without having to worry about every aspect of e.g. a good venue and event management tool, we can focus on the code with real theatre context.
Introducing filterable post_type slugs for productions and events would be the way to go, I think. So people can use, from the numerous plugins available, whatever they want to manage their events or productions. We only register the bare-bone post_types with some minimal additions, if no other plugins are running and providing what is needed.
The text was updated successfully, but these errors were encountered: