=== Simple Bike Rental ===
Contributors: rodolforizzo76
Tags: bike, rental, booking, calendar, reservations
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.0.7
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A simple and lightweight plugin to manage bike rentals with daily and hourly bookings.

== Description ==
Simple Bike Rental is the ideal solution for small businesses, tour operators or rental services that need a fast and user-friendly system to manage bicycle bookings.

**Main features:**

* Add and manage bikes from the backend
* Daily and hourly booking modes
* Availability calendar in the admin panel
* Frontend booking form with AJAX validation
* Email notifications for admin and customers
* No complicated setups, no third-party dependencies

Just install, configure, and start receiving bookings!

Read the [full documentation](https://www.simplebikerental.com/) to explore all features and configuration options.

== Installation ==

1. Upload the plugin files to the `/wp-content/plugins/simple-bike-rental` directory, or install the plugin directly through the WordPress **Plugins > Add New** screen.
2. Activate the plugin via the **Plugins** menu in WordPress.
3. Go to **Bike Rental** in the admin menu to add your bikes and manage bookings.
4. To display the booking form on the frontend, add the shortcode `[simpbire_bike_rental]` to any post or page.
5. In the page selected in the plugin settings for confirmation messages, add these shortcodes:
   * `[simpbire_token_messages]` – Displays confirmation or error messages after a user confirms a booking.
   * `[simpbire_pending_confirmation]` – Shows a pending confirmation message if the booking hasn’t been confirmed yet.

== Usage ==

To display the booking form on the frontend, use the following shortcode:

[simpbire_bike_rental]

You can add this shortcode to any post or page. The form will automatically load available bikes and booking options based on your settings.

**Tip:** Create a dedicated page (e.g. "Book a Bike") and place the shortcode there for easy access by your visitors.

== Frequently Asked Questions ==
= Can I offer both daily and hourly bookings? =
Yes! You can set the booking type dynamically when users choose dates on the frontend form.

= Are payments supported? =
The free version does not include payments. A Pro version with Stripe integration is available.

= Can I customize the styles? =
Yes, the plugin includes minimal CSS. You can override it with your theme or custom styles.

== Screenshots ==

1. Bicycle Management – Admin interface for managing bikes.
2. Add New Bike – Form to add a new bicycle from the backend.
3. Edit Bicycle – Edit details of an existing bike.
4. Add Booking (Admin) – Manual booking form for admin use.
5. Bookings Page (FullCalendar) – Calendar view of bookings.
6. Bookings Page (Table View) – Tabular view of all bookings.
7. Bookings Modal (FullCalendar) – Click to view/edit bookings.
8. Notification Page – Email templates management.
9. Edit Notification – Customize notification content.
10. Setting Page – Configure plugin options and preferences.
11. Frontend booking form

== Changelog ==
= 1.0.7 =
* Added capability and nonce verification to the admin calendar bookings AJAX endpoint, ensuring requests include a valid nonce and proper permissions.

= 1.0.6 =
* Confirmed compatibility with WordPress 6.9. No code changes.

= 1.0.5 =
* Improved redirect security (wp_safe_redirect and nonce checks).
* Improved price handling in the availability results: bicycles now display the correct rental cost directly on each card, using hourly or daily rates based on the selected rental type.
* Added currency symbol support, including a reusable helper that respects the option used in the Pro version and remains fully filterable.
* Introduced a new currency selector in the general settings, with validation of supported values and full compatibility with future Pro features.
* Updated the frontend grid layout to highlight the new price row for better clarity and user experience.
* Ensured the selected currency symbol is correctly applied when calculating and returning prices in the frontend availability AJAX response.
* Added a styled confirmation button in the booking confirmation email, replacing the plain link for a clearer and more user-friendly experience.

= 1.0.4 =
* Corrected use of the `wp_mail_content_type` filter in `simpbire_invia_notifica`: replaced the anonymous closure with a named callback (`simpbire_set_html_mail_content_type`) and removed the filter using the same reference, preventing the `text/html` content type from persisting for subsequent emails.
* Fixed the incorrect `remove_filter('wp_mail_content_type', '__return_true')`, which did not remove the actually registered callback.

= 1.0.3 =
* Added CSV export feature to download reservations filtered by status, rental type, and date range.

= 1.0.2 =  
* Confirmation emails are now sent in HTML format instead of plain text, providing improved formatting and clickable links.  
* Added filters `simpbire_email_subject` and `simpbire_email_message` to allow developers to customize the subject and content of confirmation emails.  
* Minor formatting adjustments in email content to prevent multi-line link display in some email clients.

= 1.0.1 =  
* Corrected all plugin strings to use English as the original language (required for proper translation on WordPress.org).  
* Updated the `.pot` file accordingly.

= 1.0.0 =  
* Initial stable release.  
* Added `created_at` column to the `simpbire_reservations` table for better tracking of reservation creation time.  
* Prepared code alignment with the Pro version.  
* Admin interface to manage bicycles and reservations.  
* Frontend booking form with hourly and daily options.  
* Calendar integration to show bike availability.  
* Dynamic bike availability based on selected dates.  
* Email notifications for both users and admins.  
* Localization-ready strings for translations.

== Upgrade Notice ==

= [1.0.7] =
Security update: restricts access to the admin calendar bookings AJAX endpoint and requires a valid nonce, preventing low-privileged users from accessing booking data. Updating is strongly recommended.

= [1.0.6] =
Confirmed compatibility with WordPress 6.9. No code changes.


= [1.0.5] =
This update improves security and enhances price display in the booking form. We recommend updating to benefit from the latest fixes.

= [1.0.4] =
Fix: Properly apply and remove wp_mail_content_type in simpbire_invia_notifica via a named callback, preventing text/html from persisting; replaced incorrect remove_filter('__return_true') with correct callback removal.

= 1.0.3 =
Added CSV export feature to download reservations filtered by status, rental type, and date range.

= 1.0.2 =
Improves the confirmation email by sending it in HTML format and adds filters to customize the email content. Recommended update for better user experience.

= 1.0.1 =
Fixes translation support by setting English as the source language. Important for multilingual sites.

= 1.0.0 =
First stable release of Simple Bike Rental.

== Links ==
For more information, support, or to unlock online payments and advanced features, visit:
https://www.simplebikerental.com
