Author Archive

How to solve problems with AJAX login?

If you’re trying to use Ajax login on Listeo and you get stuck on message ‘Sending user info, please wait…‘, first check if you have any cache/optimizations plugins active on your site. If you do, try to disable them to see if that help. If it does, you might need to change some settings in those plugins as they might have to aggressive optimization for this feature to work.

The issue is often connected with 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.

And last but not least, you may experience this issue on nginx server, in that case, add the following lines to /etc/nginx/nginx.conf

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

Editing Job Submission Fields

There are three main ways to customise the fields in WP Job Manager;

  1. For simple text changes, using a localisation file or a plugin such as the Say What Plugin. See Translating WP Job Manager for more information.
  2. Use a 3rd party plugin such as https://plugins.smyl.es/wp-job-manager-field-editor/ which has a UI for field editing.
  3. Use the WordPress hooks (filters) which are explained below.

WP Job Manager’s approach to allowing customisation of it’s forms is to use filters. In WordPress, filters essentially allow you to ‘filter’ data through your own custom php functions which return a different ‘filtered’ result. Any custom code can go in your theme functions.php file.


Editing fields on the frontend

Editing job submission fields is possible via the submit_job_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_job_form_fields', 'custom_submit_job_form_fields' );

// This is your function which takes the fields, modifies them, and returns them
// You can see the fields which can be changed here: https://github.com/mikejolley/WP-Job-Manager/blob/master/includes/forms/class-wp-job-manager-form-submit-job.php
function custom_submit_job_form_fields( $fields ) {

// Here we target one of the job fields (job_title) and change it's label
 $fields['job']['job_title']['label'] = "Custom Label";

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

View the full list of core fields in this file: https://github.com/mikejolley/WP-Job-Manager/blob/master/includes/forms/class-wp-job-manager-form-submit-job.php


Editing fields in admin

Fields in admin are of similar structure and can be edited using the ‘job_manager_job_listing_data_fields’ filter. Each field takes a label, placeholder, type and description arguments.

See the below example which demonstrates how to change a field’s placeholder:
 // Add your own function to filter the fields
 add_filter( 'job_manager_job_listing_data_fields', 'custom_job_manager_job_listing_data_fields' );

// This is your function which takes the fields, modifies them, and returns them
 // You can see the fields which can be changed here: https://github.com/mikejolley/WP-Job-Manager/blob/master/includes/admin/class-wp-job-manager-writepanels.php
 function custom_job_manager_job_listing_data_fields( $fields ) {

// Here we target one of the job fields (location) and change it's placeholder
 $fields['_job_location']['placeholder'] = "Custom placeholder";

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

View the full list of core fields in this file: https://github.com/mikejolley/WP-Job-Manager/blob/master/includes/admin/class-wp-job-manager-writepanels.php

Customizing Dashboard Menu

WorkScout offers a front-end dashboard for user, where they can manage their jobs, resume, messages and profile info.

The dashboard page has sidebar menu that helps navigate, some elements in that menu are automatically created based on settings in WPJM, so for example if you have set Submit Job page in the Job Listings 🠖 Settings 🠖 Pages, theme will automatically link that page in Dashboard Page menu for Employer.

However, you can assign your own links to Candidate/Employer menu.
Go to Appearance 🠖 Menus you can create there a new menu, and assign that menu to the one of dashboard locations, this could be Employer Dashboard Menu or Candidate Dashboard Menu.

Radius Search

How it works? If someone types keyword/location field, and  select a distance value, the address will be geocoded to latitude and longitude and all properties that are in the selected radius of that point are returned in search results.

If you want to enable Radius Search in your theme, you need to create another Google Maps API Key without any key or domain restrictions. This key will be used on server side geocoding and it won’t be public.

How to get Google API Key?

Once you created new API Key, paste it to WorkScout Core → Map Settings → Gooogle Maps API key for server side geocoding

 

How does search by location works?

There are two ways the ‘location’ field in search can work. The presence of Google Maps API key for server side geocoding in WorkScout Core – Map Options determines which one is used.

If the API key is added (and configured properly – please refer to this article) the address typed in ‘location’ field is geocoded to latitude and longitude and all jobs that are in the selected radius of that point are returned in search results. The radius  value can be set by default in WorkScout Core options (it’s 20km by default).

The search function creates a debug file named geocode.txt in your wp-content folder – if you think the geolocation doesn’t work or results are incorrect, please first check this file for any messages from API

If there’s no API key added the search is strictly text based, the text typed by user is compared to the jobs address field to find matching results.

Customizing Templates

Workscout Core has separated folder for all the templates that are used to display single listings and listings archives. Those templates  files can be overridden via your theme if you want to customise them. To override a template, move it to yourtheme/workscout-core/, keeping the path within ‘templates’ intact.

So for example, you’d like to change the registration form. To do that, copy file wp-content/plugins/workscout-core/templates/account/registration-form.php to wp-content/themes/yourtheme/workscout-core/account/registration-form.php and you can customise the file as you need. It will be used instead of the core template file. This also supports child themes, so you can put that file directly to your child theme.

Please note, if these files are updated in the core plugin, you may need to update your custom version in the future to maintain compatibility. Therefore it is advised to only override the template files you need to customise.

User Login / Registration

All registration options are simplified and you’ll find them in WorkScout Core → Registration Options. You can also set up recaptcha there.

Also don’t forget to enable registration in  Settings → General → Membership → Anyone can register.

Related article: How to enable social login?

How to improve page load speed?

Do you want to speed up your WordPress site? Fast loading pages improve user experience, increase your pageviews, and help with your WordPress SEO. In this article, we will share the most useful WordPress speed optimization tips to boost WordPress performance and speed up your website.

1. Enable GZIP compression

You can do it using WP Performance Score Booster plug-in or manually by adding the following to your .htaccess file:

# compress text, html, javascript, css, xml:
AddOutputFilterByType DEFLATE text/plain
AddOutputFilterByType DEFLATE text/html
AddOutputFilterByType DEFLATE text/xml
AddOutputFilterByType DEFLATE text/css
AddOutputFilterByType DEFLATE application/xml
AddOutputFilterByType DEFLATE application/xhtml+xml
AddOutputFilterByType DEFLATE application/rss+xml
AddOutputFilterByType DEFLATE application/javascript
AddOutputFilterByType DEFLATE application/x-javascript

# Or, compress certain file types by extension:
<files *.html>
SetOutputFilter DEFLATE
</files>

Before we start I should explain what content encoding is. When you request a file like http://www.yahoo.com/index.html, your browser talks to a web server. The conversation goes a little like this:

HTTP_request.png

  1. Browser: Hey, GET me /index.html
  2. Server: Ok, let me see if index.html is lying around…
  3. Server: Found it! Here’s your response code (200 OK) and I’m sending the file.
  4. Browser: 100KB? Ouch… waiting, waiting… ok, it’s loaded.

Well, the system works, but it’s not that efficient. 100KB is a lot of text, and frankly, HTML is redundant. Every <html>, <table> and <div> tag has a closing tag that’s almost the same. Words are repeated throughout the document. Any way you slice it, HTML (and its beefy cousin, XML) is not lean.

And what’s the plan when a file’s too big? Zip it!

If we could send a .zip file to the browser (index.html.zip) instead of plain old index.html, we’d save on bandwidth and download time. The browser could download the zipped file, extract it, and then show it to user, who’s in a good mood because the page loaded quickly. The browser-server conversation might look like this:

HTTP_request_compressed.png

  1. Browser: Hey, can I GET index.html? I’ll take a compressed version if you’ve got it.
  2. Server: Let me find the file… yep, it’s here. And you’ll take a compressed version? Awesome.
  3. Server: Ok, I’ve found index.html (200 OK), am zipping it and sending it over.
  4. Browser: Great! It’s only 10KB. I’ll unzip it and show the user.

The HTML portion of the yahoo home page goes from 101kb to 15kb after compression:

yahoo_compression.PNG


2. Install a WordPress Caching Plugin

We recommend using the WP Super Cache:

WP Super Cache


WordPress pages are “dynamic.” This means they’re built on the fly every time someone visits a post or page on your website. To build your pages, WordPress has to run a process to find the required information, put it all together, and then display it to your user.

This process involves a lot of steps, and it can really slow down your website when you have multiple people visiting your site at once.

That’s why we recommend every WordPress site use a caching plugin. Caching can make your WordPress site anywhere from 2x to 5x faster.

Here’s how it works: Instead of going through the whole page generation process every time, your caching plugin makes a copy of the page after the first load, and then serves that cached version to every subsequent user.

How caching works

As you can see in the graphics above, when a user visits your WordPress site, which is built using PHP, your server retrieves information from a MySQL database and your PHP files, and then it’s all put together into a HTML content which is served served to the user. It’s a long process, but you can skip a lot of it when you use caching instead.


3. Optimize Images for Speed

If your images aren’t optimized, they could be hurting more than helping. In their original formats, these photos can have huge file sizes. But based on the image file format and the compression you choose in your editing software, you can decrease your image size by up to 5x.

We recommend using Smush Image Compression and Optimization plugin:

Smush Image Compression and Optimization


4. Use a Content Delivery Network (CDN)

https://gtmetrix.com/blog/wp-content/uploads/2017/02/cdn-example.png

Users in different geographical locations may experience different loading times on your site. That’s because the location of your web hosting an have an impact on your site speed. For example, let’s say your web hosting company has its servers in the United States. A visitor who’s also in the United States will generally see faster loading times than a visitor in Europe.

A CDN is a network made up of servers all around the world. When you use a CDN, every time a user visits your website they are served those static files from whichever server is closest to them. Your own web hosting server will also be faster since the CDN is doing a lot of the work.

We recommend MaxCDN. It works well with WordPress websites and complements your existing WordPress caching plugins for even faster loading times. See guide on how to install and setup WordPress CDN solution MaxCDN to get started.

 


Sources of this article:
http://www.wpbeginner.com/wordpress-performance-speed/
http://betterexplained.com/articles/how-to-optimize-your-site-with-gzip-compression/

WooCommerce Paid Listings

WooCommerce Paid Listings is a plugin for WP Job Manager which lets you purchase Job Listing Packages and Resume Packages (as products) which are then used to post listings.

Setting up WooCommerce products as job/resume packages

After installation the first thing you’ll need to do is setup some products in WooCommerce which job submitters can purchase.

  1. Create a new product
  2. Select a package product type:
    1. Job Package – A package which lets a user post X jobs before expiring.
    2. Resume Package – A package which lets a user post X resumes before expiring. Requires Resume Manager add-on.
    3. Job Package Subscription – Requires WooCommerce Subscriptions. See below for more information.
    4. Resume Package Subscription – Requires WooCommerce Subscriptions and Resume Manager add-on. See below for more information.
  3. Enter price and other product details like any other product. Job/Resume Package products can be free or paid – your choice!
  4. Package specific options are as follows:

    • Listing limit – How many job or resume listings this package lets you create once purchased. Can be left blank for unlimited posting.
    • Listing duration – How long job/resume listings last (in days) before expiring when using this package.
    • Feature listings? – Whether or not job listings should be featured when using this package.
  5. Publish the product

The published package will then be available during job submission.


Subscriptions Support

Job Packages can also be subscriptions, but this requires the WooCommerce Subscriptions extension from WooThemes. You can have both Job and Resume Subscription packages.

Subscriptions can work in two ways.

  1. Package linked to the Subscription: If the subscription is linked to the listing, the user will be able to post a limit of X active listings which will expire when the subscription expires. Failure to renew will expire the listings.
  2. Subscription linked to the Listing: If the subscription is linked to the listing, the user will be able to post a limit of X active listings which will expire when the subscription expires. Failure to renew will expire the listings.

Job Submission Flow

WC Paid Listings will change the job submission process slightly to add the required purchase/job pack steps. This is how it should happen:

  1. User fills in the job submission form as normal
  2. User previews the job as normal
  3. Then he choose a package screen will be displayed. This page lists all Job Package products and previously purchased active job packs:
  4. User chooses a package and clicks submit.
    If this is a new package, it will be added to the WooCommerce cart, referencing the Job ID. Once paid for, the job will be approved and the package assigned to the user.
    If this is a package that has already been purchased, the job will be submitted right away.

The same flow is used for resumes

How to change some texts/words?

If you would like to change some texts from english to english (translating to another language is described here) you can do it using SayWhat? plugin that allows you to alter strings on your site without editing WordPress core:

Say what?

After installing SayWhat? plugin go to Tools → Text Changes and click “Add New“. In “Original string” field write original text, then in “Text domain” field add workscout_core or workscout and in “Replacement string” field add new text.

Some texts might come from other plugins. Please click here to find instructions on how to find text_domain.

In this example we changed text above search input field on homepage from “What job are you looking for” to “Find great places to work”.

Click “Add” and voila:

 


 

How to find text_domain?

Install Text Domain Inspector: https://wordpress.org/plugins/text-domain-inspector/

Enable it at the admin toolbar and you will see red dots. Hover over a dot and you will see text domain relevt to the text you need.