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

Add usage tracking for settings #2799

Merged
merged 4 commits into from
Apr 5, 2024
Merged

Conversation

yscik
Copy link
Contributor

@yscik yscik commented Mar 28, 2024

Fixes #2797

Changes Proposed in this Pull Request

  • Send setting field data along when sending usage tracking data
  • Configure which settings fields are included with a track key in the settings config
  • Move a few things around so the Settings class is available
  • Fix an issue with licensed plugin info not matching formatting rules for Tracks

Testing Instructions

  • Run the cron event job_manager_usage_tracking_send_usage_data
  • Wait 10 minutes
  • Check for the wpjm_stats_log event in Tracks Live View. Username can be used to filter, it's the full site URL (Like http://paper.local)
  • Check that settings_ fields are included

Plugin build for 20d4d78
📦 Download plugin zip
▶️ Open in playground

@yscik yscik requested a review from a team March 28, 2024 16:13
@yscik yscik self-assigned this Mar 28, 2024
@yscik yscik linked an issue Apr 2, 2024 that may be closed by this pull request
@@ -322,7 +322,6 @@ public function clear_fields() {
* Enqueue the scripts for the form.
*/
public function enqueue_scripts() {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is this actually called from somewhere?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Oh looks like I had the warning about this because it's called in the Applications add-on's form (WP_Job_Manager_Applications_Apply) that extends this class. Since this is a generic base class used all around I'd keep the method even if we don't use it now in core.

includes/admin/class-wp-job-manager-settings.php Outdated Show resolved Hide resolved
@@ -285,6 +312,7 @@ protected function init_settings() {
'type' => 'text',
'placeholder' => __( 'e.g. USD', 'wp-job-manager' ),
'attributes' => [],
'track' => 'bool',
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

text?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixing these in 20d4d78

includes/admin/class-wp-job-manager-settings.php Outdated Show resolved Hide resolved
Copy link
Contributor

@gikaragia gikaragia left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@yscik yscik merged commit c53f63e into feature/stats Apr 5, 2024
11 checks passed
@yscik yscik deleted the add/settings-usage-tracking branch April 5, 2024 14:53
@yscik yscik added this to the 2.3.0 milestone Apr 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Stats: add usage tracking
2 participants