﻿=== Shibhu Matrimony ===
Contributors: shibhuplugins
Tags: matrimonial, marriage, profiles, matchmaking, directory
Requires at least: 5.8
Tested up to: 6.9
Requires PHP: 7.4
Stable tag: 1.2.1
License: GPLv2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html

A comprehensive matrimonial platform for WordPress with profile management, advanced search, admin reports, and a secure front-end submission form.

== Description ==

**Shibhu Matrimony** turns any WordPress site into a fully featured matrimonial platform. Members can submit detailed biodata profiles from the front end, browse and filter listings, and manage their own profiles — all without leaving your website.

Administrators get a dedicated dashboard with real-time statistics and a timestamped activity log so they always know what is happening on the platform.

= Key Features =

**Profile Management**

* Custom post type (`mmatr_profile`) purpose-built for matrimonial biodata.
* Multi-step front-end submission form covering basic info, personal details, education & career, family details, lifestyle, and partner preferences.
* Profile photo upload with type and size validation (JPG, PNG, WebP).
* Front-end profile editing — members can update their own profiles at any time.
* Optional admin approval workflow: new profiles are held as *pending* until an administrator publishes them.
* Auto-generated profile reference numbers with configurable prefix and digit count (e.g. DMA000001).

**Search & Browse**

* Filterable profile grid with support for gender, age range, city, marital status, and more.
* AJAX-powered live filtering — no page reload required.
* Pagination for large profile sets.
* Optional login-gate: restrict profile browsing to registered members only.
* Profile photos hidden for guests when the login requirement is enabled.

**Shortcodes**

* `[shibhu_matrimony_profiles]` — Display the profiles listing grid.  
  Parameters: `gender`, `per_page`, `orderby`, `order`.  
  Example: `[shibhu_matrimony_profiles gender="female" per_page="12"]`
* `[shibhu_matrimony_submit_form]` — Render the front-end profile submission form.
* `[shibhu_matrimony_search_form]` — Render the advanced search and filter form.

**Admin Reports (v1.2.0)**

* At-a-glance statistics cards: total profiles, male / female breakdown, profiles added in the last 30 days, and profiles awaiting approval.
* Timestamped activity log timeline tracking profile creation, edits, approvals, and pending submissions.
* One-click log clearing via secure AJAX endpoint.

**Settings**

* Enable or disable front-end profile registration.
* Enable or disable the advanced search form.
* Set the default number of profiles displayed per page.
* Require admin approval before profiles go live.
* Require login to view profiles.
* Customise the profile reference number prefix and digit count.

**Developer Friendly**

* Theme template overrides — copy any plugin template into `your-theme/shibhu-matrimony/` to customise the output.
* Dozens of action and filter hooks throughout the codebase for extensibility.
* Singleton main class following WordPress coding standards.
* All output escaped, all input sanitized, all forms protected with WordPress nonces.
* Fully translation-ready with a `shibhu-matrimony` text domain.

= Security =

Shibhu Matrimony is built with security as a first priority:

* Every form submission is verified with `wp_verify_nonce()`.
* All user-supplied data is sanitized with appropriate WordPress sanitization functions (`sanitize_text_field()`, `absint()`, `wp_unslash()`, etc.).
* All output is escaped with `esc_html()`, `esc_attr()`, `esc_url()`, and `wp_kses()` before being sent to the browser.
* Capability checks (`current_user_can()`) guard every admin action and AJAX endpoint.

= Translation Ready =

All user-facing strings are wrapped in standard WordPress i18n functions. The plugin ships with a `.pot` file so translators can get started immediately.

== Installation ==

1. Upload the `shibhu-matrimony` folder to the `/wp-content/plugins/` directory, or install it directly through **Plugins > Add New** in your WordPress admin.
2. Activate the plugin through the **Plugins** screen in WordPress.
3. Navigate to **Matrimonial > Settings** to configure the platform.
4. Create a page and add the `[shibhu_matrimony_profiles]` shortcode to display the profile listing.
5. Create a page and add the `[shibhu_matrimony_submit_form]` shortcode so members can submit their biodata.
6. Optionally, create a page with the `[shibhu_matrimony_search_form]` shortcode for the advanced search form.

== Frequently Asked Questions ==

= Do members need a WordPress account to submit a profile? =

Yes. Members must be registered WordPress users to submit and manage their profiles. You can enable WordPress's built-in registration under **Settings > General > Membership**.

= Can I moderate profiles before they go live? =

Yes. Enable **Require Admin Approval** in **Matrimonial > Settings > General**. New profiles will be set to *pending* and must be approved by an administrator before they appear on the site.

= Can visitors browse profiles without logging in? =

By default, yes. If you want to restrict browsing to registered members only, enable **Require Login to View Profiles** in the plugin settings. When this option is active, profile photos are also hidden from guests.

= How do I customise the profile card or single-profile template? =

Copy the relevant template file from the plugin's `templates/` directory into `your-theme/shibhu-matrimony/` (maintaining the same folder structure) and edit it there. The plugin will automatically use your overridden version.

= What image formats are accepted for profile photos? =

JPG, PNG, and WebP images are accepted. File type and size are validated on both the client and server sides.

= How are profile reference numbers generated? =

The plugin automatically generates a unique reference number for each approved profile using a configurable prefix (default: `DMA`) and a zero-padded number (default: 6 digits). You can change both values in **Matrimonial > Settings > General**.

= Is the plugin translation ready? =

Yes. All strings use the `shibhu-matrimony` text domain and a `.pot` file is included. You can translate the plugin using Loco Translate, Poedit, or any compatible tool.

= Where can I find the Reports dashboard? =

Go to **Matrimonial > Reports** in your WordPress admin. You will see statistics cards and a chronological activity log.



== Changelog ==

= 1.2.0 =
* New: Admin Reports page with statistics cards (total profiles, male/female counts, last 30 days, awaiting approval).
* New: Timestamped activity log timeline tracking profile creation, edits, approvals, and pending submissions.
* New: AJAX-powered "Clear Log" action on the Reports page.
* New: `class-reports.php` and `class-reports-ajax.php` for clean separation of concerns.
* Improvement: Dedicated `reports.css` and `reports.js` assets loaded only on the Reports screen.
* Security: All AJAX endpoints on the Reports page are protected by nonce verification and capability checks.

= 1.1.0 =
* New: Front-end profile editing via the `[shibhu_matrimony_edit_profile]` flow.
* New: `class-edit-profile.php` with theme template override support (`your-theme/shibhu-matrimony/edit/`).
* New: `shibhu_matrimony_edit_redirect_after_save` filter to control post-save redirect behaviour.
* New: `shibhu_matrimony_edit_profile_js_strings` filter to customise JS i18n strings.
* Improvement: Profile photo removal confirmation prompt.
* Security: Edit-profile AJAX action verified with nonce and ownership check.

= 1.0.0 =
* Initial release.
* Custom post type `mmatr_profile` with full meta box support.
* Multi-step front-end submission form with six sections.
* Shortcodes: `[shibhu_matrimony_profiles]`, `[shibhu_matrimony_submit_form]`, `[shibhu_matrimony_search_form]`.
* AJAX profile filtering with gender, age, city, and marital status filters.
* Admin approval workflow and profile reference number generation.
* Plugin settings page with General, Display, and Shortcodes tabs.
* Full nonce verification, data sanitization, and output escaping throughout.
* Translation-ready with `shibhu-matrimony` text domain.

== Upgrade Notice ==

= 1.2.0 =
Version 1.2.0 adds a new Admin Reports page with statistics and an activity log. No database migration is required; simply update and activate.

= 1.1.0 =
Version 1.1.0 adds front-end profile editing. No breaking changes; existing shortcodes and templates continue to work without modification.
