opencredit / badgeos

BadgeOS is a plugin to WordPress that allows you to easily create badges and set up the steps and achievements users take to earn them. Badges are Mozilla OBI compatible and sharable via Credly.
http://www.badgeos.org
GNU Affero General Public License v3.0
92 stars 64 forks source link

Log entries, caching and bloat #90

Closed rastarr closed 11 years ago

rastarr commented 11 years ago

This probably links to #38 and I posted to http://wordpress.org/support/topic/log-entries-and-caching?replies=1 also

On a low volume (as far as BadgeOS goes) site, I still have 164 pages of log entries so I can only imagine what a busy site would have.

I just discovered that because these log entries are registered as a valid custom post type that they also get cached by caching plugin like my WPSuperCache so it's been caching thousands of extra and unneeded pages in the system. That's kinda bad for performance and unnecessary resources in many ways.

Can log entries please be changed to plain text in one file? What's the impact, if any, on deleting all log entries? Do log entries help keep track on awards in any way?

brichards commented 11 years ago

Hey Martin, we saw your forum post this morning and discussed it in a meeting this afternoon. We're currently weighing the options on how to best handle the BadgeOS Log going forward, as well as optimizing the parts of BadgeOS that are dependent upon it.

For the moment we're calling on log entries to determine a user's time of last activity with any given achievement, and we know of at least one add-on that someone has written that leverages it for building a fairly complex leaderboard. Outside of these two knowns, the log is almost entirely for referential purposes.

We're currently working with a much larger site (one that has over 600,000 entries) and will be using that as our basis for improving the logging process in BadgeOS. Look for some performance updates coming in BadgeOS 1.2 and 1.3.

rastarr commented 11 years ago

Thanks for the update and thoughts on this, Brian. I guess having log entries registered as CPTs can affect other systems and I understand you guys need to think of the bigger picture besides small sites such as mine too. Great that its in the think tank and look forward to seeing what comes of it all. For the moment, I've excluded /logs/ from the cache build so all is cool on that front. And great BOS has such an interested community of users as well

brichards commented 11 years ago

In 1.2.0 we are eliminating dependence on log entry for tracking user activity. This means that log entries can be deleted at will.

We've also introduced a new filter hook named "badgeos_post_log_entry" and we attach the creation of a log post to that hook. Running remove_filter( 'badgeos_post_log_entry', 'badgeos_log_entry', 10, 2 ); inside a function hooked to init will disable the creation of lost posts entirely.

Note that we're still assessing the relevance of BadgeOS log entries — as well as some cool external things we can do with the logging process — and will be making additional changes to the logging behavior in 1.3.0.

lkraav commented 9 months ago

Heya @brichards @tw2113 I've reached out in e-mail wrt how BadgeOS 1.4 log system ended up back then. Hoping y'all could shed some light on a few dark corners we're facing trying to migrate a site off this plugin :pray: