Contextual Related Posts - Version 2.9.4

Version Description

Release post: https://webberzone.com/blog/contextual-related-posts-v2-9-3/

  • Bugs:
    • Fixed nonce verification not always done in Import/Export interface. Thanks to Lenon Leite
Download this release

Release Info

Developer Ajay
Plugin Icon 128x128 Contextual Related Posts
Version 2.9.4
Comparing to
See all releases

Code changes from version 2.9.3 to 2.9.4

README.md CHANGED
@@ -8,7 +8,7 @@
8
 
9
  __Requires:__ 4.9
10
 
11
- __Tested up to:__ 5.4
12
 
13
  __License:__ [GPL-2.0+](http://www.gnu.org/licenses/gpl-2.0.html)
14
 
8
 
9
  __Requires:__ 4.9
10
 
11
+ __Tested up to:__ 5.5
12
 
13
  __License:__ [GPL-2.0+](http://www.gnu.org/licenses/gpl-2.0.html)
14
 
changelog.txt CHANGED
@@ -2,6 +2,24 @@
2
 
3
  This is an archive of older changelog entries. Most recent entries are maintained in readme.txt
4
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
5
  = 2.7.0 =
6
 
7
  * Features:
2
 
3
  This is an archive of older changelog entries. Most recent entries are maintained in readme.txt
4
 
5
+ = 2.8.0 =
6
+
7
+ Release post: [https://webberzone.com/blog/contextual-related-posts-v2-8-0/](https://webberzone.com/blog/contextual-related-posts-v2-8-0/)
8
+
9
+ * Features:
10
+ * New block for Gutenberg aka the block editor. The block is called **Related Posts [CRP]** and you can find it under the widgets category
11
+ * Two new settings in the widget: **Order posts** and **Randomize order** that allows the global setting to be overridden
12
+ * New setting called **Keyword** in the Meta box where you can enter a word or a phrase to find related posts. If entered, the plugin will continue to search the `post_title` and `post_content` fields but will use this keyword instead of the values of the title and content of the source post
13
+
14
+ * Enhancements:
15
+ * Show author, Show date, Show post excerpt and Post thumbnail settings will show a message that they cannnot be modified in case the Rounded thumbnails or No text styles are selected
16
+
17
+ * Bug fixes:
18
+ * Selecting date order now orders the related posts by newest first
19
+ * Fixed PHP warning in the widget
20
+ * Stop using `current_time( 'timestamp' )`
21
+ * Fixes incorrect thumbnail image displayed for attachments in the related posts list
22
+
23
  = 2.7.0 =
24
 
25
  * Features:
contextual-related-posts.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: Contextual Related Posts
16
  * Plugin URI: https://webberzone.com/plugins/contextual-related-posts/
17
  * Description: Display a set of related posts on your website or in your feed. Increase reader retention and reduce bounce rates
18
- * Version: 2.9.3
19
  * Author: WebberZone
20
  * Author URI: https://webberzone.com
21
  * License: GPL-2.0+
15
  * Plugin Name: Contextual Related Posts
16
  * Plugin URI: https://webberzone.com/plugins/contextual-related-posts/
17
  * Description: Display a set of related posts on your website or in your feed. Increase reader retention and reduce bounce rates
18
+ * Version: 2.9.4
19
  * Author: WebberZone
20
  * Author URI: https://webberzone.com
21
  * License: GPL-2.0+
includes/admin/modules/tools.php CHANGED
@@ -100,7 +100,7 @@ function crp_tools_page() {
100
  <?php submit_button( esc_html__( 'Export Settings', 'contextual-related-posts' ), 'primary', 'crp_export_settings', false ); ?>
101
  </p>
102
 
103
- <?php wp_nonce_field( 'crp_export_setting_nonce', 'crp_export_setting_nonce' ); ?>
104
  </form>
105
 
106
  <form method="post" enctype="multipart/form-data">
@@ -191,7 +191,7 @@ function crp_process_settings_export() {
191
  return;
192
  }
193
 
194
- if ( isset( $_POST['crp_export_settings_nonce'] ) && ! wp_verify_nonce( sanitize_key( $_POST['crp_export_settings_nonce'] ), 'crp_export_settings_nonce' ) ) {
195
  return;
196
  }
197
 
@@ -224,7 +224,7 @@ function crp_process_settings_import() {
224
  return;
225
  }
226
 
227
- if ( isset( $_POST['crp_import_settings_nonce'] ) && ! wp_verify_nonce( sanitize_key( $_POST['crp_import_settings_nonce'] ), 'crp_import_settings_nonce' ) ) {
228
  return;
229
  }
230
 
100
  <?php submit_button( esc_html__( 'Export Settings', 'contextual-related-posts' ), 'primary', 'crp_export_settings', false ); ?>
101
  </p>
102
 
103
+ <?php wp_nonce_field( 'crp_export_settings_nonce', 'crp_export_settings_nonce' ); ?>
104
  </form>
105
 
106
  <form method="post" enctype="multipart/form-data">
191
  return;
192
  }
193
 
194
+ if ( ! isset( $_POST['crp_export_settings_nonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['crp_export_settings_nonce'] ), 'crp_export_settings_nonce' ) ) {
195
  return;
196
  }
197
 
224
  return;
225
  }
226
 
227
+ if ( ! isset( $_POST['crp_import_settings_nonce'] ) || ! wp_verify_nonce( sanitize_key( $_POST['crp_import_settings_nonce'] ), 'crp_import_settings_nonce' ) ) {
228
  return;
229
  }
230
 
includes/tools.php CHANGED
@@ -196,7 +196,7 @@ function crp_posts_table_engine() {
196
  *
197
  * @since 2.9.0
198
  *
199
- * @param string $array Input string.
200
  * @param string $delimiter Delimiter.
201
  * @param string $enclosure Enclosure.
202
  * @param string $terminator Terminating string.
@@ -215,7 +215,7 @@ function crp_str_putcsv( $array, $delimiter = ',', $enclosure = '"', $terminator
215
  for ( $i = 0; $i < $array_size; $i++ ) {
216
  // Nested array, process nest item.
217
  if ( is_array( $work_array[ $i ] ) ) {
218
- $string .= str_putcsv( $work_array[ $i ], $delimiter, $enclosure, $terminator );
219
  } else {
220
  switch ( gettype( $work_array[ $i ] ) ) {
221
  // Manually set some strings.
196
  *
197
  * @since 2.9.0
198
  *
199
+ * @param array $array Input string.
200
  * @param string $delimiter Delimiter.
201
  * @param string $enclosure Enclosure.
202
  * @param string $terminator Terminating string.
215
  for ( $i = 0; $i < $array_size; $i++ ) {
216
  // Nested array, process nest item.
217
  if ( is_array( $work_array[ $i ] ) ) {
218
+ $string .= crp_str_putcsv( $work_array[ $i ], $delimiter, $enclosure, $terminator );
219
  } else {
220
  switch ( gettype( $work_array[ $i ] ) ) {
221
  // Manually set some strings.
phpcs.ruleset.xml DELETED
@@ -1,17 +0,0 @@
1
- <?xml version="1.0"?>
2
- <ruleset name="WordPress Coding Standards for Plugins">
3
- <description>Generally-applicable sniffs for WordPress plugins</description>
4
-
5
- <exclude-pattern>*/node_modules/*</exclude-pattern>
6
- <exclude-pattern>*/vendor/*</exclude-pattern>
7
- <exclude-pattern>*/tests/*</exclude-pattern>
8
- <exclude-pattern>*/index.php</exclude-pattern>
9
-
10
- <rule ref="WordPress" />
11
-
12
- <!-- Add in some extra rules from other standards. -->
13
- <rule ref="Generic.CodeAnalysis.UnusedFunctionParameter"/>
14
- <rule ref="Generic.Commenting.Todo"/>
15
- <rule ref="Generic.WhiteSpace.DisallowSpaceIndent.SpacesUsed"/>
16
-
17
- </ruleset>
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
readme.txt CHANGED
@@ -2,9 +2,9 @@
2
  Tags: related posts, related, related articles, contextual related posts, similar posts, related posts widget
3
  Contributors: webberzone, Ajay
4
  Donate link: https://ajaydsouza.com/donate/
5
- Stable tag: 2.9.3
6
  Requires at least: 4.9
7
- Tested up to: 5.5
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
 
@@ -178,6 +178,13 @@ You can insert the related posts anywhere in your post using the `[crp]` shortco
178
 
179
  == Changelog ==
180
 
 
 
 
 
 
 
 
181
  = 2.9.3 =
182
 
183
  Release post: [https://webberzone.com/blog/contextual-related-posts-v2-9-3/](https://webberzone.com/blog/contextual-related-posts-v2-9-3/)
@@ -228,24 +235,6 @@ Release post: [https://webberzone.com/blog/contextual-related-posts-v2-9-0/](htt
228
  * Fixed errors created when trying to fetch a featured image or scanned images with remote links
229
  * Saving categories fields in the settings page uses `str_getcsv` and a custom function `crp_str_putcsv`
230
 
231
- = 2.8.0 =
232
-
233
- Release post: [https://webberzone.com/blog/contextual-related-posts-v2-8-0/](https://webberzone.com/blog/contextual-related-posts-v2-8-0/)
234
-
235
- * Features:
236
- * New block for Gutenberg aka the block editor. The block is called **Related Posts [CRP]** and you can find it under the widgets category
237
- * Two new settings in the widget: **Order posts** and **Randomize order** that allows the global setting to be overridden
238
- * New setting called **Keyword** in the Meta box where you can enter a word or a phrase to find related posts. If entered, the plugin will continue to search the `post_title` and `post_content` fields but will use this keyword instead of the values of the title and content of the source post
239
-
240
- * Enhancements:
241
- * Show author, Show date, Show post excerpt and Post thumbnail settings will show a message that they cannnot be modified in case the Rounded thumbnails or No text styles are selected
242
-
243
- * Bug fixes:
244
- * Selecting date order now orders the related posts by newest first
245
- * Fixed PHP warning in the widget
246
- * Stop using `current_time( 'timestamp' )`
247
- * Fixes incorrect thumbnail image displayed for attachments in the related posts list
248
-
249
  = Earlier versions =
250
 
251
  For the changelog of earlier versions, please refer to the separate changelog.txt file or the [releases page on Github](https://github.com/WebberZone/contextual-related-posts/releases).
@@ -253,5 +242,5 @@ For the changelog of earlier versions, please refer to the separate changelog.tx
253
 
254
  == Upgrade Notice ==
255
 
256
- = 2.9.2 =
257
- Bug fix release. Check the Changelog for more details or view the release post on https://webberzone.com
2
  Tags: related posts, related, related articles, contextual related posts, similar posts, related posts widget
3
  Contributors: webberzone, Ajay
4
  Donate link: https://ajaydsouza.com/donate/
5
+ Stable tag: 2.9.4
6
  Requires at least: 4.9
7
+ Tested up to: 5.6
8
  Requires PHP: 5.6
9
  License: GPLv2 or later
10
 
178
 
179
  == Changelog ==
180
 
181
+ = 2.9.4 =
182
+
183
+ Release post: [https://webberzone.com/blog/contextual-related-posts-v2-9-3/](https://webberzone.com/blog/contextual-related-posts-v2-9-3/)
184
+
185
+ * Bugs:
186
+ * Fixed nonce verification not always done in Import/Export interface. Thanks to [Lenon Leite](https://github.com/lenonleite)
187
+
188
  = 2.9.3 =
189
 
190
  Release post: [https://webberzone.com/blog/contextual-related-posts-v2-9-3/](https://webberzone.com/blog/contextual-related-posts-v2-9-3/)
235
  * Fixed errors created when trying to fetch a featured image or scanned images with remote links
236
  * Saving categories fields in the settings page uses `str_getcsv` and a custom function `crp_str_putcsv`
237
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
238
  = Earlier versions =
239
 
240
  For the changelog of earlier versions, please refer to the separate changelog.txt file or the [releases page on Github](https://github.com/WebberZone/contextual-related-posts/releases).
242
 
243
  == Upgrade Notice ==
244
 
245
+ = 2.9.4 =
246
+ Bug fix and minor security release. Check the Changelog for more details or view the release post on https://webberzone.com