WP Recipe Maker - Version 1.17.1

Version Description

  • Fix: Ingredient import problem
Download this release

Release Info

Developer BrechtVds
Plugin Icon 128x128 WP Recipe Maker
Version 1.17.1
Comparing to
See all releases

Code changes from version 1.17.0 to 1.17.1

includes/admin/class-wprm-recipe-parser.php CHANGED
@@ -73,6 +73,9 @@ class WPRM_Recipe_Parser {
73
  * @param mixed $raw Text to parse into an ingredient.
74
  */
75
  public static function parse_ingredient( $raw ) {
 
 
 
76
  // Amount.
77
  $amount = '';
78
 
@@ -130,13 +133,28 @@ class WPRM_Recipe_Parser {
130
  // Take out notes.
131
  if ( ! empty( $notes_start ) ) {
132
  $start = min( array_map( 'intval', $notes_start ) );
 
133
  $notes = trim( substr( $raw, $start ) );
134
  $raw = trim( substr( $raw, 0, $start ) );
 
 
 
 
 
 
135
  }
136
 
137
  // Name.
138
  $name = trim( $raw );
139
 
 
 
 
 
 
 
 
 
140
  return array(
141
  'amount' => $amount,
142
  'unit' => $unit,
73
  * @param mixed $raw Text to parse into an ingredient.
74
  */
75
  public static function parse_ingredient( $raw ) {
76
+ // Backup raw.
77
+ $raw_original = $raw;
78
+
79
  // Amount.
80
  $amount = '';
81
 
133
  // Take out notes.
134
  if ( ! empty( $notes_start ) ) {
135
  $start = min( array_map( 'intval', $notes_start ) );
136
+
137
  $notes = trim( substr( $raw, $start ) );
138
  $raw = trim( substr( $raw, 0, $start ) );
139
+
140
+ // Make sure the name is not empty.
141
+ if ( ! $raw ) {
142
+ $raw = $notes;
143
+ $notes = '';
144
+ }
145
  }
146
 
147
  // Name.
148
  $name = trim( $raw );
149
 
150
+ // Make sure name is always filled in.
151
+ if ( ! $name ) {
152
+ $amount = '';
153
+ $unit = '';
154
+ $name = $raw_original;
155
+ $notes = '';
156
+ }
157
+
158
  return array(
159
  'amount' => $amount,
160
  'unit' => $unit,
includes/class-wp-recipe-maker.php CHANGED
@@ -31,7 +31,7 @@ class WP_Recipe_Maker {
31
  * @since 1.0.0
32
  */
33
  private function define_constants() {
34
- define( 'WPRM_VERSION', '1.17.0' );
35
  define( 'WPRM_PREMIUM_VERSION_REQUIRED', '1.3.0' );
36
  define( 'WPRM_POST_TYPE', 'wprm_recipe' );
37
  define( 'WPRM_DIR', plugin_dir_path( dirname( __FILE__ ) ) );
31
  * @since 1.0.0
32
  */
33
  private function define_constants() {
34
+ define( 'WPRM_VERSION', '1.17.1' );
35
  define( 'WPRM_PREMIUM_VERSION_REQUIRED', '1.3.0' );
36
  define( 'WPRM_POST_TYPE', 'wprm_recipe' );
37
  define( 'WPRM_DIR', plugin_dir_path( dirname( __FILE__ ) ) );
readme.txt CHANGED
@@ -97,6 +97,9 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
97
 
98
  == Changelog ==
99
 
 
 
 
100
  = 1.17.0 =
101
  * Feature: Setting to disable the output of inline CSS
102
  * Improvement: Better import of ingredient notes
@@ -282,6 +285,9 @@ Yes! We pride ourselves on offering awesome support and almost always answer sup
282
 
283
  == Upgrade notice ==
284
 
 
 
 
285
  = 1.17.0 =
286
  Update if you're experiencing problemns with the post slug
287
 
97
 
98
  == Changelog ==
99
 
100
+ = 1.17.1 =
101
+ * Fix: Ingredient import problem
102
+
103
  = 1.17.0 =
104
  * Feature: Setting to disable the output of inline CSS
105
  * Improvement: Better import of ingredient notes
285
 
286
  == Upgrade notice ==
287
 
288
+ = 1.17.1 =
289
+ Update if you're importing recipes
290
+
291
  = 1.17.0 =
292
  Update if you're experiencing problemns with the post slug
293
 
wp-recipe-maker.php CHANGED
@@ -15,7 +15,7 @@
15
  * Plugin Name: WP Recipe Maker
16
  * Plugin URI: http://bootstrapped.ventures/wp-recipe-maker/
17
  * Description: The easy and user-friendly recipe plugin for everyone. Automatic JSON-LD metadata for better SEO will get you more visitors!
18
- * Version: 1.17.0
19
  * Author: Bootstrapped Ventures
20
  * Author URI: http://bootstrapped.ventures/
21
  * License: GPL-2.0+
15
  * Plugin Name: WP Recipe Maker
16
  * Plugin URI: http://bootstrapped.ventures/wp-recipe-maker/
17
  * Description: The easy and user-friendly recipe plugin for everyone. Automatic JSON-LD metadata for better SEO will get you more visitors!
18
+ * Version: 1.17.1
19
  * Author: Bootstrapped Ventures
20
  * Author URI: http://bootstrapped.ventures/
21
  * License: GPL-2.0+