Plugin Directory

Changeset 3454510


Ignore:
Timestamp:
02/05/2026 11:02:08 AM (7 weeks ago)
Author:
htplugins
Message:

Update to version 1.0.7 from GitHub

Location:
docus
Files:
24 added
2 deleted
10 edited
1 copied

Legend:

Unmodified
Added
Removed
  • docus/tags/1.0.7/admin/Recommended_Plugins.php

    r2790076 r3454510  
    106106    public function enqueue_assets( $hook_suffix ) {
    107107        if( $this->hook_suffix ){
    108             if( $this->hook_suffix == $hook_suffix ){
    109                 wp_enqueue_script( 'htrp-plugin-install-manager', $this->assets_url . '/js/plugins_install_manager.js', array('jquery','wp-util', 'updates'), '1.0.0', true );
     108            if( $this->hook_suffix != $hook_suffix ){
     109                return;
    110110            }
    111         } else {
    112             wp_enqueue_script( 'htrp-plugin-install-manager', $this->assets_url . '/js/plugins_install_manager.js', array('jquery','wp-util', 'updates'), '1.0.0', true );
    113         }
    114 
    115         /**
    116         * Thickbox assest
    117         */
    118         add_thickbox();
     111        }
     112
     113        wp_enqueue_script( 'docus-plugin-install-manager', $this->assets_url . '/js/plugins_install_manager.js', array('jquery','wp-util', 'updates'), '1.0.0', true );
    119114
    120115        /**
     
    123118        $localize_vars['ajaxurl'] = admin_url('admin-ajax.php');
    124119        $localize_vars['text_domain'] = sanitize_title_with_dashes( $this->text_domain );
     120        $localize_vars['nonce'] = wp_create_nonce('docus_rp_nonce');
    125121        $localize_vars['buttontxt'] = array(
    126122            'buynow'     => esc_html__( 'Buy Now', $this->text_domain ),
     
    130126            'active'     => esc_html__( 'Activated', $this->text_domain ),
    131127        );
    132         wp_localize_script( 'htrp-plugin-install-manager', 'htrp_params', $localize_vars );
     128        wp_localize_script( 'docus-plugin-install-manager', 'htrp_params', $localize_vars );
    133129
    134130    }
     
    221217                                    $description  = strip_tags( $prepare_plugin[$data['slug']]['description'] );
    222218                                    $author_name  = wp_kses( $prepare_plugin[$data['slug']]['author'], $this->plugins_allowedtags );
    223                                     $details_link = self_admin_url('plugin-install.php?tab=plugin-information&plugin=' . $plugin['slug'] .'&TB_iframe=true&width=772&height=577');
    224                                     $target       = '_self';
    225                                     $modal_class  = 'class="thickbox open-plugin-details-modal"';
     219                                    $details_link = 'https://wordpress.org/plugins/' . $plugin['slug'] . '/';
     220                                    $target       = '_blank';
    226221
    227222                                }else{
     
    235230                                    $button_classes = 'button button-primary';
    236231                                    $target         = '_blank';
    237                                     $modal_class    = '';
    238232                                }
    239233
     
    263257                                            <div class="name column-name" style="margin-right: 0;">
    264258                                                <h3>
    265                                                     <a href="<?php echo esc_url( $details_link ) ?>" target="<?php echo esc_attr( $target ) ?>" <?php echo $modal_class; ?>>
     259                                                    <a href="<?php echo esc_url( $details_link ) ?>" target="<?php echo esc_attr( $target ) ?>">
    266260                                                        <?php echo esc_html( $title ) ?>
    267261                                                        <img src="<?php echo esc_url( $image_url ) ?>" class="plugin-icon" alt="<?php echo esc_attr( $title ) ?>">
     
    289283                                                    }else{
    290284                                                ?>
    291                                                     <button class="<?php echo $button_classes; ?>" data-pluginopt='<?php echo wp_json_encode( $data ); ?>'><?php echo $button_text; ?></button>
     285                                                    <button class="<?php echo esc_attr($button_classes); ?>" data-pluginopt='<?php echo wp_json_encode( $data ); ?>'><?php echo esc_html($button_text); ?></button>
    292286                                                   
    293287                                                <?php } ?>
    294288                                            </div>
    295289                                            <div class="column-downloaded">
    296                                                 <a href="<?php echo esc_url( $details_link ) ?>" target="<?php echo esc_attr( $target ) ?>" <?php echo $modal_class; ?>><?php echo esc_html__('More Details', $this->text_domain) ?></a>
     290                                                <a href="<?php echo esc_url( $details_link ) ?>" target="<?php echo esc_attr( $target ) ?>"><?php echo esc_html__('More Details', $this->text_domain) ?></a>
    297291                                                <span class="downloaded-count">
    298292                                                    <?php
     
    391385    public function plugin_activation() {
    392386
     387        check_ajax_referer('docus_rp_nonce', 'nonce');
     388
    393389        if ( ! current_user_can( 'install_plugins' ) || ! isset( $_POST['location'] ) || ! $_POST['location'] ) {
    394390            wp_send_json_error(
  • docus/tags/1.0.7/admin/assets/js/plugins_install_manager.js

    r2790076 r3454510  
    9393                        action   : htrp_params.text_domain+'_ajax_plugin_activation',
    9494                        location : $plugindata['location'],
     95                        nonce   : htrp_params.nonce,
    9596                    },
    9697                } ).done( function( result ) {
     
    132133                    action   : htrp_params.text_domain+'_ajax_plugin_activation',
    133134                    location : $plugindata['location'],
     135                    nonce   : htrp_params.nonce,
    134136                },
    135137            }).done( function( response ) {
  • docus/tags/1.0.7/docus.php

    r2810628 r3454510  
    55 * Author:      HasThemes
    66 * Author URI:  https://hasthemes.com/
    7  * Version:     1.0.6
     7 * Version:     1.0.7
    88 * Text Domain: docus
    99 * Domain Path: /languages
  • docus/tags/1.0.7/includes/class.docus.php

    r2790076 r3454510  
    2626    function __construct()
    2727    {
    28         add_action( 'init', array( $this, 'i18n') );
    29         add_action( 'plugins_loaded', array( $this, 'init' ) );
     28        add_action( 'init', array( $this, 'i18n'), 1 );
     29        add_action( 'init', array( $this, 'init' ), 10 );
    3030        add_action( 'wp_enqueue_scripts', array( $this, 'docus_assets_enqueue' ) );
    3131        register_activation_hook(DOCUS_PL_ROOT, array( $this, 'docus_deactivate_pro_version' ));
  • docus/tags/1.0.7/includes/class.shortcode.php

    r2675425 r3454510  
    4242        $list_attributes = shortcode_atts($default, $attributes);
    4343
    44         $api_data = json_encode(
     44        // Sanitize user-supplied attributes to prevent XSS
     45        $key = sanitize_text_field( $list_attributes['key'] );
     46        $channelid = sanitize_text_field( $list_attributes['channelid'] );
     47        $limit = absint( $list_attributes['limit'] );
     48
     49        $api_data = wp_json_encode(
    4550            array(
    46                 "api_key"       => $list_attributes['key'],
    47                 "channel_id"    => $list_attributes['channelid'],
     51                "api_key"       => $key,
     52                "channel_id"    => $channelid,
    4853                "layout_style"  => docus_get_option('page_layout_style',''),
    49                 "video_limit"   => $list_attributes['limit'],
     54                "video_limit"   => $limit,
    5055            )
    5156        );
     
    5358        ob_start();
    5459        ?>
    55         <div class="htyt-channel-area" id="<?php echo 'key-'.$list_attributes['key'].'-'.$list_attributes['channelid']; ?>">
    56             <div class="htyt-channel-top-area" data-apidata='<?php echo $api_data; ?>'>
     60        <div class="htyt-channel-area" id="<?php echo 'key-' . esc_attr( $key ) . '-' . esc_attr( $channelid ); ?>">
     61            <div class="htyt-channel-top-area" data-apidata='<?php echo esc_attr($api_data); ?>'>
    5762                <div class="htyt-container">
    5863                    <div class="htyt-channel-info-wrapper">
  • docus/trunk/admin/Recommended_Plugins.php

    r2790076 r3454510  
    106106    public function enqueue_assets( $hook_suffix ) {
    107107        if( $this->hook_suffix ){
    108             if( $this->hook_suffix == $hook_suffix ){
    109                 wp_enqueue_script( 'htrp-plugin-install-manager', $this->assets_url . '/js/plugins_install_manager.js', array('jquery','wp-util', 'updates'), '1.0.0', true );
     108            if( $this->hook_suffix != $hook_suffix ){
     109                return;
    110110            }
    111         } else {
    112             wp_enqueue_script( 'htrp-plugin-install-manager', $this->assets_url . '/js/plugins_install_manager.js', array('jquery','wp-util', 'updates'), '1.0.0', true );
    113         }
    114 
    115         /**
    116         * Thickbox assest
    117         */
    118         add_thickbox();
     111        }
     112
     113        wp_enqueue_script( 'docus-plugin-install-manager', $this->assets_url . '/js/plugins_install_manager.js', array('jquery','wp-util', 'updates'), '1.0.0', true );
    119114
    120115        /**
     
    123118        $localize_vars['ajaxurl'] = admin_url('admin-ajax.php');
    124119        $localize_vars['text_domain'] = sanitize_title_with_dashes( $this->text_domain );
     120        $localize_vars['nonce'] = wp_create_nonce('docus_rp_nonce');
    125121        $localize_vars['buttontxt'] = array(
    126122            'buynow'     => esc_html__( 'Buy Now', $this->text_domain ),
     
    130126            'active'     => esc_html__( 'Activated', $this->text_domain ),
    131127        );
    132         wp_localize_script( 'htrp-plugin-install-manager', 'htrp_params', $localize_vars );
     128        wp_localize_script( 'docus-plugin-install-manager', 'htrp_params', $localize_vars );
    133129
    134130    }
     
    221217                                    $description  = strip_tags( $prepare_plugin[$data['slug']]['description'] );
    222218                                    $author_name  = wp_kses( $prepare_plugin[$data['slug']]['author'], $this->plugins_allowedtags );
    223                                     $details_link = self_admin_url('plugin-install.php?tab=plugin-information&amp;plugin=' . $plugin['slug'] .'&amp;TB_iframe=true&amp;width=772&amp;height=577');
    224                                     $target       = '_self';
    225                                     $modal_class  = 'class="thickbox open-plugin-details-modal"';
     219                                    $details_link = 'https://wordpress.org/plugins/' . $plugin['slug'] . '/';
     220                                    $target       = '_blank';
    226221
    227222                                }else{
     
    235230                                    $button_classes = 'button button-primary';
    236231                                    $target         = '_blank';
    237                                     $modal_class    = '';
    238232                                }
    239233
     
    263257                                            <div class="name column-name" style="margin-right: 0;">
    264258                                                <h3>
    265                                                     <a href="<?php echo esc_url( $details_link ) ?>" target="<?php echo esc_attr( $target ) ?>" <?php echo $modal_class; ?>>
     259                                                    <a href="<?php echo esc_url( $details_link ) ?>" target="<?php echo esc_attr( $target ) ?>">
    266260                                                        <?php echo esc_html( $title ) ?>
    267261                                                        <img src="<?php echo esc_url( $image_url ) ?>" class="plugin-icon" alt="<?php echo esc_attr( $title ) ?>">
     
    289283                                                    }else{
    290284                                                ?>
    291                                                     <button class="<?php echo $button_classes; ?>" data-pluginopt='<?php echo wp_json_encode( $data ); ?>'><?php echo $button_text; ?></button>
     285                                                    <button class="<?php echo esc_attr($button_classes); ?>" data-pluginopt='<?php echo wp_json_encode( $data ); ?>'><?php echo esc_html($button_text); ?></button>
    292286                                                   
    293287                                                <?php } ?>
    294288                                            </div>
    295289                                            <div class="column-downloaded">
    296                                                 <a href="<?php echo esc_url( $details_link ) ?>" target="<?php echo esc_attr( $target ) ?>" <?php echo $modal_class; ?>><?php echo esc_html__('More Details', $this->text_domain) ?></a>
     290                                                <a href="<?php echo esc_url( $details_link ) ?>" target="<?php echo esc_attr( $target ) ?>"><?php echo esc_html__('More Details', $this->text_domain) ?></a>
    297291                                                <span class="downloaded-count">
    298292                                                    <?php
     
    391385    public function plugin_activation() {
    392386
     387        check_ajax_referer('docus_rp_nonce', 'nonce');
     388
    393389        if ( ! current_user_can( 'install_plugins' ) || ! isset( $_POST['location'] ) || ! $_POST['location'] ) {
    394390            wp_send_json_error(
  • docus/trunk/admin/assets/js/plugins_install_manager.js

    r2790076 r3454510  
    9393                        action   : htrp_params.text_domain+'_ajax_plugin_activation',
    9494                        location : $plugindata['location'],
     95                        nonce   : htrp_params.nonce,
    9596                    },
    9697                } ).done( function( result ) {
     
    132133                    action   : htrp_params.text_domain+'_ajax_plugin_activation',
    133134                    location : $plugindata['location'],
     135                    nonce   : htrp_params.nonce,
    134136                },
    135137            }).done( function( response ) {
  • docus/trunk/docus.php

    r2810628 r3454510  
    55 * Author:      HasThemes
    66 * Author URI:  https://hasthemes.com/
    7  * Version:     1.0.6
     7 * Version:     1.0.7
    88 * Text Domain: docus
    99 * Domain Path: /languages
  • docus/trunk/includes/class.docus.php

    r2790076 r3454510  
    2626    function __construct()
    2727    {
    28         add_action( 'init', array( $this, 'i18n') );
    29         add_action( 'plugins_loaded', array( $this, 'init' ) );
     28        add_action( 'init', array( $this, 'i18n'), 1 );
     29        add_action( 'init', array( $this, 'init' ), 10 );
    3030        add_action( 'wp_enqueue_scripts', array( $this, 'docus_assets_enqueue' ) );
    3131        register_activation_hook(DOCUS_PL_ROOT, array( $this, 'docus_deactivate_pro_version' ));
  • docus/trunk/includes/class.shortcode.php

    r2675425 r3454510  
    4242        $list_attributes = shortcode_atts($default, $attributes);
    4343
    44         $api_data = json_encode(
     44        // Sanitize user-supplied attributes to prevent XSS
     45        $key = sanitize_text_field( $list_attributes['key'] );
     46        $channelid = sanitize_text_field( $list_attributes['channelid'] );
     47        $limit = absint( $list_attributes['limit'] );
     48
     49        $api_data = wp_json_encode(
    4550            array(
    46                 "api_key"       => $list_attributes['key'],
    47                 "channel_id"    => $list_attributes['channelid'],
     51                "api_key"       => $key,
     52                "channel_id"    => $channelid,
    4853                "layout_style"  => docus_get_option('page_layout_style',''),
    49                 "video_limit"   => $list_attributes['limit'],
     54                "video_limit"   => $limit,
    5055            )
    5156        );
     
    5358        ob_start();
    5459        ?>
    55         <div class="htyt-channel-area" id="<?php echo 'key-'.$list_attributes['key'].'-'.$list_attributes['channelid']; ?>">
    56             <div class="htyt-channel-top-area" data-apidata='<?php echo $api_data; ?>'>
     60        <div class="htyt-channel-area" id="<?php echo 'key-' . esc_attr( $key ) . '-' . esc_attr( $channelid ); ?>">
     61            <div class="htyt-channel-top-area" data-apidata='<?php echo esc_attr($api_data); ?>'>
    5762                <div class="htyt-container">
    5863                    <div class="htyt-channel-info-wrapper">
Note: See TracChangeset for help on using the changeset viewer.