Plugin Directory

Changeset 3469622


Ignore:
Timestamp:
02/25/2026 04:44:44 PM (4 weeks ago)
Author:
purposego
Message:

Release 2.0.25

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

Legend:

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

    r3468460 r3469622  
    8787    $(document).on('click', '.saiap-change-date-save', handleChangeDateSave);
    8888    $(document).on('click', '.saiap-change-date-cancel', handleChangeDateCancel);
     89    $(document).on('click', '.saiap-skip-item-btn', handleSkipItem);
    8990  }
    9091
     
    15241525
    15251526  /**
     1527   * Handle Skip button click - replace calendar item with different keyword.
     1528   */
     1529  function handleSkipItem(e) {
     1530    e.preventDefault();
     1531    e.stopPropagation();
     1532
     1533    var $btn = $(this);
     1534    var itemId = $btn.data('item-id');
     1535
     1536    if (!itemId) {
     1537      showNotice('Missing calendar item ID', 'error');
     1538      return;
     1539    }
     1540
     1541    var originalText = $btn.text();
     1542    $btn.prop('disabled', true).text('Finding replacement...');
     1543
     1544    $.ajax({
     1545      url: saiapAdmin.ajaxurl,
     1546      type: 'POST',
     1547      timeout: 90000, // AI generation can take time
     1548      data: {
     1549        action: 'saiap_replace_calendar_item',
     1550        nonce: saiapAdmin.trialNonce,
     1551        item_id: itemId
     1552      },
     1553      success: function (response) {
     1554        if (response.success) {
     1555          showNotice('Replaced with new topic: ' + (response.data?.item?.title || 'New item'), 'success');
     1556          closeModal();
     1557          loadCalendarData();
     1558        } else {
     1559          showNotice(response.data?.message || 'Failed to replace item', 'error');
     1560          $btn.prop('disabled', false).text(originalText);
     1561        }
     1562      },
     1563      error: function () {
     1564        showNotice('Network error replacing item', 'error');
     1565        $btn.prop('disabled', false).text(originalText);
     1566      }
     1567    });
     1568  }
     1569
     1570  /**
    15261571   * Close modal.
    15271572   */
  • clearpost-simple-ai-auto-post/tags/2.0.25/includes/dashboard.php

    r3468893 r3469622  
    13541354
    13551355/**
     1356 * AJAX handler: Replace calendar item with a different keyword.
     1357 *
     1358 * Archives the current keyword, picks a new one (preferring different location),
     1359 * and creates a new calendar item for the same date.
     1360 */
     1361function saiap_ajax_replace_calendar_item() {
     1362    check_ajax_referer( 'saiap_trial_nonce', 'nonce' );
     1363
     1364    if ( ! current_user_can( 'manage_options' ) ) {
     1365        wp_send_json_error( array( 'message' => 'Unauthorized' ), 403 );
     1366    }
     1367
     1368    $item_id = isset( $_POST['item_id'] ) ? sanitize_text_field( wp_unslash( $_POST['item_id'] ) ) : '';
     1369    if ( empty( $item_id ) ) {
     1370        wp_send_json_error( array( 'message' => 'Missing item ID' ) );
     1371    }
     1372
     1373    $domain      = saiap_get_server_host();
     1374    $license_key = get_option( 'saiap_license_key', '' );
     1375
     1376    $response = wp_remote_post(
     1377        SAIAP_PREMIUM_API_URL . '/api/seo/calendar/' . $item_id . '/replace',
     1378        array(
     1379            'timeout' => 60, // AI generation can take time
     1380            'headers' => array(
     1381                'Content-Type' => 'application/json',
     1382            ),
     1383            'body'    => wp_json_encode(
     1384                array(
     1385                    'domain'      => $domain,
     1386                    'license_key' => $license_key,
     1387                )
     1388            ),
     1389        )
     1390    );
     1391
     1392    if ( is_wp_error( $response ) ) {
     1393        wp_send_json_error( array( 'message' => $response->get_error_message() ) );
     1394    }
     1395
     1396    $body = json_decode( wp_remote_retrieve_body( $response ), true );
     1397    $code = wp_remote_retrieve_response_code( $response );
     1398
     1399    if ( 200 !== $code ) {
     1400        wp_send_json_error(
     1401            array(
     1402                'message' => isset( $body['error'] ) ? $body['error'] : 'Failed to replace item',
     1403            )
     1404        );
     1405    }
     1406
     1407    wp_send_json_success( $body );
     1408}
     1409add_action( 'wp_ajax_saiap_replace_calendar_item', 'saiap_ajax_replace_calendar_item' );
     1410
     1411/**
    13561412 * AJAX handler: Generate post from calendar item.
    13571413 */
  • clearpost-simple-ai-auto-post/tags/2.0.25/readme.txt

    r3468909 r3469622  
    44Requires at least: 5.0
    55Tested up to: 6.9
    6 Stable tag: 2.0.24
     6Stable tag: 2.0.25
    77Requires PHP: 7.2
    88License: GPLv2 or later
     
    233233
    234234== Changelog ==
     235
     236= 2.0.25 =
     237* New: Skip button replaces calendar item with different keyword (Premium).
    235238
    236239= 2.0.24 =
  • clearpost-simple-ai-auto-post/tags/2.0.25/simple-ai-auto-post.php

    r3468909 r3469622  
    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.24
     6Version: 2.0.25
    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.24' );
     20define( 'SAIAP_VERSION', '2.0.25' );
    2121
    2222// Define premium API URL
  • clearpost-simple-ai-auto-post/trunk/assets/js/dashboard.js

    r3468460 r3469622  
    8787    $(document).on('click', '.saiap-change-date-save', handleChangeDateSave);
    8888    $(document).on('click', '.saiap-change-date-cancel', handleChangeDateCancel);
     89    $(document).on('click', '.saiap-skip-item-btn', handleSkipItem);
    8990  }
    9091
     
    15241525
    15251526  /**
     1527   * Handle Skip button click - replace calendar item with different keyword.
     1528   */
     1529  function handleSkipItem(e) {
     1530    e.preventDefault();
     1531    e.stopPropagation();
     1532
     1533    var $btn = $(this);
     1534    var itemId = $btn.data('item-id');
     1535
     1536    if (!itemId) {
     1537      showNotice('Missing calendar item ID', 'error');
     1538      return;
     1539    }
     1540
     1541    var originalText = $btn.text();
     1542    $btn.prop('disabled', true).text('Finding replacement...');
     1543
     1544    $.ajax({
     1545      url: saiapAdmin.ajaxurl,
     1546      type: 'POST',
     1547      timeout: 90000, // AI generation can take time
     1548      data: {
     1549        action: 'saiap_replace_calendar_item',
     1550        nonce: saiapAdmin.trialNonce,
     1551        item_id: itemId
     1552      },
     1553      success: function (response) {
     1554        if (response.success) {
     1555          showNotice('Replaced with new topic: ' + (response.data?.item?.title || 'New item'), 'success');
     1556          closeModal();
     1557          loadCalendarData();
     1558        } else {
     1559          showNotice(response.data?.message || 'Failed to replace item', 'error');
     1560          $btn.prop('disabled', false).text(originalText);
     1561        }
     1562      },
     1563      error: function () {
     1564        showNotice('Network error replacing item', 'error');
     1565        $btn.prop('disabled', false).text(originalText);
     1566      }
     1567    });
     1568  }
     1569
     1570  /**
    15261571   * Close modal.
    15271572   */
  • clearpost-simple-ai-auto-post/trunk/includes/dashboard.php

    r3468893 r3469622  
    13541354
    13551355/**
     1356 * AJAX handler: Replace calendar item with a different keyword.
     1357 *
     1358 * Archives the current keyword, picks a new one (preferring different location),
     1359 * and creates a new calendar item for the same date.
     1360 */
     1361function saiap_ajax_replace_calendar_item() {
     1362    check_ajax_referer( 'saiap_trial_nonce', 'nonce' );
     1363
     1364    if ( ! current_user_can( 'manage_options' ) ) {
     1365        wp_send_json_error( array( 'message' => 'Unauthorized' ), 403 );
     1366    }
     1367
     1368    $item_id = isset( $_POST['item_id'] ) ? sanitize_text_field( wp_unslash( $_POST['item_id'] ) ) : '';
     1369    if ( empty( $item_id ) ) {
     1370        wp_send_json_error( array( 'message' => 'Missing item ID' ) );
     1371    }
     1372
     1373    $domain      = saiap_get_server_host();
     1374    $license_key = get_option( 'saiap_license_key', '' );
     1375
     1376    $response = wp_remote_post(
     1377        SAIAP_PREMIUM_API_URL . '/api/seo/calendar/' . $item_id . '/replace',
     1378        array(
     1379            'timeout' => 60, // AI generation can take time
     1380            'headers' => array(
     1381                'Content-Type' => 'application/json',
     1382            ),
     1383            'body'    => wp_json_encode(
     1384                array(
     1385                    'domain'      => $domain,
     1386                    'license_key' => $license_key,
     1387                )
     1388            ),
     1389        )
     1390    );
     1391
     1392    if ( is_wp_error( $response ) ) {
     1393        wp_send_json_error( array( 'message' => $response->get_error_message() ) );
     1394    }
     1395
     1396    $body = json_decode( wp_remote_retrieve_body( $response ), true );
     1397    $code = wp_remote_retrieve_response_code( $response );
     1398
     1399    if ( 200 !== $code ) {
     1400        wp_send_json_error(
     1401            array(
     1402                'message' => isset( $body['error'] ) ? $body['error'] : 'Failed to replace item',
     1403            )
     1404        );
     1405    }
     1406
     1407    wp_send_json_success( $body );
     1408}
     1409add_action( 'wp_ajax_saiap_replace_calendar_item', 'saiap_ajax_replace_calendar_item' );
     1410
     1411/**
    13561412 * AJAX handler: Generate post from calendar item.
    13571413 */
  • clearpost-simple-ai-auto-post/trunk/readme.txt

    r3468909 r3469622  
    44Requires at least: 5.0
    55Tested up to: 6.9
    6 Stable tag: 2.0.24
     6Stable tag: 2.0.25
    77Requires PHP: 7.2
    88License: GPLv2 or later
     
    233233
    234234== Changelog ==
     235
     236= 2.0.25 =
     237* New: Skip button replaces calendar item with different keyword (Premium).
    235238
    236239= 2.0.24 =
  • clearpost-simple-ai-auto-post/trunk/simple-ai-auto-post.php

    r3468909 r3469622  
    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.24
     6Version: 2.0.25
    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.24' );
     20define( 'SAIAP_VERSION', '2.0.25' );
    2121
    2222// Define premium API URL
Note: See TracChangeset for help on using the changeset viewer.