applying compact design and updating error messages

This commit is contained in:
Amine Ben hammou
2017-12-19 14:56:02 +00:00
parent 2228f60e2a
commit 1ad0dce425
2 changed files with 4 additions and 4 deletions

View File

@ -92,7 +92,7 @@ class Subscribers extends APIEndpoint {
if($recaptcha['enabled'] && !isset($data['recaptcha'])) { if($recaptcha['enabled'] && !isset($data['recaptcha'])) {
return $this->badRequest(array( return $this->badRequest(array(
APIError::BAD_REQUEST => __('Please check the reCAPTCHA.', 'mailpoet') APIError::BAD_REQUEST => __('Please check the captcha.', 'mailpoet')
)); ));
} }
@ -105,13 +105,13 @@ class Subscribers extends APIEndpoint {
)); ));
if(is_wp_error($res)) { if(is_wp_error($res)) {
return $this->badRequest(array( return $this->badRequest(array(
APIError::BAD_REQUEST => __('Error while validating the reCAPTCHA.', 'mailpoet') APIError::BAD_REQUEST => __('Error while validating the captcha.', 'mailpoet')
)); ));
} }
$res = json_decode($res['body']); $res = json_decode($res['body']);
if(!$res->success) { if(!$res->success) {
return $this->badRequest(array( return $this->badRequest(array(
APIError::BAD_REQUEST => __('Error while validating the reCAPTCHA.', 'mailpoet') APIError::BAD_REQUEST => __('Error while validating the captcha.', 'mailpoet')
)); ));
} }
} }

View File

@ -53,7 +53,7 @@ class Renderer {
if(Setting::getValue('re_captcha.enabled')) { if(Setting::getValue('re_captcha.enabled')) {
$submit = array_pop($html); $submit = array_pop($html);
$site_key = Setting::getValue('re_captcha.site_token'); $site_key = Setting::getValue('re_captcha.site_token');
$html[] = '<div class="g-recaptcha" data-sitekey="'. $site_key .'"></div>'; $html[] = '<div class="g-recaptcha" data-size="compact" data-sitekey="'. $site_key .'"></div>';
$html[] = $submit; $html[] = $submit;
} }