| 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 |
$disable_logs = intval( get_option( 'mlsimport_disable_logs' ) ); |
| 37 |
$selected_no = $selected_yes = ''; |
| 38 |
|
| 39 |
if ( 0 === intval($disable_logs) ) { |
| 40 |
$selected_no = ' selected '; |
| 41 |
} else { |
| 42 |
$selected_yes = ' selected '; |
| 43 |
} |
| 44 |
|
| 45 |
|
| 46 |
$disable_history = intval( get_option( 'mlsimport-disable-history', 1 ) ); |
| 47 |
$selected_history_no = $selected_history_yes = ''; |
| 48 |
|
| 49 |
if ( 0 === intval($disable_history) ) { |
| 50 |
$selected_history_no = ' selected '; |
| 51 |
} else { |
| 52 |
$selected_history_yes = ' selected '; |
| 53 |
} |
| 54 |
?> |
| 55 |
|
| 56 |
<div class="mlsimport_tool_field_item_wrapper"> |
| 57 |
<h4 style="margin-bottom:0px;"> Disable System Logs (logs should only be enabled during debug process) </h4> |
| 58 |
<select name="mlsimport-disable-logs" id="mlsimport-disable-logs"> |
| 59 |
<option value="0" <?php echo esc_html( $selected_no ); ?> >logs disabled</option> |
| 60 |
<option value="1" <?php echo esc_html( $selected_yes ); ?>>logs enabled</option> |
| 61 |
|
| 62 |
</select> |
| 63 |
</div> |
| 64 |
|
| 65 |
|
| 66 |
<div class="mlsimport_tool_field_item_wrapper"> |
| 67 |
<h4 style="margin-bottom:0px;"> Disable Property History (can be seen by editing a property in WordPress admin) </h4> |
| 68 |
<select name="mlsimport-disable-history" id="mlsimport-disable-history"> |
| 69 |
|
| 70 |
<option value="1" <?php echo esc_html( $selected_history_yes ); ?>>history enabled</option> |
| 71 |
<option value="0" <?php echo esc_html( $selected_history_no ); ?> >history disabled</option> |
| 72 |
|
| 73 |
</select> |
| 74 |
</div> |
| 75 |
|
| 76 |
|
| 77 |
|
| 78 |
<?php submit_button( __( 'Save Changes', 'mlsimport' ), 'mlsimport_button', 'submit', true ); ?> |
| 79 |
|
| 80 |
<div class="mlsimport_tool_field_item_wrapper" style="background-color: #eee;padding: 10px;border-radius: 5px;"> |
| 81 |
<h3 style="margin-bottom:0px;"> Clear cached data </h3> |
| 82 |
<input class="mlsimport_button" type="button" id="mlsimport-clear-cache" value="Clear Plugin Cached Data" /> |
| 83 |
</div> |
| 84 |
|
| 85 |
|
| 86 |
<div class="mlsimport_tool_field_item_wrapper"> |
| 87 |
<h3 style="margin-bottom:0px;">Cron Jobs </h3> |
| 88 |
<div class="cron_job_explainin"> |
| 89 |
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. |
| 90 |
|
| 91 |
</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. |
| 92 |
</br></br><strong>Example : 0 */2 * * * wget https://yourwebsite.com/?mlsimport_cron=yes</strong> . |
| 93 |
</div> |
| 94 |
<div> |
| 95 |
|
| 96 |
<fieldset class="mlsimport-fieldset" style="background-color: #eee;padding: 10px;border-radius: 5px;"> |
| 97 |
|
| 98 |
<h3><?php esc_html__('Delete Properties','mlsimport'); ?></h3> |
| 99 |
|
| 100 |
<div id="mlsimport-delete-notification" ><?php esc_html_e('Please fill all the forms','mlsimport');?></div> |
| 101 |
|
| 102 |
|
| 103 |
<label class="mlsimport-label" for="<?php echo esc_attr($this->plugin_name) . '_administrative_options'; ?>-import" > |
| 104 |
<?php echo esc_html__( 'Delete from Category', 'mlsimport' ); ?> |
| 105 |
</label></br> |
| 106 |
<input type="text" lass="mlsimport-input" id="mlsimport_delete_category"></br> |
| 107 |
</br> |
| 108 |
<label class="mlsimport-label" for="<?php echo esc_attr($this->plugin_name) . '_administrative_options'; ?>-import" > |
| 109 |
<?php echo esc_html__( 'Delete the term from category(use term slug)', 'mlsimport' ); ?> |
| 110 |
</label></br> |
| 111 |
<input type="text" lass="mlsimport-input" id="mlsimport_delete_category_term"></br> |
| 112 |
</br> |
| 113 |
<label class="mlsimport-label" for="<?php echo esc_attr($this->plugin_name) . '_administrative_options'; ?>-import" > |
| 114 |
<?php esc_html_e('Pause the script between property delete processes (1=1 sec . For slow hosting use a number between 1 and 5)','mlsimport'); ?> |
| 115 |
</label> |
| 116 |
|
| 117 |
<input type="text" lass="mlsimport-input" id="mlsimport_delete_timeout" value="0"> |
| 118 |
|
| 119 |
</br> |
| 120 |
<input class="button mlsimport_button" type="button" id="mlsimport-delete-prop" value="Delete" /> |
| 121 |
</fieldset> |
| 122 |
<?php |
| 123 |
$ajax_nonce = wp_create_nonce( "mlsimport_tool_actions" ); |
| 124 |
?> |
| 125 |
|
| 126 |
<input type="hidden" id="mlsimport_tool_actions" name="mlsimport_tool_actions" value="<?php echo esc_attr($ajax_nonce); ?>" /> |
| 127 |
|
| 128 |
<input type="hidden" name="action" value="mlsimport_form_action"> |
| 129 |
</form> |
| 130 |
|