=== MailSentra: Email Logging & Diagnostics ===
Contributors: kjegger16
Donate link: https://buymeacoffee.com/kjegger16g6
Tags: email logs, wp_mail, smtp, email
Requires at least: 5.8
Requires PHP: 7.4
Tested up to: 7.1
Stable tag: 1.5.6
License: GPLv2 or later

Logs WordPress email attempts with source diagnostics, reports, search, CSV export, and retention controls.

== Description ==
MailSentra logs WordPress email attempts and records the status, recipient, subject, trigger, caller, call stack, and source details for each message. It provides email statistics, weekly and monthly reports, source-based diagnostics, search and filtering, CSV export, and configurable retention.

Email body, headers, attachment paths, and request IP addresses can be logged when their individual settings are enabled. Email bodies and headers are optional, and IP logging is optional. MailSentra stores logged data in the site database and does not send it to an external service.

A "Sent" status means WordPress or PHPMailer reported a successful send operation. It does not confirm final inbox delivery or rule out a later bounce.

== Changelog ==
= 1.5.6 =
* Added Weekly Email Report, Current Month, and Last Month tabs, with Weekly Email Report selected by default.
* Added Current Month and full-calendar Last Month summaries with total logs, successfully sent, failed, and completed counts.
* Added reusable source summary popups for both months, showing trigger counts, sent and failed counts, and each source's last activity.
* Kept last activity in the source popups without displaying it as a row in the month summaries.
* Restyled the monthly report panels and centered the source summary popup.
* Redesigned the weekly report comparison horizontally with current week-to-date and full previous Monday-to-Sunday email totals and the percentage change.

= 1.5.5 =
* Manual Refresh Data clears source and status filters and returns the list to page 1.

= 1.5.4 =
* Removed Last activity from the weekly source table and made Emails, Sent, and Failed counts clickable, including zero values.

= 1.5.3 =
* Added separate AJAX filters for all, sent, and failed email counts by source.
* Fixed source totals clearing a previous failed-only filter.

= 1.5.2 =
* Fixed rapid repeated source/filter clicks being ignored while AJAX refreshes were in progress.

= 1.5.1 =
* Added a reusable hover/focus explanation for the weekly Failed source-table column.

= 1.5.0 =
* Added interactive weekly source diagnostics with total, failure rate, and last activity.
* Source and failure links filter the email log list through AJAX.

= 1.4.8 =
* Moved the monthly report into its own responsive section above the log-stat cards.

= 1.4.7 =
* Added month-to-date email volume and comparison with the matching prior-month period.

= 1.4.6 =
* Enabled IP logging by default for new installs and added IP address to log details.

= 1.4.5 =
* Enabled email body and header logging by default for new installs.
* Recorded per-email capture settings and explain disabled or empty fields in log details.

= 1.4.4 =
* Replaced the Dashboard overview with the email log list and removed the duplicate visible Email Logs submenu.

= 1.4.3 =
* Moved MailSentra from the Settings menu to a dedicated top-level admin menu.

= 1.4.2 =
* Corrected weekly WordPress Core grouping for origins that include caller function names.

= 1.4.1 =
* Added a custom daily email-count tooltip for interactive chart dots.

= 1.4.0 =
* Added WordPress Core origin detection without overriding more specific plugin/theme callers.
* Added WordPress Core as a separate weekly email source category.

= 1.3.9 =
* Changed graph and weekly totals to include all logged email sources.
* Added a weekly breakdown of recognized form plugins and other/custom/unknown sources.

= 1.3.8 =
* Clarified that weekly email report counts recognized contact-form plugin emails only.

= 1.3.7 =
* Replaced pagination text arrows with larger accessible previous/next icons.

= 1.3.6 =
* Moved manual refresh loading feedback to a full-page blocking overlay and disabled refresh-icon spinning.

= 1.3.5 =
* Removed refresh icon spinning and reset manual refresh to log page 1.

= 1.3.4 =
* Limited refresh icon animation to manual refresh clicks.
* Modernized AJAX pagination controls.

= 1.3.3 =
* Set mail logs to 15 entries per page and made pagination update over AJAX.

= 1.3.2 =
* Made graph period controls, log filters, and Reset update over AJAX without reloading the page.

= 1.3.1 =
* Moved log refresh handling into a dedicated AJAX class.
* Added a numeric refresh date to the log status.

= 1.3.0 =
* Added a secure, no-page-reload refresh for log statistics, form email graph, current log rows, and pagination.

= 1.2.8 =
* Rebranded the plugin as MailSentra: Email Logging & Diagnostics.

= 1.2.7 =
* Protected CSV exports from spreadsheet formula injection.
* Changed new-install privacy defaults, made header logging fully optional, and added opt-in IP logging.
* Kept WordPress core notices visible while filtering plugin notices on Mail Logs pages.
* Added suggested privacy-policy text for logged data.

= 1.2.6 =
* Added WordPress and PHP minimum-version headers for compatibility checks.
* Updated the tested WordPress version to 7.1.

= 1.2.5 =
* Fixed form email statistics to include recognized form call-stack origins.
* Suppressed admin notices on WP Mail Interceptor screens only.

= 1.2.4 =
* Excluded non-form plugin mail from the form email statistics.
* Moved form statistics rendering and queries into a dedicated include.

= 1.2.3 =
* Added week/month form-plugin mail charts and a week-over-week email report.

= 1.2.2 =
* Collapsed origin call stacks by default in mail log details.

= 1.2.1 =
* Fixed caller detection for case-varied and custom plugin paths.
* Recover trigger labels from saved call stacks for existing logs.

= 1.2.0 =
* Records the plugin/function that triggered each wp_mail() call and its call stack.
* Shows the trigger summary in mail log tables and full origin details when viewing a log.
* Automatically upgrades the log table to store origin details.

= 1.1.0 =
* Added a statistics board above the mail logs list.
* Added successful/failed counts and percentages.
* Added total log count to the statistics board.
* Changed log details from a separate page to an in-page modal popup.
* Bumped plugin version to 1.1.0.

== Features ==
* Logs wp_mail() send attempts.
* Records sent/failed result from WordPress mail hooks.
* Dashboard statistics.
* Seven-day activity chart.
* Search and status filtering.
* Detailed individual log view.
* CSV export.
* Configurable body/header/attachment logging.
* Configurable retention period.
* Optional database cleanup on uninstall.

== Important ==
A "Sent" status means WordPress/PHPMailer reported a successful send operation. It does not prove final inbox delivery. Actual delivery/bounce tracking requires provider-level support.

== Installation ==
1. Upload the plugin ZIP through Plugins > Add New > Upload Plugin.
2. Activate the plugin.
3. Go to MailSentra > Settings.
4. Configure logging options.

== Frequently Asked Questions ==

= Does a Sent status confirm inbox delivery? =
No. It means WordPress and PHPMailer reported a successful send operation. It does not confirm final delivery or rule out a later bounce.

= What does Pending mean? =
The email attempt was logged, but MailSentra has not recorded a sent or failed result yet. This can happen while sending or if the result hook does not run.

= Where are email logs stored? =
Logs are stored in this site's WordPress database. MailSentra does not send logged data to an external service. Configure the logged fields and retention period in MailSentra > Settings.

== Upgrade Notice ==
= 1.5.6 =
Adds weekly and monthly report tabs and monthly source summaries. No special upgrade steps are required.
