WPZ

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

namespace WPMailSMTP\Admin;

use WPMailSMTP\EmailSendingDebug;
use WPMailSMTP\Options;

/**
 * WP Mail SMTP admin bar menu.
 *
 * @since 2.3.0
 */
class AdminBarMenu {

	/**
	 * Initialize class.
	 *
	 * @since 2.3.0
	 */
	public function init() {

		$this->hooks();
	}

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

		add_action( 'wp_enqueue_scripts', [ $this, 'enqueues' ] );
		add_action( 'admin_enqueue_scripts', [ $this, 'enqueues' ] );
		add_action( 'admin_bar_menu', [ $this, 'register' ], 999 );
	}

	/**
	 * Check if current user has access to see admin bar menu.
	 *
	 * @since 2.3.0
	 *
	 * @return bool
	 */
	public function has_access() {

		$access = false;

		if (
			is_user_logged_in() &&
			current_user_can( wp_mail_smtp()->get_capability_manage_options() )
		) {
			$access = true;
		}

		return apply_filters( 'wp_mail_smtp_admin_adminbarmenu_has_access', $access );
	}

	/**
	 * Check if new notifications are available.
	 *
	 * @since 2.3.0
	 *
	 * @return bool
	 */
	public function has_notifications() {

		return wp_mail_smtp()->get_notifications()->get_count();
	}

	/**
	 * Enqueue styles.
	 *
	 * @since 2.3.0
	 */
	public function enqueues() {

		if ( ! is_admin_bar_showing() ) {
			return;
		}

		if ( ! $this->has_access() ) {
			return;
		}

		wp_enqueue_style(
			'wp-mail-smtp-admin-bar',
			wp_mail_smtp()->assets_url . '/css/admin-bar.min.css',
			[],
			WPMS_PLUGIN_VER
		);
	}

	/**
	 * Register and render admin menu bar.
	 *
	 * @since 2.3.0
	 *
	 * @param \WP_Admin_Bar $wp_admin_bar WordPress Admin Bar object.
	 */
	public function register( \WP_Admin_Bar $wp_admin_bar ) {

		if (
			! $this->has_access() ||
			(
				(
					! $this->has_email_sending_errors() ||
					(bool) Options::init()->get( 'general', 'email_delivery_errors_hidden' )
				) &&
				empty( $this->has_notifications() )
			)
		) {
			return;
		}

		$items = apply_filters(
			'wp_mail_smtp_admin_adminbarmenu_register',
			[
				'main_menu',
			],
			$wp_admin_bar
		);

		foreach ( $items as $item ) {
			$this->{ $item }( $wp_admin_bar );

			do_action( "wp_mail_smtp_admin_adminbarmenu_register_{$item}_after", $wp_admin_bar );
		}
	}

	/**
	 * Render primary top-level admin menu bar item.
	 *
	 * @since 2.3.0
	 *
	 * @param \WP_Admin_Bar $wp_admin_bar WordPress Admin Bar object.
	 */
	public function main_menu( \WP_Admin_Bar $wp_admin_bar ) {

		if (
			$this->has_email_sending_errors() &&
			! (bool) Options::init()->get( 'general', 'email_delivery_errors_hidden' )
		) {
			$indicator = ' <span class="wp-mail-smtp-admin-bar-menu-error">!</span>';
		} elseif ( ! empty( $this->has_notifications() ) ) {
			$count     = $this->has_notifications() < 10 ? $this->has_notifications() : '!';
			$indicator = ' <div class="wp-mail-smtp-admin-bar-menu-notification-counter"><span>' . $count . '</span></div>';
		}

		if ( ! isset( $indicator ) ) {
			return;
		}

		$wp_admin_bar->add_menu(
			[
				'id'    => 'wp-mail-smtp-menu',
				'title' => 'WP Mail SMTP' . $indicator,
				'href'  => apply_filters(
					'wp_mail_smtp_admin_adminbarmenu_main_menu_href',
					wp_mail_smtp()->get_admin()->get_admin_page_url()
				),
			]
		);
	}

	/**
	 * Whether any active connection has a live (failed, regular-context) email
	 * sending error recorded.
	 *
	 * Matches the filter used by EmailSendingErrors so the admin bar indicator
	 * fires for the same set of failures shown by the inline error banner.
	 *
	 * @since 4.9.0
	 *
	 * @return bool
	 */
	private function has_email_sending_errors() {

		$all = EmailSendingDebug::get();

		if ( empty( $all ) ) {
			return false;
		}

		$live = array_filter(
			$all,
			static function ( $record ) {

				return isset( $record['status'], $record['context'] )
							 && $record['status'] === 'failed'
							 && $record['context'] === 'regular';
			}
		);

		return ! empty( $live );
	}
}
namawaktuukuranownerpermaksi
..
DebugEvents/ 2026-07-21 14:1448.33 KB 76129f60960:kundendxwrx-r--r
EmailSendingErrors/ 2026-07-21 14:1467.62 KB 76129f60960:kundendxwrx-r--r
Pages/ 2026-07-21 14:14223.83 KB 76129f60960:kundendxwrx-r--r
Recommendations/ 2026-07-21 14:1498.98 KB 76129f60960:kundendxwrx-r--r
AdminBarMenu.php 2026-07-21 14:143.8 KB 76129f60960:kunden-xw-x-----
edt
Area.php 2026-07-21 14:1451.57 KB 76129f60960:kunden-xw-x-----
edt
ConnectionSettings.php 2026-07-21 14:1417.6 KB 76129f60960:kunden-xw-x-----
edt
DashboardWidget.php 2026-07-21 14:1421.88 KB 76129f60960:kunden-xw-x-----
edt
DomainChecker.php 2026-07-21 14:144.48 KB 76129f60960:kunden-xw-x-----
edt
Education.php 2026-07-21 14:142.87 KB 76129f60960:kunden-xw-x-----
edt
FlyoutMenu.php 2026-07-21 14:144.12 KB 76129f60960:kunden-xw-x-----
edt
Notifications.php 2026-07-21 14:1413.29 KB 76129f60960:kunden-xw-x-----
edt
PageAbstract.php 2026-07-21 14:143.1 KB 76129f60960:kunden-xw-x-----
edt
PageInterface.php 2026-07-21 14:14551 B 76129f60960:kunden-xw-x-----
edt
ParentPageAbstract.php 2026-07-21 14:147.44 KB 76129f60960:kunden-xw-x-----
edt
PluginsInstallSkin.php 2026-07-21 14:141.19 KB 76129f60960:kunden-xw-x-----
edt
Review.php 2026-07-21 14:146.83 KB 76129f60960:kunden-xw-x-----
edt
SetupWizard.php 2026-07-21 14:1462.41 KB 76129f60960:kunden-xw-x-----
edt
WooCommerceActiveLayerEducation.php 2026-07-21 14:1411.42 KB 76129f60960:kunden-xw-x-----
edt
aksi pada path manual

cwd: /data/web/1/000/076/129/313906/htdocs/wp-content/plugins/wp-mail-smtp/src/Admin
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