Changeset 3018504
- Timestamp:
- 01/08/2024 01:35:53 AM (2 years ago)
- Location:
- wp-sponsors/trunk
- Files:
-
- 9 edited
-
README.txt (modified) (2 diffs)
-
admin/class-wp-sponsors-admin.php (modified) (3 diffs)
-
admin/partials/meta-boxes/sponsor-info.php (modified) (3 diffs)
-
includes/class-wp-sponsors-blocks.php (modified) (2 diffs)
-
includes/class-wp-sponsors-shortcodes.php (modified) (2 diffs)
-
includes/class-wp-sponsors-widget.php (modified) (6 diffs)
-
includes/class-wp-sponsors.php (modified) (1 diff)
-
public/class-wp-sponsors-public.php (modified) (6 diffs)
-
wp-sponsors.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
wp-sponsors/trunk/README.txt
r2531962 r3018504 4 4 Tags: post type, images, partners, sponsors 5 5 Requires at least: 3.1.0 6 Tested up to: 5.7.16 Tested up to: 6.4.2 7 7 Requires PHP: 7.0 8 Stable tag: 3.5. 08 Stable tag: 3.5.1 9 9 License: GPLv2 or later 10 10 License URI: http://www.gnu.org/licenses/gpl-2.0.html … … 110 110 == Changelog == 111 111 112 = 3.5.1 - 2024-01-08 = 113 * Security update 114 112 115 = 3.5.0 - 2021-05-14 = 113 116 * 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 99 99 wp_enqueue_script( $this->wp_sponsors, WP_SPONSORS_URL . 'assets/dist/js/admin.js', array( 'jquery' ), $this->version, false ); 100 100 wp_localize_script($this->wp_sponsors, 'objectL10n', array( 101 'title' => __('Select a sponsor logo', 'wp-sponsors'),101 'title' => __('Select a sponsor logo', 'wp-sponsors'), 102 102 'button' => __('Add image', 'wp-sponsors') 103 ));103 )); 104 104 105 105 } … … 131 131 // Checks for input and sanitizes/saves if needed 132 132 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'] ) ) ); 134 134 } 135 135 136 136 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'] ) ) ); 138 138 } 139 139 140 140 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'] ) ) ); 142 142 } 143 143 … … 222 222 if(is_admin()) { 223 223 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(); 226 226 } 227 227 return; -
wp-sponsors/trunk/admin/partials/meta-boxes/sponsor-info.php
r2137237 r3018504 3 3 // Display code/markup goes here. Don't forget to include nonces! 4 4 // 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__) ) . '" />';5 echo '<input type="hidden" name="wp_sponsors_nonce" id="wp_sponsors_nonce" value="' . esc_attr( wp_create_nonce( plugin_basename( __FILE__ ) ) ) . '" />'; 6 6 // Get the url data if its already been entered 7 7 $meta_value = get_post_meta( get_the_ID(), '_website', true ); … … 11 11 // Checks and displays the retrieved value 12 12 echo '<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" />';13 echo '<input type="url" name="_website" value="' . esc_attr( $meta_value ) . '" class="widefat" />'; 14 14 15 15 … … 18 18 // Checks and displays the retrieved value 19 19 echo '<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" />';20 echo '<input type="email" id="wp_sponosrs_email" name="_email" value="' . esc_attr( $meta_value ) . '" class="widefat" />'; 21 21 22 22 -
wp-sponsors/trunk/includes/class-wp-sponsors-blocks.php
r2531962 r3018504 192 192 'wp-sponsors-block-js', 193 193 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', ) 195 196 ); 196 197 } … … 210 211 'wp-sponsors-block-css', 211 212 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', ) 213 215 ); 214 216 } -
wp-sponsors/trunk/includes/class-wp-sponsors-shortcodes.php
r2531962 r3018504 265 265 ), 266 266 );*/ 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 ) ) . '">'; 268 268 $style['containerPost'] = '</div>'; 269 269 $style['wrapperClass'] = 'sponsor-item'; … … 299 299 } 300 300 301 echo '<' . $style['wrapperPre'] . ' class="' . $style['wrapperClass'] . ' ' . $class. '">';301 echo '<' . $style['wrapperPre'] . ' class="' . esc_attr( $style['wrapperClass'] ) . ' ' . esc_attr( $class ) . '">'; 302 302 $sponsor_html = ''; 303 303 -
wp-sponsors/trunk/includes/class-wp-sponsors-widget.php
r2531962 r3018504 64 64 echo $args['before_title'] . $title . $args['after_title']; 65 65 } ?> 66 <ul class="<?php echo $instance['display_option']; ?>">66 <ul class="<?php echo esc_attr( $instance['display_option'] ); ?>"> 67 67 <?php while ( $query->have_posts() ) : $query->the_post(); ?> 68 68 <?php … … 94 94 if ( ! $image || $use_title ) { 95 95 ?> 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> 97 97 <?php 98 98 } … … 113 113 if ( $desc ) { 114 114 echo '<br/>'; 115 echo '<p class="sponsor-desc">' . $desc. '</p>';115 echo '<p class="sponsor-desc">' . wp_kses_post( $desc ) . '</p>'; 116 116 } 117 117 } … … 180 180 $cats = get_terms( 'sponsor_categories' ); ?> 181 181 <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'] ); ?>" 185 185 style="width:100%;"/> 186 186 </p> 187 187 <?php if ( ! empty( $cats ) && ! is_wp_error( $cats ) ) { ?> 188 188 <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> 193 193 <?php foreach ( $cats as $cat ) { ?> 194 194 <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> 196 196 <?php } ?> 197 197 </select> … … 199 199 <?php } ?> 200 200 <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%;"> 204 204 <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> 206 206 <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> 208 208 </select> 209 209 210 210 </p> 211 211 <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%;"> 215 215 <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> 217 217 <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> 219 219 <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> 221 221 </select> 222 222 </p> 223 223 <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%;"> 242 242 <?php 243 243 foreach( $images_sizes as $size ) { 244 244 ?> 245 245 <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> 247 247 <?php 248 248 } … … 251 251 </p> 252 252 <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> 261 261 262 262 </p> -
wp-sponsors/trunk/includes/class-wp-sponsors.php
r2531962 r3018504 70 70 71 71 $this->wp_sponsors = 'wp-sponsors'; 72 $this->version = '3.5. 0';72 $this->version = '3.5.1'; 73 73 74 74 $this->define_constants(); -
wp-sponsors/trunk/public/class-wp-sponsors-public.php
r2376088 r3018504 122 122 if ( $this->form_errors ) { 123 123 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>'; 125 125 } 126 126 } … … 128 128 if ( $this->form_notices ) { 129 129 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>'; 131 131 } 132 132 } … … 151 151 } 152 152 153 $name = isset( $posted_data['name'] ) ? $posted_data['name']: '';153 $name = isset( $posted_data['name'] ) ? sanitize_text_field( $posted_data['name'] ) : ''; 154 154 155 155 if ( ! $name ) { … … 157 157 } 158 158 159 $email = isset( $posted_data['email'] ) ? $posted_data['email']: '';159 $email = isset( $posted_data['email'] ) ? sanitize_text_field( $posted_data['email'] ) : ''; 160 160 161 161 if ( ! $email ) { … … 163 163 } 164 164 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'] ) : ''; 167 167 168 168 do_action( 'sponsors_acquisition_form_before_submit', $this, $posted_data ); … … 197 197 $sponsor = get_post( $sponsor_id ); 198 198 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 ) ); 201 201 $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>' ); 203 203 $to = get_option( 'admin_email' ); 204 204 -
wp-sponsors/trunk/wp-sponsors.php
r2531962 r3018504 5 5 * Plugin URI: http://www.wpsimplesponsorships.com 6 6 * 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. 07 * Version: 3.5.1 8 8 * Author: Simple Sponsorships 9 9 * Author URI: http://www.wpsimplesponsorships.com
Note: See TracChangeset
for help on using the changeset viewer.