add('gdpr_consent_error', 'ERROR: ' . Integration::getErrorMessage(self::ID)); } return $errors; } public function logGivenGDPRConsent() { if (isset($_POST['user_email'])) { global $wpdb; $wpdb->insert($wpdb->base_prefix . 'wpgdprc_log', array( 'plugin_id' => self::ID, 'user' => Helper::anonymizeEmail($_POST['user_email']), 'ip_address' => Helper::anonymizeIP(Helper::getClientIpAddress()), 'date_created' => Helper::localDateTime(time())->format('Y-m-d H:i:s'), 'log' => 'user has given consent when registering', 'consent_text' => Integration::getCheckboxText(self::ID) )); } } /** * @return null|WPRegistration */ public static function getInstance() { if (!isset(self::$instance)) { self::$instance = new self(); } return self::$instance; } }