Commit graph

142 commits

Author SHA1 Message Date
Scott Reilly 15a05df622
XProfile: Add aliases for Performance team badge classes since the slugs aren't directly based on the name.
Some checks failed
Build files and push to `build` branch. / build (push) Has been cancelled
CI / PHP CodeSniffer (push) Has been cancelled
CI / PHP Unit Tests (7.4) (push) Has been cancelled
Props @dhrumilkumbhani
Fixes #336
2025-02-03 13:12:48 -07:00
Kelly Dwan b22bde9415
New blocks: Add blocks for the pledge contributors & pledge teams lists 2024-08-28 19:46:41 -04:00
Kelly Dwan bb25e0c78b
Tools: Add formatting command, run to fix minor phpcs issues 2024-08-27 13:43:27 -04:00
Paul Kevan aecac300ce
Update reports.php (#272)
Make use of new usermeta `last_activity_tracker` to more accurately see when a user had an interaction.

This should allow more accurate reporting, since last login can sometime be very old.
2024-08-08 16:37:53 +01:00
Paul Kevan 73455fe3c8
Update reports.php (#268)
- enqueue css on new report
- protect against PHP warnings
2024-07-05 10:29:21 +01:00
Paul Kevan b584bf354e
Add contributors report, and allow data to be downloaded. (#267)
* Add contributors report, and allow data to be downloaded.
2024-07-03 14:03:23 +01:00
Paul Kevan c880f28a63
Update contributor.php (#266)
* Update contributor.php

Store wporg user id as post meta to enable easier reporting for contributors.
2024-07-03 10:58:19 +01:00
Paul Kevan 6b57bb1e7e
Switch pledge URL (#256)
Change for more usable field
2024-05-30 14:39:33 +01:00
Paul Kevan c244c7e596
Update reports.php (#255)
Bump limit as it's too low.
2024-05-23 15:23:52 +01:00
Paul Kevan 1cabbc9729
Add company reports functionality (#252)
* Reorder includes to be alphabetic
* Add reports and styling
2024-05-23 10:32:10 +01:00
Paul Kevan c04421f980
Fix pledge activation URL (#245)
* Fix pledge activation URL

The post id being sent by email contained the pledge ID instead of the ID for form page, this fixes that are restores the ability to confirm email address.

* Fix unrelated PHPCS
2024-02-05 13:57:51 +00:00
Ian Dunn ed490dfc26 Apply coding standards 2023-11-06 10:13:10 -08:00
Ian Dunn b86470575f Contributors: Add CSV report of inactive contributors 2023-11-06 10:13:10 -08:00
Ian Dunn 2880d80e12
Contributors: Don't send inactivity emails to banned users.
Fixes #221
2023-02-28 16:36:49 -08:00
Ian Dunn 0e88966246
Add code coverage report 2022-09-13 11:53:26 -07:00
Ian Dunn 0964167f12 Apply coding standards 2022-08-29 16:21:06 -07:00
Ian Dunn 32b738d95f Contributors: Add user data for users that don't have expected meta.
Some users don't have any of the expected meta fields. The previous commit caused them to be skipped, resulting in distorted stats.
2022-08-29 16:21:06 -07:00
Ian Dunn 5f1d091185 Stats: Add stats for the % of contributors that are active. 2022-08-29 16:21:06 -07:00
Ian Dunn c9783a17f5 Contributors: Move user_registered check to pruning function.
That allows `add_user_data_to_xprofile()` to be reused in other contexts.

`user_login` was removed from the `SELECT` because it wasn't being used.
2022-08-29 16:21:06 -07:00
Ian Dunn 9c0d1371f3 Contributors: Apply ?? before array cast, to avoid PHP notice.
See 8c28881
2022-08-29 16:21:06 -07:00
Ian Dunn cd36902bb5 Contributors: Standardize on team_names field for consistency. 2022-08-29 16:21:06 -07:00
Ian Dunn ccad917c00 Contributors: Modularize activity detection for reuse. 2022-08-29 16:21:06 -07:00
Dion Hulse 44e9daccd9
Harden endpoint against junk inputs.
This avoids a PHP Notice when the `pledge_id` is invalid, or not a valid pledge.
2022-08-25 17:59:36 +10:00
Ian Dunn 574ab7fd4e
Pledges: Email companies every 6 months to update pledges.
Fixes #211
2022-08-16 14:25:44 -07:00
Ian Dunn 8c28881812
Contributors: Apply ?? before array cast, to avoid PHP notice.
Previously the `$user->team_names` would be cast to an array before the null coalescing operator executed. If the `team_names` field wasn't set in the database, PHP would throw an error before trying to apply the null coalescing operator.
2022-08-15 10:54:11 -07:00
Ian Dunn 993bd53765
Email: Check first name exists before using.
The previous check worked when the field existed as an empty string, but threw a notice when it didn't exist.
2022-08-10 11:41:14 -07:00
Ian Dunn 4dc03ada83 Email: Set From header to bounce@ to reduce confusion
Sometimes we do want folks to reply to messages, and the `donotreply` address contradicts that. `bounce@` has a similar meaning, but is less known. `bounce@` has the advantage of matching the `Return-Path`, which may reduce the chance of a message being flagged as spam for forging the `From` header.

See https://github.com/WordPress/five-for-the-future/pull/206#discussion_r938418815
2022-08-10 10:25:29 -07:00
Ian Dunn a8ce296de5 Add cron job to send emails to inactive contributors. 2022-08-10 10:25:29 -07:00
Ian Dunn a271a3f1d6 Add email that is sent to inactive contributors. 2022-08-10 10:25:29 -07:00
Ian Dunn 9e4d322b3d
Stats: Add self-sponsored hours and contributor counts.
Fixes #124

Some variables/keys to clarify their names, or makes them less verbose. See #198, #200.
2022-08-03 15:53:34 -07:00
Ian Dunn 967718263f
Stats: Store in MC instead of post type
Fixes #200
Fixes #198
2022-08-03 09:29:49 -07:00
Ian Dunn 2b17844c96
Stats: Clarify confusing "sponsored" stats
This removes the `_total_sponsored_hours` and `_total_sponsored_contributors` stats because they're not reliable or meaningfullly different from the "pledged" stats. That effectively reverts most of c1ce72d447.

The remaining variables were renamed for clarity.

See #198

This will be further clarified by #200, because it will change the labels that are displayed to viewers.
2022-08-02 16:58:51 -07:00
Ian Dunn bb0216adc6
Replace deprecated SANITIZE_STRING filter with UNSAFE_RAW.
`FILTER_UNSAFE_RAW` doesn't strip HTML tags like `FILTER_SANITIZE_STRING` did, but some of these are being run through `sanitize_text_field` as well, and the others aren't being output or saved to the database.

See https://stackoverflow.com/a/69207369/450127
2022-07-19 11:03:35 -07:00
Ian Dunn 428cde283c
Contributors: Clear object cache when resetting profile data.
BuddyPress sets it infinitely, so for some users it would be awhile before it would be pushed out organically.
2022-05-03 12:36:16 -07:00
Ian Dunn c6d7bbb7c1
Contributors: Reset profile hours when pledge deactivated.
See https://github.com/WordPress/five-for-the-future/issues/169
2022-05-02 14:22:26 -07:00
Ian Dunn 834c62c0d0
Plugin: Minor cleanup 2022-04-28 09:34:14 -07:00
Ian Dunn 53ae291a53
Apply coding standards 2022-04-28 06:51:16 -07:00
Ian Dunn 82c8c9aec6
Email: Update Reply-To address to new mailbox. 2022-04-28 06:35:33 -07:00
Ian Dunn 5d8b056798
Manage Pledge: Normalize addresses to lowercase for comparison.
Fixes #141
2022-03-28 14:17:29 -07:00
Corey McKrill 174a0381d6
Theme: Add support for Openverse team, fix Themes Team badge
This syncs `r17406-dotorg` to the canonical Git repo.
2022-03-18 12:42:05 -07:00
Corey McKrill a545168ef2
Contributors: Prevent adding to a pledge twice.
This syncs `r17275-dotorg` to the canonical Git repo.
2022-03-18 12:42:05 -07:00
Ian Dunn d22f13f2c1
Pledge: Log the reason why a pledge was deactivated. 2022-03-18 12:42:05 -07:00
Ian Dunn 13a417ce8e
Apply coding standards. 2020-11-13 12:24:03 -08:00
Ian Dunn c1ce72d447
Track number of sponsored contributors and hours. 2020-11-13 12:24:02 -08:00
Dion Hulse d835246f3f
When a pledge has no contributors, return zero contributors/hours
This avoids a PHP Notice during the cron task to update the contributor/hour counters.

By returning 0 here we have "valid" metadata attached to the pledge posts, which removes the need for further logic there.

Closes #151
2020-10-07 13:46:00 +10:00
Kelly Dwan 2d8932cbd5
Manage Pledge: Add more information to the manage link email (#138) 2019-12-20 17:20:24 -05:00
Kelly Dwan a70212bc22
Pledge List: Add sorting by total contributor count (#133)
Add a "Total Contributors" option to the sorting menu on the pledge list. This will sort the list from most confirmed contributors to least.

Fixes #94
2019-12-16 17:48:33 -05:00
Kelly Dwan 183f7a95bc
Manage Pledge: Notify removed contributors (#109)
If a contributor is removed from a pledge, they should be notified of the change. This will send an email to any confirmed contributors letting them know.
2019-12-16 17:33:43 -05:00
Kelly Dwan 3b97459b15
Pledge List: Change list order hourly (#132)
Using a seed for the RAND function, based on the date & time, will randomize the list every hour, while keeping the order consistent across any pagination. This also removes the increase to posts_per_page, since pagination is functional again.

Fixes #70
2019-12-13 15:41:00 -05:00
Kelly Dwan a91c2733d2
Pledge Management: Add "request link" form to the manage pledge (#126)
When a pledge is selected but the auth token is missing/incorrect, show the email form. Like on the pledge page, submitting the correct email will trigger a new auth token + link to be emailed to the pledge manager. This makes for a clearer path for re-requesting a valid link.

Fixes #114
2019-12-11 16:12:23 -05:00