<?php
// Intelligent caching backward compatibility
if (Swift_Performance::check_option('cache-expiry-mode', 'intelligent')){
Swift_Performance::update_option('cache-expiry-mode', 'actionbased');
}
// Async script delivery backward compatibility
if (Swift_Performance::check_option('delay-async-scripts', 1)){
Swift_Performance::remove_option('delay-async-scripts', 1);
Swift_Performance::update_option('script-delivery', 'delay');
}
// Get post types
$post_types = Swift_Performance::get_post_types();
$post_types = array_combine($post_types, $post_types);
// Get page list
global $wpdb;
$pages = array();
foreach ($wpdb->get_results("SELECT ID, post_title FROM {$wpdb->posts} WHERE post_type = 'page' AND post_status = 'publish'", ARRAY_A) as $_page) {
$pages[$_page['ID']] = $_page['post_title'];
}
// Check IP source automatically for GA
$ga_ip_source = '';
foreach (array('HTTP_CLIENT_IP', 'HTTP_X_FORWARDED_FOR', 'HTTP_X_FORWARDED', 'HTTP_X_CLUSTER_CLIENT_IP', 'HTTP_FORWARDED_FOR', 'HTTP_FORWARDED', 'HTTP_CF_CONNECTING_IP','REMOTE_ADDR') as $source) {
if (isset($_SERVER[$source]) && !empty($_SERVER[$source])) {
$ga_ip_source = $source;
break;
}
}
// Basic options
$cache_modes = array(
'disk_cache_php' => esc_html__('Disk Cache with PHP', 'swift-performance'),
);
// Add disk cache + rewrite option if it is available
if (in_array(Swift_Performance::server_software(), array('apache', 'nginx'))){
$cache_modes['disk_cache_rewrite'] = esc_html__('Disk Cache with Rewrites', 'swift-performance');
}
// Memcached support
if (class_exists('Memcached')) {
$cache_modes['memcached_php'] = esc_html__('Memcached with PHP', 'swift-performance');
}
// WebP options
if (Swift_Performance::server_software() == 'apache'){
$swift_webp = array(
'none' => esc_html__('Don\'t use WebP', 'swift-performace'),
'picture' => __('Use <picture> elements', 'swift-performace'),
'rewrite' => esc_html__('Use rewrites', 'swift-performace'),
);
}
else {
$swift_webp = array(
'none' => esc_html__('Don\'t use WebP', 'swift-performace'),
'picture' => __('Use <picture> elements', 'swift-performace'),
);
}
// Plugin based options
$active_plugins = get_option('active_plugins');
$is_woocommerce_active = apply_filters('swift_performance_is_woocommerce_active', in_array('woocommerce/woocommerce.php', $active_plugins));
$swift_countries = array();
if ($is_woocommerce_active) {
@$swift_countries = apply_filters('woocommerce_countries', include WP_PLUGIN_DIR . '/woocommerce/i18n/countries.php');
}
// User roles
$roles = array();
foreach ((array)get_option($wpdb->prefix . 'user_roles') as $role_slug => $role) {
$roles[$role_slug] = $role['name'];
}
/**
* Validate Purchase Key
* @param boolean|array $result
* @param string $value
*/
function swift_performance_purchase_key_validate_callback($result, $value){
delete_option('swift-performance-license');
if (empty($value)){
update_option('swift-performance-license', array('type' => 'offline'));
return true;
}
$validate = Swift_Performance::check_api(true, $value);
if ($validate === true) {
return true;
}
else {
return array(
'error' => $validate['response']
);
}
}
/**
* Validate log path
* @param boolean|array $result
* @param string $value
*/
function swift_performance_log_path_validate_callback($result, $value){
// Stop here if logging isn't enabled at all
if (!isset($_POST['_luv_enable-logging']) || $_POST['_luv_enable-logging'] != 1){
return $result;
}
if (!file_exists($value)) {
@mkdir($value, 0777, true);
if (!file_exists($value)) {
return array('error' => __('Log directory doesn\'t exists', 'swift-performance'));
}
} elseif (!is_dir($value)) {
return array('error' => __('Log directory should be a directory', 'swift-performance'));
} elseif (!is_writable($value)) {
return array('error' => __('Log directory isn\'t writable for WordPress. Please change the permissions.', 'swift-performance'));
}
return $result;
}
/**
* Validate caching mode
* @param boolean|array $result
* @param string $value
*/
function swift_performance_cache_mode_validate_callback($result, $value){
// Check htaccess only for Apache
if ($value != 'disk_cache_rewrite' || Swift_Performance::server_software() != 'apache') {
return true;
}
$htaccess = Swift_Performance::get_home_path() . '.htaccess';
if (!file_exists($htaccess)) {
@touch($htaccess);
if (!file_exists($htaccess)) {
return array('warning' => __('htaccess doesn\'t exists', 'swift-performance'));
}
} elseif (!is_writable($htaccess)) {
return array('warning' => __('htaccess isn\'t writable for WordPress. Please change the permissions.', 'swift-performance'));
}
return true;
}
/**
* Validate caching mode
* @param boolean|array $result
* @param string $value
*/
function swift_performance_muplugins_validate_callback($result, $value){
$muplugins_dir = WPMU_PLUGIN_DIR;
if ($value == 1) {
if (!file_exists($muplugins_dir)) {
@mkdir($muplugins_dir, 0777);
if (!file_exists($muplugins_dir)) {
return array('error' => __('MU Plugins directory doesn\'t exists', 'swift-performance'));
}
} elseif (!is_writable($muplugins_dir)) {
return array('error' => __('MU Plugins directory isn\'t writable for WordPress. Please change the permissions.', 'swift-performance'));
}
}
}
/**
* Validate caching mode
* @param boolean|array $result
* @param string $value
*/
function swift_performance_cache_path_validate_callback($result, $value){
if (empty($value)){
return array('error' => esc_html__('Cache directory is empty', 'swift-performance'));
}
if (!file_exists($value)) {
@mkdir($value, 0777, true);
if (!file_exists($value)) {
return array('error' => __('Cache directory doesn\'t exists', 'swift-performance'));
}
} elseif (!is_dir($value)) {
return array('error' => __('Cache directory should be a directory', 'swift-performance'));
} elseif (!is_writable($value)) {
return array('error' => __('Cache directory isn\'t writable for WordPress. Please change the permissions.', 'swift-performance'));
}
return true;
}
/**
* Validate custom htaccess
* @param boolean|array $result
* @param string $value
*/
function swift_performance_custom_htaccess_validate_callback($result, $value){
// Check htaccess only for Apache
if (empty($value) || Swift_Performance::server_software() != 'apache') {
return true;
}
$htaccess = Swift_Performance::get_home_path() . '.htaccess';
if (!file_exists($htaccess)) {
@touch($htaccess);
if (!file_exists($htaccess)) {
return array('warning' => __('htaccess doesn\'t exists', 'swift-performance'));
}
} elseif (!is_writable($htaccess)) {
return array('warning' => __('htaccess isn\'t writable for WordPress. Please change the permissions.', 'swift-performance'));
}
else if (Swift_Performance::disable_file_edit()){
return array('warning' => __('DISALLOW_FILE_EDIT or DISALLOW_FILE_MODS is enabled, so you can\'t add custom htaccess', 'swift-performance'));
}
return true;
}
// Conditional hooks
add_action('luv_framework_before_fields_init', function($that){
// Whitelabel
if ((defined('SWIFT_PERFORMANCE_WHITELABEL') && SWIFT_PERFORMANCE_WHITELABEL) || Swift_Performance::license_type() !== 'pro'){
unset($that->args['sections']['general']['subsections']['whitelabel']);
}
// Plugin based options
$active_plugins = get_option('active_plugins');
没有合适的资源?快使用搜索试试~ 我知道了~
【WordPress插件】2022年最新版完整功能demo+插件v2.3.6.4 Nulled.zip
共568个文件
js:167个
html:129个
php:123个
1.该资源内容由用户上传,如若侵权请联系客服进行举报
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
2.虚拟产品一经售出概不退款(资源遇到问题,请及时私信上传者)
版权申诉
0 下载量 154 浏览量
2022-04-03
20:15:14
上传
评论
收藏 4.45MB ZIP 举报
温馨提示
"【WordPress插件】2022年最新版完整功能demo+插件v2.3.6.4 Nulled Swift Performance - WordPress Cache & Performance Booster Swift Performance - WordPress缓存和性能助推器" ---------- 泰森云每天更新发布最新WordPress主题、HTML主题、WordPress插件、shopify主题、opencart主题、PHP项目源码、安卓项目源码、ios项目源码,更有超10000个资源可供选择,如有需要请站内联系。
资源推荐
资源详情
资源评论
收起资源包目录
【WordPress插件】2022年最新版完整功能demo+插件v2.3.6.4 Nulled.zip (568个子文件)
animate.css 76KB
whitelabel.css 51KB
all.min.css 46KB
styles.css 43KB
ambiance.css 26KB
select2.min.css 15KB
fields.css 15KB
admin.css 10KB
setup.css 10KB
codemirror.css 8KB
solarized.css 5KB
mdn-like.css 5KB
liquibyte.css 4KB
nouislider.min.css 4KB
xq-dark.css 3KB
duotone-light.css 3KB
modal.css 3KB
lesser-dark.css 3KB
duotone-dark.css 3KB
icecoder.css 2KB
material.css 2KB
pastel-on-dark.css 2KB
ttcn.css 2KB
shadowfox.css 2KB
tomorrow-night-eighties.css 2KB
erlang-dark.css 2KB
oceanic-next.css 2KB
xq-light.css 2KB
monokai.css 2KB
twilight.css 2KB
vibrant-ink.css 2KB
base16-light.css 2KB
base16-dark.css 2KB
mbo.css 2KB
darcula.css 2KB
paraiso-dark.css 2KB
paraiso-light.css 2KB
3024-night.css 2KB
midnight.css 2KB
dracula.css 2KB
seti.css 2KB
zenburn.css 2KB
3024-day.css 2KB
abcdef.css 2KB
the-matrix.css 2KB
blackboard.css 2KB
lucario.css 2KB
yeti.css 2KB
panda-syntax.css 2KB
rubyblue.css 2KB
tomorrow-night-bright.css 2KB
night.css 2KB
cobalt.css 2KB
colorforth.css 2KB
idea.css 2KB
gruvbox-dark.css 2KB
railscasts.css 1KB
hopscotch.css 1KB
isotope.css 1KB
bespin.css 1KB
eclipse.css 1KB
puc-debug-bar.css 1KB
neo.css 947B
elegant.css 781B
ssms.css 751B
neat.css 688B
tiki.css 439B
tiddlywiki.css 220B
ambiance-mobile.css 103B
.DS_Store 24KB
.DS_Store 14KB
.DS_Store 10KB
.DS_Store 8KB
.DS_Store 8KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
.DS_Store 6KB
fa-solid-900.eot 164KB
fa-brands-400.eot 114KB
fa-regular-400.eot 40KB
text-security-disc.eot 12KB
scala.html 28KB
index.html 22KB
index.html 17KB
index.html 13KB
index.html 13KB
index.html 12KB
index.html 10KB
index.html 10KB
index.html 9KB
index.html 9KB
index.html 8KB
index.html 8KB
index.html 8KB
index.html 7KB
index.html 7KB
共 568 条
- 1
- 2
- 3
- 4
- 5
- 6
资源评论
Lee达森
- 粉丝: 966
- 资源: 1万+
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功