at path:
ROOT
/
wp-content
/
plugins
/
wp-mail-smtp
/
src
/
Debug.php
run:
R
W
Run
Abilities
DIR
2026-07-10 16:52:15
R
W
Run
Admin
DIR
2026-07-10 16:52:15
R
W
Run
Compatibility
DIR
2026-07-10 16:52:15
R
W
Run
Helpers
DIR
2026-07-10 16:52:15
R
W
Run
Integrations
DIR
2026-07-10 16:52:15
R
W
Run
Providers
DIR
2026-07-10 16:52:15
R
W
Run
Queue
DIR
2026-07-10 16:52:15
R
W
Run
Reports
DIR
2026-07-10 16:52:15
R
W
Run
Tasks
DIR
2026-07-10 16:52:15
R
W
Run
TestEmail
DIR
2026-07-10 16:52:15
R
W
Run
UsageTracking
DIR
2026-07-10 16:52:15
R
W
Run
WPCLI
DIR
2026-07-10 16:52:15
R
W
Run
AbstractConnection.php
1.09 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
Conflicts.php
16.65 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
Connect.php
9.18 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
Connection.php
964 By
2026-06-25 12:51:00
R
W
Run
Delete
Rename
ConnectionInterface.php
1.01 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
ConnectionsManager.php
765 By
2026-06-25 12:51:00
R
W
Run
Delete
Rename
Core.php
33.84 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
DBRepair.php
6.36 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
Debug.php
4.24 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
EmailSendingDebug.php
4.82 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
Geo.php
6.76 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
MailCatcher.php
1.36 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
MailCatcherInterface.php
1.16 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
MailCatcherTrait.php
27.44 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
MailCatcherV6.php
1.2 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
Migration.php
12.11 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
MigrationAbstract.php
3.21 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
Migrations.php
4.12 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
OptimizedEmailSending.php
1.17 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
Options.php
48.36 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
Processor.php
14.11 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
SiteHealth.php
12.66 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
Upgrade.php
1.55 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
Uploads.php
5.44 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
WP.php
24.5 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
WPMailArgs.php
4.44 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
WPMailInitiator.php
4.38 KB
2026-06-25 12:51:00
R
W
Run
Delete
Rename
error_log
up
📄
Debug.php
Save
<?php namespace WPMailSMTP; use WPMailSMTP\Admin\DebugEvents\DebugEvents; use WPMailSMTP\Helpers\Helpers; /** * Class Debug — legacy global "last error" message bag. * * The plugin no longer reads from this bag. For diagnostic logging, use * {@see DebugEvents::add()}. For tracking the current email-sending failure * state per connection (the data the EmailSendingErrors banner renders), use * {@see EmailSendingDebug}. * * @since 1.2.0 * @deprecated {VERSION} */ class Debug { /** * Key for options table where all messages will be saved to. * * @since 1.2.0 */ const OPTION_KEY = 'wp_mail_smtp_debug'; /** * Hold the cached error messages. * * @since 3.0.0 * * @var array */ private static $cached_messages; /** * Save unique debug message to a debug log. * Adds one more to a list, at the end. * * Use {@see DebugEvents::add()} directly. The legacy bag this method * writes to has no remaining readers in the plugin. * * @since 1.2.0 * @since 3.0.0 Start saving the Debug Event IDs, instead of error messages. * @since 3.5.0 Returns Event ID. * @deprecated {VERSION} * * @param mixed $message An array or string error message. * * @return bool|int */ public static function set( $message ) { if ( empty( $message ) ) { return false; } self::clear_cache(); // Log the error message to the Debug Events. $event_id = DebugEvents::add( $message ); $all = self::get_raw(); if ( ! empty( $event_id ) ) { array_push( $all, $event_id ); } else { if ( ! is_string( $message ) ) { $message = wp_json_encode( $message ); } else { $message = wp_strip_all_tags( $message, false ); } array_push( $all, $message ); } update_option( self::OPTION_KEY, array_unique( $all ), false ); return $event_id; } /** * Remove all messages for a debug log. * * The plugin no longer reads from this bag, so clearing it is a no-op for * in-plugin behavior. For per-connection send failure state, use * {@see EmailSendingDebug::clear()}. * * @since 1.2.0 * @deprecated {VERSION} */ public static function clear() { self::clear_cache(); update_option( self::OPTION_KEY, [], false ); } /** * Clear cached error messages. * * @since 3.0.0 */ private static function clear_cache() { self::$cached_messages = null; } /** * Get the raw DB debug option values. * * @since 3.0.0 */ private static function get_raw() { $all = get_option( self::OPTION_KEY, [] ); if ( ! is_array( $all ) ) { $all = (array) $all; } return $all; } /** * Retrieve all messages from a debug log. * * For diagnostic event history, use {@see DebugEvents::get_debug_messages()}. * For per-connection send failure state, use {@see EmailSendingDebug::get()}. * * @since 1.2.0 * @deprecated {VERSION} * * @return array */ public static function get() { if ( isset( self::$cached_messages ) ) { return self::$cached_messages; } $all = self::get_raw(); if ( empty( $all ) ) { self::$cached_messages = []; return []; } $event_ids = []; $old_messages = []; foreach ( $all as $item ) { if ( is_int( $item ) ) { $event_ids[] = (int) $item; } else { $old_messages[] = $item; } } $event_messages = DebugEvents::get_debug_messages( $event_ids ); self::$cached_messages = array_unique( array_merge( $old_messages, $event_messages ) ); return self::$cached_messages; } /** * Get the last message that was saved to a debug log. * * For per-connection send failure state, use {@see EmailSendingDebug::get()} * keyed by connection id and read the `error_message` field. * * @since 1.2.0 * @deprecated {VERSION} * * @return string */ public static function get_last() { $all = self::get(); if ( ! empty( $all ) && is_array( $all ) ) { return (string) end( $all ); } return ''; } /** * Get the proper variable content output to debug. * * Moved to {@see Helpers::pvar()}. Kept as a thin passthrough so external * callers don't break. * * @since 1.2.0 * @deprecated {VERSION} * * @param mixed $var Variable to output. * * @return string */ public static function pvar( $var = '' ) { return Helpers::pvar( $var ); } }