Commit Graph

104 Commits

Author SHA1 Message Date
 Ján Mikláš
4a54033d1e Correctly show error message next to the field when the same form is rendered multiple times
Every form block now has unique ID (even the same block in two different form has different ID) used for rendering error messages. Before this, when the same form was rendered on a page multiple times, error messages of custom fields were always shown on the last rendered form, even if the first one was submitted.

[MAILPOET-6182]
2024-09-02 12:53:26 +02:00
 Ján Mikláš
ccc1786614 Add reCAPTCHA validation and prevent form submission when invalid
[MAILPOET-6182]
2024-09-02 12:53:26 +02:00
 Ján Mikláš
b7a6f0bea1 Change error message for checkbox and radio blocks in forms
[MAILPOET-6182]
2024-09-02 12:53:26 +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
alex-mpoet
45592114bd Fix privacy policy links not being replaced if no privacy page exists
[MAILPOET-4504]
2024-07-10 12:27:20 +02:00
Oluwaseun Olorunsola
5789a61075 Update ListingRepository::applySearch abstract function to reflect new updates
MAILPOET-6072
2024-06-20 13:31:46 +02:00
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