Not locked. return false; } $the_lock = explode( '|||', $the_lock, 2 ); if ( count( $the_lock ) !== 2 ) { // Something's wrong with the lock. $this->remove_lock(); return false; } // phpcs:ignore WordPress.PHP.DiscouragedPHPFunctions.obfuscation_base64_decode $locked_site_url = base64_decode( $the_lock[1] ); $expires = $the_lock[0]; $expiration_date = DateTime::createFromFormat( static::DATE_FORMAT_ATOM, $expires ); if ( false === $expiration_date || ! $locked_site_url ) { // Something's wrong with the lock. $this->remove_lock(); return false; } if ( Urls::site_url() === $locked_site_url ) { if ( new DateTime() > $expiration_date ) { // Site lock expired. // Site URL matches, removing the lock. $this->remove_lock(); } return false; } // Site URL doesn't match. return true; } }