Commit Graph

97 Commits

Author SHA1 Message Date
Jan Jakes
0fc6f40764 Fix W3C standard violation
Reported in https://wordpress.org/support/topic/w3c-standard-violation/#post-17543406.

[MAILPOET-5993]
2024-04-03 10:47:01 +02:00
Mike Jolley
435f638011 Apply rules on lib dir 2024-03-21 16:57:59 +01:00
Pavel Dohnal
91ba2dc89d Refactor forms column block to container queries
[MAILPOET-5917]
2024-03-18 12:17:37 +01:00
John Oleksowicz
314b1f3c27 Change method for detecting empty product pages
The previous method was relying on the idea that product pages would not
 trigger the `the_content` filter since they don't have to render the
 content. Testing revealed that this idea was unreliable.

In one instance WordPress was triggering `the_content` when attempting
to filter the excerpt, even though the excerpt was empty.

This changes the detection method to a much more direct inspection of
the post's content.

MAILPOET-5859
2024-03-08 12:27:06 +01:00
John Oleksowicz
0ab2be782d Show forms on empty product pages
The current logic for form rendering assumes that a single product page
will trigger the filter `the_content`. This is not always true. In cases
where the product has no description, WooCommerce does not render the
description tab at all, which is where that filter usually fires (in my
testing).

This change ensures that we still give these forms a chance to render on
 such pages.

MAILPOET-5859
2024-03-08 12:27:06 +01:00
Rostislav Wolny
93de29b379 Add support for heading and paragraph padding to form renderer
[MAILPOET-5714]
2024-02-19 11:44:33 +01:00
Rostislav Wolny
19506d724b Add gradient support for heading and paragraph to form renderer
[MAILPOET-5714]
2024-02-19 11:44:33 +01:00
Jan Jakes
a947dd36cd Use refreshAll() helper for batch updates
[MAILPOET-5845]
2024-02-02 12:48:40 +01:00
Jan Lysý
525c80bac4 Fix PHPStan warnings in lib
[MAILPOET-5751]
2023-12-13 11:48:14 +01:00
Jan Lysý
a1b1a6f674 Remove specific code for WP 6.2 and lower
[MAILPOET-5713]
2023-12-06 15:39:39 +01:00
Jan Jakes
469bdebf9c Use the new detach helper in other batch delete use cases
[MAILPOET-5745]
2023-12-04 12:13:51 +01:00
Rostislav Wolny
d84b738cdd Enqueue public.js to be loaded as deferred on WP 6.3+
[MAILPOET-5623]
2023-10-05 10:54:57 +02:00
Rostislav Wolny
c38b91f941 Get rid of inline JS code for public.js
This code was preventing WordPress from rendering the public.js
script as deferred.
The defer attribute can be applied only to scripts
that are loaded via src. WP detected that there was an associated
inline script and removed the defer attribute from the public.js script.

In this commit, I moved the initialization of the error message to public.js and
I pass the value via static object.
[MAILPOET-5623]
2023-10-05 10:54:57 +02:00
Jan Jakes
bb801597af Remove Twig CSS asset macro
[MAILPOET-5118]
2023-10-04 15:05:38 +02:00
Jan Jakes
480d9f1239 Extract admin pages assets setup out of form assets controller
[MAILPOET-5118]
2023-10-04 15:05:38 +02:00
Jan Jakes
6d6cb98dd6 Do not load site editor styles in analytics
[MAILPOET-5492]
2023-08-14 10:48:24 +02:00
David Remer
19de902c3f Load editor styles in analytics
[MAILPOET-5091]
2023-07-18 13:03:16 +02:00
John Oleksowicz
f3f33e5859 Don't automatically include homepage in all pages
MAILPOET-4897
2023-07-12 10:14:52 +02:00
John Oleksowicz
677ae370ed Handle special case for selected Posts page
MAILPOET-4897
2023-07-12 10:14:52 +02:00
John Oleksowicz
481f5585a0 Add form placement options for homepage, archives
MAILPOET-4897
2023-07-12 10:14:52 +02:00
David Remer
f10ef78825 Add Analytics Page and backend logic
[MAILPOET-5088]
2023-06-15 12:25:12 +02:00
David Remer
565959f28c Unify escaping of the attribute
[MAILPOET-4632]
2023-06-01 13:20:31 +02:00
David Remer
a5899895a8 Check if we have proper variables for padding and colors
[MAILPOET-4632]
2023-06-01 13:20:31 +02:00
Rodrigo Primo
00d021109c Move ModelValidator::validateNonRoleEmail() to a new Validator class
We want to remove/refactor the whole ModelValidator class as part of the
Doctrine refactor.

This commit moves the method ModelValidator::validateNonRoleEmail() to a
new Validator class as the method is not used by the validator system of
the Paris models. ModelValidator::validateEmail() was also moved as it
is called by ModelValidator::validateNonRoleEmail().

[MAILPOET-4343]
2023-05-17 12:37:22 +02:00
Jan Jakes
e81a8fca6a Load @wordpress/date settings and locale data for date picker
[MAILPOET-5000]
2023-05-08 13:58:31 +02:00
Rostislav Wolny
e62a3ee5b5 Add escaping for known shortcodes when rendered in form textarea's value
[MAILPOET-5243]
2023-04-27 10:42:34 +02:00
alex-mailpoet
930ff18785 Skip add_query_arg() finding as false positive
[MAILPOET-5230]
2023-04-26 10:01:51 +02:00
Rostislav Wolny
9240603063 Escape checkbox label on render
[MAILPOET-5241]
2023-04-24 13:26:31 +02:00
Rostislav Wolny
6c2cda36b0 Run custom field data through sanitizer when saving via API
[MAILPOET-5241]
2023-04-24 13:26:31 +02:00
Rostislav Wolny
4f42fa86a3 Use proper escaping function in option inner html
[MAILPOET-5233]
2023-04-17 11:51:52 +02:00
Brezo Cordero
94eeae5626 Escape values in Select block render
[MAILPOET-5233]
2023-04-17 11:51:52 +02:00
Jan Lysý
7fbb53e452 Fix possible scrollbar in forms
[MAILPOET-5116]
2023-03-22 09:20:57 +01:00
Rostislav Wolny
d14ce5410b Fix bold labels in forms
We save the falsy value for bold as "0" which was causing that labels
were rendered bold in front end also when the checkbox was disabled.
[MAILPOET-5139]
2023-03-20 17:24:31 +01:00
Rostislav Wolny
274a77ea92 Update from front end rendering to support font sizes with units
[MAILPOET-5139]
2023-03-20 17:24:31 +01:00
Sam Najian
2adc7fbc5e Add commons.js via wp_enqueue_script
[MAILPOET-4908]
2023-03-20 11:49:27 +01:00
Sam Najian
0a11fadb05 Enqueue newletter assest using asset controller
[MAILPOET-4908]
2023-03-20 11:49:27 +01:00
Sam Najian
c54a414d51 Make sure translations are loaded for newsletter editor
[MAILPOET-4908]
2023-03-20 11:49:27 +01:00
Sam Najian
f329306b1a Remove editor translations from tpl and add via wp/i18n
[MAILPOET-4908]
2023-03-20 11:49:27 +01:00
Sam Najian
ece4977d6a Add newsletter_editor.js using AssetsController
newsletter_editor.js was added via newsletter/editor.html
it's now removed from the template and wpEnqueueScript is
user instead

[MAILPOET-4908]
2023-03-20 11:49:27 +01:00
Jan Lysý
ce4aa37326 Add translating validation error messages for custom fields
[MAILPOET-4901]
2023-03-09 14:45:44 +01:00
Rostislav Wolny
a76fb6c63a Update form template "Relax" definition to display correctly
The popup and slide-in forms should not display email input and submit button in columns.
[MAILPOET-5047]
2023-02-13 12:14:05 +01:00
Oluwaseun Olorunsola
0019ad110e Update DisplayFormInWPContent::display method type and add more tests
MAILPOET-4885
MAILPOET-4820
2023-01-25 13:15:08 +01:00
Oluwaseun Olorunsola
62325dc096 Fix multiple forms display on pages with Woocommerce [products] shortcode
MAILPOET-4885
2023-01-25 13:15:08 +01:00
John Oleksowicz
761f7c6537 Prevent issues if other plugins define WC function
It's possible that other plugins might define wc_get_page_id, so it's
more important to know that WC is installed/active than to know if the
function itself exists.

For good measure I'm including a cast to int even though the WC version
of the function always returns an integer. This is probably unnecessary
but it protects us from the possibility of the WC version of the
function returning something other than an integer in the future.

[MAILPOET-4834]
2022-11-30 11:03:40 +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
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
Oluwaseun Olorunsola
a82a810269 Update form templates to include privacy page link (if found)
MAILPOET-4651
2022-11-16 16:51:12 +01:00
Oluwaseun Olorunsola
5a378b3c5f Add replacePrivacyLinkTags method for Form Template
MAILPOET-4651
2022-11-16 16:51:12 +01:00
Oluwaseun Olorunsola
b6e7e39fb0 Rename method and move wcGetPageId to Woo helper class
MAILPOET-4663
2022-11-01 14:58:47 +01:00
Oluwaseun Olorunsola
8c24d59f43 Add tests for form display on Woo Shop listing page
MAILPOET-4663
2022-11-01 14:58:47 +01:00