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 Salary Range Field & JobSchema to WPJM #2633

Draft
wants to merge 16 commits into
base: trunk
Choose a base branch
from

Conversation

masteradhoc
Copy link
Contributor

@masteradhoc masteradhoc commented Nov 11, 2023

Fixes #2629

Changes Proposed in this Pull Request

  • Adds a max salary field to the frontend and admin forms.
  • Adds a max salary information to Google's Job Search Structured Data

Testing Instructions

  • Create/Edit Job Listing and add salary
      1. add only one salary number (in min field)
      1. add both min salary and max salary
  • View the salary on the frontend
  • Copy the output HTML and paste here - https://search.google.com/test/rich-results

Release Notes

  • Add: WPJM now supportes Salary Ranges and includes them into the job schema

@masteradhoc masteradhoc marked this pull request as ready for review November 11, 2023 19:41
@masteradhoc
Copy link
Contributor Author

@fjorgemota @mikeyarce @onubrooks asking for a review on this as you worked last on the salary area :)

@mikeyarce
Copy link
Member

Thanks for the PR @masteradhoc !
@yscik what do you think about this one?

The code implementation looks good - but my concern is with the labelling of the fields:
Screenshot 2023-11-13 at 2 44 13 PM

Salary / Salary Min and Salary Max is confusing to me. I would either just want Salary OR Salary Min and Salary Max. What if we made it an option so that you can decide if you want a simple Salary or a Salary Range?

Overall, I think it would be great to have the option for Min/Max salary.

* @param string $currency
* @param string $unit
* @param string $after
*/
$job_salary = apply_filters( 'the_job_salary_message', $job_salary, $post, $before, $salary, $currency, $unit, $after );
$job_salary = apply_filters( 'the_job_salary_message', $job_salary, $post, $before, $salary, $currency, $salarymax, $unit, $after );
Copy link
Contributor

Choose a reason for hiding this comment

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

This might break existing integrations

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@thedebian what do you suggest?

Copy link
Contributor

Choose a reason for hiding this comment

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

Good question, I don't have an empirical solution to that, it can be anything from adding the param after $after, to changing $salary to be a concatenation of $min . '-' . $max, if it's a salary range .
I'd prefer the second option, as $salary is documented as string, it wouldn't break the contract, @gkaragia do you have an idea ?

Copy link
Contributor

Choose a reason for hiding this comment

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

I think appending it as an extra argument in the end is the safest.

If we don't add it as an extra argument and concatenate instead, this will break existing sites that use the $after function argument or specify a $unit. In these cases the job salary mind end up with weird values in the filter.

@masteradhoc
Copy link
Contributor Author

Thanks for the PR @masteradhoc ! @yscik what do you think about this one?

The code implementation looks good - but my concern is with the labelling of the fields: Screenshot 2023-11-13 at 2 44 13 PM

Salary / Salary Min and Salary Max is confusing to me. I would either just want Salary OR Salary Min and Salary Max. What if we made it an option so that you can decide if you want a simple Salary or a Salary Range?

Overall, I think it would be great to have the option for Min/Max salary.

Quite open to that. Just didnt wanted to add another setting for this as its quite common to have some jobs with no range (f.e. intern/trainee) and some with range. How would you like this to be changed?

i think also this could make sense:

  • Salary Min.
  • Salary Max.

@masteradhoc
Copy link
Contributor Author

@gkaragia @thedebian any option to get this reviewed again? :)

@gikaragia
Copy link
Contributor

Hey @masteradhoc, as @mikeyarce suggested above I think that we should have separate fields for the salary range and actual salary.

I think that the most versatile approach would be to have all three fields available, Salary, Salary Min, and Salary Max. Then we don't show the Salary field if both Salary Min and Salary Max are defined. @mikeyarce and @yscik what do you think about that?

@masteradhoc
Copy link
Contributor Author

@gkaragia sounds like an option for me.
From User Experience View im not sure if its though a good idea. What if you started with a regular salary number as WPJM didnt had the range feature until now and would like to upgrade to ranges now?

You would have to turn it on and loose all of your existing values or copy it upfront and then reenter it again. The solution like this is designed that it works even for users that are upgrading to ranges or only using them sometimes..

@gikaragia
Copy link
Contributor

Hey @masteradhoc, I am not suggesting adding an option for this. After having some second thoughts we should do the following:

  • Add a checkbox called 'Enable Salary Range' in the job itself, not WPJM settings.
  • This checkbox when clicked, will hide the existing 'Salary' field and show 'Salary Min' and 'Salary Max'.
  • When the checkbox is enabled and the listing is updated, salary range will be used for this job instead.

If you don't have the capacity to implement the above, let us know and we will consider implementing it in a future release.

@gikaragia
Copy link
Contributor

Just as an update @masteradhoc we will look into implementing this in the future.

@gikaragia
Copy link
Contributor

gikaragia commented Jan 19, 2024

We have decided that we will rework this in the near future so switching this to draft.

@gikaragia gikaragia marked this pull request as draft January 19, 2024 12:19
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.

Add Salary Range support & add to Google Schema
4 participants