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-privacy-policy-page.php
<?php
/**
 * Plugin Name: Ethnic Privacy Policy Page
 * Description: Creates and renders a plain text Privacy Policy page.
 * Version: 1.0.0
 */

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

if ( ! function_exists( 'ethnic_privacy_policy_page_get_target_page' ) ) {
	function ethnic_privacy_policy_page_get_target_page() {
		return get_page_by_path( 'privacy-policy' );
	}
}

if ( ! function_exists( 'ethnic_privacy_policy_page_request_matches' ) ) {
	function ethnic_privacy_policy_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( '/privacy-policy/' ), PHP_URL_PATH );
		$target_path = is_string( $target_path ) ? untrailingslashit( $target_path ) : '/privacy-policy';

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

if ( ! function_exists( 'ethnic_privacy_policy_page_ensure_page' ) ) {
	function ethnic_privacy_policy_page_ensure_page() {
		$page = ethnic_privacy_policy_page_get_target_page();

		if ( $page instanceof WP_Post ) {
			return;
		}

		$page_id = wp_insert_post(
			array(
				'post_title'     => 'Privacy Policy',
				'post_name'      => 'privacy-policy',
				'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_privacy_policy_page_ensure_page', 5 );
}

if ( ! function_exists( 'ethnic_privacy_policy_page_is_target' ) ) {
	function ethnic_privacy_policy_page_is_target() {
		if ( ethnic_privacy_policy_page_request_matches() ) {
			return true;
		}

		if ( is_admin() ) {
			return false;
		}

		$page = ethnic_privacy_policy_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_privacy_policy_page_body_class' ) ) {
	function ethnic_privacy_policy_page_body_class( $classes ) {
		if ( ethnic_privacy_policy_page_is_target() ) {
			$classes[] = 'ethnic-privacy-policy-active';
		}

		return $classes;
	}

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

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

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

		$data = array(
			'meta_title'       => 'Privacy Policy | Ethnic Infotech',
			'meta_description' => 'Read our Privacy Policy to understand what information we collect, how we use it, cookies and analytics practices, proposal and inquiry form handling, login activity data, and your privacy choices.',
			'contact_url'      => 'https://ethnicinfotech.com/contact-us/',
		);

		return $data;
	}
}

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

		ob_start();
		?>
		<div class="ethnic-privacy-policy">
			<div class="ethnic-privacy-policy__inner">
				<h1>Privacy Policy</h1>
				<p><strong>Effective Date:</strong> 16th May 2026</p>
				<p>This Privacy Policy explains how the company collects, uses, stores, and handles information through this website and related interactions. It is intended to provide a general overview of the information we collect and how that information may be used in connection with website activity, inquiries, proposal requests, login-related activity, and operational support.</p>

				<h2>1. Information We Collect</h2>
				<h3>Information You Provide</h3>
				<p>We may collect information that you choose to submit through the website or related communications. This may include:</p>
				<ul>
					<li>Name</li>
					<li>Email address</li>
					<li>Phone number</li>
					<li>Company name</li>
					<li>Project details, proposal details, business requirements, or inquiry information submitted through forms</li>
					<li>Budget, timeline, service requirements, or supporting notes provided through proposal or inquiry forms</li>
					<li>Uploaded files or documents, such as briefs, wireframes, decks, or other materials, if those features are available and used</li>
				</ul>

				<h3>Information Collected Automatically</h3>
				<p>We may also collect certain technical and usage-related information automatically when you use the website. This may include:</p>
				<ul>
					<li>Login-related information</li>
					<li>Browser and device information</li>
					<li>IP address</li>
					<li>Session activity and website usage data</li>
					<li>Analytics and general interaction patterns</li>
				</ul>

				<h2>2. How We Use Information</h2>
				<p>Information collected through the website may be used to:</p>
				<ul>
					<li>Respond to inquiries and contact requests</li>
					<li>Review proposal requests and understand project requirements</li>
					<li>Communicate with users about services, requests, or follow-up questions</li>
					<li>Manage account or login activity where login functionality exists</li>
					<li>Improve website performance, reliability, and user experience</li>
					<li>Understand website usage patterns and visitor behavior</li>
					<li>Protect the website, detect misuse, and support security monitoring</li>
				</ul>

				<h2>3. Cookies and Analytics</h2>
				<p>The website may use cookies or similar technologies to support normal website functionality, session handling, performance monitoring, and analytics. Cookies can help us understand how the website is used and can also support a more reliable browsing experience.</p>
				<p>Where applicable, users may be able to manage cookies through their browser settings. Disabling cookies may affect certain features or website behavior.</p>

				<h3>Google Analytics</h3>
				<p>We use Google Analytics to understand website usage, page activity, and general visitor behavior. This information helps us improve the website, understand content performance, and review how visitors interact with the site over time.</p>

				<h2>4. Proposal and Inquiry Form Information</h2>
				<p>When users submit proposal forms, contact forms, resource forms, or other inquiries through the website, we may collect the information included in those forms. This may include contact details, company information, project requirements, budget details, timeline information, service interests, and uploaded files or documents if they are provided.</p>
				<p>This information is used to review the request, understand the context of the inquiry, and respond in a way that is relevant to the request submitted.</p>

				<h2>5. Login Activity and Account Information</h2>
				<p>If the website or related systems include login functionality, we may collect login-related information. This may include login timestamps, session activity, account identifiers, and security-related logs.</p>
				<p>This information may be used for authentication, account administration, troubleshooting, operational support, and security review.</p>

				<h2>6. Third-Party Services</h2>
				<p>The website may use third-party services that support analytics, hosting, communication, scheduling, file handling, or related operational needs. These tools may process limited information as part of providing their services.</p>
				<p>Third-party services may include Google Analytics and other service providers used to operate the website or support business processes.</p>

				<h2>7. Data Sharing and Retention</h2>
				<p>Information may be shared with service providers or operational partners that help us run the website, manage communications, support forms, process inquiries, maintain systems, or perform related business functions.</p>
				<p>Information is retained for as long as reasonably necessary for communication, operational review, service delivery, security monitoring, recordkeeping, or legal and compliance-related purposes.</p>

				<h2>8. Your Rights</h2>
				<p>Depending on the situation and applicable requirements, users may request:</p>
				<ul>
					<li>Access to information associated with them</li>
					<li>Correction of inaccurate information</li>
					<li>Deletion of information where appropriate</li>
					<li>More information about how data is handled</li>
				</ul>
				<p>Requests may be reviewed in light of operational, security, and legal considerations.</p>

				<h2>9. Contact Us</h2>
				<p>If you have questions about this Privacy Policy or how information is handled, please contact us using the details below:</p>
				<p><strong>Company Name:</strong> Ethnic Infotech Pvt. Ltd.</p>
				<p><strong>Privacy 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_privacy_policy_page_filter_content' ) ) {
	function ethnic_privacy_policy_page_filter_content( $content ) {
		if ( ! ethnic_privacy_policy_page_is_target() || ! in_the_loop() || ! is_main_query() ) {
			return $content;
		}

		return ethnic_privacy_policy_page_render_content();
	}

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

if ( ! function_exists( 'ethnic_privacy_policy_page_render_template_fallback' ) ) {
	function ethnic_privacy_policy_page_render_template_fallback() {
		if ( ! ethnic_privacy_policy_page_request_matches() ) {
			return;
		}

		if ( ! is_404() ) {
			return;
		}

		$page = ethnic_privacy_policy_page_get_target_page();

		if ( ! ( $page instanceof WP_Post ) ) {
			ethnic_privacy_policy_page_ensure_page();
			$page = ethnic_privacy_policy_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_privacy_policy_page_render_content(); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped
		get_footer();
		exit;
	}

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

if ( ! function_exists( 'ethnic_privacy_policy_page_document_title' ) ) {
	function ethnic_privacy_policy_page_document_title( $title ) {
		if ( ! ethnic_privacy_policy_page_is_target() ) {
			return $title;
		}

		$data          = ethnic_privacy_policy_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_privacy_policy_page_document_title' );
}

if ( ! function_exists( 'ethnic_privacy_policy_page_head' ) ) {
	function ethnic_privacy_policy_page_head() {
		if ( ! ethnic_privacy_policy_page_is_target() ) {
			return;
		}

		$data = ethnic_privacy_policy_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-privacy-policy-page">
			body.ethnic-privacy-policy-active #page-title.page-title-block.custom-page-title {
				display: none !important;
			}

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

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

			.ethnic-privacy-policy__inner {
				max-width: 100%;
			}

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

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

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

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

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

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

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

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

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

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

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

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

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