WordPress / five-for-the-future

Plugins and themes for the Five for the Future subsite
https://wordpress.org/five-for-the-future/
54 stars 25 forks source link

Prevent impossible `hours_per_week` to avoid distorted stats #125

Closed iandunn closed 2 years ago

iandunn commented 4 years ago

There are some users who've entered obviously inaccurate hours_per_week values, like 72, 84, 96, 150, 300, etc

Devs with a sandbox can see examples with: SELECT * FROM bpmain_bp_xprofile_data where field_id = 29 and value > 40

Maybe some of them are including multiple people from their company? From looking at their profiles, it's also likely that they're counting the hours they work for their company, rather than hours they contributed to WP (see #83).

There's also some obviously fake ones like 2000, 100000, etc, and also some junk from spam bots like 555-555-0199@example.com and 200000000000000000000000000000

Most of them aren't associated with pledges, but they'll clutter the list in #69 with fake data, and will distort stats if/when we start tracking volunteered hours (see #124).

I think we should do these things:

What do y'all think?

coreymckrill commented 4 years ago

An alternative that wouldn't involve customizing the logic in BuddyPress XProfiles might be to just not include numbers on the 5ftf side if they are over the threshold (60 sounds good to me).

iandunn commented 4 years ago

🤔 I worry that there are multiple places that pull from that data, so each one would have to be updated, and the logic might not be DRY across them, and future ones might get missed.

I think the code to add the warning would be pretty simple, like [dotorg 15598].

hlashbrooke commented 4 years ago

For reference, Josepha lists her hours as 60 per week, and I think we can largely agree that no one would realistically contribute more time to the project than her. So I think 60 is a good cap to use.

iandunn commented 4 years ago

Doh, now I almost want to cap it at 40 to encourage healthy work/life balance 😆

Maybe I'll throw in a custom condition which does that only for @josephahaden. Only partially kidding 🐻

iandunn commented 4 years ago

This is mostly done in dotorg 15648 and b68664c, but I haven't emailed the affected users yet. There's some related discussion in #27 which might affect that.

coreymckrill commented 4 years ago

I should have explicitly stated earlier on this ticket that forcibly changing the values that people have entered into their profiles makes me really uncomfortable, and I'd like to avoid doing that again.