Edit File by line
/home/barbar84/www/wp-conte.../themes/Divi/core/componen...
File: PageResource.php
<?php
[0] Fix | Delete
[1] Fix | Delete
/**
[2] Fix | Delete
* Manages a frontend inline CSS or JavaScript resource.
[3] Fix | Delete
*
[4] Fix | Delete
* If possible, the resource will be served as a static file for better performance. It can be
[5] Fix | Delete
* tied to a specific post or it can be 'global'. The resource can be output, static or inline,
[6] Fix | Delete
* to one of four locations on the page:
[7] Fix | Delete
*
[8] Fix | Delete
* * `head-early`: right AFTER theme styles have been enqueued
[9] Fix | Delete
* * `head` : right BEFORE the theme and wp's inline custom css
[10] Fix | Delete
* * `head-late` : right AFTER the theme and wp's inline custom css
[11] Fix | Delete
* * `footer` : in the footer
[12] Fix | Delete
*
[13] Fix | Delete
* The first time the class is instantiated, a static callback method will be registered for each
[14] Fix | Delete
* output location. Inside each callback, we'll iterate over any/all instances that are assigned
[15] Fix | Delete
* to the current output location and perform the following steps:
[16] Fix | Delete
*
[17] Fix | Delete
* 1. If a static file exists for the resource, go to the next step. Otherwise, try to create
[18] Fix | Delete
* a static file for the resource if it has `data`. If it doesn't have `data`, assign it to
[19] Fix | Delete
* the next output location and then move on to the next resource (continue).
[20] Fix | Delete
* 2. If a static file exists for the resource, enqueue it (via WP or manually) and then move on
[21] Fix | Delete
* to the next resource (continue). If no static file exists, go to the next step.
[22] Fix | Delete
* 3. Output the resource inline.
[23] Fix | Delete
*
[24] Fix | Delete
* @since 2.0
[25] Fix | Delete
*
[26] Fix | Delete
* @package ET\Core
[27] Fix | Delete
*/
[28] Fix | Delete
class ET_Core_PageResource {
[29] Fix | Delete
[30] Fix | Delete
private static $_LOCK_FILE;
[31] Fix | Delete
[32] Fix | Delete
/**
[33] Fix | Delete
* Output locations.
[34] Fix | Delete
*
[35] Fix | Delete
* @var string[]
[36] Fix | Delete
*/
[37] Fix | Delete
private static $_OUTPUT_LOCATIONS = array(
[38] Fix | Delete
'head-early',
[39] Fix | Delete
'head',
[40] Fix | Delete
'head-late',
[41] Fix | Delete
'footer',
[42] Fix | Delete
);
[43] Fix | Delete
[44] Fix | Delete
/**
[45] Fix | Delete
* Resource owners.
[46] Fix | Delete
*
[47] Fix | Delete
* @var string[]
[48] Fix | Delete
*/
[49] Fix | Delete
private static $_OWNERS = array(
[50] Fix | Delete
'divi',
[51] Fix | Delete
'builder',
[52] Fix | Delete
'epanel',
[53] Fix | Delete
'extra',
[54] Fix | Delete
'core',
[55] Fix | Delete
'bloom',
[56] Fix | Delete
'monarch',
[57] Fix | Delete
'custom',
[58] Fix | Delete
'all',
[59] Fix | Delete
);
[60] Fix | Delete
[61] Fix | Delete
/**
[62] Fix | Delete
* Resource scopes.
[63] Fix | Delete
*
[64] Fix | Delete
* @var string[]
[65] Fix | Delete
*/
[66] Fix | Delete
private static $_SCOPES = array(
[67] Fix | Delete
'global',
[68] Fix | Delete
'post',
[69] Fix | Delete
);
[70] Fix | Delete
[71] Fix | Delete
private static $_TEMP_DIRS = array();
[72] Fix | Delete
[73] Fix | Delete
/**
[74] Fix | Delete
* Resource types.
[75] Fix | Delete
*
[76] Fix | Delete
* @var string[]
[77] Fix | Delete
*/
[78] Fix | Delete
private static $_TYPES = array(
[79] Fix | Delete
'style',
[80] Fix | Delete
'script',
[81] Fix | Delete
);
[82] Fix | Delete
[83] Fix | Delete
/**
[84] Fix | Delete
* Whether or not we have write access to the filesystem.
[85] Fix | Delete
*
[86] Fix | Delete
* @var bool
[87] Fix | Delete
*/
[88] Fix | Delete
private static $_can_write;
[89] Fix | Delete
[90] Fix | Delete
private static $_onerror = 'et_core_page_resource_fallback(this, true)';
[91] Fix | Delete
private static $_onload = 'et_core_page_resource_fallback(this)';
[92] Fix | Delete
[93] Fix | Delete
private static $_request_id;
[94] Fix | Delete
private static $_request_time;
[95] Fix | Delete
[96] Fix | Delete
/**
[97] Fix | Delete
* All instances of this class.
[98] Fix | Delete
*
[99] Fix | Delete
* @var ET_Core_PageResource[] {
[100] Fix | Delete
*
[101] Fix | Delete
* @type ET_Core_PageResource $slug
[102] Fix | Delete
* }
[103] Fix | Delete
*/
[104] Fix | Delete
private static $_resources;
[105] Fix | Delete
[106] Fix | Delete
/**
[107] Fix | Delete
* All instances of this class organized by output location and sorted by priority.
[108] Fix | Delete
*
[109] Fix | Delete
* @var array[] {
[110] Fix | Delete
*
[111] Fix | Delete
* @type array[] $location {@see self::$_OUTPUT_LOCATIONS} {
[112] Fix | Delete
*
[113] Fix | Delete
* @type ET_Core_PageResource[] $priority {
[114] Fix | Delete
*
[115] Fix | Delete
* @type ET_Core_PageResource $slug
[116] Fix | Delete
* }
[117] Fix | Delete
* }
[118] Fix | Delete
* }
[119] Fix | Delete
*/
[120] Fix | Delete
private static $_resources_by_location;
[121] Fix | Delete
[122] Fix | Delete
/**
[123] Fix | Delete
* All instances of this class organized by scope.
[124] Fix | Delete
*
[125] Fix | Delete
* @var array[] {
[126] Fix | Delete
*
[127] Fix | Delete
* @type ET_Core_PageResource[] $post|$global {
[128] Fix | Delete
*
[129] Fix | Delete
* @type ET_Core_PageResource $slug
[130] Fix | Delete
* }
[131] Fix | Delete
* }
[132] Fix | Delete
*/
[133] Fix | Delete
private static $_resources_by_scope;
[134] Fix | Delete
[135] Fix | Delete
/**
[136] Fix | Delete
* @var string
[137] Fix | Delete
*/
[138] Fix | Delete
public static $WP_CONTENT_DIR;
[139] Fix | Delete
[140] Fix | Delete
/**
[141] Fix | Delete
* @var string
[142] Fix | Delete
*/
[143] Fix | Delete
public static $current_output_location;
[144] Fix | Delete
[145] Fix | Delete
/**
[146] Fix | Delete
* @var ET_Core_Data_Utils
[147] Fix | Delete
*/
[148] Fix | Delete
public static $data_utils;
[149] Fix | Delete
[150] Fix | Delete
/**
[151] Fix | Delete
* @var \WP_Filesystem_Base|null
[152] Fix | Delete
*/
[153] Fix | Delete
public static $wpfs;
[154] Fix | Delete
[155] Fix | Delete
/**
[156] Fix | Delete
* The absolute path to the directory where the static resource will be stored.
[157] Fix | Delete
*
[158] Fix | Delete
* @var string
[159] Fix | Delete
*/
[160] Fix | Delete
public $BASE_DIR;
[161] Fix | Delete
[162] Fix | Delete
/**
[163] Fix | Delete
* The absolute path to the static resource on the server.
[164] Fix | Delete
*
[165] Fix | Delete
* @var string
[166] Fix | Delete
*/
[167] Fix | Delete
public $PATH;
[168] Fix | Delete
[169] Fix | Delete
public $TEMP_DIR;
[170] Fix | Delete
[171] Fix | Delete
/**
[172] Fix | Delete
* The absolute URL through which the static resource can be downloaded.
[173] Fix | Delete
*
[174] Fix | Delete
* @var string
[175] Fix | Delete
*/
[176] Fix | Delete
public $URL;
[177] Fix | Delete
[178] Fix | Delete
/**
[179] Fix | Delete
* The data/contents for/of the static resource sorted by priority.
[180] Fix | Delete
*
[181] Fix | Delete
* @var array
[182] Fix | Delete
*/
[183] Fix | Delete
public $data;
[184] Fix | Delete
[185] Fix | Delete
/**
[186] Fix | Delete
* Whether or not this resource has been disabled.
[187] Fix | Delete
*
[188] Fix | Delete
* @var bool
[189] Fix | Delete
*/
[190] Fix | Delete
public $disabled;
[191] Fix | Delete
[192] Fix | Delete
/**
[193] Fix | Delete
* Whether or not the static resource file has been enqueued.
[194] Fix | Delete
*
[195] Fix | Delete
* @var bool
[196] Fix | Delete
*/
[197] Fix | Delete
public $enqueued;
[198] Fix | Delete
[199] Fix | Delete
/**
[200] Fix | Delete
* Whether or not this resource is forced inline.
[201] Fix | Delete
*
[202] Fix | Delete
* @var bool
[203] Fix | Delete
*/
[204] Fix | Delete
public $forced_inline;
[205] Fix | Delete
[206] Fix | Delete
/**
[207] Fix | Delete
* @var string
[208] Fix | Delete
*/
[209] Fix | Delete
public $filename;
[210] Fix | Delete
[211] Fix | Delete
/**
[212] Fix | Delete
* Whether or not the resource has already been output to the page inline.
[213] Fix | Delete
*
[214] Fix | Delete
* @var bool
[215] Fix | Delete
*/
[216] Fix | Delete
public $inlined;
[217] Fix | Delete
[218] Fix | Delete
/**
[219] Fix | Delete
* The owner of this instance.
[220] Fix | Delete
*
[221] Fix | Delete
* @var string
[222] Fix | Delete
*/
[223] Fix | Delete
public $owner;
[224] Fix | Delete
[225] Fix | Delete
/**
[226] Fix | Delete
* The id of the post to which this resource belongs.
[227] Fix | Delete
*
[228] Fix | Delete
* @var string
[229] Fix | Delete
*/
[230] Fix | Delete
public $post_id;
[231] Fix | Delete
[232] Fix | Delete
/**
[233] Fix | Delete
* The priority of this resource.
[234] Fix | Delete
*
[235] Fix | Delete
* @var int
[236] Fix | Delete
*/
[237] Fix | Delete
public $priority;
[238] Fix | Delete
[239] Fix | Delete
/**
[240] Fix | Delete
* A unique identifier for this resource.
[241] Fix | Delete
*
[242] Fix | Delete
* @var string
[243] Fix | Delete
*/
[244] Fix | Delete
public $slug;
[245] Fix | Delete
[246] Fix | Delete
/**
[247] Fix | Delete
* The resource type (style|script).
[248] Fix | Delete
*
[249] Fix | Delete
* @var string
[250] Fix | Delete
*/
[251] Fix | Delete
public $type;
[252] Fix | Delete
[253] Fix | Delete
/**
[254] Fix | Delete
* The output location during which this resource's static file should be generated.
[255] Fix | Delete
*
[256] Fix | Delete
* @var string
[257] Fix | Delete
*/
[258] Fix | Delete
public $write_file_location;
[259] Fix | Delete
[260] Fix | Delete
/**
[261] Fix | Delete
* ET_Core_PageResource constructor
[262] Fix | Delete
*
[263] Fix | Delete
* @param string $owner The owner of the instance (core|divi|builder|bloom|monarch|custom).
[264] Fix | Delete
* @param string $slug A string that uniquely identifies the resource.
[265] Fix | Delete
* @param string|int $post_id The post id that the resource is associated with or `global`.
[266] Fix | Delete
* If `null`, {@link get_the_ID()} will be used.
[267] Fix | Delete
* @param string $type The resource type (style|script). Default: `style`.
[268] Fix | Delete
* @param string $location Where the resource should be output (head|footer). Default: `head`.
[269] Fix | Delete
*/
[270] Fix | Delete
public function __construct( $owner, $slug, $post_id = null, $priority = 10, $location = 'head-late', $type = 'style' ) {
[271] Fix | Delete
$this->owner = self::_validate_property( 'owner', $owner );
[272] Fix | Delete
$this->post_id = self::_validate_property( 'post_id', $post_id ? $post_id : et_core_page_resource_get_the_ID() );
[273] Fix | Delete
[274] Fix | Delete
$this->type = self::_validate_property( 'type', $type );
[275] Fix | Delete
$this->location = self::_validate_property( 'location', $location );
[276] Fix | Delete
[277] Fix | Delete
$this->write_file_location = $this->location;
[278] Fix | Delete
[279] Fix | Delete
$this->filename = sanitize_file_name( "et-{$this->owner}-{$slug}-{$post_id}" );
[280] Fix | Delete
$this->slug = "{$this->filename}-cached-inline-{$this->type}s";
[281] Fix | Delete
[282] Fix | Delete
$this->data = array();
[283] Fix | Delete
$this->priority = $priority;
[284] Fix | Delete
[285] Fix | Delete
self::startup();
[286] Fix | Delete
[287] Fix | Delete
$this->_initialize_resource();
[288] Fix | Delete
}
[289] Fix | Delete
[290] Fix | Delete
/**
[291] Fix | Delete
* Activates the class
[292] Fix | Delete
*/
[293] Fix | Delete
public static function startup() {
[294] Fix | Delete
if ( null !== self::$_resources ) {
[295] Fix | Delete
// Class has already been initialized
[296] Fix | Delete
return;
[297] Fix | Delete
}
[298] Fix | Delete
[299] Fix | Delete
$time = (string) microtime( true );
[300] Fix | Delete
$time = str_replace( '.', '', $time );
[301] Fix | Delete
$rand = (string) mt_rand();
[302] Fix | Delete
[303] Fix | Delete
self::$_request_time = $time;
[304] Fix | Delete
self::$_request_id = "{$time}-{$rand}";
[305] Fix | Delete
self::$_resources = array();
[306] Fix | Delete
self::$data_utils = new ET_Core_Data_Utils();
[307] Fix | Delete
[308] Fix | Delete
foreach ( self::$_OUTPUT_LOCATIONS as $location ) {
[309] Fix | Delete
self::$_resources_by_location[ $location ] = array();
[310] Fix | Delete
}
[311] Fix | Delete
[312] Fix | Delete
foreach( self::$_SCOPES as $scope ) {
[313] Fix | Delete
self::$_resources_by_scope[ $scope ] = array();
[314] Fix | Delete
}
[315] Fix | Delete
[316] Fix | Delete
self::$WP_CONTENT_DIR = self::$data_utils->normalize_path( WP_CONTENT_DIR );
[317] Fix | Delete
self::$_LOCK_FILE = self::$_request_id . '~';
[318] Fix | Delete
[319] Fix | Delete
self::_register_callbacks();
[320] Fix | Delete
self::_setup_wp_filesystem();
[321] Fix | Delete
[322] Fix | Delete
self::$_can_write = et_core_cache_dir()->can_write;
[323] Fix | Delete
}
[324] Fix | Delete
[325] Fix | Delete
/**
[326] Fix | Delete
* Updates our resource array in the database if needed.
[327] Fix | Delete
*/
[328] Fix | Delete
public static function shutdown() {
[329] Fix | Delete
if ( ! self::$_resources || ! self::$_can_write ) {
[330] Fix | Delete
return;
[331] Fix | Delete
}
[332] Fix | Delete
[333] Fix | Delete
// Remove any leftover temporary directories that belong to this request
[334] Fix | Delete
foreach ( self::$_TEMP_DIRS as $temp_directory ) {
[335] Fix | Delete
if ( file_exists( $temp_directory . '/' . self::$_LOCK_FILE ) ) {
[336] Fix | Delete
@self::$wpfs->delete( $temp_directory, true );
[337] Fix | Delete
}
[338] Fix | Delete
}
[339] Fix | Delete
[340] Fix | Delete
// Reset $_resources property; Mostly useful for unit test big request which needs to make
[341] Fix | Delete
// each test*() method act like it is different page request
[342] Fix | Delete
self::$_resources = null;
[343] Fix | Delete
[344] Fix | Delete
if ( et_()->WPFS()->exists( self::$WP_CONTENT_DIR . '/cache/et' ) ) {
[345] Fix | Delete
// Remove old cache directory
[346] Fix | Delete
et_()->WPFS()->rmdir( self::$WP_CONTENT_DIR . '/cache/et', true );
[347] Fix | Delete
}
[348] Fix | Delete
}
[349] Fix | Delete
[350] Fix | Delete
protected static function _assign_output_location( $location, $resource ) {
[351] Fix | Delete
$priority_existed = isset( self::$_resources_by_location[ $location ][ $resource->priority ] );
[352] Fix | Delete
[353] Fix | Delete
self::$_resources_by_location[ $location ][ $resource->priority ][ $resource->slug ] = $resource;
[354] Fix | Delete
[355] Fix | Delete
if ( ! $priority_existed ) {
[356] Fix | Delete
// We've added a new priority to the list, so put them back in sorted order.
[357] Fix | Delete
ksort( self::$_resources_by_location[ $location ], SORT_NUMERIC );
[358] Fix | Delete
}
[359] Fix | Delete
}
[360] Fix | Delete
[361] Fix | Delete
/**
[362] Fix | Delete
* Enqueues static file for provided script resource.
[363] Fix | Delete
*
[364] Fix | Delete
* @param ET_Core_PageResource $resource
[365] Fix | Delete
*/
[366] Fix | Delete
protected static function _enqueue_script( $resource ) {
[367] Fix | Delete
$can_enqueue = 0 === did_action( 'wp_print_scripts' );
[368] Fix | Delete
[369] Fix | Delete
if ( $can_enqueue ) {
[370] Fix | Delete
wp_enqueue_script( $resource->slug, set_url_scheme( $resource->URL ), array(), ET_CORE_VERSION, true );
[371] Fix | Delete
} else {
[372] Fix | Delete
printf(
[373] Fix | Delete
'<script id="%1$s" src="%2$s"></script>', // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedScript
[374] Fix | Delete
esc_attr( $resource->slug ),
[375] Fix | Delete
esc_url( set_url_scheme( $resource->URL ) )
[376] Fix | Delete
);
[377] Fix | Delete
}
[378] Fix | Delete
[379] Fix | Delete
$resource->enqueued = true;
[380] Fix | Delete
}
[381] Fix | Delete
[382] Fix | Delete
/**
[383] Fix | Delete
* Enqueues static file for provided style resource.
[384] Fix | Delete
*
[385] Fix | Delete
* @param ET_Core_PageResource $resource
[386] Fix | Delete
*/
[387] Fix | Delete
protected static function _enqueue_style( $resource ) {
[388] Fix | Delete
if ( 'footer' === self::$current_output_location ) {
[389] Fix | Delete
return;
[390] Fix | Delete
}
[391] Fix | Delete
[392] Fix | Delete
$can_enqueue = 0 === did_action( 'wp_print_styles' );
[393] Fix | Delete
[394] Fix | Delete
if ( $can_enqueue ) {
[395] Fix | Delete
wp_enqueue_style( $resource->slug, set_url_scheme( $resource->URL ) );
[396] Fix | Delete
} else {
[397] Fix | Delete
printf(
[398] Fix | Delete
'<link rel="stylesheet" id="%1$s" href="%2$s" onerror="%3$s" onload="%4$s" />', // phpcs:ignore WordPress.WP.EnqueuedResources.NonEnqueuedStylesheet
[399] Fix | Delete
esc_attr( $resource->slug ),
[400] Fix | Delete
esc_url( set_url_scheme( $resource->URL ) ),
[401] Fix | Delete
et_core_esc_previously( self::$_onerror ),
[402] Fix | Delete
et_core_esc_previously( self::$_onload )
[403] Fix | Delete
);
[404] Fix | Delete
}
[405] Fix | Delete
[406] Fix | Delete
$resource->enqueued = true;
[407] Fix | Delete
}
[408] Fix | Delete
[409] Fix | Delete
/**
[410] Fix | Delete
* Returns the next output location.
[411] Fix | Delete
*
[412] Fix | Delete
* @see self::$_OUTPUT_LOCATIONS
[413] Fix | Delete
*
[414] Fix | Delete
* @return string
[415] Fix | Delete
*/
[416] Fix | Delete
protected static function _get_next_output_location() {
[417] Fix | Delete
$current_index = array_search( self::$current_output_location, self::$_OUTPUT_LOCATIONS );
[418] Fix | Delete
[419] Fix | Delete
if ( false === $current_index || ! is_int( $current_index ) ) {
[420] Fix | Delete
ET_Core_Logger::error( '$current_output_location is invalid!' );
[421] Fix | Delete
}
[422] Fix | Delete
[423] Fix | Delete
$current_index += 1;
[424] Fix | Delete
[425] Fix | Delete
return self::$_OUTPUT_LOCATIONS[ $current_index ];
[426] Fix | Delete
}
[427] Fix | Delete
[428] Fix | Delete
/**
[429] Fix | Delete
* Creates static resource files for an output location if needed.
[430] Fix | Delete
*
[431] Fix | Delete
* @param string $location {@link self::$_OUTPUT_LOCATIONS}
[432] Fix | Delete
*/
[433] Fix | Delete
protected static function _maybe_create_static_resources( $location ) {
[434] Fix | Delete
self::$current_output_location = $location;
[435] Fix | Delete
[436] Fix | Delete
$sorted_resources = self::get_resources_by_output_location( $location );
[437] Fix | Delete
[438] Fix | Delete
foreach ( $sorted_resources as $priority => $resources ) {
[439] Fix | Delete
foreach ( $resources as $slug => $resource ) {
[440] Fix | Delete
if ( $resource->write_file_location !== $location ) {
[441] Fix | Delete
// This resource's static file needs to be generated later on.
[442] Fix | Delete
self::_assign_output_location( $resource->write_file_location, $resource );
[443] Fix | Delete
continue;
[444] Fix | Delete
}
[445] Fix | Delete
[446] Fix | Delete
if ( ! self::$_can_write ) {
[447] Fix | Delete
// The reason we don't simply check this before looping through resources and
[448] Fix | Delete
// bail if it fails is because we need to perform the output location assignment
[449] Fix | Delete
// in the previous conditional regardless (otherwise builder styles will break).
[450] Fix | Delete
continue;
[451] Fix | Delete
}
[452] Fix | Delete
[453] Fix | Delete
if ( $resource->forced_inline || $resource->has_file() ) {
[454] Fix | Delete
continue;
[455] Fix | Delete
}
[456] Fix | Delete
[457] Fix | Delete
$data = $resource->get_data( 'file' );
[458] Fix | Delete
[459] Fix | Delete
if ( empty( $data ) && 'footer' !== $location ) {
[460] Fix | Delete
// This resource doesn't have any data yet so we'll assign it to the next output location.
[461] Fix | Delete
$next_location = self::_get_next_output_location();
[462] Fix | Delete
[463] Fix | Delete
$resource->set_output_location( $next_location );
[464] Fix | Delete
[465] Fix | Delete
continue;
[466] Fix | Delete
}
[467] Fix | Delete
[468] Fix | Delete
if ( empty( $data ) ) {
[469] Fix | Delete
continue;
[470] Fix | Delete
}
[471] Fix | Delete
[472] Fix | Delete
// Make sure directory exists.
[473] Fix | Delete
if ( ! self::$data_utils->ensure_directory_exists( $resource->BASE_DIR ) ) {
[474] Fix | Delete
self::$_can_write = false;
[475] Fix | Delete
return;
[476] Fix | Delete
}
[477] Fix | Delete
[478] Fix | Delete
$can_continue = true;
[479] Fix | Delete
[480] Fix | Delete
// Try to create a temporary directory which we'll use as a pseudo file lock
[481] Fix | Delete
if ( @mkdir( $resource->TEMP_DIR, 0755 ) ) {
[482] Fix | Delete
self::$_TEMP_DIRS[] = $resource->TEMP_DIR;
[483] Fix | Delete
[484] Fix | Delete
// Make sure another request doesn't delete our temp directory
[485] Fix | Delete
$lock_file = $resource->TEMP_DIR . '/' . self::$_LOCK_FILE;
[486] Fix | Delete
self::$wpfs->put_contents( $lock_file, '' );
[487] Fix | Delete
[488] Fix | Delete
// Create the static resource file
[489] Fix | Delete
if ( ! self::$wpfs->put_contents( $resource->PATH, $data, 0644 ) ) {
[490] Fix | Delete
// There's no point in continuing
[491] Fix | Delete
self::$_can_write = $can_continue = false;
[492] Fix | Delete
} else {
[493] Fix | Delete
// Remove the temporary directory
[494] Fix | Delete
self::$wpfs->delete( $resource->TEMP_DIR, true );
[495] Fix | Delete
}
[496] Fix | Delete
[497] Fix | Delete
} else if ( file_exists( $resource->TEMP_DIR ) ) {
[498] Fix | Delete
// The static resource file is currently being created by another request
[499] Fix | Delete
It is recommended that you Edit text format, this type of Fix handles quite a lot in one request
Function