Commit Graph

15675 Commits

Author SHA1 Message Date
Rodrigo Primo
d874375c25 Remove MP2 migration main class and its test class
This commit removes the main MP2 migration class and its test class. It
also removes two SQL files that were used in the test class. One of
those files executed the following query:

`SET SQL_MODE = "NO_AUTO_VALUE_ON_ZERO"`

Removing this query made the tests inside SubscriberSegmentTest fail
when running the whole integration test suite. To work around this, I
added the above mentioned query to SubscriberSegmentTest. I'm not sure
why this test class fails without this query when running all the tests
but it doesn't when it is executed alone. Probably there is another test
class changing the SQL_MODE. Since SubscriberSegmentTest is a test class
for a Paris model that we will eventually remove, I decided it was not
necessary to investigate this further.

[MAILPOET-4376]
2022-08-15 12:46:22 +02:00
Rodrigo Primo
efab3be9ae Remove logic to handle MP2 subscribers when deactivating subscribers
This commit removes the logic that was added in #2045 to handle
subscribers migrated from MP2 when deactivating subscribers. Without it,
MP3 would deactive all subscribers imported from MP2 as the subscribe
date is migrated but the stats are not (see
https://mailpoet.atlassian.net/browse/MAILPOET-2040) for more details.

This code is not necessary anymore as we are removing all the MP2 migration
related code.

[MAILPOET-4376]
2022-08-15 12:46:22 +02:00
Rodrigo Primo
98e056bec7 Remove code that checks if the MP2 migration is in progress
[MAILPOET-4376]
2022-08-15 12:46:22 +02:00
Rodrigo Primo
9a5fbfbb24 Remove MP2 migration endpoints from the JSON API
[MAILPOET-4376]
2022-08-15 12:46:22 +02:00
Rodrigo Primo
d828754f94 Remove MP2 migration admin page
[MAILPOET-4376]
2022-08-15 12:46:22 +02:00
Rodrigo Primo
fdbc6ea603 Remove MP2 migration code from the welcome wizard
[MAILPOET-4376]
2022-08-15 12:46:22 +02:00
Rostislav Wolny
90ff2db0d1 Fix errors caught by translations code sniff
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
968cbb67d8 Refactor response caching in AuthorizedSenderDomainController
In the previous implementation the getDomainRecords couldn't be used without
calling getAllSenderDomains or getVerifiedSenderDomains upfront.
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
e03e375942 Fix variable names and comments typos
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
d625457174 Add logging of unexpected formats from sender domain endpoints on Bridge API
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
574c1cdd8f Reuse mocked api data in Bridre test case
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
c58c613959 Use WordPress translation functions directly
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
f4346c8957 Add links to sender domains API docs
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
543465d9de Fix indentation in Bridge
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
1642a5477c Use constants and add missing test case in DmarcPolicyCheckerTest
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
e36f105387 Add basic acceptance tests for sender domain verification
These tests test that basic checks works in both settings and send pages.
We can't verify the test domain for acceptance test docker so the tests just check the error state.
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
6411182705 Hide sender domains error when editing sender address
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
1ede10fce6 Update list of popular free ESP domains
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
baea06abf5 Unify loaders size in sender domain/email tabs and render in column
This makes sure that the modal has some reasonable initial size (small column).
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
39b431b7b3 Display correct tab in sender domain/email configuration modal based on clicked link
Previously when both errors were present authorized email tab was always opened no matter what error was clicked.
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
866c22c336 Use common/button component fot copy button
The proprietary button had displaying issues. This commit add props
that enable connection with a tooltip into the common button and replaces
the proprietary button with the common component.
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
de2b0c34b6 Remove unused max_width property from manage_sender_domain
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
838903bc41 Removing protypes from Typescript component
We use only typed props in components written in TS.
[MAILPOER-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
aee63444fe Skip DMARC address check when email domain is freemail
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
d389595d72 Prevent triggering domain and authorized email checks when MSS is not active
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
0fe260f605 Refactor sender address errors rendering on send page
Both auht. email error and DMARC check warning were rendered via parsley error.
There was not enough space for both messages to display and also both were rendered
as errors that block sending. But so far we allow sending when the DMARC warning is present.

This commit changes displaying of both error messages so that they are rendered in
a custom component and use the parsley only to mark the input red.
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
67b6d2279f Fetch authorized domains and emails for JS Apps only when MSS is active
This prevents calling bridge API in cases when user use different sending methods.
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
af203ba29e Refactor AuthorizedSenderDomainControllerTest to avoid live api calls
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
d0b1ff3aef Refactor sender domain related bridge integration tests to use mocks
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
fd1ac46207 Fix typo in isDomainDmarcRestricted method name
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Rostislav Wolny
4ffdd5bed5 Add declare(strict_types = 1); to newly added PHP files
[MAILPOET-4302]
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
ccb070c500 Update information provided for tracking
MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
fcd12b41b5 Update DMARC Status check
Handle edge case for domains where DMARC `p` policy is set to  reject or quarantine but `sp` (subdomain policy) is set to none

The previous implementation will return dmarcStatus === none when
sp is none but will not check for p policy as well.

If the `sp` is reject or quarantine, it would supersede the `p` status

MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
449fde75a7 Add tracking for authorized email and sender domain
MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
bbd27a5b3e Update ManageSenderDomain component UI
Add DomainKeyComponent to assist with rendering the input fields
and DomainStatusComponent for rendering the DNS records status

MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
f09616dc46 General refactor
Use a single click handler for css lookup

Set to mailpoet-js-button-authorize-email-and-sender-domain

MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
55f10a403c Show sender domain verification modal on newsletter
sending page

MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
bd5ea1041d Use unidirectional data store, remove unnecessary useState
MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
25013e8c8c Add AuthorizeSenderEmailAndDomainModal component
This component wraps the AuthorizeSenderEmailModal  and
AuthorizeSenderDomainModal and displays them in a Tabbed
manner

This gives the user the ability to either authorize an email or verify
a domain

MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
fcfcbcc4d7 Update SenderDomainModal and AuthorizeSenderEmailModal
Provide the ability to display content without modal

I included the `useModal` option for backward compatibility and
to not break any other components

MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
f9588484a6 Feat: Add classname to tabs
This would give us the ability to selectively display or hide the
tab component with CSS classes without causing issues
with the JavaScript code

MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
1a0796c627 Add clean up action after domain is verified
MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
847d199352 Implement the Manage Sender Domain component and
The AuthorizeSenderDomainModal

MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
5c3a9fe9b2 Add API methods for creating and verifying sender domains
We also included an API method for fetching Sender Domains

MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
aba68d2305 Add mailpoet_all_sender_domains to Newsletter and settings
MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
9e5f1d0ff0 Implement Show sender domain warning for settings
This would show the sender domain warning message for
domains that are not verified and have a Retricted DMARC Policy

MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
370de8050a Add mailpoet_verified_sender_domains to newsletters and settings page
Update tests

MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
c961e0a363 Add AuthorizedSenderDomainController class and tests
MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
601b3e775b Add DMARC Policy Checker class and
getDomainDmarcPolicy method

MAILPOET-4302
2022-08-11 12:36:23 +02:00
Oluwaseun Olorunsola
417c0897e8 Add API methods for fetching, creating and verifying
sender domain

MAILPOET-4302
2022-08-11 12:36:23 +02:00