Changeset 3452434
- Timestamp:
- 02/02/2026 10:29:02 PM (2 weeks ago)
- Location:
- shift8-real-estate-listings-for-treb/trunk
- Files:
-
- 4 edited
-
admin/class-shift8-treb-admin.php (modified) (1 diff)
-
includes/class-shift8-treb-sync-service.php (modified) (2 diffs)
-
readme.txt (modified) (2 diffs)
-
shift8-treb.php (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
shift8-real-estate-listings-for-treb/trunk/admin/class-shift8-treb-admin.php
r3385519 r3452434 397 397 // Get the main plugin instance and trigger sync 398 398 $plugin = Shift8_TREB::get_instance(); 399 $plugin->sync_listings_cron( );399 $plugin->sync_listings_cron(true); 400 400 401 401 shift8_treb_log('=== MANUAL SYNC COMPLETED ===', array(), 'info'); -
shift8-real-estate-listings-for-treb/trunk/includes/class-shift8-treb-sync-service.php
r3387235 r3452434 164 164 } 165 165 166 $current_timestamp = current_time('c'); // ISO 8601 format 167 166 168 if (empty($listings)) { 169 if (!$dry_run) { 170 update_option('shift8_treb_last_sync', $current_timestamp); 171 } 172 167 173 $results['message'] = 'No listings returned from API'; 168 174 shift8_treb_log('No listings returned from AMPRE API', array( 169 175 'settings' => array( 170 176 'listing_age_days' => $this->settings['listing_age_days'] ?? 30, 171 'last_sync_timestamp' => $this->settings['last_sync_timestamp'] ?? 'none' 177 'last_sync_timestamp' => $this->settings['last_sync_timestamp'] ?? 'none', 178 'last_sync_updated' => !$dry_run 172 179 ) 173 180 )); … … 282 289 // Update last sync timestamp (only if not dry run) 283 290 if (!$dry_run) { 284 $current_timestamp = current_time('c'); // ISO 8601 format285 291 update_option('shift8_treb_last_sync', $current_timestamp); 286 292 } -
shift8-real-estate-listings-for-treb/trunk/readme.txt
r3440414 r3452434 5 5 Tested up to: 6.8 6 6 Requires PHP: 7.4 7 Stable tag: 1.7. 37 Stable tag: 1.7.4 8 8 License: GPLv3 or later 9 9 License URI: https://www.gnu.org/licenses/gpl-3.0.html … … 132 132 133 133 == Changelog == 134 135 = 1.7.4 = 136 * Fix: "Last sync" timestamp now updates even when API returns zero listings (manual/cron) 137 * Tests: added coverage to ensure last sync updates on empty results and not on dry-run 134 138 135 139 = 1.7.3 = -
shift8-real-estate-listings-for-treb/trunk/shift8-treb.php
r3437057 r3452434 4 4 * Plugin URI: https://github.com/stardothosting/shift8-treb 5 5 * Description: Integrates Toronto Real Estate Board (TREB) listings via AMPRE API, automatically importing property listings into WordPress. Replaces the Python script with native WordPress functionality. 6 * Version: 1.7. 36 * Version: 1.7.4 7 7 * Author: Shift8 Web 8 8 * Author URI: https://shift8web.ca … … 22 22 23 23 // Plugin constants 24 define('SHIFT8_TREB_VERSION', '1.7. 3');24 define('SHIFT8_TREB_VERSION', '1.7.4'); 25 25 define('SHIFT8_TREB_PLUGIN_FILE', __FILE__); 26 26 define('SHIFT8_TREB_PLUGIN_DIR', plugin_dir_path(__FILE__)); … … 513 513 * @since 1.0.0 514 514 */ 515 public function sync_listings_cron( ) {515 public function sync_listings_cron($skip_lock = false) { 516 516 // Check if sync is already running (prevent simultaneous syncs) 517 $sync_lock = get_transient('shift8_treb_sync_lock'); 518 if ($sync_lock) { 519 shift8_treb_log('Sync already running, skipping cron execution', array( 520 'lock_time' => $sync_lock, 521 'current_time' => time() 522 )); 523 return; 517 if (!$skip_lock) { 518 $sync_lock = get_transient('shift8_treb_sync_lock'); 519 if ($sync_lock) { 520 shift8_treb_log('Sync already running, skipping cron execution', array( 521 'lock_time' => $sync_lock, 522 'current_time' => time() 523 )); 524 return; 525 } 524 526 } 525 527
Note: See TracChangeset
for help on using the changeset viewer.