Plugin Directory

Changeset 3166563


Ignore:
Timestamp:
10/10/2024 12:59:43 PM (16 months ago)
Author:
wpinternallink2024
Message:

Update security

Location:
laci-link-cluster
Files:
138 added
26 deleted
25 edited

Legend:

Unmodified
Added
Removed
  • laci-link-cluster/trunk/assets/admin/css/admin.css

    r3165071 r3166563  
    99}
    1010
    11 .wp-internal-links-popup {
     11.laci-notice {
     12  display: block !important;
     13}
     14
     15.laci-internal-links-popup {
    1216  background: #fff;
    1317  padding: 20px;
    1418}
    1519
    16 .wp-internal-links-popup table {
     20.laci-internal-links-popup table {
    1721  width: 100%;
    1822  border-collapse: collapse;
    1923}
    2024
    21 .wp-internal-links-popup th,
    22 .wp-internal-links-popup td {
     25.laci-internal-links-popup th,
     26.laci-internal-links-popup td {
    2327  padding: 10px;
    2428  border: 1px solid #ddd;
    2529}
    2630
    27 .wp-internal-links-popup th {
     31.laci-internal-links-popup th {
    2832  background: #f1f1f1;
    2933  text-align: left;
     
    159163}
    160164
    161 .laci-dashboard-page .column-categories,
     165.laci-dashboard-page .column-taxonomies,
    162166.laci-dashboard-page .column-key_words {
    163167  width: 13%;
     
    285289}
    286290
    287 .laci-dashboard-page #categories a,
     291.laci-dashboard-page #taxonomies a,
    288292.laci-dashboard-page #key_words a {
    289293  width: 60%;
     
    361365}
    362366
    363 .button-primary.laci-updating-message::after,
     367.button.laci-updating-message::after,
    364368.laci-loading.laci-updating-message::after {
    365369  color: #e10909;
     
    588592  display: inline-block;
    589593}
    590 
    591 .laci-link-assistant-item {
    592   display: none;
    593 }
  • laci-link-cluster/trunk/assets/admin/css/link-assistant.css

    r3165071 r3166563  
    4949}
    5050
    51 .laci-placement-assistant .column-categories,
     51.laci-placement-assistant .column-taxonomies,
    5252.laci-placement-assistant .column-key_words {
    5353  width: 15%;
     
    6464}
    6565
    66 .laci-placement-assistant #categories {
     66.laci-placement-assistant #taxonomies {
    6767  position: relative;
    6868}
     
    318318}
    319319
    320 .admin_page_wp-internal-links-assistant .ui-widget-header {
     320.admin_page_laci-internal-links-assistant .ui-widget-header {
    321321  border: 1px solid #6bc623;
    322322  background: #6bc623;
     
    325325}
    326326
    327 .admin_page_wp-internal-links-assistant .ui-widget.ui-widget-content {
     327.admin_page_laci-internal-links-assistant .ui-widget.ui-widget-content {
    328328  border: 3px solid #6bc623;
    329329  padding: 0;
  • laci-link-cluster/trunk/assets/admin/js/admin.js

    r3165071 r3166563  
    2121                    if (response.success && response.data.html) {
    2222                        // Show popup with response.data.html
    23                         const $popup = $('<div class="wp-internal-links-popup"></div>').html(response.data.html);
     23                        const $popup = $('<div class="laci-internal-links-popup"></div>').html(response.data.html);
    2424                        const title = response.data.title;
    2525                        $popup.dialog({
     
    113113            jQuery('.laci-category-text').toggleClass('laci-display-none');
    114114
    115             jQuery('#categories .laci-categories-title').hide();
    116             jQuery('#categories .sorting-indicators').hide();
     115            jQuery('#taxonomies .laci-categories-title').hide();
     116            jQuery('#taxonomies .sorting-indicators').hide();
    117117           
    118118            jQuery('.laci-categories-action-change').show();
     
    126126            jQuery('.laci-category-text').toggleClass('laci-display-none');
    127127
    128             jQuery('#categories .laci-categories-title').show();
    129             jQuery('#categories .sorting-indicators').show();
     128            jQuery('#taxonomies .laci-categories-title').show();
     129            jQuery('#taxonomies .sorting-indicators').show();
    130130
    131131            jQuery('.laci-categories-action-change').hide();
     
    177177                        jQuery('.laci-category-text').toggleClass('laci-display-none');
    178178
    179                         jQuery('#categories .laci-categories-title').show();
    180                         jQuery('#categories .sorting-indicators').show();
     179                        jQuery('#taxonomies .laci-categories-title').show();
     180                        jQuery('#taxonomies .sorting-indicators').show();
    181181
    182182                        jQuery('.laci-categories-action-change').hide();
     
    431431                    if (response.success && response.data.html) {
    432432                        // Show popup with response.data.html
    433                         const $popup = $('<div class="wp-internal-links-popup"></div>').html(response.data.html);
     433                        const $popup = $('<div class="laci-internal-links-popup"></div>').html(response.data.html);
    434434                        $popup.dialog({
    435435                            title: 'Update Focus Keywords',
  • laci-link-cluster/trunk/assets/admin/js/link-assistant.js

    r3165071 r3166563  
    4343            jQuery("#laci-current-data").attr('data-currentExcerpt', currentExcerpt);
    4444
    45             jQuery('.wp-internal-links-popup').dialog('open');
    46             jQuery('.wp-internal-links-popup').dialog('option', 'title', title);
     45            jQuery('.laci-internal-links-popup').dialog('open');
     46            jQuery('.laci-internal-links-popup').dialog('option', 'title', title);
    4747
    4848            if (tinymce.get('popup-editor')) {
     
    7070            jQuery("#laci-current-data").attr('data-currentExcerpt', currentExcerpt);
    7171
    72             jQuery('.wp-internal-links-popup').dialog('open');
    73             jQuery('.wp-internal-links-popup').dialog('option', 'title', title);
     72            jQuery('.laci-internal-links-popup').dialog('open');
     73            jQuery('.laci-internal-links-popup').dialog('option', 'title', title);
    7474
    7575            if (tinymce.get('popup-editor')) {
     
    8282    },
    8383    createdPopup($) {
    84         $('.wp-internal-links-popup').dialog({
     84        $('.laci-internal-links-popup').dialog({
    8585            autoOpen: false,
    8686            title: 'Title',
     
    138138                },
    139139                error: function(response) {
    140                     notification.showNotification('Key words can be updated');
     140                    notification.showNotification('Key words can\'t be updated');
    141141                }
    142142            });
     
    147147            const keyWord = jQuery('.laci-search-input-control').val();
    148148            const postId = jQuery('.laci-search-input-control').data('id');
     149            $('.laci-search-button').addClass('laci-updating-message');
     150            $('.laci-search-button').attr('disabled', 'disabled');
    149151       
    150152            jQuery.ajax({
     
    158160                },
    159161                success: function(response) {
     162                    $('.laci-search-button').removeClass('laci-updating-message');
     163                    $('.laci-search-button').removeAttr('disabled', 'disabled');
    160164                    if (response.success && response.data) {
    161165                        jQuery('.laci-search-results__same-category__content').html(response.data.html_same_cate);
     
    212216                },
    213217                error: function(response) {
     218                    $('.laci-search-button').removeClass('laci-updating-message');
     219                    $('.laci-search-button').removeAttr('disabled', 'disabled');
    214220                    console.log(response);
    215221                    notification.showNotification('Search failed', true);
     
    477483    handleLoadMore($) {
    478484        $('.laci-load-more-same-category').click(function() {
    479             let lacCurrentPage = $(this).data('set-paging') || 1;
    480             const lacMaxPages = $(this).data('max-pages');
     485            let wpilCurrentPage = $(this).data('set-paging') || 1;
     486            const wpilMaxPages = $(this).data('max-pages');
    481487            const postId = $(this).data('post-id');
    482488            const keyWord = $(this).data('key-word');
     
    484490            jQuery('.laci-loading').show();
    485491
    486             lacCurrentPage++;
    487             $(this).attr('data-set-paging', lacCurrentPage);
     492            wpilCurrentPage++;
     493            $(this).attr('data-set-paging', wpilCurrentPage);
    488494   
    489             if (lacCurrentPage <= lacMaxPages) {
     495            if (wpilCurrentPage <= wpilMaxPages) {
    490496                jQuery('.laci-loading').show();
    491497                $.ajax({
     
    497503                        post_id: postId,
    498504                        key_word: keyWord,
    499                         page: lacCurrentPage,
     505                        page: wpilCurrentPage,
    500506                    },
    501507                    success: function(response) {
     
    503509                        if (response.success) {
    504510                            $('.laci-search-results__same-category__content').append(response.data.html_same_cate);
    505                             if (lacCurrentPage >= lacMaxPages) {
     511                            if (wpilCurrentPage >= wpilMaxPages) {
    506512                                jQuery('.laci-search-results__same-category__load-more').addClass('laci-display-none');
    507513                            }
     
    517523
    518524        $('.laci-load-more-diff-category').click(function() {
    519             let lacCurrentPage = $(this).data('set-paging') || 1;
    520             const lacMaxPages = $(this).data('max-pages');
     525            let wpilCurrentPage = $(this).data('set-paging') || 1;
     526            const wpilMaxPages = $(this).data('max-pages');
    521527            const postId = $(this).data('post-id');
    522528            const keyWord = $(this).data('key-word');
     
    524530            jQuery('.laci-loading').show();
    525531
    526             lacCurrentPage++;
    527             $(this).attr('data-set-paging', lacCurrentPage);
     532            wpilCurrentPage++;
     533            $(this).attr('data-set-paging', wpilCurrentPage);
    528534   
    529             if (lacCurrentPage <= lacMaxPages) {
     535            if (wpilCurrentPage <= wpilMaxPages) {
    530536                jQuery('.laci-loading').show();
    531537                $.ajax({
     
    537543                        post_id: postId,
    538544                        key_word: keyWord,
    539                         page: lacCurrentPage,
     545                        page: wpilCurrentPage,
    540546                    },
    541547                    success: function(response) {
     
    543549                        if (response.success) {
    544550                            $('.laci-search-results__diff-category__content').append(response.data.html_diff_cate);
    545                             if (lacCurrentPage >= lacMaxPages) {
     551                            if (wpilCurrentPage >= wpilMaxPages) {
    546552                                jQuery('.laci-search-results__diff-category__load-more').addClass('laci-display-none');
    547553                            }
     
    575581            const relatedPostTitle = $('.laci-placement-assistant-title').data('title');
    576582            const keywords = $('.laci-search-input-control').val();
    577    
     583            $(this).addClass('laci-updating-message');
     584            $(this).attr('disabled', 'disabled');
     585
    578586            jQuery.ajax({
    579587                url: laci_internal_links.ajax_url,
     
    588596                success: function (response) {
    589597                    if (response.success === true) {
     598                        $('.laci-add-related-box').removeClass('laci-updating-message');
     599                        $('.laci-add-related-box').removeAttr('disabled');
    590600                        if (response.success && response.data.html) {
    591601                            let $popup = $(".laci-add-related-box-popup");
     
    726736                                    setTimeout(function() {
    727737                                        scrollToTarget();
    728                                     }, 200);
     738                                    }, 500);
    729739                                }
    730740                            });
     
    734744                    }
    735745                },
     746                error: function(response) {
     747                    $('.laci-add-related-box').removeClass('laci-updating-message');
     748                    $('.laci-add-related-box').removeAttr('disabled');
     749                    alert('Error: Failed to get content post.');
     750                }
    736751            });
     752
     753         
    737754        });
    738755    },
  • laci-link-cluster/trunk/assets/admin/js/settings.js

    r3165071 r3166563  
    1 const lacSettings = {
    2     lacColorPicker($) {
     1const wpilSettings = {
     2    wpilColorPicker($) {
    33        jQuery('#laci-bg-color').wpColorPicker();
    44        jQuery('#laci-bd-color').wpColorPicker();
     
    8484            importKeywords();
    8585        });
     86    },
     87    uploadImage($) {
     88        var wp_media_frame;
     89
     90        $('#laci-related-box-image-upload').on('click', function(e) {
     91            e.preventDefault();
     92   
     93            // If the media frame already exists, reopen it.
     94            if (wp_media_frame) {
     95                wp_media_frame.open();
     96                return;
     97            }
     98   
     99            // Create the media frame.
     100            wp_media_frame = wp.media.frames.wp_media_frame = wp.media({
     101                title: 'Select Image for Related Box',
     102                button: {
     103                    text: 'Use this image',
     104                },
     105                multiple: false
     106            });
     107   
     108            // When an image is selected, run a callback.
     109            wp_media_frame.on('select', function() {
     110                var attachment = wp_media_frame.state().get('selection').first().toJSON();
     111                $('#laci-related-box-image').val(attachment.url); // Set the input value to the image URL
     112            });
     113   
     114            // Finally, open the modal.
     115            wp_media_frame.open();
     116        });
    86117    }
    87118}
    88119
    89120jQuery(document).ready(function($){
    90     lacSettings.lacColorPicker($);
    91     lacSettings.importKeyWordsRankMath($);
    92     lacSettings.importKeyWordsYoast($);
     121    wpilSettings.wpilColorPicker($);
     122    wpilSettings.importKeyWordsRankMath($);
     123    wpilSettings.importKeyWordsYoast($);
     124    wpilSettings.uploadImage($);
    93125});
  • laci-link-cluster/trunk/includes/Deactivate.php

    r3165071 r3166563  
    1010
    1111    public static function delete_shortcode() {
    12         update_option( 'laci_delete_shortcode_in_deactivate', 0 );
     12        $laci_delete_shortcode_in_deactivate = get_option( 'laci_delete_shortcode_in_deactivate', 0 );
     13        if ( $laci_delete_shortcode_in_deactivate ) {
     14            laci_delete_shortcode();
     15        }
    1316    }
    1417}
  • laci-link-cluster/trunk/includes/Functions.php

    r3165071 r3166563  
    3434    }
    3535}
     36
     37if ( ! function_exists( 'laci_delete_shortcode' ) ) {
     38    /**
     39     * The function `laci_delete_shortcode` removes the shortcode from the post content.
     40     *
     41     */
     42    function laci_delete_shortcode() {
     43        global $wpdb;
     44
     45        // Pattern to match the entire Gutenberg block containing the shortcode
     46        $pattern = '<!-- wp:shortcode -->\s*\[laci_related_post_content[^\]]*\]\s*<!-- \/wp:shortcode -->';
     47
     48        // Update the posts' content by removing the matched blocks
     49        $wpdb->query(
     50            $wpdb->prepare(
     51                "UPDATE {$wpdb->posts} SET post_content = REGEXP_REPLACE(post_content, %s, '')",
     52                $pattern
     53            )
     54        );
     55    }
     56}
  • laci-link-cluster/trunk/includes/Utils/Helpers.php

    r3165071 r3166563  
    99
    1010    public static function wp_kses_allowed_html( $cus_attr_tags = [] ) {
    11         $allowed_html_tags           = wp_kses_allowed_html( 'post' );
    12         $allowed_html_tags['style']  = true;
     11        $allowed_html_tags = wp_kses_allowed_html( 'post' );
     12
     13        $allowed_html_tags['style'] = true;
     14
     15        $allowed_html_tags['select'] = [
     16            'id'       => true,
     17            'class'    => true,
     18            'name'     => true,
     19            'style'    => true,
     20            'multiple' => true,
     21            'data-id'  => true,
     22        ];
     23
     24        $allowed_html_tags['option'] = [
     25            'value'    => true,
     26            'selected' => true,
     27            'style'    => true,
     28            'class'    => true,
     29            'data-id'  => true,
     30        ];
     31
    1332        $allowed_html_tags['script'] = true;
    14         $allowed_html_attr           = $cus_attr_tags;
     33
     34        $allowed_html_attr = $cus_attr_tags;
    1535
    1636        return array_map(
  • laci-link-cluster/trunk/readme.txt

    r3165075 r3166563  
    55Tested up to: 6.6
    66Requires PHP: 7.1.0
    7 Stable tag: 1.0.0
     7Stable tag: 1.0.1
    88License: GPLv2 or later
    99License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    4444= 1.0.0 =
    4545* Initial release
    46 
    47 == Upgrade Notice ==
    48 
    49 = 1.0.0 =
    50 This is the initial release of the Link and Cluster plugin.
     46= 1.0.1 =
     47* Update security
    5148
    5249== Screenshots ==
  • laci-link-cluster/trunk/templates/dashboard/column-title.php

    r3165071 r3166563  
    1111    <span class="laci-title-action-item laci-link-assistant-item">
    1212        <span class="dashicons dashicons-search"></span>
    13         <a class="link-assistant" target="_blank" href="<?php echo esc_attr( $link_assistant ); ?>"><?php esc_html_e( 'Internal Link Opportunities', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></a>
     13        <a class="link-assistant" target="_blank" href="<?php echo esc_attr( $link_assistant ); ?>"><?php esc_html_e( 'Internal Link Opportunities', 'laci-link-cluster' ); ?></a>
    1414    </span>
    1515    <span class="laci-title-action-item laci-update-internal-link-item">
    1616        <span class="dashicons dashicons-image-rotate"></span>
    17         <a class="update-internal-link" data-id="<?php echo esc_attr( $item->ID ); ?>"><?php esc_html_e( 'Update Link Count', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></a>
     17        <a class="update-internal-link" data-id="<?php echo esc_attr( $item->ID ); ?>"><?php esc_html_e( 'Update Link Count', 'laci-link-cluster' ); ?></a>
    1818    </span>
    1919    <span class="laci-title-action-item laci-update-focus-keywords">
    2020        <span class="dashicons dashicons-edit"></span>
    21         <a class="laci-action-update-focus-keywords" data-id="<?php echo esc_attr( $item->ID ); ?>"><?php esc_html_e( 'Focus Keywords', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></a>
     21        <a class="laci-action-update-focus-keywords" data-id="<?php echo esc_attr( $item->ID ); ?>"><?php esc_html_e( 'Focus Keywords', 'laci-link-cluster' ); ?></a>
    2222    </span>
    2323</div>
  • laci-link-cluster/trunk/templates/dashboard/dashboard.php

    r3165071 r3166563  
    66    <div class="logo">
    77        <img src="<?php echo esc_url( LACI_INTERNAL_LINKS_PLUGIN_URL . 'assets/admin/images/logo.png' ); ?>" alt="WP Internal Links">
    8         <h2><?php esc_html_e( 'Report & Cluster Cockpit', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></h2>
     8        <h2><?php esc_html_e( 'Report & Cluster Cockpit', 'laci-link-cluster' ); ?></h2>
    99    </div>
    1010
  • laci-link-cluster/trunk/templates/dashboard/popup-info.php

    r3165071 r3166563  
    11<?php
    22defined( 'ABSPATH' ) || exit;
     3$taxonomy_data = get_option( 'laci_internallinks_taxonomy', 'category' );
     4$taxonomy_data = get_taxonomy( $taxonomy_data );
    35
     6$terms = get_the_term_list( $post_id, $taxonomy_data->name, '', ', ', '' );
    47?>
    58
    6 <h3><?php echo esc_html__( 'Information for: ', 'link-and-cluster-automated-seo-link-builder-for-your-site' ) . esc_html( $post_title ); ?></h3>
     9<h3><?php echo esc_html__( 'Information for: ', 'laci-link-cluster' ) . esc_html( $post_title ); ?></h3>
    710
    811<?php
     
    1215        <thead>
    1316            <tr>
    14                 <th><?php esc_html_e( 'Category Name', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
    15                 <th><?php esc_html_e( 'Linked', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     17                <th><?php echo esc_html( $taxonomy_data->label ); ?></th>
     18                <th><?php esc_html_e( 'Linked', 'laci-link-cluster' ); ?></th>
    1619            </tr>
    1720        </thead>
     
    1922            <?php foreach ( $links as $item ) : ?>
    2023                <tr>
    21                     <td><?php echo wp_kses_post( $item['category_name'] ); ?></td>
     24                    <td><?php echo wp_kses_post( $terms ); ?></td>
    2225                    <td><?php echo wp_kses_post( $item['linked'] ); ?></td>
    2326                </tr>
     
    3134        <thead>
    3235            <tr>
    33                 <th><?php esc_html_e( 'Title', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
    34                 <th><?php esc_html_e( 'Type', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
    35                 <th><?php esc_html_e( 'Categories', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
    36                 <th><?php esc_html_e( 'Anchor Text', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     36                <th><?php esc_html_e( 'Title', 'laci-link-cluster' ); ?></th>
     37                <th><?php esc_html_e( 'Type', 'laci-link-cluster' ); ?></th>
     38                <th><?php echo esc_html( $taxonomy_data->label ); ?></th>
     39                <th><?php esc_html_e( 'Anchor Text', 'laci-link-cluster' ); ?></th>
    3740            </tr>
    3841        </thead>
     
    4245                    <td><a href="<?php echo esc_url( get_edit_post_link( $item['ID'] ) ); ?>"><?php echo esc_html( $item['title'] ); ?></a></td>
    4346                    <td><?php echo esc_html( ucfirst( $item['type'] ) ); ?></td>
    44                     <td><?php echo wp_kses_post( $item['categories'] ); ?></td>
     47                    <td><?php echo wp_kses_post( $terms ); ?></td>
    4548                    <td><?php echo wp_kses_post( $item['anchor_text'] ); ?></td>
    4649                </tr>
  • laci-link-cluster/trunk/templates/dashboard/table-report.php

    r3165071 r3166563  
    22defined( 'ABSPATH' ) || exit;
    33
    4 use LACI_InternalLinks\Controllers\LACI_CreatePostListTableController;
     4use LACI_InternalLinks\Controllers\CreatePostListTableController;
    55
    66$nonce = isset( $_REQUEST['nonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['nonce'] ) ) : '';
    7 if ( ! empty( $nonce ) && ! wp_verify_nonce( $nonce, 'wp-internal-links-nonce' ) ) {
     7if ( ! empty( $nonce ) && ! wp_verify_nonce( $nonce, 'laci-internal-links-nonce' ) ) {
    88    wp_die( 'Security check' );
    99}
    1010
    11 $post_list_table = LACI_CreatePostListTableController::get_instance();
     11$post_list_table = CreatePostListTableController::get_instance();
    1212
    1313$post_list_table->prepare_items();
     
    4242            <?php
    4343            $links = [
    44                 'all'    => [ esc_html__( 'All', 'link-and-cluster-automated-seo-link-builder-for-your-site' ), $all_count ],
    45                 'page'   => [ esc_html__( 'Only Page', 'link-and-cluster-automated-seo-link-builder-for-your-site' ), $page_count ],
    46                 'post'   => [ esc_html__( 'Only Post', 'link-and-cluster-automated-seo-link-builder-for-your-site' ), $post_count ],
    47                 'other'  => [ esc_html__( 'Other Post Type', 'link-and-cluster-automated-seo-link-builder-for-your-site' ), $other_count ],
    48                 'orphan' => [ esc_html__( 'Only Orphan Page', 'link-and-cluster-automated-seo-link-builder-for-your-site' ), $orphan_count ],
     44                'all'    => [ esc_html__( 'All', 'laci-link-cluster' ), $all_count ],
     45                'page'   => [ esc_html__( 'Only Page', 'laci-link-cluster' ), $page_count ],
     46                'post'   => [ esc_html__( 'Only Post', 'laci-link-cluster' ), $post_count ],
     47                'other'  => [ esc_html__( 'Other Post Type', 'laci-link-cluster' ), $other_count ],
     48                'orphan' => [ esc_html__( 'Only Orphan Page', 'laci-link-cluster' ), $orphan_count ],
    4949            ];
    50 
    51 
    5250
    5351            foreach ( $links as $key => $label_count ) {
    5452                $class = ( $get_post_type === $key || ( $only_orphan && 'orphan' === $key ) ) ? 'class="current"' : '';
    55 
    56                 $href = add_query_arg(
    57                     [
    58                         'get_post_type' => 'orphan' !== $key ? $key : '',
    59                         'only_orphan'   => 'orphan' === $key ? '1' : '',
    60                         'page'          => 'laci_internal_links_dashboard',
    61                     ]
     53                $href  = add_query_arg(
     54                    array_merge(
     55                        $_REQUEST,
     56                        [
     57                            'get_post_type' => 'orphan' !== $key ? $key : '',
     58                            'only_orphan'   => 'orphan' === $key ? '1' : '',
     59                            'page'          => 'laci_internal_links_dashboard',
     60                        ]
     61                    )
    6262                );
    6363                // $href  = remove_query_arg(
     
    8888            <input type="hidden" name="only_orphan" value="<?php echo esc_html( $only_orphan ); ?>">
    8989            <input type="hidden" name="page" value="laci_internal_links_dashboard">
    90             <input type="hidden" name="nonce" value="<?php echo wp_kses_post( wp_create_nonce( 'wp-internal-links-nonce' ) ); ?>">
     90            <input type="hidden" name="nonce" value="<?php echo wp_kses_post( wp_create_nonce( 'laci-internal-links-nonce' ) ); ?>">
    9191            <input type="search" id="search_id-search-input" name="s" value="<?php echo esc_html( $search_value ); ?>">
    9292            <input type="submit" id="search-submit" class="button" value="Search">
    93             <select name="category" id="category">
    94                 <option value=""><?php esc_html_e( 'All Category', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></option>
    95                 <?php
    96                 $selected_category = isset( $_GET['category'] ) ? sanitize_text_field( wp_unslash( $_GET['category'] ) ) : '';
    97                 $categories        = get_categories();
     93            <?php
     94            $taxonomy_val = get_option( 'laci_internallinks_taxonomy', 'category' );
    9895
    99                 foreach ( $categories as $cate_item ) {
    100                     $selected = strval( $cate_item->term_id ) === $selected_category ? 'selected' : '';
    101                     echo '<option value="' . esc_attr( $cate_item->term_id ) . '" ' . esc_attr( $selected ) . '>' . esc_html( $cate_item->name ) . '</option>';
    102                 }
    103 
    104                 ?>
    105             </select>
     96            wp_dropdown_categories(
     97                [
     98                    'taxonomy'        => $taxonomy_val,
     99                    'hide_empty'      => false,
     100                    'name'            => 'category',
     101                    'id'              => 'category',
     102                    'show_option_all' => __( 'All Terms', 'laci-link-cluster' ),
     103                    'selected'        => isset( $_GET['category'] ) ? intval( $_GET['category'] ) : 0,
     104                    'hierarchical'    => true,
     105                    'value_field'     => 'term_id',
     106                ]
     107            );
     108            ?>
    106109            <input type="submit" value="Filter" class="button">
    107        
    108110            <div class="clear"></div>
    109111            <input type="hidden" name="page" value="laci_internal_links_dashboard">
    110             <input type="hidden" name="nonce" value="<?php echo wp_kses_post( wp_create_nonce( 'wp-internal-links-nonce' ) ); ?>">
     112            <input type="hidden" name="nonce" value="<?php echo wp_kses_post( wp_create_nonce( 'laci-internal-links-nonce' ) ); ?>">
    111113            <div class="laci-filter-link-group">
    112114                <div>
    113115                    <div class="laci-filter-link-item">
    114                         <label class="laci-label-filter-number" for="quantity"><?php esc_html_e( 'INBOUND LINKS ENTIRE SITE', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></label>
     116                        <label class="laci-label-filter-number" for="quantity"><?php esc_html_e( 'INBOUND LINKS ENTIRE SITE', 'laci-link-cluster' ); ?></label>
    115117                        <input class="laci-filter-link" style="width: 70px" type="number" id="quantity" name="inbound_link_entire_site_quantity_from" min="0" max="9000" value="<?php echo esc_attr( $inbound_link_entire_site_quantity_from ); ?>" placeholder="from">
    116118                        <input class="laci-filter-link"  style="width: 70px" type="number" id="quantity" name="inbound_link_entire_site_quantity_to" min="0" max="9000" value="<?php echo esc_attr( $inbound_link_entire_site_quantity_to ); ?>"  placeholder="to">
     
    118120                    </div>
    119121                    <div class="laci-filter-link-item">
    120                         <label class="laci-label-filter-number" for="quantity"><?php esc_html_e( 'OUTBOUND LINKS ENTIRE SITE', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></label>
     122                        <label class="laci-label-filter-number" for="quantity"><?php esc_html_e( 'OUTBOUND LINKS ENTIRE SITE', 'laci-link-cluster' ); ?></label>
    121123                        <input class="laci-filter-link" style="width: 70px" type="number" id="quantity" name="outbound_link_entire_site_quantity_from" min="0" max="9000" value="<?php echo esc_attr( $outbound_link_entire_site_quantity_from ); ?>" placeholder="from">
    122124                        <input class="laci-filter-link" style="width: 70px" type="number" id="quantity" name="outbound_link_entire_site_quantity_to" min="0" max="9000" value="<?php echo esc_attr( $outbound_link_entire_site_quantity_to ); ?>"  placeholder="to">
     
    125127                <div>
    126128                    <div class="laci-filter-link-item">
    127                         <label class="laci-label-filter-number" for="quantity"><?php esc_html_e( 'INBOUND LINKS SAME CLUSTER', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></label>
     129                        <label class="laci-label-filter-number" for="quantity"><?php esc_html_e( 'INBOUND LINKS SAME CLUSTER', 'laci-link-cluster' ); ?></label>
    128130                        <input class="laci-filter-link" style="width: 70px" type="number" id="quantity" name="inbound_links_in_category_quantity_from" min="0" max="9000" value="<?php echo esc_attr( $inbound_links_in_category_quantity_from ); ?>"  placeholder="from">
    129131                        <input class="laci-filter-link" style="width: 70px" type="number" id="quantity" name="inbound_links_in_category_quantity_to" min="0" max="9000" value="<?php echo esc_attr( $inbound_links_in_category_quantity_to ); ?>"  placeholder="to">
    130132                    </div>
    131133                    <div class="laci-filter-link-item">
    132                         <label class="laci-label-filter-number" for="quantity"><?php esc_html_e( 'OUTBOUND LINKS SAME CLUSTER', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></label>
     134                        <label class="laci-label-filter-number" for="quantity"><?php esc_html_e( 'OUTBOUND LINKS SAME CLUSTER', 'laci-link-cluster' ); ?></label>
    133135                        <input class="laci-filter-link" style="width: 70px" type="number" id="quantity" name="outbound_links_in_category_quantity_from" min="0" max="9000" value="<?php echo esc_attr( $outbound_links_in_category_quantity_from ); ?>" placeholder="from">
    134136                        <input class="laci-filter-link" style="width: 70px" type="number" id="quantity" name="outbound_links_in_category_quantity_to" min="0" max="9000" value="<?php echo esc_attr( $outbound_links_in_category_quantity_to ); ?>" placeholder="to">
     
    147149            <span class="laci-action-update-post-to-db">
    148150                <span class="dashicons dashicons-update laci-icon-update-post"></span>
    149                 <?php esc_html_e( 'Update Link Count for the Entire Site', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?>
     151                <?php esc_html_e( 'Update Link Count for the Entire Site', 'laci-link-cluster' ); ?>
    150152            </span>
    151153            <span class="laci-percent-updated"><span class="laci-percent-number">0</span><span>% Updated</span></span>
    152154            <?php if ( ! empty( get_option( 'laci_last_updated_date' ) ) && ! empty( get_option( 'laci_last_updated_time' ) ) ) { ?>
    153             <span class="laci-time-updated">[<?php esc_html_e( 'Last Update:', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?> <?php echo esc_html( get_option( 'laci_last_updated_time' ) ); ?> on <?php echo esc_html( get_option( 'laci_last_updated_date' ) ); ?>]</span>
     155            <span class="laci-time-updated">[<?php esc_html_e( 'Last Update:', 'laci-link-cluster' ); ?> <?php echo esc_html( get_option( 'laci_last_updated_time' ) ); ?> on <?php echo esc_html( get_option( 'laci_last_updated_date' ) ); ?>]</span>
    154156            <?php } ?>
    155157    </div>
  • laci-link-cluster/trunk/templates/meta-box/suggestion-table.php

    r3165071 r3166563  
    22defined( 'ABSPATH' ) || exit;
    33?>
     4<style>
     5    table {
     6        width: 100%;
     7        border-collapse: collapse;
     8    }
     9
     10    table th {
     11        background-color: #f1f1f1;
     12        border: 1px solid #ddd;
     13        padding: 8px;
     14        text-align: left;
     15    }
     16
     17    table td {
     18        border: 1px solid #ddd;
     19        padding: 8px;
     20    }
     21
     22    table td.copy {
     23        text-align: center;
     24    }
     25</style>
    426
    527<table class="laci-table-suggested">
    628    <thead>
    729        <tr>
    8             <th><b><?php esc_html_e( 'Phrases In This Post To Link From', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></b></th>
    9             <th><b><?php esc_html_e( 'Suggested Posts To Link To', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></b></th>
    10             <th><b><?php esc_html_e( 'Action', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></b></th>
     30            <th><b><?php esc_html_e( 'Phrases In This Post To Link From', 'laci-link-cluster' ); ?></b></th>
     31            <th><b><?php esc_html_e( 'Suggested Posts To Link To', 'laci-link-cluster' ); ?></b></th>
     32            <th><b><?php esc_html_e( 'Action', 'laci-link-cluster' ); ?></b></th>
    1133        </tr>
    1234    </thead>
     
    1941                <td>
    2042                    <div>
    21                         <strong><?php esc_html_e( 'Title', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></strong>
     43                        <strong><?php esc_html_e( 'Title', 'laci-link-cluster' ); ?></strong>
    2244                        <span><i><strong><?php echo esc_html( $suggestion['title_post_outbound'] ); ?></strong></i></span>
    2345                    </div>
    2446                    <div>
    25                         <strong><?php esc_html_e( 'Url:', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></strong>
     47                        <strong><?php esc_html_e( 'Url:', 'laci-link-cluster' ); ?></strong>
    2648                        <span><a href="<?php echo esc_url( $suggestion['url_post_outbound'] ); ?>"><?php echo esc_url( $suggestion['url_post_outbound'] ); ?></a></span>
    2749                    </div>
    2850                </td>
    2951                <td>
    30                     <button class="button button-primary laci-table-suggested-button-copy"><?php esc_html_e( 'Copy', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></button>
     52                    <button class="button button-primary laci-table-suggested-button-copy"><?php esc_html_e( 'Copy', 'laci-link-cluster' ); ?></button>
    3153                </td>
    3254            </tr>
  • laci-link-cluster/trunk/templates/placement-assistant/box-content.php

    r3165071 r3166563  
    11<?php
    2 defined( 'ABSPATH' ) || exit;
    32$laci_related_box__content = get_option( 'laci_related_box__content', '' );
    43$laci_related_box__title   = get_option( 'laci_related_box__title', '0' );
     
    1312$list_key_word = explode( ',', $key_words );
    1413
    15 $key_word      = $list_key_word[0];
    16 $firt_location = strpos( $post_content, $key_word ) ? strpos( $post_content, $key_word ) : strlen( $post_content );
     14$key_word = $list_key_word[0];
     15
     16$firt_location = stripos( $post_content, $key_word ) ? stripos( $post_content, $key_word ) : strlen( $post_content );
    1717
    1818foreach ( $list_key_word as $item ) {
    19     $location = strpos( $post_content, $item );
     19    $location = stripos( $post_content, trim( $item ) );
    2020    if ( $location && ( $location < $firt_location ) ) {
    2121        $key_word = $item;
  • laci-link-cluster/trunk/templates/placement-assistant/diff-category.php

    r3165071 r3166563  
    22defined( 'ABSPATH' ) || exit;
    33
    4 use LACI_InternalLinks\Controllers\LACI_CreatePostListTableController;
    5 use LACI_InternalLinks\Controllers\LACI_InternalLinksController;
     4use LACI_InternalLinks\Controllers\CreatePostListTableController;
     5use LACI_InternalLinks\Controllers\InternalLinksController;
    66
    77if ( empty( $result_diff_cat ) ) {
     
    2828        <div class="laci-left-section">
    2929            <div class="laci-category">
    30                 <h3 style="margin-top:0"><?php esc_html_e( 'Category: ', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></h3>
    31                 <span><?php laci_kses_post_e( LACI_CreatePostListTableController::get_hierarchical_categories( $post_id_data ) ); ?></span>
     30                <h3 style="margin-top:0"><?php echo esc_html( $taxonomy_data->label ); ?></h3>
     31                <span><?php laci_kses_post_e( CreatePostListTableController::get_hierarchical_categories( $post_id_data ) ); ?></span>
    3232            </div>
    3333        </div>
     
    4747            </div>
    4848            <div class="laci-diff-cat-action">
    49                 <span class="laci-diff-cat-num-results"><?php echo ( esc_html( $total_results ) . esc_html__( ' - Search Results', 'link-and-cluster-automated-seo-link-builder-for-your-site' ) ); ?></span>
    50                 <button class="button laci-diff-cat-content-previous" disabled><?php esc_html_e( '<< Previous', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></button>
    51                 <button class="button laci-diff-cat-content-next" <?php echo esc_attr( $total_results < 2 ? 'disabled' : '' ); ?>><?php esc_html_e( 'Next >>', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></button>
    52                 <button class="button laci-diff-cat-content-edit"><?php esc_html_e( 'Edit & Place Link', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></button>
    53                 <button class="button laci-add-related-box"><?php esc_html_e( 'Add Related Box', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></button>
     49                <span class="laci-diff-cat-num-results"><?php echo ( esc_html( $total_results ) . esc_html__( ' - Search Results', 'laci-link-cluster' ) ); ?></span>
     50                <button class="button laci-diff-cat-content-previous" disabled><?php esc_html_e( '<< Previous', 'laci-link-cluster' ); ?></button>
     51                <button class="button laci-diff-cat-content-next" <?php echo esc_attr( $total_results < 2 ? 'disabled' : '' ); ?>><?php esc_html_e( 'Next >>', 'laci-link-cluster' ); ?></button>
     52                <button class="button laci-diff-cat-content-edit"><?php esc_html_e( 'Edit & Place Link', 'laci-link-cluster' ); ?></button>
     53                <button class="button laci-add-related-box"><?php esc_html_e( 'Add Related Box', 'laci-link-cluster' ); ?></button>
    5454            </div>
    5555        </div>
    5656        <div class="laci-right-section">
    57             <div><?php echo esc_html__( 'Outgoing Links to', 'link-and-cluster-automated-seo-link-builder-for-your-site' ) . esc_html( $post_title ); ?>: <?php echo esc_html( LACI_InternalLinksController::laci_count_outbound_links_between_posts( $post_id_data, $post_id_main ) ); ?></div>
    58             <div><?php echo esc_html__( 'Outbound Internal Links:', 'link-and-cluster-automated-seo-link-builder-for-your-site' ) . esc_html( count( LACI_InternalLinksController::laci_get_outbound_internal_links( $post_id_data ) ) ); ?></div>
    59             <div><?php echo esc_html__( 'Inbound Internal Links:', 'link-and-cluster-automated-seo-link-builder-for-your-site' ) . esc_html( count( LACI_InternalLinksController::laci_get_inbound_internal_links( $post_id_data ) ) ); ?></div>
     57            <div><?php echo esc_html__( 'Outgoing Links to', 'laci-link-cluster' ) . esc_html( $post_title ); ?>: <?php echo esc_html( InternalLinksController::count_outbound_links_between_posts( $post_id_data, $post_id_main ) ); ?></div>
     58            <div><?php echo esc_html__( 'Outbound Internal Links:', 'laci-link-cluster' ) . esc_html( count( InternalLinksController::get_outbound_internal_links( $post_id_data ) ) ); ?></div>
     59            <div><?php echo esc_html__( 'Inbound Internal Links:', 'laci-link-cluster' ) . esc_html( count( InternalLinksController::get_inbound_internal_links( $post_id_data ) ) ); ?></div>
    6060        </div>
    6161    </div>
  • laci-link-cluster/trunk/templates/placement-assistant/placement-assistant.php

    r3165071 r3166563  
    11<?php
    22defined( 'ABSPATH' ) || exit;
    3 use LACI_InternalLinks\Controllers\LACI_LinkAssistantController;
     3use LACI_InternalLinks\Controllers\LinkAssistantController;
    44
    5 $post_table = LACI_LinkAssistantController::get_instance();
     5$post_table = LinkAssistantController::get_instance();
    66$post_table->prepare_items();
    77
    88$nonce = isset( $_REQUEST['nonce'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['nonce'] ) ) : '';
    9 if ( ! empty( $nonce ) && ! wp_verify_nonce( $nonce, 'wp-internal-links-nonce' ) ) {
     9if ( ! empty( $nonce ) && ! wp_verify_nonce( $nonce, 'laci-internal-links-nonce' ) ) {
    1010    wp_die( 'Security check' );
    1111}
     
    1818$key_words_implode = is_array( $key_words ) ? implode( ',', $key_words ) : '';
    1919
    20 $content   = '';
    21 $editor_id = 'popup-editor';
    22 $settings  = [
    23     'textarea_name' => 'popup-editor',
    24     'media_buttons' => true,
    25     'teeny'         => false,
    26     'quicktags'     => true,
    27     'tinymce'       => [
    28         'plugins'     => 'wordpress, wplink, wpeditimage, custom_button_add_link',
    29         'toolbar1'    => 'undo redo | styleselect | bold italic fontsizeselect hr alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | mediaImageLibrary  | mediaimagelibrary fullscreen shortcodeList | custom_button_add_link',
    30         'height'      => 180,
    31         'content_css' => LACI_INTERNAL_LINKS_PLUGIN_URL . 'assets/admin/css/laci-editor-style.css',
    32     ],
    33 ];
     20$taxonomy_data = get_option( 'laci_internallinks_taxonomy', 'category' );
     21$taxonomy_data = get_taxonomy( $taxonomy_data );
    3422
    3523?>
    36 <div class="wp-internal-links-popup" title="Text Editor" style="display: none;">
    37     <?php wp_editor( $content, $editor_id, $settings ); ?>
    38 </div>
    39 <div id="laci-current-data"  style="display: none;"></div>
     24<div class="laci-laci-placement-assistant-container">
     25    <div class="laci-laci-placement-assistant-update-pro">
     26        <div class="laci-update-pro-text">
     27            <a class="button button-primary laci-buy-pro" href="https://linkandcluster.com/" target="_blank">
     28                <?php esc_html_e( 'Note: This is just a demo. To get it please buy our pro version', 'laci-link-cluster' ); ?>
     29            </a>
     30        </div>
     31    </div>
    4032
    41 <div class="laci-placement-assistant">
    42     <div class="wrap">
    43         <div class="laci-placement-assistant-title" data-link="<?php echo esc_attr( $post_link ); ?>" data-title="<?php echo esc_attr( $post_title ); ?>" data-id="<?php echo esc_attr( $post_id_data ); ?>" data-keywords="<?php echo esc_attr( $key_words_implode ); ?>">
    44             <h1><?php echo ( esc_html__( 'Link Assistant to find Link Opportunities for: ', 'link-and-cluster-automated-seo-link-builder-for-your-site' ) . esc_html( $post_title ) ); ?></h1>
    45         </div>
    46         <div>
    47             <?php $post_table->display(); ?>
    48         </div>
    49         <div class="laci-search-group">
    50             <div class="laci-search-control">
    51                 <input type="text" class="laci-search-input-control" placeholder="key_word1, key_word2,..." style="width:100%;height:50px" data-id="<?php echo esc_html( $post_id_data ); ?>">
    52                 <p class="laci-insert-main-key-word"><?php esc_html_e( '[ INSERT MAIN KEYWORDS FOR THE POST ]', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></p>
     33    <div class="laci-placement-assistant">
     34        <div class="wrap">
     35            <div class="laci-placement-assistant-title" data-link="<?php echo esc_attr( $post_link ); ?>" data-title="<?php echo esc_attr( $post_title ); ?>" data-id="<?php echo esc_attr( $post_id_data ); ?>" data-keywords="<?php echo esc_attr( $key_words_implode ); ?>">
     36                <h1><?php echo ( esc_html__( 'Link Assistant to find Link Opportunities for: ', 'laci-link-cluster' ) . esc_html( $post_title ) ); ?></h1>
    5337            </div>
    54             <button class="button laci-search-button"><?php esc_html_e( 'Search', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></button>
    55         </div>
    56         <div class="laci-search-text"><?php esc_html_e( 'Search Results:', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></div>
    57         <div class="laci-search-results-group">
    58             <div class="laci-search-results__same-category">
    59                 <div class="laci-search-results__same-category__title">
    60                     <p class="laci-text-title"><?php esc_html_e( 'SAME CATEGORY / CLUSTER: IN-TEXT LINK OPPORTUNITIES', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></p>
     38            <div>
     39                <?php $post_table->display(); ?>
     40            </div>
     41            <div class="laci-search-group">
     42                <div class="laci-search-control">
     43                    <input type="text" class="laci-search-input-control" placeholder="key_word1, key_word2,..." style="width:100%;height:50px" data-id="<?php echo esc_html( $post_id_data ); ?>">
     44                    <p class="laci-insert-main-key-word"><?php esc_html_e( '[ INSERT MAIN KEYWORDS FOR THE POST ]', 'laci-link-cluster' ); ?></p>
    6145                </div>
    62                 <div class="laci-search-results__same-category__content">
    63                     <?php
    64                     $post_id_main = isset( $_REQUEST['post_id'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['post_id'] ) ) : '';
    65                     //$key_word     = isset( $_REQUEST['key_word'] ) ? sanitize_text_field( $_REQUEST['key_word'] ) : '';
    66                     $key_word = '';
    67                     if ( ! empty( $post_id_main ) && empty( $key_word ) ) {
    68                         $key_words = get_post_meta( $post_id_main, 'laci_list_key_word', true );
    69                         $key_word  = is_array( $key_words ) ? implode( ',', $key_words ) : '';
    70                     }
     46                <button class="button laci-search-button"><?php esc_html_e( 'Search', 'laci-link-cluster' ); ?></button>
     47            </div>
     48            <div class="laci-search-text"><?php esc_html_e( 'Search Results:', 'laci-link-cluster' ); ?></div>
     49            <div class="laci-search-results-group">
     50                <div class="laci-search-results__same-category">
     51                    <div class="laci-search-results__same-category__title">
     52                        <p class="laci-text-title">
     53                            <?php
     54                            // translators: %s: taxonomy label
     55                            echo sprintf( esc_html__( 'SAME %s / CLUSTER: IN-TEXT LINK OPPORTUNITIES', 'laci-link-cluster' ), esc_html( strtoupper( $taxonomy_data->label ) ) );
     56                            ?>
     57                        </p>
     58                    </div>
     59                    <div class="laci-search-results__same-category__content">
    7160
    72                     $key_word = preg_replace( '/,+/', ',', $key_word );
    73                     $key_word = rtrim( $key_word, ',' );
     61                    </div>
     62                    <div class="laci-loading laci-updating-message" style="display: none;"></div>
     63                    <div class="laci-search-results__same-category__load-more <?php echo esc_attr( $class_name ); ?>">
     64                        <button class="button laci-load-more-same-category" data-post-id="" data-key-word="" data-max-pages=""><?php esc_html_e( 'Load More', 'laci-link-cluster' ); ?></button>
     65                    </div>
     66                </div>
    7467
    75                     $result_same_cat             = LACI_InternalLinks\Controllers\LACI_PlacementAssistantController::get_posts_with_keyword_in_same_categories( $post_id_main, $key_word );
    76                     $result_same_cat ['post_id'] = $post_id_main;
    77                     $class_name                  = isset( $result_same_cat['max_pages'] ) && (int) $result_same_cat['max_pages'] > 1 ? '' : 'laci-display-none';
    78                     if ( ! empty( $key_word ) && ! empty( $result_same_cat['posts_data'] ) ) {
    79                         ob_start();
    80                         require LACI_INTERNAL_LINKS_PLUGIN_PATH . 'templates/placement-assistant/same-category.php';
    81                         $html = ob_get_contents();
    82                         ob_end_clean();
    83                         laci_kses_post_e( $html );
    84                     } else {
    85                         echo '<p class="laci-text-not-info">' . esc_html__( 'No posts found with the keyword(s) in the same categories', 'link-and-cluster-automated-seo-link-builder-for-your-site' ) . '</p>';
    86                     }
    87                     ?>
     68                <div class="laci-search-results__diff-category">
     69                    <div class="laci-search-results__diff-category__title">
     70                        <p class="laci-text-title">
     71                            <?php
     72                            // translators: %s: taxonomy label
     73                            echo sprintf( esc_html__( 'OTHER %s / CLUSTER: IN-TEXT LINK OPPORTUNITIES', 'laci-link-cluster' ), esc_html( strtoupper( $taxonomy_data->label ) ) );
     74                            ?>
     75                        </p>
     76                    </div>
     77                    <div class="laci-search-results__diff-category__content">
    8878
    89                 </div>
    90                 <div class="laci-loading laci-updating-message" style="display: none;"></div>
    91                 <div class="laci-search-results__same-category__load-more <?php echo esc_attr( $class_name ); ?>">
    92                     <?php if ( isset( $result_same_cat['max_pages'] ) && $result_same_cat['max_pages'] > 1 ) { ?>
    93                         <button class="button laci-load-more-same-category" data-post-id="<?php echo esc_attr( $post_id_main ); ?>" data-key-word="<?php echo esc_attr( $key_word ); ?>" data-max-pages="<?php echo esc_attr( $result_same_cat['max_pages'] ); ?>"><?php esc_html_e( 'Load More', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></button>
    94                     <?php } else { ?>
    95                         <button class="button laci-load-more-same-category" data-post-id="" data-key-word="" data-max-pages=""><?php esc_html_e( 'Load More', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></button>
    96                     <?php } ?>
    97                 </div>
    98             </div>
    99 
    100             <div class="laci-search-results__diff-category">
    101                 <div class="laci-search-results__diff-category__title">
    102                     <p class="laci-text-title"><?php esc_html_e( 'OTHER CATEGORY / CLUSTER: IN-TEXT LINK OPPORTUNITIES', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></p>
    103                 </div>
    104                 <div class="laci-search-results__diff-category__content">
    105                     <?php
    106                     $post_id_main_diff = isset( $_REQUEST['post_id'] ) ? sanitize_text_field( wp_unslash( $_REQUEST['post_id'] ) ) : '';
    107                     //$key_word          = isset( $_REQUEST['key_word'] ) ? sanitize_text_field( $_REQUEST['key_word'] ) : '';
    108 
    109                     $key_word = '';
    110                     if ( ! empty( $post_id_main_diff ) && empty( $key_word ) ) {
    111                         $key_words = get_post_meta( $post_id_main, 'laci_list_key_word', true );
    112                         $key_word  = is_array( $key_words ) ? implode( ',', $key_words ) : '';
    113                     }
    114 
    115                     $key_word                    = rtrim( $key_word, ',' );
    116                     $key_word                    = preg_replace( '/,+/', ',', $key_word );
    117                     $result_diff_cat             = LACI_InternalLinks\Controllers\LACI_PlacementAssistantController::get_posts_with_keyword_in_diff_categories( $post_id_main_diff, $key_word );
    118                     $result_diff_cat ['post_id'] = $post_id_main_diff;
    119                     $class_name_diff             = isset( $result_diff_cat['max_pages'] ) && (int) $result_diff_cat['max_pages'] > 1 ? '' : 'laci-display-none';
    120                     if ( ! empty( $key_word ) && ! empty( $result_diff_cat['posts_data'] ) ) {
    121                         ob_start();
    122                         require LACI_INTERNAL_LINKS_PLUGIN_PATH . 'templates/placement-assistant/diff-category.php';
    123                         $html = ob_get_contents();
    124                         ob_end_clean();
    125                         laci_kses_post_e( $html );
    126                     } else {
    127                         echo '<p class="laci-text-not-info">' . esc_html__( 'No posts found with the keyword(s) in the same categories', 'link-and-cluster-automated-seo-link-builder-for-your-site' ) . '</p>';
    128                     }
    129                     ?>
    130 
    131                 </div>
    132                 <div class="laci-loading laci-updating-message" style="display: none;"></div>
    133                 <div class="laci-search-results__diff-category__load-more <?php echo esc_attr( $class_name_diff ); ?>">
    134                     <?php if ( isset( $result_diff_cat['max_pages'] ) && $result_diff_cat['max_pages'] > 1 ) { ?>
    135                         <button class="button laci-load-more-diff-category" data-post-id="<?php echo esc_attr( $post_id_main_diff ); ?>" data-key-word="<?php echo esc_attr( $key_word ); ?>" data-max-pages="<?php echo esc_attr( $result_diff_cat['max_pages'] ); ?>"><?php esc_html_e( 'Load More', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></button>
    136                     <?php } else { ?>
    137                         <button class="button laci-load-more-diff-category" data-post-id="" data-key-word="" data-max-pages=""><?php esc_html_e( 'Load More', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></button>
    138                     <?php } ?>
     79                    </div>
     80                    <div class="laci-loading laci-updating-message" style="display: none;"></div>
     81                    <div class="laci-search-results__diff-category__load-more <?php echo esc_attr( $class_name_diff ); ?>">
     82                        <button class="button laci-load-more-diff-category" data-post-id="" data-key-word="" data-max-pages=""><?php esc_html_e( 'Load More', 'laci-link-cluster' ); ?></button>
     83                    </div>
    13984                </div>
    14085            </div>
  • laci-link-cluster/trunk/templates/placement-assistant/same-category.php

    r3165071 r3166563  
    22defined( 'ABSPATH' ) || exit;
    33
    4 use LACI_InternalLinks\Controllers\LACI_CreatePostListTableController;
    5 use LACI_InternalLinks\Controllers\LACI_InternalLinksController;
     4use LACI_InternalLinks\Controllers\CreatePostListTableController;
     5use LACI_InternalLinks\Controllers\InternalLinksController;
    66
    77if ( empty( $result_same_cat ) ) {
     
    2828        <div class="laci-left-section">
    2929            <div class="laci-category">
    30                <h3 style="margin-top:0"><?php esc_html_e( 'Category: ', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></h3>
    31                <span><?php laci_kses_post_e( LACI_CreatePostListTableController::get_hierarchical_categories( $post_id_data ) ); ?></span>
     30               <h3 style="margin-top:0"><?php echo esc_html( $taxonomy_data->label ); ?></h3>
     31               <span><?php laci_kses_post_e( CreatePostListTableController::get_hierarchical_categories( $post_id_data ) ); ?></span>
    3232            </div>
    3333        </div>
     
    4747            </div>
    4848            <div class="laci-same-cat-action">
    49                 <span class="laci-same-cat-num-results"><?php echo ( esc_html( $total_results ) . esc_html__( ' - Search Results', 'link-and-cluster-automated-seo-link-builder-for-your-site' ) ); ?></span>
    50                 <button class="button laci-same-cat-content-previous" disabled><?php esc_html_e( '<< Previous', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></button>
    51                 <button class="button laci-same-cat-content-next" <?php echo esc_attr( $total_results < 2 ? 'disabled' : '' ); ?>><?php esc_html_e( 'Next >>', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></button>
    52                 <button class="button laci-same-cat-content-edit"><?php esc_html_e( 'Edit & Place Link', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></button>
    53                 <button class="button laci-add-related-box"><?php esc_html_e( 'Add Related Box', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></button>
     49                <span class="laci-same-cat-num-results"><?php echo ( esc_html( $total_results ) . esc_html__( ' - Search Results', 'laci-link-cluster' ) ); ?></span>
     50                <button class="button laci-same-cat-content-previous" disabled><?php esc_html_e( '<< Previous', 'laci-link-cluster' ); ?></button>
     51                <button class="button laci-same-cat-content-next" <?php echo esc_attr( $total_results < 2 ? 'disabled' : '' ); ?>><?php esc_html_e( 'Next >>', 'laci-link-cluster' ); ?></button>
     52                <button class="button laci-same-cat-content-edit"><?php esc_html_e( 'Edit & Place Link', 'laci-link-cluster' ); ?></button>
     53                <button class="button laci-add-related-box"><?php esc_html_e( 'Add Related Box', 'laci-link-cluster' ); ?></button>
    5454            </div>
    5555        </div>
    5656        <div class="laci-right-section">
    57             <div><?php echo esc_html__( 'Outgoing Links to', 'link-and-cluster-automated-seo-link-builder-for-your-site' ) . esc_html( $post_title ); ?>: <?php echo esc_html( LACI_InternalLinksController::laci_count_outbound_links_between_posts( $post_id_data, $post_id_main ) ); ?></div>
    58             <div><?php echo esc_html__( 'Outbound Internal Links:', 'link-and-cluster-automated-seo-link-builder-for-your-site' ) . esc_html( count( LACI_InternalLinksController::laci_get_outbound_internal_links( $post_id_data ) ) ); ?></div>
    59             <div><?php echo esc_html__( 'Inbound Internal Links:', 'link-and-cluster-automated-seo-link-builder-for-your-site' ) . esc_html( count( LACI_InternalLinksController::laci_get_inbound_internal_links( $post_id_data ) ) ); ?></div>
     57            <div><?php echo esc_html__( 'Outgoing Links to', 'laci-link-cluster' ) . esc_html( $post_title ); ?>: <?php echo esc_html( InternalLinksController::count_outbound_links_between_posts( $post_id_data, $post_id_main ) ); ?></div>
     58            <div><?php echo esc_html__( 'Outbound Internal Links:', 'laci-link-cluster' ) . esc_html( count( InternalLinksController::get_outbound_internal_links( $post_id_data ) ) ); ?></div>
     59            <div><?php echo esc_html__( 'Inbound Internal Links:', 'laci-link-cluster' ) . esc_html( count( InternalLinksController::get_inbound_internal_links( $post_id_data ) ) ); ?></div>
    6060        </div>
    6161    </div>
  • laci-link-cluster/trunk/templates/settings/import-key-words.php

    r3165071 r3166563  
    55<table class="form-table">
    66    <tr>
    7         <th><?php esc_html_e( 'Import from YOAST', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     7        <th><?php esc_html_e( 'Import from YOAST', 'laci-link-cluster' ); ?></th>
    88        <td>
    9             <button id="import-key-work-yoast" class="button import-key-work-yoast"><?php esc_html_e( 'Import', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></button>
     9            <button id="import-key-work-yoast" class="button import-key-work-yoast"><?php esc_html_e( 'Import', 'laci-link-cluster' ); ?></button>
    1010        </td>
    1111    </tr>
    1212    <tr>
    13         <th><?php esc_html_e( 'Import from RankMath', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     13        <th><?php esc_html_e( 'Import from RankMath', 'laci-link-cluster' ); ?></th>
    1414        <td>
    15             <button id="import-key-work-rank-math" class="button import-key-work-rank-math"><?php esc_html_e( 'Import', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></button>
     15            <button id="import-key-work-rank-math" class="button import-key-work-rank-math"><?php esc_html_e( 'Import', 'laci-link-cluster' ); ?></button>
    1616        </td>
    1717    </tr>
  • laci-link-cluster/trunk/templates/settings/nav-tabs.php

    r3165071 r3166563  
    1111
    1212<div class="wrap">
    13     <h1><?php esc_html_e( 'Settings', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></h1>
    14     <p><?php esc_html_e( 'Welcome to the WP Internal Links plugin settings page.', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></p>
     13    <h1><?php esc_html_e( 'Settings', 'laci-link-cluster' ); ?></h1>
     14    <p><?php esc_html_e( 'Welcome to the WP Internal Links plugin settings page.', 'laci-link-cluster' ); ?></p>
    1515
    1616    <div class="laci-settings-container">
    1717        <h1 class="nav-tab-wrapper hide-if-no-js">
    18             <a href="<?php echo esc_attr( admin_url( 'admin.php?page=wp-internal-links-settings&tab=settings' ) ); ?>" class="nav-tab <?php echo esc_attr( $active_tab_settings ); ?>"><?php esc_html_e( 'Settings', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></a>
    19             <a href="<?php echo esc_attr( admin_url( 'admin.php?page=wp-internal-links-settings&tab=cus_related_box' ) ); ?>" class="nav-tab <?php echo esc_attr( $active_tab_cus_related_box ); ?>"><?php esc_html_e( 'Customs For Related Box', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></a>
    20             <a href="<?php echo esc_attr( admin_url( 'admin.php?page=wp-internal-links-settings&tab=import_key_words' ) ); ?>" class="nav-tab <?php echo esc_attr( $active_tab_import_key_words ); ?>"><?php esc_html_e( 'Import Key Words', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></a>
     18            <a href="<?php echo esc_attr( admin_url( 'admin.php?page=laci-internal-links-settings&tab=settings' ) ); ?>" class="nav-tab <?php echo esc_attr( $active_tab_settings ); ?>"><?php esc_html_e( 'Settings', 'laci-link-cluster' ); ?></a>
    2119        </h1>
    2220        <div class="laci-settings-content">
    2321            <?php
    24             if ( isset( $_GET['tab'] ) && $_GET['tab'] === 'cus_related_box' ) {
    25                 require_once LACI_INTERNAL_LINKS_PLUGIN_PATH . 'templates/settings/related-box.php';
    26             } elseif ( isset( $_GET['tab'] ) && $_GET['tab'] === 'import_key_words' ) {
    27                 require_once LACI_INTERNAL_LINKS_PLUGIN_PATH . 'templates/settings/import-key-words.php';
    28             } else {
    2922                require_once LACI_INTERNAL_LINKS_PLUGIN_PATH . 'templates/settings/settings.php';
    30             }
    3123            ?>
    3224        </div>
  • laci-link-cluster/trunk/templates/settings/related-box-html.php

    r3165071 r3166563  
    1818$laci_related_box__margin_left   = get_option( 'laci_related_box__margin_left', '0' );
    1919
     20$laci_related_box__image        = get_option( 'laci_related_box__image', '' );
     21$laci_related_box__image_width  = get_option( 'laci_related_box__image_width', '100' );
     22$laci_related_box__image_height = get_option( 'laci_related_box__image_height', '100' );
    2023?>
     24<style>
     25    .laci-related-box-container {
     26        padding: <?php echo esc_html( $laci_related_box__padding_top ); ?>px <?php echo esc_html( $laci_related_box__padding_right ); ?>px <?php echo esc_html( $laci_related_box__padding_bottom ); ?>px <?php echo esc_html( $laci_related_box__padding_left ); ?>px;
     27        background: <?php echo esc_html( $laci_related_box__bg_color ); ?>;
     28        border-radius: <?php echo esc_html( $laci_related_box__bd_radius ); ?>px;
     29        color: <?php echo esc_html( $laci_related_box__title_color ); ?>;
     30        border: 1px solid <?php echo esc_html( $laci_related_box__bd_color ); ?>;
     31    }
     32    .laci-related-box-text {
     33        color: <?php echo esc_html( $laci_related_box__content_color ); ?>;
     34    }
    2135
    22 <div class="laci-related-box-container"><?php laci_kses_post_e( $laci_related_box__title ); ?> <span class="laci-related-box-text"><?php echo do_shortcode( $laci_related_box__content ); ?></span></div>
     36    .laci-related-box-container {
     37        display: flex;
     38        flex-direction: row;
     39        align-items: center;
     40    }
     41
     42    .laci-related-box-image {
     43        flex-shrink: 0;
     44        padding-right: 20px;
     45    }
     46
     47    .laci-related-box-image img {
     48        display: block;
     49        max-width: 100%;
     50    }
     51
     52    .laci-related-box-content {
     53        flex: 1;
     54    }
     55</style>
     56
     57<div class="laci-related-box-container">
     58    <?php if ( ! empty( $laci_related_box__image ) ) : ?>
     59        <div class="laci-related-box-image">
     60            <img width="<?php echo esc_attr( $laci_related_box__image_width ); ?>" height="<?php echo esc_attr( $laci_related_box__image_height ); ?>" src="<?php echo esc_url( $laci_related_box__image ); ?>" alt="<?php esc_html_e( 'Related Box Image', 'laci-link-cluster' ); ?>" style="max-width: 100%;" />
     61        </div>
     62    <?php endif; ?>
     63    <div class="laci-related-box-content">
     64        <?php laci_kses_post_e( $laci_related_box__title ); ?>
     65        <span class="laci-related-box-text">
     66            <?php echo do_shortcode( $laci_related_box__content ); ?>
     67        </span>
     68    </div>
     69</div>
  • laci-link-cluster/trunk/templates/settings/related-box.php

    r3165071 r3166563  
    11<?php
    22defined( 'ABSPATH' ) || exit;
    3 use LACI_InternalLinks\Controllers\LACI_SettingsController;
     3use LACI_InternalLinks\Controllers\SettingsController;
    44
    55if ( isset( $_POST['laci-settings-security-token'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['laci-settings-security-token'] ) ), 'laci-settings-security-token' ) ) {
    66    if ( isset( $_POST['reset_to_default'] ) ) {
    7         LACI_SettingsController::laci_set_default_value();
     7        SettingsController::set_default_value();
    88    } elseif ( isset( $_POST['submit'] ) ) {
    9         $data = [
    10             'laci_title_color'                  => isset( $_POST['laci_title_color'] ) ? sanitize_hex_color( wp_unslash( $_POST['laci_title_color'] ) ) : '',
    11             'laci_content_color'                => isset( $_POST['laci_content_color'] ) ? sanitize_hex_color( wp_unslash( $_POST['laci_content_color'] ) ) : '',
    12             'laci_bg_color'                     => isset( $_POST['laci_bg_color'] ) ? sanitize_hex_color( wp_unslash( $_POST['laci_bg_color'] ) ) : '',
    13             'laci_bd_color'                     => isset( $_POST['laci_bd_color'] ) ? sanitize_hex_color( wp_unslash( $_POST['laci_bd_color'] ) ) : '',
    14             'laci_bd_radius'                    => isset( $_POST['laci_bd_radius'] ) ? sanitize_text_field( wp_unslash( $_POST['laci_bd_radius'] ) ) : '',
    15             'laci_pd_top'                       => isset( $_POST['laci_pd_top'] ) ? sanitize_text_field( wp_unslash( $_POST['laci_pd_top'] ) ) : '',
    16             'laci_pd_right'                     => isset( $_POST['laci_pd_right'] ) ? sanitize_text_field( wp_unslash( $_POST['laci_pd_right'] ) ) : '',
    17             'laci_pd_bottom'                    => isset( $_POST['laci_pd_bottom'] ) ? sanitize_text_field( wp_unslash( $_POST['laci_pd_bottom'] ) ) : '',
    18             'laci_pd_left'                      => isset( $_POST['laci_pd_left'] ) ? sanitize_text_field( wp_unslash( $_POST['laci_pd_left'] ) ) : '',
    19             'laci_mg_top'                       => isset( $_POST['laci_mg_top'] ) ? sanitize_text_field( wp_unslash( $_POST['laci_mg_top'] ) ) : '',
    20             'laci_mg_right'                     => isset( $_POST['laci_mg_right'] ) ? sanitize_text_field( wp_unslash( $_POST['laci_mg_right'] ) ) : '',
    21             'laci_mg_bottom'                    => isset( $_POST['laci_mg_bottom'] ) ? sanitize_text_field( wp_unslash( $_POST['laci_mg_bottom'] ) ) : '',
    22             'laci_mg_left'                      => isset( $_POST['laci_mg_left'] ) ? sanitize_text_field( wp_unslash( $_POST['laci_mg_left'] ) ) : '',
    23             'custom-related-box-title-editor'   => isset( $_POST['custom-related-box-title-editor'] ) ? wp_kses_post( wp_unslash( $_POST['custom-related-box-title-editor'] ) ) : '',
    24             'custom-related-box-content-editor' => isset( $_POST['custom-related-box-content-editor'] ) ? wp_kses_post( wp_unslash( $_POST['custom-related-box-content-editor'] ) ) : '',
    25         ];
    26 
    27         LACI_SettingsController::laci_update_option_related_box( $data );
     9        SettingsController::update_option_related_box( $_POST );
    2810    }
    2911}
    30 
    31 $laci_related_box__title_color   = get_option( 'laci_related_box__title_color', '#ffffff' );
    32 $laci_related_box__content_color = get_option( 'laci_related_box__content_color', '#ffffff' );
    33 $laci_related_box__bg_color      = get_option( 'laci_related_box__bg_color', '#ffffff' );
    34 $laci_related_box__bd_color      = get_option( 'laci_related_box__bd_color', '#ffffff' );
    35 $laci_related_box__bd_radius     = get_option( 'laci_related_box__bd_radius', '5' );
    36 
    37 $laci_related_box__padding_top    = get_option( 'laci_related_box__padding_top', '0' );
    38 $laci_related_box__padding_right  = get_option( 'laci_related_box__padding_right', '0' );
    39 $laci_related_box__padding_bottom = get_option( 'laci_related_box__padding_bottom', '0' );
    40 $laci_related_box__padding_left   = get_option( 'laci_related_box__padding_left', '0' );
    41 
    42 $laci_related_box__margin_top    = get_option( 'laci_related_box__margin_top', '0' );
    43 $laci_related_box__margin_right  = get_option( 'laci_related_box__margin_right', '0' );
    44 $laci_related_box__margin_bottom = get_option( 'laci_related_box__margin_bottom', '0' );
    45 $laci_related_box__margin_left   = get_option( 'laci_related_box__margin_left', '0' );
    4612
    4713$laci_related_box__title    = wp_unslash( get_option( 'laci_related_box__title', '0' ) );
     
    6026        'height'           => 180,
    6127        'fontsize_formats' => '10px 12px 14px 16px 18px 20px 24px 28px 32px 36px 48px 60px 72px 96px',
    62         //'content_css'      => LACI_INTERNAL_LINKS_PLUGIN_URL . 'assets/admin/css/laci-editor-style.css',
     28        'content_css'      => LACI_INTERNAL_LINKS_PLUGIN_URL . 'assets/admin/css/laci-editor-style.css',
    6329    ],
    6430];
     
    7440        'height'           => 180,
    7541        'fontsize_formats' => '10px 12px 14px 16px 18px 20px 24px 28px 32px 36px 48px 60px 72px 96px',
    76         //'content_css'      => LACI_INTERNAL_LINKS_PLUGIN_URL . 'assets/admin/css/laci-editor-style.css',
     42        'content_css'      => LACI_INTERNAL_LINKS_PLUGIN_URL . 'assets/admin/css/laci-editor-style.css',
    7743    ],
    7844];
     
    8248    <form class="laci-custom-related-box-form" method="POST">
    8349        <input type='hidden' name='laci-settings-security-token' value='<?php echo esc_attr( wp_create_nonce( 'laci-settings-security-token' ) ); ?>'> 
    84         <h2><?php esc_html_e( 'Custom related box', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></h2>
     50        <h2><?php esc_html_e( 'Custom related box', 'laci-link-cluster' ); ?></h2>
    8551
    8652        <table class="form-table">
    8753            <tr>
    88                 <th><?php esc_html_e( 'Title color', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     54                <th><?php esc_html_e( 'Title color', 'laci-link-cluster' ); ?></th>
    8955                <td>
    9056                    <input type="text" id="laci-title-color" name="laci_title_color" value="<?php echo esc_attr( get_option( 'laci_related_box__title_color', '#ffffff' ) ); ?>" class="laci-title-color__related-box" />
     
    9258            </tr>
    9359            <tr>
    94                 <th><?php esc_html_e( 'Content color', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     60                <th><?php esc_html_e( 'Content color', 'laci-link-cluster' ); ?></th>
    9561                <td>
    9662                    <input type="text" id="laci-content-color" name="laci_content_color" value="<?php echo esc_attr( get_option( 'laci_related_box__content_color', '#ffffff' ) ); ?>" class="laci-content-color__related-box" />
     
    9864            </tr>
    9965            <tr>
    100                 <th><?php esc_html_e( 'Background color', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     66                <th><?php esc_html_e( 'Background color', 'laci-link-cluster' ); ?></th>
    10167                <td>
    10268                    <input type="text" id="laci-bg-color" name="laci_bg_color" value="<?php echo esc_attr( get_option( 'laci_related_box__bg_color', '#ffffff' ) ); ?>" class="laci-bg-color__related-box" />
     
    10470            </tr>
    10571            <tr>
    106                 <th><?php esc_html_e( 'Border color', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     72                <th><?php esc_html_e( 'Border color', 'laci-link-cluster' ); ?></th>
    10773                <td>
    10874                    <input type="text" id="laci-bd-color" name="laci_bd_color" value="<?php echo esc_attr( get_option( 'laci_related_box__bd_color', '#ffffff' ) ); ?>" class="laci-bd-color__related-box" />
     
    11076            </tr>
    11177            <tr>
    112                 <th><?php esc_html_e( 'Border radius (px)', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     78                <th><?php esc_html_e( 'Border radius (px)', 'laci-link-cluster' ); ?></th>
    11379                <td>
    11480                    <input  style="width: 50px;" type="number" id="laci-bd-radius" name="laci_bd_radius" value="<?php echo esc_attr( get_option( 'laci_related_box__bd_radius', '5' ) ); ?>" class="laci-bd-radius__related-box" />
     
    11682            </tr>
    11783            <tr>
    118                 <th><?php esc_html_e( 'Padding (px)', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     84                <th><?php esc_html_e( 'Padding (px)', 'laci-link-cluster' ); ?></th>
    11985                <td>
    12086                    <div>
     
    13399            </tr>
    134100            <tr>
    135                 <th><?php esc_html_e( 'Margin (px)', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     101                <th><?php esc_html_e( 'Margin (px)', 'laci-link-cluster' ); ?></th>
    136102                <td>
    137103                    <div>
     
    150116            </tr>
    151117            <tr>
    152                 <th><?php esc_html_e( 'Title related box', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     118                <th><?php esc_html_e( 'Related box image', 'laci-link-cluster' ); ?></th>
     119                <td>
     120                    <input type="text" id="laci-related-box-image" name="laci_related_box_image" value="<?php echo esc_attr( get_option( 'laci_related_box__image', '' ) ); ?>" style="width: 70%;" />
     121                    <button type="button" class="button" id="laci-related-box-image-upload"><?php esc_html_e( 'Select Image', 'laci-link-cluster' ); ?></button>
     122                </td>
     123            </tr>
     124            <tr>
     125                <th><?php esc_html_e( 'Image width(px)', 'laci-link-cluster' ); ?></th>
     126                <td>
     127                    <input  style="width: 100px;" type="number" id="laci-related-box-image-width" name="laci_related_box_image_width" value="<?php echo esc_attr( get_option( 'laci_related_box__image_width', '100' ) ); ?>" />
     128                </td>
     129            </tr>
     130            <tr>
     131                <th><?php esc_html_e( 'Image height(px)', 'laci-link-cluster' ); ?></th>
     132                <td>
     133                    <input  style="width: 100px;" type="number" id="laci-related-box-image-height" name="laci_related_box_image_height" value="<?php echo esc_attr( get_option( 'laci_related_box__image_height', '100' ) ); ?>" />
     134                </td>
     135            </tr>
     136            <tr>
     137                <th><?php esc_html_e( 'Title related box', 'laci-link-cluster' ); ?></th>
    153138                <td><?php wp_editor( $laci_related_box__title, $laci_related_box__title_id, $settings_related_box__title ); ?>
    154139                </td>
    155140            </tr>
    156141            <tr>   
    157                 <th><?php esc_html_e( 'Content related box', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     142                <th><?php esc_html_e( 'Content related box', 'laci-link-cluster' ); ?></th>
    158143                <td>
    159144                    <?php wp_editor( $laci_related_box__content, $laci_related_box__content_id, $settings ); ?>
    160                     <p style="margin-top: 5px;"> <?php esc_html_e( 'Note: ', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?><code><?php esc_html_e( 'You can use the shortcode [laci_post_title_link] to display the title of the post.', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></code></p>
     145                    <p style="margin-top: 5px;"> <?php esc_html_e( 'Note: ', 'laci-link-cluster' ); ?><code><?php esc_html_e( 'You can use the shortcode [laci_post_title_link] to display the title of the post.', 'laci-link-cluster' ); ?></code></p>
    161146                </td>
    162147            </tr>
     148           
    163149        </table>
    164150        <span class="submit"><input type="submit" name="submit" id="submit" class="button button-primary" value="Save Changes"></span>
    165         <span class="submit"><input type="submit" name="reset_to_default" id="reset_to_default" class="button button-primary" value="<?php esc_html_e( 'Reset to default', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?>"></span>
     151        <span class="submit"><input type="submit" name="reset_to_default" id="reset_to_default" class="button button-primary" value="<?php esc_html_e( 'Reset to default', 'laci-link-cluster' ); ?>"></span>
     152        <script>
     153        jQuery(document).ready(function($) {
     154            $('#reset_to_default').on('click', function(e) {
     155                var confirmed = confirm('<?php esc_html_e( 'Are you sure you want to reset to default?', 'laci-link-cluster' ); ?>');
     156                if (!confirmed) {
     157                    e.preventDefault(); // Prevent form submission if the user cancels
     158                }
     159            });
     160        });
     161        </script>
    166162    </form>
    167163
  • laci-link-cluster/trunk/templates/settings/settings.php

    r3165071 r3166563  
    22defined( 'ABSPATH' ) || exit;
    33
    4 use  LACI_InternalLinks\Controllers\LACI_SettingsController;
     4use  LACI_InternalLinks\Controllers\SettingsController;
    55
    6 $setting = LACI_SettingsController::get_instance();
     6$setting = SettingsController::get_instance();
    77
    88if ( isset( $_POST['laci-settings-security-token'] ) && wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['laci-settings-security-token'] ) ), 'laci-settings-security-token' ) ) {
    99    update_option( 'laci_num_item_dash', sanitize_text_field( isset( $_POST['num_item_dash'] ) ? wp_unslash( $_POST['num_item_dash'] ) : '' ) );
    10     update_option( 'laci_num_item_la', sanitize_text_field( isset( $_POST['num_item_la'] ) ? wp_unslash( $_POST['num_item_dash'] ) : '' ) );
     10    update_option( 'laci_num_item_la', sanitize_text_field( isset( $_POST['num_item_la'] ) ? wp_unslash( $_POST['num_item_la'] ) : '' ) );
    1111    update_option( 'laci_delete_shortcode_in_deactivate', isset( $_POST['delete_shortcode_in_deactivate'] ) && sanitize_text_field( wp_unslash( $_POST['delete_shortcode_in_deactivate'] ) ) === 'on' ? 1 : 0 );
    1212    update_option( 'laci_delete_shortcode_in_delete', isset( $_POST['delete_shortcode_in_delete'] ) && sanitize_text_field( wp_unslash( $_POST['delete_shortcode_in_delete'] ) ) === 'on' ? 1 : 0 );
    13     update_option( 'wpinternallinks_taxonomy', sanitize_text_field( isset( $_POST['wpinternallinks_taxonomy'] ) ? wp_unslash( $_POST['wpinternallinks_taxonomy'] ) : '' ) );
     13    update_option( 'laci_internallinks_taxonomy', sanitize_text_field( isset( $_POST['laci_internallinks_taxonomy'] ) ? wp_unslash( $_POST['laci_internallinks_taxonomy'] ) : '' ) );
    1414}
    1515
     
    1818$laci_delete_shortcode_in_deactivate = get_option( 'laci_delete_shortcode_in_deactivate', 0 );
    1919$laci_delete_shortcode_in_delete     = get_option( 'laci_delete_shortcode_in_delete', 0 );
    20 $taxonomy_data                       = get_option( 'wpinternallinks_taxonomy', 'category' );
     20$taxonomy_data                       = get_option( 'laci_internallinks_taxonomy', 'category' );
    2121$taxonomies                          = get_taxonomies( [ 'public' => true ], 'objects' );
     22
     23$updated_for_taxonomy = get_option( 'laci_internallinks_updated_for_taxonomy', 'category' );
     24
     25if ( $taxonomy_data !== $updated_for_taxonomy ) {
     26    ?>
     27<div class="notice notice-warning laci-notice" style="display: block;">
     28    <p><?php esc_html_e( 'Please note that changing the applicable taxonomy will require', 'laci-link-cluster' ); ?> <a href="<?php echo esc_url( admin_url( 'admin.php?page=laci_internal_links_dashboard' ) ); ?>"><?php esc_html_e( 'updating the link counts', 'laci-link-cluster' ); ?></a> <?php esc_html_e( 'to ensure internal links are properly counted within their respective clusters.', 'laci-link-cluster' ); ?></p>
     29</div>
     30    <?php
     31}
    2232?>
    23 
    2433<form class="laci-settings-form" method="POST">
    2534    <input type='hidden' name='laci-settings-security-token' value='<?php echo esc_attr( wp_create_nonce( 'laci-settings-security-token' ) ); ?>'> 
    2635    <table class="form-table">
    27         <tr>
    28             <th><?php esc_html_e( 'Taxonomies', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     36        <tr class="laci-setting-taxonomies">
     37            <th><?php esc_html_e( 'Taxonomies', 'laci-link-cluster' ); ?></th>
    2938            <td>
    30                 <select name="wpinternallinks_taxonomy">
     39                <select name="laci_internallinks_taxonomy">
    3140                    <?php foreach ( $taxonomies as $tax_item ) : ?>
    3241                        <option value="<?php echo esc_attr( $tax_item->name ); ?>" <?php selected( $taxonomy_data, $tax_item->name ); ?>>
     
    3847        </tr>
    3948        <tr>
    40             <th><?php esc_html_e( 'Number of items per page in the dashboard', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     49            <th><?php esc_html_e( 'Number of items per page in the dashboard', 'laci-link-cluster' ); ?></th>
    4150            <td>
    42                 <input name="num_item_dash" type="number" id="num_item_dash" value="<?php echo esc_attr( $laci_num_item_dash ); ?>">
     51                <input name="num_item_dash" type="number" id="num_item_dash" value="<?php echo esc_attr( $laci_num_item_dash ); ?>" min="1" max="900">
     52            </td>
     53        </tr>
     54        <tr class="laci-setting-item-per-page">
     55            <th><?php esc_html_e( 'Number of items per page in Link Assistant', 'laci-link-cluster' ); ?></th>
     56            <td>
     57                <input name="num_item_la" type="number" id="num_item_la" value="<?php echo esc_attr( $laci_num_item_la ); ?>" min="1" max="100">
     58                <p style="margin-top: 5px;"> <?php esc_html_e( 'Note: ', 'laci-link-cluster' ); ?><code><?php esc_html_e( 'Max is 100', 'laci-link-cluster' ); ?></code></p>
    4359            </td>
    4460        </tr>
    4561        <tr>
    46             <th><?php esc_html_e( 'Number of items per page in Link Assistant', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
    47             <td>
    48                 <input name="num_item_la" type="number" id="num_item_la" value="<?php echo esc_attr( $laci_num_item_la ); ?>">
    49             </td>
    50         </tr>
    51         <tr>
    52             <th><?php esc_html_e( 'Delete shortcode when deactivate the plugin', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     62            <th><?php esc_html_e( 'Delete shortcode when deactivate the plugin', 'laci-link-cluster' ); ?></th>
    5363            <td>
    5464                <label class="laci-switch" for="delete_shortcode_in_deactivate">
     
    5969        </tr>
    6070        <tr>
    61             <th><?php esc_html_e( 'Delete shortcode when delete the plugin', 'link-and-cluster-automated-seo-link-builder-for-your-site' ); ?></th>
     71            <th><?php esc_html_e( 'Delete shortcode when delete the plugin', 'laci-link-cluster' ); ?></th>
    6272            <td>
    6373                <label class="laci-switch" for="delete_shortcode_in_delete">
  • laci-link-cluster/trunk/uninstall.php

    r3165071 r3166563  
    11<?php
    2 defined( 'ABSPATH' ) || exit;
     2defined( 'WP_UNINSTALL_PLUGIN' ) || exit;
    33
     4global $wpdb, $wp_version;
     5
     6if ( get_option( 'laci_delete_shortcode_in_delete', 0 ) ) {
     7    global $wpdb;
     8
     9    // Pattern to match the entire Gutenberg block containing the shortcode
     10    $pattern = '<!-- wp:shortcode -->\s*\[laci_related_post_content[^\]]*\]\s*<!-- \/wp:shortcode -->';
     11
     12    // Update the posts' content by removing the matched blocks
     13    $wpdb->query(
     14        $wpdb->prepare(
     15            "UPDATE {$wpdb->posts} SET post_content = REGEXP_REPLACE(post_content, %s, '')",
     16            $pattern
     17        )
     18    );
     19}
  • laci-link-cluster/trunk/wp-link-and-cluster.php

    r3165071 r3166563  
    77 * Author: Link and Cluster
    88 * Author URI: https://linkandcluster.com/
    9  * Text Domain: link-and-cluster-automated-seo-link-builder-for-your-site
    10  * Domain Path: /i18n/languages/
    11  * Version: 1.0.0
     9 * Text Domain: laci-link-cluster
     10 * Domain Path: /languages/i18n
     11 * Version: 1.0.1
    1212 * License: GPLv2 or later
    1313 * License URI: https://www.gnu.org/licenses/gpl-2.0.html
     
    2121}
    2222
    23 define( 'LACI_INTERNAL_LINKS_VERSION', '1.0.0' );
    24 define( 'LACI_INTERNAL_LINKS_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
    25 define( 'LACI_INTERNAL_LINKS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
    26 define( 'LACI_INTERNAL_LINKS_IS_DEVELOPMENT', true );
    27 define( 'LACI_INTERNAL_LINKS_CUSTOM_TABLE_NAME', 'laci_custom_table' );
     23if ( ! defined( 'LACI_INTERNAL_LINKS_VERSION' ) ) {
     24    define( 'LACI_INTERNAL_LINKS_VERSION', '1.0.1' );
     25}
    2826
    29 define( 'LACI_INTERNAL_LINKS_CUSTOM_NUM_ITEM_LA', get_option( 'laci_num_item_la', '50' ) );
     27if ( ! defined( 'LACI_INTERNAL_LINKS_PLUGIN_PATH' ) ) {
     28    define( 'LACI_INTERNAL_LINKS_PLUGIN_PATH', plugin_dir_path( __FILE__ ) );
     29}
    3030
     31if ( ! defined( 'LACI_INTERNAL_LINKS_PLUGIN_URL' ) ) {
     32    define( 'LACI_INTERNAL_LINKS_PLUGIN_URL', plugin_dir_url( __FILE__ ) );
     33}
     34
     35if ( ! defined( 'LACI_INTERNAL_LINKS_PLUGIN_BASENAME' ) ) {
     36    define( 'LACI_INTERNAL_LINKS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) );
     37}
     38
     39if ( ! defined( 'LACI_INTERNAL_LINKS_IS_DEVELOPMENT' ) ) {
     40    define( 'LACI_INTERNAL_LINKS_IS_DEVELOPMENT', true );
     41}
     42
     43if ( ! defined( 'LACI_INTERNAL_LINKS_CUSTOM_TABLE_NAME' ) ) {
     44    define( 'LACI_INTERNAL_LINKS_CUSTOM_TABLE_NAME', 'laci_custom_table' );
     45}
     46
     47if ( ! defined( 'LACI_INTERNAL_LINKS_CUSTOM_NUM_ITEM_LA' ) ) {
     48    define( 'LACI_INTERNAL_LINKS_CUSTOM_NUM_ITEM_LA', get_option( 'laci_num_item_la', '50' ) );
     49}
    3150
    3251spl_autoload_register(
     
    5271if ( ! wp_installing() ) {
    5372    if ( ! function_exists( 'LACI_InternalLinks\\init' ) ) {
     73        \LACI_InternalLinks\Controllers\AdminMenuController::get_instance();
    5474        function init() {
    55             \LACI_InternalLinks\LACI_Initialize::get_instance();
     75            \LACI_InternalLinks\Initialize::get_instance();
    5676        }
    5777    }
Note: See TracChangeset for help on using the changeset viewer.