Below is a differential between the unpatched vulnerable code and the patched update, for reference.
--- a/wpdirectorykit/admin/class-wpdirectorykit-admin.php
+++ b/wpdirectorykit/admin/class-wpdirectorykit-admin.php
@@ -217,6 +217,12 @@
if (isset($_POST['page'])) $page = sanitize_text_field($_POST['page']);
if (isset($_POST['function'])) $function = sanitize_text_field($_POST['function']);
+ /* protect access only to ajax controller */
+ if($page != 'wdk_frontendajax' && $page != 'wdk_backendajax' && $page != 'wdk_fields') {
+ exit(esc_html__('Access denied','wdk-bookings'));
+ }
+
+
$Winter_MVC_WDK->load_controller($page, $function, array());
}
--- a/wpdirectorykit/application/controllers/Wdk_fields.php
+++ b/wpdirectorykit/application/controllers/Wdk_fields.php
@@ -256,11 +256,16 @@
{
$this->load->model('field_m');
- $data_fields_list = $this->input->post_get('data_fields_list');
-
+ $data_fields_list = sanitize_text_field($this->input->post_get('data_fields_list'));
- $splitted = explode(';', $data_fields_list);
+ // Verify the nonce before proceeding
+ $nonce = $this->input->post_get('wdk_fields_nonce');
+ if (empty($nonce) || !wp_verify_nonce($nonce, 'wdk_fields_save_order')) {
+ wp_send_json_error(array('message' => __('Invalid security token (nonce).', 'wpdirectorykit')), 403);
+ exit();
+ }
+ $splitted = explode(';', preg_replace('/[^0-9;]/', '', $data_fields_list));
$values = array();
$order_index = 1;
--- a/wpdirectorykit/application/controllers/Wdk_listing.php
+++ b/wpdirectorykit/application/controllers/Wdk_listing.php
@@ -192,24 +192,15 @@
$Winter_MVC_wdk_membership->model('subscription_m');
$this->db->select('*');
- $this->db->join($Winter_MVC_wdk_membership->subscription_m->_table_name.' ON '.$Winter_MVC_wdk_membership->subscription_m->_table_name.'.idsubscription = '.$Winter_MVC_wdk_membership->subscription_user_m->_table_name.'.subscription_id');
$this->db->join($this->db->prefix.'wdk_categories ON '.$this->db->prefix.'wdk_categories.idcategory = '.$Winter_MVC_wdk_membership->subscription_m->_table_name.'.category_id', TRUE, 'LEFT');
$this->db->join($this->db->prefix.'wdk_locations ON '.$this->db->prefix.'wdk_locations.idlocation = '.$Winter_MVC_wdk_membership->subscription_m->_table_name.'.location_id', TRUE, 'LEFT');
- $this->db->where(array(
- '(date_expire > ''.current_time( 'mysql' ).'')'=>NULL,
- '(user_id = ''.wmvc_show_data('user_id_editor', $this->data['db_data'], false).'')'=>NULL,
- '(status = 'ACTIVE')'=>NULL,
- )
- );
-
- $subscriptions = $Winter_MVC_wdk_membership->subscription_user_m->get();
+ $subscriptions = $Winter_MVC_wdk_membership->subscription_m->get();
if (count($subscriptions) > 0) {
foreach($subscriptions as $subscription) {
- $this->data['subscriptions'][wdk_show_data('subscription_id',$subscription,'', TRUE, TRUE)] = wdk_show_data('subscription_id', $subscription,'', TRUE, TRUE)
+ $this->data['subscriptions'][wdk_show_data('idsubscription', $subscription,'', TRUE, TRUE)] = wdk_show_data('idsubscription', $subscription,'', TRUE, TRUE)
.', '.wdk_show_data('subscription_name', $subscription,'', TRUE, TRUE)
.', '.wdk_show_data('location_title',$subscription, esc_html__('Any', 'wpdirectorykit'), TRUE, TRUE).' '. esc_html__('Location', 'wpdirectorykit')
- .', '.wdk_show_data('category_title',$subscription, esc_html__('Any', 'wpdirectorykit'), TRUE, TRUE).' '. esc_html__('Category', 'wpdirectorykit')
- .'('.wdk_get_date(wdk_show_data('date_expire', $subscription,'', TRUE, TRUE)).')';
+ .', '.wdk_show_data('category_title',$subscription, esc_html__('Any', 'wpdirectorykit'), TRUE, TRUE).' '. esc_html__('Category', 'wpdirectorykit');
}
}
}
--- a/wpdirectorykit/application/helpers/Basic.php
+++ b/wpdirectorykit/application/helpers/Basic.php
@@ -5368,5 +5368,17 @@
}
+ if ( ! function_exists('wdk_filter_viber_phone'))
+ {
+ // Validation phone for viber
+ /**
+ * @param string $value phone in string
+ * @return strings +xxx
+ */
+ function wdk_filter_viber_phone($value = '') {
+ $value = str_replace(array(' ','-','(',')'),'',$value);
+ return (strpos($value, '+') !== 0) ? '+' . $value : $value;
+ }
+ }
?>
--- a/wpdirectorykit/application/models/Settings_m.php
+++ b/wpdirectorykit/application/models/Settings_m.php
@@ -167,6 +167,14 @@
'field_type' => 'CHECKBOX',
'rules' => '',
),
+ array(
+ 'field' => 'wdk_disable_outline_on_focus',
+ 'field_label' => __('Disable outline on focus', 'wpdirectorykit'),
+ 'hint' => __('Removes the outline style from form elements when they are focused.', 'wpdirectorykit'),
+ 'field_type' => 'CHECKBOX',
+ 'rules' => '',
+ ),
+
);
$this->fields_list_tabs['templates'] [] = array(
--- a/wpdirectorykit/application/views/wdk_category/category_edit.php
+++ b/wpdirectorykit/application/views/wdk_category/category_edit.php
@@ -15,7 +15,7 @@
<div class="wrap wdk-wrap">
<h1 class="wp-heading-inline"><?php echo __('Category Management', 'wpdirectorykit'); ?></h1>
- <br /><br />
+ <br />
<div class="wdk-body">
<div class="postbox" style="display: block;">
--- a/wpdirectorykit/application/views/wdk_change_currency/index.php
+++ b/wpdirectorykit/application/views/wdk_change_currency/index.php
@@ -19,9 +19,9 @@
<br />
<img class="presentation-image" src="<?php echo WPDIRECTORYKIT_URL; ?>admin/img/change_currency.jpg" />
- <br /><br />
+ <br />
<a href="https://wpdirectorykit.com/documentation/" class="button button-primary xl" target="_blank"><?php echo __('Please check also other documentation guides', 'wpdirectorykit'); ?></a>
- <br /><br />
+ <br />
<a href="https://www.youtube.com/channel/UCTO1oMn1NOO8sJVUeaDytIA" class="button button-primary xl" target="_blank"><?php echo __('Or video tutorials on YouTube', 'wpdirectorykit'); ?></a>
<br />
</div>
--- a/wpdirectorykit/application/views/wdk_demo_import/index.php
+++ b/wpdirectorykit/application/views/wdk_demo_import/index.php
@@ -14,7 +14,7 @@
<div class="wrap wdk-wrap">
<h1 class="wp-heading-inline"><?php echo __('WDK Demo Import', 'wpdirectorykit'); ?></h1>
- <br /><br />
+ <br />
<div class="wdk-body">
<div class="postbox" style="display: block;">
<div class="postbox-header">
--- a/wpdirectorykit/application/views/wdk_demo_import/step_1.php
+++ b/wpdirectorykit/application/views/wdk_demo_import/step_1.php
@@ -14,7 +14,7 @@
<div class="wrap wdk-wrap">
<h1 class="wp-heading-inline"><?php echo __('WDK Demo Import', 'wpdirectorykit'); ?></h1>
- <br /><br />
+ <br />
<div class="wdk-body">
<div class="postbox" style="display: block;">
<div class="postbox-header">
--- a/wpdirectorykit/application/views/wdk_demo_import/step_2.php
+++ b/wpdirectorykit/application/views/wdk_demo_import/step_2.php
@@ -14,7 +14,7 @@
<div class="wrap wdk-wrap">
<h1 class="wp-heading-inline"><?php echo __('WDK Demo Import', 'wpdirectorykit'); ?></h1>
- <br /><br />
+ <br />
<div class="wdk-body">
<div class="postbox" style="display: block;">
<div class="postbox-header">
--- a/wpdirectorykit/application/views/wdk_fields/field_edit.php
+++ b/wpdirectorykit/application/views/wdk_fields/field_edit.php
@@ -15,7 +15,7 @@
<div class="wrap wdk-wrap">
<h1 class="wp-heading-inline"><?php echo __('Fields Management', 'wpdirectorykit'); ?></h1>
- <br /><br />
+ <br />
<div class="wdk-body">
<div class="postbox" style="display: block;">
<div class="postbox-header">
--- a/wpdirectorykit/application/views/wdk_fields/index.php
+++ b/wpdirectorykit/application/views/wdk_fields/index.php
@@ -15,7 +15,7 @@
<div class="wrap wdk-wrap">
<h1 class="wp-heading-inline"><?php echo __('Directory Fields Management','wpdirectorykit'); ?> <a href="<?php echo esc_url(get_admin_url() . "admin.php?page=wdk_fields&function=field_edit"); ?>" class="button button-primary" id="add_field_button"><?php echo __('Add Field','wpdirectorykit'); ?></a></h1>
- <br /><br />
+ <br />
<div class="wdk-body ">
<div class="row fields_list">
<?php if(count($fields) == 0): ?>
@@ -156,7 +156,8 @@
'page': 'wdk_fields',
'function': 'ajax_save_order',
'action': 'wdk_admin_action',
- 'data_fields_list' : data_fields_list
+ 'data_fields_list' : data_fields_list,
+ 'wdk_fields_nonce' : '<?php echo esc_js(wp_create_nonce('wdk_fields_save_order')); ?>'
};
$.post( "<?php echo esc_url(admin_url( 'admin-ajax.php' )); ?>", data)
--- a/wpdirectorykit/application/views/wdk_install/index.php
+++ b/wpdirectorykit/application/views/wdk_install/index.php
@@ -81,7 +81,7 @@
<?php echo __('Begin to install / activate','wpdirectorykit'); ?>
</a>
<?php else:?>
- <input type="submit" name="submit" id="submit" class="button button-primary event-ajax-indicator" value="<?php echo __('Import demo data', 'wpdirectorykit'); ?>"> <span class="wdk-ajax-indicator wdk-infinity-load color-primary dashicons dashicons-update-alt hidden" style="margin-top: 4px;margin-left: 4px;"></span>
+ <input type="submit" name="submit" id="submit" class="button button-primary event-ajax-indicator" value="<?php echo __('Import demo data', 'wpdirectorykit'); ?>"> <span class="wdk-ajax-indicator wdk-infinity-load color-primary dashicons dashicons-update-alt hidden" style="margin-left: 4px;"></span>
<?php endif;?>
<?php endif;?>
--- a/wpdirectorykit/application/views/wdk_install/remove_log.php
+++ b/wpdirectorykit/application/views/wdk_install/remove_log.php
@@ -13,7 +13,7 @@
<!-- This file should primarily consist of HTML with a little bit of PHP. -->
<div class="wrap wdk-wrap">
<h1 class="wp-heading-inline"><?php echo __('Remove Plugin Data', 'wpdirectorykit'); ?></h1>
- <br /><br />
+ <br />
<div class="wdk-body">
<div class="postbox" style="display: block;">
<div class="postbox-header">
--- a/wpdirectorykit/application/views/wdk_listing/inc/quick-nav-listings.php
+++ b/wpdirectorykit/application/views/wdk_listing/inc/quick-nav-listings.php
@@ -0,0 +1,68 @@
+<?php
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+?>
+<?php
+global $wpdb;
+$prev_id = $next_id = null;
+
+if(isset($_GET['id'])) {
+ $current_id = absint($_GET['id']);
+
+ $prev_id = $wpdb->get_var($wpdb->prepare("
+ SELECT ID
+ FROM {$wpdb->posts}
+ WHERE post_type = %s
+ AND post_status != 'trash'
+ AND ID < %d
+ ORDER BY ID DESC
+ LIMIT 1
+ ", 'wdk-listing', $current_id));
+
+ $next_id = $wpdb->get_var($wpdb->prepare("
+ SELECT ID
+ FROM {$wpdb->posts}
+ WHERE post_type = %s
+ AND post_status != 'trash'
+ AND ID > %d
+ ORDER BY ID ASC
+ LIMIT 1
+ ", 'wdk-listing', $current_id));
+}
+
+?>
+<div class="wdk-d-flex wdk-align-items-end wdk-justify-content-end">
+
+
+<div class="wdk-listing-toolbar">
+ <div class="wdk-toolbar-left">
+ <?php if ($prev_id): ?>
+ <a class="button button-secondary"
+ href="<?php echo esc_url(add_query_arg('id', $prev_id)); ?>">
+ <span class="dashicons dashicons-arrow-left-alt2"></span>
+ </a>
+ <?php endif; ?>
+ </div>
+
+ <div class="wdk-toolbar-search">
+ <input
+ type="text"
+ id="wdk-listing-search"
+ idexecuted="<?php echo isset($_GET['id']) ? esc_attr((int)$_GET['id']) : ''; ?>"
+ placeholder="<?php echo esc_html__('Search listings...', 'wpdirectorykit'); ?>"
+ autocomplete="off">
+ <div class="wdk-search-results" hidden></div>
+ </div>
+
+ <div class="wdk-toolbar-right">
+ <?php if ($next_id): ?>
+ <a class="button button-secondary"
+ href="<?php echo esc_url(add_query_arg('id', $next_id)); ?>">
+ <span class="dashicons dashicons-arrow-right-alt2"></span>
+ </a>
+ <?php endif; ?>
+ </div>
+
+</div>
+</div>
No newline at end of file
--- a/wpdirectorykit/application/views/wdk_listing/index.php
+++ b/wpdirectorykit/application/views/wdk_listing/index.php
@@ -15,7 +15,7 @@
<!-- This file should primarily consist of HTML with a little bit of PHP. -->
<div class="wrap wdk-wrap">
<h1 class="wp-heading-inline"><?php echo __('Add/Edit Listing', 'wpdirectorykit'); ?></h1>
- <br /><br />
+ <br />
<?php if (!function_exists('run_wdk_membership')): ?>
<div class="notice notice-success">
@@ -27,6 +27,9 @@
</p>
</div>
<?php endif; ?>
+
+ <?php $this->view('wdk_listing/inc/quick-nav-listings',$data); ?>
+
<div class="wdk-body">
<form method="post" class="form_listing form_listing_ai" action="<?php echo esc_url(wmvc_current_edit_url()); ?>" enctype="multipart/form-data" novalidate="novalidate">
<?php wp_nonce_field('wdk-listing-edit_' . wmvc_show_data('ID', $db_data, 0), '_wpnonce'); ?>
@@ -71,7 +74,7 @@
<?php if ($calendar_id): ?>
<a href="<?php echo esc_url(get_admin_url() . "admin.php?page=wdk-bookings-calendar&function=edit&id=" . esc_attr($calendar_id)); ?>"
class="wdk-mr-5 button button-secondary alignright">
- <span class="dashicons dashicons-calendar" style="margin-top: 4px;"></span> <?php echo __('Edit Calendar', 'wpdirectorykit') ?>
+ <span class="dashicons dashicons-calendar"></span> <?php echo __('Edit Calendar', 'wpdirectorykit') ?>
</a>
<?php endif; ?>
@@ -92,9 +95,9 @@
<?php else: ?>
class="wdk-mr-5 button button-secondary alignright"
<?php endif; ?>>
- <span class="dashicons dashicons-admin-page" style="margin-top: 4px;"></span> <?php echo __('Duplicate Listing', 'wpdirectorykit') ?>
+ <span class="dashicons dashicons-admin-page"></span> <?php echo __('Duplicate Listing', 'wpdirectorykit') ?>
</a>
- <a href="<?php echo get_permalink(wmvc_show_data('ID', $db_data)); ?>" title="<?php echo esc_attr__('View', 'wpdirectorykit'); ?>" class="button button-secondary alignright" target="_blank" style="margin-right:15px;"><span class="dashicons dashicons-visibility" style="margin-top: 4px;"></span> <?php echo __('View listing', 'wpdirectorykit'); ?></a>
+ <a href="<?php echo get_permalink(wmvc_show_data('ID', $db_data)); ?>" title="<?php echo esc_attr__('View', 'wpdirectorykit'); ?>" class="button button-secondary alignright" target="_blank" style="margin-right:15px;"><span class="dashicons dashicons-visibility" ></span> <?php echo __('View listing', 'wpdirectorykit'); ?></a>
<?php endif; ?>
</div>
<div class="inside">
@@ -110,6 +113,7 @@
}
$form->messages('class="alert alert-danger"', $success_message);
?>
+
<div class="wdk-side-content">
<div class="wdk-col main">
<table class="form-table" role="presentation">
@@ -509,7 +513,7 @@
<th scope="row"><label for="subscription_id"><?php echo __('Membership Subscription', 'wpdirectorykit'); ?></label></th>
<td>
<?php
- echo wmvc_select_option('subscription_id', $subscriptions, wmvc_show_data('subscription_id', $db_data, ''), "id='subscription_id'", __('Not Selected', 'wpdirectorykit'));
+ echo wmvc_select_option('subscription_id', $subscriptions, wmvc_show_data('subscription_id', $db_data, ''), "id='subscription_id' class='regular-text'", __('Not Selected', 'wpdirectorykit'));
?>
</td>
</tr>
@@ -761,21 +765,63 @@
$('#input_address').on('change keyup', function(e) {
clearTimeout(wdk_timerMap);
wdk_timerMap = setTimeout(function() {
- $.get('https://nominatim.openstreetmap.org/search?format=json&q=' + $('#input_address').val(), function(data) {
- if (data.length && typeof data[0]) {
- var {
- lat,
- lon
- } = data[0];
- wdk_edit_map_marker.setLatLng([lat, lon]).update();
- wdk_edit_map.panTo(new L.LatLng(lat, lon));
- $('#input_lat').val(lat);
- $('#input_lng').val(lon);
- } else {
- wdk_log_notify('<?php echo esc_js(__('Address not found', 'wpdirectorykit')); ?>', 'error');
- return;
- }
- });
+ var googleApiKey = '<?php echo esc_js(get_option('wdk_geo_google_api_key', '')); ?>';
+ var address = $('#input_address').val();
+
+ // If we have a Google API key, try Google Geocoding FIRST
+ if (googleApiKey) {
+ $.get('https://maps.googleapis.com/maps/api/geocode/json?address=' + encodeURIComponent(address) + '&key=' + googleApiKey, function(googleData) {
+ if (googleData.status === "OK" && googleData.results.length > 0) {
+ var location = googleData.results[0].geometry.location;
+ wdk_edit_map_marker.setLatLng([location.lat, location.lng]).update();
+ wdk_edit_map.panTo(new L.LatLng(location.lat, location.lng));
+ $('#input_lat').val(location.lat);
+ $('#input_lng').val(location.lng);
+ } else {
+ // If not found by Google, try Nominatim
+ $.get('https://nominatim.openstreetmap.org/search?format=json&q=' + encodeURIComponent(address), function(data) {
+ if (data.length && typeof data[0]) {
+ var {
+ lat,
+ lon
+ } = data[0];
+ wdk_edit_map_marker.setLatLng([lat, lon]).update();
+ wdk_edit_map.panTo(new L.LatLng(lat, lon));
+ $('#input_lat').val(lat);
+ $('#input_lng').val(lon);
+ } else {
+ wdk_log_notify('<?php echo esc_js(__('Address not found', 'wpdirectorykit')); ?>', 'error');
+ }
+ });
+ }
+ }).fail(function() {
+ wdk_log_notify('<?php echo esc_js(__('Google Geocoding API request failed.', 'wpdirectorykit')); ?>', 'error');
+ });
+ } else {
+ // If no API key, use Nominatim as fallback/only method
+ $.get('https://nominatim.openstreetmap.org/search?format=json&q=' + encodeURIComponent(address), function(data) {
+ if (data.length && typeof data[0]) {
+ var {
+ lat,
+ lon
+ } = data[0];
+ wdk_edit_map_marker.setLatLng([lat, lon]).update();
+ wdk_edit_map.panTo(new L.LatLng(lat, lon));
+ $('#input_lat').val(lat);
+ $('#input_lng').val(lon);
+ } else {
+ wdk_log_notify('<?php echo esc_js(__('Address not found', 'wpdirectorykit')); ?>', 'error');
+ if ($('#input_address').parent().find('[data-alert="google"]').length === 0) {
+ $('#input_address').parent().append(`<div class="alert alert-info" data-alert="google"><?php echo wdk_sprintf(
+ esc_html__('Address not found, try enter google maps api key for more accurate results %1$s[here]%2$s','wpdirectorykit'),
+ '<a target="_blank" href="'.esc_url(admin_url("admin.php?page=wdk_settings&wdk_tabs=wdk_tab_apis#wdk_geo_google_api_key")).'">','</a>'
+ );?></div>`);
+ }
+ return;
+ }
+ });
+ }
+
}, 1000);
});
--- a/wpdirectorykit/application/views/wdk_location/import_from_svg.php
+++ b/wpdirectorykit/application/views/wdk_location/import_from_svg.php
@@ -14,7 +14,7 @@
<div class="wrap wdk-wrap">
<h1 class="wp-heading-inline"><?php echo __('Location Management','wpdirectorykit'); ?></h1>
- <br /><br />
+ <br />
<div class="wdk-body">
<div class="postbox" style="display: block;">
<div class="postbox-header"><h3><?php echo __('Add/Edit Location','wpdirectorykit'); ?></h3>
--- a/wpdirectorykit/application/views/wdk_location/location_edit.php
+++ b/wpdirectorykit/application/views/wdk_location/location_edit.php
@@ -15,7 +15,7 @@
<div class="wrap wdk-wrap">
<h1 class="wp-heading-inline"><?php echo __('Location Management', 'wpdirectorykit'); ?></h1>
- <br /><br />
+ <br />
<div class="wdk-body">
<div class="postbox" style="display: block;">
<div class="postbox-header">
@@ -23,7 +23,7 @@
<?php if (function_exists('run_wdk_svg_map') && wmvc_show_data('idlocation', $db_data, false)): ?>
<a href="<?php echo esc_url(admin_url('admin.php?page=wdk_location&function=import_from_svg&id=' . wmvc_show_data('idlocation', $db_data, false))); ?>" class="wdk-mr-5 button button-secondary alignright">
- <span class="dashicons dashicons-admin-page" style="margin-top: 4px;"></span><?php echo esc_html__('Import sublocations from SVG Map', 'wpdirectorykit'); ?>
+ <span class="dashicons dashicons-admin-page" ></span><?php echo esc_html__('Import sublocations from SVG Map', 'wpdirectorykit'); ?>
</a>
<?php endif; ?>
</div>
--- a/wpdirectorykit/application/views/wdk_messages/edit.php
+++ b/wpdirectorykit/application/views/wdk_messages/edit.php
@@ -14,7 +14,7 @@
<!-- This file should primarily consist of HTML with a little bit of PHP. -->
<div class="wrap wdk-wrap">
<h1 class="wp-heading-inline"><?php echo __('View/Edit Messages', 'wpdirectorykit'); ?></h1>
- <br /><br />
+ <br />
<div class="wdk-body">
<form method="post" action="<?php echo esc_url(wmvc_current_edit_url()); ?>" enctype="multipart/form-data" novalidate="novalidate">
<?php wp_nonce_field('wdk-messages-edit_' . wmvc_show_data('idmessage', $db_data, 0), '_wpnonce'); ?>
--- a/wpdirectorykit/application/views/wdk_resultitem/resultitem_edit.php
+++ b/wpdirectorykit/application/views/wdk_resultitem/resultitem_edit.php
@@ -15,7 +15,7 @@
<div class="wrap wdk-wrap">
<h1 class="wp-heading-inline"><?php echo __('Result Card Designer','wpdirectorykit'); ?></h1>
-<br /><br />
+<br />
<div class="wdk-body">
<form method="post" action="<?php echo esc_url(wmvc_current_edit_url()); ?>" novalidate="novalidate">
--- a/wpdirectorykit/application/views/wdk_searchform/searchform_edit.php
+++ b/wpdirectorykit/application/views/wdk_searchform/searchform_edit.php
@@ -16,7 +16,7 @@
<div class="wrap wdk-wrap">
<h1 class="wp-heading-inline"><?php echo __('Search Form Designer','wpdirectorykit'); ?></h1>
- <br /><br />
+ <br />
<div class="wdk-body">
<form method="post" action="<?php echo esc_url(wmvc_current_edit_url()); ?>" novalidate="novalidate">
--- a/wpdirectorykit/application/views/wdk_settings/index.php
+++ b/wpdirectorykit/application/views/wdk_settings/index.php
@@ -28,16 +28,16 @@
<?php endif;?>
<div class="wdk-tabs-navs">
- <label for="wdk_tab_general"<?php if(!wmvc_show_data('wdk_tabs',$_POST, false) || wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_general'):?> class="active" <?php endif;?>><?php echo esc_html__('General','wpdirectorykit');?></label>
- <label for="wdk_tab_apis" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_apis'):?> class="active" <?php endif;?>><?php echo esc_html__('APIs','wpdirectorykit');?></label>
- <label for="wdk_tab_templates" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_templates'):?> class="active" <?php endif;?>><?php echo esc_html__('Layout','wpdirectorykit');?></label>
- <label for="wdk_tab_fields" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_fields'):?> class="active" <?php endif;?>><?php echo esc_html__('Fields','wpdirectorykit' );?></label>
- <label for="wdk_tab_tools" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_tools'):?> class="active" <?php endif;?>><?php echo esc_html__('Tools','wpdirectorykit' );?></label>
- <label for="wdk_tab_autosuggestion" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_autosuggestion'):?> class="active" <?php endif;?>><?php echo esc_html__('Autosuggestion','wpdirectorykit' );?></label>
+ <label for="wdk_tab_general"<?php if(!wmvc_show_data('wdk_tabs',$_REQUEST, false) || wmvc_show_data('wdk_tabs',$_REQUEST) == 'wdk_tab_general'):?> class="active" <?php endif;?>><?php echo esc_html__('General','wpdirectorykit');?></label>
+ <label for="wdk_tab_apis" <?php if(wmvc_show_data('wdk_tabs',$_REQUEST) == 'wdk_tab_apis'):?> class="active" <?php endif;?>><?php echo esc_html__('APIs','wpdirectorykit');?></label>
+ <label for="wdk_tab_templates" <?php if(wmvc_show_data('wdk_tabs',$_REQUEST) == 'wdk_tab_templates'):?> class="active" <?php endif;?>><?php echo esc_html__('Layout','wpdirectorykit');?></label>
+ <label for="wdk_tab_fields" <?php if(wmvc_show_data('wdk_tabs',$_REQUEST) == 'wdk_tab_fields'):?> class="active" <?php endif;?>><?php echo esc_html__('Fields','wpdirectorykit' );?></label>
+ <label for="wdk_tab_tools" <?php if(wmvc_show_data('wdk_tabs',$_REQUEST) == 'wdk_tab_tools'):?> class="active" <?php endif;?>><?php echo esc_html__('Tools','wpdirectorykit' );?></label>
+ <label for="wdk_tab_autosuggestion" <?php if(wmvc_show_data('wdk_tabs',$_REQUEST) == 'wdk_tab_autosuggestion'):?> class="active" <?php endif;?>><?php echo esc_html__('Autosuggestion','wpdirectorykit' );?></label>
<?php if(get_option('wdk_experimental_features')):?>
- <label for="wdk_tab_experimental" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_experimental'):?> class="active" <?php endif;?>><?php echo esc_html__('Experimental','wpdirectorykit' );?></label>
+ <label for="wdk_tab_experimental" <?php if(wmvc_show_data('wdk_tabs',$_REQUEST) == 'wdk_tab_experimental'):?> class="active" <?php endif;?>><?php echo esc_html__('Experimental','wpdirectorykit' );?></label>
<?php endif;?>
- <label for="wdk_tab_mails" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_mails'):?> class="active" <?php endif;?>><?php echo esc_html__('Emails','wpdirectorykit' );?></label>
+ <label for="wdk_tab_mails" <?php if(wmvc_show_data('wdk_tabs',$_REQUEST) == 'wdk_tab_mails'):?> class="active" <?php endif;?>><?php echo esc_html__('Emails','wpdirectorykit' );?></label>
<?php do_action('wpdirectorykit/admin/settings/page/tabs', $db_data);?>
</div>
@@ -49,39 +49,39 @@
<?php echo wdk_generate_fields($fields_list_tabs['general'], $db_data); ?>
</div>
- <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_apis" value="wdk_tab_apis" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_apis'):?> checked="checked" <?php endif;?>>
+ <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_apis" value="wdk_tab_apis" <?php if(wmvc_show_data('wdk_tabs',$_REQUEST) == 'wdk_tab_apis'):?> checked="checked" <?php endif;?>>
<div class="wdk-tab">
<?php echo wdk_generate_fields($fields_list_tabs['apis'], $db_data); ?>
</div>
- <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_templates" value="wdk_tab_templates" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_templates'):?> checked="checked" <?php endif;?>>
+ <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_templates" value="wdk_tab_templates" <?php if(wmvc_show_data('wdk_tabs',$_REQUEST) == 'wdk_tab_templates'):?> checked="checked" <?php endif;?>>
<div class="wdk-tab">
<?php echo wdk_generate_fields($fields_list_tabs['templates'], $db_data); ?>
</div>
- <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_fields" value="wdk_tab_fields" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_fields'):?> checked="checked" <?php endif;?>>
+ <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_fields" value="wdk_tab_fields" <?php if(wmvc_show_data('wdk_tabs',$_REQUEST) == 'wdk_tab_fields'):?> checked="checked" <?php endif;?>>
<div class="wdk-tab">
<?php echo wdk_generate_fields($fields_list_tabs['fields'], $db_data); ?>
</div>
<?php if(get_option('wdk_experimental_features')):?>
- <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_experimental" value="wdk_tab_experimental" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_experimental'):?> checked="checked" <?php endif;?>>
+ <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_experimental" value="wdk_tab_experimental" <?php if(wmvc_show_data('wdk_tabs',$_REQUEST) == 'wdk_tab_experimental'):?> checked="checked" <?php endif;?>>
<div class="wdk-tab">
<?php echo wdk_generate_fields($fields_list_tabs['experimental'], $db_data); ?>
</div>
<?php endif;?>
- <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_tools" value="wdk_tab_tools" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_tools'):?> checked="checked" <?php endif;?>>
+ <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_tools" value="wdk_tab_tools" <?php if(wmvc_show_data('wdk_tabs',$_REQUEST) == 'wdk_tab_tools'):?> checked="checked" <?php endif;?>>
<div class="wdk-tab">
<?php $this->view('wdk_settings/tabs/tab_tools', $data); ?>
</div>
- <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_autosuggestion" value="wdk_tab_autosuggestion" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_autosuggestion'):?> checked="checked" <?php endif;?>>
+ <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_autosuggestion" value="wdk_tab_autosuggestion" <?php if(wmvc_show_data('wdk_tabs',$_REQUEST) == 'wdk_tab_autosuggestion'):?> checked="checked" <?php endif;?>>
<div class="wdk-tab">
<?php echo wdk_generate_fields($fields_list_tabs['autosuggestion'], $db_data); ?>
</div>
- <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_mails" value="wdk_tab_mails" <?php if(wmvc_show_data('wdk_tabs',$_POST) == 'wdk_tab_mails'):?> checked="checked" <?php endif;?>>
+ <input type="radio" class="wdk-tab-input" name="wdk_tabs" id="wdk_tab_mails" value="wdk_tab_mails" <?php if(wmvc_show_data('wdk_tabs',$_REQUEST) == 'wdk_tab_mails'):?> checked="checked" <?php endif;?>>
<div class="wdk-tab">
<?php $this->view('wdk_settings/tabs/tab_emails', $data); ?>
</div>
--- a/wpdirectorykit/application/views/wdk_settings/tabs/tab_tools.php
+++ b/wpdirectorykit/application/views/wdk_settings/tabs/tab_tools.php
@@ -1,7 +1,7 @@
<div class="wdk-field-edit">
<a href="<?php echo esc_url(get_admin_url() . "admin.php?page=wdk_settings&function=remove&_wpnonce=".wp_create_nonce( 'remove-data')); ?>"
class="button button-primary event-ajax-indicator confirm" id="reset_data_field_button"><?php echo __('Remove plugin data (Listings, fields, location, categories)','wpdirectorykit'); ?></a>
- <span class="wdk-ajax-indicator wdk-infinity-load color-primary dashicons dashicons-update-alt hidden" style="margin-top: 4px;margin-left: 4px;"></span>
+ <span class="wdk-ajax-indicator wdk-infinity-load color-primary dashicons dashicons-update-alt hidden" style="margin-left: 4px;"></span>
</div>
<div class="wdk-field-edit">
<a href="<?php echo esc_url(get_admin_url() . "admin.php?page=wdk_settings&function=import_demo"); ?>" class="button button-primary" id="import_demo_field_button"><?php echo __('Import Demo Data','wpdirectorykit'); ?></a>
--- a/wpdirectorykit/elementor-elements/classes/wdk-locations-grid-cover.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-locations-grid-cover.php
@@ -165,7 +165,7 @@
} else {
$where = array();
if (!empty($this->data['settings']['conf_order_by'])) {
- $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
+ $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order']);
}
if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
--- a/wpdirectorykit/elementor-elements/classes/wdk-locations-grid.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-locations-grid.php
@@ -151,14 +151,12 @@
} else {
$order_by = NULL;
if(!empty($this->data['settings']['conf_order_by']))
- $order_by = $this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order'];
-
+ $order_by = wdk_esc_sql($this->data['settings']['conf_order_by'].' '.$this->data['settings']['conf_order']);
$where = array();
if (!empty($this->data['settings']['only_root_enable']) && $this->data['settings']['only_root_enable'] == 'yes') {
$where['('.$this->WMVC->{$controller.'_m'}->_table_name.'.level = 0)'] = NULL;
}
$this->data['results'] = $this->WMVC->{$controller.'_m'}->get_pagination((!empty($this->data['settings']['conf_limit'])) ? $this->data['settings']['conf_limit'] : NULL, NULL, $where, $order_by);
-
}
$this->data['is_edit_mode']= false;
--- a/wpdirectorykit/elementor-elements/classes/wdk-search.php
+++ b/wpdirectorykit/elementor-elements/classes/wdk-search.php
@@ -249,6 +249,18 @@
],
]
);
+
+ $this->add_control(
+ 'section_more_before_buttons',
+ [
+ 'label' => __( 'Show Additional Fields Before Search Buttons', 'wpdirectorykit' ),
+ 'type' => Controls_Manager::SWITCHER,
+ 'label_on' => __( 'Yes', 'wpdirectorykit' ),
+ 'label_off' => __( 'None', 'wpdirectorykit' ),
+ 'return_value' => 'yes',
+ 'default' => '',
+ ]
+ );
$this->add_control(
'section_config_more_limit',
--- a/wpdirectorykit/elementor-elements/views/wdk-field-value.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-field-value.php
@@ -116,7 +116,7 @@
<?php if (wmvc_show_data('text_limit_worlds', $settings)): ?>
<?php echo (wp_strip_all_tags(html_entity_decode(wp_trim_words($field_value, $settings['text_limit_worlds'], '...')))); ?>
<?php else: ?>
- <?php echo wp_kses_post(wdk_filter_decimal($field_value)); ?>
+ <?php echo wp_kses_post(wp_unslash(wdk_filter_decimal($field_value))); ?>
<?php endif; ?>
</span>
<span class='suffix'><?php echo esc_html($field_suffix); ?></span>
@@ -134,7 +134,7 @@
<?php if (wmvc_show_data('text_limit_worlds', $settings)): ?>
<?php echo (wp_strip_all_tags(html_entity_decode(wp_trim_words($field_value, $settings['text_limit_worlds'], '...')))); ?>
<?php else: ?>
- <?php echo wp_kses_post(wdk_filter_decimal($field_value)); ?>
+ <?php echo wp_kses_post(wp_unslash(wdk_filter_decimal($field_value))); ?>
<?php endif; ?>
</span>
<?php endif; ?>
--- a/wpdirectorykit/elementor-elements/views/wdk-search.php
+++ b/wpdirectorykit/elementor-elements/views/wdk-search.php
@@ -68,6 +68,14 @@
):?>
ajax_results_enabled
<?php endif;?>
+ <?php if
+ (
+ isset($settings['section_more_before_buttons']) && $settings['section_more_before_buttons'] == 'yes'
+ ):?>
+ section_more_before_buttons
+ <?php endif;?>
+
+ wdk-form-additional
">
<form data-current-link="<?php echo esc_url($current_url);?>" data-scrollto="<?php echo esc_attr(wmvc_show_data('search_scroll', $settings));?>" class="wdk-search-form wdk-skip-empty
<?php if(wmvc_show_data('auto_search_enable', $settings) == 'yes'):?> auto_search <?php endif;?>
--- a/wpdirectorykit/elementor-extensions/class-ajax-handler.php
+++ b/wpdirectorykit/elementor-extensions/class-ajax-handler.php
@@ -563,7 +563,7 @@
$ret = wdk_mail(wdk_show_data('user_email', $data_message['user'], '' , TRUE, TRUE), __('Reservation approved, waiting for payment', 'wpdirectorykit'), $data_message, 'reservation_approved_visitor');
$ret = wdk_mail(wdk_show_data('user_email', $data_message['user_owner'], '' , TRUE, TRUE), __('New Reservation approved, please confirm as paid when you receive payment', 'wpdirectorykit'), $data_message, 'reservation_approved_owner');
-
+ $ret =false;
if( $ret) {
add_filter( 'eli/ajax-handler/filter_output', function($filter_output) {
$filter_output['message'] = '<div class="elementinvader_addons_for_elementor_alert elementinvader_addons_for_elementor_alert-success" role="alert">'.esc_html__('Reservation sent, please check your email with payment details', 'wpdirectorykit').'</div>';
@@ -573,7 +573,11 @@
else
{
add_filter( 'eli/ajax-handler/filter_output', function($filter_output) {
- $filter_output['message'] = '<div class="elementinvader_addons_for_elementor_alert elementinvader_addons_for_elementor_alert-danger" role="alert">'.esc_html__('Server can't send emails, please use SMTP mail configuration.', 'wpdirectorykit').'</div>';
+ $filter_output['message'] = '<div class="elementinvader_addons_for_elementor_alert elementinvader_addons_for_elementor_alert-danger" role="alert">'. sprintf(
+ esc_html__('Server can't send emails, please use SMTP mail configuration. Check %1$sGuide%2$s', 'wpdirectorykit'),
+ '<a href="https://wpdirectorykit.com/e-mail-sending-issues-smtp-mail-configuration/" target="_blank" style="text-decoration: underline">',
+ '</a>'
+ ).'</div>';
$filter_output['no_clear_from'] = true;
return $filter_output;
} );
@@ -661,7 +665,7 @@
/* waiting approve to client */
$ret = wdk_mail(wdk_show_data('user_email', $user_client, '' , TRUE, TRUE), __('Your reservation waiting approvement by owner', 'wpdirectorykit'), $data_message, 'reservation_waiting_for_approve_visitor');
-
+ $ret =false;
if( $ret) {
add_filter( 'eli/ajax-handler/filter_output', function($filter_output){
$filter_output['message'] = '<div class="elementinvader_addons_for_elementor_alert elementinvader_addons_for_elementor_alert-success" role="alert">'.esc_html__('Thanks on reservation, after owner approvement you will receive details for payment', 'wpdirectorykit').'</div>';
@@ -671,7 +675,11 @@
else
{
add_filter( 'eli/ajax-handler/filter_output', function($filter_output) {
- $filter_output['message'] = '<div class="elementinvader_addons_for_elementor_alert elementinvader_addons_for_elementor_alert-danger" role="alert">'.esc_html__('Server can't send emails, please use SMTP mail configuration.', 'wpdirectorykit').'</div>';
+ $filter_output['message'] = '<div class="elementinvader_addons_for_elementor_alert elementinvader_addons_for_elementor_alert-danger" role="alert">'. sprintf(
+ esc_html__('Server can't send emails, please use SMTP mail configuration. Check %1$sGuide%2$s', 'wpdirectorykit'),
+ '<a href="https://wpdirectorykit.com/e-mail-sending-issues-smtp-mail-configuration/" target="_blank" style="text-decoration: underline">',
+ '</a>'
+ ).'</div>';
$filter_output['no_clear_from'] = true;
return $filter_output;
} );
@@ -778,6 +786,7 @@
}
$ret = wdk_mail($owner_email, $message_title, $data_message, 'new_message', '', NULL, $email);
+ $ret =false;
if( $ret) {
add_filter( 'eli/ajax-handler/filter_output', function($filter_output){
$filter_output['message'] = '<div class="elementinvader_addons_for_elementor_alert elementinvader_addons_for_elementor_alert-success" role="alert">'.esc_html__('Thanks for the message.', 'wpdirectorykit').'</div>';
@@ -793,7 +802,15 @@
else
{
add_filter( 'eli/ajax-handler/filter_output', function($filter_output) {
- $filter_output['message'] = '<div class="elementinvader_addons_for_elementor_alert elementinvader_addons_for_elementor_alert-danger" role="alert">'.esc_html__('Server can't send emails, please use SMTP mail configuration.', 'wpdirectorykit').'</div>';
+ $filter_output['message'] = '<div class="elementinvader_addons_for_elementor_alert elementinvader_addons_for_elementor_alert-danger" role="alert">'.
+ sprintf(
+ esc_html__('Server can't send emails, please use SMTP mail configuration. Check %1$sGuide%2$s', 'wpdirectorykit'),
+ '<a href="https://wpdirectorykit.com/e-mail-sending-issues-smtp-mail-configuration/" target="_blank" style="text-decoration: underline">',
+ '</a>'
+ )
+ .'</div>';
+
+
$filter_output['success'] = false;
$filter_output['no_clear_from'] = true;
return $filter_output;
--- a/wpdirectorykit/extensions/wdk-dependfields.php
+++ b/wpdirectorykit/extensions/wdk-dependfields.php
@@ -99,7 +99,7 @@
<?php echo __('Visible fields','wpdirectorykit'); ?>
</h3>
<a href="#" class="wdk-mr-5 button button-secondary wdk_copy_on_subcategories" data-category="<?php echo esc_attr(wmvc_show_data('idcategory', $data));?>" data-wpnonce="<?php echo wp_create_nonce('wdk_depend_copy_on_subcategories');?>">
- <span class="dashicons dashicons-admin-page" style="margin-top: 4px;"></span> <?php echo __('Copy on subcategories','wpdirectorykit'); ?>
+ <span class="dashicons dashicons-admin-page"></span> <?php echo __('Copy on subcategories','wpdirectorykit'); ?>
</a>
</div>
<div class="inside">
--- a/wpdirectorykit/filters.php
+++ b/wpdirectorykit/filters.php
@@ -433,7 +433,7 @@
if(!empty($_GET['field_search'])) {
global $Winter_MVC_WDK;
$Winter_MVC_WDK->model('location_m');
- $location = $Winter_MVC_WDK->location_m->get_by(array('location_title'=>sanitize_text_field(wp_unslash($_GET['field_search']))), TRUE);
+ $location = $Winter_MVC_WDK->location_m->get_by(array('location_title'=>wdk_esc_sql(sanitize_text_field(wp_unslash($_GET['field_search'])))), TRUE);
if($location) {
$url = $_SERVER["HTTP_HOST"] . $_SERVER["REQUEST_URI"];
@@ -448,7 +448,7 @@
$new_url = (isset($_SERVER['HTTPS']) && $_SERVER['HTTPS'] === 'on' ? "https" : "http").'://'.$clear_link.'?'.http_build_query($string_par);
wp_redirect($new_url);
exit;
- }
+ }
}
@@ -834,4 +834,12 @@
update_user_meta(get_current_user_id(), '_wdk_admin_popup_closed', time());
wp_die();
+});
+
+
+add_filter('body_class', function($classes) {
+ if (get_option('wdk_disable_outline_on_focus')) {
+ $classes[] = 'wdk_disable_outline_on_focus';
+ }
+ return $classes;
});
No newline at end of file
--- a/wpdirectorykit/includes/class-wpdirectorykit.php
+++ b/wpdirectorykit/includes/class-wpdirectorykit.php
@@ -164,6 +164,9 @@
// Load Blocks
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'blocks/blocks-init.php';
+ // Load Blocks
+ require_once plugin_dir_path( dirname( __FILE__ ) ) . 'rest_api.php';
+
$this->loader = new Wpdirectorykit_Loader();
//global $Winter_MVC;
--- a/wpdirectorykit/rest_api.php
+++ b/wpdirectorykit/rest_api.php
@@ -0,0 +1,59 @@
+<?php
+
+if ( ! defined( 'ABSPATH' ) ) {
+ exit; // Exit if accessed directly.
+}
+
+add_action('rest_api_init', function () {
+ register_rest_route('wdk/v1', '/listing/autosuggestion', [
+ 'methods' => 'POST',
+ 'callback' => 'wdk_listing_search_rest_callback',
+ 'permission_callback' => function () {
+ return current_user_can('edit_posts');
+ },
+ ]);
+});
+
+function wdk_listing_search_rest_callback($request)
+{
+ $params = $request->get_json_params();
+ $keyword = '';
+
+ if ($params && isset($params['keyword'])) {
+ $keyword = sanitize_text_field($params['keyword']);
+ }
+
+ if (strlen($keyword) < 2) {
+ return rest_ensure_response([
+ 'success' => true,
+ 'data' => []
+ ]);
+ }
+
+ $args = [
+ 'post_type' => 'wdk-listing',
+ 'posts_per_page' => 10,
+ 's' => $keyword,
+ ];
+
+ // Optionally exclude the currently executed ID if provided
+ if (isset($params['executedId'])) {
+ $args['post__not_in'] = [intval($params['executedId'])];
+ }
+
+ $posts = get_posts($args);
+
+ $result = [];
+ foreach ($posts as $post) {
+ $result[] = [
+ 'id' => $post->ID,
+ 'title' => $post->post_title,
+ 'edit' => urlencode(admin_url('admin.php?page=wdk_listing&id=' . $post->ID)),
+ ];
+ }
+
+ return rest_ensure_response([
+ 'success' => true,
+ 'data' => $result
+ ]);
+}
--- a/wpdirectorykit/shortcodes/shortcode-wdk-listing-field-value.php
+++ b/wpdirectorykit/shortcodes/shortcode-wdk-listing-field-value.php
@@ -45,6 +45,15 @@
$data['field_value'] = '';
$data['field_prefix'] = '';
$data['field_suffix'] = '';
+
+ /* protect check */
+ if(in_array($data['settings']['field_id'], ['post_password', 'status']) ) {
+ return false;
+ }
+ if(wdk_field_option($data['settings']['field_id'], 'is_visible_frontend') != 1) {
+ return false;
+ }
+
if(!empty($data['settings']['field_id'])){
if(strpos($data['settings']['field_id'],'__') !== FALSE){
$data['settings']['field_id'] = substr($data['settings']['field_id'], strpos($data['settings']['field_id'],'__')+2);
--- a/wpdirectorykit/vendor/Winter_MVC/core/helpers.php
+++ b/wpdirectorykit/vendor/Winter_MVC/core/helpers.php
@@ -1152,7 +1152,7 @@
$data = preg_replace('#</*w+:w[^>]*+>#i', '', $data);
$data = preg_replace("/(b1=1b|) ORb)/", "", $data);
$data = preg_replace("/alert(/", "", $data);
-
+
do
{
// Remove really unwanted tags
@@ -1408,9 +1408,6 @@
//exit(curl_error($ch));
}
- // Closes a cURL session and frees all resources
- curl_close($ch);
-
// Close file
fclose($fp);
@@ -1463,7 +1460,6 @@
// EXECUTE:
$result = curl_exec($curl);
if(!$result){return FALSE;}
- curl_close($curl);
return $result;
}
--- a/wpdirectorykit/vendor/Winter_MVC/init.php
+++ b/wpdirectorykit/vendor/Winter_MVC/init.php
@@ -3,13 +3,13 @@
/**
* Winter_MVC library
*
- * @version 3.4
+ * @version 3.7
*
* @author SWIT
* @link https://github.com/sandiwinter/winter_mvc
*/
-$Winter_MVC_version_this = 3.4;
+$Winter_MVC_version_this = 3.7;
global $Winter_MVC;
--- a/wpdirectorykit/wpdirectorykit.php
+++ b/wpdirectorykit/wpdirectorykit.php
@@ -16,7 +16,7 @@
* Plugin Name: WP Directory Kit
* Plugin URI: https://wpdirectorykit.com/plugins/wpdirectorykit.html
* Description: Build your Directory portal, demos for Real Estate Agencies and Car Dealership included
- * Version: 1.5.4
+ * Version: 1.5.5
* Requires PHP: 7.0
* Author: wpdirectorykit.com
* Author URI: https://wpdirectorykit.com
@@ -25,8 +25,8 @@
* Text Domain: wpdirectorykit
* Domain Path: /languages
*
- * Elementor tested up to: 3.33.1
- * Elementor Pro tested up to: 3.23.2
+ * Elementor tested up to: 4.2.1
+ * Elementor Pro tested up to: 4.3.1
*
* Copyright (C) SWIT Sandi Winter IT.
*
@@ -42,7 +42,7 @@
* Start at version 1.0.0 and use SemVer - https://semver.org
* Rename this for your plugin and update it as you release new versions.
*/
-define('WPDIRECTORYKIT_VERSION', '1.5.4');
+define('WPDIRECTORYKIT_VERSION', '1.5.5');
define('WPDIRECTORYKIT_NAME', 'wdk');
define('WPDIRECTORYKIT_PATH', plugin_dir_path(__FILE__));
define('WPDIRECTORYKIT_URL', plugin_dir_url(__FILE__));