validator = $validator; } public function is_valid() { $option = get_option( self::CACHE_OPTION ); if ( false !== $option ) { return (bool) $option; } $result = $this->validator->is_valid(); update_option( self::CACHE_OPTION, $result ? 1 : 0, true ); return $result; } }