Plugin Directory

Changeset 3018504


Ignore:
Timestamp:
01/08/2024 01:35:53 AM (2 years ago)
Author:
ibenic
Message:

Pushing 3.5.1

Location:
wp-sponsors/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • wp-sponsors/trunk/README.txt

    r2531962 r3018504  
    44Tags: post type, images, partners, sponsors
    55Requires at least: 3.1.0
    6 Tested up to: 5.7.1
     6Tested up to: 6.4.2
    77Requires PHP: 7.0
    8 Stable tag: 3.5.0
     8Stable tag: 3.5.1
    99License: GPLv2 or later
    1010License URI: http://www.gnu.org/licenses/gpl-2.0.html
     
    110110== Changelog ==
    111111
     112= 3.5.1 - 2024-01-08 =
     113* Security update
     114
    112115= 3.5.0 - 2021-05-14 =
    113116* New: Shortcode attribute verticalcenter for slider to define if we need to center the images/content vertically. On by default.
  • wp-sponsors/trunk/admin/class-wp-sponsors-admin.php

    r2376088 r3018504  
    9999        wp_enqueue_script( $this->wp_sponsors, WP_SPONSORS_URL . 'assets/dist/js/admin.js', array( 'jquery' ), $this->version, false );
    100100        wp_localize_script($this->wp_sponsors, 'objectL10n', array(
    101             'title' => __('Select a sponsor logo', 'wp-sponsors'),
     101            'title'  => __('Select a sponsor logo', 'wp-sponsors'),
    102102            'button' => __('Add image', 'wp-sponsors')
    103             ));
     103        ));
    104104
    105105    }
     
    131131        // Checks for input and sanitizes/saves if needed
    132132        if ( isset( $_POST['_website'] ) ) {
    133             update_post_meta( $post_id, '_website', sanitize_text_field( $_POST['_website'] ) );
     133            update_post_meta( $post_id, '_website', sanitize_text_field( wp_unslash( $_POST['_website'] ) ) );
    134134        }
    135135
    136136        if ( isset( $_POST['_email'] ) ) {
    137             update_post_meta( $post_id, '_email', sanitize_text_field( $_POST['_email'] ) );
     137            update_post_meta( $post_id, '_email', sanitize_text_field( wp_unslash( $_POST['_email'] ) ) );
    138138        }
    139139
    140140        if ( isset( $_POST['wp_sponsors_desc'] ) ) {
    141             update_post_meta( $post_id, 'wp_sponsors_desc', $_POST['wp_sponsors_desc'] );
     141            update_post_meta( $post_id, 'wp_sponsors_desc', wp_kses_post( wp_unslash( $_POST['wp_sponsors_desc'] ) ) );
    142142        }
    143143
     
    222222        if(is_admin()) {
    223223            if(get_option( 'sponsors_db_version') < 2 ) {
    224                 $update = new WP_Sponsors_upgrade( $this->version );
    225                 $update->run( 'upgrade200' );
     224                wp_sponsors_update_200();
     225                wp_sponsors_update_post_type_300();
    226226            }
    227227            return;
  • wp-sponsors/trunk/admin/partials/meta-boxes/sponsor-info.php

    r2137237 r3018504  
    33// Display code/markup goes here. Don't forget to include nonces!
    44// Noncename needed to verify where the data originated
    5 echo '<input type="hidden" name="wp_sponsors_nonce" id="wp_sponsors_nonce" value="' . wp_create_nonce( plugin_basename( __FILE__ ) ) . '" />';
     5echo '<input type="hidden" name="wp_sponsors_nonce" id="wp_sponsors_nonce" value="' . esc_attr( wp_create_nonce( plugin_basename( __FILE__ ) ) ) . '" />';
    66// Get the url data if its already been entered
    77$meta_value = get_post_meta( get_the_ID(), '_website', true );
     
    1111// Checks and displays the retrieved value
    1212echo '<p class="post-attributes-label-wrapper"><label for="wp_sponsors_url" class="post-attributes-label">' . __( 'Link', 'wp-sponsors' ) . '</label></p>';
    13 echo '<input type="url" name="_website" value="' . $meta_value . '" class="widefat" />';
     13echo '<input type="url" name="_website" value="' . esc_attr( $meta_value ) . '" class="widefat" />';
    1414
    1515
     
    1818// Checks and displays the retrieved value
    1919echo '<p class="post-attributes-label-wrapper"><label for="wp_sponosrs_email" class="post-attributes-label">' . __( 'Email', 'wp-sponsors' ) . '</label></p>';
    20 echo '<input type="email" id="wp_sponosrs_email" name="_email" value="' . $meta_value . '" class="widefat" />';
     20echo '<input type="email" id="wp_sponosrs_email" name="_email" value="' . esc_attr( $meta_value ) . '" class="widefat" />';
    2121
    2222
  • wp-sponsors/trunk/includes/class-wp-sponsors-blocks.php

    r2531962 r3018504  
    192192                'wp-sponsors-block-js',
    193193                WP_SPONSORS_URL . '/assets/dist/js/gutenberg.js',
    194                 array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-editor', 'wp-compose' )
     194                array( 'wp-blocks', 'wp-i18n', 'wp-element', 'wp-components', 'wp-editor', 'wp-compose' ),
     195                filemtime( WP_SPONSORS_PATH . '/assets/dist/js/gutenberg.js', )
    195196            );
    196197        }
     
    210211            'wp-sponsors-block-css',
    211212            WP_SPONSORS_URL . '/assets/dist/css/gutenberg.css',
    212             array( 'wp-edit-blocks' )
     213            array( 'wp-edit-blocks' ),
     214            filemtime( WP_SPONSORS_PATH . '/assets/dist/css/gutenberg.css', )
    213215        );
    214216    }
  • wp-sponsors/trunk/includes/class-wp-sponsors-shortcodes.php

    r2531962 r3018504  
    265265                    ),
    266266                );*/
    267                 $style['containerPre'] = '<div id="wp-sponsors" class="clearfix slider wp-sponsors ' . $atts['slider_image'] . ' ' . ( 1 === absint( $atts['verticalcenter'] ) ? 'vertical-center' : '' ) . '" data-slick="' . esc_attr( wp_json_encode( $slickSettings ) ) . '">';
     267                $style['containerPre'] = '<div id="wp-sponsors" class="clearfix slider wp-sponsors ' . esc_attr( $atts['slider_image'] ) . ' ' . ( 1 === absint( $atts['verticalcenter'] ) ? 'vertical-center' : '' ) . '" data-slick="' . esc_attr( wp_json_encode( $slickSettings ) ) . '">';
    268268                $style['containerPost'] = '</div>';
    269269                $style['wrapperClass'] = 'sponsor-item';
     
    299299                    }
    300300
    301                     echo '<' . $style['wrapperPre'] . ' class="' . $style['wrapperClass'] . ' ' . $class . '">';
     301                    echo '<' . $style['wrapperPre'] . ' class="' . esc_attr( $style['wrapperClass'] ) . ' ' . esc_attr( $class ) . '">';
    302302                    $sponsor_html = '';
    303303
  • wp-sponsors/trunk/includes/class-wp-sponsors-widget.php

    r2531962 r3018504  
    6464            echo $args['before_title'] . $title . $args['after_title'];
    6565        } ?>
    66         <ul class="<?php echo $instance['display_option']; ?>">
     66        <ul class="<?php echo esc_attr( $instance['display_option'] ); ?>">
    6767            <?php while ( $query->have_posts() ) : $query->the_post(); ?>
    6868                <?php
     
    9494                    if ( ! $image || $use_title ) {
    9595                        ?>
    96                         <div class="sponsor-title widget-title"><?php echo the_title(); ?></div>
     96                        <div class="sponsor-title widget-title"><?php echo esc_html( the_title( '', '', false ) ); ?></div>
    9797                        <?php
    9898                    }
     
    113113                        if ( $desc ) {
    114114                            echo '<br/>';
    115                             echo '<p class="sponsor-desc">' . $desc . '</p>';
     115                            echo '<p class="sponsor-desc">' . wp_kses_post( $desc ) . '</p>';
    116116                        }
    117117                    }
     
    180180        $cats = get_terms( 'sponsor_categories' ); ?>
    181181        <p>
    182             <label for="<?php echo $this->get_field_id( 'title' ); ?>"><?php _e( 'Title', 'wp-sponsors' ); ?></label>
    183             <input id="<?php echo $this->get_field_id( 'title' ); ?>"
    184                    name="<?php echo $this->get_field_name( 'title' ); ?>" value="<?php echo $instance['title']; ?>"
     182            <label for="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"><?php _e( 'Title', 'wp-sponsors' ); ?></label>
     183            <input id="<?php echo esc_attr( $this->get_field_id( 'title' ) ); ?>"
     184                   name="<?php echo esc_attr( $this->get_field_name( 'title' ) ); ?>" value="<?php echo esc_attr( $instance['title'] ); ?>"
    185185                   style="width:100%;"/>
    186186        </p>
    187187        <?php if ( ! empty( $cats ) && ! is_wp_error( $cats ) ) { ?>
    188188            <p>
    189                 <label for="<?php echo $this->get_field_id( 'category' ); ?>"> <?php echo __( 'Category', 'wp-sponsors' ) ?></label>
    190                 <select id="<?php echo $this->get_field_id( 'category' ); ?>"
    191                         name="<?php echo $this->get_field_name( 'category' ); ?>" class="widefat" style="width:100%;">
    192                     <option value="all"><?php echo _e( 'All', 'wp-sponsors' ); ?></option>
     189                <label for="<?php echo esc_attr( $this->get_field_id( 'category' ) ); ?>"> <?php echo __( 'Category', 'wp-sponsors' ) ?></label>
     190                <select id="<?php echo esc_attr( $this->get_field_id( 'category' ) ); ?>"
     191                        name="<?php echo esc_attr( $this->get_field_name( 'category' ) ); ?>" class="widefat" style="width:100%;">
     192                    <option value="all"><?php echo __( 'All', 'wp-sponsors' ); ?></option>
    193193                    <?php foreach ( $cats as $cat ) { ?>
    194194                        <option <?php selected( $instance['category'], $cat->slug, 'selected' ); ?>
    195                                 value="<?php echo $cat->slug; ?>"><?php echo $cat->name; ?></option>
     195                                value="<?php echo esc_attr( $cat->slug ); ?>"><?php echo esc_html( $cat->name ); ?></option>
    196196                    <?php } ?>
    197197                </select>
     
    199199        <?php } ?>
    200200        <p>
    201             <label for="<?php echo $this->get_field_id( 'display_option' ); ?>"> <?php echo __( 'Display', 'wp-sponsors' ) ?></label>
    202             <select id="<?php echo $this->get_field_id( 'display_option' ); ?>"
    203                     name="<?php echo $this->get_field_name( 'display_option' ); ?>" class="widefat" style="width:100%;">
     201            <label for="<?php echo esc_attr( $this->get_field_id( 'display_option' ) ); ?>"> <?php echo __( 'Display', 'wp-sponsors' ) ?></label>
     202            <select id="<?php echo esc_attr( $this->get_field_id( 'display_option' ) ); ?>"
     203                    name="<?php echo esc_attr( $this->get_field_name( 'display_option' ) ); ?>" class="widefat" style="width:100%;">
    204204                <option <?php selected( $instance['display_option'], 'vertical' ); ?>
    205                         value="vertical"><?php echo _e( 'Vertical (best for sidebars)', 'wp-sponsors' ); ?></option>
     205                        value="vertical"><?php echo __( 'Vertical (best for sidebars)', 'wp-sponsors' ); ?></option>
    206206                <option <?php selected( $instance['display_option'], 'horizontal' ); ?>
    207                         value="horizontal"><?php echo _e( 'Horizontal (best for footers)', 'wp-sponsors' ); ?></option>
     207                        value="horizontal"><?php echo __( 'Horizontal (best for footers)', 'wp-sponsors' ); ?></option>
    208208            </select>
    209209
    210210        </p>
    211211        <p>
    212             <label for="<?php echo $this->get_field_id( 'order_by' ); ?>"> <?php echo __( 'Order by', 'wp-sponsors' ) ?></label>
    213             <select id="<?php echo $this->get_field_id( 'order_by' ); ?>"
    214                     name="<?php echo $this->get_field_name( 'order_by' ); ?>" class="widefat" style="width:100%;">
     212            <label for="<?php echo esc_attr( $this->get_field_id( 'order_by' ) ); ?>"> <?php echo __( 'Order by', 'wp-sponsors' ) ?></label>
     213            <select id="<?php echo esc_attr( $this->get_field_id( 'order_by' ) ); ?>"
     214                    name="<?php echo esc_attr( $this->get_field_name( 'order_by' ) ); ?>" class="widefat" style="width:100%;">
    215215                <option <?php selected( $instance['order_by'], 'menu_order' ); ?>
    216                         value="menu_order"><?php echo _e( 'Weight', 'wp-sponsors' ); ?></option>
     216                        value="menu_order"><?php echo __( 'Weight', 'wp-sponsors' ); ?></option>
    217217                <option <?php selected( $instance['order_by'], 'title' ); ?>
    218                         value="title"><?php echo _e( 'Title', 'wp-sponsors' ); ?></option>
     218                        value="title"><?php echo __( 'Title', 'wp-sponsors' ); ?></option>
    219219                <option <?php selected( $instance['order_by'], 'rand' ); ?>
    220                         value="rand"><?php echo _e( 'Random', 'wp-sponsors' ); ?></option>
     220                        value="rand"><?php echo __( 'Random', 'wp-sponsors' ); ?></option>
    221221            </select>
    222222        </p>
    223223        <p>
    224             <label for="<?php echo $this->get_field_id( 'max' ); ?>"><?php _e( 'Number of sponsors to show  (leave to show all)', 'wp-sponsors' ); ?></label>
    225             <input id="<?php echo $this->get_field_id( 'max' ); ?>" name="<?php echo $this->get_field_name( 'max' ); ?>"
    226                    value="<?php echo $instance['max']; ?>" style="width:100%;" type="number"/>
    227         </p>
    228         <p>
    229             <input type="checkbox" id="<?php echo $this->get_field_id( 'show_title' ); ?>"
    230                    name="<?php echo $this->get_field_name( 'show_title' ); ?>" <?php checked( $instance['show_title'], 'on' ); ?> />
    231             <label for="<?php echo $this->get_field_id( 'show_title' ); ?>"><?php echo __( 'Show sponsor title', 'wp-sponsors' ) ?></label>
    232         </p>
    233         <p>
    234             <input type="checkbox" id="<?php echo $this->get_field_id( 'check_images' ); ?>"
    235                    name="<?php echo $this->get_field_name( 'check_images' ); ?>" <?php checked( $instance['check_images'], 'on' ); ?> />
    236             <label for="<?php echo $this->get_field_id( 'check_images' ); ?>"><?php echo __( 'Show sponsor logo', 'wp-sponsors' ) ?></label>
    237         </p>
    238         <p>
    239             <label for="<?php echo $this->get_field_id( 'image_size' ); ?>"> <?php echo __( 'Image Size', 'wp-sponsors' ) ?></label>
    240             <select id="<?php echo $this->get_field_id( 'image_size' ); ?>"
    241                     name="<?php echo $this->get_field_name( 'image_size' ); ?>" class="widefat" style="width:100%;">
     224            <label for="<?php echo esc_attr( $this->get_field_id( 'max' ) ); ?>"><?php _e( 'Number of sponsors to show  (leave to show all)', 'wp-sponsors' ); ?></label>
     225            <input id="<?php echo esc_attr( $this->get_field_id( 'max' ) ); ?>" name="<?php echo esc_attr( $this->get_field_name( 'max' ) ); ?>"
     226                   value="<?php echo esc_attr( $instance['max'] ); ?>" style="width:100%;" type="number"/>
     227        </p>
     228        <p>
     229            <input type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'show_title' ) ); ?>"
     230                   name="<?php echo esc_attr( $this->get_field_name( 'show_title' ) ); ?>" <?php checked( $instance['show_title'], 'on' ); ?> />
     231            <label for="<?php echo esc_attr( $this->get_field_id( 'show_title' ) ); ?>"><?php echo __( 'Show sponsor title', 'wp-sponsors' ) ?></label>
     232        </p>
     233        <p>
     234            <input type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'check_images' ) ); ?>"
     235                   name="<?php echo esc_attr( $this->get_field_name( 'check_images' ) ); ?>" <?php checked( $instance['check_images'], 'on' ); ?> />
     236            <label for="<?php echo esc_attr( $this->get_field_id( 'check_images' ) ); ?>"><?php echo __( 'Show sponsor logo', 'wp-sponsors' ) ?></label>
     237        </p>
     238        <p>
     239            <label for="<?php echo esc_attr( $this->get_field_id( 'image_size' ) ); ?>"> <?php echo __( 'Image Size', 'wp-sponsors' ) ?></label>
     240            <select id="<?php echo esc_attr( $this->get_field_id( 'image_size' ) ); ?>"
     241                    name="<?php echo esc_attr( $this->get_field_name( 'image_size' ) ); ?>" class="widefat" style="width:100%;">
    242242                <?php
    243243                    foreach( $images_sizes as $size ) {
    244244                        ?>
    245245                        <option <?php selected( $instance['image_size'], $size ); ?>
    246                                 value="<?php echo esc_attr( $size ); ?>"><?php echo $size ?></option>
     246                                value="<?php echo esc_attr( $size ); ?>"><?php echo esc_html( $size ); ?></option>
    247247                        <?php
    248248                    }
     
    251251        </p>
    252252        <p>
    253             <input type="checkbox" id="<?php echo $this->get_field_id( 'show_description' ); ?>"
    254                    name="<?php echo $this->get_field_name( 'show_description' ); ?>" <?php checked( $instance['show_description'], 'on' ); ?> />
    255             <label for="<?php echo $this->get_field_id( 'show_description' ); ?>"><?php echo __( 'Show sponsor description', 'wp-sponsors' ) ?></label>
    256         </p>
    257         <p>
    258             <input type="checkbox" id="<?php echo $this->get_field_id( 'target_blank' ); ?>"
    259                    name="<?php echo $this->get_field_name( 'target_blank' ); ?>" <?php checked( $instance['target_blank'], 'on' ); ?> />
    260             <label for="<?php echo $this->get_field_id( 'target_blank' ); ?>"><?php echo __( 'Open links in a new window', 'wp-sponsors' ) ?></label>
     253            <input type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'show_description' ) ); ?>"
     254                   name="<?php echo esc_attr( $this->get_field_name( 'show_description' ) ); ?>" <?php checked( $instance['show_description'], 'on' ); ?> />
     255            <label for="<?php echo esc_attr( $this->get_field_id( 'show_description' ) ); ?>"><?php echo __( 'Show sponsor description', 'wp-sponsors' ) ?></label>
     256        </p>
     257        <p>
     258            <input type="checkbox" id="<?php echo esc_attr( $this->get_field_id( 'target_blank' ) ); ?>"
     259                   name="<?php echo esc_attr( $this->get_field_name( 'target_blank' ) ); ?>" <?php checked( $instance['target_blank'], 'on' ); ?> />
     260            <label for="<?php echo esc_attr( $this->get_field_id( 'target_blank' ) ); ?>"><?php echo __( 'Open links in a new window', 'wp-sponsors' ) ?></label>
    261261
    262262        </p>
  • wp-sponsors/trunk/includes/class-wp-sponsors.php

    r2531962 r3018504  
    7070
    7171        $this->wp_sponsors = 'wp-sponsors';
    72         $this->version     = '3.5.0';
     72        $this->version     = '3.5.1';
    7373
    7474        $this->define_constants();
  • wp-sponsors/trunk/public/class-wp-sponsors-public.php

    r2376088 r3018504  
    122122        if ( $this->form_errors ) {
    123123            foreach ( $this->form_errors as $error ) {
    124                 echo '<div class="wp-sponsors-form-notice wp-sponsors-form-error">' . $error . '</div>';
     124                echo '<div class="wp-sponsors-form-notice wp-sponsors-form-error">' . wp_kses_post( $error ) . '</div>';
    125125            }
    126126        }
     
    128128        if ( $this->form_notices ) {
    129129            foreach ( $this->form_notices as $notice ) {
    130                 echo '<div class="wp-sponsors-form-notice">' . $notice . '</div>';
     130                echo '<div class="wp-sponsors-form-notice">' . wp_kses_post( $notice ) . '</div>';
    131131            }
    132132        }
     
    151151        }
    152152
    153         $name = isset( $posted_data['name'] ) ? $posted_data['name'] : '';
     153        $name = isset( $posted_data['name'] ) ? sanitize_text_field( $posted_data['name'] ) : '';
    154154
    155155        if ( ! $name ) {
     
    157157        }
    158158
    159         $email = isset( $posted_data['email'] ) ? $posted_data['email'] : '';
     159        $email = isset( $posted_data['email'] ) ? sanitize_text_field( $posted_data['email'] ) : '';
    160160
    161161        if ( ! $email ) {
     
    163163        }
    164164
    165         $desc  = isset( $posted_data['desc'] ) ? $posted_data['desc'] : '';
    166         $url   = isset( $posted_data['website'] ) ? $posted_data['website'] : '';
     165        $desc  = isset( $posted_data['desc'] ) ? sanitize_textarea_field( $posted_data['desc'] ) : '';
     166        $url   = isset( $posted_data['website'] ) ? sanitize_url( $posted_data['website'] ) : '';
    167167
    168168        do_action( 'sponsors_acquisition_form_before_submit', $this, $posted_data );
     
    197197        $sponsor = get_post( $sponsor_id );
    198198
    199         $sponsor_link = admin_url( 'post.php?post=' . $sponsor_id . '&action=edit');
    200         $subject = sprintf( __( 'New Sponsor Submitted: %s', 'wp-sponsors' ), $sponsor->post_title );
     199        $sponsor_link = admin_url( 'post.php?post=' . absint( $sponsor_id ) . '&action=edit');
     200        $subject = sprintf( __( 'New Sponsor Submitted: %s', 'wp-sponsors' ), esc_html( $sponsor->post_title ) );
    201201        $message = __( 'Hi, there was a new sponsor submission on your site!', 'wp-sponsors' );
    202         $message .= sprintf( __( 'You can check it out here: %s', 'wp-sponsors' ), '<a href="' . esc_url( $sponsor_link ) . '">' . $sponsor_link . '</a>' );
     202        $message .= sprintf( __( 'You can check it out here: %s', 'wp-sponsors' ), '<a href="' . esc_url( $sponsor_link ) . '">' . esc_html( $sponsor_link ) . '</a>' );
    203203        $to = get_option( 'admin_email' );
    204204
  • wp-sponsors/trunk/wp-sponsors.php

    r2531962 r3018504  
    55 * Plugin URI:        http://www.wpsimplesponsorships.com
    66 * Description:       Add links and logo's for your sponsors/partners/etc to your sidebars and posts with our widget and shortcode.
    7  * Version:           3.5.0
     7 * Version:           3.5.1
    88 * Author:            Simple Sponsorships
    99 * Author URI:        http://www.wpsimplesponsorships.com
Note: See TracChangeset for help on using the changeset viewer.