HEX
Server: nginx/1.24.0
System: Linux 0c1023d6c65e 6.8.0-137-generic #137-Ubuntu SMP PREEMPT_DYNAMIC Fri Jul 17 20:28:23 UTC 2026 x86_64
User: root (0)
PHP: 8.3.33
Disabled: NONE
Upload Files
File: /var/www/html/wp-content/mu-plugins/ethnic-disclaimer-page.php
<?php
/**
 * Plugin Name: Ethnic Disclaimer Page
 * Description: Creates and renders a plain text Disclaimer page.
 * Version: 1.0.0
 */

if ( ! defined( 'ABSPATH' ) ) {
	exit;
}

if ( ! function_exists( 'ethnic_disclaimer_page_get_target_page' ) ) {
	function ethnic_disclaimer_page_get_target_page() {
		return get_page_by_path( 'disclaimer' );
	}
}

if ( ! function_exists( 'ethnic_disclaimer_page_ensure_page' ) ) {
	function ethnic_disclaimer_page_ensure_page() {
		$page = ethnic_disclaimer_page_get_target_page();

		if ( $page instanceof WP_Post ) {
			return;
		}

		$page_id = wp_insert_post(
			array(
				'post_title'     => 'Disclaimer',
				'post_name'      => 'disclaimer',
				'post_status'    => 'publish',
				'post_type'      => 'page',
				'post_content'   => '',
				'post_parent'    => 0,
				'comment_status' => 'closed',
			)
		);

		if ( $page_id && ! is_wp_error( $page_id ) ) {
			update_post_meta( $page_id, '_wp_page_template', 'default' );
		}
	}

	add_action( 'init', 'ethnic_disclaimer_page_ensure_page', 5 );
}

if ( ! function_exists( 'ethnic_disclaimer_page_request_matches' ) ) {
	function ethnic_disclaimer_page_request_matches() {
		if ( is_admin() ) {
			return false;
		}

		$request_uri = isset( $_SERVER['REQUEST_URI'] ) ? (string) wp_unslash( $_SERVER['REQUEST_URI'] ) : '';
		$request_uri = wp_parse_url( $request_uri, PHP_URL_PATH );
		$request_uri = is_string( $request_uri ) ? untrailingslashit( $request_uri ) : '';

		$target_path = wp_parse_url( home_url( '/disclaimer/' ), PHP_URL_PATH );
		$target_path = is_string( $target_path ) ? untrailingslashit( $target_path ) : '/disclaimer';

		return '' !== $request_uri && $request_uri === $target_path;
	}
}

if ( ! function_exists( 'ethnic_disclaimer_page_is_target' ) ) {
	function ethnic_disclaimer_page_is_target() {
		if ( ethnic_disclaimer_page_request_matches() ) {
			return true;
		}

		if ( is_admin() ) {
			return false;
		}

		$page = ethnic_disclaimer_page_get_target_page();

		if ( ! ( $page instanceof WP_Post ) ) {
			return false;
		}

		return (int) get_queried_object_id() === (int) $page->ID || is_page( (int) $page->ID );
	}
}

if ( ! function_exists( 'ethnic_disclaimer_page_body_class' ) ) {
	function ethnic_disclaimer_page_body_class( $classes ) {
		if ( ethnic_disclaimer_page_is_target() ) {
			$classes[] = 'ethnic-disclaimer-active';
		}

		return $classes;
	}

	add_filter( 'body_class', 'ethnic_disclaimer_page_body_class' );
}

if ( ! function_exists( 'ethnic_disclaimer_page_data' ) ) {
	function ethnic_disclaimer_page_data() {
		static $data = null;

		if ( null !== $data ) {
			return $data;
		}

		$data = array(
			'meta_title'       => 'Disclaimer | Ethnic Infotech',
			'meta_description' => 'Read our Disclaimer to understand the informational nature of website content, no-guarantee statements, service limitations, third-party link notice, and general responsibility boundaries.',
			'contact_url'      => 'https://ethnicinfotech.com/contact-us/',
		);

		return $data;
	}
}

if ( ! function_exists( 'ethnic_disclaimer_page_render_content' ) ) {
	function ethnic_disclaimer_page_render_content() {
		$data        = ethnic_disclaimer_page_data();
		$contact_url = isset( $data['contact_url'] ) ? (string) $data['contact_url'] : home_url( '/contact-us/' );

		ob_start();
		?>
		<div class="ethnic-disclaimer">
			<div class="ethnic-disclaimer__inner">
				<h1>Disclaimer</h1>
				<p><strong>Effective Date:</strong> 16th May 2026</p>
				<p>The content on this website is provided for general informational purposes only. It is intended to help visitors understand the company, its services, case studies, resources, and general business context, but it should not be treated as formal advice or a guaranteed representation of results.</p>

				<h2>1. General Information Only</h2>
				<p>Content on the website is intended for general informational and business reference purposes. This may include service descriptions, case studies, resource materials, industry information, and general business guidance.</p>
				<p>Website content should not be treated as formal professional advice or as a final statement applicable to every business situation.</p>

				<h2>2. No Professional Advice</h2>
				<p>Nothing on the website should be considered legal, financial, tax, compliance, investment, regulatory, or other regulated professional advice.</p>
				<p>Users should seek appropriate professional advice before making decisions based on website content. The company&rsquo;s website content is not a substitute for direct consultation, professional review, or formal written agreements.</p>

				<h2>3. No Guaranteed Results</h2>
				<p>References to outcomes, case studies, capabilities, performance, project examples, or business improvements are intended to describe past work or general service direction only. They do not guarantee similar results for every business or project.</p>
				<p>Results may vary depending on goals, scope, timing, budget, systems, market conditions, implementation decisions, operational readiness, and other factors. Service information should not be interpreted as a promise of specific business performance.</p>

				<h2>4. Service Information and Engagement</h2>
				<p>Descriptions of services on the website are general in nature and are provided to explain areas of work, capabilities, and typical project support.</p>
				<p>Website content does not by itself create a client, vendor, advisory, or contractual relationship. Any formal engagement is subject to separate discussion, review, scope definition, and agreed written terms.</p>

				<h2>5. Accuracy and Completeness</h2>
				<p>The company aims to keep website information reasonably current and useful. However, the company does not guarantee that all content is complete, current, accurate, or suitable for every purpose or decision-making need.</p>
				<p>Content may change over time without notice.</p>

				<h2>6. Third-Party Links and External Content</h2>
				<p>The website may contain links to third-party websites, platforms, tools, or content. These may be included for convenience, reference, operational support, or general business use.</p>
				<p>The company is not responsible for the content, availability, accuracy, security, or practices of third-party websites or services. Users access third-party resources at their own discretion.</p>

				<h2>7. Downloads and Resources</h2>
				<p>Downloadable guides, whitepapers, checklists, profiles, and other materials are provided for general informational purposes only. These materials do not create guarantees, commitments, or professional advice obligations.</p>
				<p>Users should independently evaluate how any downloaded material applies to their business, project, or decision-making context.</p>

				<h2>8. Limitation of Responsibility</h2>
				<p>To the extent permitted by law, the company is not responsible for losses, damages, or decisions made in reliance on website content. Users are responsible for evaluating information before acting on it.</p>
				<p>Important decisions should be supported by direct consultation, formal review, and appropriate agreements where needed.</p>

				<h2>9. Changes to This Disclaimer</h2>
				<p>The company may update this Disclaimer from time to time. Updated versions may be posted on the website with a revised effective date.</p>

				<h2>10. Contact Us</h2>
				<p>If you have questions about this Disclaimer, please contact us using the details below:</p>
				<p><strong>Company Name:</strong> Ethnic Infotech Pvt. Ltd.</p>
				<p><strong>Contact Email:</strong> info@ethnicinfotech.com</p>
				<p><strong>Contact Page:</strong> <a href="<?php echo esc_url( $contact_url ); ?>"><?php echo esc_html( $contact_url ); ?></a></p>
			</div>
		</div>
		<?php

		return (string) ob_get_clean();
	}
}

if ( ! function_exists( 'ethnic_disclaimer_page_filter_content' ) ) {
	function ethnic_disclaimer_page_filter_content( $content ) {
		if ( ! ethnic_disclaimer_page_is_target() || ! in_the_loop() || ! is_main_query() ) {
			return $content;
		}

		return ethnic_disclaimer_page_render_content();
	}

	add_filter( 'the_content', 'ethnic_disclaimer_page_filter_content', 20 );
}

if ( ! function_exists( 'ethnic_disclaimer_page_render_template_fallback' ) ) {
	function ethnic_disclaimer_page_render_template_fallback() {
		if ( ! ethnic_disclaimer_page_request_matches() ) {
			return;
		}

		if ( ! is_404() ) {
			return;
		}

		$page = ethnic_disclaimer_page_get_target_page();

		if ( ! ( $page instanceof WP_Post ) ) {
			ethnic_disclaimer_page_ensure_page();
			$page = ethnic_disclaimer_page_get_target_page();
		}

		global $wp_query, $post;

		if ( $page instanceof WP_Post ) {
			$post = $page;
			setup_postdata( $post );
		}

		if ( $wp_query instanceof WP_Query ) {
			$wp_query->is_404            = false;
			$wp_query->is_page           = true;
			$wp_query->is_singular       = true;
			$wp_query->is_home           = false;
			$wp_query->is_archive        = false;
			$wp_query->queried_object    = $page instanceof WP_Post ? $page : null;
			$wp_query->queried_object_id = $page instanceof WP_Post ? (int) $page->ID : 0;
			$wp_query->post              = $page instanceof WP_Post ? $page : null;
			$wp_query->posts             = $page instanceof WP_Post ? array( $page ) : array();
			$wp_query->post_count        = $page instanceof WP_Post ? 1 : 0;
			$wp_query->found_posts       = $page instanceof WP_Post ? 1 : 0;
			$wp_query->max_num_pages     = 1;
		}

		status_header( 200 );

		get_header();
		echo ethnic_disclaimer_page_render_content(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
		get_footer();
		exit;
	}

	add_action( 'template_redirect', 'ethnic_disclaimer_page_render_template_fallback', 1 );
}

if ( ! function_exists( 'ethnic_disclaimer_page_document_title' ) ) {
	function ethnic_disclaimer_page_document_title( $title ) {
		if ( ! ethnic_disclaimer_page_is_target() ) {
			return $title;
		}

		$data         = ethnic_disclaimer_page_data();
		$custom_title = isset( $data['meta_title'] ) ? trim( (string) $data['meta_title'] ) : '';

		if ( '' !== $custom_title ) {
			return $custom_title;
		}

		return $title;
	}

	add_filter( 'pre_get_document_title', 'ethnic_disclaimer_page_document_title' );
}

if ( ! function_exists( 'ethnic_disclaimer_page_head' ) ) {
	function ethnic_disclaimer_page_head() {
		if ( ! ethnic_disclaimer_page_is_target() ) {
			return;
		}

		$data = ethnic_disclaimer_page_data();
		$meta = isset( $data['meta_description'] ) ? trim( (string) $data['meta_description'] ) : '';

		if ( '' !== $meta ) {
			echo '<meta name="description" content="' . esc_attr( $meta ) . '">' . "\n";
		}
		?>
		<style id="ethnic-disclaimer-page">
			body.ethnic-disclaimer-active #page-title.page-title-block.custom-page-title {
				display: none !important;
			}

			body.ethnic-disclaimer-active #main,
			body.ethnic-disclaimer-active .block-content,
			body.ethnic-disclaimer-active .fullwidth-content {
				background: transparent !important;
			}

			.ethnic-disclaimer {
				max-width: 880px;
				margin: 0 auto;
				padding: 48px 20px 72px;
				color: #18212c;
			}

			.ethnic-disclaimer__inner {
				max-width: 100%;
			}

			.ethnic-disclaimer h1,
			.ethnic-disclaimer h2,
			.ethnic-disclaimer h3 {
				margin: 0;
				color: #18212c;
			}

			.ethnic-disclaimer h1 {
				font-size: clamp(34px, 4vw, 48px);
				line-height: 1.08;
				letter-spacing: -0.04em;
				margin-bottom: 18px;
			}

			.ethnic-disclaimer h2 {
				font-size: clamp(24px, 2.4vw, 30px);
				line-height: 1.2;
				letter-spacing: -0.03em;
				margin-top: 40px;
				margin-bottom: 16px;
			}

			.ethnic-disclaimer h3 {
				font-size: 18px;
				line-height: 1.35;
				margin-top: 22px;
				margin-bottom: 10px;
			}

			.ethnic-disclaimer p,
			.ethnic-disclaimer li {
				font-size: 16px;
				line-height: 1.8;
				color: #425066;
			}

			.ethnic-disclaimer p {
				margin: 0 0 16px;
			}

			.ethnic-disclaimer ul {
				margin: 0 0 18px 20px;
				padding: 0;
			}

			.ethnic-disclaimer li {
				margin: 0 0 8px;
			}

			.ethnic-disclaimer a {
				color: #2f6bff;
				text-decoration: underline;
			}

			.ethnic-disclaimer strong {
				color: #18212c;
			}

			@media (max-width: 767px) {
				.ethnic-disclaimer {
					padding: 36px 18px 56px;
				}

				.ethnic-disclaimer h2 {
					margin-top: 32px;
				}
			}
		</style>
		<?php
	}

	add_action( 'wp_head', 'ethnic_disclaimer_page_head', 20 );
}