Plugin Directory

Changeset 3452434


Ignore:
Timestamp:
02/02/2026 10:29:02 PM (2 weeks ago)
Author:
shift8
Message:

Fixed minor UI bug

Location:
shift8-real-estate-listings-for-treb/trunk
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • shift8-real-estate-listings-for-treb/trunk/admin/class-shift8-treb-admin.php

    r3385519 r3452434  
    397397            // Get the main plugin instance and trigger sync
    398398            $plugin = Shift8_TREB::get_instance();
    399             $plugin->sync_listings_cron();
     399            $plugin->sync_listings_cron(true);
    400400           
    401401            shift8_treb_log('=== MANUAL SYNC COMPLETED ===', array(), 'info');
  • shift8-real-estate-listings-for-treb/trunk/includes/class-shift8-treb-sync-service.php

    r3387235 r3452434  
    164164            }
    165165
     166            $current_timestamp = current_time('c'); // ISO 8601 format
     167
    166168            if (empty($listings)) {
     169                if (!$dry_run) {
     170                    update_option('shift8_treb_last_sync', $current_timestamp);
     171                }
     172
    167173                $results['message'] = 'No listings returned from API';
    168174                shift8_treb_log('No listings returned from AMPRE API', array(
    169175                    'settings' => array(
    170176                        '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
    172179                    )
    173180                ));
     
    282289            // Update last sync timestamp (only if not dry run)
    283290            if (!$dry_run) {
    284                 $current_timestamp = current_time('c'); // ISO 8601 format
    285291                update_option('shift8_treb_last_sync', $current_timestamp);
    286292            }
  • shift8-real-estate-listings-for-treb/trunk/readme.txt

    r3440414 r3452434  
    55Tested up to: 6.8
    66Requires PHP: 7.4
    7 Stable tag: 1.7.3
     7Stable tag: 1.7.4
    88License: GPLv3 or later
    99License URI: https://www.gnu.org/licenses/gpl-3.0.html
     
    132132
    133133== 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
    134138
    135139= 1.7.3 =
  • shift8-real-estate-listings-for-treb/trunk/shift8-treb.php

    r3437057 r3452434  
    44 * Plugin URI: https://github.com/stardothosting/shift8-treb
    55 * 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.3
     6 * Version: 1.7.4
    77 * Author: Shift8 Web
    88 * Author URI: https://shift8web.ca
     
    2222
    2323// Plugin constants
    24 define('SHIFT8_TREB_VERSION', '1.7.3');
     24define('SHIFT8_TREB_VERSION', '1.7.4');
    2525define('SHIFT8_TREB_PLUGIN_FILE', __FILE__);
    2626define('SHIFT8_TREB_PLUGIN_DIR', plugin_dir_path(__FILE__));
     
    513513     * @since 1.0.0
    514514     */
    515     public function sync_listings_cron() {
     515    public function sync_listings_cron($skip_lock = false) {
    516516        // 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            }
    524526        }
    525527       
Note: See TracChangeset for help on using the changeset viewer.