Skip to content
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

Measure first-time participation #888

Closed
10 tasks done
iandunn opened this issue Jun 2, 2023 · 4 comments · Fixed by #935 or #939
Closed
10 tasks done

Measure first-time participation #888

iandunn opened this issue Jun 2, 2023 · 4 comments · Fixed by #935 or #939
Assignees

Comments

@iandunn
Copy link
Member

iandunn commented Jun 2, 2023

First-time participation will be a key metric for pilot sites.

We could use the old first-time.php script for some of these, but volunteers/attendees aren't included in that. We may want to move the others towards a self-reported model for increased accuracy, but that also places an extra burden on the user when filling out forms.

Speakers

  • Add First Time being a speakers question to CPT
  • Retrieve _wcb_speaker_first_time and render the value properly on WordCamp Reports » WordCamp Counts

Sponsors

  • Add First Time being a sponsors question to CPT
  • Retrieve _wcb_sponsor_first_time and render the value properly on WordCamp Reports » WordCamp Counts

Organizers

  • Add First Time being an organizer question to CPT
  • Retrieve _wcb_organizer_first_time and render the value properly on WordCamp Reports » WordCamp Counts

Volunteers. Related #887

  • Retrieve _wcb_volunteer_first_time and render the value properly on WordCamp Reports » WordCamp Counts

Attendees. Related #875

  • Add First Time being an organizer question to CPT
  • Retrieve _wcb_attendees_first_time and render the value properly on WordCamp Reports » WordCamp Counts

Script

@StevenDufresne StevenDufresne added this to the Pilot Events: MVP milestone Jun 7, 2023
@renintw renintw self-assigned this Jun 20, 2023
@renintw
Copy link
Contributor

renintw commented Jun 21, 2023

@iandunn 👋
I got some questions that need a bit of guidance. In the ticket, you mentioned that:

We could use the old first-time.php script for some of these, but volunteers/attendees aren’t included in that.

  1. For this approach, I assume we can achieve the goal (although the stats might not be accurate enough) by having volunteers/attendees included in the script to make it able to fetch their data, is it correct? But the script seems to include volunteers already.

2023: 1 first-time volunteer

php first-time.php wcb_volunteer 2023

First time wcb_volunteer in 2023:
casiepa

Total number of first time wcb_volunteer in 2023: 1

2022: 0

$ php first-time.php wcb_volunteer 2022

Warning: sort() expects parameter 1 to be array, null given in /first-time.php on line 85

Call Stack:
    ...

First time wcb_volunteer in 2022:
Warning: Invalid argument supplied for foreach() in /first-time.php on line 89

Call Stack:
   ...

Warning: count(): Parameter must be an array or an object that implements Countable in /first-time.php on line 93

Call Stack:
    ...

Total number of first time wcb_volunteer in 2022: 0
  1. And I got a minor proposal for the script, do you think it’s ok to add some usage examples or to replace the wording like speakers/sponsors/organizers with its real post-type naming?

This is because the script tends to take a while before the list is finally generated and Warning: This post type doesn't exist on Central. It may exist on other sites, though. would pop up if $_SERVER['HTTP_HOST'] = '[wordcamp.org](http://wordcamp.org/)'; wasn’t updated.

For me, the waiting time made me wonder and think if there was something wrong with my configuration or if there were any bugs and then started to trace codes, like this time I tried to figure out how it determines whether the post types exist or not, or checked if it’s my environment provision that causing the error. But it turns out, it was simply because the post type wasn’t correctly given in the first place.

@iandunn
Copy link
Member Author

iandunn commented Jun 22, 2023

the script seems to include volunteers already.

Ah, you're right. It'll accept an arbitrary post type, so once #895 merged it started working automatically. The Community team wants to use self-reported data for volunteers (and attendees), though.

Related:

So, I can think of 2 options:

  1. Build a report in the wordcamp-reports plugin that pulls the volunteer data from the _wcb_volunteer_first_time post meta value. Then, make first-time.php quit early if wcb_volunteer is the passed post type. It could inform them to use the report in wp-admin instead.
  2. Adapt first-time.php to use the _wcb_volunteer_first_time for wcb_volunteer, and then continue using the existing counting method for the other post types.

1 would be more work, but a better outcome since folks wouldn't need to rely on devs running the script for them. I'd lean towards that one, but 2 might also work if we need to get it done fast. What do you think @renintw and @StevenDufresne ?

@iandunn
Copy link
Member Author

iandunn commented Jun 22, 2023

add some usage examples or to replace the wording like speakers/sponsors/organizers with its real post-type naming?

That's a good idea 👍🏻

the waiting time made me wonder ... if there was something wrong with my configuration

Good point 👍🏻

We could add something like echo '.'; each time it finishes an iteration of the foreach ( $sites as $site_id ) loop, similar to flush-alloptions-caches.php.

Another option would be to convert it to a WP-CLI script, and then use make_progress_bar(), like in check-spam-posts.php. That's ideal since it's more modern and gives a better devex, but maybe not worth the time if it doesn't look quick. If you choose that option, the script should move from the php folder to the wp-cli one.

@renintw
Copy link
Contributor

renintw commented Jun 23, 2023

1 would be more work, but a better outcome since folks wouldn't need to rely on devs running the script for them. I'd lean towards that one, but 2 might also work if we need to get it done fast.

I'll vote for 1 as well, but if we really need to have it done fast, I can have 2 finished first, and then work on 1. I'm not that sure if 1 could be done fast as well, as it seems not that complicated at a quick look. But that is just my gut feeling, haven't looked into the code.

convert it to a WP-CLI script, and then use make_progress_bar()...

converting it to a WP-CLI script sounds like a good idea, I'll work on that, thanks for the instruction!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment