Plugin Directory

Changeset 3421255


Ignore:
Timestamp:
12/16/2025 04:43:55 PM (3 months ago)
Author:
seomantis
Message:

Remove old tag 1.7.9.1 before recreating

Location:
seo-links-interlinking
Files:
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • seo-links-interlinking/trunk/ajax.php

    r3421102 r3421255  
    506506    $args = array(
    507507        'timeout'     => 30,
    508         'sslverify' => false
     508        'sslverify' => true, // Abilitato per sicurezza
     509        'reject_unsafe_urls' => true,
    509510    );
     511    // Permetti di disabilitare SSL verify solo se necessario tramite filter (non raccomandato)
     512    $args['sslverify'] = apply_filters( 'seoli_sslverify', $args['sslverify'], $remote_get );
    510513    $data = wp_remote_get( $remote_get, $args );
    511514   
  • seo-links-interlinking/trunk/css/main.css

    r2594956 r3421255  
    111111    }
    112112}
     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  
    12381238            'timestamp' => $next_timestamp
    12391239        ) );
     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        }
    12401248    }
    12411249   
     
    14571465   
    14581466    // Update queue based on result
     1467    // Note: success = true even when 0 links are inserted (this is normal behavior, not an error)
    14591468    if( $result['success'] ) {
    14601469        $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        ) );
    14611475    } else {
    14621476        $queue['failed']++;
     1477        seoli_debug_log( 'Post marked as failed', array(
     1478            'post_id' => $post_id,
     1479            'message' => $result['message'] ?? 'Unknown error'
     1480        ) );
    14631481    }
    14641482   
     
    14931511                'scheduled' => true,
    14941512                'delay' => $delay,
    1495                 'note' => 'If cron does not run automatically, use manual trigger or external endpoint'
     1513                'note' => 'Cron scheduled - will spawn automatically'
    14961514            ) );
     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            }
    14971524        }
    14981525    } else {
     
    16581685                'next_run' => date( 'Y-m-d H:i:s', $next_timestamp )
    16591686            ) );
     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            }
    16601695        } else {
    16611696            seoli_debug_log( 'ERROR: Failed to reschedule cron', array(
    16621697                'next_timestamp' => $next_timestamp
    16631698            ) );
    1664         }
    1665        
    1666         // Force WordPress to spawn cron (if not disabled)
    1667         if( ! defined( 'DISABLE_WP_CRON' ) || ! DISABLE_WP_CRON ) {
    1668             spawn_cron();
    16691699        }
    16701700    }
  • seo-links-interlinking/trunk/view/seo_links_settings.php

    r3420953 r3421255  
    4242                        <select name="seo_links_multilang" id="seo_links_multilang">
    4343                            <?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>
    4646                        </select>
    4747                    </td>
     
    7171                                    <th scope="row"><label for="seo_links_impressions">Impressions</label></th>
    7272                                    <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" />
    7474                                    </td>
    7575                                </tr>
     
    7777                                    <?php $clicks = get_option( 'seo_links_clicks' ) ? get_option( 'seo_links_clicks' ) : 0; ?>
    7878                                    <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>
    8080                                </tr>
    8181                            </tbody>
     
    8686                    <th scope="row">Custom Links</th>
    8787                    <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>
    8892                        <table id="custom_links">
    8993                            <tbody>
     
    9498                                </tr>
    9599                                <?php $seoli_custom_links = get_option('seoli_custom_links'); ?>
     100                                <?php $seoli_custom_links = $seoli_custom_links ? $seoli_custom_links : array(); ?>
    96101                                <?php $index = 1; ?>
    97102                                <?php foreach( $seoli_custom_links as $custom_link) : ?>
     
    104109                                <?php endforeach; ?>
    105110                                <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&#10;Example:&#10;https://example.com/page1&#10;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&#10;Example:&#10;keyword 1&#10;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>
    109122                                </tr>
    110123                            </tbody>
     
    122135                                    <td>
    123136                                        <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>
    126139                                        </select>
    127140                                        <p class="description">Enable bulk linking functionality in the posts list page.</p>
     
    606619
    607620    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);
    612653
    613654        jQuery.ajax({
     
    617658            data: {
    618659                action: 'seoli_saveCustomLinks',
    619                 page: page,
    620                 query: query,
     660                pages: pages,
     661                queries: queries,
    621662                nonce: '<?php echo wp_create_nonce( 'seoli_saveCustomLinks_nonce' ); ?>',
    622663            }
    623664        }).fail(function(){
    624665            console.log('Ajax request fails');
     666            alert('Error saving custom links. Please try again.');
    625667        }).done(function( data ){
    626668            console.log( data );
    627669            if( data.success == true ){
    628670                window.location.reload();
     671            } else {
     672                alert( data.data && data.data.message ? data.data.message : 'Error saving custom links. Please try again.' );
    629673            }
    630674        });
Note: See TracChangeset for help on using the changeset viewer.