ASA2 Update 1.11 brings support for WP Cron API

Timo ASA 2 Pro, Updates Leave a Comment

This post is also available in: Deutsch (German)

WP Cron API

With version 1.11 ASA2 gets a new function to use the WP Cron API. With WP Cron time-controlled commands can be executed. This makes WP Cron an alternative for server-side cron jobs that are not available on every web server. ASA2 can now use the WP Cron system to automatically and regularly update products via the Amazon API.

Disadvantages to server-side cronjobs

The WP Cron API is based on page requests. This means that the configured WP Cron events can only be executed if there are frequent requests to your site. For example, if there is no request at night, the WP Cron events will not be executed.

The other drawback is that running a WP cron event on your website can have a negative effect on the page load time, as the job is run in the background. On older servers this can lead to short blockages, so that the page is only loaded when the cron is finished.

Therefore server-side cronjobs are always preferable to WP crons, especially if you are an ASA2 power user with over 1000 products in your Repo.

Setup WP Cron for ASA2 product update

For the configuration of the WP Crons I recommend the plugin WP Crontol. After installation you can set your own intervals in the “Settings / Cron Schedules” section. For example, to run a WP Cron every three minutes, you can create a new interval of 180 seconds:

In the section “Tools / Cron Events” you can create a new “PHP Cron Event” for the ASA2 Cron. The PHP function “asa2_repo_wp_cron_refresh”, which works with the same parameters as the server-side cron job (see list of all options), must be entered in the code text field.

For example, to update only products that were last updated more than twelve hours (43200 seconds) ago, the command should be like this:

asa2_repo_wp_cron_refresh(array(
    'lifetime' => 43200
));

For example, if you only want to set up a cron to update US products, you can do so using the “country_code” option:

asa2_repo_wp_cron_refresh(array(
    'lifetime' => 43200
    'country_code' => 'US'
));

Cronjob Calculator

Also on this page you can find the ASA2 Cronjob Calculator, with which you can find your optimal individual configuration for the ASA2 Product Update Cronjob.

Cronjob Logging

Furthermore, with version 1.11 there is a new logger option “Cronjob debug”, which writes an entry with detailed information into the ASA2 log for each execution of a WP cron or server-side cron job.

List of cronjob details in the ASA2 log:

More Details

More details and further examples for the installation of the ASA2 WP Crons can be found in the ASA2 Online Documentation.

 

Managed Templates

  1. For the managed templates that can display product features, there is now a new option to determine the maximum text length of each feature. This allows better control over the layout of product boxes.
  2. The template option “Custom CSS” did not work as expected. This was fixed with version 1.11. With this option, which you can find at the end of the template options, you can save your own CSS adjustments for each template included in ASA2.
  3. If a maximum length was defined for the product description, the three points were no longer displayed at the position where the text was truncated. This works again with version 1.11.
  4. For the template “Sortable_table_2” the script used for the table representation has been updated.
  5. Fixed a rare PHP memory limit problem when rendering templates.

 

Get ASA2 (Amazon Simple Affiliate Pro)
Timo

This post is also available in: Deutsch (German)

Subscribe
Notify of
guest

0 Comments
Inline Feedbacks
View all comments