Changeset 3421255
- Timestamp:
- 12/16/2025 04:43:55 PM (3 months ago)
- Location:
- seo-links-interlinking
- Files:
-
- 1 deleted
- 4 edited
-
tags/1.7.9.1 (deleted)
-
trunk/ajax.php (modified) (1 diff)
-
trunk/css/main.css (modified) (1 diff)
-
trunk/scdata.php (modified) (4 diffs)
-
trunk/view/seo_links_settings.php (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
seo-links-interlinking/trunk/ajax.php
r3421102 r3421255 506 506 $args = array( 507 507 'timeout' => 30, 508 'sslverify' => false 508 'sslverify' => true, // Abilitato per sicurezza 509 'reject_unsafe_urls' => true, 509 510 ); 511 // Permetti di disabilitare SSL verify solo se necessario tramite filter (non raccomandato) 512 $args['sslverify'] = apply_filters( 'seoli_sslverify', $args['sslverify'], $remote_get ); 510 513 $data = wp_remote_get( $remote_get, $args ); 511 514 -
seo-links-interlinking/trunk/css/main.css
r2594956 r3421255 111 111 } 112 112 } 113 114 /* Stile per i link delle query nel widget - solo sottolineatura, no colore blu */ 115 #seo_links_most_relevant_keyword a, 116 #seo_links_keyword a { 117 color: inherit !important; 118 text-decoration: underline; 119 } 120 121 #seo_links_most_relevant_keyword a:hover, 122 #seo_links_keyword a:hover { 123 color: inherit !important; 124 text-decoration: underline; 125 } -
seo-links-interlinking/trunk/scdata.php
r3421102 r3421255 1238 1238 'timestamp' => $next_timestamp 1239 1239 ) ); 1240 } else { 1241 // Force WordPress to spawn cron immediately to ensure execution 1242 if( ! defined( 'DISABLE_WP_CRON' ) || ! DISABLE_WP_CRON ) { 1243 spawn_cron(); 1244 seoli_debug_log( 'spawn_cron() called after scheduling first event', array( 1245 'note' => 'This helps ensure cron runs even with low site traffic' 1246 ) ); 1247 } 1240 1248 } 1241 1249 … … 1457 1465 1458 1466 // Update queue based on result 1467 // Note: success = true even when 0 links are inserted (this is normal behavior, not an error) 1459 1468 if( $result['success'] ) { 1460 1469 $queue['processed']++; 1470 seoli_debug_log( 'Post marked as processed successfully', array( 1471 'post_id' => $post_id, 1472 'links_added' => $result['links_added'], 1473 'note' => $result['links_added'] === 0 ? '0 links added - this is normal and the process continues' : 'Links added successfully' 1474 ) ); 1461 1475 } else { 1462 1476 $queue['failed']++; 1477 seoli_debug_log( 'Post marked as failed', array( 1478 'post_id' => $post_id, 1479 'message' => $result['message'] ?? 'Unknown error' 1480 ) ); 1463 1481 } 1464 1482 … … 1493 1511 'scheduled' => true, 1494 1512 'delay' => $delay, 1495 'note' => ' If cron does not run automatically, use manual trigger or external endpoint'1513 'note' => 'Cron scheduled - will spawn automatically' 1496 1514 ) ); 1515 1516 // Force WordPress to spawn cron immediately (helps with sites that have low traffic) 1517 // This ensures the cron runs even if there's no visitor traffic 1518 if( ! defined( 'DISABLE_WP_CRON' ) || ! DISABLE_WP_CRON ) { 1519 spawn_cron(); 1520 seoli_debug_log( 'spawn_cron() called to force cron execution', array( 1521 'note' => 'This helps ensure cron runs even with low site traffic' 1522 ) ); 1523 } 1497 1524 } 1498 1525 } else { … … 1658 1685 'next_run' => date( 'Y-m-d H:i:s', $next_timestamp ) 1659 1686 ) ); 1687 1688 // Force WordPress to spawn cron (if not disabled) 1689 if( ! defined( 'DISABLE_WP_CRON' ) || ! DISABLE_WP_CRON ) { 1690 spawn_cron(); 1691 seoli_debug_log( 'spawn_cron() called after rescheduling', array( 1692 'note' => 'Forcing cron execution to continue queue processing' 1693 ) ); 1694 } 1660 1695 } else { 1661 1696 seoli_debug_log( 'ERROR: Failed to reschedule cron', array( 1662 1697 'next_timestamp' => $next_timestamp 1663 1698 ) ); 1664 }1665 1666 // Force WordPress to spawn cron (if not disabled)1667 if( ! defined( 'DISABLE_WP_CRON' ) || ! DISABLE_WP_CRON ) {1668 spawn_cron();1669 1699 } 1670 1700 } -
seo-links-interlinking/trunk/view/seo_links_settings.php
r3420953 r3421255 42 42 <select name="seo_links_multilang" id="seo_links_multilang"> 43 43 <?php $option_multi_lang = get_option("seo_links_multilang"); ?> 44 <option value="no" <?php echo $option_multi_lang== "no" ? 'selected' : '' ?>>No</option>45 <option value="yes" <?php echo $option_multi_lang== "yes" ? 'selected' : '' ?>>Yes</option>44 <option value="no" <?php echo esc_attr( $option_multi_lang ) == "no" ? 'selected' : '' ?>>No</option> 45 <option value="yes" <?php echo esc_attr( $option_multi_lang ) == "yes" ? 'selected' : '' ?>>Yes</option> 46 46 </select> 47 47 </td> … … 71 71 <th scope="row"><label for="seo_links_impressions">Impressions</label></th> 72 72 <td> 73 <input name="seo_links_impressions" type="number" step="1" id="seo_links_impressions" value="<?php echo $impressions; ?>" class="regular-text" />73 <input name="seo_links_impressions" type="number" step="1" id="seo_links_impressions" value="<?php echo esc_attr( $impressions ); ?>" class="regular-text" /> 74 74 </td> 75 75 </tr> … … 77 77 <?php $clicks = get_option( 'seo_links_clicks' ) ? get_option( 'seo_links_clicks' ) : 0; ?> 78 78 <th scope="row"><label for="seo_links_clicks">Clicks</label></th> 79 <td><input name="seo_links_clicks" type="number" step="1" id="seo_links_clicks" value="<?php echo $clicks; ?>" class="regular-text" /></td>79 <td><input name="seo_links_clicks" type="number" step="1" id="seo_links_clicks" value="<?php echo esc_attr( $clicks ); ?>" class="regular-text" /></td> 80 80 </tr> 81 81 </tbody> … … 86 86 <th scope="row">Custom Links</th> 87 87 <td> 88 <p class="description" style="margin-bottom: 15px;"> 89 You can add multiple custom links at once. Enter one or more pages and queries, each on a new line or separated by commas. 90 The first page will be paired with the first query, the second page with the second query, and so on. 91 </p> 88 92 <table id="custom_links"> 89 93 <tbody> … … 94 98 </tr> 95 99 <?php $seoli_custom_links = get_option('seoli_custom_links'); ?> 100 <?php $seoli_custom_links = $seoli_custom_links ? $seoli_custom_links : array(); ?> 96 101 <?php $index = 1; ?> 97 102 <?php foreach( $seoli_custom_links as $custom_link) : ?> … … 104 109 <?php endforeach; ?> 105 110 <tr> 106 <td><input type="text" id="custom_links_page" /></td> 107 <td><input type="text" id="custom_links_query" /></td> 108 <td><a href="javascript:void(0);" class="button button-primary" onclick="seoliSaveCustomLinks();">Save</a></td> 111 <td> 112 <textarea id="custom_links_page" rows="5" style="width: 100%; min-width: 300px;" placeholder="Enter one or more pages, one per line or separated by commas Example: https://example.com/page1 https://example.com/page2"></textarea> 113 <p class="description" style="margin-top: 5px; font-size: 12px;">Enter pages separated by new lines or commas</p> 114 </td> 115 <td> 116 <textarea id="custom_links_query" rows="5" style="width: 100%; min-width: 300px;" placeholder="Enter one or more queries, one per line or separated by commas Example: keyword 1 keyword 2"></textarea> 117 <p class="description" style="margin-top: 5px; font-size: 12px;">Enter queries separated by new lines or commas</p> 118 </td> 119 <td style="vertical-align: top; padding-top: 10px;"> 120 <a href="javascript:void(0);" class="button button-primary" onclick="seoliSaveCustomLinks();">Save</a> 121 </td> 109 122 </tr> 110 123 </tbody> … … 122 135 <td> 123 136 <select name="seoli_bulk_enabled" id="seoli_bulk_enabled"> 124 <option value="yes" <?php echo $bulk_enabled== 'yes' ? 'selected' : ''; ?>>Yes</option>125 <option value="no" <?php echo $bulk_enabled== 'no' ? 'selected' : ''; ?>>No</option>137 <option value="yes" <?php echo esc_attr( $bulk_enabled ) == 'yes' ? 'selected' : ''; ?>>Yes</option> 138 <option value="no" <?php echo esc_attr( $bulk_enabled ) == 'no' ? 'selected' : ''; ?>>No</option> 126 139 </select> 127 140 <p class="description">Enable bulk linking functionality in the posts list page.</p> … … 606 619 607 620 function seoliSaveCustomLinks(){ 608 const page = jQuery( "#custom_links_page" ).val(); 609 const query = jQuery( "#custom_links_query" ).val(); 610 611 console.log( page, query ); 621 const pageText = jQuery( "#custom_links_page" ).val().trim(); 622 const queryText = jQuery( "#custom_links_query" ).val().trim(); 623 624 if( !pageText || !queryText ) { 625 alert('Please enter at least one page and one query.'); 626 return; 627 } 628 629 // Parse pages: split by newline or comma, trim, remove empty 630 const pages = pageText.split(/[\n,]+/) 631 .map(function(p) { return p.trim(); }) 632 .filter(function(p) { return p.length > 0; }); 633 634 // Parse queries: split by newline or comma, trim, remove empty 635 const queries = queryText.split(/[\n,]+/) 636 .map(function(q) { return q.trim(); }) 637 .filter(function(q) { return q.length > 0; }); 638 639 // Check if we have matching counts 640 if( pages.length !== queries.length ) { 641 alert('The number of pages (' + pages.length + ') must match the number of queries (' + queries.length + ').\n\n' + 642 'First page will be paired with first query, second page with second query, and so on.'); 643 return; 644 } 645 646 if( pages.length === 0 ) { 647 alert('Please enter at least one page and one query.'); 648 return; 649 } 650 651 console.log('Pages:', pages); 652 console.log('Queries:', queries); 612 653 613 654 jQuery.ajax({ … … 617 658 data: { 618 659 action: 'seoli_saveCustomLinks', 619 page : page,620 quer y: query,660 pages: pages, 661 queries: queries, 621 662 nonce: '<?php echo wp_create_nonce( 'seoli_saveCustomLinks_nonce' ); ?>', 622 663 } 623 664 }).fail(function(){ 624 665 console.log('Ajax request fails'); 666 alert('Error saving custom links. Please try again.'); 625 667 }).done(function( data ){ 626 668 console.log( data ); 627 669 if( data.success == true ){ 628 670 window.location.reload(); 671 } else { 672 alert( data.data && data.data.message ? data.data.message : 'Error saving custom links. Please try again.' ); 629 673 } 630 674 });
Note: See TracChangeset
for help on using the changeset viewer.