Файловый менеджер - Редактировать - /home/bean7936/perfect-community.com/442aa3/wp-mail-smtp.zip
Назад
PK ��\����n% n% uninstall.phpnu �[��� <?php /** * Uninstall all WP Mail SMTP data. * * @since 1.3.0 */ // Exit if accessed directly. if ( ! defined( 'WP_UNINSTALL_PLUGIN' ) ) { exit; } // Prevent data removal if Pro plugin is active. if ( is_plugin_active( 'wp-mail-smtp-pro/wp_mail_smtp.php' ) ) { return; } // Load plugin file. require_once 'wp_mail_smtp.php'; require_once dirname( __FILE__ ) . '/vendor/woocommerce/action-scheduler/action-scheduler.php'; global $wpdb; /* * Remove Legacy options. */ $options = [ '_amn_smtp_last_checked', 'pepipost_ssl', 'pepipost_port', 'pepipost_pass', 'pepipost_user', 'smtp_pass', 'smtp_user', 'smtp_auth', 'smtp_ssl', 'smtp_port', 'smtp_host', 'mail_set_return_path', 'mailer', 'mail_from_name', 'mail_from', ]; /** * Remove AM announcement posts. */ $am_announcement_params = [ 'post_type' => [ 'amn_smtp' ], 'post_status' => 'any', 'numberposts' => - 1, 'fields' => 'ids', ]; /** * Disable Action Schedule Queue Runner, to prevent a fatal error on the shutdown WP hook. */ if ( class_exists( 'ActionScheduler_QueueRunner' ) ) { $as_queue_runner = \ActionScheduler_QueueRunner::instance(); if ( method_exists( $as_queue_runner, 'unhook_dispatch_async_request' ) ) { $as_queue_runner->unhook_dispatch_async_request(); } } // WP MS uninstall process. //phpcs:disable WPForms.Formatting.EmptyLineAfterAssigmentVariables.AddEmptyLine, WPForms.PHP.BackSlash.UseShortSyntax if ( is_multisite() ) { $main_site_settings = get_blog_option( get_main_site_id(), 'wp_mail_smtp', [] ); $network_wide = ! empty( $main_site_settings['general']['network_wide'] ); $network_uninstall = ! empty( $main_site_settings['general']['uninstall'] ); $sites = get_sites(); foreach ( $sites as $site ) { $settings = get_blog_option( $site->blog_id, 'wp_mail_smtp', [] ); // Confirm network site admin has decided to remove all data, otherwise skip. if ( ( $network_wide && ! $network_uninstall ) || ( ! $network_wide && empty( $settings['general']['uninstall'] ) ) ) { continue; } /* * Delete network site plugin options. */ foreach ( $options as $option ) { delete_blog_option( $site->blog_id, $option ); } // Switch to the current network site. switch_to_blog( $site->blog_id ); // Delete plugin settings. $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'wp\_mail\_smtp%'" ); // phpcs:ignore WordPress.DB // Delete plugin user meta. $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key LIKE 'wp\_mail\_smtp\_%'" ); // phpcs:ignore WordPress.DB // Remove any transients we've left behind. $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '\_transient\_wp\_mail\_smtp\_%'" ); // phpcs:ignore WordPress.DB $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '\_site\_transient\_wp\_mail\_smtp\_%'" ); // phpcs:ignore WordPress.DB $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '\_transient\_timeout\_wp\_mail\_smtp\_%'" ); // phpcs:ignore WordPress.DB $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '\_site\_transient\_timeout\_wp\_mail\_smtp\_%'" ); // phpcs:ignore WordPress.DB // Delete debug events table. $debug_events_table = \WPMailSMTP\Admin\DebugEvents\DebugEvents::get_table_name(); $wpdb->query( "DROP TABLE IF EXISTS $debug_events_table;" ); // phpcs:ignore WordPress.DB /* * Delete network site product announcements. */ $announcements = get_posts( $am_announcement_params ); if ( ! empty( $announcements ) ) { foreach ( $announcements as $announcement ) { wp_delete_post( $announcement, true ); } } // Delete queue table. $queue_table = \WPMailSMTP\Queue\Queue::get_table_name(); $wpdb->query( "DROP TABLE IF EXISTS $queue_table;" ); // phpcs:ignore WordPress.DB // Delete all queue attachments. ( new \WPMailSMTP\Queue\Attachments() )->delete_attachments(); /* * Cleanup network site data for Pro plugin only. */ if ( function_exists( 'wp_mail_smtp' ) && is_readable( wp_mail_smtp()->plugin_path . '/src/Pro/Pro.php' ) ) { // Delete logs table. $table = \WPMailSMTP\Pro\Emails\Logs\Logs::get_table_name(); $wpdb->query( "DROP TABLE IF EXISTS $table;" ); // phpcs:ignore WordPress.DB // Delete attachments tables. $attachment_files_table = \WPMailSMTP\Pro\Emails\Logs\Attachments\Attachments::get_attachment_files_table_name(); $wpdb->query( "DROP TABLE IF EXISTS $attachment_files_table;" ); // phpcs:ignore WordPress.DB $email_attachments_table = \WPMailSMTP\Pro\Emails\Logs\Attachments\Attachments::get_email_attachments_table_name(); $wpdb->query( "DROP TABLE IF EXISTS $email_attachments_table;" ); // phpcs:ignore WordPress.DB // Delete all attachments if any. ( new \WPMailSMTP\Pro\Emails\Logs\Attachments\Attachments() )->delete_all_attachments(); // Delete tracking tables. $tracking_events_table = \WPMailSMTP\Pro\Emails\Logs\Tracking\Tracking::get_events_table_name(); $wpdb->query( "DROP TABLE IF EXISTS $tracking_events_table;" ); // phpcs:ignore WordPress.DB $tracking_links_table = \WPMailSMTP\Pro\Emails\Logs\Tracking\Tracking::get_links_table_name(); $wpdb->query( "DROP TABLE IF EXISTS $tracking_links_table;" ); // phpcs:ignore WordPress.DB } /* * Drop all Action Scheduler data and unschedule all plugin ActionScheduler actions. */ ( new \WPMailSMTP\Tasks\Tasks() )->remove_all(); $meta_table = \WPMailSMTP\Tasks\Meta::get_table_name(); $wpdb->query( "DROP TABLE IF EXISTS $meta_table;" ); // phpcs:ignore WordPress.DB // Delete current sub-site wp-mail-smtp uploads folder. \WPMailSMTP\Uploads::delete_upload_dir(); // Restore the current network site back to the original one. restore_current_blog(); } } else { // Non WP MS uninstall process (for normal WP installs). // Confirm user has decided to remove all data, otherwise stop. $settings = get_option( 'wp_mail_smtp', [] ); if ( empty( $settings['general']['uninstall'] ) ) { return; } /* * Delete plugin options. */ foreach ( $options as $option ) { delete_option( $option ); } // Delete plugin settings. $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE 'wp\_mail\_smtp%'" ); // phpcs:ignore WordPress.DB // Delete plugin user meta. $wpdb->query( "DELETE FROM {$wpdb->usermeta} WHERE meta_key LIKE 'wp\_mail\_smtp\_%'" ); // phpcs:ignore WordPress.DB // Remove any transients we've left behind. $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '\_transient\_wp\_mail\_smtp\_%'" ); // phpcs:ignore WordPress.DB $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '\_site\_transient\_wp\_mail\_smtp\_%'" ); // phpcs:ignore WordPress.DB $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '\_transient\_timeout\_wp\_mail\_smtp\_%'" ); // phpcs:ignore WordPress.DB $wpdb->query( "DELETE FROM {$wpdb->options} WHERE option_name LIKE '\_site\_transient\_timeout\_wp\_mail\_smtp\_%'" ); // phpcs:ignore WordPress.DB // Delete debug events table. $debug_events_table = \WPMailSMTP\Admin\DebugEvents\DebugEvents::get_table_name(); $wpdb->query( "DROP TABLE IF EXISTS $debug_events_table;" ); // phpcs:ignore WordPress.DB /* * Remove product announcements. */ $announcements = get_posts( $am_announcement_params ); if ( ! empty( $announcements ) ) { foreach ( $announcements as $announcement ) { wp_delete_post( $announcement, true ); } } // Delete queue table. $queue_table = \WPMailSMTP\Queue\Queue::get_table_name(); $wpdb->query( "DROP TABLE IF EXISTS $queue_table;" ); // phpcs:ignore WordPress.DB // Delete all queue attachments. ( new \WPMailSMTP\Queue\Attachments() )->delete_attachments(); /* * Cleanup data for Pro plugin only. */ if ( function_exists( 'wp_mail_smtp' ) && is_readable( wp_mail_smtp()->plugin_path . '/src/Pro/Pro.php' ) ) { // Delete logs table. $table = \WPMailSMTP\Pro\Emails\Logs\Logs::get_table_name(); $wpdb->query( "DROP TABLE IF EXISTS $table;" ); // phpcs:ignore WordPress.DB // Delete attachments tables. $attachment_files_table = \WPMailSMTP\Pro\Emails\Logs\Attachments\Attachments::get_attachment_files_table_name(); $wpdb->query( "DROP TABLE IF EXISTS $attachment_files_table;" ); // phpcs:ignore WordPress.DB $email_attachments_table = \WPMailSMTP\Pro\Emails\Logs\Attachments\Attachments::get_email_attachments_table_name(); $wpdb->query( "DROP TABLE IF EXISTS $email_attachments_table;" ); // phpcs:ignore WordPress.DB // Delete all attachments if any. ( new \WPMailSMTP\Pro\Emails\Logs\Attachments\Attachments() )->delete_all_attachments(); // Delete tracking tables. $tracking_events_table = \WPMailSMTP\Pro\Emails\Logs\Tracking\Tracking::get_events_table_name(); $wpdb->query( "DROP TABLE IF EXISTS $tracking_events_table;" ); // phpcs:ignore WordPress.DB $tracking_links_table = \WPMailSMTP\Pro\Emails\Logs\Tracking\Tracking::get_links_table_name(); $wpdb->query( "DROP TABLE IF EXISTS $tracking_links_table;" ); // phpcs:ignore WordPress.DB } /* * Drop all Action Scheduler data and unschedule all plugin ActionScheduler actions. */ ( new \WPMailSMTP\Tasks\Tasks() )->remove_all(); $meta_table = \WPMailSMTP\Tasks\Meta::get_table_name(); $wpdb->query( "DROP TABLE IF EXISTS $meta_table;" ); // phpcs:ignore WordPress.DB // Delete wp-mail-smtp uploads folder. \WPMailSMTP\Uploads::delete_upload_dir(); } //phpcs:enable WPForms.Formatting.EmptyLineAfterAssigmentVariables.AddEmptyLine, WPForms.PHP.BackSlash.UseShortSyntax PK ��\�Շ�� � ) vendor_prefixed/guzzlehttp/guzzle/LICENSEnu �[��� The MIT License (MIT) Copyright (c) 2011 Michael Dowling <mtdowling@gmail.com> Copyright (c) 2012 Jeremy Lindblom <jeremeamia@gmail.com> Copyright (c) 2014 Graham Campbell <hello@gjcampbell.co.uk> Copyright (c) 2015 Márk Sági-Kazár <mark.sagikazar@gmail.com> Copyright (c) 2015 Tobias Schultze <webmaster@tubo-world.de> Copyright (c) 2016 Tobias Nyholm <tobias.nyholm@gmail.com> Copyright (c) 2016 George Mponos <gmponos@gmail.com> Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK ��\�(�3 �3 / vendor_prefixed/guzzlehttp/guzzle/src/Utils.phpnu �[��� <?php namespace WPMailSMTP\Vendor\GuzzleHttp; use WPMailSMTP\Vendor\GuzzleHttp\Exception\InvalidArgumentException; use WPMailSMTP\Vendor\GuzzleHttp\Handler\CurlHandler; use WPMailSMTP\Vendor\GuzzleHttp\Handler\CurlMultiHandler; use WPMailSMTP\Vendor\GuzzleHttp\Handler\Proxy; use WPMailSMTP\Vendor\GuzzleHttp\Handler\StreamHandler; use WPMailSMTP\Vendor\Psr\Http\Message\UriInterface; final class Utils { /** * Debug function used to describe the provided value type and class. * * @param mixed $input * * @return string Returns a string containing the type of the variable and * if a class is provided, the class name. */ public static function describeType($input) : string { switch (\gettype($input)) { case 'object': return 'object(' . \get_class($input) . ')'; case 'array': return 'array(' . \count($input) . ')'; default: \ob_start(); \var_dump($input); // normalize float vs double /** @var string $varDumpContent */ $varDumpContent = \ob_get_clean(); return \str_replace('double(', 'float(', \rtrim($varDumpContent)); } } /** * Parses an array of header lines into an associative array of headers. * * @param iterable $lines Header lines array of strings in the following * format: "Name: Value" */ public static function headersFromLines(iterable $lines) : array { $headers = []; foreach ($lines as $line) { $parts = \explode(':', $line, 2); $headers[\trim($parts[0])][] = isset($parts[1]) ? \trim($parts[1]) : null; } return $headers; } /** * Returns a debug stream based on the provided variable. * * @param mixed $value Optional value * * @return resource */ public static function debugResource($value = null) { if (\is_resource($value)) { return $value; } if (\defined('STDOUT')) { return \STDOUT; } return Psr7\Utils::tryFopen('php://output', 'w'); } /** * Chooses and creates a default handler to use based on the environment. * * The returned handler is not wrapped by any default middlewares. * * @return callable(\Psr\Http\Message\RequestInterface, array): Promise\PromiseInterface Returns the best handler for the given system. * * @throws \RuntimeException if no viable Handler is available. */ public static function chooseHandler() : callable { $handler = null; if (\defined('CURLOPT_CUSTOMREQUEST') && \function_exists('curl_version') && \version_compare(\curl_version()['version'], '7.21.2') >= 0) { if (\function_exists('curl_multi_exec') && \function_exists('curl_exec')) { $handler = Proxy::wrapSync(new CurlMultiHandler(), new CurlHandler()); } elseif (\function_exists('curl_exec')) { $handler = new CurlHandler(); } elseif (\function_exists('curl_multi_exec')) { $handler = new CurlMultiHandler(); } } if (\ini_get('allow_url_fopen')) { $handler = $handler ? Proxy::wrapStreaming($handler, new StreamHandler()) : new StreamHandler(); } elseif (!$handler) { throw new \RuntimeException('GuzzleHttp requires cURL, the allow_url_fopen ini setting, or a custom HTTP handler.'); } return $handler; } /** * Get the default User-Agent string to use with Guzzle. */ public static function defaultUserAgent() : string { return \sprintf('GuzzleHttp/%d', ClientInterface::MAJOR_VERSION); } /** * Returns the default cacert bundle for the current system. * * First, the openssl.cafile and curl.cainfo php.ini settings are checked. * If those settings are not configured, then the common locations for * bundles found on Red Hat, CentOS, Fedora, Ubuntu, Debian, FreeBSD, OS X * and Windows are checked. If any of these file locations are found on * disk, they will be utilized. * * Note: the result of this function is cached for subsequent calls. * * @throws \RuntimeException if no bundle can be found. * * @deprecated Utils::defaultCaBundle will be removed in guzzlehttp/guzzle:8.0. This method is not needed in PHP 5.6+. */ public static function defaultCaBundle() : string { static $cached = null; static $cafiles = [ // Red Hat, CentOS, Fedora (provided by the ca-certificates package) '/etc/pki/tls/certs/ca-bundle.crt', // Ubuntu, Debian (provided by the ca-certificates package) '/etc/ssl/certs/ca-certificates.crt', // FreeBSD (provided by the ca_root_nss package) '/usr/local/share/certs/ca-root-nss.crt', // SLES 12 (provided by the ca-certificates package) '/var/lib/ca-certificates/ca-bundle.pem', // OS X provided by homebrew (using the default path) '/usr/local/etc/openssl/cert.pem', // Google app engine '/etc/ca-certificates.crt', // Windows? 'C:\\windows\\system32\\curl-ca-bundle.crt', 'C:\\windows\\curl-ca-bundle.crt', ]; if ($cached) { return $cached; } if ($ca = \ini_get('openssl.cafile')) { return $cached = $ca; } if ($ca = \ini_get('curl.cainfo')) { return $cached = $ca; } foreach ($cafiles as $filename) { if (\file_exists($filename)) { return $cached = $filename; } } throw new \RuntimeException(<<<EOT No system CA bundle could be found in any of the the common system locations. PHP versions earlier than 5.6 are not properly configured to use the system's CA bundle by default. In order to verify peer certificates, you will need to supply the path on disk to a certificate bundle to the 'verify' request option: https://docs.guzzlephp.org/en/latest/request-options.html#verify. If you do not need a specific certificate bundle, then Mozilla provides a commonly used CA bundle which can be downloaded here (provided by the maintainer of cURL): https://curl.haxx.se/ca/cacert.pem. Once you have a CA bundle available on disk, you can set the 'openssl.cafile' PHP ini setting to point to the path to the file, allowing you to omit the 'verify' request option. See https://curl.haxx.se/docs/sslcerts.html for more information. EOT ); } /** * Creates an associative array of lowercase header names to the actual * header casing. */ public static function normalizeHeaderKeys(array $headers) : array { $result = []; foreach (\array_keys($headers) as $key) { $result[\strtolower($key)] = $key; } return $result; } /** * Returns true if the provided host matches any of the no proxy areas. * * This method will strip a port from the host if it is present. Each pattern * can be matched with an exact match (e.g., "foo.com" == "foo.com") or a * partial match: (e.g., "foo.com" == "baz.foo.com" and ".foo.com" == * "baz.foo.com", but ".foo.com" != "foo.com"). * * Areas are matched in the following cases: * 1. "*" (without quotes) always matches any hosts. * 2. An exact match. * 3. The area starts with "." and the area is the last part of the host. e.g. * '.mit.edu' will match any host that ends with '.mit.edu'. * * @param string $host Host to check against the patterns. * @param string[] $noProxyArray An array of host patterns. * * @throws InvalidArgumentException */ public static function isHostInNoProxy(string $host, array $noProxyArray) : bool { if (\strlen($host) === 0) { throw new InvalidArgumentException('Empty host provided'); } // Strip port if present. [$host] = \explode(':', $host, 2); foreach ($noProxyArray as $area) { // Always match on wildcards. if ($area === '*') { return \true; } if (empty($area)) { // Don't match on empty values. continue; } if ($area === $host) { // Exact matches. return \true; } // Special match if the area when prefixed with ".". Remove any // existing leading "." and add a new leading ".". $area = '.' . \ltrim($area, '.'); if (\substr($host, -\strlen($area)) === $area) { return \true; } } return \false; } /** * Wrapper for json_decode that throws when an error occurs. * * @param string $json JSON data to parse * @param bool $assoc When true, returned objects will be converted * into associative arrays. * @param int $depth User specified recursion depth. * @param int $options Bitmask of JSON decode options. * * @return object|array|string|int|float|bool|null * * @throws InvalidArgumentException if the JSON cannot be decoded. * * @see https://www.php.net/manual/en/function.json-decode.php */ public static function jsonDecode(string $json, bool $assoc = \false, int $depth = 512, int $options = 0) { $data = \json_decode($json, $assoc, $depth, $options); if (\JSON_ERROR_NONE !== \json_last_error()) { throw new InvalidArgumentException('json_decode error: ' . \json_last_error_msg()); } return $data; } /** * Wrapper for JSON encoding that throws when an error occurs. * * @param mixed $value The value being encoded * @param int $options JSON encode option bitmask * @param int $depth Set the maximum depth. Must be greater than zero. * * @throws InvalidArgumentException if the JSON cannot be encoded. * * @see https://www.php.net/manual/en/function.json-encode.php */ public static function jsonEncode($value, int $options = 0, int $depth = 512) : string { $json = \json_encode($value, $options, $depth); if (\JSON_ERROR_NONE !== \json_last_error()) { throw new InvalidArgumentException('json_encode error: ' . \json_last_error_msg()); } /** @var string */ return $json; } /** * Wrapper for the hrtime() or microtime() functions * (depending on the PHP version, one of the two is used) * * @return float UNIX timestamp * * @internal */ public static function currentTime() : float { return (float) \function_exists('hrtime') ? \hrtime(\true) / 1000000000.0 : \microtime(\true); } /** * @throws InvalidArgumentException * * @internal */ public static function idnUriConvert(UriInterface $uri, int $options = 0) : UriInterface { if ($uri->getHost()) { $asciiHost = self::idnToAsci($uri->getHost(), $options, $info); if ($asciiHost === \false) { $errorBitSet = $info['errors'] ?? 0; $errorConstants = \array_filter(\array_keys(\get_defined_constants()), static function (string $name) : bool { return \substr($name, 0, 11) === 'IDNA_ERROR_'; }); $errors = []; foreach ($errorConstants as $errorConstant) { if ($errorBitSet & \constant($errorConstant)) { $errors[] = $errorConstant; } } $errorMessage = 'IDN conversion failed'; if ($errors) { $errorMessage .= ' (errors: ' . \implode(', ', $errors) . ')'; } throw new InvalidArgumentException($errorMessage); } if ($uri->getHost() !== $asciiHost) { // Replace URI only if the ASCII version is different $uri = $uri->withHost($asciiHost); } } return $uri; } /** * @internal */ public static function getenv(string $name) : ?string { if (isset($_SERVER[$name])) { return (string) $_SERVER[$name]; } if (\PHP_SAPI === 'cli' && ($value = \getenv($name)) !== \false && $value !== null) { return (string) $value; } return null; } /** * @return string|false */ private static function idnToAsci(string $domain, int $options, ?array &$info = []) { if (\function_exists('idn_to_ascii') && \defined('INTL_IDNA_VARIANT_UTS46')) { return \idn_to_ascii($domain, $options, \INTL_IDNA_VARIANT_UTS46, $info); } throw new \Error('ext-idn or symfony/polyfill-intl-idn not loaded or too old'); } } PK ��\�;~� � D vendor_prefixed/guzzlehttp/guzzle/src/Exception/RequestException.phpnu �[��� <?php namespace WPMailSMTP\Vendor\GuzzleHttp\Exception; use WPMailSMTP\Vendor\GuzzleHttp\BodySummarizer; use WPMailSMTP\Vendor\GuzzleHttp\BodySummarizerInterface; use WPMailSMTP\Vendor\Psr\Http\Client\RequestExceptionInterface; use WPMailSMTP\Vendor\Psr\Http\Message\RequestInterface; use WPMailSMTP\Vendor\Psr\Http\Message\ResponseInterface; /** * HTTP Request exception */ class RequestException extends TransferException implements RequestExceptionInterface { /** * @var RequestInterface */ private $request; /** * @var ResponseInterface|null */ private $response; /** * @var array */ private $handlerContext; public function __construct(string $message, RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $previous = null, array $handlerContext = []) { // Set the code of the exception if the response is set and not future. $code = $response ? $response->getStatusCode() : 0; parent::__construct($message, $code, $previous); $this->request = $request; $this->response = $response; $this->handlerContext = $handlerContext; } /** * Wrap non-RequestExceptions with a RequestException */ public static function wrapException(RequestInterface $request, \Throwable $e) : RequestException { return $e instanceof RequestException ? $e : new RequestException($e->getMessage(), $request, null, $e); } /** * Factory method to create a new exception with a normalized error message * * @param RequestInterface $request Request sent * @param ResponseInterface $response Response received * @param \Throwable|null $previous Previous exception * @param array $handlerContext Optional handler context * @param BodySummarizerInterface|null $bodySummarizer Optional body summarizer */ public static function create(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $previous = null, array $handlerContext = [], ?BodySummarizerInterface $bodySummarizer = null) : self { if (!$response) { return new self('Error completing request', $request, null, $previous, $handlerContext); } $level = (int) \floor($response->getStatusCode() / 100); if ($level === 4) { $label = 'Client error'; $className = ClientException::class; } elseif ($level === 5) { $label = 'Server error'; $className = ServerException::class; } else { $label = 'Unsuccessful request'; $className = __CLASS__; } $uri = \WPMailSMTP\Vendor\GuzzleHttp\Psr7\Utils::redactUserInfo($request->getUri()); // Client Error: `GET /` resulted in a `404 Not Found` response: // <html> ... (truncated) $message = \sprintf('%s: `%s %s` resulted in a `%s %s` response', $label, $request->getMethod(), $uri->__toString(), $response->getStatusCode(), $response->getReasonPhrase()); $summary = ($bodySummarizer ?? new BodySummarizer())->summarize($response); if ($summary !== null) { $message .= ":\n{$summary}\n"; } return new $className($message, $request, $response, $previous, $handlerContext); } /** * Get the request that caused the exception */ public function getRequest() : RequestInterface { return $this->request; } /** * Get the associated response */ public function getResponse() : ?ResponseInterface { return $this->response; } /** * Check if a response was received */ public function hasResponse() : bool { return $this->response !== null; } /** * Get contextual information about the error from the underlying handler. * * The contents of this array will vary depending on which handler you are * using. It may also be just an empty array. Relying on this data will * couple you to a specific handler, but can give more debug information * when needed. */ public function getHandlerContext() : array { return $this->handlerContext; } } PK ��\��HS� � D vendor_prefixed/guzzlehttp/guzzle/src/Exception/ConnectException.phpnu �[��� <?php namespace WPMailSMTP\Vendor\GuzzleHttp\Exception; use WPMailSMTP\Vendor\Psr\Http\Client\NetworkExceptionInterface; use WPMailSMTP\Vendor\Psr\Http\Message\RequestInterface; /** * Exception thrown when a connection cannot be established. * * Note that no response is present for a ConnectException */ class ConnectException extends TransferException implements NetworkExceptionInterface { /** * @var RequestInterface */ private $request; /** * @var array */ private $handlerContext; public function __construct(string $message, RequestInterface $request, ?\Throwable $previous = null, array $handlerContext = []) { parent::__construct($message, 0, $previous); $this->request = $request; $this->handlerContext = $handlerContext; } /** * Get the request that caused the exception */ public function getRequest() : RequestInterface { return $this->request; } /** * Get contextual information about the error from the underlying handler. * * The contents of this array will vary depending on which handler you are * using. It may also be just an empty array. Relying on this data will * couple you to a specific handler, but can give more debug information * when needed. */ public function getHandlerContext() : array { return $this->handlerContext; } } PK ��\ N>j� � C vendor_prefixed/guzzlehttp/guzzle/src/Exception/ClientException.phpnu �[��� <?php namespace WPMailSMTP\Vendor\GuzzleHttp\Exception; /** * Exception when a client error is encountered (4xx codes) */ class ClientException extends BadResponseException { } PK ��\��Tv� � C vendor_prefixed/guzzlehttp/guzzle/src/Exception/GuzzleException.phpnu �[��� <?php namespace WPMailSMTP\Vendor\GuzzleHttp\Exception; use WPMailSMTP\Vendor\Psr\Http\Client\ClientExceptionInterface; interface GuzzleException extends ClientExceptionInterface { } PK ��\.�9� � H vendor_prefixed/guzzlehttp/guzzle/src/Exception/BadResponseException.phpnu �[��� <?php namespace WPMailSMTP\Vendor\GuzzleHttp\Exception; use WPMailSMTP\Vendor\Psr\Http\Message\RequestInterface; use WPMailSMTP\Vendor\Psr\Http\Message\ResponseInterface; /** * Exception when an HTTP error occurs (4xx or 5xx error) */ class BadResponseException extends RequestException { public function __construct(string $message, RequestInterface $request, ResponseInterface $response, ?\Throwable $previous = null, array $handlerContext = []) { parent::__construct($message, $request, $response, $previous, $handlerContext); } /** * Current exception and the ones that extend it will always have a response. */ public function hasResponse() : bool { return \true; } /** * This function narrows the return type from the parent class and does not allow it to be nullable. */ public function getResponse() : ResponseInterface { /** @var ResponseInterface */ return parent::getResponse(); } } PK ��\�Λ� � C vendor_prefixed/guzzlehttp/guzzle/src/Exception/ServerException.phpnu �[��� <?php namespace WPMailSMTP\Vendor\GuzzleHttp\Exception; /** * Exception when a server error is encountered (5xx codes) */ class ServerException extends BadResponseException { } PK ��\��{�� � E vendor_prefixed/guzzlehttp/guzzle/src/Exception/TransferException.phpnu �[��� <?php namespace WPMailSMTP\Vendor\GuzzleHttp\Exception; class TransferException extends \RuntimeException implements GuzzleException { } PK ��\+ �w w M vendor_prefixed/guzzlehttp/guzzle/src/Exception/TooManyRedirectsException.phpnu �[��� <?php namespace WPMailSMTP\Vendor\GuzzleHttp\Exception; class TooManyRedirectsException extends RequestException { } PK ��\@#$� � L vendor_prefixed/guzzlehttp/guzzle/src/Exception/InvalidArgumentException.phpnu �[��� <?php namespace WPMailSMTP\Vendor\GuzzleHttp\Exception; final class InvalidArgumentException extends \InvalidArgumentException implements GuzzleException { } PK ��\� %� � : vendor_prefixed/guzzlehttp/guzzle/src/MessageFormatter.phpnu �[��� <?php namespace WPMailSMTP\Vendor\GuzzleHttp; use WPMailSMTP\Vendor\Psr\Http\Message\MessageInterface; use WPMailSMTP\Vendor\Psr\Http\Message\RequestInterface; use WPMailSMTP\Vendor\Psr\Http\Message\ResponseInterface; /** * Formats log messages using variable substitutions for requests, responses, * and other transactional data. * * The following variable substitutions are supported: * * - {request}: Full HTTP request message * - {response}: Full HTTP response message * - {ts}: ISO 8601 date in GMT * - {date_iso_8601} ISO 8601 date in GMT * - {date_common_log} Apache common log date using the configured timezone. * - {host}: Host of the request * - {method}: Method of the request * - {uri}: URI of the request * - {version}: Protocol version * - {target}: Request target of the request (path + query + fragment) * - {hostname}: Hostname of the machine that sent the request * - {code}: Status code of the response (if available) * - {phrase}: Reason phrase of the response (if available) * - {error}: Any error messages (if available) * - {req_header_*}: Replace `*` with the lowercased name of a request header to add to the message * - {res_header_*}: Replace `*` with the lowercased name of a response header to add to the message * - {req_headers}: Request headers * - {res_headers}: Response headers * - {req_body}: Request body * - {res_body}: Response body * * @final */ class MessageFormatter implements MessageFormatterInterface { /** * Apache Common Log Format. * * @see https://httpd.apache.org/docs/2.4/logs.html#common * * @var string */ public const CLF = '{hostname} {req_header_User-Agent} - [{date_common_log}] "{method} {target} HTTP/{version}" {code} {res_header_Content-Length}'; public const DEBUG = ">>>>>>>>\n{request}\n<<<<<<<<\n{response}\n--------\n{error}"; public const SHORT = '[{ts}] "{method} {target} HTTP/{version}" {code}'; /** * @var string Template used to format log messages */ private $template; /** * @param string $template Log message template */ public function __construct(?string $template = self::CLF) { $this->template = $template ?: self::CLF; } /** * Returns a formatted message string. * * @param RequestInterface $request Request that was sent * @param ResponseInterface|null $response Response that was received * @param \Throwable|null $error Exception that was received */ public function format(RequestInterface $request, ?ResponseInterface $response = null, ?\Throwable $error = null) : string { $cache = []; /** @var string */ return \preg_replace_callback('/{\\s*([A-Za-z_\\-\\.0-9]+)\\s*}/', function (array $matches) use($request, $response, $error, &$cache) { if (isset($cache[$matches[1]])) { return $cache[$matches[1]]; } $result = ''; switch ($matches[1]) { case 'request': $result = Psr7\Message::toString($request); break; case 'response': $result = $response ? Psr7\Message::toString($response) : ''; break; case 'req_headers': $result = \trim($request->getMethod() . ' ' . $request->getRequestTarget()) . ' HTTP/' . $request->getProtocolVersion() . "\r\n" . $this->headers($request); break; case 'res_headers': $result = $response ? \sprintf('HTTP/%s %d %s', $response->getProtocolVersion(), $response->getStatusCode(), $response->getReasonPhrase()) . "\r\n" . $this->headers($response) : 'NULL'; break; case 'req_body': $result = $request->getBody()->__toString(); break; case 'res_body': if (!$response instanceof ResponseInterface) { $result = 'NULL'; break; } $body = $response->getBody(); if (!$body->isSeekable()) { $result = 'RESPONSE_NOT_LOGGEABLE'; break; } $result = $response->getBody()->__toString(); break; case 'ts': case 'date_iso_8601': $result = \gmdate('c'); break; case 'date_common_log': $result = \date('d/M/Y:H:i:s O'); break; case 'method': $result = $request->getMethod(); break; case 'version': $result = $request->getProtocolVersion(); break; case 'uri': case 'url': $result = $request->getUri()->__toString(); break; case 'target': $result = $request->getRequestTarget(); break; case 'req_version': $result = $request->getProtocolVersion(); break; case 'res_version': $result = $response ? $response->getProtocolVersion() : 'NULL'; break; case 'host': $result = $request->getHeaderLine('Host'); break; case 'hostname': $result = \gethostname(); break; case 'code': $result = $response ? $response->getStatusCode() : 'NULL'; break; case 'phrase': $result = $response ? $response->getReasonPhrase() : 'NULL'; break; case 'error': $result = $error ? $error->getMessage() : 'NULL'; break; default: // handle prefixed dynamic headers if (\strpos($matches[1], 'req_header_') === 0) { $result = $request->getHeaderLine(\substr($matches[1], 11)); } elseif (\strpos($matches[1], 'res_header_') === 0) { $result = $response ? $response->getHeaderLine(\substr($matches[1], 11)) : 'NULL'; } } $cache[$matches[1]] = $result; return $result; }, $this->template); } /** * Get headers from message as string */ private function headers(MessageInterface $message) : string { $result = ''; foreach ($message->getHeaders() as $name => $values) { $result .= $name . ': ' . \implode(', ', $values) . "\r\n"; } return \trim($result); } } PK ��\�)KR� � ; vendor_prefixed/guzzlehttp/guzzle/src/functions_include.phpnu �[��� <?php namespace WPMailSMTP\Vendor; // Don't redefine the functions if included multiple times. if (!\function_exists('WPMailSMTP\\Vendor\\GuzzleHttp\\describe_type')) { require __DIR__ . '/functions.php'; } PK ��\�%�B B <