Author Archive

How to fix login stuck at ā€œsending user info, please waitā€¦ā€?

If you’re experiencing issues during logging in in and you get stuck on message ‘Sending user info, please wait…‘ there might be couple of issues:

  1. Most common cause of this problem are cache plugins active on your site. Try to disable them to see if that help. If it does – you may need to adjust plugin settings, as some may have aggressive optimization. For example, in WP Rocket, set the cache lifespan to 10 hours or less.
     
    If it still happens from time to time we suggest enabling ā€œSkip additional login/registration security checkā€ option in WorkScout Core → Registration
  2. Another but less common reasonis often related to custom mod_security rules. Some hosting providers block login requests from non standard paths, so try to contact your hosting provider and ask them about it.
  3. And last but not least, you may experience this issue on nginx server, in that case, add the following lines to /etc/nginx/nginx.com
    fastcgi_temp_file_write_size 10m; 
    fastcgi_busy_buffers_size 512k; 
    fastcgi_buffer_size 512k;
    fastcgi_buffers 16 512k;
    client_max_body_size 50m; 
    proxy_buffer_size 16k; 
    proxy_busy_buffers_size 16k;

    if that won’t help, check if you have Nginx Content caching enabled, you might need to disable that to fix that problem

Registration is disabled – what to do?

This is a very basic WordPress setting. Simply head over to the Settings → General page in your WordPress admin area. Scroll down to the ā€˜Membership’ section and check the box next to the ā€˜Anyone can register’ option.

If you caching enabled on your website you’d need to flush cache aswell.

Editing Freelancer & Resume Submission Fields

There are three main methods to customise resume submission fields in WP Job Manager.

1. Basic adjustment by Enabling / Disabling fields WorkScout Core → Form Fields Visibility → Resume Fields
2. Thrid party plugin such as https://plugins.smyl.es/wp-job-manager-field-editor/
3. Through functions.php snippets


Enabling / Disabling Fields

Basic changes can be done in WorkScout Core → Form Fields Visibility → Resume Fields where you can enable or disable fields you want in resume submit form.

For text changes from english to english use plugin such asĀ the Say What Plugin. If you’d like to translate fields to other language than english please refer to article: Translating theme and plugins →


Drag & Drop Editor

Use a 3rd party plugin such asĀ https://plugins.smyl.es/wp-job-manager-field-editor/ which has a UI for field editing.


Editing fields via PHP snippets on the frontend

Editing resumeĀ submission fields is possible via theĀ submit_resume_form_fieldsĀ filter. Adding some code will allow you to edit various fields, or add new ones.

See the below example which demonstrates how to change a field’s label:

// Add your own function to filter the fields
add_filter( 'submit_resume_form_fields', 'custom_submit_resume_form_fields' );

// This is your function which takes the fields, modifies them, and returns them
function custom_submit_resume_form_fields( $fields ) {

// Here we target one of the job fields (candidate name) and change it's label
$fields['resume_fields']['candidate_name']['label'] = "The Candidate Name";

// And return the modified fields
return $fields;
}


Adding a field

Similarly, you can add a field just as easily. Here’s an example showing how to add a new text input to the form:

// Add field to admin
add_filter( 'resume_manager_resume_fields', 'wpjms_admin_resume_form_fields' );
function wpjms_admin_resume_form_fields( $fields ) {

$fields['_candidate_color'] = array(
'label' => __( 'Favourite Color', 'job_manager' ),
'type' => 'text',
'placeholder' => __( 'Blue', 'job_manager' ),
'description' => '',
'priority' => 1
);

return $fields;

}

// Add field to frontend
add_filter( 'submit_resume_form_fields', 'wpjms_frontend_resume_form_fields' );
function wpjms_frontend_resume_form_fields( $fields ) {

$fields['resume_fields']['candidate_color'] = array(
'label' => __( 'Favourite Color', 'job_manager' ),
'type' => 'text',
'required' => true,
'placeholder' => '',
'priority' => 1
);

return $fields;

}

// Add a line to the notifcation email with custom field
add_filter( 'apply_with_resume_email_message', 'wpjms_color_field_email_message', 10, 2 );
function wpjms_color_field_email_message( $message, $resume_id ) {
$message[] = "\n" . "Favourite Color: " . get_post_meta( $resume_id, '_candidate_color', true );
return $message;
}

Note:Ā You can change the ā€˜priority’ of the field to position it where you want it. The higher the number, the lower down the form it will appear.

You could use a different field type likeĀ selectĀ orĀ checkbox, just make sure to follow the same method to add those field types that WP Job Manager uses.

Note:Ā To add it to the preview field you’d want to look at adding it to the template files, likeĀ content-single-resume.php, with some code like:

<? php echo get_post_meta( $post->ID, '_candidate_color', true ); ?>

Making the ā€˜Resume File’ field required

A common request is to require a resume file to be added. Simply use the following code to make it so:

// Add your own function to filter the fields
add_filter( 'submit_resume_form_fields', 'resume_file_required' );

// This is your function which takes the fields, modifies them, and returns them
function resume_file_required( $fields ) {

// Here we target one of the job fields (candidate name) and change it's label
$fields['resume_fields']['resume_file']['required'] = true;

// And return the modified fields
return $fields;
}

Adding a field to a repeated section

To add a field to one of the resume’s repeated sections (Education, Experience), the process is almost the same as adding a single field. Here’s an example of adding a ā€œFavorite Teacherā€ field to each Education section.


Adding the field to admin

Note that we use theĀ 'resume_manager_resume_education_fields'Ā filter instead ofĀ 'resume_manager_resume_fields'.

It’s also important to include aĀ 'name' entry as shown:

// Add field to admin
add_filter( 'resume_manager_resume_education_fields', 'wpjms_admin_resume_form_fields' );
function wpjms_admin_resume_form_fields( $fields ) {

$fields['favorite_teacher'] = array(
'label' => __( 'Favourite Teacher', 'job_manager' ),
'name' => 'resume_education_teacher[]',
'type' => 'text',
'placeholder' => '',
'description' => '',
'priority' => 1
);

return $fields;

}

Adding the field to the frontend form

This code is almost the same as adding a single field to the form, you just need to includeĀ ['candidate_education']['fields']Ā to specify where this field should go.

// Add field to frontend
add_filter( 'submit_resume_form_fields', 'wpjms_frontend_resume_form_fields' );
function wpjms_frontend_resume_form_fields( $fields ) {
	
	$fields['resume_fields']['candidate_education']['fields']['favorite_teacher'] = array(
	    'label' => __( 'Favourite Teacher', 'job_manager' ),
	    'type' => 'text',
	    'required' => true,
	    'placeholder' => '',
	    'priority' => 1
	);

	return $fields;
	
}

Remove the Preview Step

You may want to simplify the job submission process by removing the preview step.

To do so, simply add the following code to yourĀ functions.phpĀ file or even better, use a plugin such asĀ Code Snippets

How to add PHP snippets?

<?php

/**
* Remove the preview step. Code goes in theme functions.php or custom plugin.
* @param array $steps
* @return array
*/
function custom_submit_job_steps( $steps ) {
unset( $steps['preview'] );
return $steps;
}
add_filter( 'submit_job_steps', 'custom_submit_job_steps' );

/**
* Change button text (won't work until v1.16.2)
*/
function change_preview_text() {
return __( 'Submit Job' );
}
add_filter( 'submit_job_form_submit_button_text', 'change_preview_text' );

/**
* Since we removed the preview step and it's handler, we need to manually publish jobs
* @param int $job_id
*/
function done_publish_job( $job_id ) {
$job = get_post( $job_id );

if ( in_array( $job->post_status, array( 'preview', 'expired' ) ) ) {
// Reset expirey
delete_post_meta( $job->ID, '_job_expires' );

// Update job listing
$update_job = array();
$update_job['ID'] = $job->ID;
$update_job['post_status'] = get_option( 'job_manager_submission_requires_approval' ) ? 'pending' : 'publish';
$update_job['post_date'] = current_time( 'mysql' );
$update_job['post_date_gmt'] = current_time( 'mysql', 1 );
wp_update_post( $update_job );
}
}
add_action( 'job_manager_job_submitted', 'done_publish_job' );

You may need to remove the first line from the code.

Basically this does a few things:

  1. Remove the preview step
  2. Change preview text to ā€˜Submit Job’
  3. Manually publish job (as the preview handler normally does this)

Require an active job package to view resumes

This tutorial applies to users running bothĀ Job Manager ResumesĀ andĀ WC Paid ListingsĀ and lets you restrict access to the resumes portion of your site to users with an active job package only.

How to add PHP snippets?


Add a snippet

Use code snippet below into theme functions.php file, or even better, with a plugin such as Code Snippets.

// Hook into user_has_cap filter. This assumes you have setup resumes to require the capability 'has_active_job_package'
add_filter( 'user_has_cap', 'has_active_job_package_capability_check', 10, 3 );

/**
* has_active_job_package_capability_check()
*
* Filter on the current_user_can() function.
*
* @param array $allcaps All the capabilities of the user
* @param array $cap [0] Required capability
* @param array $args [0] Requested capability
* [1] User ID
* [2] Associated object ID
*/
function has_active_job_package_capability_check( $allcaps, $cap, $args ) {
// Only interested in has_active_job_package
if ( empty( $cap[0] ) || $cap[0] !== 'has_active_job_package' || ! function_exists( 'wc_paid_listings_get_user_packages' ) ) {
return $allcaps;
}

$user_id = $args[1];
$packages = wc_paid_listings_get_user_packages( $user_id, 'job_listing' );

// Has active package
if ( is_array( $packages ) && sizeof( $packages ) > 0 ) {
$allcaps[ $cap[0] ] = true;
}

return $allcaps;
}

What does it do? When WordPress checks if the user has the correct capability to view resumes, it checks the users packages. If they have a package, they are given the capability dynamically.


Configure Resume Access

The next step is to configure resumes for capability based access. Go to Resumes → Settings → Resume VisibilityĀ and for each permission enter ā€˜has_active_job_package’.

Update Resume Visibility