Say what? - Version 1.5

Version Description

Avoid warnings on initial activation. Avoid issues where strings contain HTML / entities

Download this release

Release Info

Developer leewillis77
Plugin Icon 128x128 Say what?
Version 1.5
Comparing to
See all releases

Code changes from version 1.4 to 1.5

html/say-what-admin-addedit.php CHANGED
@@ -8,23 +8,23 @@
8
  <input type="hidden" name="say_what_save" value="1">
9
  <?php wp_nonce_field( 'swaddedit', 'nonce' ); ?>
10
  <?php if ( ! empty ( $replacement->string_id ) ) : ?>
11
- <input type="hidden" name="say_what_string_id" value="<?php echo esc_attr( $replacement->string_id ); ?>">
12
  <?php endif; ?>
13
  <p>
14
  <label for="say_what_orig_string"><?php _e( 'Original string', 'say_what' ); ?></label><br/>
15
- <input type="text" name="say_what_orig_string" size="120" value="<?php echo esc_attr( $replacement->orig_string ) ?>"><br/>
16
  </p>
17
  <p>
18
  <label for="say_what_domain"><?php _e( 'Text domain', 'say_what' ); ?></label> <a href="http://plugins.leewillis.co.uk/doc_post/adding-string-replacement/"><i class="dashicons dashicons-info">&nbsp;</i></a><br/>
19
- <input type="text" name="say_what_domain" size="30" value="<?php echo esc_attr( $replacement->domain ); ?>"><br/>
20
  </p>
21
  <p>
22
  <label for="say_what_context"><?php _e( 'Text context', 'say_what' ); ?></label> <a href="http://plugins.leewillis.co.uk/doc_post/replacing-wordpress-strings-context/"><i class="dashicons dashicons-info">&nbsp;</i></a><br/>
23
- <input type="text" name="say_what_context" size="30" value="<?php echo esc_attr( $replacement->context ); ?>"><br/>
24
  </p>
25
  <p>
26
  <label for="say_what_replacement_string"><?php _e( 'Replacement string', 'say_what' ); ?></label><br/>
27
- <input type="text" name="say_what_replacement_string" size="120" value="<?php echo esc_attr( $replacement->replacement_string ); ?>"><br/>
28
  </p>
29
  <p>
30
  <input type="submit" class="button-primary" value="<?php ! empty( $replacement->string_id ) ? _e( 'Update', 'say_what' ) : _e( 'Add', 'say_what' ); ?>">
8
  <input type="hidden" name="say_what_save" value="1">
9
  <?php wp_nonce_field( 'swaddedit', 'nonce' ); ?>
10
  <?php if ( ! empty ( $replacement->string_id ) ) : ?>
11
+ <input type="hidden" name="say_what_string_id" value="<?php echo esc_attr( htmlspecialchars( $replacement->string_id ) ); ?>">
12
  <?php endif; ?>
13
  <p>
14
  <label for="say_what_orig_string"><?php _e( 'Original string', 'say_what' ); ?></label><br/>
15
+ <input type="text" name="say_what_orig_string" size="120" value="<?php echo esc_attr( htmlspecialchars( $replacement->orig_string ) ) ?>"><br/>
16
  </p>
17
  <p>
18
  <label for="say_what_domain"><?php _e( 'Text domain', 'say_what' ); ?></label> <a href="http://plugins.leewillis.co.uk/doc_post/adding-string-replacement/"><i class="dashicons dashicons-info">&nbsp;</i></a><br/>
19
+ <input type="text" name="say_what_domain" size="30" value="<?php echo esc_attr( htmlspecialchars( $replacement->domain ) ); ?>"><br/>
20
  </p>
21
  <p>
22
  <label for="say_what_context"><?php _e( 'Text context', 'say_what' ); ?></label> <a href="http://plugins.leewillis.co.uk/doc_post/replacing-wordpress-strings-context/"><i class="dashicons dashicons-info">&nbsp;</i></a><br/>
23
+ <input type="text" name="say_what_context" size="30" value="<?php echo esc_attr( htmlspecialchars( $replacement->context ) ); ?>"><br/>
24
  </p>
25
  <p>
26
  <label for="say_what_replacement_string"><?php _e( 'Replacement string', 'say_what' ); ?></label><br/>
27
+ <input type="text" name="say_what_replacement_string" size="120" value="<?php echo esc_attr( htmlspecialchars( $replacement->replacement_string ) ); ?>"><br/>
28
  </p>
29
  <p>
30
  <input type="submit" class="button-primary" value="<?php ! empty( $replacement->string_id ) ? _e( 'Update', 'say_what' ) : _e( 'Add', 'say_what' ); ?>">
html/say-what-admin-list.php CHANGED
@@ -8,8 +8,8 @@
8
  ?>
9
  <div class="saywhat-gopro">
10
  <h2>Go pro</h2>
11
- <p><a href="http://plugins.leewillis.co.uk/downloads/say-what-pro/?utm_campaign=saywhatproupgrade">Say What? Pro</a> makes it even easier for you to change strings by offering <em><a href="http://plugins.leewillis.co.uk/doc_post/string-discovery/" target="_blank">String Discovery</a></em> and autocomplete, making it even easier to find the strings you need to change without diving through code.</p>
12
  <p><strong>Upgrade to the Pro version today, and <em>save 20%</em> with the code <code>SAYWHATWP</code> at checkout.</strong></p>
13
- <p><a href="http://plugins.leewillis.co.uk/downloads/say-what-pro/?utm_campaign=saywhatproupgrade" class="button button-primary">Go Pro now &raquo;</a></p>
14
  </div>
15
  </div>
8
  ?>
9
  <div class="saywhat-gopro">
10
  <h2>Go pro</h2>
11
+ <p><a href="http://plugins.leewillis.co.uk/downloads/say-what-pro/?utm_source=wporg&amp;utm_medium=plugin&amp;utm_campaign=saywhatproupgrade">Say What? Pro</a> makes it even easier for you to change strings by offering <em><a href="http://plugins.leewillis.co.uk/doc_post/string-discovery/?utm_source=wporg&amp;utm_medium=plugin&amp;utm_campaign=saywhatproupgrade" target="_blank">String Discovery</a></em> and autocomplete, making it even easier to find the strings you need to change without diving through code.</p>
12
  <p><strong>Upgrade to the Pro version today, and <em>save 20%</em> with the code <code>SAYWHATWP</code> at checkout.</strong></p>
13
+ <p><a href="http://plugins.leewillis.co.uk/downloads/say-what-pro/?utm_source=wporg&amp;utm_medium=plugin&amp;utm_campaign=saywhatproupgrade" class="button button-primary">Go Pro now &raquo;</a></p>
14
  </div>
15
  </div>
readme.txt CHANGED
@@ -3,8 +3,8 @@ Contributors: leewillis77
3
  Donate link: http://www.leewillis.co.uk/wordpress-plugins/?utm_source=wordpress&utm_medium=www&utm_campaign=say-what
4
  Tags: string, change, translation
5
  Requires at least: 3.5
6
- Tested up to: 4.0
7
- Stable tag: 1.4
8
 
9
  == Description ==
10
  An easy-to-use plugin that allows you to alter strings on your site without editing WordPress core, or plugin code. Simply enter the current string, and what you want to replace it with and the plugin will automatically do the rest!
@@ -48,6 +48,10 @@ See the [GitHub homepage](https://github.com/leewillis77/say-what) for examples.
48
 
49
  == Changelog ==
50
 
 
 
 
 
51
  = 1.4 =
52
  Add info box about Pro version
53
 
3
  Donate link: http://www.leewillis.co.uk/wordpress-plugins/?utm_source=wordpress&utm_medium=www&utm_campaign=say-what
4
  Tags: string, change, translation
5
  Requires at least: 3.5
6
+ Tested up to: 4.3
7
+ Stable tag: 1.5
8
 
9
  == Description ==
10
  An easy-to-use plugin that allows you to alter strings on your site without editing WordPress core, or plugin code. Simply enter the current string, and what you want to replace it with and the plugin will automatically do the rest!
48
 
49
  == Changelog ==
50
 
51
+ = 1.5 =
52
+ Avoid warnings on initial activation.
53
+ Avoid issues where strings contain HTML / entities
54
+
55
  = 1.4 =
56
  Add info box about Pro version
57
 
say-what-list-table.class.php CHANGED
@@ -103,7 +103,7 @@ class SayWhatListTable extends WP_List_Table {
103
  * Output column data
104
  */
105
  function column_default( $item, $column_name ) {
106
- return esc_html( $item[ $column_name ] );
107
  }
108
 
109
  /**
103
  * Output column data
104
  */
105
  function column_default( $item, $column_name ) {
106
+ return esc_html( htmlspecialchars( $item[ $column_name ] ) );
107
  }
108
 
109
  /**
say-what-settings.php CHANGED
@@ -9,7 +9,7 @@ if ( ! defined( 'ABSPATH' ) ) {
9
  */
10
  class SayWhatSettings {
11
 
12
- public $replacements;
13
 
14
  /**
15
  * Constructor.
@@ -18,7 +18,10 @@ class SayWhatSettings {
18
  */
19
  public function __construct() {
20
  global $wpdb, $table_prefix;
21
- // @TODO - Read other settings in when we have them
 
 
 
22
  $sql = "SELECT * FROM {$table_prefix}say_what_strings";
23
  $this->replacements = $wpdb->get_results( $sql, ARRAY_A );
24
  }
9
  */
10
  class SayWhatSettings {
11
 
12
+ public $replacements = array();
13
 
14
  /**
15
  * Constructor.
18
  */
19
  public function __construct() {
20
  global $wpdb, $table_prefix;
21
+ $current_db_version = get_option( 'say_what_db_version' );
22
+ if ( false === $current_db_version ) {
23
+ return;
24
+ }
25
  $sql = "SELECT * FROM {$table_prefix}say_what_strings";
26
  $this->replacements = $wpdb->get_results( $sql, ARRAY_A );
27
  }
say-what.php CHANGED
@@ -4,7 +4,7 @@
4
  Plugin Name: Say What?
5
  Plugin URI: https://github.com/leewillis77/say-what
6
  Description: An easy-to-use plugin that allows you to alter strings on your site without editing WordPress core, or plugin code
7
- Version: 1.4
8
  Author: Lee Willis
9
  Author URI: http://www.leewillis.co.uk/
10
  */
4
  Plugin Name: Say What?
5
  Plugin URI: https://github.com/leewillis77/say-what
6
  Description: An easy-to-use plugin that allows you to alter strings on your site without editing WordPress core, or plugin code
7
+ Version: 1.5
8
  Author: Lee Willis
9
  Author URI: http://www.leewillis.co.uk/
10
  */