Commit Graph

72 Commits

Author SHA1 Message Date
Jan Jakes
38c6880400 Unify setting no-cache headers, use WP-native nocache_headers() 2024-09-17 17:27:37 +02:00
Jan Jakes
ab16f5be10 Remove ignores of WordPressDotOrg sniffs
[MAILPOET-6150]
2024-08-29 17:23:34 +02:00
Rostislav Wolny
33f4b2d729 Replace usage of WP's current_time without gmt parameter in libs
This commit replaces usages by Carbon::now or in case we need a timestamp it
keeps current_time but adds the gtm parameter as true.
[MAILPOET-6142]
2024-08-19 15:29:42 +02:00
Rostislav Wolny
3214a86ee2 Add empty email check also for multisite registration
[MAILPOET-6188]
2024-08-16 09:35:45 +02:00
Rostislav Wolny
a046d4ab6f Attempt to add a subscriber only when there is an email address
[MAILPOET-6188]
2024-08-16 09:35:45 +02:00
 Ján Mikláš
8ec7333a34 Track CAPTCHA setting to Mixpanel
[MAILPOET-6187]
2024-08-13 08:01:38 +02:00
Jan Jakes
a664186108 Unify setting no-cache headers, use only relevant headers
See also: https://stackoverflow.com/questions/49547/how-do-we-control-web-page-caching-across-all-browsers

[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
Jan Jakes
ee6e22efa3 Regenerate CAPTCHA phrase using a custom request with cachebust to avoid caching
[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
Jan Jakes
758cb09a77 Check for audio file existence before sending headers
[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
Jan Jakes
975f42c56c Remove unnecessary check (it checks for image requirements, not audio)
[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
Jan Jakes
fad5e629af Simplify renderAudio and renderImage
[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
Jan Jakes
71d7f46718 Make captcha session stateless
[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
Jan Jakes
e8cf3d61ef Make captcha phrase stateless
[MAILPOET-6038]
2024-08-05 13:28:52 +02:00
Jan Jakes
10ef9ffce5 Initialize CAPTCHA session and phrase on page load
Previously, a new CAPTCHA phrase was generated when the CAPTCHA image
or audio was requested "again". For that, a counter needed to be stored in the
session, and since image and audio were fetched in parallel, any of them could
initialize the new CAPTCHA phrase. The problem appeared when they both
generated a new phrase at the same time. This resulted in a race condition,
where the image and audio had different CAPTCHA phrases and some users
weren't able to pass the CAPTCHA at all. This was occuring especially in Safari,
(maybe somehow due the type dectection range "preflight" request).

Now, the phrase is initialized on the CAPTCHA page load (and reloaded via AJAX),
so we don't need to store any additional metadata, apart from the phrase itself.

[MAILPOET-6038]x
2024-08-05 13:28:52 +02:00
Rostislav Wolny
39849a61f1 Use default sizes for captcha image in case invalid value is passed
[MAILPOET-6112]
2024-06-24 15:19:43 +02:00
Brezo Cordero
eb6cd87133 Add a limit to timeout in throttling function
to prevent integer overflows

[MAILPOET-6103]
2024-06-06 09:17:52 +03:00
Mike Jolley
435f638011 Apply rules on lib dir 2024-03-21 16:57:59 +01:00
Jan Lysý
525c80bac4 Fix PHPStan warnings in lib
[MAILPOET-5751]
2023-12-13 11:48:14 +01:00
Brezo Cordero
ecaaaaa729 Check if post is set when setting the title
[MAILPOET-5716]
2023-11-23 11:34:33 +01:00
Jan Lysý
c711eac7f4 Update custom fields on confirmation when are stored in unconfirmed data
[MAILPOET-5246]
2023-05-03 11:31:24 +02:00
David Remer
118cc83cc2 Remove 'Click to refresh' in title because a click does no longer refresh
[MAILPOET-5032]
2023-02-08 13:08:09 +01:00
David Remer
3da2144ead Extend audio type by range header
[MAILPOET-5032]
2023-02-08 13:08:09 +01:00
David Remer
efaa5073fb Query subscriber by user in shortcode
[MAILPOET-4184]
2023-02-01 10:53:26 +01:00
David Remer
37f4082210 Remove wpUser authentication
[MAILPOET-4184]
2023-02-01 10:53:26 +01:00
Rostislav Wolny
ee83e4d748 Refactor SubscriberActions:subscribe to return status of confirmation email
We need to pass the error or success info about the confirmation email
in order to be able to be able to display the error message.
[MAILPOET-4736]
2022-12-28 14:25:56 +01:00
 Ján Mikláš
650d730c3f Fix lowercased captcha on built-in CAPTCHA buttons
[MAILPOET-4915]
2022-12-16 14:27:49 +01:00
Sam Najian
b0ae21ec60 Record click stat for 1-click unsubscribe
[MAILPOET-4862]
2022-12-07 10:52:07 +01:00
Jan Jakes
926620e8f8 Ignore strict types rule in all existing files that don't have it
[MAILPOET-2688]
2022-11-29 15:04:09 +01:00
Sam Najian
735d33d05b Add method of tracking when tracking unsubscriptions
[MAILPOET-4733]
2022-11-25 14:51:57 +01:00
David Remer
86076547c3 Raise aria-live level
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
David Remer
f5c678ec2d Initialize session when no ID exists
[MAILPOET-4514]
2022-11-24 09:20:39 +01:00
David Remer
223625bd9b Use constant for endpoint
[MAILPOET-4514]
2022-11-24 09:20:39 +01:00
David Remer
fbd7cf8cc7 Use SubscriberEntity instead of the Model
[MAILPOET-4514]
2022-11-24 09:20:39 +01:00
David Remer
26c7e4d1cc Use null instead of empty string
[MAILPOET-4514]
2022-11-24 09:20:39 +01:00
David Remer
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
David Remer
7fb8d64628 Rename CaptchaRenderer to CaptchaFormRenderer
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
David Remer
36fed3bbf8 Enable output of audio captcha when image captcha has not yet been generated
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
David Remer
8ab738b315 Use classes instead of ids for captcha elements
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
David Remer
b84b9606e9 Remove type residual from audio captcha url building
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
David Remer
aa68b7e148 Bust caching when building the audio captcha url
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
David Remer
c164268c20 Change file name to lower case
and codestyle
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
David Remer
e42808f22d Update Captcha UI to add audio button
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
David Remer
75a4b2c538 Add Captcha Audio endpoint to Router
[MAILPOET-4203]
2022-11-24 09:20:39 +01:00
Oluwaseun Olorunsola
8b922681b6 Use boolean instead of integer for displayInManageSubscriptionPage column
MAILPOET-4669
2022-11-21 15:21:29 +01:00
Oluwaseun Olorunsola
e64dc1669f Add support for segment displayInManageSubscriptionPage on Subscription management page
MAILPOET-4669
2022-11-21 15:21:29 +01:00
Jan Jakes
725e0ecb00 Remove automation feature flag
[MAILPOET-4788]
2022-11-14 12:35:29 +02:00
David Remer
9a14ddb57c Fire mailpoet_segment_subscribed only when subscriber status changed
[MAILPOET-4773]
2022-11-07 04:41:47 -06:00
Oluwaseun Olorunsola
dc5254721e Update the confirmation page title
Show website title instead of list names

MAILPOET-4667
2022-10-27 13:42:50 +02:00
David Remer
87ced17813 Use submit button label of form for captcha submit button
[MAILPOET-4496]
2022-09-14 11:44:09 +02:00
David Remer
218de96024 Fix WordPress.WP.I18n.MissingTranslatorsComment errors
[MAILPOET-4524]
2022-08-09 13:23:16 +02:00