Changeset 3181810
- Timestamp:
- 11/04/2024 09:49:32 PM (17 months ago)
- Location:
- cron-logger/trunk
- Files:
-
- 3 added
- 7 edited
-
README.txt (modified) (2 diffs)
-
classes/Ajax.php (added)
-
classes/Components/Component.php (modified) (2 diffs)
-
classes/Log.php (modified) (2 diffs)
-
classes/Page.php (modified) (3 diffs)
-
classes/Schedule.php (added)
-
plugin.php (modified) (3 diffs)
-
vendor/composer/autoload_real.php (modified) (1 diff)
-
vendor/composer/installed.php (modified) (2 diffs)
-
vendor/composer/platform_check.php (added)
Legend:
- Unmodified
- Added
- Removed
-
cron-logger/trunk/README.txt
r3067274 r3181810 4 4 Tags: tool, log, debug, cron, wp-cron 5 5 Requires at least: 5.3 6 Tested up to: 6. 5.07 Stable tag: 1. 2.28 Requires PHP: 8. 06 Tested up to: 6.6.2 7 Stable tag: 1.3.0 8 Requires PHP: 8.1 9 9 License: GPLv3 10 10 License URI: http://www.gnu.org/licenses/gpl … … 29 29 30 30 == Changelog == 31 32 = 1.3.0 33 * Feature: Database cleanup cron and cleanup button 34 * Feature: Automatically purge logs after 30 day. Can be modified via filter. 31 35 32 36 = 1.2.2 -
cron-logger/trunk/classes/Components/Component.php
r3067274 r3181810 3 3 4 4 namespace CronLogger\Components; 5 abstract class Component { 5 6 6 /**7 * Class Component8 *9 * @package Palasthotel\WordPress10 * @version 0.1.311 */12 abstract class Component {13 protected Plugin $plugin;14 7 15 /** 16 * _Component constructor. 17 */ 18 public function __construct(Plugin $plugin) { 19 $this->plugin = $plugin; 8 public function __construct( 9 public \CronLogger\Plugin $plugin 10 ) { 20 11 $this->onCreate(); 21 }22 23 public function getPlugin(): Plugin {24 return $this->plugin;25 12 } 26 13 … … 28 15 * overwrite this method in component implementations 29 16 */ 30 public function onCreate() {17 public function onCreate(): void { 31 18 // init your hooks and stuff 32 19 } -
cron-logger/trunk/classes/Log.php
r3067274 r3181810 11 11 public string $table; 12 12 13 public function init() {13 public function init(): void { 14 14 $this->table = $this->wpdb->prefix . Plugin::TABLE_LOGS; 15 15 } … … 121 121 function clean(): void { 122 122 $table = $this->table; 123 $days = apply_filters( Plugin::FILTER_EXPIRE, 14);123 $days = apply_filters( Plugin::FILTER_EXPIRE, 30 ); 124 124 $parentIds = "SELECT id FROM (" . 125 125 "SELECT id FROM " . $this->table . " WHERE " . -
cron-logger/trunk/classes/Page.php
r3067274 r3181810 20 20 const ARG_DURATION_MIN = "cron-logs-dm"; 21 21 22 public function onCreate() {22 public function onCreate(): void { 23 23 add_action( 'admin_menu', array( $this, 'menu_pages' ) ); 24 24 } 25 25 26 public function menu_pages() {26 public function menu_pages(): void { 27 27 add_submenu_page( 28 28 'tools.php', … … 99 99 </form> 100 100 101 <?php submit_button( __( 'Toggle open/close log details', Plugin::DOMAIN ), 'small', "toggle_logs" ); ?> 101 <div style="display: flex; gap: 25px;"> 102 <?php submit_button( __( 'Toggle open/close log details', Plugin::DOMAIN ), 'small', "toggle_logs" ); ?> 103 <p class="submit"><button class="button button-small button-link-delete" id="cron-logger-cleanup">Cleanup</button></p> 104 </div> 102 105 103 106 <table class="widefat striped"> … … 164 167 }); 165 168 }); 169 const cleanupButton = document.getElementById("cron-logger-cleanup"); 170 cleanupButton.addEventListener("click", function(e){ 171 e.preventDefault(); 172 cleanupButton.removeEventListener("click", this); 173 cleanupButton.innerHTML = "<span class='spinner is-active'></span>"; 174 fetch("/wp-admin/admin-ajax.php?action=cron_logger_cleanup") 175 .then(() => { 176 window.location.reload(); 177 }); 178 }) 166 179 </script> 167 180 <?php -
cron-logger/trunk/plugin.php
r3067274 r3181810 3 3 * Plugin Name: Cron Logger 4 4 * Description: Logs for wp-cron.php runs. 5 * Version: 1. 2.25 * Version: 1.3.0 6 6 * Requires at least: 5.3 7 * Tested up to: 6. 5.07 * Tested up to: 6.6.2 8 8 * Author: Palasthotel <rezeption@palasthotel.de> (Edward Bock) 9 9 * Author URI: https://palasthotel.de 10 10 * Domain Path: /languages 11 11 * Text Domain: cron-logger 12 * Requires PHP: 8. 012 * Requires PHP: 8.1 13 13 * @copyright Palasthotel 14 14 * @package Palasthotel\CronLogger … … 38 38 const OPTION_VERSION = "_cron_logger_version"; 39 39 40 const SCHEDULE = "cron_logger"; 41 40 42 public Timer $timer; 41 43 public Log $log; … … 52 54 53 55 $this->timer = new Timer(); 54 $this->log = new Log( $this);56 $this->log = new Log(); 55 57 new Updates( $this ); 56 58 new Services( $this ); 57 59 new Page( $this ); 60 new Schedule($this); 61 new Ajax($this); 58 62 } 59 63 -
cron-logger/trunk/vendor/composer/autoload_real.php
r2936889 r3181810 23 23 } 24 24 25 require __DIR__ . '/platform_check.php'; 26 25 27 spl_autoload_register(array('ComposerAutoloaderInit23ee4c2407e30847b3ca4c7f48c696a9', 'loadClassLoader'), true, true); 26 28 self::$loader = $loader = new \Composer\Autoload\ClassLoader(\dirname(__DIR__)); -
cron-logger/trunk/vendor/composer/installed.php
r3067274 r3181810 4 4 'pretty_version' => 'dev-master', 5 5 'version' => 'dev-master', 6 'reference' => ' fec4f5c6b21d3612292a1791bcf9061c8d56085a',6 'reference' => 'd2eac360b2fd360dbef067cd52f256f0d3b97d45', 7 7 'type' => 'library', 8 8 'install_path' => __DIR__ . '/../../', … … 14 14 'pretty_version' => 'dev-master', 15 15 'version' => 'dev-master', 16 'reference' => ' fec4f5c6b21d3612292a1791bcf9061c8d56085a',16 'reference' => 'd2eac360b2fd360dbef067cd52f256f0d3b97d45', 17 17 'type' => 'library', 18 18 'install_path' => __DIR__ . '/../../',
Note: See TracChangeset
for help on using the changeset viewer.