Commit Graph

17 Commits

Author SHA1 Message Date
df171fdcc7 Add JSON endpoint for CAPTCHA rendering
To be used inside WP/WC registration form to construct URL for CAPTCHA page.

[MAILPOET-6325]
2024-12-17 13:56:00 +02:00
3bda992f13 Move CAPTCHA classes under MailPoet\Captcha dir
CAPTCHA usage is no longer tied to MP's subscription form.
2024-12-17 13:56:00 +02:00
d6d71c7cc3 Ensure the API request data are string
In case an array was passed to an endpoint or token, there was a fatal error.
[MAILPOET-6348]
2024-12-09 15:08:00 +01:00
070fd30b6e Update the notice message to fix consistency
MAILPOET-6022
2024-06-07 17:17:57 +02:00
4f63437ccc Add html to the error message
MAILPOET-6022
2024-06-07 17:17:57 +02:00
95e595de42 Invalid API endpoint exception improvement
MAILPOET-6022
2024-06-07 17:17:57 +02:00
212e01dd4c Add check that function error_log exists
[MAILPOET-5026]
2023-03-02 13:59:51 +01:00
aab8281af0 Remove request data from logged context
[MAILPOET-4639]
2023-01-09 15:23:48 +01:00
3df00548ab Change logged error to warning
[MAILPOET-4639]
2023-01-09 15:23:48 +01:00
ada346f4ef Add logging to php error log
[MAILPOET-4104]
2023-01-09 15:23:48 +01:00
b0ab2f404f Add logging errors to the log table
[MAILPOET-4104]
2023-01-09 15:23:48 +01:00
926620e8f8 Ignore strict types rule in all existing files that don't have it
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
4832771185 Refactor the captcha system
The current Captcha class has a lot of responsibilities. It renders the captcha
image, can check if a certain captcha type is a Google captcha, if a captcha is
required for a certain email. The SubscriberSubscribeController is not only in
charge of "controlling" the subscription process but also validates, whether a
captcha is correct or not. This architecture made it difficult to extend the
functionality and introduce the audio captcha feature.

Therefore this commit refactors the captcha architecture and tries to seperate
the different concerns into several classes and objects. Validation is now done
by validators.

The CaptchaPhrase now is in charge of keeping the captcha phrase consistent
between the image and the new audio, so that you can renew the captcha and both
captchas are in sync.

[MAILPOET-4514]
2022-11-24 09:20:39 +01:00
b05e6d414c Remove WP\Functions::__ and other translate functions
Under the new sniffer rules, those functions produce errors and, when those methods
are used, the sniffer can not properly be applied.

[MAILPOET-4524]
2022-08-09 13:23:16 +02:00
fc1f3e6dc2 Inline generateToken for clarity
The only thing Security::generateToken was providing was a default value
 for the $action, which created a pattern of using the same $action
 everywhere, which may not be the best way to go.

 Since it was essentially a wrapper for WP's built-in nonce functions,
 it seemed clearer to use those functions directly to be more explicit
 about how we're handling tokens.

[MAILPOET-2030]
2022-04-11 10:29:35 +02:00
a8d88beec9 Escape output according to WP sniffs
[MAILPOET-4129]
2022-04-04 17:12:33 +02:00
9f790efbf0 Move plugin files to a subfolder
[MAILPOET-3988]
2022-01-18 15:30:22 +01:00