Skip to content
Permalink
Browse files Browse the repository at this point in the history
New version 1.3 fixing prettyPhoto XSS issue and video rendering
git-svn-id: https://plugins.svn.wordpress.org/woo-popup/trunk@1165140 b8457f37-d9ea-0310-8a92-e5e31aec5664
  • Loading branch information
guillaume-lostweb committed May 21, 2015
1 parent 45077f7 commit 7c76ac7
Show file tree
Hide file tree
Showing 8 changed files with 272 additions and 29 deletions.
4 changes: 2 additions & 2 deletions README.txt
Expand Up @@ -3,8 +3,8 @@ Contributors: Guillaume Kanoufi
Donate link: http://lostwebdesigns.com/
Tags: pop up, woocommerce, woopopup, modal window, display info after a product is added
Requires at least: 3.5.1
Tested up to: 3.9
Stable tag: 1.2.2
Tested up to: 4.2
Stable tag: 1.3.0
License: GPLv2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html

Expand Down
11 changes: 10 additions & 1 deletion admin/class-woo-popup-admin.php
Expand Up @@ -194,6 +194,7 @@ public function validate($input) {
$valid['popup_content'] = wp_kses_post($input['popup_content']);
$valid['popup_page'] = sanitize_text_field($input['popup_page']);
$valid['popup_class'] = sanitize_text_field($input['popup_class']);
$valid['popup_theme'] = sanitize_text_field($input['popup_theme']);
$valid['start_date'] = sanitize_text_field($input['start_date']);
$valid['end_date'] = sanitize_text_field($input['end_date']);
$valid['popup_timezone'] = sanitize_text_field($input['popup_timezone']);
Expand Down Expand Up @@ -237,8 +238,16 @@ public function validate($input) {

$valid['popup_class'] = $this->data['popup_class'];
}
if (strlen($valid['popup_theme']) == 0) {
add_settings_error(
'popup_theme',
'popup_theme_texterror',
'Please choose a theme to display the pop up to',
'error'
);


$valid['popup_class'] = $this->data['popup_class'];
}
if (strlen($valid['start_date']) == 0) {
add_settings_error(
'start_date',
Expand Down
42 changes: 40 additions & 2 deletions admin/views/admin.php
Expand Up @@ -29,6 +29,8 @@
$content = $options['popup_content'];
$page = $options['popup_page'];
$class = $options['popup_class'];
$theme = $options['popup_theme'];
// $use_button = $options['popup_use_button'];
$permanent = $options['popup_permanent'];
$start_date = $options['start_date'];
$end_date = $options['end_date'];
Expand All @@ -42,7 +44,25 @@
?>


<?php wp_editor( $content, $this->options_slug.'[popup_content]'); ?>
<?php
// editor_id cannot have brackets and must be lowercase
$editor_id = 'popup_content';
// textarea_name in array can have brackets!
$settings = array(
'wpautop' => true, // use wpautop?
'media_buttons' => true, // show insert/upload button(s)
'textarea_name' => $this->options_slug.'[popup_content]', // set the textarea name to something different, square brackets [] can be used here
'textarea_rows' => get_option('default_post_edit_rows', 10), // rows="..."
'tabindex' => '',
'editor_css' => '', // intended for extra styles for both visual and HTML editors buttons, needs to include the <style> tags, can use "scoped".
'editor_class' => '', // add extra class(es) to the editor textarea
'teeny' => false, // output the minimal editor config used in Press This
'dfw' => true, // replace the default fullscreen with DFW (supported on the front-end in WordPress 3.4)
'tinymce' => true, // load TinyMCE, can be used to pass settings directly to TinyMCE using an array()
'quicktags' => true
);
wp_editor($content, $editor_id, $settings);?>

<table width="100%" cellpadding="10" class="form-table">
<tr>
<th scope="row">
Expand All @@ -61,13 +81,31 @@
</td>

</tr>
<tr>
<th scope="row">
<label><?php _e('Choose the prettyPhoto Modal theme color', $this->plugin_slug);?>:</label>
</th>
<td>
<select name="<?php echo $this->options_slug;?>[popup_theme]" >
light_rounded / dark_rounded / light_square / dark_square / facebook
<option value="pp_default" <?php if($theme == 'pp_default') echo 'selected';?>>Default</option>
<option value="light_rounded" <?php if($theme == 'light_rounded') echo 'selected';?>>Light Rounded</option>
<option value="dark_rounded" <?php if($theme == 'dark_rounded') echo 'selected';?>>Dark Rounded</option>
<option value="light_square" <?php if($theme == 'light_square') echo 'selected';?>>Light Square</option>
<option value="dark_square" <?php if($theme == 'dark_square') echo 'selected';?>>Dark Square</option>
<option value="facebook" <?php if($theme == 'facebook') echo 'selected';?>>Facebook</option>
</select>
</td>

</tr>
<tr>
<tr>
<th scope="row">
<label><?php _e('If using woocommerce, you can choose from woocommerce-message classes (message, info or error) else it will add a custom class of woopopup-yourchoice (your choice being: message, info or error) so you will be able to style it in your css', $this->plugin_slug);?>:</label>
</th>
<td>
<select name="<?php echo $this->options_slug;?>[popup_class]" >
<option value="notice">Notice (default non woocommerce class)</option>
<option value="notice" <?php if($class == 'notice') echo 'selected';?>>Notice (default non woocommerce class)</option>
<option value="message" <?php if($class == 'message') echo 'selected';?>>Message</option>
<option value="info" <?php if($class == 'info') echo 'selected';?>>Info</option>
<option value="error" <?php if($class == 'error') echo 'selected';?>>Error</option>
Expand Down

0 comments on commit 7c76ac7

Please sign in to comment.