| Server IP : 150.230.34.123 / Your IP : 216.73.217.23 Web Server : LiteSpeed System : Linux amd-instance-20210802-1657 5.15.0-1042-oracle #48~20.04.1-Ubuntu SMP Mon Aug 21 18:27:46 UTC 2023 x86_64 User : ubuntu ( 1001) PHP Version : 7.4.33 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wifcontinued,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_get_handler,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,pcntl_async_signals,pcntl_unshare, MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /usr/local/lsws/aloysius/html/wp-content/plugins/host-analyticsjs-local/includes/ |
Upload File : |
<?php
defined( 'ABSPATH' ) || exit;
/**
* @package CAOS
* @author Daan van den Bergh
* https://daan.dev
* @copyright © 2022 Daan van den Bergh
* @license BY-NC-ND-4.0
* http://creativecommons.org/licenses/by-nc-nd/4.0/
*/
class CAOS_Ajax {
/**
* Build class.
*
* @return void
*/
public function __construct() {
$this->init();
}
/**
* Init hooks and filters.
*
* @return void
*/
private function init() {
add_action( 'wp_ajax_caos_regenerate_alias', [ $this, 'regenerate_alias' ] );
}
/**
* Regenerate aliases and new files. Cleans up old files.
*
* @since v4.2.1
*
* @return void
*/
public function regenerate_alias() {
check_ajax_referer( CAOS_Admin_Settings::CAOS_ADMIN_PAGE, 'nonce' );
if ( ! current_user_can( 'manage_options' ) ) {
wp_die( __( "Sorry, you're not allowed to do this.", 'host-analyticsjs-local' ) );
}
global $caos_file_aliases;
if ( empty( $caos_file_aliases ) || ! $caos_file_aliases ) {
return;
}
foreach ( $caos_file_aliases as $file => $alias ) {
if ( file_exists( CAOS::get_local_dir() . $alias ) ) {
unlink( CAOS::get_local_dir() . $alias );
}
$caos_file_aliases[ $file ] = bin2hex( random_bytes( 4 ) ) . '.js';
}
CAOS::set_file_aliases( $caos_file_aliases, true );
}
}