Commit Graph

89 Commits

Author SHA1 Message Date
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
Oluwaseun Olorunsola
5ed0c3fb2d Allow form display on Woo Shop listing page
The WooCommerce Shop page is a special kind of page. It’s basically a post archive.

The Shop page is a placeholder for a post type archive for products. It may render differently than other pages in your install.
https://woocommerce.com/document/woocommerce-pages/#section-4

It doesn’t have any content and WooCommerce core team is also removing the the-content filter from the Shop listing page hence why we are unable to hook into the the-content filter we use for other parts of the codebase

MAILPOET-4663
2022-11-01 14:58:47 +01:00
Jan Jakes
742e3e85e9 Load translations for automation scripts using wp_set_script_translations()
[MAILPOET-4611]
2022-10-31 10:03:45 +01:00
Jan Jakes
6eeb5bb1bf Load all automation scripts using wp_enqueue_script()
[MAILPOET-4611]
2022-10-31 10:03:45 +01:00
David Remer
524e403a88 escape string for usage in JavaScript
[MAILPOET-4694]
2022-10-17 10:26:38 +02:00
Pavel Dohnal
941e443c22 Remove version number from the widget
[MAILPOET-4474]
2022-09-09 11:25:51 +02:00
Jan Jakes
598ae291e5 Fix issues detected by CodeSniffer
[MAILPOET-4617]
2022-09-06 17:38:01 +02:00
Jan Jakes
c601aaa3eb Autofix issues detected by CodeSniffer
[MAILPOET-4617]
2022-09-06 17:38:01 +02:00
David Remer
97e160bf67 Fix WordPress.WP.I18n.MissingArgDomain
[MAILPOET-4524]
2022-08-09 13:23:16 +02:00