golden hour
/home/godaofbq/cellsonic-usa.com/wp-content/plugins/litespeed-cache/src
⬆️ Go Up
Upload
File/Folder
Size
Actions
activation.cls.php
17.62 KB
Del
OK
admin-display.cls.php
48.76 KB
Del
OK
admin-settings.cls.php
12.77 KB
Del
OK
admin.cls.php
6.13 KB
Del
OK
api.cls.php
10.44 KB
Del
OK
avatar.cls.php
9.25 KB
Del
OK
base.cls.php
37.66 KB
Del
OK
cdn
-
Del
OK
cdn.cls.php
17.76 KB
Del
OK
cloud-auth-callback.trait.php
10.43 KB
Del
OK
cloud-auth-ip.trait.php
4.33 KB
Del
OK
cloud-auth.trait.php
9.38 KB
Del
OK
cloud-misc.trait.php
10.32 KB
Del
OK
cloud-node.trait.php
5.95 KB
Del
OK
cloud-queue-svc.cls.php
9.33 KB
Del
OK
cloud-request.trait.php
19.68 KB
Del
OK
cloud.cls.php
7.32 KB
Del
OK
conf.cls.php
19.53 KB
Del
OK
control.cls.php
24.35 KB
Del
OK
core.cls.php
21.53 KB
Del
OK
crawler-map.cls.php
22.3 KB
Del
OK
crawler.cls.php
44 KB
Del
OK
css.cls.php
7.26 KB
Del
OK
data.cls.php
22.2 KB
Del
OK
data.upgrade.func.php
6.41 KB
Del
OK
data_structure
-
Del
OK
db-optm.cls.php
15.35 KB
Del
OK
debug2.cls.php
18.4 KB
Del
OK
doc.cls.php
5.45 KB
Del
OK
error.cls.php
7.35 KB
Del
OK
esi.cls.php
31.37 KB
Del
OK
file.cls.php
13.75 KB
Del
OK
guest.cls.php
2.75 KB
Del
OK
gui.cls.php
35.09 KB
Del
OK
health.cls.php
4.66 KB
Del
OK
htaccess.cls.php
29.81 KB
Del
OK
img-optm-manage.trait.php
31.25 KB
Del
OK
img-optm-pull.trait.php
22.1 KB
Del
OK
img-optm-send.trait.php
20.77 KB
Del
OK
img-optm.cls.php
5.25 KB
Del
OK
import.cls.php
4.29 KB
Del
OK
import.preset.cls.php
5.5 KB
Del
OK
lang.cls.php
17.02 KB
Del
OK
localization.cls.php
4.03 KB
Del
OK
media.cls.php
44.06 KB
Del
OK
metabox.cls.php
5.29 KB
Del
OK
object-cache-wp.cls.php
18.82 KB
Del
OK
object-cache.cls.php
21.82 KB
Del
OK
object.lib.php
13.85 KB
Del
OK
optimax.cls.php
8.94 KB
Del
OK
optimize.cls.php
38.74 KB
Del
OK
optimizer.cls.php
12.71 KB
Del
OK
placeholder.cls.php
17.64 KB
Del
OK
purge.cls.php
35.48 KB
Del
OK
report.cls.php
7.53 KB
Del
OK
rest.cls.php
7.95 KB
Del
OK
root.cls.php
14.29 KB
Del
OK
router.cls.php
20.86 KB
Del
OK
str.cls.php
3.08 KB
Del
OK
tag.cls.php
9.26 KB
Del
OK
task.cls.php
8.98 KB
Del
OK
tool.cls.php
4.58 KB
Del
OK
ucss.cls.php
7.34 KB
Del
OK
utility.cls.php
27.11 KB
Del
OK
vary.cls.php
21.33 KB
Del
OK
vpi.cls.php
4.25 KB
Del
OK
Edit: vpi.cls.php
<?php /** * The viewport image (VPI) class. * * Handles discovering above-the-fold images for posts/pages and stores the * viewport image list per post (desktop & mobile). Coordinates with the * remote svc via queue + cron. * * @since 4.7 * @package LiteSpeed */ namespace LiteSpeed; defined( 'WPINC' ) || exit(); /** * Generate and manage ViewPort Images (VPI) for pages. */ class VPI extends Cloud_Queue_Svc { /** * Log tag for debug output. * * @var string */ const LOG_TAG = '[VPI]'; /** * VPI Desktop Meta name. * * @since 7.6 * @var string */ const POST_META = 'litespeed_vpi_list'; /** * VPI Mobile Meta name. * * @since 7.6 * @var string */ const POST_META_MOBILE = 'litespeed_vpi_list_mobile'; /** * Summary values persisted between requests (timings, last runs, etc). * * @var array */ protected $_summary; /** * Init. * * @since 4.7 */ public function __construct() { $this->_summary = self::get_summary(); } /** * Svc id slug — drives queue type, Cloud::SVC_VPI, and summary key prefix. * * @return string */ protected function _svc_id() { return 'vpi'; } /** * Response field carrying the viewport image data. * * @return string */ protected function _data_key() { return 'data_vpi'; } /** * UI templates read `last_request` directly (settings_vpi.tpl.php, * dashboard.tpl.php). Keep the legacy unsuffixed key. * * @return string */ protected function _last_request_key() { return 'last_request'; } /** * Build the request body for Cloud::post. * * @param string $queue_k Queue key. * @param array $v Queue item. * @return array */ protected function _build_payload( $queue_k, $v ) { return [ 'url' => $v['url'], 'queue_k' => $queue_k, 'user_agent' => $v['user_agent'], 'is_mobile' => ! empty( $v['is_mobile'] ) ? 1 : 0, ]; } /** * Persist the viewport image list to post meta. Empty/null payload is * persisted as an empty list (matches pre-refactor VPI behavior) so the * post is marked processed and not re-queued. * * @param mixed $data VPI data (array, string, or null). * @param string $queue_k Queue key. * @param array $v Queue item. * @return bool */ protected function _save_result( $data, $queue_k, $v ) { $name = ! empty( $v['is_mobile'] ) ? self::POST_META_MOBILE : self::POST_META; if ( is_array( $data ) ) { $urldecode = array_map( 'urldecode', $data ); } elseif ( null === $data || '' === $data ) { $urldecode = ''; } else { $urldecode = urldecode( (string) $data ); } self::debug( 'save data_vpi', $urldecode ); $this->cls( 'Metabox' )->save( (int) $v['post_id'], $name, $urldecode ); return true; } /** * Queue the current page for VPI generation. * * @since 4.7 * @return void */ public function add_to_queue() { $is_mobile = $this->_separate_mobile(); global $wp; $request_url = home_url( $wp->request ); if ( ! apply_filters( 'litespeed_vpi_should_queue', true, $request_url ) ) { return; } // Sanitize user agent coming from the server superglobal. $ua = ! empty( $_SERVER['HTTP_USER_AGENT'] ) ? sanitize_text_field( wp_unslash( $_SERVER['HTTP_USER_AGENT'] ) ) : ''; // Store it to prepare for cron. $this->_queue = $this->load_queue( 'vpi' ); if ( count( $this->_queue ) > $this->_max_queue_size() ) { self::debug( 'Queue is full - ' . $this->_max_queue_size() ); return; } $home_id = (int) get_option( 'page_for_posts' ); if ( ! is_singular() && ! ( $home_id > 0 && is_home() ) ) { self::debug( 'not single post ID' ); return; } $post_id = is_home() ? $home_id : get_the_ID(); $queue_k = ( $is_mobile ? 'mobile' : '' ) . ' ' . $request_url; if ( ! empty( $this->_queue[ $queue_k ] ) ) { self::debug( 'queue k existed ' . $queue_k ); return; } $this->_queue[ $queue_k ] = [ 'url' => apply_filters( 'litespeed_vpi_url', $request_url ), 'post_id' => $post_id, 'user_agent' => substr( $ua, 0, 200 ), 'is_mobile' => $is_mobile, ]; // Current UA will be used to request. $this->save_queue( 'vpi', $this->_queue ); self::debug( 'Added queue_vpi [url] ' . $queue_k . ' [UA] ' . $ua ); // Prepare cache tag for later purge. Tag::add( 'VPI.' . md5( $queue_k ) ); } }
Save