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
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
As of MySQL 8.0.28, there is no longer charset utf8, which was an alias for utf8mb3.
It is show as utf8mb3 so we need to check for both utf8 for older versions and utf8mb3 to cover newer versions.
See https://dev.mysql.com/doc/refman/8.0/en/charset-unicode-utf8.html
[MAILPOET-5888]
When loading an email post in the editor we need to attach MailPoet
specific data like associated newsletter entity id, email type etc.
This is done using register_rest_field function.
So far we only send the associated entity ID but there is also a method `saveEmailData` that will
be used to save MailPoet specific email data.
[MAILPOET-5365]
We need to add a warning so that we know for sure
that this piece of risky code gets reviewed by a human and consciously ignore the warning
[MAILPOET-5245]
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
This commit removes the method Posts::getTerms() as it existed to add a
compatibility layer for sites running WP < 4.5.0 and we don't support
this version anymore. The signature of the WP get_terms() function was
changed in version 4.5.0 and that is why this compatibility layer was
needed.
The integration test class for this method was also removed. The only
place where this method was used, AutomatedLatestContent::getTerms(),
now call WPFunctions->getTerms() directly. A very basic integration test
was added to cover the happy path of AutomatedLatestContent::getTerms().
[MAILPOET-4225]
- Convert date.js to typescript and define types
- Fix test script to include ts tests as well
- Make eslint for ts tests work correct and recognize mocha
[MAILPOET-4023]