Plugin Directory

Changeset 3405223


Ignore:
Timestamp:
11/28/2025 01:46:09 PM (4 months ago)
Author:
kakaroto84
Message:

1.0.8

  • Tested and confirmed compatibility with WordPress 6.9
  • Updated Clipboard API to modern standard
  • Improved output escaping for security
Location:
pixel-clusters/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • pixel-clusters/trunk/js/cluster.js

    r2175363 r3405223  
    5555function pixel_copyToClipboard(elemento)
    5656{
    57     var temp = jQuery("<input>")
    58     jQuery("body").append(temp);
    59     temp.val(jQuery(elemento).text()).select();
    60     document.execCommand("copy");
    61     temp.remove();
     57    var textToCopy = jQuery(elemento).text();
    6258   
    63     jQuery('#success').html('').show();
    64     jQuery('#success').html('Shortcode was copied!').fadeOut(2000);
     59    // Modern Clipboard API
     60    if (navigator.clipboard && navigator.clipboard.writeText) {
     61        navigator.clipboard.writeText(textToCopy).then(function() {
     62            jQuery('#success').html('').show();
     63            jQuery('#success').html('Shortcode was copied!').fadeOut(2000);
     64        }).catch(function(err) {
     65            console.error('Failed to copy: ', err);
     66        });
     67    } else {
     68        // Fallback for older browsers
     69        var temp = jQuery("<input>");
     70        jQuery("body").append(temp);
     71        temp.val(textToCopy).select();
     72        try {
     73            document.execCommand("copy");
     74            jQuery('#success').html('').show();
     75            jQuery('#success').html('Shortcode was copied!').fadeOut(2000);
     76        } catch (err) {
     77            console.error('Failed to copy: ', err);
     78        }
     79        temp.remove();
     80    }
    6581}
  • pixel-clusters/trunk/pixel-clusters.php

    r3299439 r3405223  
    99 * Plugin URI:        https://mireunion.com/
    1010 * Description:       A small plugin for create clusters of posts.
    11  * Version:           1.0.7
     11 * Version:           1.0.8
    1212 * Author:            Mex Avila
    1313 * Author URI:        https://datakun.com/
     
    7979            case 1:
    8080           
    81                 $html .= '<article class="category">
    82                     <div class="images">';
    83                         if ( has_post_thumbnail($data->ID) ) :
    84                             $html .= '<a href="'. get_the_permalink($data->ID) .'" title="'. get_the_title($data->ID) .'">
    85                                 '. get_the_post_thumbnail($data->ID, 'thumbnail') .'
    86                             </a>';
    87                         endif;
    88                         $html .= '&nbsp;
    89                     </div>
    90                     <div class="articles">           
    91                         <div class="h2"><a href="'. get_the_permalink($data->ID) .'">'. get_the_title($data->ID) .'</a></div>                 
    92                         '. get_the_excerpt($data->ID) .'       
    93                     </div>
    94                 </article>';
    95            
    96                 break;
     81            $html .= '<article class="category">
     82                <div class="images">';
     83                    if ( has_post_thumbnail($data->ID) ) :
     84                        $html .= '<a href="'. esc_url( get_the_permalink($data->ID) ) .'" title="'. esc_attr( get_the_title($data->ID) ) .'">
     85                            '. get_the_post_thumbnail($data->ID, 'thumbnail') .'
     86                        </a>';
     87                    endif;
     88                    $html .= '&nbsp;
     89                </div>
     90                <div class="articles">           
     91                    <div class="h2"><a href="'. esc_url( get_the_permalink($data->ID) ) .'">'. esc_html( get_the_title($data->ID) ) .'</a></div>                 
     92                    '. wp_kses_post( get_the_excerpt($data->ID) ) .'       
     93                </div>
     94            </article>';                break;
    9795               
    9896            case 2:
    9997           
    10098                $html .= '<article class="column3">
    101                     <a href="'. get_the_permalink($data->ID) .'" title="'. get_the_title($data->ID) .'"><div class="images" style="background-image: url('. get_the_post_thumbnail_url($data->ID, 'medium') .');">&nbsp;</div></a>
     99                    <a href="'. esc_url( get_the_permalink($data->ID) ) .'" title="'. esc_attr( get_the_title($data->ID) ) .'"><div class="images" style="background-image: url('. esc_url( get_the_post_thumbnail_url($data->ID, 'medium') ) .');">&nbsp;</div></a>
    102100                    <div class="articles">           
    103                         <div class="h2"><a href="'. get_the_permalink($data->ID) .'">'. get_the_title($data->ID) .'</a></div>       
     101                        <div class="h2"><a href="'. esc_url( get_the_permalink($data->ID) ) .'">'. esc_html( get_the_title($data->ID) ) .'</a></div>       
    104102                    </div>
    105103                </article>';
     
    109107            case 3:
    110108           
    111                 $html .= '<li><a href="'. get_the_permalink($data->ID) .'">'. get_the_title($data->ID) .'</a></li>';
     109                $html .= '<li><a href="'. esc_url( get_the_permalink($data->ID) ) .'">'. esc_html( get_the_title($data->ID) ) .'</a></li>';
    112110           
    113111                break;
  • pixel-clusters/trunk/readme.txt

    r3299439 r3405223  
    33Tags: cluster, posts, categories, tags, pixel
    44Donate link: https://www.paypal.me/datakun
    5 Requires at least: 7.4
    6 Tested up to: 6.6.1
     5Requires at least: 6.4
     6Tested up to: 6.9
    77Requires PHP: 8.0
    88Stable tag: trunk
     
    4646
    4747== Changelog ==
     48= 1.0.8 =
     49* Tested and confirmed compatibility with WordPress 6.9
     50* Updated Clipboard API to modern standard
     51* Improved output escaping for security
    4852= 1.0 =
    4953* Initial release
Note: See TracChangeset for help on using the changeset viewer.