self::STATUS_UNKNOWN, self::OPTION_TIMESTAMP_KEY => microtime( true ), ); switch ( $status ) { case self::STATUS_DISABLED: case self::STATUS_OUT_OF_SYNC: case self::STATUS_IN_SYNC: $new_status[ self::OPTION_STATUS_KEY ] = $status; break; } \Jetpack_Options::update_option( self::STATUS_OPTION, $new_status ); return true; } /** * Check if Status has been previously set. * * @return bool is a Status defined */ public static function is_status_defined() { $status = \Jetpack_Options::get_option( self::STATUS_OPTION ); if ( false === $status || ! is_array( $status ) || empty( $status[ self::OPTION_STATUS_KEY ] ) ) { return false; } else { return true; } } /** * Update Sync Status if Full Sync ended of Posts * * @param string $checksum The checksum that's currently being processed. * @param array $range The ranges of object types being processed. */ public static function full_sync_end_update_status( $checksum, $range ) { if ( isset( $range['posts'] ) ) { self::update_status( self::STATUS_IN_SYNC ); } } }