Changeset 3462630
- Timestamp:
- 02/16/2026 03:16:59 PM (4 days ago)
- Location:
- jne-shipping-official
- Files:
-
- 9 edited
- 38 copied
-
tags/1.8.0 (copied) (copied from jne-shipping-official/trunk)
-
tags/1.8.0/LICENSE.txt (copied) (copied from jne-shipping-official/trunk/LICENSE.txt)
-
tags/1.8.0/admin (copied) (copied from jne-shipping-official/trunk/admin)
-
tags/1.8.0/admin/class-jne-woocommerce-admin.php (copied) (copied from jne-shipping-official/trunk/admin/class-jne-woocommerce-admin.php)
-
tags/1.8.0/admin/includes/class-jne-admin-dashboard.php (copied) (copied from jne-shipping-official/trunk/admin/includes/class-jne-admin-dashboard.php)
-
tags/1.8.0/admin/includes/class-jne-admin-generate-awb.php (copied) (copied from jne-shipping-official/trunk/admin/includes/class-jne-admin-generate-awb.php)
-
tags/1.8.0/admin/includes/class-jne-admin-generate-cnote.php (copied) (copied from jne-shipping-official/trunk/admin/includes/class-jne-admin-generate-cnote.php)
-
tags/1.8.0/admin/includes/class-jne-admin-order-helper.php (copied) (copied from jne-shipping-official/trunk/admin/includes/class-jne-admin-order-helper.php)
-
tags/1.8.0/admin/includes/class-jne-admin-order-list.php (copied) (copied from jne-shipping-official/trunk/admin/includes/class-jne-admin-order-list.php)
-
tags/1.8.0/admin/includes/class-jne-admin-shipping-cost-adjustment.php (copied) (copied from jne-shipping-official/trunk/admin/includes/class-jne-admin-shipping-cost-adjustment.php)
-
tags/1.8.0/admin/includes/class-jne-admin-shipping-method.php (copied) (copied from jne-shipping-official/trunk/admin/includes/class-jne-admin-shipping-method.php)
-
tags/1.8.0/admin/includes/class-jne-admin-store-helper.php (copied) (copied from jne-shipping-official/trunk/admin/includes/class-jne-admin-store-helper.php)
-
tags/1.8.0/admin/includes/class-jne-weight-helper.php (copied) (copied from jne-shipping-official/trunk/admin/includes/class-jne-weight-helper.php)
-
tags/1.8.0/admin/partials/jne-woocommerce-admin-dashboard-display.php (copied) (copied from jne-shipping-official/trunk/admin/partials/jne-woocommerce-admin-dashboard-display.php)
-
tags/1.8.0/admin/partials/jne-woocommerce-admin-setting-display.php (copied) (copied from jne-shipping-official/trunk/admin/partials/jne-woocommerce-admin-setting-display.php)
-
tags/1.8.0/admin/partials/jne-woocommerce-admin-shipping-cost-adjustments-display.php (copied) (copied from jne-shipping-official/trunk/admin/partials/jne-woocommerce-admin-shipping-cost-adjustments-display.php)
-
tags/1.8.0/admin/partials/jne-woocommerce-admin-support-display.php (copied) (copied from jne-shipping-official/trunk/admin/partials/jne-woocommerce-admin-support-display.php)
-
tags/1.8.0/admin/partials/jne-woocommerce-admin-webhook-logs-display.php (copied) (copied from jne-shipping-official/trunk/admin/partials/jne-woocommerce-admin-webhook-logs-display.php)
-
tags/1.8.0/assets (copied) (copied from jne-shipping-official/trunk/assets)
-
tags/1.8.0/composer.json (copied) (copied from jne-shipping-official/trunk/composer.json) (1 diff)
-
tags/1.8.0/composer.lock (copied) (copied from jne-shipping-official/trunk/composer.lock)
-
tags/1.8.0/includes (copied) (copied from jne-shipping-official/trunk/includes)
-
tags/1.8.0/includes/class-jne-woocommerce-activator.php (modified) (1 diff)
-
tags/1.8.0/includes/class-jne-woocommerce-api.php (copied) (copied from jne-shipping-official/trunk/includes/class-jne-woocommerce-api.php)
-
tags/1.8.0/includes/class-jne-woocommerce-deactivator.php (modified) (1 diff)
-
tags/1.8.0/includes/class-jne-woocommerce-webhook-logger.php (copied) (copied from jne-shipping-official/trunk/includes/class-jne-woocommerce-webhook-logger.php) (1 diff)
-
tags/1.8.0/includes/class-jne-woocommerce-webhook.php (copied) (copied from jne-shipping-official/trunk/includes/class-jne-woocommerce-webhook.php)
-
tags/1.8.0/includes/class-jne-woocommerce.php (copied) (copied from jne-shipping-official/trunk/includes/class-jne-woocommerce.php) (1 diff)
-
tags/1.8.0/index.php (copied) (copied from jne-shipping-official/trunk/index.php)
-
tags/1.8.0/jne-shipping-official.php (copied) (copied from jne-shipping-official/trunk/jne-shipping-official.php) (2 diffs)
-
tags/1.8.0/languages (copied) (copied from jne-shipping-official/trunk/languages)
-
tags/1.8.0/public (copied) (copied from jne-shipping-official/trunk/public)
-
tags/1.8.0/public/class-jne-woocommerce-public.php (copied) (copied from jne-shipping-official/trunk/public/class-jne-woocommerce-public.php)
-
tags/1.8.0/public/includes/jne-woocommerce-public-checkout-validation.php (copied) (copied from jne-shipping-official/trunk/public/includes/jne-woocommerce-public-checkout-validation.php)
-
tags/1.8.0/public/includes/jne-woocommerce-public-cod.php (copied) (copied from jne-shipping-official/trunk/public/includes/jne-woocommerce-public-cod.php)
-
tags/1.8.0/public/includes/jne-woocommerce-public-insurance.php (copied) (copied from jne-shipping-official/trunk/public/includes/jne-woocommerce-public-insurance.php)
-
tags/1.8.0/public/includes/jne-woocommerce-public-shipping-cost-adjustment.php (copied) (copied from jne-shipping-official/trunk/public/includes/jne-woocommerce-public-shipping-cost-adjustment.php)
-
tags/1.8.0/readme.txt (copied) (copied from jne-shipping-official/trunk/readme.txt) (2 diffs)
-
tags/1.8.0/uninstall.php (copied) (copied from jne-shipping-official/trunk/uninstall.php)
-
tags/1.8.0/vendor (copied) (copied from jne-shipping-official/trunk/vendor)
-
trunk/composer.json (modified) (1 diff)
-
trunk/includes/class-jne-woocommerce-activator.php (modified) (1 diff)
-
trunk/includes/class-jne-woocommerce-deactivator.php (modified) (1 diff)
-
trunk/includes/class-jne-woocommerce-webhook-logger.php (modified) (1 diff)
-
trunk/includes/class-jne-woocommerce.php (modified) (1 diff)
-
trunk/jne-shipping-official.php (modified) (2 diffs)
-
trunk/readme.txt (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
jne-shipping-official/tags/1.8.0/composer.json
r3462262 r3462630 2 2 "name": "jne-shipping/jne-shipping-official", 3 3 "description": "WordPress plugin integrated with WooCommerce for JNE shipping services", 4 "version": "1. 7.1",4 "version": "1.8.0", 5 5 "type": "wordpress-plugin", 6 6 "license": "GPL-2.0+", -
jne-shipping-official/tags/1.8.0/includes/class-jne-woocommerce-activator.php
r3387194 r3462630 39 39 add_option('jneshof_shipping_indonesia_version', '1.0.0'); 40 40 41 // Schedule cron job to clear old webhook logs daily 42 if (!wp_next_scheduled('jneshof_clear_old_webhook_logs')) { 43 wp_schedule_event(time(), 'daily', 'jneshof_clear_old_webhook_logs'); 44 } 45 41 46 flush_rewrite_rules(); 42 47 } -
jne-shipping-official/tags/1.8.0/includes/class-jne-woocommerce-deactivator.php
r3387194 r3462630 44 44 } 45 45 46 // Clear scheduled cron job for webhook log cleanup 47 wp_clear_scheduled_hook('jneshof_clear_old_webhook_logs'); 48 46 49 delete_option('jneshof_shipping_indonesia_version'); 47 50 delete_option(JNESHOF_OPTION_ACCESS_KEY); -
jne-shipping-official/tags/1.8.0/includes/class-jne-woocommerce-webhook-logger.php
r3399074 r3462630 163 163 164 164 /** 165 * Clear logs older than specified days 166 * 167 * @param int $days Number of days to keep (default: 30) 168 * @return int Number of logs deleted 169 */ 170 public function clear_old_logs($days = 30) 171 { 172 $logs = $this->get_logs(0); // Get all logs 173 $original_count = count($logs); 174 175 if (empty($logs)) { 176 return 0; 177 } 178 179 // Calculate cutoff timestamp (current time - specified days) 180 $cutoff_timestamp = current_time('timestamp') - ($days * 24 * 60 * 60); 181 182 // Filter logs that are newer than cutoff timestamp 183 $logs = array_filter($logs, function ($log) use ($cutoff_timestamp) { 184 // Keep logs that have timestamp_unix and are newer than cutoff 185 if (isset($log['timestamp_unix']) && is_numeric($log['timestamp_unix'])) { 186 return $log['timestamp_unix'] >= $cutoff_timestamp; 187 } 188 // If timestamp_unix is missing, try to use timestamp string 189 if (isset($log['timestamp']) && !empty($log['timestamp'])) { 190 $log_timestamp = strtotime($log['timestamp']); 191 return $log_timestamp >= $cutoff_timestamp; 192 } 193 // If no timestamp found, keep the log (shouldn't happen, but safer) 194 return true; 195 }); 196 197 $logs = array_values($logs); // Re-index array 198 $deleted_count = $original_count - count($logs); 199 200 // Update option with filtered logs 201 if ($deleted_count > 0) { 202 update_option(self::OPTION_KEY, $logs, false); 203 } 204 205 return $deleted_count; 206 } 207 208 /** 209 * Cron callback to clear old logs 210 * This method is called by WordPress cron 211 * 212 * @return void 213 */ 214 public static function cron_clear_old_logs() 215 { 216 $logger = self::get_instance(); 217 $deleted_count = $logger->clear_old_logs(30); // Clear logs older than 30 days (1 month) 218 219 // Optional: Log the cleanup action (for debugging) 220 if (defined('WP_DEBUG') && WP_DEBUG) { 221 error_log(sprintf('[JNE Shipping] Auto-cleared %d webhook logs older than 30 days', $deleted_count)); 222 } 223 } 224 225 /** 165 226 * Get client IP address 166 227 * -
jne-shipping-official/tags/1.8.0/includes/class-jne-woocommerce.php
r3399074 r3462630 189 189 $this->loader->add_action( 'rest_api_init', $webhook_handler, 'register_routes' ); 190 190 191 // Register cron hook for clearing old webhook logs 192 // Use direct WordPress add_action for static method callback 193 add_action( 'jneshof_clear_old_webhook_logs', array( 'Jneshof_Woocommerce_Webhook_Logger', 'cron_clear_old_logs' ) ); 194 191 195 } 192 196 -
jne-shipping-official/tags/1.8.0/jne-shipping-official.php
r3462262 r3462630 20 20 * Plugin Name: JNE Shipping Official 21 21 * Description: WordPress plugin integrated with WooCommerce for JNE shipping services 22 * Version: 1. 7.122 * Version: 1.8.0 23 23 * Author: PT. Tiki Jalur Nugraha Ekakurir 24 24 * Author URI: https://jne.co.id/ … … 48 48 * Rename this for your plugin and update it as you release new versions. 49 49 */ 50 define('JNESHOF_PLUGIN_VERSION', '1. 7.1');50 define('JNESHOF_PLUGIN_VERSION', '1.8.0'); 51 51 52 52 /** -
jne-shipping-official/tags/1.8.0/readme.txt
r3462262 r3462630 6 6 Tested up to: 6.9 7 7 Requires PHP: 7.4 8 Stable tag: 1. 7.18 Stable tag: 1.8.0 9 9 License: GPL-2.0+ 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 90 90 91 91 == Changelog == 92 93 = 1.8.0 = 94 * Added: Auto-clear webhook logs feature - Webhook logs older than 1 month are automatically deleted daily via WordPress cron job 95 * Improved: Webhook log management with automatic cleanup to prevent database bloat 92 96 93 97 = 1.7.1 = -
jne-shipping-official/trunk/composer.json
r3462262 r3462630 2 2 "name": "jne-shipping/jne-shipping-official", 3 3 "description": "WordPress plugin integrated with WooCommerce for JNE shipping services", 4 "version": "1. 7.1",4 "version": "1.8.0", 5 5 "type": "wordpress-plugin", 6 6 "license": "GPL-2.0+", -
jne-shipping-official/trunk/includes/class-jne-woocommerce-activator.php
r3387194 r3462630 39 39 add_option('jneshof_shipping_indonesia_version', '1.0.0'); 40 40 41 // Schedule cron job to clear old webhook logs daily 42 if (!wp_next_scheduled('jneshof_clear_old_webhook_logs')) { 43 wp_schedule_event(time(), 'daily', 'jneshof_clear_old_webhook_logs'); 44 } 45 41 46 flush_rewrite_rules(); 42 47 } -
jne-shipping-official/trunk/includes/class-jne-woocommerce-deactivator.php
r3387194 r3462630 44 44 } 45 45 46 // Clear scheduled cron job for webhook log cleanup 47 wp_clear_scheduled_hook('jneshof_clear_old_webhook_logs'); 48 46 49 delete_option('jneshof_shipping_indonesia_version'); 47 50 delete_option(JNESHOF_OPTION_ACCESS_KEY); -
jne-shipping-official/trunk/includes/class-jne-woocommerce-webhook-logger.php
r3399074 r3462630 163 163 164 164 /** 165 * Clear logs older than specified days 166 * 167 * @param int $days Number of days to keep (default: 30) 168 * @return int Number of logs deleted 169 */ 170 public function clear_old_logs($days = 30) 171 { 172 $logs = $this->get_logs(0); // Get all logs 173 $original_count = count($logs); 174 175 if (empty($logs)) { 176 return 0; 177 } 178 179 // Calculate cutoff timestamp (current time - specified days) 180 $cutoff_timestamp = current_time('timestamp') - ($days * 24 * 60 * 60); 181 182 // Filter logs that are newer than cutoff timestamp 183 $logs = array_filter($logs, function ($log) use ($cutoff_timestamp) { 184 // Keep logs that have timestamp_unix and are newer than cutoff 185 if (isset($log['timestamp_unix']) && is_numeric($log['timestamp_unix'])) { 186 return $log['timestamp_unix'] >= $cutoff_timestamp; 187 } 188 // If timestamp_unix is missing, try to use timestamp string 189 if (isset($log['timestamp']) && !empty($log['timestamp'])) { 190 $log_timestamp = strtotime($log['timestamp']); 191 return $log_timestamp >= $cutoff_timestamp; 192 } 193 // If no timestamp found, keep the log (shouldn't happen, but safer) 194 return true; 195 }); 196 197 $logs = array_values($logs); // Re-index array 198 $deleted_count = $original_count - count($logs); 199 200 // Update option with filtered logs 201 if ($deleted_count > 0) { 202 update_option(self::OPTION_KEY, $logs, false); 203 } 204 205 return $deleted_count; 206 } 207 208 /** 209 * Cron callback to clear old logs 210 * This method is called by WordPress cron 211 * 212 * @return void 213 */ 214 public static function cron_clear_old_logs() 215 { 216 $logger = self::get_instance(); 217 $deleted_count = $logger->clear_old_logs(30); // Clear logs older than 30 days (1 month) 218 219 // Optional: Log the cleanup action (for debugging) 220 if (defined('WP_DEBUG') && WP_DEBUG) { 221 error_log(sprintf('[JNE Shipping] Auto-cleared %d webhook logs older than 30 days', $deleted_count)); 222 } 223 } 224 225 /** 165 226 * Get client IP address 166 227 * -
jne-shipping-official/trunk/includes/class-jne-woocommerce.php
r3399074 r3462630 189 189 $this->loader->add_action( 'rest_api_init', $webhook_handler, 'register_routes' ); 190 190 191 // Register cron hook for clearing old webhook logs 192 // Use direct WordPress add_action for static method callback 193 add_action( 'jneshof_clear_old_webhook_logs', array( 'Jneshof_Woocommerce_Webhook_Logger', 'cron_clear_old_logs' ) ); 194 191 195 } 192 196 -
jne-shipping-official/trunk/jne-shipping-official.php
r3462262 r3462630 20 20 * Plugin Name: JNE Shipping Official 21 21 * Description: WordPress plugin integrated with WooCommerce for JNE shipping services 22 * Version: 1. 7.122 * Version: 1.8.0 23 23 * Author: PT. Tiki Jalur Nugraha Ekakurir 24 24 * Author URI: https://jne.co.id/ … … 48 48 * Rename this for your plugin and update it as you release new versions. 49 49 */ 50 define('JNESHOF_PLUGIN_VERSION', '1. 7.1');50 define('JNESHOF_PLUGIN_VERSION', '1.8.0'); 51 51 52 52 /** -
jne-shipping-official/trunk/readme.txt
r3462262 r3462630 6 6 Tested up to: 6.9 7 7 Requires PHP: 7.4 8 Stable tag: 1. 7.18 Stable tag: 1.8.0 9 9 License: GPL-2.0+ 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.txt … … 90 90 91 91 == Changelog == 92 93 = 1.8.0 = 94 * Added: Auto-clear webhook logs feature - Webhook logs older than 1 month are automatically deleted daily via WordPress cron job 95 * Improved: Webhook log management with automatic cleanup to prevent database bloat 92 96 93 97 = 1.7.1 =
Note: See TracChangeset
for help on using the changeset viewer.