Initial plugin setup (v0.0.1)
All checks were successful
Create Release Package / build-release (push) Successful in 1m21s

- Main plugin file with PHP 8.3+ and WordPress 6.0+ version checks
- Plugin singleton class with admin menu and settings pages
- License Manager integration with SecureLicenseClient
- License settings tab with validation and activation
- Admin CSS and JavaScript for license management
- Gitea CI/CD workflow for automated releases
- Documentation: README.md, PLAN.md, CHANGELOG.md, CLAUDE.md
- Composer dependencies: Twig 3.0, license client
- Git submodule for wc-licensed-product-client library

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-31 13:15:13 +01:00
commit d36b6c3dd9
18 changed files with 3615 additions and 0 deletions

81
assets/css/admin.css Normal file
View File

@@ -0,0 +1,81 @@
/**
* WP BnB Admin Styles
*
* @package Magdev\WpBnb
*/
/* Dashboard */
.wp-bnb-dashboard {
background: #fff;
border: 1px solid #c3c4c7;
border-radius: 4px;
padding: 20px;
margin-top: 20px;
}
/* License Status Badge */
.wp-bnb-license-status {
display: inline-flex;
align-items: center;
gap: 5px;
font-weight: 600;
}
.wp-bnb-license-status .dashicons {
font-size: 18px;
width: 18px;
height: 18px;
}
/* License Message */
#wp-bnb-license-message {
margin: 15px 0;
padding: 12px 15px;
border-radius: 4px;
}
#wp-bnb-license-message.success {
background: #d4edda;
border: 1px solid #c3e6cb;
color: #155724;
}
#wp-bnb-license-message.error {
background: #f8d7da;
border: 1px solid #f5c6cb;
color: #721c24;
}
/* Spinner */
#wp-bnb-license-spinner {
float: none;
margin-left: 10px;
}
/* Settings Tabs */
.nav-tab-wrapper {
margin-bottom: 20px;
}
.tab-content {
background: #fff;
border: 1px solid #c3c4c7;
border-top: none;
padding: 20px;
}
/* Form Tables */
.form-table th {
width: 200px;
}
/* Submit Buttons */
.submit {
display: flex;
align-items: center;
gap: 10px;
}
.submit .button {
margin: 0;
}

7
assets/css/frontend.css Normal file
View File

@@ -0,0 +1,7 @@
/**
* WP BnB Frontend Styles
*
* @package Magdev\WpBnb
*/
/* Placeholder - Frontend styles will be added as features are implemented */

99
assets/js/admin.js Normal file
View File

@@ -0,0 +1,99 @@
/**
* WP BnB Admin JavaScript
*
* @package Magdev\WpBnb
*/
(function($) {
'use strict';
/**
* Initialize license management functionality.
*/
function initLicenseManagement() {
var $validateBtn = $('#wp-bnb-validate-license');
var $activateBtn = $('#wp-bnb-activate-license');
var $spinner = $('#wp-bnb-license-spinner');
var $message = $('#wp-bnb-license-message');
if (!$validateBtn.length) {
return;
}
// Validate license button click.
$validateBtn.on('click', function(e) {
e.preventDefault();
performLicenseAction('wp_bnb_validate_license', wpBnbAdmin.i18n.validating);
});
// Activate license button click.
$activateBtn.on('click', function(e) {
e.preventDefault();
performLicenseAction('wp_bnb_activate_license', wpBnbAdmin.i18n.activating);
});
/**
* Perform a license AJAX action.
*
* @param {string} action AJAX action name.
* @param {string} loadingText Loading text to display.
*/
function performLicenseAction(action, loadingText) {
// Disable buttons and show spinner.
$validateBtn.prop('disabled', true);
$activateBtn.prop('disabled', true);
$spinner.addClass('is-active');
$message.hide();
$.ajax({
url: wpBnbAdmin.ajaxUrl,
type: 'POST',
data: {
action: action,
nonce: wpBnbAdmin.nonce
},
success: function(response) {
$spinner.removeClass('is-active');
$validateBtn.prop('disabled', false);
$activateBtn.prop('disabled', false);
if (response.success) {
showMessage('success', response.data.message);
// Reload page after short delay to show updated status.
setTimeout(function() {
window.location.reload();
}, 1500);
} else {
showMessage('error', response.data.message || wpBnbAdmin.i18n.error);
}
},
error: function() {
$spinner.removeClass('is-active');
$validateBtn.prop('disabled', false);
$activateBtn.prop('disabled', false);
showMessage('error', wpBnbAdmin.i18n.error);
}
});
}
/**
* Show a message.
*
* @param {string} type Message type (success or error).
* @param {string} message Message text.
*/
function showMessage(type, message) {
$message
.removeClass('success error')
.addClass(type)
.text(message)
.fadeIn();
}
}
// Initialize on document ready.
$(document).ready(function() {
initLicenseManagement();
});
})(jQuery);

12
assets/js/frontend.js Normal file
View File

@@ -0,0 +1,12 @@
/**
* WP BnB Frontend JavaScript
*
* @package Magdev\WpBnb
*/
(function() {
'use strict';
// Placeholder - Frontend scripts will be added as features are implemented
})();