I am happy and a bit nervous to inform you we will be releasing WPAdverts 1.4.0 within 48 hours (on 6th February around 10 AM GMT).

This is a major version change (from 1.3.X to 1.4.0) which pushes the whole project forward (in terms of what we can do with it under the hood), but unfortunately …

… this is a major update with possibly backward-incompatible changes.

Do not panic though, this is nothing that would break your site. We also did as much as possible to avoid any unwanted behavior but you still might need to change few (exactly max. 2) things manually.

Before I will list the new features lets start with who might be affected and what to check before and after updating to avoid any surprises.

Basically, there are 4 major changes out of which only 2 could potentially be backward-incompatible and each has a solution you can implement within a few minutes.

Note that we will be also extending the support hours, so you will be able to get help quickly in case of problems.

Ok, so what changed?

Custom Language

Using custom language. To put it simply if you used Loco Translate (or another translation plugin/software), or the Say What? plugin to change some phrases then most likely your site is affected.

To fix it you would need to go to wp-content/languages/plugins folder, and check if you have there file(s) which names starts with adverts-*, if you do then rename it to wpadverts-*.

Similarly, if you are using Say What? the plugin then edit the customized phrases and in the “Text Domain” enter “wpadverts” where you have “adverts”.

Custom Templates

Specifically, if you created a child template for the wpadverts/templates/add-preview.php template file, then after the update you will need to overwrite it with the add-preview.php file from WPAdverts 1.4.0 otherwise going to “Preview” from [adverts_add] might not work.

I suppose some of the users might say: “Ok, but I am not sure if you have a custom add-preview.php, what then?“.

If you had a developer create a website for you, then it would be best to ask him. If you created the website yourself and do not know what an add-preview.php template is then there is a good chance (like 99% chance) you do not have a custom template and can update safely.

In either case, after updating just go to the page with [adverts_add] shortcode and post a new Ad if you will be able to go from Preview to Publish/Pay then everything is set correctly.

If you use a custom add-preview.php template file then you can prepare yourself for the update by opening the add-preview.php file and adding below (or above)

<input type="hidden" name="_adverts_action" value="save" />

the following code

<input type="hidden" name="_post_id_nonce" id="_post_id_nonce" value="<?php echo esc_attr( isset($post_id_nonce) ? $post_id_nonce : "" ) ?>" />

It is best to edit this file via FTP, but you also should be able to find it in wp-admin / Appearance / Theme Editor panel and edit it from there.

UPDATE: 2020-02-06

Additionally, if you have at least one of the following custom templates add.php, form.php, list.php or manage-edit.php then in each of these templates you will need to find code

call_user_func( adverts_field_get_renderer($field), $field )

and replace it with

call_user_func( adverts_field_get_renderer($field), $field, $form )

basically just add third param “$form”

ALS Slider Replaced with Slick

On Ad details pages WPAdverts was using ALS slider which was no longer supported and started becoming incompatible with newer browsers, so we made a switch to the Slick slider which is a modern alternative and hopefully as its slogan says it will be “the last carousel you’ll ever need“.

This change you will only notice if in wp-admin / Classifieds / Options / Core / Gallery panel you have option “Thumbnails Slider” selected in the “Gallery Pagination” field.

That being said the only noticeable change here should be that the image slider uses the space better and now allows scrolling the images by dragging.

Categories Handling

We did quite a lot of work on handling the custom taxonomy pages (in our case Advert Category and Advert Location taxonomies).

The update changes how the taxonomy pages (that is the pages with URLs like https://example.com/advert-category/test/) will be handled, internally.

In most cases, we expect an improvement in the compatibility between WPAdverts and the WordPress themes, but since this is a quite big change just check one or two category pages to make it works the way it used to work (or if it works better if the previous version had some kind of conflict with WPAdverts).

That is a LOT of work on my end!!!

You might be wondering: couldn’t you just make an update which *just works*? Unfortunately, the answer is: “no”.

I understand that some users will not read the update notices (thank you for reading it btw.) and will rate the plugin with a 1-star rating or ask for a refund because the update “broke” their website.

I am ok with that, as in order to improve the WPAdverts and take it to a so-called next-level (as much as cliche it sounds), these are all changes that needed to happen sooner or later.

What else changed?

Additional Security when posting from [adverts_add]

The two main updates are under the hood changes. I have prepared a kind-of checksum system to verify the integrity of the requests sent via [adverts_add] shortcode.

The checksums system will check the form integrity specifically when uploading files if you are using more than one form scheme or more than one [adverts_add].

It is maybe not that useful if you have just one [adverts_add] form scheme but still adds an additional layer of security. For now, the main usage of this feature is to validate the integrity of the [adverts_add] submission when skip_preview param is set to 1 (read more on this feature below).

These security improvements will come handy when we will allow more file upload fields and when the anonymous users will be able to edit their listings.

Skip Preview in [adverts_add]

You can now use the [adverts_add] shortcode with skip_preview param like this

[adverts_add skip_preview="1"]

With this param, the user will go to straight from the Form to the Publish or Pay screen.

Streamlined Taxonomy Browsing

Until now each taxonomy added to Adverts (usually) required some programming in order to display the browsing by taxonomy correctly.

With the new class Adverts_Taxonomies all of the taxonomies assigned to “advert” Custom Post Type should be handled in the same way.

This means if you assign a new taxonomy to “advert” then display for the taxonomy archive should be handled automatically.

On top of that, the Adverts_Taxonomies registers auto-magic tax__* params in the [adverts_list] which allow filtering the list by taxonomy.

For example, if you have an “advert_location” taxonomy registered then you can list Ads assigned to this taxonomy by using [adverts_list] like this

[adverts_list tax__advert_location="100"]

where 100 is an ID of taxonomy term you want to filter by.

That is all for now!

The update will be available pretty soon, please do not get discouraged with the listed issues we will be here to help you.