| Server IP : 95.171.21.124 / Your IP : 216.73.216.71 Web Server : Apache/2.4.66 (Ubuntu) mod_fcgid/2.3.9 OpenSSL/3.0.2 System : Linux tr.turqaestate.com 5.15.0-186-generic #196-Ubuntu SMP Sat Jun 20 16:09:34 UTC 2026 x86_64 User : root ( 0) PHP Version : 8.3.30 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_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority,exec,system,passthru,shell_exec,proc_open,popen MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : OFF | Sudo : ON | Pkexec : ON Directory : /home/turqa/web/turqaestate.com/public_html/wp-content/plugins/wps-cleaner/classes/ |
Upload File : |
<?php
namespace WPS\WPS_Cleaner;
class Pub {
/**
*
* Return PF current user
*
* @return null|string|string[]
*/
public static function wps_ip_check_return_pf() {
$pf = '';
$host_name = gethostname();
if ( strpos( $host_name, 'wps' ) !== false ) {
if ( false !== strpos( $host_name, 'wpserveur' ) ) {
$pf = 'pf1';
return $pf;
}
$pf = preg_replace( "/[^0-9]/", '', $host_name );
$pf = 'pf' . $pf;
}
return $pf;
}
public static function is_plugin_installed( $plugin ) {
if ( ! function_exists( 'get_plugins' ) ) {
require_once ABSPATH . 'wp-admin/includes/plugin.php';
}
$installed_plugins = get_plugins();
return isset( $installed_plugins[ $plugin ] );
}
/**
* @return array|mixed|string|\WP_Error
*/
public static function get_api_result() {
if ( false === ( $response = get_transient( 'wps_plugins_adds' ) ) ) {
$response = wp_remote_get( WPS_PUB_API_URL . 'wp/v2/wps_plugins_adds/' );
set_transient( 'wps_plugins_adds', $response, 24 * HOUR_IN_SECONDS );
}
$datas = '';
if ( is_array( $response ) ) {
$datas = $response;
}
return $datas;
}
/**
* @param $response
*
* @return array
*/
public static function get_json_array( $response ) {
if ( empty( $response ) ) {
return array();
}
$datas = json_decode( wp_remote_retrieve_body( $response ), true );
if ( ! is_array( $datas ) ) {
return array();
}
if ( isset( $datas['code'] ) && is_null( $datas['data'] ) ) {
return array();
}
$adds = array();
foreach ( $datas as $data ) {
$post_metas = $data['post-meta-fields'];
$title = $data['title']['rendered'];
$description = $data['content']['rendered'];
$plugin = '';
if ( isset( $post_metas['plugin'] ) ) {
$plugin = $post_metas['plugin'];
$plugin = reset( $plugin );
}
$wps_pour_tous = '';
if ( isset( $post_metas['pour_tous'] ) ) {
$wps_pour_tous = $post_metas['pour_tous'];
$wps_pour_tous = reset( $wps_pour_tous );
}
$locale = get_locale();
$locale = substr( $locale, 0, 2 );
if ( 'fr' !== $locale ) {
if ( isset( $post_metas[ 'description_' . $locale ] ) ) {
$description = $post_metas[ 'description_' . $locale ];
$description = reset( $description );
}
}
$adds[] = array(
'title' => $title,
'plugin' => $plugin,
'description' => $description,
'wps_pour_tous' => $wps_pour_tous,
'img_64' => $post_metas['img_64'][0],
);
}
return $adds;
}
}