diff --git a/changelog.txt b/changelog.txt
index e01ceed5..0c6c4b3f 100755
--- a/changelog.txt
+++ b/changelog.txt
@@ -1,3 +1,6 @@
+= 1.5.2 - 2020-06-04 =
+* Added - Clean Up setting.
+
= 1.5.1 - 2020-06-01 =
* Added - Enable/Disable setting for each property.
diff --git a/inc/admin/functions.php b/inc/admin/functions.php
index eeafc92e..d8b879a9 100755
--- a/inc/admin/functions.php
+++ b/inc/admin/functions.php
@@ -353,75 +353,6 @@ function opalestate_hook_callback( $args ) {
do_action( 'opalestate_' . $args['id'] );
}
-register_activation_hook( __FILE__, 'opalestate_active_cron_jobs' );
-
-function opalestate_active_cron_jobs() {
- if ( ! wp_next_scheduled( 'opalestate_cleanup' ) ) {
- wp_schedule_event( time(), 'daily', 'opalestate_cleanup' );
- }
-}
-
-register_deactivation_hook( __FILE__, 'opalestate_deactive_cron_jobs' );
-
-function opalestate_deactive_cron_jobs() {
- wp_clear_scheduled_hook( 'opalestate_cleanup' );
-}
-
-function opalestate_cleanup() {
- $query = new WP_Query(
- [
- 'post_type' => 'attachment',
- 'post_status' => 'inherit',
- 'date_query' => [
- 'column' => 'post_date',
- 'before' => date( 'Y-m-d', strtotime( '-1 days' ) ),
- ],
- 'meta_query' => [
- [
- 'key' => '_pending_to_use_',
- 'value' => 1,
- 'compare' => '>=',
- ],
- ],
- ]
- );
- // clean up per day
- if ( $query->have_posts() ) {
- while ( $query->have_posts() ) {
- $query->the_post();
- wp_delete_attachment( get_the_ID() );
- }
- }
- wp_reset_postdata();
-
- // Change status expired properties.
- $expired_query = new WP_Query( [
- 'post_type' => 'opalestate_property',
- 'post_status' => [ 'pending', 'publish' ],
- 'meta_query' => [
- [
- 'key' => OPALESTATE_PROPERTY_PREFIX . 'expired_time',
- 'value' => time(),
- 'compare' => '>=',
- 'type' => 'NUMERIC',
- ],
- ],
- ] );
-
- if ( $expired_query->have_posts() ) {
- while ( $expired_query->have_posts() ) {
- $expired_query->the_post();
-
- wp_update_post( [
- 'ID' => get_the_ID(),
- 'post_status' => 'expired',
- ] );
- }
- }
-
- wp_reset_postdata();
-}
-
/**
* Searches for users via ajax and returns a list of results
*
diff --git a/inc/admin/property/class-property.php b/inc/admin/property/class-property.php
index aaf06317..c0c80794 100755
--- a/inc/admin/property/class-property.php
+++ b/inc/admin/property/class-property.php
@@ -25,6 +25,8 @@ class Opalestate_Admin_Property {
// add_action( 'transition_post_status', array( __CLASS__, 'save_post' ), 10, 3 );
add_action( 'parse_query', [ $this, 'search_custom_fields' ] );
+
+ add_filter( 'display_post_states', [ $this, 'display_post_states' ], 10, 2 );
}
/**
@@ -183,6 +185,20 @@ class Opalestate_Admin_Property {
$wp->query_vars['post__in'] = array_merge( $post_ids, [ 0 ] );
}
}
+
+ /**
+ * Filters the default post display states used in the posts list table.
+ *
+ * @param string[] $post_states An array of post display states.
+ * @param WP_Post $post The current post object.
+ */
+ public function display_post_states( $post_states, $post ) {
+ if ( 'expired' == $post->post_status ) {
+ $post_states['expired'] = _x( 'Expired', 'post status', 'opalestate-pro' );
+ }
+
+ return $post_states;
+ }
}
new Opalestate_Admin_Property();
diff --git a/inc/admin/settings/general.php b/inc/admin/settings/general.php
index 832984f2..bd7dacfe 100755
--- a/inc/admin/settings/general.php
+++ b/inc/admin/settings/general.php
@@ -37,7 +37,7 @@ class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
'name' => esc_html__( 'General Settings', 'opalestate-pro' ),
'type' => 'opalestate_title',
- 'id' => 'opalestate_title_general_settings_1',
+ 'id' => 'opalestate_title_general_settings',
'before_row' => '
',
'after_row' => '
',
],
@@ -62,37 +62,12 @@ class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
],
],
[
- 'name' => esc_html__( 'Maximum Upload Image Size', 'opalestate-pro' ),
- 'desc' => esc_html__( 'Set maximum volumn size having < x MB', 'opalestate-pro' ),
-
- 'id' => 'upload_image_max_size',
- 'type' => 'text',
- 'default' => '0.5',
- ],
- [
- 'name' => esc_html__( 'Maximum Upload Image Files', 'opalestate-pro' ),
- 'desc' => esc_html__( 'Set maximum volumn size having < x MB', 'opalestate-pro' ),
-
- 'id' => 'upload_image_max_files',
- 'type' => 'text',
- 'default' => '10',
- ],
- [
- 'name' => esc_html__( 'Maximum Upload Other Size', 'opalestate-pro' ),
- 'desc' => esc_html__( 'Set maximum volumn size having < x MB for upload docx, pdf...', 'opalestate-pro' ),
-
- 'id' => 'upload_other_max_size',
- 'type' => 'text',
- 'default' => '0.8',
- ],
- [
- 'name' => esc_html__( 'Maximum Upload Other Files', 'opalestate-pro' ),
- 'desc' => esc_html__( 'Set maximum volumn size having < x MB for upload docx, pdf...', 'opalestate-pro' ),
-
- 'id' => 'upload_other_max_files',
- 'type' => 'text',
- 'default' => '10',
- 'after_row' => '
',
+ 'name' => esc_html__( 'Image Settings', 'opalestate-pro' ),
+ 'desc' => '',
+ 'type' => 'opalestate_title',
+ 'id' => 'opalestate_title_image_settings',
+ 'before_row' => '
',
+ 'after_row' => '
',
],
[
'name' => esc_html__( 'Agent Image Size', 'opalestate-pro' ),
@@ -115,8 +90,6 @@ class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
'options' => opalestate_get_featured_image_sizes(),
],
-
-
[
'name' => esc_html__( 'Loop Image Size', 'opalestate-pro' ),
'desc' => esc_html__( 'The Loop Image is an image that is chosen as the representative image in grid and list.', 'opalestate-pro' ),
@@ -126,8 +99,6 @@ class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
'default' => 'large',
'options' => opalestate_get_featured_image_sizes(),
],
-
-
[
'name' => esc_html__( 'Featured Image Size', 'opalestate-pro' ),
'desc' => esc_html__( 'The Featured Image is an image that is chosen as the representative image in single page. .', 'opalestate-pro' ),
@@ -138,46 +109,18 @@ class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
'after_row' => '' . __( 'To generate images with new image sizes, you can use this Force Regenerate Thumbnails',
'opalestate-pro' ) . '',
],
- [
- 'name' => esc_html__( 'Minimum of Target Price For Agent', 'opalestate-pro' ),
- 'desc' => esc_html__( 'Enter minimum of price for starting search agent by target', 'opalestate-pro' ),
- 'id' => 'search_agent_min_price',
- 'type' => 'text_medium',
- 'attributes' => [
- 'type' => 'number',
- ],
- 'default' => 0,
- ],
- [
- 'name' => esc_html__( 'Maximum of Target Price For Agent', 'opalestate-pro' ),
- 'desc' => esc_html__( 'Enter maximum of price for starting search agent by target', 'opalestate-pro' ),
- 'id' => 'search_agent_max_price',
- 'type' => 'text_medium',
- 'attributes' => [
- 'type' => 'number',
- ],
- 'default' => 1000000,
- ],
- [
- 'name' => esc_html__( 'Single Layout Page', 'opalestate-pro' ),
- 'desc' => esc_html__( 'Choose layout for single property.', 'opalestate-pro' ),
- 'id' => 'layout',
- 'type' => 'select',
- 'options' => apply_filters( 'opalestate_single_layout_templates', [ '' => esc_html__( 'Inherit', 'opalestate-pro' ) ] ),
- ],
-
[
'name' => esc_html__( 'Currency Settings', 'opalestate-pro' ),
'desc' => '',
'type' => 'opalestate_title',
- 'id' => 'opalestate_title_general_settings_2',
+ 'id' => 'opalestate_title_currency_settings',
'before_row' => '
',
'after_row' => '
',
],
[
'name' => esc_html__( 'Currency', 'opalestate-pro' ),
- 'desc' => 'Choose your currency. Note that some payment gateways have currency restrictions.',
+ 'desc' => esc_html__( 'Choose your currency. Note that some payment gateways have currency restrictions.', 'opalestate-pro' ),
'id' => 'currency',
'type' => 'select',
'options' => opalestate_get_currencies(),
@@ -234,6 +177,51 @@ class Opalestate_Settings_General_Tab extends Opalestate_Settings_Base_Tab {
'options' => opalestate_get_time_formats(),
'default' => '12_hour',
],
+
+ [
+ 'name' => esc_html__( 'Others', 'opalestate-pro' ),
+ 'desc' => '',
+ 'type' => 'opalestate_title',
+ 'id' => 'opalestate_title_others_settings',
+ 'before_row' => '
',
+ 'after_row' => '
',
+ ],
+ [
+ 'name' => esc_html__( 'Minimum of Target Price For Agent', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Enter minimum of price for starting search agent by target', 'opalestate-pro' ),
+ 'id' => 'search_agent_min_price',
+ 'type' => 'text_medium',
+ 'attributes' => [
+ 'type' => 'number',
+ ],
+ 'default' => 0,
+ ],
+ [
+ 'name' => esc_html__( 'Maximum of Target Price For Agent', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Enter maximum of price for starting search agent by target', 'opalestate-pro' ),
+ 'id' => 'search_agent_max_price',
+ 'type' => 'text_medium',
+ 'attributes' => [
+ 'type' => 'number',
+ ],
+ 'default' => 1000000,
+ ],
+ [
+ 'name' => esc_html__( 'Advanced', 'opalestate-pro' ),
+ 'desc' => '',
+ 'type' => 'opalestate_title',
+ 'id' => 'opalestate_title_advanced_settings',
+ 'before_row' => '
',
+ 'after_row' => '
',
+ ],
+ [
+ 'name' => esc_html__( 'Clean Up Interval', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Set a schedule to automatically clean up expired properties and attachments.', 'opalestate-pro' ),
+ 'id' => 'schedule',
+ 'type' => 'select',
+ 'options' => opalestate_get_schedule_interval_options(),
+ 'default' => 0,
+ ],
]
);
}
diff --git a/inc/admin/settings/property.php b/inc/admin/settings/property.php
index c5044fee..1f0da6a6 100755
--- a/inc/admin/settings/property.php
+++ b/inc/admin/settings/property.php
@@ -238,12 +238,11 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
];
$fields[] = [
- 'name' => esc_html__( 'Horizontal Search Fields', 'opalestate-pro' ),
- 'desc' => esc_html__( 'Disable or enable fields appearing in search form', 'opalestate-pro' ),
+ 'name' => esc_html__( 'Search Fields', 'opalestate-pro' ),
'type' => 'opalestate_title',
- 'id' => 'opalestate_title_general_settings_1',
+ 'id' => 'opalestate_title_search_fields',
'before_row' => '
',
- 'after_row' => '
',
+ 'after_row' => '' . __( 'Enable/Disable fields appearing in search properties form.', 'opalestate-pro' ) . '
',
];
$fields[] = [
@@ -280,12 +279,11 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
}
$fields[] = [
- 'name' => esc_html__( 'Setting type fields search', 'opalestate-pro' ),
- 'desc' => esc_html__( 'Setting type fields search', 'opalestate-pro' ) . '
',
+ 'name' => esc_html__( 'Search Fields type', 'opalestate-pro' ),
'type' => 'opalestate_title',
'id' => 'opalestate_title_general_settings_type_search',
'before_row' => '
',
- 'after_row' => '
',
+ 'after_row' => '' . __( 'Input type for search fields.', 'opalestate-pro' ) . '',
];
$metas = Opalestate_Property_MetaBox::metaboxes_info_fields();
@@ -367,6 +365,14 @@ class Opalestate_Settings_Property_Tab extends Opalestate_Settings_Base_Tab {
private function get_subtab_detail_fields() {
$fields = [];
+ $fields[] = [
+ 'name' => esc_html__( 'Single Layout Page', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Choose layout for single property.', 'opalestate-pro' ),
+ 'id' => 'layout',
+ 'type' => 'select',
+ 'options' => apply_filters( 'opalestate_single_layout_templates', [ '' => esc_html__( 'Inherit', 'opalestate-pro' ) ] ),
+ ];
+
$fields[] = [
'name' => esc_html__( 'Enable Request Viewing', 'opalestate-pro' ),
'desc' => esc_html__( 'Enable Request Viewing feature in the single property page.', 'opalestate-pro' ),
diff --git a/inc/class-opalestate-deactivator.php b/inc/class-opalestate-deactivator.php
new file mode 100644
index 00000000..7d73a41c
--- /dev/null
+++ b/inc/class-opalestate-deactivator.php
@@ -0,0 +1,22 @@
+ __( 'Opal Estate Pro Clean Up Interval', 'opalestate-pro' ),
+ 'interval' => $interval,
+ ];
+
+ return $schedules;
+ }
+
+ /**
+ * Create cron jobs (clear them first).
+ */
+ public static function create_cron_jobs() {
+ wp_clear_scheduled_hook( 'opalestate_corn' );
+ wp_clear_scheduled_hook( 'opalestate_clean_update' );
+
+ if ( ! wp_next_scheduled ( 'opalestate_clean_update' ) ) {
+ wp_schedule_event( time(), 'opalestate_corn', 'opalestate_clean_update' );
+ }
+ }
}
/**
diff --git a/inc/hook-functions.php b/inc/hook-functions.php
new file mode 100644
index 00000000..ff3af683
--- /dev/null
+++ b/inc/hook-functions.php
@@ -0,0 +1,135 @@
+
+ */
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly
+}
+
+/**
+ * Register widget area.
+ *
+ * @link https://developer.wordpress.org/themes/functionality/sidebars/#registering-a-sidebar
+ */
+function opalestate_widgets_init() {
+ register_sidebar( [
+ 'name' => esc_html__( 'Single Property Sidebar', 'opalestate-pro' ),
+ 'id' => 'opalestate-single-property',
+ 'description' => esc_html__( 'Add widgets here to appear in your single property sidebar area.', 'opalestate-pro' ),
+ 'before_widget' => '',
+ 'after_widget' => '
',
+ 'before_title' => '',
+ ] );
+}
+
+add_action( 'widgets_init', 'opalestate_widgets_init' );
+
+/**
+ * Add hidden multilingual.
+ */
+function opalestate_add_hidden_multilingual() {
+ if ( ! opalestate_running_on_multilanguage() ) {
+ return;
+ }
+ ?>
+
+ 'attachment',
+ 'post_status' => 'inherit',
+ 'date_query' => [
+ 'column' => 'post_date',
+ 'before' => date( 'Y-m-d', strtotime( '-1 days' ) ),
+ ],
+ 'meta_query' => [
+ [
+ 'key' => '_pending_to_use_',
+ 'value' => 1,
+ 'compare' => '>=',
+ ],
+ ],
+ ]
+ );
+
+ if ( $query->have_posts() ) {
+ while ( $query->have_posts() ) {
+ $query->the_post();
+ wp_delete_attachment( get_the_ID() );
+ }
+ }
+ wp_reset_postdata();
+
+ // Change status expired properties.
+ $expired_query = new WP_Query( [
+ 'post_type' => 'opalestate_property',
+ 'post_status' => [ 'pending', 'publish' ],
+ 'meta_query' => [
+ [
+ 'key' => OPALESTATE_PROPERTY_PREFIX . 'expired_time',
+ 'value' => time(),
+ 'compare' => '<',
+ 'type' => 'NUMERIC',
+ ],
+ ],
+ ] );
+
+ opalestate_write_log($expired_query->found_posts);
+
+ if ( $expired_query->have_posts() ) {
+ while ( $expired_query->have_posts() ) {
+ $expired_query->the_post();
+ opalestate_write_log(get_the_ID());
+
+ wp_update_post( [
+ 'ID' => get_the_ID(),
+ 'post_status' => 'expired',
+ ] );
+ }
+ }
+
+ wp_reset_postdata();
+ } catch ( Exception $e ) {
+ opalestate_write_log( $e->getMessage() );
+ }
+}
+
+add_action( 'opalestate_clean_update', 'opalestate_clean_update' );
diff --git a/inc/mixes-functions.php b/inc/mixes-functions.php
index 2db066ac..34ac4c62 100755
--- a/inc/mixes-functions.php
+++ b/inc/mixes-functions.php
@@ -940,7 +940,6 @@ function opalestate_currency_symbol( $currency = '' ) {
'LRD' => '$',
'LSL' => 'L',
'LYD' => 'ل.د',
- 'MAD' => 'د. م.',
'MAD' => 'د.م.',
'MDL' => 'L',
'MGA' => 'Ar',
@@ -1208,20 +1207,6 @@ function opalestate_running_on_multilanguage() {
return apply_filters( 'opalestate_is_running_multilanguage', Opalestate_Multilingual::is_polylang() || Opalestate_Multilingual::is_wpml() );
}
-/**
- * Add hidden multilingual.
- */
-function opalestate_add_hidden_multilingual() {
- if ( ! opalestate_running_on_multilanguage() ) {
- return;
- }
- ?>
-
- esc_html__( 'Single Property Sidebar', 'opalestate-pro' ),
- 'id' => 'opalestate-single-property',
- 'description' => esc_html__( 'Add widgets here to appear in your single property sidebar area.', 'opalestate-pro' ),
- 'before_widget' => '',
- 'after_widget' => '
',
- 'before_title' => '',
- ] );
-}
-
-add_action( 'widgets_init', 'opalestate_widgets_init' );
-
/**
* Get email date format.
*
@@ -1412,24 +1378,24 @@ function opalestate_email_date_format() {
* @return string
*/
function opalestate_get_autocomplete_restrictions() {
- $restrictions_option = trim( opalestate_options( 'autocomplete_restrictions', '' ) );
+ $restrictions_option = trim( opalestate_options( 'autocomplete_restrictions', '' ) );
- if ( ! $restrictions_option ) {
- return '';
- }
+ if ( ! $restrictions_option ) {
+ return '';
+ }
- $array = explode( ',', $restrictions_option );
- $results = [];
+ $array = explode( ',', $restrictions_option );
+ $results = [];
- foreach ( $array as $res ) {
- $results[] = strtolower( trim( $res ) );
- }
+ foreach ( $array as $res ) {
+ $results[] = strtolower( trim( $res ) );
+ }
- if ( ! $results ) {
- return '';
- }
+ if ( ! $results ) {
+ return '';
+ }
- return json_encode( $results );
+ return json_encode( $results );
}
/**
@@ -1468,3 +1434,38 @@ function opalestate_search_property_by_term( $term ) {
return apply_filters( 'opalestate_search_property_results', $property_ids, $term, $search_fields );
}
+
+/**
+ * Get Schedule Intervals
+ *
+ * @return array
+ */
+function opalestate_get_schedule_interval_options() {
+ return apply_filters( 'opalestate_schedule_interval_options', [
+ '0' => esc_html__( 'Never', 'opalestate-pro' ),
+ WEEK_IN_SECONDS => esc_html__( '1 Week', 'opalestate-pro' ),
+ DAY_IN_SECONDS => esc_html__( '24 Hours', 'opalestate-pro' ),
+ 12 * HOUR_IN_SECONDS => esc_html__( '12 Hours', 'opalestate-pro' ),
+ 6 * HOUR_IN_SECONDS => esc_html__( '6 Hours', 'opalestate-pro' ),
+ HOUR_IN_SECONDS => esc_html__( '1 Hours', 'opalestate-pro' ),
+ ]
+ );
+}
+
+if ( ! function_exists( 'opalestate_write_log' ) ) {
+
+ /**
+ * Write log.
+ *
+ * @param $log
+ */
+ function opalestate_write_log( $log ) {
+ if ( true === WP_DEBUG ) {
+ if ( is_array( $log ) || is_object( $log ) ) {
+ error_log( print_r( $log, true ) );
+ } else {
+ error_log( $log );
+ }
+ }
+ }
+}
diff --git a/inc/submission/class-opalestate-submission.php b/inc/submission/class-opalestate-submission.php
index fff50f28..bba5c922 100755
--- a/inc/submission/class-opalestate-submission.php
+++ b/inc/submission/class-opalestate-submission.php
@@ -260,6 +260,46 @@ class OpalEstate_Submission {
'type' => 'text',
'default' => 'SKU-{property_id}',
],
+ [
+ 'name' => esc_html__( 'Upload Settings', 'opalestate-pro' ),
+ 'id' => 'opalestate_title_upload_settings',
+ 'type' => 'title',
+ 'before_row' => '
',
+ 'after_row' => '
',
+ ],
+ [
+ 'name' => esc_html__( 'Maximum Upload Image Size', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Set maximum volumn size having < x MB', 'opalestate-pro' ),
+
+ 'id' => 'upload_image_max_size',
+ 'type' => 'text',
+ 'default' => '0.5',
+ ],
+ [
+ 'name' => esc_html__( 'Maximum Upload Image Files', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Set maximum volumn size having < x MB', 'opalestate-pro' ),
+
+ 'id' => 'upload_image_max_files',
+ 'type' => 'text',
+ 'default' => '10',
+ ],
+ [
+ 'name' => esc_html__( 'Maximum Upload Other Size', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Set maximum volumn size having < x MB for upload docx, pdf...', 'opalestate-pro' ),
+
+ 'id' => 'upload_other_max_size',
+ 'type' => 'text',
+ 'default' => '0.8',
+ ],
+ [
+ 'name' => esc_html__( 'Maximum Upload Other Files', 'opalestate-pro' ),
+ 'desc' => esc_html__( 'Set maximum volumn size having < x MB for upload docx, pdf...', 'opalestate-pro' ),
+
+ 'id' => 'upload_other_max_files',
+ 'type' => 'text',
+ 'default' => '10',
+ 'after_row' => '
',
+ ],
]
),
];
diff --git a/inc/vendors/elementor/widgets/opalestate-form-builder.php b/inc/vendors/elementor/widgets/opalestate-form-builder.php
index f40c7ade..4875bde5 100755
--- a/inc/vendors/elementor/widgets/opalestate-form-builder.php
+++ b/inc/vendors/elementor/widgets/opalestate-form-builder.php
@@ -77,7 +77,7 @@ class Opalestate_form_builder_Elementor_Widget extends Opalestate_Elementor_Widg
$this->start_controls_section(
'form_builder_head',
[
- 'label' => esc_html__( 'Agency/Agent Tab Form Search', 'opalestate-pro' ),
+ 'label' => esc_html__( 'Form Builder', 'opalestate-pro' ),
]
);
diff --git a/opal-estate-pro.php b/opal-estate-pro.php
index 8509e56a..bff90fed 100755
--- a/opal-estate-pro.php
+++ b/opal-estate-pro.php
@@ -3,7 +3,7 @@
* Plugin Name: Opal Estate Pro
* Plugin URI: https://wpdocs.gitbook.io/opal-estate/
* Description: Opal Real Estate Plugin is an ideal solution and brilliant choice for you to set up a professional estate website.
- * Version: 1.5.1
+ * Version: 1.5.2
* Author: WPOPAL
* Author URI: http://www.wpopal.com
* Requires at least: 4.9
@@ -123,12 +123,16 @@ if ( ! class_exists( 'OpalEstate' ) ) {
self::$instance->setup_constants();
register_activation_hook( OPALESTATE_PLUGIN_FILE, [ 'Opalestate_Install', 'install' ] );
+ register_deactivation_hook( OPALESTATE_PLUGIN_FILE, [ 'Opalestate_Deactivator', 'deactivate' ] );
+
add_action( 'plugins_loaded', [ self::$instance, 'load_textdomain' ] );
self::$instance->setup();
- self::$instance->roles = new Opalestate_Roles();
- self::$instance->html = new Opalestate_HTML_Elements();
- self::$instance->api = new Opalestate_API();
- self::$instance->session = new Opalestate_Session();
+ self::$instance->roles = new Opalestate_Roles();
+ self::$instance->html = new Opalestate_HTML_Elements();
+ self::$instance->api = new Opalestate_API();
+ self::$instance->session = new Opalestate_Session();
+
+ Opalestate_Install::init();
/**
*
@@ -150,7 +154,7 @@ if ( ! class_exists( 'OpalEstate' ) ) {
*/
public function __clone() {
// Cloning instances of the class is forbidden
- _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'opalestate-pro' ), '1.5.1' );
+ _doing_it_wrong( __FUNCTION__, esc_html__( 'Cheatin’ huh?', 'opalestate-pro' ), '1.5.2' );
}
/**
@@ -159,7 +163,7 @@ if ( ! class_exists( 'OpalEstate' ) ) {
public function setup_constants() {
// Plugin version
if ( ! defined( 'OPALESTATE_VERSION' ) ) {
- define( 'OPALESTATE_VERSION', '1.5.1' );
+ define( 'OPALESTATE_VERSION', '1.5.2' );
}
// Plugin Folder Path
@@ -236,6 +240,7 @@ if ( ! class_exists( 'OpalEstate' ) ) {
'class-template-loader.php',
'query-functions.php',
'mixes-functions.php',
+ 'hook-functions.php',
'class-opalestate-roles.php',
'classes/class-opalestate-session.php',
'classes/class-opalestate-abs-query.php',
@@ -360,6 +365,7 @@ if ( ! class_exists( 'OpalEstate' ) ) {
);
require_once OPALESTATE_PLUGIN_DIR . 'inc/class-opalestate-install.php';
+ require_once OPALESTATE_PLUGIN_DIR . 'inc/class-opalestate-deactivator.php';
require_once OPALESTATE_PLUGIN_DIR . 'inc/class-opalestate-html.php';
require_once OPALESTATE_PLUGIN_DIR . 'inc/function-search-fields.php';
diff --git a/readme.txt b/readme.txt
index 8e322664..12e0da55 100755
--- a/readme.txt
+++ b/readme.txt
@@ -27,8 +27,6 @@ The plugin will not make you disappointed with ease of use, friendly & flexible
2. *[ Latehome - Real Estate WordPress Theme](http://bit.ly/2p5HUn2 "Latehome - Real Estate WordPress Theme")*
3. *[ Latehome Free - Real Estate Free WordPress Theme](http://demo2.themelexus.com/latehome_free/ "Latehome Free - Real Estate Free WordPress Theme"). You can download free [here](http://bit.ly/latehomefree "Latehome Free download").*
- * Please keep contact us at help@wpopal.com to send us your website, we will publish it our showcase
-
= Add-ons for Opal Estate Pro =
* Please visit and download [all add-ons](https://wordpress.org/plugins/tags/opalestate_addon/ "Opal Estate Pro add-ons") for Opal Estate Pro, they are free 100%*
1. *[ Opal Membership](https://wordpress.org/plugins/opal-membership/ "Opal Membership")*: Manage membership packages, users.
@@ -152,6 +150,9 @@ This section describes how to install the plugin and get it working.
* System tickets support 24/7 available : [free support](https://themelexus.ticksy.com/ "Visit the Plugin support Page")
== Changelog ==
+= 1.5.2 - 2020-06-04 =
+* Added - Clean Up setting.
+
= 1.5.1 - 2020-06-01 =
* Added - Enable/Disable setting for each property.