We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 76e1580 commit 0b612b3Copy full SHA for 0b612b3
1 file changed
php/cron/class-lock-file.php
@@ -33,7 +33,13 @@ class Lock_File {
33
*/
34
public function get_lock_file( $file = null ) {
35
$lock_file = $this->get_lock_file_name( $file );
36
- $data = file_get_contents( $lock_file ); // phpcs:ignore WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown
+
37
+ if ( ! file_exists( $lock_file ) ) {
38
+ return '';
39
+ }
40
41
+ $data = file_get_contents( $lock_file ); // phpcs:ignore WordPressVIPMinimum.Performance.FetchingRemoteData.FileGetContentsUnknown
42
43
if ( false !== strpos( $data, '[' ) ) {
44
$data = json_decode( $data, true );
45
}
@@ -106,5 +112,4 @@ public function delete_lock_file( $file = null ) {
106
112
$file = $this->get_lock_file_name( $file );
107
113
wp_delete_file( $file );
108
114
109
-
110
115
0 commit comments