Changeset 3303554
- Timestamp:
- 05/30/2025 11:57:13 AM (10 months ago)
- Location:
- storecontrl-wp-connection/trunk
- Files:
-
- 4 edited
-
includes/admin/class-storecontrl-wp-connection-admin.php (modified) (1 diff)
-
includes/cronjob/class-storecontrl-cronjob-functions.php (modified) (1 diff)
-
readme.txt (modified) (2 diffs)
-
storecontrl-wp-connection.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
storecontrl-wp-connection/trunk/includes/admin/class-storecontrl-wp-connection-admin.php
r3275641 r3303554 12 12 add_filter('cron_schedules', array( $this, 'storecontrl_connect_cron_schedules') ); 13 13 add_action('admin_post_download_log', array($this, 'handle_log_download_request')); 14 15 add_action( 'init', array($this, 'sc_renew_crontrol_url_crons') ); 16 } 17 18 function sc_renew_crontrol_url_crons() { 19 // Check of WP Crontrol's functie beschikbaar is 20 if ( ! function_exists( 'wp_schedule_event' ) || ! function_exists( 'get_option' ) ) { 21 return; 22 } 23 24 // Alleen uitvoeren als WP Crontrol geactiveerd is 25 if ( ! defined( 'WP_CRONTROL_VERSION' ) ) { 26 return; 27 } 28 29 $target_urls = [ 30 site_url().'/storecontrl-process-stockchanges', 31 site_url().'/storecontrl-process-changes', 32 site_url().'/storecontrl-process-products', 33 ]; 34 35 $cron_array = _get_cron_array(); 36 $existing = []; 37 38 // Zoek bestaande crontrol_url_cron_job entries 39 foreach ( $cron_array as $timestamp => $crons ) { 40 foreach ( $crons as $hook => $jobs ) { 41 if ( $hook === 'crontrol_url_cron_job' ) { 42 foreach ( $jobs as $job ) { 43 if ( isset( $job['args'][0] ) ) { 44 $existing[] = $job['args'][0]; 45 } 46 } 47 } 48 } 49 } 50 51 // Voeg ontbrekende URL's toe (interval: every 5 minutes) 52 foreach ( $target_urls as $url ) { 53 if ( ! in_array( $url, $existing, true ) ) { 54 wp_schedule_event( time(), 'storecontrl_connect', 'crontrol_url_cron_job', [ $url ] ); 55 error_log( '[CRON HERSTEL] Toegevoegd: ' . $url ); 56 } 57 } 14 58 } 15 59 -
storecontrl-wp-connection/trunk/includes/cronjob/class-storecontrl-cronjob-functions.php
r3275641 r3303554 898 898 print_r($changes); 899 899 echo '</pre>'; 900 901 $api_calls = array();902 foreach ($changes as $change) {903 $api_calls[] = $change['api_name'];904 }905 900 if( isset($changes) && !empty($changes) ) { 906 901 -
storecontrl-wp-connection/trunk/readme.txt
r3275641 r3303554 5 5 Requires at least: 6.0.0 6 6 Tested up to: 6.7.2 7 Stable tag: 4.1. 57 Stable tag: 4.1.6 8 8 Requires PHP: 7.4 9 9 License: GPLv2 or later … … 93 93 == Changelog == 94 94 95 = 4.1.6 = 96 * Auto renew fallback for WP Crontrol 97 95 98 = 4.1.5 = 96 99 * Queue check for empty batch files -
storecontrl-wp-connection/trunk/storecontrl-wp-connection.php
r3275641 r3303554 4 4 Plugin URI: http://www.arture.nl/storecontrl 5 5 Description: The Wordpress plugin for connecting Woocommerce with StoreContrl Cloud. With the synchronizing cronjobs your products will be automatically processed, images added, and the categories set. Every 5 minutes all stock changes are processed. We provide a up-to-date plugin, easy setup and always the best support. 6 Version: 4.1. 56 Version: 4.1.6 7 7 Requires Plugins: woocommerce 8 8 Author: Arture
Note: See TracChangeset
for help on using the changeset viewer.