PluginProbe
Property Hive / 2.3.0
Property Hive v2.3.0
2.3.1 2.3.0 2.2.6 2.2.5 2.2.4 2.2.3 2.2.2 1.4.46 1.4.47 1.4.48 1.4.49 1.4.5 1.4.50 1.4.51 1.4.52 1.4.53 1.4.54 1.4.55 1.4.56 1.4.57 1.4.58 1.4.59 1.4.6 1.4.60 1.4.61 All 261 releases
← All changes | includes/class-ph-install.php +258 -75 1.4.62.3.0 View file →
@@ -17,8 +17,25 @@
17 17 */
18 18 class PH_Install {
19 19
20 20 /**
21 + * DB updates and callbacks that need to be run per version.
22 + *
23 + * @var array
24 + */
25 + private static $db_updates = array(
26 + '1.4.68' => array(
27 + 'propertyhive_update_1468_on_market_change_dates',
28 + ),
29 + '2.0.0' => array(
30 + 'propertyhive_update_200_pre_pro_record_installed_plugins',
31 + ),
32 + '2.2.0' => array(
33 + 'propertyhive_deactivate_template_assistant', // different naming convention as needs to be run elsewhere too
34 + ),
35 + );
36 +
37 + /**
21 38 * Hook in tabs.
22 39 */
23 40 public function __construct() {
24 41 register_activation_hook( PH_PLUGIN_FILE, array( $this, 'install' ) );
@@ -25,8 +42,10 @@
25 42 register_deactivation_hook( PH_PLUGIN_FILE, array( $this, 'deactivate' ) );
26 43
27 44 add_action( 'admin_init', array( $this, 'install_actions' ) );
28 45 add_action( 'admin_init', array( $this, 'check_version' ), 5 );
46 +
47 + add_filter( 'cron_schedules', array( $this, 'custom_cron_recurrence' ) );
29 48 //add_action( 'in_plugin_update_message-propertyhive/propertyhive.php', array( $this, 'in_plugin_update_message' ) );
30 49 }
31 50
32 51 /**
@@ -46,46 +65,10 @@
46 65 /**
47 66 * Install actions such as installing pages when a button is clicked.
48 67 */
49 68 public function install_actions() {
50 - // Install - Add pages button
51 - /*if ( ! empty( $_GET['install_propertyhive_pages'] ) ) {
52 69
53 - self::create_pages();
54 70
55 - // We no longer need to install pages
56 - delete_option( '_ph_needs_pages' );
57 - delete_transient( '_ph_activation_redirect' );
58 -
59 - // What's new redirect
60 - wp_redirect( admin_url( 'index.php?page=ph-about&ph-installed=true' ) );
61 - exit;
62 -
63 - // Skip button
64 - } elseif ( ! empty( $_GET['skip_install_propertyhive_pages'] ) ) {
65 -
66 - // We no longer need to install pages
67 - delete_option( '_ph_needs_pages' );
68 - delete_transient( '_ph_activation_redirect' );
69 -
70 - // What's new redirect
71 - wp_redirect( admin_url( 'index.php?page=ph-about' ) );
72 - exit;
73 -
74 - // Update button
75 - } elseif ( ! empty( $_GET['do_update_propertyhive'] ) ) {
76 -
77 - $this->update();
78 -
79 - // Update complete
80 - delete_option( '_ph_needs_pages' );
81 - delete_option( '_ph_needs_update' );
82 - delete_transient( '_ph_activation_redirect' );
83 -
84 - // What's new redirect
85 - wp_redirect( admin_url( 'index.php?page=ph-about&ph-updated=true' ) );
86 - exit;
87 - }*/
88 71 }
89 72
90 73 /**
91 74 * Install Property Hive
@@ -100,12 +83,13 @@
100 83 include_once( 'class-ph-post-types.php' );
101 84 PH_Post_types::register_post_types();
102 85 PH_Post_types::register_taxonomies();
103 86
104 - $this->create_terms();
105 87 $this->create_primary_office();
106 88 $this->create_cron_jobs();
107 89
90 + $this->update();
91 +
108 92 // Clear transient cache
109 93
110 94 // Queue upgrades
111 95 $current_version = get_option( 'propertyhive_version', null );
@@ -113,8 +97,10 @@
113 97
114 98 // No existing version set. This must be a new fresh install
115 99 if ( is_null( $current_version ) && is_null( $current_db_version ) )
116 100 {
101 + $this->create_terms();
102 + $this->create_pages();
117 103 set_transient( '_ph_activation_redirect', 1, 30 );
118 104 }
119 105
120 106 update_option( 'propertyhive_db_version', PH()->version );
@@ -139,11 +125,22 @@
139 125 wp_clear_scheduled_hook( 'propertyhive_update_currency_exchange_rates' );
140 126 wp_clear_scheduled_hook( 'propertyhive_process_email_log' );
141 127 wp_clear_scheduled_hook( 'propertyhive_auto_email_match' );
142 128 wp_clear_scheduled_hook( 'propertyhive_check_licenses' );
129 + wp_clear_scheduled_hook( 'propertyhive_update_address_concatenated' );
130 + wp_clear_scheduled_hook( 'propertyhive_cleanup_search_analytics' );
143 131 }
144 132
145 133 /**
134 + * Get list of DB update callbacks.
135 + *
136 + * @return array
137 + */
138 + public static function get_db_update_callbacks() {
139 + return self::$db_updates;
140 + }
141 +
142 + /**
146 143 * Handle updates
147 144 */
148 145 public function update() {
149 146 // Do updates
@@ -148,19 +145,17 @@
148 145 public function update() {
149 146 // Do updates
150 147 $current_db_version = get_option( 'propertyhive_db_version' );
151 148
152 - /*if ( version_compare( $current_db_version, '1.4', '<' ) ) {
153 - include( 'updates/propertyhive-update-1.4.php' );
154 - update_option( 'propertyhive_db_version', '1.4' );
149 + foreach ( self::get_db_update_callbacks() as $version => $update_callbacks ) {
150 + if ( version_compare( $current_db_version, $version, '<' ) ) {
151 + foreach ( $update_callbacks as $update_callback ) {
152 + add_action('property_run_update_actions', $update_callback);
153 + }
154 + }
155 155 }
156 -
157 - if ( version_compare( $current_db_version, '2.1.0', '<' ) || PH_VERSION == '2.1-bleeding' ) {
158 - include( 'updates/propertyhive-update-2.1.php' );
159 - update_option( 'propertyhive_db_version', '2.1.0' );
160 - }*/
161 -
162 - update_option( 'propertyhive_db_version', PH()->version );
156 + // phpcs:ignore WordPress.NamingConventions.PrefixAllGlobals.NonPrefixedHooknameFound -- Existing public Property Hive extension hook property_run_update_actions; changing the established name would detach installed callbacks.
157 + do_action('property_run_update_actions');
163 158 }
164 159
165 160 /**
166 161 * Create cron jobs (clear them first)
@@ -171,28 +166,55 @@
171 166 wp_clear_scheduled_hook( 'propertyhive_update_currency_exchange_rates' );
172 167 wp_clear_scheduled_hook( 'propertyhive_process_email_log' );
173 168 wp_clear_scheduled_hook( 'propertyhive_auto_email_match' );
174 169 wp_clear_scheduled_hook( 'propertyhive_check_licenses' );
170 + wp_clear_scheduled_hook( 'propertyhive_update_address_concatenated' );
171 + wp_clear_scheduled_hook( 'propertyhive_cleanup_search_analytics' );
175 172
176 - $ve = get_option( 'gmt_offset' ) > 0 ? '+' : '-';
177 -
178 173 // Schedule for midnight as it's likely traffic will be quieter at that time
179 - wp_schedule_event( strtotime( '00:00 tomorrow ' . $ve . get_option( 'gmt_offset' ) . ' HOURS' ), 'daily', 'propertyhive_update_currency_exchange_rates' );
174 + wp_schedule_event( strtotime( 'tomorrow' ) - ( (int)get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ), 'daily', 'propertyhive_update_currency_exchange_rates' );
180 175
181 - wp_schedule_event( time(), 'hourly', 'propertyhive_process_email_log' );
176 + wp_schedule_event( time(), 'every_fifteen_minutes', 'propertyhive_process_email_log' );
182 177
183 178 $auto_property_match_enabled = get_option( 'propertyhive_auto_property_match', '' );
184 179
185 180 if ( $auto_property_match_enabled == 'yes' )
186 181 {
187 - wp_schedule_event( strtotime( '02:00 tomorrow ' . $ve . get_option( 'gmt_offset' ) . ' HOURS' ), 'daily', 'propertyhive_auto_email_match' );
182 + $recurrence = apply_filters( 'propertyhive_auto_email_match_cron_recurrence', 'daily' );
183 + if ( $recurrence != 'hourly' )
184 + {
185 + $timestamp = strtotime( 'tomorrow +2hours') - ( (int)get_option( 'gmt_offset' ) * HOUR_IN_SECONDS );
186 + }
187 + else
188 + {
189 + $timestamp = strtotime( '+1 hours' );
190 + }
191 + wp_schedule_event(
192 + apply_filters( 'propertyhive_auto_email_match_cron_timestamp', $timestamp ),
193 + $recurrence,
194 + 'propertyhive_auto_email_match'
195 + );
188 196 }
189 197
190 198 // Schedule for 1am as it's likely traffic will be quieter at that time
191 199 // 1am so it doesn't run at exactly the same time as the exchange rate cron
192 - wp_schedule_event( strtotime( '01:00 tomorrow ' . $ve . get_option( 'gmt_offset' ) . ' HOURS' ), 'daily', 'propertyhive_check_licenses' );
200 + wp_schedule_event( strtotime( 'tomorrow +1hours' ) - ( (int)get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ), 'daily', 'propertyhive_check_licenses' );
201 +
202 + wp_schedule_event( strtotime( 'tomorrow +3hours' ) - ( (int)get_option( 'gmt_offset' ) * HOUR_IN_SECONDS ), 'daily', 'propertyhive_update_address_concatenated' );
203 +
204 + wp_schedule_event( time() + HOUR_IN_SECONDS, 'daily', 'propertyhive_cleanup_search_analytics' );
193 205 }
194 206
207 + public function custom_cron_recurrence( $schedules )
208 + {
209 + $schedules['every_fifteen_minutes'] = array(
210 + 'interval' => 900,
211 + 'display' => __( 'Every 15 Minutes', 'propertyhive' )
212 + );
213 +
214 + return $schedules;
215 + }
216 +
195 217 /**
196 218 * Create pages that the plugin relies on
197 219 *
198 220 * @access public
@@ -197,9 +219,9 @@
197 219 *
198 220 * @access public
199 221 * @return void
200 222 */
201 - public static function create_pages() {
223 + public function create_pages() {
202 224
203 225 // Create page object
204 226 $my_post = array(
205 227 'post_title' => __( 'Property Search', 'propertyhive' ),
@@ -210,11 +232,14 @@
210 232 'ping_status' => 'closed',
211 233 );
212 234
213 235 // Insert the post into the database
214 - $page_id = wp_insert_post( $my_post );
236 + $page_id = wp_insert_post( $my_post, true );
215 237
216 - update_option( 'propertyhive_search_results_page_id', $page_id );
238 + if ( !is_wp_error($page_id) )
239 + {
240 + update_option( 'propertyhive_search_results_page_id', $page_id );
241 + }
217 242 }
218 243
219 244 /**
220 245 * Add the default terms for PH taxonomies - property types, tenures etc. Modify this at your own risk.
@@ -226,27 +251,34 @@
226 251
227 252 $taxonomies = array(
228 253 'availability' => array(
229 254 array(
230 - 'name' => 'For Sale'
255 + 'name' => 'For Sale',
256 + 'departments' => array('residential-sales', 'commercial')
231 257 ),
232 258 array(
233 - 'name' => 'Under Offer'
259 + 'name' => 'Under Offer',
260 + 'departments' => array('residential-sales', 'commercial')
234 261 ),
235 262 array(
236 - 'name' => 'Sold STC'
263 + 'name' => 'Sold STC',
264 + 'departments' => array('residential-sales', 'commercial')
237 265 ),
238 266 array(
239 - 'name' => 'Sold'
267 + 'name' => 'Sold',
268 + 'departments' => array('residential-sales', 'commercial')
240 269 ),
241 270 array(
242 - 'name' => 'To Let'
271 + 'name' => 'To Let',
272 + 'departments' => array('residential-lettings', 'commercial')
243 273 ),
244 274 array(
245 - 'name' => 'Let Agreed'
275 + 'name' => 'Let Agreed',
276 + 'departments' => array('residential-lettings', 'commercial')
246 277 ),
247 278 array(
248 - 'name' => 'Let'
279 + 'name' => 'Let',
280 + 'departments' => array('residential-lettings', 'commercial')
249 281 ),
250 282 ),
251 283 'property_type' => array(
252 284 // HOUSE
@@ -301,9 +333,9 @@
301 333 'name' => 'Terraced Bungalow',
302 334 'child_of_previous' => true
303 335 ),
304 336 array(
305 - 'name' => 'End of Terrace House',
337 + 'name' => 'End of Terrace Bungalow',
306 338 'child_of_previous' => true
307 339 ),
308 340 // FLATS
309 341 array(
@@ -441,8 +473,14 @@
441 473 'name' => 'Freehold'
442 474 ),
443 475 array(
444 476 'name' => 'Leasehold'
477 + ),
478 + array(
479 + 'name' => 'Share of Freehold'
480 + ),
481 + array(
482 + 'name' => 'Commonhold'
445 483 )
446 484 ),
447 485 'commercial_tenure' => array(
448 486 array(
@@ -449,8 +487,14 @@
449 487 'name' => 'Freehold'
450 488 ),
451 489 array(
452 490 'name' => 'Leasehold'
491 + ),
492 + array(
493 + 'name' => 'Share of Freehold'
494 + ),
495 + array(
496 + 'name' => 'Commonhold'
453 497 )
454 498 ),
455 499 'furnished' => array(
456 500 array(
@@ -464,22 +508,36 @@
464 508 )
465 509 ),
466 510 'marketing_flag' => array(
467 511 array(
468 - 'name' => 'Recently Sold'
512 + 'name' => 'New Instruction'
469 513 ),
470 514 array(
471 - 'name' => 'Recently Let'
515 + 'name' => 'Chain Free'
516 + )
517 + ),
518 + 'management_key_date_type' => array(
519 + array(
520 + 'name' => 'Initial Inventory',
521 + 'recurrence_type' => 'tenancy_management',
522 + 'recurrence_rule' => 'FREQ=ONCE',
472 523 ),
473 524 array(
474 - 'name' => 'New Instruction'
525 + 'name' => 'Inspection',
526 + 'recurrence_type' => 'tenancy_management',
527 + 'recurrence_rule' => 'FREQ=MONTHLY;INTERVAL=3',
475 528 ),
476 529 array(
477 - 'name' => 'Chain Free'
478 - )
530 + 'name' => 'Gas Safety Check',
531 + 'recurrence_type' => 'property_management',
532 + 'recurrence_rule' => 'FREQ=YEARLY;INTERVAL=1',
533 + ),
479 534 ),
480 535 );
481 536
537 + $availability_departments = get_option( 'propertyhive_availability_departments', array() );
538 + if ( !is_array($availability_departments) ) { $availability_departments = array(); }
539 +
482 540 $previous_term_id = '';
483 541 foreach ( $taxonomies as $taxonomy => $terms )
484 542 {
485 543 // Make sure no terms for this taxonomy exist already
@@ -501,8 +559,26 @@
501 559 if ( !isset($term['child_of_previous']) || (isset($term['child_of_previous']) && !$term['child_of_previous']) )
502 560 {
503 561 $previous_term_id = $return['term_id'];
504 562 }
563 +
564 + if ( $taxonomy == 'availability' && is_array($term['departments']) && !empty($term['departments']) )
565 + {
566 + $availability_departments[$return['term_id']] = $term['departments'];
567 + }
568 +
569 + if ( $taxonomy == 'management_key_date_type' && isset($term['recurrence_type']) && isset($term['recurrence_rule']) )
570 + {
571 + $options = get_option( 'propertyhive_key_date_type', array() );
572 + if ( !is_array($options) ) { $options = array(); }
573 +
574 + $options[$return['term_id']] = array(
575 + 'recurrence_rule' => $term['recurrence_rule'],
576 + 'recurrence_type' => $term['recurrence_type'],
577 + );
578 +
579 + update_option( 'propertyhive_key_date_type', $options );
580 + }
505 581 }
506 582 else
507 583 {
508 584 // Hmm... an error occurred
@@ -511,8 +587,10 @@
511 587 }
512 588 }
513 589 }
514 590 }
591 +
592 + update_option( 'propertyhive_availability_departments', $availability_departments );
515 593 }
516 594
517 595 /**
518 596 * Add the first office so at least one exists
@@ -555,22 +633,37 @@
555 633 add_option( 'propertyhive_active_departments_sales', 'yes', '', 'yes' );
556 634 add_option( 'propertyhive_active_departments_lettings', 'yes', '', 'yes' );
557 635 add_option( 'propertyhive_primary_department', 'residential-sales', '', 'yes' );
558 636
637 + add_option( 'propertyhive_maps_provider', 'osm', '', 'no' );
638 + add_option( 'propertyhive_geocoding_provider', 'osm', '', 'no' );
639 +
640 + add_option( 'propertyhive_default_country', 'GB', '', 'yes' );
641 + add_option( 'propertyhive_countries', array('GB'), '', 'yes' );
642 +
643 + add_option( 'propertyhive_applicant_match_price_range_percentage_lower', 20, '', 'no' );
644 + add_option( 'propertyhive_applicant_match_price_range_percentage_higher', 5, '', 'no' );
645 +
646 + add_option( 'propertyhive_license_type', 'pro', '', 'yes' );
647 +
559 648 add_option( 'propertyhive_install_timestamp', time(), '', 'no' );
560 649 add_option( 'propertyhive_review_prompt_due_timestamp', strtotime('+30 days'), '', 'no' );
561 650
562 651 add_option( 'propertyhive_enquiry_auto_responder_email_subject', __( 'Thank you for your enquiry', 'propertyhive' ), '', 'no' );
563 - add_option( 'propertyhive_enquiry_auto_responder_email_body', __( "Thank you for your recent property enquiry about [property_address_hyperlinked]. A member of our team will be in touch shortly.
652 + add_option( 'propertyhive_enquiry_auto_responder_email_body', sprintf(
653 + /* translators: %s: blog name shown in the email sign-off */
654 + __( "Thank you for your recent property enquiry about [property_address_hyperlinked]. A member of our team will be in touch shortly.
564 655
565 656 Kind regards,
566 657
567 -" . get_bloginfo('name') . "
658 +%s
568 659
569 -[similar_properties]", 'propertyhive' ), '', 'no' );
660 +[similar_properties]", 'propertyhive' ),
661 + get_bloginfo('name')
662 + ), '', 'no' );
570 663
571 664 add_option( 'propertyhive_property_match_default_email_subject', __( 'We found [property_count] that might be of interest to you', 'propertyhive' ), '', 'no' );
572 - add_option( 'propertyhive_property_match_default_email_body', __( "Hi [contact_name],
665 + add_option( 'propertyhive_property_match_default_email_body', __( "Hi [contact_dear],
573 666
574 667 Based on your requirements, we've found [property_count] below that we believe might be suitable for you:
575 668
576 669 [properties]
@@ -578,10 +671,84 @@
578 671 If you have any questions or require more information about any of the properties shown above please let me know.
579 672
580 673 Kind regards,
581 674
582 -" . get_bloginfo('name'), 'propertyhive' ), '', 'no' );
675 +", 'propertyhive' ) . get_bloginfo('name'), '', 'no' );
583 676
677 + // Applicant Viewing Booking Confirmation
678 + add_option( 'propertyhive_viewing_applicant_booking_confirmation_email_subject', __( 'Your Viewing On [property_address]', 'propertyhive' ), '', 'no' );
679 + add_option( 'propertyhive_viewing_applicant_booking_confirmation_email_body', __( "Dear [applicant_dear],
680 +
681 +This is confirmation that your viewing on [property_address] has been booked for [viewing_time] on [viewing_date].
682 +
683 +Should you need to cancel or amend your booking please do not hesitate to contact us.
684 +
685 +", 'propertyhive' ) . get_bloginfo('name'), '', 'no' );
686 +
687 + // Applicant Viewing Cancellation Notification
688 + add_option( 'propertyhive_viewing_applicant_cancellation_notification_email_subject', __( 'Your Viewing On [property_address] Has Been Cancelled', 'propertyhive' ), '', 'no' );
689 + add_option( 'propertyhive_viewing_applicant_cancellation_notification_email_body', __( "Dear [applicant_dear],
690 +
691 +This is confirmation that a viewing on [property_address] that was booked for [viewing_time] on [viewing_date] has been cancelled. [cancelled_reason]
692 +
693 +Should you have any questions please do not hesitate to contact us.
694 +
695 +", 'propertyhive' ) . get_bloginfo('name'), '', 'no' );
696 +
697 + // Owner/Landlord Viewing Booking Confirmation
698 + add_option( 'propertyhive_viewing_owner_booking_confirmation_email_subject', __( 'Viewing Booked On [property_address]', 'propertyhive' ), '', 'no' );
699 + add_option( 'propertyhive_viewing_owner_booking_confirmation_email_body', __( "Dear [owner_dear],
700 +
701 +This is confirmation that a viewing has been booked at your property, [property_address], for [viewing_time] on [viewing_date].
702 +
703 +Should you need to cancel or amend this viewing please do not hesitate to contact us.
704 +
705 +", 'propertyhive' ) . get_bloginfo('name'), '', 'no' );
706 +
707 + // Owner/Landlord Viewing Cancellation Notification
708 + add_option( 'propertyhive_viewing_owner_cancellation_notification_email_subject', __( 'Viewing Cancelled On [property_address]', 'propertyhive' ), '', 'no' );
709 + add_option( 'propertyhive_viewing_owner_cancellation_notification_email_body', __( "Dear [owner_dear],
710 +
711 +This is confirmation that a viewing on [property_address] that was booked for [viewing_time] on [viewing_date] has been cancelled. [cancelled_reason]
712 +
713 +Should you have any questions please do not hesitate to contact us.
714 +
715 +", 'propertyhive' ) . get_bloginfo('name'), '', 'no' );
716 +
717 + // Attending Negotiator Viewing Booking Confirmation
718 + add_option( 'propertyhive_viewing_attending_negotiator_booking_confirmation_email_subject', __( 'Viewing Booked On [property_address]', 'propertyhive' ), '', 'no' );
719 + add_option( 'propertyhive_viewing_attending_negotiator_booking_confirmation_email_body', __( "This is confirmation you've been assigned to attend a viewing at property, [property_address], for [viewing_time] on [viewing_date].
720 +
721 +Applicant Details:
722 +[applicant_details]
723 +
724 +Owner Details:
725 +[owner_details]
726 +
727 +", 'propertyhive' ) . get_bloginfo('name'), '', 'no' );
728 +
729 + // Attending Negotiator Viewing Cancellation Notification
730 + add_option( 'propertyhive_viewing_attending_negotiator_cancellation_notification_email_subject', __( 'Viewing Cancelled On [property_address]', 'propertyhive' ), '', 'no' );
731 + add_option( 'propertyhive_viewing_attending_negotiator_cancellation_notification_email_body', __( "This is confirmation that a viewing you were assigned to carry out on [property_address] that was booked for [viewing_time] on [viewing_date] has been cancelled. [cancelled_reason]
732 +
733 +Applicant Details:
734 +[applicant_details]
735 +
736 +Owner Details:
737 +[owner_details]
738 +
739 +", 'propertyhive' ) . get_bloginfo('name'), '', 'no' );
740 +
741 + // Owner/Landlord Appraisal Booking Confirmation
742 + add_option( 'propertyhive_appraisal_owner_booking_confirmation_email_subject', __( 'Appraisal Booked On [property_address]', 'propertyhive' ), '', 'no' );
743 + add_option( 'propertyhive_appraisal_owner_booking_confirmation_email_body', __( "Dear [owner_dear],
744 +
745 +This is confirmation that an appraisal has been booked for your property, [property_address], for [appraisal_time] on [appraisal_date].
746 +
747 +Should you need to cancel or amend this appraisal, please do not hesitate to contact us.
748 +
749 +", 'propertyhive' ) . get_bloginfo('name'), '', 'no' );
750 +
584 751 }
585 752
586 753 /**
587 754 * Set up the database tables which the plugin needs to function.
@@ -611,12 +778,14 @@
611 778 contact_id bigint(20) unsigned NOT NULL,
612 779 property_ids text NOT NULL,
613 780 applicant_profile_id tinyint(3) unsigned NOT NULL,
614 781 to_email_address varchar(255) NOT NULL,
782 + cc_email_address varchar(255) NOT NULL,
783 + bcc_email_address varchar(255) NOT NULL,
615 784 from_name varchar(255) NOT NULL,
616 785 from_email_address varchar(255) NOT NULL,
617 786 subject varchar(255) NOT NULL,
618 - body longtext NOT NULL,
787 + body blob NOT NULL,
619 788 lock_id varchar(23) NOT NULL,
620 789 locked_at datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
621 790 status varchar(5) NOT NULL,
622 791 send_at datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
@@ -621,8 +790,22 @@
621 790 status varchar(5) NOT NULL,
622 791 send_at datetime NOT NULL DEFAULT '0000-00-00 00:00:00',
623 792 sent_by bigint(20) unsigned NOT NULL,
624 793 PRIMARY KEY (email_id)
794 + ) $collate;";
795 +
796 + $tables .= "
797 + CREATE TABLE {$wpdb->prefix}ph_address_keyword_polygon (
798 + address_keyword varchar(255) NOT NULL,
799 + polygon_coordinates longtext NOT NULL
800 + ) $collate;";
801 +
802 + $tables .= "
803 + CREATE TABLE {$wpdb->prefix}ph_search_log (
804 + id bigint(20) unsigned NOT NULL AUTO_INCREMENT,
805 + searched_at datetime NOT NULL,
806 + PRIMARY KEY (id),
807 + KEY searched_at (searched_at)
625 808 ) $collate;";
626 809
627 810 dbDelta( $tables );
628 811 }