??????????????
??????????????
??????????????
??????????????
Warning : Undefined variable $auth in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
Warning : Trying to access array offset on value of type null in /home/u627560552/domains/kovexadvisory.com/public_html/666.php on line 546
??????????????
??????????????
??????????????
??????????????
File Manager
✏️ Edit File: /home/mklsvubc/rosestpetronal.nl/wp-content/plugins/litespeed-cache/src/metabox.cls.php
⬅ Kembali
<?php
/**
* The class to operate post editor metabox settings.
*
* @since 4.7
* @package LiteSpeed
*/
namespace LiteSpeed;
defined( 'WPINC' ) || exit();
/**
* Class Metabox
*
* Registers and handles LiteSpeed options shown in the post/page edit screen.
*/
class Metabox extends Root {
const LOG_TAG = '📦';
const POST_NONCE_ACTION = 'post_nonce_action';
/**
* Map of metabox settings keys to labels.
*
* @var array
*/
private $_postmeta_settings;
/**
* Init the setting list.
*
* @since 4.7
*/
public function __construct() {
// Append meta box.
$this->_postmeta_settings = [
'litespeed_no_cache' => __( 'Disable Cache', 'litespeed-cache' ),
'litespeed_no_image_lazy' => __( 'Disable Image Lazyload', 'litespeed-cache' ),
'litespeed_no_vpi' => __( 'Disable VPI', 'litespeed-cache' ),
'litespeed_vpi_list' => __( 'Viewport Images', 'litespeed-cache' ),
'litespeed_vpi_list_mobile' => __( 'Viewport Images', 'litespeed-cache' ) . ' - ' . __( 'Mobile', 'litespeed-cache' ),
];
}
/**
* Register post edit settings.
*
* @since 4.7
* @return void
*/
public function register_settings() {
add_action( 'add_meta_boxes', [ $this, 'add_meta_boxes' ] );
add_action( 'save_post', [ $this, 'save_meta_box_settings' ], 15, 2 );
add_action( 'attachment_updated', [ $this, 'save_meta_box_settings' ], 15, 2 );
}
/**
* Register meta box.
*
* @since 4.7
*
* @param string $post_type Current post type.
* @return void
*/
public function add_meta_boxes( $post_type ) {
if ( apply_filters( 'litespeed_bypass_metabox', false, $post_type ) ) {
return;
}
$post_type_obj = get_post_type_object( $post_type );
if ( ! empty( $post_type_obj ) && ! $post_type_obj->public ) {
self::debug( 'post type public=false, bypass add_meta_boxes' );
return;
}
add_meta_box( 'litespeed_meta_boxes', 'LiteSpeed', [ $this, 'meta_box_options' ], $post_type, 'side', 'core' );
}
/**
* Show meta box content.
*
* @since 4.7
* @return void
*/
public function meta_box_options() {
require_once LSCWP_DIR . 'tpl/inc/metabox.php';
}
/**
* Save settings.
*
* @since 4.7
*
* @param int $post_id Post ID.
* @param \WP_Post $post Post object.
* @return void
*/
public function save_meta_box_settings( $post_id, $post ) {
global $pagenow;
self::debug( 'Maybe save post2 [post_id] ' . $post_id );
if ( 'post.php' !== $pagenow || ! $post || ! is_object( $post ) ) {
return;
}
if ( defined( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) {
return;
}
if ( ! $this->cls( 'Router' )->verify_nonce( self::POST_NONCE_ACTION ) ) {
return;
}
self::debug( 'Saving post [post_id] ' . $post_id );
foreach ($this->_postmeta_settings as $k => $v) {
// phpcs:ignore WordPress.Security.NonceVerification.Missing, WordPress.Security.ValidatedSanitizedInput
$val = isset($_POST[$k]) ? $_POST[$k] : false;
$this->save($post_id, $k, $val);
}
}
/**
* Load setting per post.
*
* @since 4.7
*
* @param string $conf Meta key to load.
* @param int|bool $post_id Optional specific post ID, defaults to current query object.
* @return mixed|null Meta value or null when not set.
*/
public function setting( $conf, $post_id = false ) {
// Check if has metabox non-cacheable setting or not.
if ( ! $post_id ) {
$home_id = (int) get_option( 'page_for_posts' );
if ( is_singular() ) {
$post_id = get_the_ID();
} elseif ( $home_id > 0 && is_home() ) {
$post_id = $home_id;
}
}
$val = $post_id ? get_post_meta( $post_id, $conf, true ) : null;
if ( $val ) {
return $val;
}
return null;
}
/**
* Save a metabox value.
*
* @since 4.7
*
* @param int $post_id Post ID.
* @param string $name Meta key name.
* @param string|bool $val Value to save.
* @param bool $is_append If true, append to existing list values.
* @return void
*/
public function save( $post_id, $name, $val, $is_append = false ) {
if ( false !== strpos( $name, VPI::POST_META ) ) {
$val = Utility::sanitize_lines( $val, 'basename,drop_webp' );
}
// Load existing data if has set.
if ( $is_append ) {
$existing_data = $this->setting( $name, $post_id );
if ( $existing_data ) {
$existing_data = Utility::sanitize_lines( $existing_data, 'basename' );
$val = array_unique( array_merge( $val, $existing_data ) );
}
}
if ( $val ) {
update_post_meta( $post_id, $name, $val );
} else {
delete_post_meta( $post_id, $name );
}
}
/**
* Load exclude images per post.
*
* @since 4.7
*
* @param array $exclude_list Current exclude list.
* @return array Modified exclude list.
*/
public function lazy_img_excludes( $exclude_list ) {
$is_mobile = $this->_separate_mobile();
$excludes = $this->setting( $is_mobile ? VPI::POST_META_MOBILE : VPI::POST_META );
if ( null !== $excludes ) {
$excludes = Utility::sanitize_lines( $excludes, 'basename' );
if ( $excludes ) {
// Check if contains `data:` (invalid result, need to clear existing result) or not.
if ( Utility::str_hit_array( 'data:', $excludes ) ) {
$this->cls( 'VPI' )->add_to_queue();
} else {
return array_merge( $exclude_list, $excludes );
}
}
return $exclude_list;
}
$this->cls( 'VPI' )->add_to_queue();
return $exclude_list;
}
}
Nama
Tipe
Ukuran
Diubah
Aksi
📁 cdn
dir
—
2026-06-22 10:09
📁 data_structure
dir
—
2026-06-22 10:09
🐘 activation.cls.php
php
17.3 KB
2026-04-01 20:54
🐘 admin-display.cls.php
php
48.5 KB
2026-04-01 20:54
🐘 admin-settings.cls.php
php
11.1 KB
2026-04-01 20:54
🐘 admin.cls.php
php
6.1 KB
2026-04-01 20:54
🐘 api.cls.php
php
10.4 KB
2026-04-01 20:54
🐘 avatar.cls.php
php
8.7 KB
2026-04-01 20:54
🐘 base.cls.php
php
37.7 KB
2026-04-01 20:54
🐘 cdn.cls.php
php
15.9 KB
2026-04-01 20:54
🐘 cloud-auth-callback.trait.php
php
10.4 KB
2026-04-01 20:54
🐘 cloud-auth-ip.trait.php
php
4.3 KB
2026-04-01 20:54
🐘 cloud-auth.trait.php
php
9.4 KB
2026-04-01 20:54
🐘 cloud-misc.trait.php
php
10.3 KB
2026-04-01 20:54
🐘 cloud-node.trait.php
php
5.9 KB
2026-04-01 20:54
🐘 cloud-request.trait.php
php
19.7 KB
2026-04-01 20:54
🐘 cloud.cls.php
php
7.3 KB
2026-04-01 20:54
🐘 conf.cls.php
php
19.5 KB
2026-04-01 20:54
🐘 control.cls.php
php
24.3 KB
2026-04-01 20:54
🐘 core.cls.php
php
21 KB
2026-04-01 20:54
🐘 crawler-map.cls.php
php
19.4 KB
2026-04-01 20:54
🐘 crawler.cls.php
php
44.7 KB
2026-04-01 20:54
🐘 css.cls.php
php
17.8 KB
2026-04-01 20:54
🐘 data.cls.php
php
22.2 KB
2026-04-01 20:54
🐘 data.upgrade.func.php
php
5.7 KB
2026-04-01 20:54
🐘 db-optm.cls.php
php
15.3 KB
2026-04-01 20:54
🐘 debug2.cls.php
php
18.4 KB
2026-04-01 20:54
🐘 doc.cls.php
php
5.4 KB
2026-04-01 20:54
🐘 error.cls.php
php
7.4 KB
2026-04-01 20:54
🐘 esi.cls.php
php
27.2 KB
2026-04-01 20:54
🐘 file.cls.php
php
10.6 KB
2026-04-01 20:54
🐘 guest.cls.php
php
2.8 KB
2026-04-01 20:54
🐘 gui.cls.php
php
36.6 KB
2026-04-01 20:54
🐘 health.cls.php
php
2.8 KB
2026-04-01 20:54
🐘 htaccess.cls.php
php
29.8 KB
2026-04-01 20:54
🐘 img-optm-manage.trait.php
php
30.8 KB
2026-04-01 20:54
🐘 img-optm-pull.trait.php
php
22.1 KB
2026-04-01 20:54
🐘 img-optm-send.trait.php
php
21.9 KB
2026-04-01 20:54
🐘 img-optm.cls.php
php
5.3 KB
2026-04-01 20:54
🐘 import.cls.php
php
4.3 KB
2026-04-01 20:54
🐘 import.preset.cls.php
php
5.5 KB
2026-04-01 20:54
🐘 lang.cls.php
php
17 KB
2026-04-01 20:54
🐘 localization.cls.php
php
4 KB
2026-04-01 20:54
🐘 media.cls.php
php
44.1 KB
2026-04-01 20:54
🐘 metabox.cls.php
php
5.3 KB
2026-04-01 20:54
🐘 object-cache-wp.cls.php
php
18.8 KB
2026-04-01 20:54
🐘 object-cache.cls.php
php
20.9 KB
2026-04-01 20:54
🐘 object.lib.php
php
14.2 KB
2026-04-01 20:54
🐘 optimize.cls.php
php
38.6 KB
2026-04-01 20:54
🐘 optimizer.cls.php
php
10.5 KB
2026-04-01 20:54
🐘 placeholder.cls.php
php
17.9 KB
2026-04-01 20:54
🐘 purge.cls.php
php
34.4 KB
2026-04-01 20:54
🐘 report.cls.php
php
6.1 KB
2026-04-01 20:54
🐘 rest.cls.php
php
9.1 KB
2026-04-01 20:54
🐘 root.cls.php
php
14.3 KB
2026-04-01 20:54
🐘 router.cls.php
php
20.8 KB
2026-04-01 20:54
🐘 str.cls.php
php
3.1 KB
2026-04-01 20:54
🐘 tag.cls.php
php
9.3 KB
2026-04-01 20:54
🐘 task.cls.php
php
7 KB
2026-04-01 20:54
🐘 tool.cls.php
php
4.2 KB
2026-04-01 20:54
🐘 ucss.cls.php
php
16.3 KB
2026-04-01 20:54
🐘 utility.cls.php
php
26 KB
2026-04-01 20:54
🐘 vary.cls.php
php
21.3 KB
2026-04-01 20:54
🐘 vpi.cls.php
php
9.4 KB
2026-04-01 20:54