Changeset 3469622
- Timestamp:
- 02/25/2026 04:44:44 PM (4 weeks ago)
- Location:
- clearpost-simple-ai-auto-post
- Files:
-
- 8 edited
- 1 copied
-
tags/2.0.25 (copied) (copied from clearpost-simple-ai-auto-post/trunk)
-
tags/2.0.25/assets/js/dashboard.js (modified) (2 diffs)
-
tags/2.0.25/includes/dashboard.php (modified) (1 diff)
-
tags/2.0.25/readme.txt (modified) (2 diffs)
-
tags/2.0.25/simple-ai-auto-post.php (modified) (2 diffs)
-
trunk/assets/js/dashboard.js (modified) (2 diffs)
-
trunk/includes/dashboard.php (modified) (1 diff)
-
trunk/readme.txt (modified) (2 diffs)
-
trunk/simple-ai-auto-post.php (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
clearpost-simple-ai-auto-post/tags/2.0.25/assets/js/dashboard.js
r3468460 r3469622 87 87 $(document).on('click', '.saiap-change-date-save', handleChangeDateSave); 88 88 $(document).on('click', '.saiap-change-date-cancel', handleChangeDateCancel); 89 $(document).on('click', '.saiap-skip-item-btn', handleSkipItem); 89 90 } 90 91 … … 1524 1525 1525 1526 /** 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 /** 1526 1571 * Close modal. 1527 1572 */ -
clearpost-simple-ai-auto-post/tags/2.0.25/includes/dashboard.php
r3468893 r3469622 1354 1354 1355 1355 /** 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 */ 1361 function 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 } 1409 add_action( 'wp_ajax_saiap_replace_calendar_item', 'saiap_ajax_replace_calendar_item' ); 1410 1411 /** 1356 1412 * AJAX handler: Generate post from calendar item. 1357 1413 */ -
clearpost-simple-ai-auto-post/tags/2.0.25/readme.txt
r3468909 r3469622 4 4 Requires at least: 5.0 5 5 Tested up to: 6.9 6 Stable tag: 2.0.2 46 Stable tag: 2.0.25 7 7 Requires PHP: 7.2 8 8 License: GPLv2 or later … … 233 233 234 234 == Changelog == 235 236 = 2.0.25 = 237 * New: Skip button replaces calendar item with different keyword (Premium). 235 238 236 239 = 2.0.24 = -
clearpost-simple-ai-auto-post/tags/2.0.25/simple-ai-auto-post.php
r3468909 r3469622 4 4 Description: Your AI Agent for SEO, in WordPress. An AI content marketer that knows your site, then schedules and generates posts every day. 5 5 Plugin URI: https://clearpostplugin.com/ 6 Version: 2.0.2 46 Version: 2.0.25 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 18 18 19 19 // Define plugin version 20 define( 'SAIAP_VERSION', '2.0.2 4' );20 define( 'SAIAP_VERSION', '2.0.25' ); 21 21 22 22 // Define premium API URL -
clearpost-simple-ai-auto-post/trunk/assets/js/dashboard.js
r3468460 r3469622 87 87 $(document).on('click', '.saiap-change-date-save', handleChangeDateSave); 88 88 $(document).on('click', '.saiap-change-date-cancel', handleChangeDateCancel); 89 $(document).on('click', '.saiap-skip-item-btn', handleSkipItem); 89 90 } 90 91 … … 1524 1525 1525 1526 /** 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 /** 1526 1571 * Close modal. 1527 1572 */ -
clearpost-simple-ai-auto-post/trunk/includes/dashboard.php
r3468893 r3469622 1354 1354 1355 1355 /** 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 */ 1361 function 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 } 1409 add_action( 'wp_ajax_saiap_replace_calendar_item', 'saiap_ajax_replace_calendar_item' ); 1410 1411 /** 1356 1412 * AJAX handler: Generate post from calendar item. 1357 1413 */ -
clearpost-simple-ai-auto-post/trunk/readme.txt
r3468909 r3469622 4 4 Requires at least: 5.0 5 5 Tested up to: 6.9 6 Stable tag: 2.0.2 46 Stable tag: 2.0.25 7 7 Requires PHP: 7.2 8 8 License: GPLv2 or later … … 233 233 234 234 == Changelog == 235 236 = 2.0.25 = 237 * New: Skip button replaces calendar item with different keyword (Premium). 235 238 236 239 = 2.0.24 = -
clearpost-simple-ai-auto-post/trunk/simple-ai-auto-post.php
r3468909 r3469622 4 4 Description: Your AI Agent for SEO, in WordPress. An AI content marketer that knows your site, then schedules and generates posts every day. 5 5 Plugin URI: https://clearpostplugin.com/ 6 Version: 2.0.2 46 Version: 2.0.25 7 7 License: GPLv2 or later 8 8 License URI: https://www.gnu.org/licenses/gpl-2.0.html … … 18 18 19 19 // Define plugin version 20 define( 'SAIAP_VERSION', '2.0.2 4' );20 define( 'SAIAP_VERSION', '2.0.25' ); 21 21 22 22 // Define premium API URL
Note: See TracChangeset
for help on using the changeset viewer.