HEX
Server: nginx
System: Linux pool64-304-45.dca.atomicsites.net 5.10.0-31-amd64 #1 SMP Debian 5.10.221-1 (2024-07-14) x86_64
User: (0)
PHP: 8.4.18
Disabled: pcntl_fork
Upload Files
File: /wordpress/mu-plugins/photon-subsizes-loader.php
<?php

function photon_subsizes_loader() {
	$should_load = false;

	if ( defined( 'PHOTON_SUBSIZES' ) ) {
		// Enabled by user-defined constant
		$should_load = !! PHOTON_SUBSIZES;
	} else if ( '' !== AT_PHOTON_SUBSIZES ) {
		// Respect platform setting but allow user to override in case it causes issues
		$should_load = apply_filters( 'photon_subsizes_enable', !! AT_PHOTON_SUBSIZES );
	} else {
		// Default loading policy

		$is_newspack = 6 == constant( 'ATOMIC_CLIENT_ID' );
		$is_wpcom_and_should_load = (
			'wp_uploads' !== constant( 'AT_PRIVACY_MODEL' ) &&
			2 == constant( 'ATOMIC_CLIENT_ID' )
		);

		// Allow filtering default loading behavior so sites that
		// urgently need to disable the feature can do so with ease
		$should_load = apply_filters(
			'photon_subsizes_enable',
			$is_newspack || $is_wpcom_and_should_load
		);
	}

	if ( $should_load ) {
		require_once __DIR__ . '/photon-subsizes/photon-subsizes.php';
	}
}
add_action( 'muplugins_loaded', 'photon_subsizes_loader' );