Restaurant Reservations - Version 1.0.2

Version Description

(2014-05-08) = * Remove development tool from codebase

Download this release

Release Info

Developer NateWr
Plugin Icon 128x128 Restaurant Reservations
Version 1.0.2
Comparing to
See all releases

Code changes from version 1.0.1 to 1.0.2

readme.txt CHANGED
@@ -5,7 +5,7 @@ Plugin URL: http://themeofthecrop.com
5
  Requires at Least: 3.8
6
  Tested Up To: 3.9
7
  Tags: restaurant, reservations, bookings, table bookings, restaurant reservation, table reservation
8
- Stable tag: 1.0.1
9
  License: GPLv2 or later
10
  Donate link: http://themeofthecrop.com
11
 
@@ -54,8 +54,16 @@ This plugin is packed with hooks so you can extend it, customize it and rebrand
54
 
55
  == Changelog ==
56
 
 
 
 
57
  = 1.0.1 (2014-05-08) =
58
  * Replace dashicons caret with CSS-only caret in booking form
59
 
60
  = 1.0 (2014-05-07) =
61
  * Initial release
 
 
 
 
 
5
  Requires at Least: 3.8
6
  Tested Up To: 3.9
7
  Tags: restaurant, reservations, bookings, table bookings, restaurant reservation, table reservation
8
+ Stable tag: 1.0.2
9
  License: GPLv2 or later
10
  Donate link: http://themeofthecrop.com
11
 
54
 
55
  == Changelog ==
56
 
57
+ = 1.0.2 (2014-05-08) =
58
+ * Remove development tool from codebase
59
+
60
  = 1.0.1 (2014-05-08) =
61
  * Replace dashicons caret with CSS-only caret in booking form
62
 
63
  = 1.0 (2014-05-07) =
64
  * Initial release
65
+
66
+ == Upgrade Notice ==
67
+
68
+ = 1.0.2 =
69
+ This update removes a bit of code that was used for development purposes. Please update as this code could be run by any user on the frontend.
restaurant-reservations.php CHANGED
@@ -3,7 +3,7 @@
3
  * Plugin Name: Restaurant Reservations
4
  * Plugin URI: http://themeofthecrop.com
5
  * Description: Accept restaurant reservations and bookings online.
6
- * Version: 1.0.1
7
  * Author: Theme of the Crop
8
  * Author URI: http://themeofthecrop.com
9
  * License: GNU General Public License v2.0 or later
@@ -92,10 +92,6 @@ class rtbInit {
92
  // Add links to plugin listing
93
  add_filter('plugin_action_links', array( $this, 'plugin_action_links' ), 10, 2);
94
 
95
- // Development tool
96
- // @todo maybe split off this sort of thing to another file
97
- add_action( 'init', array( $this, 'dev_add_bookings_data' ) );
98
-
99
  }
100
 
101
  /**
@@ -218,65 +214,6 @@ class rtbInit {
218
  return $content . rtb_print_booking_form();
219
  }
220
 
221
- /**
222
- * Development tool to populate the database with lots of bookings
223
- * @since 0.0.1
224
- */
225
- public function dev_add_bookings_data() {
226
-
227
- if ( !WP_DEBUG || !isset( $_GET['rtb_devmode'] ) || $_GET['rtb_devmode'] !== 'add_bookings' ) {
228
- return;
229
- }
230
-
231
- $lorem = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Etiam feugiat consequat diam, in tincidunt purus convallis vel. Morbi sed dapibus diam. Vestibulum laoreet mi at neque varius consequat. Nam non mi erat. Donec nec semper velit. Maecenas id tortor orci. Aenean viverra suscipit urna, egestas adipiscing felis varius vitae. Curabitur et accumsan turpis. Suspendisse sed risus ac mi lobortis aliquam vel vel dolor. Nulla facilisi. In feugiat tempus massa, sed pulvinar neque bibendum ut. Nullam nibh eros, consectetur et orci non, condimentum tempor nunc. Maecenas sit amet libero sed diam pulvinar iaculis eget vitae odio. Quisque ac luctus metus, sit amet fringilla magna. Aliquam commodo odio eu eros imperdiet, ut auctor odio faucibus.';
232
- $words = explode( ' ', str_replace( array( ',', '.'), '', $lorem ) );
233
- for ( $i = 0; $i < 100; $i++ ) {
234
-
235
- shuffle( $words );
236
-
237
- $phone = '(';
238
- for( $p = 0; $p < 3; $p++ ) {
239
- $phone .= rand(0,9);
240
- }
241
- $phone .= ') ';
242
- for( $p = 0; $p < 3; $p++ ) {
243
- $phone .= rand(0,9);
244
- }
245
- $phone .= '-';
246
- for( $p = 0; $p < 4; $p++ ) {
247
- $phone .= rand(0,9);
248
- }
249
-
250
- $status = rand(0, 100) > 30 ? 'confirmed' : 'pending';
251
- $status = rand(0, 100) > 90 ? 'closed' : $status;
252
-
253
- // Get the date formatted for MySQL
254
- $date = new DateTime( date('Y-m-d H:i:s', current_time() + rand( 0, 7776000 ) ) ); // 90 days in advance
255
-
256
- $id = wp_insert_post(
257
- array(
258
- 'post_type' => RTB_BOOKING_POST_TYPE,
259
- 'post_title' => $words[0] . ' ' . $words[1],
260
- 'post_content' => rand(0,10) < 3 ? $lorem : '',
261
- 'post_date' => $date->format( 'Y-m-d H:i:s' ),
262
- 'post_status' => $status,
263
- )
264
- );
265
-
266
- $meta = array(
267
- 'party' => rand(1, 20),
268
- 'email' => $words[2] . '@email.com',
269
- 'phone' => $phone,
270
- 'date_submission' => current_time(), // keep track of when it was submitted for logs
271
- );
272
-
273
- $meta = apply_filters( 'rtb_sanitize_post_metadata_devmode', $meta, $id );
274
-
275
- update_post_meta( $id, 'rtb', $meta );
276
-
277
- }
278
- }
279
-
280
  /**
281
  * Enqueue the admin-only CSS and Javascript
282
  * @since 0.0.1
3
  * Plugin Name: Restaurant Reservations
4
  * Plugin URI: http://themeofthecrop.com
5
  * Description: Accept restaurant reservations and bookings online.
6
+ * Version: 1.0.2
7
  * Author: Theme of the Crop
8
  * Author URI: http://themeofthecrop.com
9
  * License: GNU General Public License v2.0 or later
92
  // Add links to plugin listing
93
  add_filter('plugin_action_links', array( $this, 'plugin_action_links' ), 10, 2);
94
 
 
 
 
 
95
  }
96
 
97
  /**
214
  return $content . rtb_print_booking_form();
215
  }
216
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
217
  /**
218
  * Enqueue the admin-only CSS and Javascript
219
  * @since 0.0.1
screenshot-1.PNG DELETED
Binary file
screenshot-1.png ADDED
Binary file
screenshot-2.PNG DELETED
Binary file
screenshot-2.png ADDED
Binary file
screenshot-3.PNG DELETED
Binary file
screenshot-3.png ADDED
Binary file
screenshot-4.PNG DELETED
Binary file
screenshot-4.png ADDED
Binary file
screenshot-5.PNG DELETED
Binary file
screenshot-5.png ADDED
Binary file
screenshot-6.PNG DELETED
Binary file
screenshot-6.png ADDED
Binary file
screenshot-7.PNG DELETED
Binary file
screenshot-7.png ADDED
Binary file
screenshot-8.PNG DELETED
Binary file
screenshot-8.png ADDED
Binary file
screenshot-9.PNG DELETED
Binary file
screenshot-9.png ADDED
Binary file