Download the PHP package doiftrue/wp-kama-cron without Composer

On this page you can find all versions of the php package doiftrue/wp-kama-cron. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package wp-kama-cron

A small class for easy adding WP Cron tasks (jobs).

This Class allow you to create WordPress Cron tasks in a quick and simple way. In order not to confuse anything, all tasks settings are specified in the first parameter when crating the class instance. The class takes care of all the routine for proper registration of Cron tasks and their intervals. The task handler (callback function) must already exist in PHP or need to be written separately!

Requirements

Examples

By default, the tasks are registered automatically (it works very fast) when you visit the admin panel OR at WP_CLI request OR at any cron request. If automatic registration is not needed, specify parameter auto_activate' => false and activate tasks manually using method activate(). See the example below.

INFO: You can call Kama_Cron at the earliest stage of loading WP, starting from the earliest muplugins_loaded hook.

IMPORTANT: The ``Kama_Cron'' code should also work in cron requests, because it registers the necessary WP hooks that will be executed during cron requests. In other words, you CANNOT register a cron job with this code and delete it.

Repeatable job

Use the known WP interval (hourly):

wpkama_core_data_check_update - it's an internal name of WP hook you don't need to use it anywhere in your code - just specify unique understandable name (I think it's a good idea to name it same as callback function).

Use the unknown WP interval (10 minutes):

In this case the class will parse the string 10 minutes and fill in the interval_sec and interval_desc parameters itself.

In interval_name you can specify the name in the following format: N (min|minutes|hour|day|month)s10 minutes, 2 hours, 5 days, 2 months, then the number will be taken to 'interval_sec' parameter. OR you can specify an existing WP interval: hourly, twicedaily, daily.

Single job

Single job (once):

Repeatable Single job (once at time):

Register more than one task at once:

Let's create 4 task with different intervals. Tasks are registered automatically (it works very fast) when you visit admin panel OR from CLI OR from Cron request.

Add following code anywhere, for example in functions.php OR in plugin.

Register tasks when activating the plugin

The code below shows how to activate and deactivate tasks customly - when activating/deactivating the plugin.

IMPORTANT: in this case the parameter auto_activate must be false: 'auto_activate' => false!

INFO: deactivate() method will deactivate all the jobs from current pack (in the example above these are two jobs).

--

Plugin page: https://wp-kama.com/1353/kama_cron


All versions of wp-kama-cron with dependencies

PHP Build Version
Package Version
Requires php Version >=7.1.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package doiftrue/wp-kama-cron contains the following files

Loading the files please wait ....