ヤミRoot VoidGate
User / IP
:
216.73.216.137
Host / Server
:
173.201.252.198 / gabrieltopman.com
System
:
Linux p3plzcpnl482572.prod.phx3.secureserver.net 4.18.0-553.54.1.lve.el8.x86_64 #1 SMP Wed Jun 4 13:01:13 UTC 2025 x86_64
Command
|
Upload
|
Mass Deface
|
Create
:
/
home
/
l1ltxx5gqn9k
/
www
/
wp-content
/
plugins
/
wp-defender
/
framework
/
helper
/
Viewing: class-route.php
<?php /** * Helper to enqueue ajax route, also generate the nonce's. * * @package Calotes\Helper */ namespace Calotes\Helper; /** * Helper to enqueue ajax route, also generate the nonce's. */ class Route { /** * Array to store registered routes. * * @var array */ protected static $routes = array(); /** * Array to store nonce's for registered routes. * * @var array */ protected static $nonces = array(); /** * Registers a new route for handling AJAX requests. * * @param mixed $name The name of the route. * @param mixed $category The category of the route. * @param mixed $route The route to be registered. * @param mixed $callback The callback function to handle the request. * @param bool $nopriv Whether the route should be accessible without authentication. */ public static function register_route( $name, $category, $route, $callback, $nopriv = false ) { $namespace = self::get_namespace( $category ); $route = $namespace . '/' . $route; add_action( 'wp_ajax_' . $route, $callback ); if ( true === $nopriv ) { add_action( 'wp_ajax_nopriv_' . $route, $callback ); } if ( ! isset( self::$routes[ $category ] ) ) { self::$routes[ $category ] = array(); self::$nonces[ $category ] = array(); } self::$routes[ $category ][ $name ] = $route; self::$nonces[ $category ][ $name ] = wp_create_nonce( $name . $category ); } /** * Retrieves the exported routes and nonce's for the specified categories. * * @param mixed $categories The categories for which to export routes and nonce's. * * @return array The exported routes and nonce's. */ public static function export_routes( $categories ) { $routes = self::$routes[ $categories ] ?? array(); $nonces = self::$nonces[ $categories ] ?? array(); return array( $routes, $nonces ); } /** * Retrieves the namespace for a given module. * * @param mixed $module The module for which to retrieve the namespace. * * @return string The namespace for the specified module. */ public static function get_namespace( $module ) { return 'wp-defender/v1/' . $module; } }
Coded With 💗 by
0x6ick