Say what? - Version 2.1.0

Version Description

  • New: Optimise performance when an external object cache is available
  • Fix: Imports via WP-CLI could fail if the pro extension had previously been active
Download this release

Release Info

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

Code changes from version 2.1.1 to 2.1.0

Files changed (3) hide show
  1. readme.txt +2 -5
  2. say-what-settings.php +3 -6
  3. say-what.php +1 -1
readme.txt CHANGED
@@ -4,8 +4,8 @@ Donate link: http://plugins.leewillis.co.uk/downloads/say-what-pro?utm_source=wo
4
  Tags: string, change, translation
5
  Requires at least: 5.4
6
  Requires PHP: 5.6
7
- Tested up to: 6.0
8
- Stable tag: 2.1.1
9
 
10
  == Description ==
11
  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!
@@ -65,9 +65,6 @@ Not in the free plugin, however this is available in the [Pro version of the plu
65
 
66
  == Changelog ==
67
 
68
- = 2.1.1 =
69
- * Fix: Resolve issue where console errors could be thrown if no replacements configured.
70
-
71
  = 2.1.0 =
72
  * New: Optimise performance when an external object cache is available
73
  * Fix: Imports via WP-CLI could fail if the pro extension had previously been active
4
  Tags: string, change, translation
5
  Requires at least: 5.4
6
  Requires PHP: 5.6
7
+ Tested up to: 6.1
8
+ Stable tag: 2.1.0
9
 
10
  == Description ==
11
  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!
65
 
66
  == Changelog ==
67
 
 
 
 
68
  = 2.1.0 =
69
  * New: Optimise performance when an external object cache is available
70
  * Fix: Imports via WP-CLI could fail if the pro extension had previously been active
say-what-settings.php CHANGED
@@ -55,10 +55,7 @@ class SayWhatSettings {
55
  return $this->flattened_replacements;
56
  }
57
  }
58
- // Otherwise, generate them...
59
- if ( empty( $this->replacements ) ) {
60
- $this->flattened_replacements = [];
61
- }
62
  array_walk(
63
  $this->replacements,
64
  function ( $replacement ) {
@@ -68,7 +65,6 @@ class SayWhatSettings {
68
  $this->flattened_replacements[ $key ] = $replacement['replacement_string'];
69
  }
70
  );
71
- // ...and cache them.
72
  if ( wp_using_ext_object_cache() ) {
73
  wp_cache_set( 'say_what_flattened_replacements', $this->flattened_replacements, 'swp', 3600 );
74
  }
@@ -80,7 +76,7 @@ class SayWhatSettings {
80
  * @return void
81
  */
82
  public function invalidate_caches() {
83
- wp_cache_delete_multiple( [ 'say_what_strings', 'say_what_flattened_replacements' ], 'swp' );
84
  }
85
 
86
  /**
@@ -118,6 +114,7 @@ class SayWhatSettings {
118
  private function load_replacements_from_database() {
119
  global $wpdb, $table_prefix;
120
 
 
121
  $sql = "SELECT * FROM {$table_prefix}say_what_strings";
122
  $this->replacements = $wpdb->get_results( $sql, ARRAY_A );
123
  // Cache them if we're using an external object cache.
55
  return $this->flattened_replacements;
56
  }
57
  }
58
+ // Otherwise, generate them, and cache them.
 
 
 
59
  array_walk(
60
  $this->replacements,
61
  function ( $replacement ) {
65
  $this->flattened_replacements[ $key ] = $replacement['replacement_string'];
66
  }
67
  );
 
68
  if ( wp_using_ext_object_cache() ) {
69
  wp_cache_set( 'say_what_flattened_replacements', $this->flattened_replacements, 'swp', 3600 );
70
  }
76
  * @return void
77
  */
78
  public function invalidate_caches() {
79
+ wp_cache_delete_multiple( [ 'say_what_strings', 'say_what_flattened_replacements', ], 'swp' );
80
  }
81
 
82
  /**
114
  private function load_replacements_from_database() {
115
  global $wpdb, $table_prefix;
116
 
117
+ // If they didn't exist in the cache, load from the DB.
118
  $sql = "SELECT * FROM {$table_prefix}say_what_strings";
119
  $this->replacements = $wpdb->get_results( $sql, ARRAY_A );
120
  // Cache them if we're using an external object cache.
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: 2.1.1
8
  * Author: Ademti Software
9
  * Author URI: https://plugins.leewillis.co.uk/
10
  * Text Domain: say-what
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: 2.1.0
8
  * Author: Ademti Software
9
  * Author URI: https://plugins.leewillis.co.uk/
10
  * Text Domain: say-what