Release v0.6.1 - Bug fixes and enhancements
All checks were successful
Create Release Package / build-release (push) Successful in 1m1s

New Features:
- Auto-update system with configurable check frequency
- Updates tab in settings with manual check button
- Localhost development mode bypasses license validation
- Extended general settings (address, contact, social media)
- Pricing settings split into subtabs
- Guest ID/passport encryption using AES-256-CBC
- Guest auto-creation from booking form

Bug Fixes:
- Fixed Booking admin issues with auto-draft status
- Fixed guest dropdown loading in booking form
- Fixed booking history display on Guest edit page
- Fixed service pricing meta box (Gutenberg hiding meta boxes)

Changes:
- Admin submenu reordered for better organization
- Booking title shows guest name and dates (room removed)
- Service, Guest, Booking use classic editor (not Gutenberg)
- Settings tabs flush with content (no gap)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-02-03 15:18:27 +01:00
parent c17dd53c5a
commit 13ba264431
11 changed files with 1699 additions and 173 deletions

View File

@@ -91,6 +91,91 @@
}
}
/**
* Initialize update check functionality.
*/
function initUpdateCheck() {
var $checkBtn = $('#wp-bnb-check-updates');
var $spinner = $('#wp-bnb-update-spinner');
var $message = $('#wp-bnb-update-message');
var $latestVersion = $('#wp-bnb-latest-version');
var $lastCheck = $('#wp-bnb-update-last-check');
if (!$checkBtn.length) {
return;
}
$checkBtn.on('click', function(e) {
e.preventDefault();
// Disable button and show spinner.
$checkBtn.prop('disabled', true);
$spinner.addClass('is-active');
$message.hide();
$.ajax({
url: wpBnbAdmin.ajaxUrl,
type: 'POST',
data: {
action: 'wp_bnb_check_updates',
nonce: wpBnbAdmin.nonce
},
success: function(response) {
$spinner.removeClass('is-active');
$checkBtn.prop('disabled', false);
if (response.success) {
var data = response.data;
// Update last check time.
$lastCheck.text(wpBnbAdmin.i18n.justNow || 'Just now');
// Update version display.
if (data.update_available) {
$latestVersion.html(
'<span style="color: #00a32a; font-weight: 600;">' +
data.latest_version +
'</span> ' +
'<span class="dashicons dashicons-yes" style="color: #00a32a;"></span> ' +
'<em>' + (wpBnbAdmin.i18n.updateAvailable || 'Update available!') + '</em>'
);
showUpdateMessage('success', data.message);
} else {
$latestVersion.html(
data.latest_version +
' <span style="color: #646970;">' +
(wpBnbAdmin.i18n.upToDate || '(You are up to date)') +
'</span>'
);
showUpdateMessage('success', data.message);
}
} else {
showUpdateMessage('error', response.data.message || wpBnbAdmin.i18n.error);
}
},
error: function() {
$spinner.removeClass('is-active');
$checkBtn.prop('disabled', false);
showUpdateMessage('error', wpBnbAdmin.i18n.error);
}
});
});
/**
* Show an update message.
*
* @param {string} type Message type (success or error).
* @param {string} message Message text.
*/
function showUpdateMessage(type, message) {
$message
.removeClass('success error')
.addClass(type)
.text(message)
.fadeIn();
}
}
/**
* Initialize room gallery functionality.
*/
@@ -768,7 +853,7 @@
return;
}
$pricingTypeInputs.on('change', function() {
function updatePriceRowVisibility() {
var pricingType = $('input[name="bnb_service_pricing_type"]:checked').val();
if (pricingType === 'included') {
@@ -784,7 +869,12 @@
$priceDescription.text(wpBnbAdmin.i18n.perBookingDescription || 'This price will be charged once for the booking.');
}
}
});
}
$pricingTypeInputs.on('change', updatePriceRowVisibility);
// Set initial visibility state on page load.
updatePriceRowVisibility();
}
/**
@@ -937,6 +1027,7 @@
// Initialize on document ready.
$(document).ready(function() {
initLicenseManagement();
initUpdateCheck();
initRoomGallery();
initPricingSettings();
initSeasonForm();