GRAYBYTE WORDPRESS FILE MANAGER2995

Server IP : 198.54.121.189 / Your IP : 216.73.216.34
System : Linux premium69.web-hosting.com 4.18.0-553.44.1.lve.el8.x86_64 #1 SMP Thu Mar 13 14:29:12 UTC 2025 x86_64
PHP Version : 7.4.33
Disable Function : NONE
cURL : ON | WGET : ON | Sudo : OFF | Pkexec : OFF
Directory : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/wp-mail-smtp/src/
Upload Files :
Current_dir [ Writeable ] Document_root [ Writeable ]

Command :


Current File : /home/giriqfky/trustyourlawyer.com/wp-content/plugins/wp-mail-smtp/src//WPMailInitiator.php
<?php

namespace WPMailSMTP;

/**
 * The `wp_mail` function initiator. It has centralized initiator data that can be used across all processes.
 *
 * @since 3.7.0
 */
class WPMailInitiator {

	/**
	 * The path where the `wp_mail` function was called.
	 *
	 * @since 3.7.0
	 *
	 * @var string
	 */
	private $file;

	/**
	 * Line in the file where the `wp_mail` function was called.
	 *
	 * @since 3.7.0
	 *
	 * @var int
	 */
	private $line;

	/**
	 * The `wp_mail` function call backtrace.
	 *
	 * @since 3.7.0
	 *
	 * @var array
	 */
	private $backtrace;

	/**
	 * Initiator name (plugin or theme name).
	 *
	 * @since 3.7.0
	 *
	 * @var string
	 */
	private $name;

	/**
	 * Initiator type. Available options: plugin, mu-plugin, theme, wp-core, unknown.
	 *
	 * @since 3.7.0
	 *
	 * @var string
	 */
	private $type;

	/**
	 * Initiator slug (plugin or theme slug).
	 *
	 * @since 3.7.0
	 *
	 * @var string
	 */
	private $slug;

	/**
	 * Whether performance-costly properties were initialized.
	 *
	 * @since 3.7.0
	 *
	 * @var array
	 */
	private $initialized = false;

	/**
	 * Register hooks.
	 *
	 * @since 3.7.0
	 */
	public function hooks() {

		// Capture `wp_mail` function call.
		add_action( 'wp_mail_smtp_processor_capture_wp_mail_call', [ $this, 'capture_wp_mail_call' ], 0 );
	}

	/**
	 * Capture `wp_mail` function call.
	 *
	 * @since 4.0.0
	 */
	public function capture_wp_mail_call() {

		$this->set_initiator();
	}

	/**
	 * Get the path where the `wp_mail` function was called.
	 *
	 * @since 3.7.0
	 *
	 * @return string
	 */
	public function get_file() {

		return $this->file;
	}

	/**
	 * Get the line in the file where the `wp_mail` function was called.
	 *
	 * @since 3.7.0
	 *
	 * @return int
	 */
	public function get_line() {

		return $this->line;
	}

	/**
	 * Get the `wp_mail` function call backtrace.
	 *
	 * @since 3.7.0
	 *
	 * @return array
	 */
	public function get_backtrace() {

		return $this->backtrace;
	}

	/**
	 * Get the initiator name (plugin or theme name).
	 *
	 * @since 3.7.0
	 *
	 * @return string
	 */
	public function get_name() {

		$this->lazy_init();

		return $this->name;
	}

	/**
	 * Get the initiator type. Available options: plugin, mu-plugin, theme, wp-core, unknown.
	 *
	 * @since 3.7.0
	 *
	 * @return string
	 */
	public function get_type() {

		$this->lazy_init();

		return $this->type;
	}

	/**
	 * Get the initiator slug (plugin or theme slug).
	 *
	 * @since 3.7.0
	 *
	 * @return string
	 */
	public function get_slug() {

		$this->lazy_init();

		return $this->slug;
	}

	/**
	 * Initialize initiator data.
	 *
	 * @since 3.7.0
	 */
	public function set_initiator() {

		// Reset previous values.
		$this->reset();

		$backtrace = $this->get_wpmail_backtrace();

		/**
		 * Filter the `wp_mail` function initiator data.
		 *
		 * @since 4.0.0
		 *
		 * @param array $backtrace Backtrace data.
		 */
		$backtrace = apply_filters( 'wp_mail_smtp_wp_mail_initiator_set_initiator', $backtrace );

		if ( empty( $backtrace['file'] ) ) {
			return;
		}

		$this->file      = $backtrace['file'];
		$this->backtrace = $backtrace['backtrace'];

		if ( ! empty( $backtrace['line'] ) ) {
			$this->line = $backtrace['line'];
		}
	}

	/**
	 * Initialize performance-costly properties.
	 *
	 * @since 3.7.0
	 */
	private function lazy_init() {

		if ( empty( $this->file ) || $this->initialized ) {
			return;
		}

		$data = WP::get_initiator( $this->file );

		$this->name = $data['name'];
		$this->type = $data['type'];

		if ( isset( $data['slug'] ) ) {
			$this->slug = $data['slug'];
		}

		$this->initialized = true;
	}

	/**
	 * Reset previous initiator data before the new email sending.
	 *
	 * @since 3.7.0
	 */
	private function reset() {

		$this->initialized = false;
		$this->file        = null;
		$this->line        = null;
		$this->backtrace   = null;
		$this->name        = null;
		$this->type        = null;
		$this->slug        = null;
	}

	/**
	 * Get the `wp_mail` function backtrace data, if it exists.
	 *
	 * @since 3.7.0
	 *
	 * @return array
	 */
	private function get_wpmail_backtrace() {

		$backtrace = debug_backtrace( DEBUG_BACKTRACE_IGNORE_ARGS ); // phpcs:ignore WordPress.PHP.DevelopmentFunctions.error_log_debug_backtrace

		foreach ( $backtrace as $i => $item ) {
			if ( $item['function'] === 'wp_mail' ) {
				if ( isset( $item['function'] ) ) {
					unset( $item['function'] );
				}

				$item['backtrace'] = array_slice( $backtrace, $i );

				return $item;
			}
		}

		return [];
	}
}

[ Back ]
Name
Size
Last Modified
Owner / Group
Permissions
Options
..
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Admin
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Compatibility
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Helpers
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Providers
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Queue
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Reports
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
Tasks
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
UsageTracking
--
July 10 2025 04:32:23
giriqfky / giriqfky
0755
.htaccess
0.41 KB
July 10 2025 04:32:23
giriqfky / giriqfky
0644
AbstractConnection.php
1.09 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
Conflicts.php
15.015 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
Connect.php
9.184 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
Connection.php
0.941 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
ConnectionInterface.php
1.014 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
ConnectionsManager.php
0.747 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
Core.php
33.451 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
DBRepair.php
6.286 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
Debug.php
3.497 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
Geo.php
6.758 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
MailCatcher.php
1.633 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
MailCatcherInterface.php
1.157 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
MailCatcherTrait.php
13.429 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
MailCatcherV6.php
1.474 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
Migration.php
12.107 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
MigrationAbstract.php
3.211 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
Migrations.php
3.592 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
OptimizedEmailSending.php
1.167 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
Options.php
46.444 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
Processor.php
14.063 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
SiteHealth.php
12.63 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
Upgrade.php
1.55 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
Uploads.php
5.436 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
WP.php
20.078 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
WPMailArgs.php
4.442 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644
WPMailInitiator.php
4.38 KB
June 05 2025 17:33:30
giriqfky / giriqfky
0644

GRAYBYTE WORDPRESS FILE MANAGER @ 2025
CONTACT ME
Static GIF