| Server IP : 43.130.17.34 / Your IP : 216.73.217.6 Web Server : nginx/1.28.0 System : Linux VM-4-12-opencloudos 6.6.92-34.1.oc9.x86_64 #1 SMP PREEMPT_DYNAMIC Wed Jun 25 21:32:13 CST 2025 x86_64 User : www ( 1000) PHP Version : 8.0.26 Disable Function : passthru,exec,system,putenv,chroot,chgrp,chown,shell_exec,popen,proc_open,pcntl_exec,ini_alter,ini_restore,dl,openlog,syslog,readlink,symlink,popepassthru,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,imap_open,apache_setenv MySQL : OFF | cURL : ON | WGET : OFF | Perl : OFF | Python : OFF | Sudo : OFF | Pkexec : OFF Directory : /www/wwwroot/yespkg.com/wp-content/plugins/wpforms/src/Pro/Admin/ |
Upload File : |
<?php
namespace WPForms\Pro\Admin;
use WPForms\Helpers\CacheBase;
/**
* Class CoreInfoCache handles plugin information caching.
*
* @since 1.8.6
*/
class CoreInfoCache extends CacheBase {
/**
* Determine if the class is allowed to load.
*
* @since 1.8.6
*
* @return bool
*/
protected function allow_load(): bool {
return is_admin() || wp_doing_cron() || wpforms_doing_wp_cli();
}
/**
* Provide settings.
*
* @since 1.8.6
*
* @return array Settings array.
*/
protected function setup(): array {
return [
// Remote source URL.
'remote_source' => 'https://wpforms.com/wp-content/core.json',
// Addons cache file name.
'cache_file' => 'core.json',
/**
* Time-to-live of the core information cache file in seconds.
*
* This applies to `uploads/wpforms/cache/core.json` file.
*
* @since 1.8.6
*
* @param integer $cache_ttl Cache time-to-live, in seconds.
* Default value: WEEK_IN_SECONDS.
*/
'cache_ttl' => (int) apply_filters( 'wpforms_pro_admin_core_info_cache_ttl', WEEK_IN_SECONDS ),
// Scheduled update action.
'update_action' => 'wpforms_pro_core_info_cache_update',
];
}
/**
* Prepare core info to store in a local cache..
*
* @since 1.8.6
*
* @param array $data Raw remote core data.
*
* @return array Prepared data for caching.
*/
protected function prepare_cache_data( $data ): array {
if ( empty( $data[0] ) ) {
return [];
}
$cache = $data[0];
// The remote file doesn't contain these icons, but we need them.
// The icons are used on the Dashboard > Updates page.
$cache['icons'] = [
'1x' => 'https://plugins.svn.wordpress.org/wpforms-lite/assets/icon-128x128.png',
'2x' => 'https://plugins.svn.wordpress.org/wpforms-lite/assets/icon-256x256.png',
'default' => 'https://plugins.svn.wordpress.org/wpforms-lite/assets/icon-256x256.png',
];
return $cache;
}
}