| Server IP : 81.2.241.106 / Your IP : 216.73.216.165 Web Server : Apache/2.4.67 (Debian) System : Linux tranq-f.bakta.org 5.10.0-45-amd64 #1 SMP Debian 5.10.259-1 (2026-07-02) x86_64 User : lisky ( 1002) 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 : OFF Directory : /var/www/lisky/wp-content/plugins/weglot/ |
Upload File : |
<?php
if ( ! defined( 'ABSPATH' ) ) {
exit;
}
if ( ! function_exists( 'wp_doing_ajax' ) ) {
/**
* Compatibility WP < 4.7.0
* @return bool
*/
function wp_doing_ajax() {
/**
* Filters whether the current request is a WordPress Ajax request.
*
* @param bool $wp_doing_ajax Whether the current request is a WordPress Ajax request.
*
* @since 4.7.0
*
*/
return apply_filters( 'wp_doing_ajax', defined( 'DOING_AJAX' ) && DOING_AJAX );
}
}
if ( ! function_exists( 'wg_is_rest' ) ) {
/**
* Checks if the current request is a WP REST API request.
*
* Case #1: After WP_REST_Request initialisation
* Case #2: Support "plain" permalink settings
* Case #3: URL Path begins with wp-json/ (your REST prefix)
* Also supports WP installations in subfolders
*
* @return boolean
* @author matzeeable
*/
function wg_is_rest() {
$prefix = rest_get_url_prefix();
if ( defined( 'REST_REQUEST' ) && REST_REQUEST // (#1)
|| isset( $_GET['rest_route'] ) //phpcs:ignore
&& strpos( trim( $_GET['rest_route'], '\\/' ), $prefix, 0 ) === 0 ) { //phpcs:ignore
return true;
}
// (#3)
$rest_url = wp_parse_url( site_url( $prefix ) );
$current_url = wp_parse_url( add_query_arg( array() ) );
if( !isset( $current_url['path'] ) || !isset( $rest_url['path'] ) ) {
return false;
} else {
return strpos( $current_url['path'], $rest_url['path'], 0 ) === 0;
}
}
}
if ( ! function_exists( 'array_column' ) ) {
/**
* Compatibility for library weglot-php PHP 5.4
*
* @param array<string,mixed> $input
* @param int|string $column_key
* @param int|string $index_key
*
* @return bool|array<string,mixed>
*/
function array_column( array $input, $column_key, $index_key = null ) {
$array = array();
foreach ( $input as $value ) {
if ( ! array_key_exists( $column_key, $value ) ) {
trigger_error( esc_html("Key \"$column_key\" does not exist in array" ));
return false;
}
if ( is_null( $index_key ) ) {
$array[] = $value[ $column_key ];
} else {
if ( ! array_key_exists( $index_key, $value ) ) {
trigger_error( esc_html("Key \"$index_key\" does not exist in array" ));
return false;
}
if ( ! is_scalar( $value[ $index_key ] ) ) {
trigger_error( esc_html("Key \"$index_key\" does not contain scalar value" ) );
return false;
}
$array[ $value[ $index_key ] ] = $value[ $column_key ];
}
}
return $array;
}
}