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 stats section to job overlay #2776

Merged
merged 23 commits into from
Mar 13, 2024
Merged

Add stats section to job overlay #2776

merged 23 commits into from
Mar 13, 2024

Conversation

yscik
Copy link
Contributor

@yscik yscik commented Feb 22, 2024

Fixes #2744, fixes #2745, fixes #2746

Changes Proposed in this Pull Request

  • Add stats section and daily chart to job overlay
  • Add accent color, with a script to auto-detect link color by default
  • Fix/tune related styles, improve job overlay on mobile
  • Add a dev cli command to generate stats
  • Add search impression count to the dashboard and admin tables

Testing Instructions

  • Open the [job_dashboard], and click on various jobs to view them.
  • Generate stats to show by clicking around job search opening jobs, or by the CLI helper command: wp jm dev stats generate <postId>
  • The daily views chart goes from publish date to expiration date, make sure those are realistic. Test data generation goes from publish date to current date.
  • Check on a few themes. Chart color should pick up the site's link color.

New or Updated Hooks and Templates

  • job_manager_job_stats_chart - Filter the data for the daily breakdown chart
  • job_manager_job_stats_summary - Filter the sections and data for the summaries
  • job_manager_ui_accent_color - Set an accent color manually

Screenshot / Video

image
Plugin build for 78c905a
📦 Download plugin zip
▶️ Open in playground

Base automatically changed from add/job-dashboard-company to feature/stats February 23, 2024 16:02
@yscik yscik marked this pull request as ready for review February 28, 2024 19:25
@yscik yscik linked an issue Feb 29, 2024 that may be closed by this pull request
Copy link
Contributor

@thedebian thedebian left a comment

Choose a reason for hiding this comment

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

Code looks good.
When opening the modal, the ajax fails, because I have a warning "Warning: Undefined array key "posts_per_page" in /var/www/html/wp-content/plugins/WP-Job-Manager/includes/class-job-dashboard-shortcode.php on line 636", it seems to come from this PR, there's no default set for posts_per_page and $args['posts_per_page'] is checked in the method.

Also had a bunch of other warnings once this one was fixed 😅 :

Capture d’écran 2024-03-05 à 09 06 48

I could only get some stats after running the wp command, but that's maybe normal ?

Last (but not least), something's happening there and the pages hangs the Firefox tab for a while, after the modal is displayed:

Capture d’écran 2024-03-05 à 09 10 49

@yscik
Copy link
Contributor Author

yscik commented Mar 6, 2024

Last (but not least), something's happening there and the pages hangs the Firefox tab for a while, after the modal is displayed

I suspect that's to do with the 100 years of stats it's supposed to render :D I'll put some sane limit on it.

@yscik yscik merged commit e4c23ac into feature/stats Mar 13, 2024
11 checks passed
@yscik yscik deleted the add/job-overlay-stats branch March 13, 2024 13:47
@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
Projects
None yet
2 participants