Commit Graph

216 Commits

Author SHA1 Message Date
Rodrigo Primo
5c6000bed6 Fix: duplicated entries when exporting subscribers of dynamic segments
This commit fixes a bug in the code that exports subscribers to a CSV
file. This bug caused duplicated entries when exporting subscribers of
dynamic segments. Instead of a given subscriber appearing only once in the
CSV file, they would be included multiple times, and the number of times
would depend on the number of static segments that they had subscribed to.

This bug was caused by a problem in the code that generates the SQL
query used to fetch the subscribers that will be exported. The same
method is used for subscribers not linked to a segment, static
segments, and dynamic segments. The table wp_mailpoet_segments was
included in the query in the three cases, but it should not be included
for dynamic segments as this type of segment does not have a
corresponding entry in this table. Including this table without
specifying a segment ID (as there is not one for dynamic segments),
meant that MySQL would return an extra entry for a given subscriber for
each static segment that they had subscribed to.

[MAILPOET-3900]
2021-11-22 14:33:58 +01:00
Brezo Cordero
3cf95c7feb Attempt to convert dates using d/m/Y
[MAILPOET-3747]
2021-11-16 11:06:52 +01:00
oluwaseun Olorunsola
95f7e427f9 Use __ without using the WPFunctions wrapper
MAILPOET-3852
2021-11-03 13:35:18 +01:00
oluwaseun Olorunsola
1cdbf31b50 Include list column for excel subscribers export
MAILPOET-3852
2021-11-03 13:35:18 +01:00
Rostislav Wolny
73a9bed483 Replace deprecated doctrine methods in lib directory
[MAILPOET-3889]
2021-10-28 15:44:18 +02:00
Pavel Dohnal
21839fc30b Fix indentation of multiline function declarations
[MAILPOET-3732]
2021-09-17 12:17:36 +02:00
Pavel Dohnal
cdda3480ca Make all constructor signatures multiline
[MAILPOET-3732]
2021-09-16 14:19:40 +02:00
Rodrigo Primo
8b7815caf8 Use Doctrine for the opens and clicks exporters
This commit refactors the code that handles exporting e-mails opens and
clicks when generating the personal data file to use Doctrine instead of
Paris. I opted to do this in this task as opens and clicks code share
some functionality, and I didn't want to add more code that relies on
Paris, as we are eventually going to remove it.

[MAILPOET-3738]
2021-08-25 17:01:33 +02:00
Rodrigo Primo
780ac5e53c Add email opens data when exporting personal data
This commit adds stats about email opens data to the personal data
exported by WP.

To do this, I refactored the code that adds email clicks stats to use
base abstract class with functionality that is shared between both
exporters.

[MAILPOET-3738]
2021-08-25 17:01:33 +02:00
Rodrigo Primo
4fdcee1064 Add the new user agent field when exporting data about clicks
This commit includes information about the user agent used when clicking
links in e-mails to the data that MailPoet exports when the WP tool
"Export Personal Data" is used.

When information about the user agent is not available, the string
'Unknown' is displayed instead.

This information is available under the section "MailPoet Emails
Clicks".

[MAILPOET-3738]
2021-08-25 17:01:33 +02:00
Brezo Cordero
44932d27c9 Allow import subscribers with empty IP address
Allow import subscribers with empty confirmed_ip or subscribed_ip when one of the columns is selected in the last step of the import.
Don't allow importing invalid IP addresses - still import the subscriber but remove the invalid IP address.

[MAILPOET-3665]
2021-08-16 10:37:31 +02:00
Rodrigo Primo
e59992cc16 Fix checkGenericClassInNonGenericObjectType PHPStan errors
This commit removes the checkGenericClassInNonGenericObjectType flag
from PHPStan configuration files and fixes all associated errors in our
code base.

[MAILPOET-3236]
2021-08-09 12:58:56 +02:00
Rostislav Wolny
7a3ffa388f Update PHPStan
[MAILPOET-3658]
2021-07-06 13:29:00 +02:00
Jan Lysý
aeeceeeb8d Use Newsletter\Url as service
[MAILPOET-3269]
2021-06-14 10:12:34 +02:00
Jan Lysý
dbbe0266ec Calculate batch size for import custom fields
[MAILPOET-3570]
2021-04-19 12:44:43 +02:00
Pavel Dohnal
ce48153b12 Fix code using the combined segments
[MAILPOET-3212]
2021-03-23 15:58:34 +01:00
Jan Lysý
f3a54c0cec Remove distinct statement from export query
[MAILPOET-3505]
2021-03-22 13:37:42 +01:00
Rostislav Wolny
aff4c9d5b7 Fix dynamic segments filtering in subscriber export
[MAILPOET-3177]
2021-03-10 15:20:32 +01:00
wxa
e71e063ef0 Use same query logic for counting and exporting subs w/o lists
[MAILPOET-3462]
2021-03-10 13:16:48 +01:00
Rostislav Wolny
6f42222abc Fix subscriber consent data in export
[MAILPOET-3472]
2021-03-09 13:13:55 +01:00
Jan Lysý
be29262319 Add support for import subscription consent evidence
[MAILPOET-3389]
2021-03-08 11:39:44 +01:00
Jan Lysý
abdcbb245a Add missing fclose method for exported csv
[MAILPOET-3376]
2021-03-08 09:09:00 +01:00
Jan Lysý
a3224e9286 Remove old unused class for read subscribers
[MAILPOET-3376]
2021-03-08 09:09:00 +01:00
Jan Lysý
9c961757e7 Add a comment for a property segments in Export
[MAILPOET-3376]
2021-03-08 09:09:00 +01:00
Jan Lysý
302f9f2ca9 Set dynamic segment name via Doctrine parameter
[MAILPOET-3376]
2021-03-08 09:09:00 +01:00
Jan Lysý
8450beaf10 Add tests for get subscribers in ImportExportRepository
[MAILPOET-3376]
2021-03-08 09:09:00 +01:00
Jan Lysý
f2655c40aa Use doctrine for exporting subscribers
[MAILPOET-3376]
2021-03-08 09:09:00 +01:00
Jan Lysý
b2e0bac2d8 Add function for export subscribers to repository
[MAILPOET-3376]
2021-03-08 09:09:00 +01:00
Pavel Dohnal
5b56903eee Add date creation to the default fields
[MAILPOET-3393]
2021-03-02 16:39:22 +01:00
Pavel Dohnal
1e78769618 Use created_at as subscription date
[MAILPOET-3393]
2021-03-02 16:39:22 +01:00
Pavel Dohnal
f6f9983d9a Add the new fields for the export
[MAILPOET-3393]
2021-03-02 16:39:22 +01:00
Jan Lysý
cbea75927a Add ignoring improper subscribers from MailChimp
[MAILPOET-3404]
2021-03-02 14:29:27 +01:00
Jan Lysý
d940c9365e Refactor Mailchimp import to API v3
[MAILPOET-3404]
2021-03-02 14:29:27 +01:00
Jan Lysý
0347e44893 Use importExportRepository in import
[MAILPOET-3378]
2021-02-18 10:13:44 +01:00
Jan Lysý
7b893dfb51 Move multi insert functionality to a special repository
[MAILPOET-3378]
2021-02-18 10:13:44 +01:00
Jan Lysý
09acbb0d07 Use Doctrine instead of Paris in Import
[MAILPOET-3378]
2021-02-18 10:13:44 +01:00
Rostislav Wolny
8456581695 Refactor segment lists fetching methods to separate repository
[MAILPOET-3164]
2021-01-25 09:17:17 +01:00
Rostislav Wolny
cd578e6475 Refactor fetching list of subscribers for export
[MAILPOET-3146]
2021-01-25 09:17:17 +01:00
Rostislav Wolny
c7152e9448 Refactor getting segments for import into doctrine
[MAILPOET-3164]
2021-01-25 09:17:17 +01:00
Rostislav Wolny
d91c383e53 Fix importing WP users as subscribers
[MAILPOET-3298]
2020-11-16 13:25:56 +01:00
Ján Mikláš
4045fba527 Remove unnecessary duplicated 'text' property
[MAILPOET-3073]
2020-10-29 14:09:37 +01:00
Ján Mikláš
27eebf9ae9 Redesign select2 on export page
[MAILPOET-3073]
2020-10-29 14:09:37 +01:00
Pavel Dohnal
9e8ccd2c17 Use native array_column
[MAILPOET-3173]
2020-10-12 10:10:03 +02:00
Rostislav Wolny
82ce309df1 Rename property used for a dynamic segments service
[MAILPOET-3077]
2020-09-28 14:26:53 +02:00
Rostislav Wolny
814686e8d2 Refactor mailpoet_get_segment_filters to direct calls
[MAILPOET-3077]
2020-09-28 14:26:53 +02:00
Rostislav Wolny
331e40a137 Remove filter mailpoet_segments_with_subscriber_count
[MAILPOET-3077]
2020-09-28 14:26:53 +02:00
Rostislav Wolny
dd4bf486a6 Load dynamic segments for list directly without hook
[MAILPOET-3077]
2020-09-28 14:26:53 +02:00
Pavel Dohnal
3490b8847c Use wordpress time when importing subscribers
[MAILPOET-3041]
2020-09-02 10:35:16 +02:00
Lysy Jan
e7002f74ae Add possibility set status for new or existing users in import
Fixes:#2968
[MAILPOET-2957]
2020-08-10 15:16:31 +02:00
Pavel Dohnal
10f0d31137 Make sure the file is opened for export
[MAILPOET-2716]
2020-04-24 11:44:09 +02:00