| 1 |
<?php |
| 2 |
if ( ! defined( 'ABSPATH' ) ) { |
| 3 |
exit; // Exit if accessed directly |
| 4 |
} |
| 5 |
|
| 6 |
if (isset($_POST['mlsimport_tool_actions']) && |
| 7 |
wp_verify_nonce( sanitize_text_field( wp_unslash( $_POST['mlsimport_tool_actions'] ) ), 'mlsimport_tool_actions')) { |
| 8 |
|
| 9 |
if ( isset( $_POST['mlsimport-disable-logs'] ) ) { |
| 10 |
$disable_logs = intval( $_POST['mlsimport-disable-logs'] ); |
| 11 |
update_option( 'mlsimport_disable_logs', $disable_logs ); |
| 12 |
} |
| 13 |
if ( isset( $_POST['mlsimport-disable-history'] ) ) { |
| 14 |
$disable_history = intval( $_POST['mlsimport-disable-history'] ); |
| 15 |
update_option( 'mlsimport-disable-history', $disable_history ); |
| 16 |
} |
| 17 |
|
| 18 |
} |
| 19 |
?> |
| 20 |
|
| 21 |
<form method="post" name="cleanup_options" action=""> |
| 22 |
<?php |
| 23 |
global $mlsimport; |
| 24 |
settings_fields( $this->plugin_name . '_administrative_options' ); |
| 25 |
do_settings_sections( $this->plugin_name . '_administrative_options' ); |
| 26 |
$options = get_option( $this->plugin_name . '_administrative_options' ); |
| 27 |
$mlsimport->admin->mlsimport_saas_setting_up(); |
| 28 |
//mlsimport_saas_event_mls_import_auto_function(); |
| 29 |
//mlsimport_saas_reconciliation_event_function(); |
| 30 |
?> |
| 31 |
|
| 32 |
<h1> Administrative Tools</h1> |
| 33 |
|
| 34 |
|
| 35 |
<?php |
| 36 |
|
| 37 |
|
| 38 |
|
| 39 |
$disable_logs = intval( get_option( 'mlsimport_disable_logs' ) ); |
| 40 |
$selected_no = $selected_yes = ''; |
| 41 |
|
| 42 |
if ( 0 === intval($disable_logs) ) { |
| 43 |
$selected_no = ' selected '; |
| 44 |
} else { |
| 45 |
$selected_yes = ' selected '; |
| 46 |
} |
| 47 |
|
| 48 |
|
| 49 |
$disable_history = intval( get_option( 'mlsimport-disable-history', 1 ) ); |
| 50 |
$selected_history_no = $selected_history_yes = ''; |
| 51 |
|
| 52 |
if ( 0 === intval($disable_history) ) { |
| 53 |
$selected_history_no = ' selected '; |
| 54 |
} else { |
| 55 |
$selected_history_yes = ' selected '; |
| 56 |
} |
| 57 |
?> |
| 58 |
|
| 59 |
<div class="mlsimport_tool_field_item_wrapper"> |
| 60 |
<h4 style="margin-bottom:0px;"> Disable System Logs (logs should only be enabled during debug process) </h4> |
| 61 |
<select name="mlsimport-disable-logs" class="mlsimport-2025-select" id="mlsimport-disable-logs"> |
| 62 |
<option value="0" <?php echo esc_html( $selected_no ); ?> >logs disabled</option> |
| 63 |
<option value="1" <?php echo esc_html( $selected_yes ); ?>>logs enabled</option> |
| 64 |
|
| 65 |
</select> |
| 66 |
</div> |
| 67 |
|
| 68 |
|
| 69 |
<div class="mlsimport_tool_field_item_wrapper"> |
| 70 |
<h4 style="margin-bottom:0px;"> Disable Property History (can be seen by editing a property in WordPress admin) </h4> |
| 71 |
<select name="mlsimport-disable-history" class="mlsimport-2025-select" id="mlsimport-disable-history"> |
| 72 |
|
| 73 |
<option value="1" <?php echo esc_html( $selected_history_yes ); ?>>history enabled</option> |
| 74 |
<option value="0" <?php echo esc_html( $selected_history_no ); ?> >history disabled</option> |
| 75 |
|
| 76 |
</select> |
| 77 |
</div> |
| 78 |
|
| 79 |
|
| 80 |
|
| 81 |
<?php submit_button( __( 'Save Changes', 'mlsimport' ), 'mlsimport_button button save_data', 'submit', true ); ?> |
| 82 |
|
| 83 |
<div class="mlsimport_tool_field_item_wrapper" style="background-color: #eee;padding: 10px;border-radius: 5px;"> |
| 84 |
<h3 style="margin-bottom:20px;"> Clear cached data </h3> |
| 85 |
<input class="button mlsimport_button " type="button" id="mlsimport-clear-cache" value="Clear Plugin Cached Data" /> |
| 86 |
</div> |
| 87 |
|
| 88 |
<div class="mlsimport_tool_field_item_wrapper" style="background-color: #eee;padding: 10px;border-radius: 5px;"> |
| 89 |
<h3 style="margin-bottom:20px;"> Clear fields data </h3> |
| 90 |
<input class="button mlsimport_button " type="button" id="mlsimport-clear-fields-data" value="Clear Field Data" /> |
| 91 |
</div> |
| 92 |
|
| 93 |
|
| 94 |
<div class="mlsimport_tool_field_item_wrapper"> |
| 95 |
<h3 style="margin-bottom:0px;">Cron Jobs </h3> |
| 96 |
<div class="cron_job_explainin"> |
| 97 |
By default a syncronization event runs every hour. The action will be triggered when someone visits your site if the scheduled time has passed. This is the default, "out of the box" way to do things in WordPress and it works very well in 99% of the cases. |
| 98 |
|
| 99 |
</br></br>If, for some reason, you want to force the syncronization event to run every two hours(minimum time frame permitted by this plugin) you can set a cron job on your server enviroment and call this url : http://yourwebsite.com/?mlsimport_cron=yes. |
| 100 |
</br></br><strong>Example : 0 */2 * * * wget https://yourwebsite.com/?mlsimport_cron=yes</strong> . |
| 101 |
</div> |
| 102 |
<div> |
| 103 |
|
| 104 |
<fieldset class="mlsimport-fieldset" style="background-color: #eee;padding: 10px;border-radius: 5px;"> |
| 105 |
|
| 106 |
<h3><?php esc_html_e('Delete Properties','mlsimport'); ?></h3> |
| 107 |
|
| 108 |
<div id="mlsimport-delete-notification"><?php esc_html_e('Select a taxonomy and terms, then click Delete.','mlsimport');?></div> |
| 109 |
|
| 110 |
<label class="mlsimport-label"><?php esc_html_e( 'Select Taxonomy', 'mlsimport' ); ?></label><br> |
| 111 |
<select id="mlsimport_delete_category" class="mlsimport-select mlsimport-2025-select"> |
| 112 |
<option value=""><?php esc_html_e( '-- Select Taxonomy --', 'mlsimport' ); ?></option> |
| 113 |
<?php |
| 114 |
$delete_taxonomies = mlsimport_get_custom_post_type_taxonomies( $mlsimport->admin->env_data->get_property_post_type() ); |
| 115 |
foreach ( $delete_taxonomies as $tax_slug => $tax_label ) : |
| 116 |
?> |
| 117 |
<option value="<?php echo esc_attr( $tax_slug ); ?>"><?php echo esc_html( $tax_label ); ?> (<?php echo esc_html( $tax_slug ); ?>)</option> |
| 118 |
<?php endforeach; ?> |
| 119 |
</select> |
| 120 |
<br><br> |
| 121 |
|
| 122 |
<label class="mlsimport-label"><?php esc_html_e( 'Select Terms', 'mlsimport' ); ?></label><br> |
| 123 |
<select id="mlsimport_delete_category_term" class="mlsimport-select mlsimport-2025-select" multiple disabled style="min-height:120px;width:100%;max-width:400px;"> |
| 124 |
<option value="" disabled><?php esc_html_e( 'Select a taxonomy first', 'mlsimport' ); ?></option> |
| 125 |
</select> |
| 126 |
<p class="mlsimport-exp"><?php esc_html_e( 'Hold Ctrl (Windows) or Command (Mac) to select multiple terms.', 'mlsimport' ); ?></p> |
| 127 |
<br> |
| 128 |
|
| 129 |
<div id="mlsimport-delete-progress" style="display:none;margin-bottom:10px;"> |
| 130 |
<div style="background:#ddd;border-radius:4px;overflow:hidden;height:20px;margin-bottom:5px;"> |
| 131 |
<div id="mlsimport-delete-progress-bar" style="background:#0073aa;height:100%;width:0%;transition:width 0.3s;"></div> |
| 132 |
</div> |
| 133 |
<span id="mlsimport-delete-progress-text">0 / 0</span> |
| 134 |
</div> |
| 135 |
|
| 136 |
<input class="button mlsimport_button error_action" type="button" id="mlsimport-delete-prop" value="<?php esc_attr_e( 'Delete', 'mlsimport' ); ?>" /> |
| 137 |
<input class="button" type="button" id="mlsimport-delete-stop" value="<?php esc_attr_e( 'Stop', 'mlsimport' ); ?>" style="display:none;margin-left:10px;" /> |
| 138 |
</fieldset> |
| 139 |
<?php |
| 140 |
$ajax_nonce = wp_create_nonce( "mlsimport_tool_actions" ); |
| 141 |
?> |
| 142 |
|
| 143 |
<input type="hidden" id="mlsimport_tool_actions" name="mlsimport_tool_actions" value="<?php echo esc_attr($ajax_nonce); ?>" /> |
| 144 |
|
| 145 |
<input type="hidden" name="action" value="mlsimport_form_action"> |
| 146 |
</form> |
| 147 |
|