| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin Name: Cron Logger |
| 4 |
* Description: Logs for wp-cron.php runs. |
| 5 |
* Version: 1.3.4 |
| 6 |
* Requires at least: 5.3 |
| 7 |
* Tested up to: 6.8.2 |
| 8 |
* Author: Palasthotel <rezeption@palasthotel.de> (Edward Bock) |
| 9 |
* Author URI: https://palasthotel.de |
| 10 |
* Domain Path: /languages |
| 11 |
* Text Domain: cron-logger |
| 12 |
* Requires PHP: 8.1 |
| 13 |
* @copyright Palasthotel |
| 14 |
* @package Palasthotel\CronLogger |
| 15 |
*/ |
| 16 |
|
| 17 |
namespace CronLogger; |
| 18 |
|
| 19 |
require_once dirname( __FILE__ ) . "/vendor/autoload.php"; |
| 20 |
|
| 21 |
class Plugin extends Components\Plugin { |
| 22 |
|
| 23 |
/** |
| 24 |
* --------------------------------------------- |
| 25 |
* constants |
| 26 |
* --------------------------------------------- |
| 27 |
*/ |
| 28 |
const DOMAIN = "cron-logger"; |
| 29 |
|
| 30 |
const ACTION_INIT = "cron_logger_init"; |
| 31 |
|
| 32 |
const ACTION_WP_CRON_START = "cron_logger_wp_cron_start"; |
| 33 |
const ACTION_WP_CRON_FINISH = "cron_logger_wp_cron_shutdown"; |
| 34 |
|
| 35 |
const FILTER_EXPIRE = "cron_logger_expire"; |
| 36 |
|
| 37 |
const TABLE_LOGS = "cron_logs"; |
| 38 |
const OPTION_VERSION = "_cron_logger_version"; |
| 39 |
|
| 40 |
const SCHEDULE = "cron_logger"; |
| 41 |
|
| 42 |
public Timer $timer; |
| 43 |
public Log $log; |
| 44 |
|
| 45 |
/** |
| 46 |
* Plugin constructor |
| 47 |
*/ |
| 48 |
function onCreate(): void { |
| 49 |
|
| 50 |
$this->loadTextdomain( |
| 51 |
Plugin::DOMAIN, |
| 52 |
"languages" |
| 53 |
); |
| 54 |
|
| 55 |
$this->timer = new Timer(); |
| 56 |
$this->log = new Log(); |
| 57 |
new Updates( $this ); |
| 58 |
new Services( $this ); |
| 59 |
new Page( $this ); |
| 60 |
new Schedule($this); |
| 61 |
new Ajax($this); |
| 62 |
} |
| 63 |
|
| 64 |
/** |
| 65 |
* on activation |
| 66 |
*/ |
| 67 |
function onSiteActivation(): void { |
| 68 |
$this->log->createTables(); |
| 69 |
} |
| 70 |
} |
| 71 |
|
| 72 |
Plugin::instance(); |
| 73 |
|