Plugin Directory

Changeset 3468460


Ignore:
Timestamp:
02/24/2026 09:41:59 AM (5 weeks ago)
Author:
purposego
Message:

Release 2.0.22

Location:
clearpost-simple-ai-auto-post
Files:
8 edited
1 copied

Legend:

Unmodified
Added
Removed
  • clearpost-simple-ai-auto-post/tags/2.0.22/assets/js/dashboard.js

    r3468416 r3468460  
    1313  let calendarVariant = 'locked';
    1414  let trialDayLimit = 7;
     15  let totalPlannedCount = 0; // Total planned posts across all months (from backend)
    1516
    1617  // Setup loader state
     
    158159        if (response.success && response.data.items && response.data.items.length > 0) {
    159160          // Calendar items exist! Hide loader and show calendar
    160           onSetupComplete(response.data.items);
     161          onSetupComplete(response.data);
    161162        }
    162163        // If no items yet, keep polling
     
    171172   * Handle setup completion - hide loader, show calendar, update status.
    172173   */
    173   function onSetupComplete(items) {
     174  function onSetupComplete(data) {
     175    var items = data.items || [];
     176
    174177    // Stop polling and status cycling
    175178    if (setupPollingInterval) {
     
    202205    // Store the items and render calendar
    203206    calendarData = items;
     207    // Update total planned count (all planned items across all months)
     208    if (typeof data.total_planned_count !== 'undefined') {
     209      totalPlannedCount = data.total_planned_count;
     210    }
    204211    currentMonth = new Date();
    205212    renderCalendar();
    206213
    207     // Update scheduled count (after calendarData is set)
     214    // Update scheduled count (after totalPlannedCount is set)
    208215    updateScheduledCount();
    209216
     
    458465   * Update the "Posts Scheduled" metric count.
    459466   *
    460    * Counts planned calendar items (not yet generated) and updates the metric display.
    461    * Called after calendar data is loaded to ensure the count reflects actual scheduled items.
     467   * Uses totalPlannedCount from the backend (all planned items across all months,
     468   * not just the current month view).
    462469   */
    463470  function updateScheduledCount() {
    464     // Count planned items (items that are scheduled but not yet generated)
    465     var plannedCount = 0;
    466     if (calendarData && calendarData.length) {
    467       calendarData.forEach(function(item) {
    468         if (item.status === 'planned') {
    469           plannedCount++;
    470         }
    471       });
    472     }
    473 
    474471    // Update the "Posts Scheduled" metric card value
    475472    var $metricCards = $('.saiap-metric-card');
     
    478475      var labelText = $card.find('.saiap-metric-card__label').text().toLowerCase();
    479476      if (labelText.indexOf('scheduled') !== -1) {
    480         $card.find('.saiap-metric-card__value').text(plannedCount);
     477        $card.find('.saiap-metric-card__value').text(totalPlannedCount);
    481478      }
    482479    });
     
    631628        if (response.success) {
    632629          calendarData = response.data.items || [];
     630          // Update total planned count (all planned items across all months)
     631          if (typeof response.data.total_planned_count !== 'undefined') {
     632            totalPlannedCount = response.data.total_planned_count;
     633          }
    633634          renderCalendar();
    634635          updateScheduledCount();
     
    891892          // Update calendar data and re-render
    892893          calendarData = data.items || [];
     894          // Update total planned count (all planned items across all months)
     895          if (typeof data.total_planned_count !== 'undefined') {
     896            totalPlannedCount = data.total_planned_count;
     897          }
    893898          currentMonth = new Date();
    894899          renderCalendar();
  • clearpost-simple-ai-auto-post/tags/2.0.22/includes/dashboard.php

    r3468416 r3468460  
    12061206        set_transient( 'saiap_calendar_items_count', count( $body['items'] ), HOUR_IN_SECONDS );
    12071207
    1208         // Count planned items (scheduled but not yet generated).
    1209         $planned_count = 0;
    1210         foreach ( $body['items'] as $item ) {
    1211             if ( isset( $item['status'] ) && 'planned' === $item['status'] ) {
    1212                 ++$planned_count;
    1213             }
    1214         }
    1215         set_transient( 'saiap_planned_calendar_items_count', $planned_count, HOUR_IN_SECONDS );
     1208        // Use backend-provided total planned count (all planned items, not filtered by date).
     1209        if ( isset( $body['total_planned_count'] ) ) {
     1210            set_transient( 'saiap_planned_calendar_items_count', (int) $body['total_planned_count'], HOUR_IN_SECONDS );
     1211        }
    12161212
    12171213        // Enrich calendar items with local WP post IDs.
     
    17291725    }
    17301726
     1727    // Update the planned count cache from backend response.
     1728    if ( isset( $body['total_planned_count'] ) ) {
     1729        set_transient( 'saiap_planned_calendar_items_count', (int) $body['total_planned_count'], HOUR_IN_SECONDS );
     1730    }
     1731
    17311732    wp_send_json_success( $body );
    17321733}
  • clearpost-simple-ai-auto-post/tags/2.0.22/readme.txt

    r3468416 r3468460  
    44Requires at least: 5.0
    55Tested up to: 6.9
    6 Stable tag: 2.0.21
     6Stable tag: 2.0.22
    77Requires PHP: 7.2
    88License: GPLv2 or later
     
    233233
    234234== Changelog ==
     235
     236= 2.0.22 =
     237* Fixed: "Posts Scheduled" metric now shows total across all months, not just the current month view.
    235238
    236239= 2.0.21 =
  • clearpost-simple-ai-auto-post/tags/2.0.22/simple-ai-auto-post.php

    r3468416 r3468460  
    44Description: Your AI Agent for SEO, in WordPress. An AI content marketer that knows your site, then schedules and generates posts every day.
    55Plugin URI: https://clearpostplugin.com/
    6 Version: 2.0.21
     6Version: 2.0.22
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    1818
    1919// Define plugin version
    20 define( 'SAIAP_VERSION', '2.0.21' );
     20define( 'SAIAP_VERSION', '2.0.22' );
    2121
    2222// Define premium API URL
  • clearpost-simple-ai-auto-post/trunk/assets/js/dashboard.js

    r3468416 r3468460  
    1313  let calendarVariant = 'locked';
    1414  let trialDayLimit = 7;
     15  let totalPlannedCount = 0; // Total planned posts across all months (from backend)
    1516
    1617  // Setup loader state
     
    158159        if (response.success && response.data.items && response.data.items.length > 0) {
    159160          // Calendar items exist! Hide loader and show calendar
    160           onSetupComplete(response.data.items);
     161          onSetupComplete(response.data);
    161162        }
    162163        // If no items yet, keep polling
     
    171172   * Handle setup completion - hide loader, show calendar, update status.
    172173   */
    173   function onSetupComplete(items) {
     174  function onSetupComplete(data) {
     175    var items = data.items || [];
     176
    174177    // Stop polling and status cycling
    175178    if (setupPollingInterval) {
     
    202205    // Store the items and render calendar
    203206    calendarData = items;
     207    // Update total planned count (all planned items across all months)
     208    if (typeof data.total_planned_count !== 'undefined') {
     209      totalPlannedCount = data.total_planned_count;
     210    }
    204211    currentMonth = new Date();
    205212    renderCalendar();
    206213
    207     // Update scheduled count (after calendarData is set)
     214    // Update scheduled count (after totalPlannedCount is set)
    208215    updateScheduledCount();
    209216
     
    458465   * Update the "Posts Scheduled" metric count.
    459466   *
    460    * Counts planned calendar items (not yet generated) and updates the metric display.
    461    * Called after calendar data is loaded to ensure the count reflects actual scheduled items.
     467   * Uses totalPlannedCount from the backend (all planned items across all months,
     468   * not just the current month view).
    462469   */
    463470  function updateScheduledCount() {
    464     // Count planned items (items that are scheduled but not yet generated)
    465     var plannedCount = 0;
    466     if (calendarData && calendarData.length) {
    467       calendarData.forEach(function(item) {
    468         if (item.status === 'planned') {
    469           plannedCount++;
    470         }
    471       });
    472     }
    473 
    474471    // Update the "Posts Scheduled" metric card value
    475472    var $metricCards = $('.saiap-metric-card');
     
    478475      var labelText = $card.find('.saiap-metric-card__label').text().toLowerCase();
    479476      if (labelText.indexOf('scheduled') !== -1) {
    480         $card.find('.saiap-metric-card__value').text(plannedCount);
     477        $card.find('.saiap-metric-card__value').text(totalPlannedCount);
    481478      }
    482479    });
     
    631628        if (response.success) {
    632629          calendarData = response.data.items || [];
     630          // Update total planned count (all planned items across all months)
     631          if (typeof response.data.total_planned_count !== 'undefined') {
     632            totalPlannedCount = response.data.total_planned_count;
     633          }
    633634          renderCalendar();
    634635          updateScheduledCount();
     
    891892          // Update calendar data and re-render
    892893          calendarData = data.items || [];
     894          // Update total planned count (all planned items across all months)
     895          if (typeof data.total_planned_count !== 'undefined') {
     896            totalPlannedCount = data.total_planned_count;
     897          }
    893898          currentMonth = new Date();
    894899          renderCalendar();
  • clearpost-simple-ai-auto-post/trunk/includes/dashboard.php

    r3468416 r3468460  
    12061206        set_transient( 'saiap_calendar_items_count', count( $body['items'] ), HOUR_IN_SECONDS );
    12071207
    1208         // Count planned items (scheduled but not yet generated).
    1209         $planned_count = 0;
    1210         foreach ( $body['items'] as $item ) {
    1211             if ( isset( $item['status'] ) && 'planned' === $item['status'] ) {
    1212                 ++$planned_count;
    1213             }
    1214         }
    1215         set_transient( 'saiap_planned_calendar_items_count', $planned_count, HOUR_IN_SECONDS );
     1208        // Use backend-provided total planned count (all planned items, not filtered by date).
     1209        if ( isset( $body['total_planned_count'] ) ) {
     1210            set_transient( 'saiap_planned_calendar_items_count', (int) $body['total_planned_count'], HOUR_IN_SECONDS );
     1211        }
    12161212
    12171213        // Enrich calendar items with local WP post IDs.
     
    17291725    }
    17301726
     1727    // Update the planned count cache from backend response.
     1728    if ( isset( $body['total_planned_count'] ) ) {
     1729        set_transient( 'saiap_planned_calendar_items_count', (int) $body['total_planned_count'], HOUR_IN_SECONDS );
     1730    }
     1731
    17311732    wp_send_json_success( $body );
    17321733}
  • clearpost-simple-ai-auto-post/trunk/readme.txt

    r3468416 r3468460  
    44Requires at least: 5.0
    55Tested up to: 6.9
    6 Stable tag: 2.0.21
     6Stable tag: 2.0.22
    77Requires PHP: 7.2
    88License: GPLv2 or later
     
    233233
    234234== Changelog ==
     235
     236= 2.0.22 =
     237* Fixed: "Posts Scheduled" metric now shows total across all months, not just the current month view.
    235238
    236239= 2.0.21 =
  • clearpost-simple-ai-auto-post/trunk/simple-ai-auto-post.php

    r3468416 r3468460  
    44Description: Your AI Agent for SEO, in WordPress. An AI content marketer that knows your site, then schedules and generates posts every day.
    55Plugin URI: https://clearpostplugin.com/
    6 Version: 2.0.21
     6Version: 2.0.22
    77License: GPLv2 or later
    88License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    1818
    1919// Define plugin version
    20 define( 'SAIAP_VERSION', '2.0.21' );
     20define( 'SAIAP_VERSION', '2.0.22' );
    2121
    2222// Define premium API URL
Note: See TracChangeset for help on using the changeset viewer.