indieweb / wordpress-indieauth

IndieAuth for WordPress
https://wordpress.org/plugins/indieauth/
MIT License
31 stars 11 forks source link

Explore Storing Tokens as a Custom Post Type instead of User Meta #232

Open dshanske opened 2 years ago

dshanske commented 2 years ago

Prompted by @pfefferle, and something I'd considered in the past. The biggest issue is migration, but I'd deliberately built into the plugin a class the token storage classes are all inherited from. There are currently two...one that stores as a transient, the other as user meta. I would just have to improve that abstraction a bit.

The advantage of the current system is its simplicity, but things have gotten more complicated since I did it. So, proposal is as follows.

tw2113 commented 2 years ago

80-90% of the content feels like it'd end up being stored as meta, so my gut tells me just store it all as meta instead of most of it. It's most definitely possible to fetch all meta for a post in one go, and go from there. Realistically how often are these values going to be added to NEW posts as opposed to UPDATED posts? Assuming part of the mitigated problems are intended to be post/post meta bloat? Given that we're often working with personal sites, as opposed to to-be-grown community sites, probably NOT that many new posts.

dshanske commented 2 years ago

@tw2113 A token can be used for multiple posts. So, it would be a post to post relationship, but it is many posts to a single token.