Add rule for concatenation operator spacing
[MAILPOET-2090]
This commit is contained in:
@ -33,7 +33,7 @@ abstract class Response {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!empty($response)) {
|
if (!empty($response)) {
|
||||||
@header('Content-Type: application/json; charset='.get_option('blog_charset'));
|
@header('Content-Type: application/json; charset=' . get_option('blog_charset'));
|
||||||
echo WPFunctions::get()->wpJsonEncode($response);
|
echo WPFunctions::get()->wpJsonEncode($response);
|
||||||
}
|
}
|
||||||
die();
|
die();
|
||||||
|
@ -55,7 +55,7 @@ class Segments extends APIEndpoint {
|
|||||||
$data = [];
|
$data = [];
|
||||||
foreach ($listing_data['items'] as $segment) {
|
foreach ($listing_data['items'] as $segment) {
|
||||||
$segment->subscribers_url = WPFunctions::get()->adminUrl(
|
$segment->subscribers_url = WPFunctions::get()->adminUrl(
|
||||||
'admin.php?page=mailpoet-subscribers#/filter[segment='.$segment->id.']'
|
'admin.php?page=mailpoet-subscribers#/filter[segment=' . $segment->id . ']'
|
||||||
);
|
);
|
||||||
|
|
||||||
$data[] = $segment
|
$data[] = $segment
|
||||||
|
@ -251,7 +251,7 @@ class MP2Migrator {
|
|||||||
global $wpdb;
|
global $wpdb;
|
||||||
|
|
||||||
$table = MP_SEGMENTS_TABLE;
|
$table = MP_SEGMENTS_TABLE;
|
||||||
$wpdb->query("DELETE FROM {$table} WHERE type != '" . Segment::TYPE_WP_USERS . "' AND type != '" . Segment::TYPE_WC_USERS ."'");
|
$wpdb->query("DELETE FROM {$table} WHERE type != '" . Segment::TYPE_WP_USERS . "' AND type != '" . Segment::TYPE_WC_USERS . "'");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -263,7 +263,7 @@ class Migrator {
|
|||||||
'type varchar(20) NOT NULL DEFAULT "standard",',
|
'type varchar(20) NOT NULL DEFAULT "standard",',
|
||||||
'sender_address varchar(150) NOT NULL DEFAULT "",',
|
'sender_address varchar(150) NOT NULL DEFAULT "",',
|
||||||
'sender_name varchar(150) NOT NULL DEFAULT "",',
|
'sender_name varchar(150) NOT NULL DEFAULT "",',
|
||||||
'status varchar(20) NOT NULL DEFAULT "'.Newsletter::STATUS_DRAFT.'",',
|
'status varchar(20) NOT NULL DEFAULT "' . Newsletter::STATUS_DRAFT . '",',
|
||||||
'reply_to_address varchar(150) NOT NULL DEFAULT "",',
|
'reply_to_address varchar(150) NOT NULL DEFAULT "",',
|
||||||
'reply_to_name varchar(150) NOT NULL DEFAULT "",',
|
'reply_to_name varchar(150) NOT NULL DEFAULT "",',
|
||||||
'preheader varchar(250) NOT NULL DEFAULT "",',
|
'preheader varchar(250) NOT NULL DEFAULT "",',
|
||||||
|
@ -599,7 +599,7 @@ class BookStoreWithCoupon {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'facebook',
|
'iconType' => 'facebook',
|
||||||
'link' => 'http://www.facebook.com',
|
'link' => 'http://www.facebook.com',
|
||||||
'image' => $this->social_icon_url.'/07-full-symbol-black/Facebook.png',
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Facebook.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Facebook',
|
'text' => 'Facebook',
|
||||||
@ -638,7 +638,7 @@ class BookStoreWithCoupon {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'twitter',
|
'iconType' => 'twitter',
|
||||||
'link' => 'http://www.twitter.com',
|
'link' => 'http://www.twitter.com',
|
||||||
'image' => $this->social_icon_url.'/07-full-symbol-black/Twitter.png',
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Twitter.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Twitter',
|
'text' => 'Twitter',
|
||||||
@ -677,7 +677,7 @@ class BookStoreWithCoupon {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'instagram',
|
'iconType' => 'instagram',
|
||||||
'link' => 'http://instagram.com',
|
'link' => 'http://instagram.com',
|
||||||
'image' => $this->social_icon_url.'/07-full-symbol-black/Instagram.png',
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Instagram.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Instagram',
|
'text' => 'Instagram',
|
||||||
|
@ -1463,7 +1463,7 @@ class ClearNews {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'facebook',
|
'iconType' => 'facebook',
|
||||||
'link' => 'http://www.facebook.com',
|
'link' => 'http://www.facebook.com',
|
||||||
'image' => $this->social_icon_url.'/03-circles/Facebook.png',
|
'image' => $this->social_icon_url . '/03-circles/Facebook.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Facebook',
|
'text' => 'Facebook',
|
||||||
@ -1473,7 +1473,7 @@ class ClearNews {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'twitter',
|
'iconType' => 'twitter',
|
||||||
'link' => 'http://www.twitter.com',
|
'link' => 'http://www.twitter.com',
|
||||||
'image' => $this->social_icon_url.'/03-circles/Twitter.png',
|
'image' => $this->social_icon_url . '/03-circles/Twitter.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Twitter',
|
'text' => 'Twitter',
|
||||||
@ -1483,7 +1483,7 @@ class ClearNews {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'youtube',
|
'iconType' => 'youtube',
|
||||||
'link' => 'http://www.youtube.com',
|
'link' => 'http://www.youtube.com',
|
||||||
'image' => $this->social_icon_url.'/03-circles/Youtube.png',
|
'image' => $this->social_icon_url . '/03-circles/Youtube.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Youtube',
|
'text' => 'Youtube',
|
||||||
|
@ -972,7 +972,7 @@ class FashionBlogA {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'facebook',
|
'iconType' => 'facebook',
|
||||||
'link' => 'http://www.facebook.com',
|
'link' => 'http://www.facebook.com',
|
||||||
'image' => $this->social_icon_url.'/07-full-symbol-black/Facebook.png',
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Facebook.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Facebook',
|
'text' => 'Facebook',
|
||||||
@ -982,7 +982,7 @@ class FashionBlogA {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'twitter',
|
'iconType' => 'twitter',
|
||||||
'link' => 'http://www.twitter.com',
|
'link' => 'http://www.twitter.com',
|
||||||
'image' => $this->social_icon_url.'/07-full-symbol-black/Twitter.png',
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Twitter.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Twitter',
|
'text' => 'Twitter',
|
||||||
@ -992,7 +992,7 @@ class FashionBlogA {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'instagram',
|
'iconType' => 'instagram',
|
||||||
'link' => 'http://instagram.com',
|
'link' => 'http://instagram.com',
|
||||||
'image' => $this->social_icon_url.'/07-full-symbol-black/Instagram.png',
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Instagram.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Instagram',
|
'text' => 'Instagram',
|
||||||
|
@ -556,7 +556,7 @@ class FashionShop {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'facebook',
|
'iconType' => 'facebook',
|
||||||
'link' => 'http://www.facebook.com',
|
'link' => 'http://www.facebook.com',
|
||||||
'image' => $this->social_icon_url.'/06-full-symbol-color/Facebook.png',
|
'image' => $this->social_icon_url . '/06-full-symbol-color/Facebook.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Facebook',
|
'text' => 'Facebook',
|
||||||
@ -566,7 +566,7 @@ class FashionShop {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'twitter',
|
'iconType' => 'twitter',
|
||||||
'link' => 'http://www.twitter.com',
|
'link' => 'http://www.twitter.com',
|
||||||
'image' => $this->social_icon_url.'/06-full-symbol-color/Twitter.png',
|
'image' => $this->social_icon_url . '/06-full-symbol-color/Twitter.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Twitter',
|
'text' => 'Twitter',
|
||||||
@ -576,7 +576,7 @@ class FashionShop {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'instagram',
|
'iconType' => 'instagram',
|
||||||
'link' => 'http://instagram.com',
|
'link' => 'http://instagram.com',
|
||||||
'image' => $this->social_icon_url.'/06-full-symbol-color/Instagram.png',
|
'image' => $this->social_icon_url . '/06-full-symbol-color/Instagram.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Instagram',
|
'text' => 'Instagram',
|
||||||
@ -586,7 +586,7 @@ class FashionShop {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'youtube',
|
'iconType' => 'youtube',
|
||||||
'link' => 'http://www.youtube.com',
|
'link' => 'http://www.youtube.com',
|
||||||
'image' => $this->social_icon_url.'/06-full-symbol-color/Youtube.png',
|
'image' => $this->social_icon_url . '/06-full-symbol-color/Youtube.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Youtube',
|
'text' => 'Youtube',
|
||||||
|
@ -228,7 +228,7 @@ class FlowersWithCoupon {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'facebook',
|
'iconType' => 'facebook',
|
||||||
'link' => 'http://www.facebook.com',
|
'link' => 'http://www.facebook.com',
|
||||||
'image' => $this->social_icon_url.'/07-full-symbol-black/Facebook.png',
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Facebook.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Facebook',
|
'text' => 'Facebook',
|
||||||
@ -238,7 +238,7 @@ class FlowersWithCoupon {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'twitter',
|
'iconType' => 'twitter',
|
||||||
'link' => 'http://www.twitter.com',
|
'link' => 'http://www.twitter.com',
|
||||||
'image' => $this->social_icon_url.'/07-full-symbol-black/Twitter.png',
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Twitter.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Twitter',
|
'text' => 'Twitter',
|
||||||
@ -248,7 +248,7 @@ class FlowersWithCoupon {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'instagram',
|
'iconType' => 'instagram',
|
||||||
'link' => 'http://instagram.com',
|
'link' => 'http://instagram.com',
|
||||||
'image' => $this->social_icon_url.'/07-full-symbol-black/Instagram.png',
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Instagram.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Instagram',
|
'text' => 'Instagram',
|
||||||
@ -1090,7 +1090,7 @@ class FlowersWithCoupon {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'facebook',
|
'iconType' => 'facebook',
|
||||||
'link' => 'http://www.facebook.com',
|
'link' => 'http://www.facebook.com',
|
||||||
'image' => $this->social_icon_url.'/02-grey/Facebook.png',
|
'image' => $this->social_icon_url . '/02-grey/Facebook.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Facebook',
|
'text' => 'Facebook',
|
||||||
@ -1100,7 +1100,7 @@ class FlowersWithCoupon {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'twitter',
|
'iconType' => 'twitter',
|
||||||
'link' => 'http://www.twitter.com',
|
'link' => 'http://www.twitter.com',
|
||||||
'image' => $this->social_icon_url.'/02-grey/Twitter.png',
|
'image' => $this->social_icon_url . '/02-grey/Twitter.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Twitter',
|
'text' => 'Twitter',
|
||||||
@ -1110,7 +1110,7 @@ class FlowersWithCoupon {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'instagram',
|
'iconType' => 'instagram',
|
||||||
'link' => 'http://instagram.com',
|
'link' => 'http://instagram.com',
|
||||||
'image' => $this->social_icon_url.'/02-grey/Instagram.png',
|
'image' => $this->social_icon_url . '/02-grey/Instagram.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Instagram',
|
'text' => 'Instagram',
|
||||||
|
@ -1001,7 +1001,7 @@ class IndustryConference {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'facebook',
|
'iconType' => 'facebook',
|
||||||
'link' => 'http://www.facebook.com',
|
'link' => 'http://www.facebook.com',
|
||||||
'image' => $this->social_icon_url.'/08-full-symbol-grey/Facebook.png',
|
'image' => $this->social_icon_url . '/08-full-symbol-grey/Facebook.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Facebook',
|
'text' => 'Facebook',
|
||||||
@ -1011,7 +1011,7 @@ class IndustryConference {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'twitter',
|
'iconType' => 'twitter',
|
||||||
'link' => 'http://www.twitter.com',
|
'link' => 'http://www.twitter.com',
|
||||||
'image' => $this->social_icon_url.'/08-full-symbol-grey/Twitter.png',
|
'image' => $this->social_icon_url . '/08-full-symbol-grey/Twitter.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Twitter',
|
'text' => 'Twitter',
|
||||||
@ -1021,7 +1021,7 @@ class IndustryConference {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'email',
|
'iconType' => 'email',
|
||||||
'link' => '',
|
'link' => '',
|
||||||
'image' => $this->social_icon_url.'/08-full-symbol-grey/Email.png',
|
'image' => $this->social_icon_url . '/08-full-symbol-grey/Email.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Email',
|
'text' => 'Email',
|
||||||
@ -1031,7 +1031,7 @@ class IndustryConference {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'instagram',
|
'iconType' => 'instagram',
|
||||||
'link' => 'http://instagram.com',
|
'link' => 'http://instagram.com',
|
||||||
'image' => $this->social_icon_url.'/08-full-symbol-grey/Instagram.png',
|
'image' => $this->social_icon_url . '/08-full-symbol-grey/Instagram.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Instagram',
|
'text' => 'Instagram',
|
||||||
|
@ -860,7 +860,7 @@ class LifestyleBlogA {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'facebook',
|
'iconType' => 'facebook',
|
||||||
'link' => 'http://www.facebook.com',
|
'link' => 'http://www.facebook.com',
|
||||||
'image' => $this->social_icon_url.'/07-full-symbol-black/Facebook.png',
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Facebook.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Facebook',
|
'text' => 'Facebook',
|
||||||
@ -870,7 +870,7 @@ class LifestyleBlogA {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'twitter',
|
'iconType' => 'twitter',
|
||||||
'link' => 'http://www.twitter.com',
|
'link' => 'http://www.twitter.com',
|
||||||
'image' => $this->social_icon_url.'/07-full-symbol-black/Twitter.png',
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Twitter.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Twitter',
|
'text' => 'Twitter',
|
||||||
@ -880,7 +880,7 @@ class LifestyleBlogA {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'instagram',
|
'iconType' => 'instagram',
|
||||||
'link' => 'http://instagram.com',
|
'link' => 'http://instagram.com',
|
||||||
'image' => $this->social_icon_url.'/07-full-symbol-black/Instagram.png',
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Instagram.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Instagram',
|
'text' => 'Instagram',
|
||||||
|
@ -1069,7 +1069,7 @@ class LifestyleBlogB {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'facebook',
|
'iconType' => 'facebook',
|
||||||
'link' => 'http://www.facebook.com',
|
'link' => 'http://www.facebook.com',
|
||||||
'image' => $this->social_icon_url.'/03-circles/Facebook.png',
|
'image' => $this->social_icon_url . '/03-circles/Facebook.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Facebook',
|
'text' => 'Facebook',
|
||||||
@ -1079,7 +1079,7 @@ class LifestyleBlogB {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'twitter',
|
'iconType' => 'twitter',
|
||||||
'link' => 'http://www.twitter.com',
|
'link' => 'http://www.twitter.com',
|
||||||
'image' => $this->social_icon_url.'/03-circles/Twitter.png',
|
'image' => $this->social_icon_url . '/03-circles/Twitter.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Twitter',
|
'text' => 'Twitter',
|
||||||
@ -1089,7 +1089,7 @@ class LifestyleBlogB {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'website',
|
'iconType' => 'website',
|
||||||
'link' => '',
|
'link' => '',
|
||||||
'image' => $this->social_icon_url.'/03-circles/Website.png',
|
'image' => $this->social_icon_url . '/03-circles/Website.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Website',
|
'text' => 'Website',
|
||||||
@ -1099,7 +1099,7 @@ class LifestyleBlogB {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'pinterest',
|
'iconType' => 'pinterest',
|
||||||
'link' => 'http://www.pinterest.com',
|
'link' => 'http://www.pinterest.com',
|
||||||
'image' => $this->social_icon_url.'/03-circles/Pinterest.png',
|
'image' => $this->social_icon_url . '/03-circles/Pinterest.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Pinterest',
|
'text' => 'Pinterest',
|
||||||
|
@ -753,7 +753,7 @@ class NewspaperTraditional {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'facebook',
|
'iconType' => 'facebook',
|
||||||
'link' => 'http://www.facebook.com',
|
'link' => 'http://www.facebook.com',
|
||||||
'image' => $this->social_icon_url.'/07-full-symbol-black/Facebook.png',
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Facebook.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Facebook',
|
'text' => 'Facebook',
|
||||||
@ -763,7 +763,7 @@ class NewspaperTraditional {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'twitter',
|
'iconType' => 'twitter',
|
||||||
'link' => 'http://www.twitter.com',
|
'link' => 'http://www.twitter.com',
|
||||||
'image' => $this->social_icon_url.'/07-full-symbol-black/Twitter.png',
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Twitter.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Twitter',
|
'text' => 'Twitter',
|
||||||
@ -773,7 +773,7 @@ class NewspaperTraditional {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'instagram',
|
'iconType' => 'instagram',
|
||||||
'link' => 'http://instagram.com',
|
'link' => 'http://instagram.com',
|
||||||
'image' => $this->social_icon_url.'/07-full-symbol-black/Instagram.png',
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Instagram.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Instagram',
|
'text' => 'Instagram',
|
||||||
@ -783,7 +783,7 @@ class NewspaperTraditional {
|
|||||||
'type' => 'socialIcon',
|
'type' => 'socialIcon',
|
||||||
'iconType' => 'email',
|
'iconType' => 'email',
|
||||||
'link' => '',
|
'link' => '',
|
||||||
'image' => $this->social_icon_url.'/07-full-symbol-black/Email.png',
|
'image' => $this->social_icon_url . '/07-full-symbol-black/Email.png',
|
||||||
'height' => '32px',
|
'height' => '32px',
|
||||||
'width' => '32px',
|
'width' => '32px',
|
||||||
'text' => 'Email',
|
'text' => 'Email',
|
||||||
|
@ -92,7 +92,7 @@ class RequirementsChecker {
|
|||||||
|
|
||||||
function checkMbstringExtension() {
|
function checkMbstringExtension() {
|
||||||
if (!extension_loaded('mbstring')) {
|
if (!extension_loaded('mbstring')) {
|
||||||
require_once Env::$util_path .'/Polyfills.php';
|
require_once Env::$util_path . '/Polyfills.php';
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -99,17 +99,17 @@ class Shortcodes {
|
|||||||
} else {
|
} else {
|
||||||
$title = $this->wp->applyFilters('mailpoet_archive_title', '');
|
$title = $this->wp->applyFilters('mailpoet_archive_title', '');
|
||||||
if (!empty($title)) {
|
if (!empty($title)) {
|
||||||
$html .= '<h3 class="mailpoet_archive_title">'.$title.'</h3>';
|
$html .= '<h3 class="mailpoet_archive_title">' . $title . '</h3>';
|
||||||
}
|
}
|
||||||
$html .= '<ul class="mailpoet_archive">';
|
$html .= '<ul class="mailpoet_archive">';
|
||||||
foreach ($newsletters as $newsletter) {
|
foreach ($newsletters as $newsletter) {
|
||||||
$queue = $newsletter->queue()->findOne();
|
$queue = $newsletter->queue()->findOne();
|
||||||
$html .= '<li>'.
|
$html .= '<li>' .
|
||||||
'<span class="mailpoet_archive_date">'.
|
'<span class="mailpoet_archive_date">' .
|
||||||
$this->wp->applyFilters('mailpoet_archive_date', $newsletter).
|
$this->wp->applyFilters('mailpoet_archive_date', $newsletter) .
|
||||||
'</span>
|
'</span>
|
||||||
<span class="mailpoet_archive_subject">'.
|
<span class="mailpoet_archive_subject">' .
|
||||||
$this->wp->applyFilters('mailpoet_archive_subject', $newsletter, $subscriber, $queue).
|
$this->wp->applyFilters('mailpoet_archive_subject', $newsletter, $subscriber, $queue) .
|
||||||
'</span>
|
'</span>
|
||||||
</li>';
|
</li>';
|
||||||
}
|
}
|
||||||
@ -132,9 +132,9 @@ class Shortcodes {
|
|||||||
$subscriber,
|
$subscriber,
|
||||||
$queue
|
$queue
|
||||||
);
|
);
|
||||||
return '<a href="'.esc_attr($preview_url).'" target="_blank" title="'
|
return '<a href="' . esc_attr($preview_url) . '" target="_blank" title="'
|
||||||
.esc_attr(__('Preview in a new tab', 'mailpoet')).'">'
|
. esc_attr(__('Preview in a new tab', 'mailpoet')) . '">'
|
||||||
.esc_attr($newsletter->newsletter_rendered_subject).
|
. esc_attr($newsletter->newsletter_rendered_subject) .
|
||||||
'</a>';
|
'</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -26,7 +26,7 @@ class ContainerFactory {
|
|||||||
* @return Container
|
* @return Container
|
||||||
*/
|
*/
|
||||||
function getContainer() {
|
function getContainer() {
|
||||||
$dump_class = '\\'. $this->configurator->getDumpNamespace() . '\\' . $this->configurator->getDumpClassname();
|
$dump_class = '\\' . $this->configurator->getDumpNamespace() . '\\' . $this->configurator->getDumpClassname();
|
||||||
if (!$this->debug && class_exists($dump_class)) {
|
if (!$this->debug && class_exists($dump_class)) {
|
||||||
$container = new $dump_class();
|
$container = new $dump_class();
|
||||||
} else {
|
} else {
|
||||||
|
@ -39,14 +39,14 @@ abstract class Base {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (in_array($block['type'], ['radio', 'checkbox'])) {
|
if (in_array($block['type'], ['radio', 'checkbox'])) {
|
||||||
$rules['group'] = 'custom_field_'.$block['id'];
|
$rules['group'] = 'custom_field_' . $block['id'];
|
||||||
$rules['errors-container'] = '.mailpoet_error_'.$block['id'];
|
$rules['errors-container'] = '.mailpoet_error_' . $block['id'];
|
||||||
$rules['required-message'] = WPFunctions::get()->__('Please select at least one option', 'mailpoet');
|
$rules['required-message'] = WPFunctions::get()->__('Please select at least one option', 'mailpoet');
|
||||||
}
|
}
|
||||||
|
|
||||||
if ($block['type'] === 'date') {
|
if ($block['type'] === 'date') {
|
||||||
$rules['group'] = 'custom_field_'.$block['id'];
|
$rules['group'] = 'custom_field_' . $block['id'];
|
||||||
$rules['errors-container'] = '.mailpoet_error_'.$block['id'];
|
$rules['errors-container'] = '.mailpoet_error_' . $block['id'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$validation = [];
|
$validation = [];
|
||||||
@ -59,7 +59,7 @@ abstract class Base {
|
|||||||
if (is_bool($value)) {
|
if (is_bool($value)) {
|
||||||
$value = ($value) ? 'true' : 'false';
|
$value = ($value) ? 'true' : 'false';
|
||||||
}
|
}
|
||||||
$validation[] = 'data-parsley-'.$rule.'="'.$value.'"';
|
$validation[] = 'data-parsley-' . $rule . '="' . $value . '"';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return join(' ', $validation);
|
return join(' ', $validation);
|
||||||
@ -75,7 +75,7 @@ abstract class Base {
|
|||||||
}
|
}
|
||||||
if (isset($block['params']['label'])
|
if (isset($block['params']['label'])
|
||||||
&& strlen(trim($block['params']['label'])) > 0) {
|
&& strlen(trim($block['params']['label'])) > 0) {
|
||||||
$html .= '<label class="mailpoet_'.$block['type'].'_label">';
|
$html .= '<label class="mailpoet_' . $block['type'] . '_label">';
|
||||||
$html .= htmlspecialchars($block['params']['label']);
|
$html .= htmlspecialchars($block['params']['label']);
|
||||||
|
|
||||||
if (isset($block['params']['required']) && $block['params']['required']) {
|
if (isset($block['params']['required']) && $block['params']['required']) {
|
||||||
@ -109,7 +109,7 @@ abstract class Base {
|
|||||||
// return field name depending on block data
|
// return field name depending on block data
|
||||||
protected static function getFieldName($block = []) {
|
protected static function getFieldName($block = []) {
|
||||||
if ((int)$block['id'] > 0) {
|
if ((int)$block['id'] > 0) {
|
||||||
return 'cf_'.$block['id'];
|
return 'cf_' . $block['id'];
|
||||||
} else {
|
} else {
|
||||||
$obfuscator = new FieldNameObfuscator();
|
$obfuscator = new FieldNameObfuscator();
|
||||||
return $obfuscator->obfuscate($block['id']);//obfuscate field name for spambots
|
return $obfuscator->obfuscate($block['id']);//obfuscate field name for spambots
|
||||||
|
@ -26,7 +26,7 @@ class Checkbox extends Base {
|
|||||||
$html .= '<label class="mailpoet_checkbox_label">';
|
$html .= '<label class="mailpoet_checkbox_label">';
|
||||||
$html .= '<input type="checkbox" class="mailpoet_checkbox" ';
|
$html .= '<input type="checkbox" class="mailpoet_checkbox" ';
|
||||||
|
|
||||||
$html .= 'name="'.$field_name.'" ';
|
$html .= 'name="' . $field_name . '" ';
|
||||||
|
|
||||||
$html .= 'value="1" ';
|
$html .= 'value="1" ';
|
||||||
|
|
||||||
@ -40,12 +40,12 @@ class Checkbox extends Base {
|
|||||||
|
|
||||||
$html .= $field_validation;
|
$html .= $field_validation;
|
||||||
|
|
||||||
$html .= ' /> '.esc_attr($option['value']);
|
$html .= ' /> ' . esc_attr($option['value']);
|
||||||
|
|
||||||
$html .= '</label>';
|
$html .= '</label>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$html .= '<span class="mailpoet_error_'.$block['id'].'"></span>';
|
$html .= '<span class="mailpoet_error_' . $block['id'] . '"></span>';
|
||||||
|
|
||||||
$html .= '</p>';
|
$html .= '</p>';
|
||||||
|
|
||||||
|
@ -73,7 +73,7 @@ class Date extends Base {
|
|||||||
$html .= static::getInputValidation($block, [
|
$html .= static::getInputValidation($block, [
|
||||||
'required-message' => WPFunctions::get()->__('Please select a day', 'mailpoet'),
|
'required-message' => WPFunctions::get()->__('Please select a day', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
$html .= 'name="'.$field_name.'[day]" placeholder="'.__('Day', 'mailpoet').'">';
|
$html .= 'name="' . $field_name . '[day]" placeholder="' . __('Day', 'mailpoet') . '">';
|
||||||
$html .= static::getDays($block);
|
$html .= static::getDays($block);
|
||||||
$html .= '</select>';
|
$html .= '</select>';
|
||||||
} else if ($date_selector === 'MM') {
|
} else if ($date_selector === 'MM') {
|
||||||
@ -82,7 +82,7 @@ class Date extends Base {
|
|||||||
$html .= static::getInputValidation($block, [
|
$html .= static::getInputValidation($block, [
|
||||||
'required-message' => WPFunctions::get()->__('Please select a month', 'mailpoet'),
|
'required-message' => WPFunctions::get()->__('Please select a month', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
$html .= 'name="'.$field_name.'[month]" placeholder="'.__('Month', 'mailpoet').'">';
|
$html .= 'name="' . $field_name . '[month]" placeholder="' . __('Month', 'mailpoet') . '">';
|
||||||
$html .= static::getMonths($block);
|
$html .= static::getMonths($block);
|
||||||
$html .= '</select>';
|
$html .= '</select>';
|
||||||
} else if ($date_selector === 'YYYY') {
|
} else if ($date_selector === 'YYYY') {
|
||||||
@ -91,13 +91,13 @@ class Date extends Base {
|
|||||||
$html .= static::getInputValidation($block, [
|
$html .= static::getInputValidation($block, [
|
||||||
'required-message' => WPFunctions::get()->__('Please select a year', 'mailpoet'),
|
'required-message' => WPFunctions::get()->__('Please select a year', 'mailpoet'),
|
||||||
]);
|
]);
|
||||||
$html .= 'name="'.$field_name.'[year]" placeholder="'.__('Year', 'mailpoet').'">';
|
$html .= 'name="' . $field_name . '[year]" placeholder="' . __('Year', 'mailpoet') . '">';
|
||||||
$html .= static::getYears($block);
|
$html .= static::getYears($block);
|
||||||
$html .= '</select>';
|
$html .= '</select>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$html .= '<span class="mailpoet_error_'.$block['id'].'"></span>';
|
$html .= '<span class="mailpoet_error_' . $block['id'] . '"></span>';
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
}
|
}
|
||||||
@ -139,11 +139,11 @@ class Date extends Base {
|
|||||||
$html = '';
|
$html = '';
|
||||||
|
|
||||||
// empty value label
|
// empty value label
|
||||||
$html .= '<option value="">'.__('Month', 'mailpoet').'</option>';
|
$html .= '<option value="">' . __('Month', 'mailpoet') . '</option>';
|
||||||
|
|
||||||
for ($i = 1; $i < 13; $i++) {
|
for ($i = 1; $i < 13; $i++) {
|
||||||
$is_selected = ($i === $block['selected']) ? 'selected="selected"' : '';
|
$is_selected = ($i === $block['selected']) ? 'selected="selected"' : '';
|
||||||
$html .= '<option value="'.$i.'" '.$is_selected.'>';
|
$html .= '<option value="' . $i . '" ' . $is_selected . '>';
|
||||||
$html .= $month_names[$i - 1];
|
$html .= $month_names[$i - 1];
|
||||||
$html .= '</option>';
|
$html .= '</option>';
|
||||||
}
|
}
|
||||||
@ -169,12 +169,12 @@ class Date extends Base {
|
|||||||
$html = '';
|
$html = '';
|
||||||
|
|
||||||
// empty value label
|
// empty value label
|
||||||
$html .= '<option value="">'.__('Year', 'mailpoet').'</option>';
|
$html .= '<option value="">' . __('Year', 'mailpoet') . '</option>';
|
||||||
|
|
||||||
// return years as an array
|
// return years as an array
|
||||||
for ($i = (int)$block['to']; $i > (int)($block['from'] - 1); $i--) {
|
for ($i = (int)$block['to']; $i > (int)($block['from'] - 1); $i--) {
|
||||||
$is_selected = ($i === $block['selected']) ? 'selected="selected"' : '';
|
$is_selected = ($i === $block['selected']) ? 'selected="selected"' : '';
|
||||||
$html .= '<option value="'.$i.'" '.$is_selected.'>'.$i.'</option>';
|
$html .= '<option value="' . $i . '" ' . $is_selected . '>' . $i . '</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
@ -195,12 +195,12 @@ class Date extends Base {
|
|||||||
$html = '';
|
$html = '';
|
||||||
|
|
||||||
// empty value label
|
// empty value label
|
||||||
$html .= '<option value="">'.__('Day', 'mailpoet').'</option>';
|
$html .= '<option value="">' . __('Day', 'mailpoet') . '</option>';
|
||||||
|
|
||||||
// return days as an array
|
// return days as an array
|
||||||
for ($i = 1; $i < 32; $i++) {
|
for ($i = 1; $i < 32; $i++) {
|
||||||
$is_selected = ($i === $block['selected']) ? 'selected="selected"' : '';
|
$is_selected = ($i === $block['selected']) ? 'selected="selected"' : '';
|
||||||
$html .= '<option value="'.$i.'" '.$is_selected.'>'.$i.'</option>';
|
$html .= '<option value="' . $i . '" ' . $is_selected . '>' . $i . '</option>';
|
||||||
}
|
}
|
||||||
|
|
||||||
return $html;
|
return $html;
|
||||||
|
@ -27,7 +27,7 @@ class Radio extends Base {
|
|||||||
|
|
||||||
$html .= '<input type="radio" class="mailpoet_radio" ';
|
$html .= '<input type="radio" class="mailpoet_radio" ';
|
||||||
|
|
||||||
$html .= 'name="'.$field_name.'" ';
|
$html .= 'name="' . $field_name . '" ';
|
||||||
|
|
||||||
if (is_array($option['value'])) {
|
if (is_array($option['value'])) {
|
||||||
$value = key($option['value']);
|
$value = key($option['value']);
|
||||||
@ -37,7 +37,7 @@ class Radio extends Base {
|
|||||||
$label = $option['value'];
|
$label = $option['value'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$html .= 'value="'.esc_attr($value).'" ';
|
$html .= 'value="' . esc_attr($value) . '" ';
|
||||||
|
|
||||||
$html .= (
|
$html .= (
|
||||||
(
|
(
|
||||||
@ -48,11 +48,11 @@ class Radio extends Base {
|
|||||||
) ? 'checked="checked"' : '';
|
) ? 'checked="checked"' : '';
|
||||||
|
|
||||||
$html .= $field_validation;
|
$html .= $field_validation;
|
||||||
$html .= ' /> '.esc_attr($label);
|
$html .= ' /> ' . esc_attr($label);
|
||||||
$html .= '</label>';
|
$html .= '</label>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$html .= '<span class="mailpoet_error_'.$block['id'].'"></span>';
|
$html .= '<span class="mailpoet_error_' . $block['id'] . '"></span>';
|
||||||
|
|
||||||
$html .= '</p>';
|
$html .= '</p>';
|
||||||
|
|
||||||
|
@ -27,14 +27,14 @@ class Segment extends Base {
|
|||||||
|
|
||||||
$html .= '<label class="mailpoet_checkbox_label">';
|
$html .= '<label class="mailpoet_checkbox_label">';
|
||||||
$html .= '<input type="checkbox" class="mailpoet_checkbox" ';
|
$html .= '<input type="checkbox" class="mailpoet_checkbox" ';
|
||||||
$html .= 'name="'.$field_name.'[]" ';
|
$html .= 'name="' . $field_name . '[]" ';
|
||||||
$html .= 'value="'.$option['id'].'" '.$is_checked.' ';
|
$html .= 'value="' . $option['id'] . '" ' . $is_checked . ' ';
|
||||||
$html .= $field_validation;
|
$html .= $field_validation;
|
||||||
$html .= ' /> '.esc_attr($option['name']);
|
$html .= ' /> ' . esc_attr($option['name']);
|
||||||
$html .= '</label>';
|
$html .= '</label>';
|
||||||
}
|
}
|
||||||
|
|
||||||
$html .= '<span class="mailpoet_error_'.$block['id'].'"></span>';
|
$html .= '<span class="mailpoet_error_' . $block['id'] . '"></span>';
|
||||||
|
|
||||||
$html .= '</p>';
|
$html .= '</p>';
|
||||||
|
|
||||||
|
@ -16,10 +16,10 @@ class Select extends Base {
|
|||||||
$automation_id = ($block['id'] == 'status') ? 'data-automation-id="form_status"' : '';
|
$automation_id = ($block['id'] == 'status') ? 'data-automation-id="form_status"' : '';
|
||||||
$html .= '<p class="mailpoet_paragraph">';
|
$html .= '<p class="mailpoet_paragraph">';
|
||||||
$html .= static::renderLabel($block);
|
$html .= static::renderLabel($block);
|
||||||
$html .= '<select class="mailpoet_select" name="'.$field_name.'" ' . $automation_id . '>';
|
$html .= '<select class="mailpoet_select" name="' . $field_name . '" ' . $automation_id . '>';
|
||||||
|
|
||||||
if (isset($block['params']['label_within']) && $block['params']['label_within']) {
|
if (isset($block['params']['label_within']) && $block['params']['label_within']) {
|
||||||
$html .= '<option value="">'.static::getFieldLabel($block).'</option>';
|
$html .= '<option value="">' . static::getFieldLabel($block) . '</option>';
|
||||||
} else {
|
} else {
|
||||||
if (empty($block['params']['required']) || !$block['params']['required']) {
|
if (empty($block['params']['required']) || !$block['params']['required']) {
|
||||||
$html .= '<option value="">-</option>';
|
$html .= '<option value="">-</option>';
|
||||||
@ -52,7 +52,7 @@ class Select extends Base {
|
|||||||
$label = $option['value'];
|
$label = $option['value'];
|
||||||
}
|
}
|
||||||
|
|
||||||
$html .= '<option value="'.$value.'"' . $is_selected . $is_disabled . '>';
|
$html .= '<option value="' . $value . '"' . $is_selected . $is_disabled . '>';
|
||||||
$html .= WPFunctions::get()->escAttr($label);
|
$html .= WPFunctions::get()->escAttr($label);
|
||||||
$html .= '</option>';
|
$html .= '</option>';
|
||||||
}
|
}
|
||||||
|
@ -10,7 +10,7 @@ class Submit extends Base {
|
|||||||
|
|
||||||
$html .= '<p class="mailpoet_paragraph"><input type="submit" class="mailpoet_submit" ';
|
$html .= '<p class="mailpoet_paragraph"><input type="submit" class="mailpoet_submit" ';
|
||||||
|
|
||||||
$html .= 'value="'.static::getFieldLabel($block).'" ';
|
$html .= 'value="' . static::getFieldLabel($block) . '" ';
|
||||||
|
|
||||||
$html .= 'data-automation-id="subscribe-submit-button" ';
|
$html .= 'data-automation-id="subscribe-submit-button" ';
|
||||||
|
|
||||||
|
@ -13,9 +13,9 @@ class Textarea extends Base {
|
|||||||
|
|
||||||
$lines = (isset($block['params']['lines']) ? (int)$block['params']['lines'] : 1);
|
$lines = (isset($block['params']['lines']) ? (int)$block['params']['lines'] : 1);
|
||||||
|
|
||||||
$html .= '<textarea class="mailpoet_textarea" rows="'.$lines.'" ';
|
$html .= '<textarea class="mailpoet_textarea" rows="' . $lines . '" ';
|
||||||
|
|
||||||
$html .= 'name="data['.static::getFieldName($block).']"';
|
$html .= 'name="data[' . static::getFieldName($block) . ']"';
|
||||||
|
|
||||||
$html .= static::renderInputPlaceholder($block);
|
$html .= static::renderInputPlaceholder($block);
|
||||||
|
|
||||||
@ -23,7 +23,7 @@ class Textarea extends Base {
|
|||||||
|
|
||||||
$html .= static::getInputModifiers($block);
|
$html .= static::getInputModifiers($block);
|
||||||
|
|
||||||
$html .= '>'.static::getFieldValue($block).'</textarea>';
|
$html .= '>' . static::getFieldValue($block) . '</textarea>';
|
||||||
|
|
||||||
$html .= '</p>';
|
$html .= '</p>';
|
||||||
|
|
||||||
|
@ -52,13 +52,13 @@ class Renderer {
|
|||||||
foreach ($blocks as $key => $block) {
|
foreach ($blocks as $key => $block) {
|
||||||
if ($block['type'] == 'submit' && $settings->get('re_captcha.enabled')) {
|
if ($block['type'] == 'submit' && $settings->get('re_captcha.enabled')) {
|
||||||
$site_key = $settings->get('re_captcha.site_token');
|
$site_key = $settings->get('re_captcha.site_token');
|
||||||
$html .= '<div class="mailpoet_recaptcha" data-sitekey="'. $site_key .'">
|
$html .= '<div class="mailpoet_recaptcha" data-sitekey="' . $site_key . '">
|
||||||
<div class="mailpoet_recaptcha_container"></div>
|
<div class="mailpoet_recaptcha_container"></div>
|
||||||
<noscript>
|
<noscript>
|
||||||
<div>
|
<div>
|
||||||
<div style="width: 302px; height: 422px; position: relative;">
|
<div style="width: 302px; height: 422px; position: relative;">
|
||||||
<div style="width: 302px; height: 422px; position: absolute;">
|
<div style="width: 302px; height: 422px; position: absolute;">
|
||||||
<iframe src="https://www.google.com/recaptcha/api/fallback?k='. $site_key .'" frameborder="0" scrolling="no" style="width: 302px; height:422px; border-style: none;">
|
<iframe src="https://www.google.com/recaptcha/api/fallback?k=' . $site_key . '" frameborder="0" scrolling="no" style="width: 302px; height:422px; border-style: none;">
|
||||||
</iframe>
|
</iframe>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
@ -29,7 +29,7 @@ class Export {
|
|||||||
'height="100%"',
|
'height="100%"',
|
||||||
'scrolling="no"',
|
'scrolling="no"',
|
||||||
'frameborder="0"',
|
'frameborder="0"',
|
||||||
'src="'.$iframe_url.'"',
|
'src="' . $iframe_url . '"',
|
||||||
'class="mailpoet_form_iframe"',
|
'class="mailpoet_form_iframe"',
|
||||||
'id="mailpoet_form_iframe"',
|
'id="mailpoet_form_iframe"',
|
||||||
'vspace="0"',
|
'vspace="0"',
|
||||||
@ -44,8 +44,8 @@ class Export {
|
|||||||
case 'php':
|
case 'php':
|
||||||
$output = [
|
$output = [
|
||||||
'$form_widget = new \MailPoet\Form\Widget();',
|
'$form_widget = new \MailPoet\Form\Widget();',
|
||||||
'echo $form_widget->widget(array(\'form\' => '.
|
'echo $form_widget->widget(array(\'form\' => ' .
|
||||||
(int)$form['id'].
|
(int)$form['id'] .
|
||||||
', \'form_type\' => \'php\'));',
|
', \'form_type\' => \'php\'));',
|
||||||
];
|
];
|
||||||
return join("\n", $output);
|
return join("\n", $output);
|
||||||
@ -53,40 +53,40 @@ class Export {
|
|||||||
case 'html':
|
case 'html':
|
||||||
$output = [];
|
$output = [];
|
||||||
|
|
||||||
$output[] = '<!-- '.
|
$output[] = '<!-- ' .
|
||||||
WPFunctions::get()->__(
|
WPFunctions::get()->__(
|
||||||
'BEGIN Scripts: you should place them in the header of your theme',
|
'BEGIN Scripts: you should place them in the header of your theme',
|
||||||
'mailpoet'
|
'mailpoet'
|
||||||
).
|
) .
|
||||||
' -->';
|
' -->';
|
||||||
|
|
||||||
// CSS
|
// CSS
|
||||||
$output[] = '<link rel="stylesheet" type="text/css" href="'.
|
$output[] = '<link rel="stylesheet" type="text/css" href="' .
|
||||||
Env::$assets_url.'/dist/css/public.css?mp_ver='.MAILPOET_VERSION.
|
Env::$assets_url . '/dist/css/public.css?mp_ver=' . MAILPOET_VERSION .
|
||||||
'" />';
|
'" />';
|
||||||
|
|
||||||
// jQuery
|
// jQuery
|
||||||
$output[] = '<script type="text/javascript" src="'.
|
$output[] = '<script type="text/javascript" src="' .
|
||||||
WPFunctions::get()->includesUrl().'js/jquery/jquery.js?mp_ver'.MAILPOET_VERSION.
|
WPFunctions::get()->includesUrl() . 'js/jquery/jquery.js?mp_ver' . MAILPOET_VERSION .
|
||||||
'"></script>';
|
'"></script>';
|
||||||
|
|
||||||
// JS
|
// JS
|
||||||
$output[] = '<script type="text/javascript" src="'.
|
$output[] = '<script type="text/javascript" src="' .
|
||||||
Env::$assets_url.'/dist/js/vendor.js?mp_ver='.MAILPOET_VERSION.
|
Env::$assets_url . '/dist/js/vendor.js?mp_ver=' . MAILPOET_VERSION .
|
||||||
'"></script>';
|
'"></script>';
|
||||||
$output[] = '<script type="text/javascript" src="'.
|
$output[] = '<script type="text/javascript" src="' .
|
||||||
Env::$assets_url.'/dist/js/public.js?mp_ver='.MAILPOET_VERSION.
|
Env::$assets_url . '/dist/js/public.js?mp_ver=' . MAILPOET_VERSION .
|
||||||
'"></script>';
|
'"></script>';
|
||||||
|
|
||||||
// (JS) variables...
|
// (JS) variables...
|
||||||
$output[] = '<script type="text/javascript">';
|
$output[] = '<script type="text/javascript">';
|
||||||
$output[] = ' var MailPoetForm = MailPoetForm || {';
|
$output[] = ' var MailPoetForm = MailPoetForm || {';
|
||||||
$output[] = ' is_rtl: '.((int)is_rtl()).",";
|
$output[] = ' is_rtl: ' . ((int)is_rtl()) . ",";
|
||||||
$output[] = ' ajax_url: "'.admin_url('admin-ajax.php').'"';
|
$output[] = ' ajax_url: "' . admin_url('admin-ajax.php') . '"';
|
||||||
$output[] = ' };';
|
$output[] = ' };';
|
||||||
$output[] = '</script>';
|
$output[] = '</script>';
|
||||||
$output[] = '<!-- '.
|
$output[] = '<!-- ' .
|
||||||
WPFunctions::get()->__('END Scripts', 'mailpoet').
|
WPFunctions::get()->__('END Scripts', 'mailpoet') .
|
||||||
'-->';
|
'-->';
|
||||||
|
|
||||||
$form_widget = new Widget();
|
$form_widget = new Widget();
|
||||||
@ -97,7 +97,7 @@ class Export {
|
|||||||
return join("\n", $output);
|
return join("\n", $output);
|
||||||
|
|
||||||
case 'shortcode':
|
case 'shortcode':
|
||||||
return '[mailpoet_form id="'.(int)$form['id'].'"]';
|
return '[mailpoet_form id="' . (int)$form['id'] . '"]';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -11,7 +11,7 @@ class FieldNameObfuscator {
|
|||||||
|
|
||||||
public function obfuscate($name) {
|
public function obfuscate($name) {
|
||||||
$auth_key = defined('AUTH_KEY') ? AUTH_KEY : '';
|
$auth_key = defined('AUTH_KEY') ? AUTH_KEY : '';
|
||||||
$hash = substr(md5($auth_key . WPFunctions::get()->homeUrl() . $name), 0, self::HASH_LENGTH);
|
$hash = substr(md5($auth_key . WPFunctions::get()->homeUrl() . $name), 0, self::HASH_LENGTH);
|
||||||
return self::OBFUSCATED_FIELD_PREFIX . base64_encode($hash . '_' . $name);
|
return self::OBFUSCATED_FIELD_PREFIX . base64_encode($hash . '_' . $name);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ class Widget extends \WP_Widget {
|
|||||||
WPFunctions::get()->wpPrintScripts('jquery');
|
WPFunctions::get()->wpPrintScripts('jquery');
|
||||||
WPFunctions::get()->wpPrintScripts('mailpoet_vendor');
|
WPFunctions::get()->wpPrintScripts('mailpoet_vendor');
|
||||||
WPFunctions::get()->wpPrintScripts('mailpoet_public');
|
WPFunctions::get()->wpPrintScripts('mailpoet_public');
|
||||||
echo '<script src="'.self::RECAPTCHA_API_URL.'" async defer></script>';
|
echo '<script src="' . self::RECAPTCHA_API_URL . '" async defer></script>';
|
||||||
$scripts = ob_get_contents();
|
$scripts = ob_get_contents();
|
||||||
ob_end_clean();
|
ob_end_clean();
|
||||||
|
|
||||||
|
@ -42,8 +42,8 @@ class Beacon {
|
|||||||
'PHP post_max_size' => ini_get('post_max_size'),
|
'PHP post_max_size' => ini_get('post_max_size'),
|
||||||
'WordPress language' => WPFunctions::get()->getLocale(),
|
'WordPress language' => WPFunctions::get()->getLocale(),
|
||||||
'Multisite environment?' => (is_multisite() ? 'Yes' : 'No'),
|
'Multisite environment?' => (is_multisite() ? 'Yes' : 'No'),
|
||||||
'Current Theme' => $current_theme->get('Name').
|
'Current Theme' => $current_theme->get('Name') .
|
||||||
' (version '.$current_theme->get('Version').')',
|
' (version ' . $current_theme->get('Version') . ')',
|
||||||
'Active Plugin names' => join(", ", WPFunctions::get()->getOption('active_plugins')),
|
'Active Plugin names' => join(", ", WPFunctions::get()->getOption('active_plugins')),
|
||||||
'Sending Method' => $mta['method'],
|
'Sending Method' => $mta['method'],
|
||||||
'Sending Frequency' => sprintf('%d emails every %d minutes',
|
'Sending Frequency' => sprintf('%d emails every %d minutes',
|
||||||
|
@ -16,7 +16,7 @@ class BulkActionController {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function apply($model_class, array $data) {
|
function apply($model_class, array $data) {
|
||||||
$bulk_action_method = 'bulk'.ucfirst($data['action']);
|
$bulk_action_method = 'bulk' . ucfirst($data['action']);
|
||||||
unset($data['action']);
|
unset($data['action']);
|
||||||
|
|
||||||
$action_class = $this->factory->getActionClass($model_class, $bulk_action_method);
|
$action_class = $this->factory->getActionClass($model_class, $bulk_action_method);
|
||||||
|
@ -24,7 +24,7 @@ class BulkActionFactory {
|
|||||||
private function ensureMethodExists($action_class, $bulk_action_method) {
|
private function ensureMethodExists($action_class, $bulk_action_method) {
|
||||||
if (!method_exists($action_class, $bulk_action_method)) {
|
if (!method_exists($action_class, $bulk_action_method)) {
|
||||||
throw new \Exception(
|
throw new \Exception(
|
||||||
(is_object($action_class) ? get_class($action_class) : $action_class).' has no method "'.$bulk_action_method.'"'
|
(is_object($action_class) ? get_class($action_class) : $action_class) . ' has no method "' . $bulk_action_method . '"'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -17,7 +17,7 @@ class Handler {
|
|||||||
[$data]
|
[$data]
|
||||||
);
|
);
|
||||||
if (!empty($data['selection'])) {
|
if (!empty($data['selection'])) {
|
||||||
$custom_query->whereIn($table_name.'.id', $data['selection']);
|
$custom_query->whereIn($table_name . '.id', $data['selection']);
|
||||||
}
|
}
|
||||||
return $custom_query;
|
return $custom_query;
|
||||||
} else {
|
} else {
|
||||||
@ -26,7 +26,7 @@ class Handler {
|
|||||||
$this->setSearch($model, $data);
|
$this->setSearch($model, $data);
|
||||||
|
|
||||||
if (!empty($data['selection'])) {
|
if (!empty($data['selection'])) {
|
||||||
$model->whereIn($table_name.'.id', $data['selection']);
|
$model->whereIn($table_name . '.id', $data['selection']);
|
||||||
}
|
}
|
||||||
return $model;
|
return $model;
|
||||||
}
|
}
|
||||||
@ -66,8 +66,8 @@ class Handler {
|
|||||||
$items = $custom_query
|
$items = $custom_query
|
||||||
->offset($data['offset'])
|
->offset($data['offset'])
|
||||||
->limit($data['limit'])
|
->limit($data['limit'])
|
||||||
->{'order_by_'.$data['sort_order']}(
|
->{'order_by_' . $data['sort_order']}(
|
||||||
$table_name.'.'.$data['sort_by']
|
$table_name . '.' . $data['sort_by']
|
||||||
)
|
)
|
||||||
->findMany();
|
->findMany();
|
||||||
} else {
|
} else {
|
||||||
@ -101,8 +101,8 @@ class Handler {
|
|||||||
|
|
||||||
private function setOrder(\ORMWrapper $model, array $data, $table_name) {
|
private function setOrder(\ORMWrapper $model, array $data, $table_name) {
|
||||||
return $model
|
return $model
|
||||||
->{'order_by_'.$data['sort_order']}(
|
->{'order_by_' . $data['sort_order']}(
|
||||||
$table_name.'.'.$data['sort_by']);
|
$table_name . '.' . $data['sort_by']);
|
||||||
}
|
}
|
||||||
|
|
||||||
private function setGroup(\ORMWrapper $model, array $data) {
|
private function setGroup(\ORMWrapper $model, array $data) {
|
||||||
|
@ -99,7 +99,7 @@ class Form extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static function search($orm, $search = '') {
|
static function search($orm, $search = '') {
|
||||||
return $orm->whereLike('name', '%'.$search.'%');
|
return $orm->whereLike('name', '%' . $search . '%');
|
||||||
}
|
}
|
||||||
|
|
||||||
static function groups() {
|
static function groups() {
|
||||||
|
@ -66,7 +66,7 @@ class Newsletter extends Model {
|
|||||||
|
|
||||||
function children() {
|
function children() {
|
||||||
return $this->hasMany(
|
return $this->hasMany(
|
||||||
__NAMESPACE__.'\Newsletter',
|
__NAMESPACE__ . '\Newsletter',
|
||||||
'parent_id',
|
'parent_id',
|
||||||
'id'
|
'id'
|
||||||
);
|
);
|
||||||
@ -74,7 +74,7 @@ class Newsletter extends Model {
|
|||||||
|
|
||||||
function parent() {
|
function parent() {
|
||||||
return $this->hasOne(
|
return $this->hasOne(
|
||||||
__NAMESPACE__.'\Newsletter',
|
__NAMESPACE__ . '\Newsletter',
|
||||||
'id',
|
'id',
|
||||||
'parent_id'
|
'parent_id'
|
||||||
);
|
);
|
||||||
@ -82,8 +82,8 @@ class Newsletter extends Model {
|
|||||||
|
|
||||||
function segments() {
|
function segments() {
|
||||||
return $this->hasManyThrough(
|
return $this->hasManyThrough(
|
||||||
__NAMESPACE__.'\Segment',
|
__NAMESPACE__ . '\Segment',
|
||||||
__NAMESPACE__.'\NewsletterSegment',
|
__NAMESPACE__ . '\NewsletterSegment',
|
||||||
'newsletter_id',
|
'newsletter_id',
|
||||||
'segment_id'
|
'segment_id'
|
||||||
);
|
);
|
||||||
@ -91,7 +91,7 @@ class Newsletter extends Model {
|
|||||||
|
|
||||||
function segmentRelations() {
|
function segmentRelations() {
|
||||||
return $this->hasMany(
|
return $this->hasMany(
|
||||||
__NAMESPACE__.'\NewsletterSegment',
|
__NAMESPACE__ . '\NewsletterSegment',
|
||||||
'newsletter_id',
|
'newsletter_id',
|
||||||
'id'
|
'id'
|
||||||
);
|
);
|
||||||
@ -99,11 +99,11 @@ class Newsletter extends Model {
|
|||||||
|
|
||||||
function options() {
|
function options() {
|
||||||
return $this->hasManyThrough(
|
return $this->hasManyThrough(
|
||||||
__NAMESPACE__.'\NewsletterOptionField',
|
__NAMESPACE__ . '\NewsletterOptionField',
|
||||||
__NAMESPACE__.'\NewsletterOption',
|
__NAMESPACE__ . '\NewsletterOption',
|
||||||
'newsletter_id',
|
'newsletter_id',
|
||||||
'option_field_id'
|
'option_field_id'
|
||||||
)->select_expr(MP_NEWSLETTER_OPTION_TABLE.'.value');
|
)->select_expr(MP_NEWSLETTER_OPTION_TABLE . '.value');
|
||||||
}
|
}
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
@ -787,7 +787,7 @@ class Newsletter extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static function filterWithOptions($orm, $type) {
|
static function filterWithOptions($orm, $type) {
|
||||||
$orm = $orm->select(MP_NEWSLETTERS_TABLE.'.*');
|
$orm = $orm->select(MP_NEWSLETTERS_TABLE . '.*');
|
||||||
$optionFields = NewsletterOptionField::findArray();
|
$optionFields = NewsletterOptionField::findArray();
|
||||||
foreach ($optionFields as $optionField) {
|
foreach ($optionFields as $optionField) {
|
||||||
if ($optionField['newsletter_type'] !== $type) {
|
if ($optionField['newsletter_type'] !== $type) {
|
||||||
@ -796,26 +796,26 @@ class Newsletter extends Model {
|
|||||||
$orm = $orm->select_expr(
|
$orm = $orm->select_expr(
|
||||||
'IFNULL(GROUP_CONCAT(CASE WHEN ' .
|
'IFNULL(GROUP_CONCAT(CASE WHEN ' .
|
||||||
MP_NEWSLETTER_OPTION_FIELDS_TABLE . '.id=' . $optionField['id'] . ' THEN ' .
|
MP_NEWSLETTER_OPTION_FIELDS_TABLE . '.id=' . $optionField['id'] . ' THEN ' .
|
||||||
MP_NEWSLETTER_OPTION_TABLE . '.value END), NULL) as "' . $optionField['name'].'"');
|
MP_NEWSLETTER_OPTION_TABLE . '.value END), NULL) as "' . $optionField['name'] . '"');
|
||||||
}
|
}
|
||||||
$orm = $orm
|
$orm = $orm
|
||||||
->left_outer_join(
|
->left_outer_join(
|
||||||
MP_NEWSLETTER_OPTION_TABLE,
|
MP_NEWSLETTER_OPTION_TABLE,
|
||||||
[
|
[
|
||||||
MP_NEWSLETTERS_TABLE.'.id',
|
MP_NEWSLETTERS_TABLE . '.id',
|
||||||
'=',
|
'=',
|
||||||
MP_NEWSLETTER_OPTION_TABLE.'.newsletter_id',
|
MP_NEWSLETTER_OPTION_TABLE . '.newsletter_id',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
->left_outer_join(
|
->left_outer_join(
|
||||||
MP_NEWSLETTER_OPTION_FIELDS_TABLE,
|
MP_NEWSLETTER_OPTION_FIELDS_TABLE,
|
||||||
[
|
[
|
||||||
MP_NEWSLETTER_OPTION_FIELDS_TABLE.'.id',
|
MP_NEWSLETTER_OPTION_FIELDS_TABLE . '.id',
|
||||||
'=',
|
'=',
|
||||||
MP_NEWSLETTER_OPTION_TABLE.'.option_field_id',
|
MP_NEWSLETTER_OPTION_TABLE . '.option_field_id',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
->group_by(MP_NEWSLETTERS_TABLE.'.id');
|
->group_by(MP_NEWSLETTERS_TABLE . '.id');
|
||||||
return $orm;
|
return $orm;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -23,6 +23,6 @@ class NewsletterOptionField extends Model {
|
|||||||
__NAMESPACE__ . '\NewsletterOption',
|
__NAMESPACE__ . '\NewsletterOption',
|
||||||
'option_field_id',
|
'option_field_id',
|
||||||
'newsletter_id'
|
'newsletter_id'
|
||||||
)->select_expr(MP_NEWSLETTER_OPTION_TABLE.'.value');
|
)->select_expr(MP_NEWSLETTER_OPTION_TABLE . '.value');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -35,8 +35,8 @@ class ScheduledTask extends Model {
|
|||||||
|
|
||||||
function subscribers() {
|
function subscribers() {
|
||||||
return $this->hasManyThrough(
|
return $this->hasManyThrough(
|
||||||
__NAMESPACE__.'\Subscriber',
|
__NAMESPACE__ . '\Subscriber',
|
||||||
__NAMESPACE__.'\ScheduledTaskSubscriber',
|
__NAMESPACE__ . '\ScheduledTaskSubscriber',
|
||||||
'task_id',
|
'task_id',
|
||||||
'subscriber_id'
|
'subscriber_id'
|
||||||
);
|
);
|
||||||
|
@ -34,8 +34,8 @@ class Segment extends Model {
|
|||||||
|
|
||||||
function newsletters() {
|
function newsletters() {
|
||||||
return $this->has_many_through(
|
return $this->has_many_through(
|
||||||
__NAMESPACE__.'\Newsletter',
|
__NAMESPACE__ . '\Newsletter',
|
||||||
__NAMESPACE__.'\NewsletterSegment',
|
__NAMESPACE__ . '\NewsletterSegment',
|
||||||
'segment_id',
|
'segment_id',
|
||||||
'newsletter_id'
|
'newsletter_id'
|
||||||
);
|
);
|
||||||
@ -43,8 +43,8 @@ class Segment extends Model {
|
|||||||
|
|
||||||
function subscribers() {
|
function subscribers() {
|
||||||
return $this->has_many_through(
|
return $this->has_many_through(
|
||||||
__NAMESPACE__.'\Subscriber',
|
__NAMESPACE__ . '\Subscriber',
|
||||||
__NAMESPACE__.'\SubscriberSegment',
|
__NAMESPACE__ . '\SubscriberSegment',
|
||||||
'segment_id',
|
'segment_id',
|
||||||
'subscriber_id'
|
'subscriber_id'
|
||||||
);
|
);
|
||||||
@ -156,7 +156,7 @@ class Segment extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static function search($orm, $search = '') {
|
static function search($orm, $search = '') {
|
||||||
return $orm->whereLike('name', '%'.$search.'%');
|
return $orm->whereLike('name', '%' . $search . '%');
|
||||||
}
|
}
|
||||||
|
|
||||||
static function groups() {
|
static function groups() {
|
||||||
@ -184,31 +184,31 @@ class Segment extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static function getSegmentsWithSubscriberCount($type = self::TYPE_DEFAULT) {
|
static function getSegmentsWithSubscriberCount($type = self::TYPE_DEFAULT) {
|
||||||
$query = self::selectMany([self::$_table.'.id', self::$_table.'.name'])
|
$query = self::selectMany([self::$_table . '.id', self::$_table . '.name'])
|
||||||
->whereIn('type', [Segment::TYPE_DEFAULT, Segment::TYPE_WP_USERS, Segment::TYPE_WC_USERS])
|
->whereIn('type', [Segment::TYPE_DEFAULT, Segment::TYPE_WP_USERS, Segment::TYPE_WC_USERS])
|
||||||
->selectExpr(
|
->selectExpr(
|
||||||
self::$_table.'.*, ' .
|
self::$_table . '.*, ' .
|
||||||
'COUNT(IF('.
|
'COUNT(IF(' .
|
||||||
MP_SUBSCRIBER_SEGMENT_TABLE.'.status="'.Subscriber::STATUS_SUBSCRIBED.'"'
|
MP_SUBSCRIBER_SEGMENT_TABLE . '.status="' . Subscriber::STATUS_SUBSCRIBED . '"'
|
||||||
.' AND '.
|
. ' AND ' .
|
||||||
MP_SUBSCRIBERS_TABLE.'.deleted_at IS NULL'
|
MP_SUBSCRIBERS_TABLE . '.deleted_at IS NULL'
|
||||||
.' AND '.
|
. ' AND ' .
|
||||||
MP_SUBSCRIBERS_TABLE.'.status="'.Subscriber::STATUS_SUBSCRIBED.'"'
|
MP_SUBSCRIBERS_TABLE . '.status="' . Subscriber::STATUS_SUBSCRIBED . '"'
|
||||||
.', 1, NULL)) `subscribers`'
|
. ', 1, NULL)) `subscribers`'
|
||||||
)
|
)
|
||||||
->leftOuterJoin(
|
->leftOuterJoin(
|
||||||
MP_SUBSCRIBER_SEGMENT_TABLE,
|
MP_SUBSCRIBER_SEGMENT_TABLE,
|
||||||
[self::$_table.'.id', '=', MP_SUBSCRIBER_SEGMENT_TABLE.'.segment_id'])
|
[self::$_table . '.id', '=', MP_SUBSCRIBER_SEGMENT_TABLE . '.segment_id'])
|
||||||
->leftOuterJoin(
|
->leftOuterJoin(
|
||||||
MP_SUBSCRIBERS_TABLE,
|
MP_SUBSCRIBERS_TABLE,
|
||||||
[MP_SUBSCRIBER_SEGMENT_TABLE.'.subscriber_id', '=', MP_SUBSCRIBERS_TABLE.'.id'])
|
[MP_SUBSCRIBER_SEGMENT_TABLE . '.subscriber_id', '=', MP_SUBSCRIBERS_TABLE . '.id'])
|
||||||
->groupBy(self::$_table.'.id')
|
->groupBy(self::$_table . '.id')
|
||||||
->groupBy(self::$_table.'.name')
|
->groupBy(self::$_table . '.name')
|
||||||
->orderByAsc(self::$_table.'.name')
|
->orderByAsc(self::$_table . '.name')
|
||||||
->whereNull(self::$_table.'.deleted_at');
|
->whereNull(self::$_table . '.deleted_at');
|
||||||
|
|
||||||
if (!empty($type)) {
|
if (!empty($type)) {
|
||||||
$query->where(self::$_table.'.type', $type);
|
$query->where(self::$_table . '.type', $type);
|
||||||
}
|
}
|
||||||
|
|
||||||
return $query->findArray();
|
return $query->findArray();
|
||||||
@ -259,7 +259,7 @@ class Segment extends Model {
|
|||||||
Segment::rawExecute(join(' ', [
|
Segment::rawExecute(join(' ', [
|
||||||
'UPDATE `' . Segment::$_table . '`',
|
'UPDATE `' . Segment::$_table . '`',
|
||||||
'SET `deleted_at` = NOW()',
|
'SET `deleted_at` = NOW()',
|
||||||
'WHERE `id` IN ('.rtrim(str_repeat('?,', count($ids)), ',').')',
|
'WHERE `id` IN (' . rtrim(str_repeat('?,', count($ids)), ',') . ')',
|
||||||
'AND `type` = "' . Segment::TYPE_DEFAULT . '"',
|
'AND `type` = "' . Segment::TYPE_DEFAULT . '"',
|
||||||
]), $ids);
|
]), $ids);
|
||||||
});
|
});
|
||||||
|
@ -60,12 +60,12 @@ class Subscriber extends Model {
|
|||||||
|
|
||||||
function segments() {
|
function segments() {
|
||||||
return $this->has_many_through(
|
return $this->has_many_through(
|
||||||
__NAMESPACE__.'\Segment',
|
__NAMESPACE__ . '\Segment',
|
||||||
__NAMESPACE__.'\SubscriberSegment',
|
__NAMESPACE__ . '\SubscriberSegment',
|
||||||
'subscriber_id',
|
'subscriber_id',
|
||||||
'segment_id'
|
'segment_id'
|
||||||
)
|
)
|
||||||
->where(MP_SUBSCRIBER_SEGMENT_TABLE.'.status', self::STATUS_SUBSCRIBED);
|
->where(MP_SUBSCRIBER_SEGMENT_TABLE . '.status', self::STATUS_SUBSCRIBED);
|
||||||
}
|
}
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
@ -157,7 +157,7 @@ class Subscriber extends Model {
|
|||||||
|
|
||||||
return $orm->where_raw(
|
return $orm->where_raw(
|
||||||
'(`email` LIKE ? OR `first_name` LIKE ? OR `last_name` LIKE ?)',
|
'(`email` LIKE ? OR `first_name` LIKE ? OR `last_name` LIKE ?)',
|
||||||
['%'.$search.'%', '%'.$search.'%', '%'.$search.'%']
|
['%' . $search . '%', '%' . $search . '%', '%' . $search . '%']
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -281,58 +281,58 @@ class Subscriber extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static function filterWithCustomFields($orm) {
|
static function filterWithCustomFields($orm) {
|
||||||
$orm = $orm->select(MP_SUBSCRIBERS_TABLE.'.*');
|
$orm = $orm->select(MP_SUBSCRIBERS_TABLE . '.*');
|
||||||
$customFields = CustomField::findArray();
|
$customFields = CustomField::findArray();
|
||||||
foreach ($customFields as $customField) {
|
foreach ($customFields as $customField) {
|
||||||
$orm = $orm->select_expr(
|
$orm = $orm->select_expr(
|
||||||
'IFNULL(GROUP_CONCAT(CASE WHEN ' .
|
'IFNULL(GROUP_CONCAT(CASE WHEN ' .
|
||||||
MP_CUSTOM_FIELDS_TABLE . '.id=' . $customField['id'] . ' THEN ' .
|
MP_CUSTOM_FIELDS_TABLE . '.id=' . $customField['id'] . ' THEN ' .
|
||||||
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE . '.value END), NULL) as "' . $customField['name'].'"');
|
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE . '.value END), NULL) as "' . $customField['name'] . '"');
|
||||||
}
|
}
|
||||||
$orm = $orm
|
$orm = $orm
|
||||||
->leftOuterJoin(
|
->leftOuterJoin(
|
||||||
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE,
|
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE,
|
||||||
[
|
[
|
||||||
MP_SUBSCRIBERS_TABLE.'.id',
|
MP_SUBSCRIBERS_TABLE . '.id',
|
||||||
'=',
|
'=',
|
||||||
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.subscriber_id',
|
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE . '.subscriber_id',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
->leftOuterJoin(
|
->leftOuterJoin(
|
||||||
MP_CUSTOM_FIELDS_TABLE,
|
MP_CUSTOM_FIELDS_TABLE,
|
||||||
[
|
[
|
||||||
MP_CUSTOM_FIELDS_TABLE.'.id',
|
MP_CUSTOM_FIELDS_TABLE . '.id',
|
||||||
'=',
|
'=',
|
||||||
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.custom_field_id',
|
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE . '.custom_field_id',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
->groupBy(MP_SUBSCRIBERS_TABLE.'.id');
|
->groupBy(MP_SUBSCRIBERS_TABLE . '.id');
|
||||||
return $orm;
|
return $orm;
|
||||||
}
|
}
|
||||||
|
|
||||||
static function filterWithCustomFieldsForExport($orm) {
|
static function filterWithCustomFieldsForExport($orm) {
|
||||||
$orm = $orm->select(MP_SUBSCRIBERS_TABLE.'.*');
|
$orm = $orm->select(MP_SUBSCRIBERS_TABLE . '.*');
|
||||||
$customFields = CustomField::findArray();
|
$customFields = CustomField::findArray();
|
||||||
foreach ($customFields as $customField) {
|
foreach ($customFields as $customField) {
|
||||||
$orm = $orm->selectExpr(
|
$orm = $orm->selectExpr(
|
||||||
'MAX(CASE WHEN ' .
|
'MAX(CASE WHEN ' .
|
||||||
MP_CUSTOM_FIELDS_TABLE . '.id=' . $customField['id'] . ' THEN ' .
|
MP_CUSTOM_FIELDS_TABLE . '.id=' . $customField['id'] . ' THEN ' .
|
||||||
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE . '.value END) as "' . $customField['id'].'"'
|
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE . '.value END) as "' . $customField['id'] . '"'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
$orm = $orm
|
$orm = $orm
|
||||||
->leftOuterJoin(
|
->leftOuterJoin(
|
||||||
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE,
|
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE,
|
||||||
[
|
[
|
||||||
MP_SUBSCRIBERS_TABLE.'.id', '=',
|
MP_SUBSCRIBERS_TABLE . '.id', '=',
|
||||||
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.subscriber_id',
|
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE . '.subscriber_id',
|
||||||
]
|
]
|
||||||
)
|
)
|
||||||
->leftOuterJoin(
|
->leftOuterJoin(
|
||||||
MP_CUSTOM_FIELDS_TABLE,
|
MP_CUSTOM_FIELDS_TABLE,
|
||||||
[
|
[
|
||||||
MP_CUSTOM_FIELDS_TABLE.'.id','=',
|
MP_CUSTOM_FIELDS_TABLE . '.id','=',
|
||||||
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.custom_field_id',
|
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE . '.custom_field_id',
|
||||||
]
|
]
|
||||||
);
|
);
|
||||||
return $orm;
|
return $orm;
|
||||||
@ -356,11 +356,11 @@ class Subscriber extends Model {
|
|||||||
|
|
||||||
function customFields() {
|
function customFields() {
|
||||||
return $this->hasManyThrough(
|
return $this->hasManyThrough(
|
||||||
__NAMESPACE__.'\CustomField',
|
__NAMESPACE__ . '\CustomField',
|
||||||
__NAMESPACE__.'\SubscriberCustomField',
|
__NAMESPACE__ . '\SubscriberCustomField',
|
||||||
'subscriber_id',
|
'subscriber_id',
|
||||||
'custom_field_id'
|
'custom_field_id'
|
||||||
)->select_expr(MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.value');
|
)->select_expr(MP_SUBSCRIBER_CUSTOM_FIELD_TABLE . '.value');
|
||||||
}
|
}
|
||||||
|
|
||||||
static function createOrUpdate($data = []) {
|
static function createOrUpdate($data = []) {
|
||||||
@ -444,7 +444,7 @@ class Subscriber extends Model {
|
|||||||
->where('subscriber_id', $this->id())
|
->where('subscriber_id', $this->id())
|
||||||
->findMany();
|
->findMany();
|
||||||
foreach ($relations as $relation) {
|
foreach ($relations as $relation) {
|
||||||
$this->{'cf_'.$relation->custom_field_id} = $relation->value;
|
$this->{'cf_' . $relation->custom_field_id} = $relation->value;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $this;
|
return $this;
|
||||||
@ -606,9 +606,9 @@ class Subscriber extends Model {
|
|||||||
Subscriber::rawExecute(join(' ', [
|
Subscriber::rawExecute(join(' ', [
|
||||||
'UPDATE `' . Subscriber::$_table . '`',
|
'UPDATE `' . Subscriber::$_table . '`',
|
||||||
'SET `deleted_at` = NOW()',
|
'SET `deleted_at` = NOW()',
|
||||||
'WHERE `id` IN ('.
|
'WHERE `id` IN (' .
|
||||||
rtrim(str_repeat('?,', count($subscriber_ids)), ',')
|
rtrim(str_repeat('?,', count($subscriber_ids)), ',')
|
||||||
.')',
|
. ')',
|
||||||
'AND `wp_user_id` IS NULL',
|
'AND `wp_user_id` IS NULL',
|
||||||
'AND `is_woocommerce_user` = 0',
|
'AND `is_woocommerce_user` = 0',
|
||||||
]),
|
]),
|
||||||
@ -666,13 +666,13 @@ class Subscriber extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
static function withoutSegments($orm) {
|
static function withoutSegments($orm) {
|
||||||
return $orm->select(MP_SUBSCRIBERS_TABLE.'.*')
|
return $orm->select(MP_SUBSCRIBERS_TABLE . '.*')
|
||||||
->whereRaw(
|
->whereRaw(
|
||||||
MP_SUBSCRIBERS_TABLE . '.id NOT IN (
|
MP_SUBSCRIBERS_TABLE . '.id NOT IN (
|
||||||
SELECT `subscriber_id`
|
SELECT `subscriber_id`
|
||||||
FROM '.MP_SUBSCRIBER_SEGMENT_TABLE.'
|
FROM ' . MP_SUBSCRIBER_SEGMENT_TABLE . '
|
||||||
WHERE `status` = "'.self::STATUS_SUBSCRIBED.'" AND `segment_id` IN (
|
WHERE `status` = "' . self::STATUS_SUBSCRIBED . '" AND `segment_id` IN (
|
||||||
SELECT `id` FROM '.MP_SEGMENTS_TABLE.' WHERE `deleted_at` IS NULL
|
SELECT `id` FROM ' . MP_SEGMENTS_TABLE . ' WHERE `deleted_at` IS NULL
|
||||||
)
|
)
|
||||||
)'
|
)'
|
||||||
);
|
);
|
||||||
|
@ -15,7 +15,7 @@ class SubscriberSegment extends Model {
|
|||||||
public static $_table = MP_SUBSCRIBER_SEGMENT_TABLE;
|
public static $_table = MP_SUBSCRIBER_SEGMENT_TABLE;
|
||||||
|
|
||||||
function subscriber() {
|
function subscriber() {
|
||||||
return $this->has_one(__NAMESPACE__.'\Subscriber', 'id', 'subscriber_id');
|
return $this->has_one(__NAMESPACE__ . '\Subscriber', 'id', 'subscriber_id');
|
||||||
}
|
}
|
||||||
|
|
||||||
static function unsubscribeFromSegments($subscriber, $segment_ids = []) {
|
static function unsubscribeFromSegments($subscriber, $segment_ids = []) {
|
||||||
@ -112,9 +112,9 @@ class SubscriberSegment extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$query = [
|
$query = [
|
||||||
'INSERT IGNORE INTO `'.self::$_table.'`',
|
'INSERT IGNORE INTO `' . self::$_table . '`',
|
||||||
'(`subscriber_id`, `segment_id`, `created_at`)',
|
'(`subscriber_id`, `segment_id`, `created_at`)',
|
||||||
'VALUES '.rtrim(str_repeat('(?, ?, NOW()),', $row_count), ','),
|
'VALUES ' . rtrim(str_repeat('(?, ?, NOW()),', $row_count), ','),
|
||||||
];
|
];
|
||||||
self::rawExecute(join(' ', $query), $values);
|
self::rawExecute(join(' ', $query), $values);
|
||||||
|
|
||||||
|
@ -61,7 +61,7 @@ class PostContentManager {
|
|||||||
|
|
||||||
$content = strip_tags($content, implode('', $tags_not_being_stripped));
|
$content = strip_tags($content, implode('', $tags_not_being_stripped));
|
||||||
if ($with_post_class) {
|
if ($with_post_class) {
|
||||||
$content = str_replace('<p', '<p class="' . self::WP_POST_CLASS .'"', WPFunctions::get()->wpautop($content));
|
$content = str_replace('<p', '<p class="' . self::WP_POST_CLASS . '"', WPFunctions::get()->wpautop($content));
|
||||||
} else {
|
} else {
|
||||||
$content = WPFunctions::get()->wpautop($content);
|
$content = WPFunctions::get()->wpautop($content);
|
||||||
}
|
}
|
||||||
@ -107,7 +107,7 @@ class PostContentManager {
|
|||||||
// remove embedded video and replace with links
|
// remove embedded video and replace with links
|
||||||
$content = preg_replace(
|
$content = preg_replace(
|
||||||
'#<iframe.*?src=\"(.+?)\".*><\/iframe>#',
|
'#<iframe.*?src=\"(.+?)\".*><\/iframe>#',
|
||||||
'<a href="$1">'.__('Click here to view media.', 'mailpoet').'</a>',
|
'<a href="$1">' . __('Click here to view media.', 'mailpoet') . '</a>',
|
||||||
$content
|
$content
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -30,7 +30,7 @@ class Footer {
|
|||||||
'bgcolor="' . $background_color . '"' :
|
'bgcolor="' . $background_color . '"' :
|
||||||
false;
|
false;
|
||||||
if (!$background_color) unset($element['styles']['block']['backgroundColor']);
|
if (!$background_color) unset($element['styles']['block']['backgroundColor']);
|
||||||
$style = 'line-height: ' . $line_height . ';' . StylesHelper::getBlockStyles($element) . StylesHelper::getStyles($element['styles'], 'text');
|
$style = 'line-height: ' . $line_height . ';' . StylesHelper::getBlockStyles($element) . StylesHelper::getStyles($element['styles'], 'text');
|
||||||
$style = EHelper::escapeHtmlStyleAttr($style);
|
$style = EHelper::escapeHtmlStyleAttr($style);
|
||||||
$template = '
|
$template = '
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -30,7 +30,7 @@ class Header {
|
|||||||
'bgcolor="' . $background_color . '"' :
|
'bgcolor="' . $background_color . '"' :
|
||||||
false;
|
false;
|
||||||
if (!$background_color) unset($element['styles']['block']['backgroundColor']);
|
if (!$background_color) unset($element['styles']['block']['backgroundColor']);
|
||||||
$style = 'line-height: ' . $line_height . ';' . StylesHelper::getBlockStyles($element) . StylesHelper::getStyles($element['styles'], 'text');
|
$style = 'line-height: ' . $line_height . ';' . StylesHelper::getBlockStyles($element) . StylesHelper::getStyles($element['styles'], 'text');
|
||||||
$style = EHelper::escapeHtmlStyleAttr($style);
|
$style = EHelper::escapeHtmlStyleAttr($style);
|
||||||
$template = '
|
$template = '
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -28,7 +28,7 @@ class Social {
|
|||||||
if (!empty($icons_block)) {
|
if (!empty($icons_block)) {
|
||||||
$template = '
|
$template = '
|
||||||
<tr>
|
<tr>
|
||||||
<td class="mailpoet_padded_side mailpoet_padded_vertical" valign="top" align="'. EHelper::escapeHtmlAttr($alignment) . '">
|
<td class="mailpoet_padded_side mailpoet_padded_vertical" valign="top" align="' . EHelper::escapeHtmlAttr($alignment) . '">
|
||||||
' . $icons_block . '
|
' . $icons_block . '
|
||||||
</td>
|
</td>
|
||||||
</tr>';
|
</tr>';
|
||||||
|
@ -27,7 +27,7 @@ class Renderer {
|
|||||||
$background_css = $this->getBackgroundCss($styles, $image);
|
$background_css = $this->getBackgroundCss($styles, $image);
|
||||||
$template['content_start'] = '
|
$template['content_start'] = '
|
||||||
<tr>
|
<tr>
|
||||||
<td class="mailpoet_content" align="center" style="border-collapse:collapse;' . $background_css . '" ' . $this->getBgColorAttribute($styles, $image) .'>
|
<td class="mailpoet_content" align="center" style="border-collapse:collapse;' . $background_css . '" ' . $this->getBgColorAttribute($styles, $image) . '>
|
||||||
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-spacing:0;mso-table-lspace:0;mso-table-rspace:0">
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-spacing:0;mso-table-lspace:0;mso-table-rspace:0">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
@ -67,7 +67,7 @@ class Renderer {
|
|||||||
private function getMultipleColumnsContainerStart($class, $styles, $image) {
|
private function getMultipleColumnsContainerStart($class, $styles, $image) {
|
||||||
return '
|
return '
|
||||||
<tr>
|
<tr>
|
||||||
<td class="mailpoet_content-' . $class . '" align="left" style="border-collapse:collapse;' . $this->getBackgroundCss($styles, $image) . '" ' . $this->getBgColorAttribute($styles, $image) .'>
|
<td class="mailpoet_content-' . $class . '" align="left" style="border-collapse:collapse;' . $this->getBackgroundCss($styles, $image) . '" ' . $this->getBgColorAttribute($styles, $image) . '>
|
||||||
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-spacing:0;mso-table-lspace:0;mso-table-rspace:0">
|
<table width="100%" border="0" cellpadding="0" cellspacing="0" style="border-spacing:0;mso-table-lspace:0;mso-table-rspace:0">
|
||||||
<tbody>
|
<tbody>
|
||||||
<tr>
|
<tr>
|
||||||
|
@ -61,7 +61,7 @@ class ConfirmationEmailMailer {
|
|||||||
// replace list of segments shortcode
|
// replace list of segments shortcode
|
||||||
$body = str_replace(
|
$body = str_replace(
|
||||||
'[lists_to_confirm]',
|
'[lists_to_confirm]',
|
||||||
'<strong>'.join(', ', $segment_names).'</strong>',
|
'<strong>' . join(', ', $segment_names) . '</strong>',
|
||||||
$body
|
$body
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -50,7 +50,7 @@ class DynamicSubscribersGetter extends SubscribersGetter {
|
|||||||
->selectMany([
|
->selectMany([
|
||||||
'list_status' => Subscriber::$_table . '.status',
|
'list_status' => Subscriber::$_table . '.status',
|
||||||
])
|
])
|
||||||
->selectExpr("'". $name . "' AS segment_name")
|
->selectExpr("'" . $name . "' AS segment_name")
|
||||||
->offset($this->offset)
|
->offset($this->offset)
|
||||||
->limit($this->batch_size)
|
->limit($this->batch_size)
|
||||||
->findArray();
|
->findArray();
|
||||||
|
@ -47,7 +47,7 @@ class Comment {
|
|||||||
id="mailpoet_subscribe_on_comment"
|
id="mailpoet_subscribe_on_comment"
|
||||||
value="1"
|
value="1"
|
||||||
name="mailpoet[subscribe_on_comment]"
|
name="mailpoet[subscribe_on_comment]"
|
||||||
/> '.esc_attr($label).'
|
/> ' . esc_attr($label) . '
|
||||||
</label>
|
</label>
|
||||||
</p>';
|
</p>';
|
||||||
}
|
}
|
||||||
|
@ -259,7 +259,7 @@ class Pages {
|
|||||||
}
|
}
|
||||||
|
|
||||||
$custom_fields = array_map(function($custom_field) use($subscriber) {
|
$custom_fields = array_map(function($custom_field) use($subscriber) {
|
||||||
$custom_field->id = 'cf_'.$custom_field->id;
|
$custom_field->id = 'cf_' . $custom_field->id;
|
||||||
$custom_field = $custom_field->asArray();
|
$custom_field = $custom_field->asArray();
|
||||||
$custom_field['params']['value'] = $subscriber->{$custom_field['id']};
|
$custom_field['params']['value'] = $subscriber->{$custom_field['id']};
|
||||||
|
|
||||||
@ -392,23 +392,23 @@ class Pages {
|
|||||||
]
|
]
|
||||||
);
|
);
|
||||||
|
|
||||||
$form_html = '<form method="POST" '.
|
$form_html = '<form method="POST" ' .
|
||||||
'action="'.admin_url('admin-post.php').'" '.
|
'action="' . admin_url('admin-post.php') . '" ' .
|
||||||
'novalidate>';
|
'novalidate>';
|
||||||
$form_html .= '<input type="hidden" name="action"'.
|
$form_html .= '<input type="hidden" name="action"' .
|
||||||
' value="mailpoet_subscription_update" />';
|
' value="mailpoet_subscription_update" />';
|
||||||
$form_html .= '<input type="hidden" name="data[segments]" value="" />';
|
$form_html .= '<input type="hidden" name="data[segments]" value="" />';
|
||||||
$form_html .= '<input type="hidden" name="mailpoet_redirect" '.
|
$form_html .= '<input type="hidden" name="mailpoet_redirect" ' .
|
||||||
'value="' . htmlspecialchars($this->url_helper->getCurrentUrl(), ENT_QUOTES) . '" />';
|
'value="' . htmlspecialchars($this->url_helper->getCurrentUrl(), ENT_QUOTES) . '" />';
|
||||||
$form_html .= '<input type="hidden" name="data[email]" value="'.
|
$form_html .= '<input type="hidden" name="data[email]" value="' .
|
||||||
$subscriber->email.
|
$subscriber->email .
|
||||||
'" />';
|
'" />';
|
||||||
$form_html .= '<input type="hidden" name="token" value="'.
|
$form_html .= '<input type="hidden" name="token" value="' .
|
||||||
Subscriber::generateToken($subscriber->email).
|
Subscriber::generateToken($subscriber->email) .
|
||||||
'" />';
|
'" />';
|
||||||
|
|
||||||
$form_html .= '<p class="mailpoet_paragraph">';
|
$form_html .= '<p class="mailpoet_paragraph">';
|
||||||
$form_html .= '<label>'.__('Email', 'mailpoet').' *<br /><strong>' . htmlspecialchars($subscriber->email) . '</strong></label>';
|
$form_html .= '<label>' . __('Email', 'mailpoet') . ' *<br /><strong>' . htmlspecialchars($subscriber->email) . '</strong></label>';
|
||||||
$form_html .= '<br /><span style="font-size:85%;">';
|
$form_html .= '<br /><span style="font-size:85%;">';
|
||||||
// special case for WP users as they cannot edit their subscriber's email
|
// special case for WP users as they cannot edit their subscriber's email
|
||||||
if ($subscriber->isWPUser() || $subscriber->isWooCommerceUser()) {
|
if ($subscriber->isWPUser() || $subscriber->isWooCommerceUser()) {
|
||||||
@ -442,7 +442,7 @@ class Pages {
|
|||||||
private function getUnsubscribeContent() {
|
private function getUnsubscribeContent() {
|
||||||
$content = '';
|
$content = '';
|
||||||
if ($this->isPreview() || $this->subscriber !== false) {
|
if ($this->isPreview() || $this->subscriber !== false) {
|
||||||
$content .= '<p>'.__('Accidentally unsubscribed?', 'mailpoet').' <strong>';
|
$content .= '<p>' . __('Accidentally unsubscribed?', 'mailpoet') . ' <strong>';
|
||||||
$content .= '[mailpoet_manage]';
|
$content .= '[mailpoet_manage]';
|
||||||
$content .= '</strong></p>';
|
$content .= '</strong></p>';
|
||||||
}
|
}
|
||||||
@ -459,8 +459,8 @@ class Pages {
|
|||||||
: WPFunctions::get()->__('Manage your subscription', 'mailpoet')
|
: WPFunctions::get()->__('Manage your subscription', 'mailpoet')
|
||||||
);
|
);
|
||||||
|
|
||||||
return '<a href="'.Url::getManageUrl(
|
return '<a href="' . Url::getManageUrl(
|
||||||
$this->subscriber ?: null
|
$this->subscriber ?: null
|
||||||
).'">'.$text.'</a>';
|
) . '">' . $text . '</a>';
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -33,7 +33,7 @@ class Registration {
|
|||||||
id="mailpoet_subscribe_on_register"
|
id="mailpoet_subscribe_on_register"
|
||||||
value="1"
|
value="1"
|
||||||
name="mailpoet[subscribe_on_register]"
|
name="mailpoet[subscribe_on_register]"
|
||||||
/> '.esc_attr($label).'
|
/> ' . esc_attr($label) . '
|
||||||
</label>
|
</label>
|
||||||
</p>';
|
</p>';
|
||||||
}
|
}
|
||||||
|
@ -43,17 +43,17 @@ class Url {
|
|||||||
|
|
||||||
$params = [
|
$params = [
|
||||||
Router::NAME,
|
Router::NAME,
|
||||||
'endpoint='.SubscriptionEndpoint::ENDPOINT,
|
'endpoint=' . SubscriptionEndpoint::ENDPOINT,
|
||||||
'action='.$action,
|
'action=' . $action,
|
||||||
'data='.Router::encodeRequestData($data),
|
'data=' . Router::encodeRequestData($data),
|
||||||
];
|
];
|
||||||
|
|
||||||
// add parameters
|
// add parameters
|
||||||
$url .= (parse_url($url, PHP_URL_QUERY) ? '&' : '?').join('&', $params);
|
$url .= (parse_url($url, PHP_URL_QUERY) ? '&' : '?') . join('&', $params);
|
||||||
|
|
||||||
$url_params = parse_url($url);
|
$url_params = parse_url($url);
|
||||||
if (empty($url_params['scheme'])) {
|
if (empty($url_params['scheme'])) {
|
||||||
$url = WPFunctions::get()->getBloginfo('url').$url;
|
$url = WPFunctions::get()->getBloginfo('url') . $url;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $url;
|
return $url;
|
||||||
|
@ -49,7 +49,7 @@ class I18n extends AbstractExtension {
|
|||||||
$output[] = '<script type="text/javascript">';
|
$output[] = '<script type="text/javascript">';
|
||||||
foreach ($translations as $key => $translation) {
|
foreach ($translations as $key => $translation) {
|
||||||
$output[] =
|
$output[] =
|
||||||
'MailPoet.I18n.add("'.$key.'", "'. str_replace('"', '\"', $translation) . '");';
|
'MailPoet.I18n.add("' . $key . '", "' . str_replace('"', '\"', $translation) . '");';
|
||||||
}
|
}
|
||||||
$output[] = '</script>';
|
$output[] = '</script>';
|
||||||
return join("\n", $output);
|
return join("\n", $output);
|
||||||
|
@ -34,7 +34,7 @@ class Engine
|
|||||||
}
|
}
|
||||||
|
|
||||||
public function executeOne($check, $val, $params=[]) {
|
public function executeOne($check, $val, $params=[]) {
|
||||||
$callback = __NAMESPACE__ .'\Engine::'.$check;
|
$callback = __NAMESPACE__ . '\Engine::' . $check;
|
||||||
if (is_callable($callback)) {
|
if (is_callable($callback)) {
|
||||||
return call_user_func($callback, $val, $params);
|
return call_user_func($callback, $val, $params);
|
||||||
}
|
}
|
||||||
|
@ -70,10 +70,10 @@ class XLSXWriter
|
|||||||
|
|
||||||
@unlink($filename);//if the zip already exists, overwrite it
|
@unlink($filename);//if the zip already exists, overwrite it
|
||||||
$zip = new \ZipArchive();
|
$zip = new \ZipArchive();
|
||||||
if (empty($this->sheets)) { self::log("Error in ".__CLASS__."::".__FUNCTION__.", no worksheets defined.");
|
if (empty($this->sheets)) { self::log("Error in " . __CLASS__ . "::" . __FUNCTION__ . ", no worksheets defined.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (!$zip->open($filename, \ZipArchive::CREATE)) { self::log("Error in ".__CLASS__."::".__FUNCTION__.", unable to create zip.");
|
if (!$zip->open($filename, \ZipArchive::CREATE)) { self::log("Error in " . __CLASS__ . "::" . __FUNCTION__ . ", unable to create zip.");
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -86,7 +86,7 @@ class XLSXWriter
|
|||||||
|
|
||||||
$zip->addEmptyDir("xl/worksheets/");
|
$zip->addEmptyDir("xl/worksheets/");
|
||||||
foreach ($this->sheets as $sheet) {
|
foreach ($this->sheets as $sheet) {
|
||||||
$zip->addFile($sheet->filename, "xl/worksheets/".$sheet->xmlname );
|
$zip->addFile($sheet->filename, "xl/worksheets/" . $sheet->xmlname );
|
||||||
}
|
}
|
||||||
if (!empty($this->shared_strings)) {
|
if (!empty($this->shared_strings)) {
|
||||||
$zip->addFile($this->writeSharedStringsXML(), "xl/sharedStrings.xml" ); //$zip->addFromString("xl/sharedStrings.xml", self::buildSharedStringsXML() );
|
$zip->addFile($this->writeSharedStringsXML(), "xl/sharedStrings.xml" ); //$zip->addFromString("xl/sharedStrings.xml", self::buildSharedStringsXML() );
|
||||||
@ -106,7 +106,7 @@ class XLSXWriter
|
|||||||
return;
|
return;
|
||||||
|
|
||||||
$sheet_filename = $this->tempFilename();
|
$sheet_filename = $this->tempFilename();
|
||||||
$sheet_xmlname = 'sheet' . (count($this->sheets) + 1).".xml";
|
$sheet_xmlname = 'sheet' . (count($this->sheets) + 1) . ".xml";
|
||||||
$this->sheets[$sheet_name] = (object)[
|
$this->sheets[$sheet_name] = (object)[
|
||||||
'filename' => $sheet_filename,
|
'filename' => $sheet_filename,
|
||||||
'sheetname' => $sheet_name,
|
'sheetname' => $sheet_name,
|
||||||
@ -223,26 +223,26 @@ class XLSXWriter
|
|||||||
$s = isset($styles[$cell_format]) ? $styles[$cell_format] : '0';
|
$s = isset($styles[$cell_format]) ? $styles[$cell_format] : '0';
|
||||||
|
|
||||||
if (!is_scalar($value) || $value == '') { //objects, array, empty
|
if (!is_scalar($value) || $value == '') { //objects, array, empty
|
||||||
$file->write('<c r="'.$cell.'" s="'.$s.'"/>');
|
$file->write('<c r="' . $cell . '" s="' . $s . '"/>');
|
||||||
} elseif ($cell_format == 'date') {
|
} elseif ($cell_format == 'date') {
|
||||||
$file->write('<c r="'.$cell.'" s="'.$s.'" t="n"><v>'.intval(self::convert_date_time($value)).'</v></c>');
|
$file->write('<c r="' . $cell . '" s="' . $s . '" t="n"><v>' . intval(self::convert_date_time($value)) . '</v></c>');
|
||||||
} elseif ($cell_format == 'datetime') {
|
} elseif ($cell_format == 'datetime') {
|
||||||
$file->write('<c r="'.$cell.'" s="'.$s.'" t="n"><v>'.self::convert_date_time($value).'</v></c>');
|
$file->write('<c r="' . $cell . '" s="' . $s . '" t="n"><v>' . self::convert_date_time($value) . '</v></c>');
|
||||||
} elseif (!is_string($value)) {
|
} elseif (!is_string($value)) {
|
||||||
$file->write('<c r="'.$cell.'" s="'.$s.'" t="n"><v>'.($value * 1).'</v></c>');//int,float, etc
|
$file->write('<c r="' . $cell . '" s="' . $s . '" t="n"><v>' . ($value * 1) . '</v></c>');//int,float, etc
|
||||||
} elseif ($value{0} != '0' && filter_var($value, FILTER_VALIDATE_INT)){ //excel wants to trim leading zeros
|
} elseif ($value{0} != '0' && filter_var($value, FILTER_VALIDATE_INT)){ //excel wants to trim leading zeros
|
||||||
$file->write('<c r="'.$cell.'" s="'.$s.'" t="n"><v>'.($value).'</v></c>');//numeric string
|
$file->write('<c r="' . $cell . '" s="' . $s . '" t="n"><v>' . ($value) . '</v></c>');//numeric string
|
||||||
} elseif ($value{0} == '='){
|
} elseif ($value{0} == '='){
|
||||||
$file->write('<c r="'.$cell.'" s="'.$s.'" t="s"><f>'.self::xmlspecialchars($value).'</f></c>');
|
$file->write('<c r="' . $cell . '" s="' . $s . '" t="s"><f>' . self::xmlspecialchars($value) . '</f></c>');
|
||||||
} elseif ($value !== ''){
|
} elseif ($value !== ''){
|
||||||
$file->write('<c r="'.$cell.'" s="'.$s.'" t="s"><v>'.self::xmlspecialchars($this->setSharedString($value)).'</v></c>');
|
$file->write('<c r="' . $cell . '" s="' . $s . '" t="s"><v>' . self::xmlspecialchars($this->setSharedString($value)) . '</v></c>');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function writeStylesXML() {
|
protected function writeStylesXML() {
|
||||||
$temporary_filename = $this->tempFilename();
|
$temporary_filename = $this->tempFilename();
|
||||||
$file = new XLSXWriter_BuffererWriter($temporary_filename);
|
$file = new XLSXWriter_BuffererWriter($temporary_filename);
|
||||||
$file->write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'."\n");
|
$file->write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' . "\n");
|
||||||
$file->write('<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">');
|
$file->write('<styleSheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">');
|
||||||
$file->write('<numFmts count="4">');
|
$file->write('<numFmts count="4">');
|
||||||
$file->write( '<numFmt formatCode="GENERAL" numFmtId="164"/>');
|
$file->write( '<numFmt formatCode="GENERAL" numFmtId="164"/>');
|
||||||
@ -319,11 +319,11 @@ class XLSXWriter
|
|||||||
protected function writeSharedStringsXML() {
|
protected function writeSharedStringsXML() {
|
||||||
$temporary_filename = $this->tempFilename();
|
$temporary_filename = $this->tempFilename();
|
||||||
$file = new XLSXWriter_BuffererWriter($temporary_filename, $fd_flags = 'w', $check_utf8 = true);
|
$file = new XLSXWriter_BuffererWriter($temporary_filename, $fd_flags = 'w', $check_utf8 = true);
|
||||||
$file->write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'."\n");
|
$file->write('<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' . "\n");
|
||||||
$file->write('<sst count="'.($this->shared_string_count).'" uniqueCount="'.count($this->shared_strings).'" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">');
|
$file->write('<sst count="' . ($this->shared_string_count) . '" uniqueCount="' . count($this->shared_strings) . '" xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main">');
|
||||||
foreach ($this->shared_strings as $s => $c)
|
foreach ($this->shared_strings as $s => $c)
|
||||||
{
|
{
|
||||||
$file->write('<si><t>'.self::xmlspecialchars($s).'</t></si>');
|
$file->write('<si><t>' . self::xmlspecialchars($s) . '</t></si>');
|
||||||
}
|
}
|
||||||
$file->write('</sst>');
|
$file->write('</sst>');
|
||||||
$file->close();
|
$file->close();
|
||||||
@ -333,17 +333,17 @@ class XLSXWriter
|
|||||||
|
|
||||||
protected function buildAppXML() {
|
protected function buildAppXML() {
|
||||||
$app_xml = "";
|
$app_xml = "";
|
||||||
$app_xml .= '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'."\n";
|
$app_xml .= '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' . "\n";
|
||||||
$app_xml .= '<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><TotalTime>0</TotalTime></Properties>';
|
$app_xml .= '<Properties xmlns="http://schemas.openxmlformats.org/officeDocument/2006/extended-properties" xmlns:vt="http://schemas.openxmlformats.org/officeDocument/2006/docPropsVTypes"><TotalTime>0</TotalTime></Properties>';
|
||||||
return $app_xml;
|
return $app_xml;
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function buildCoreXML() {
|
protected function buildCoreXML() {
|
||||||
$core_xml = "";
|
$core_xml = "";
|
||||||
$core_xml .= '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'."\n";
|
$core_xml .= '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' . "\n";
|
||||||
$core_xml .= '<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">';
|
$core_xml .= '<cp:coreProperties xmlns:cp="http://schemas.openxmlformats.org/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:dcmitype="http://purl.org/dc/dcmitype/" xmlns:dcterms="http://purl.org/dc/terms/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">';
|
||||||
$core_xml .= '<dcterms:created xsi:type="dcterms:W3CDTF">'.date("Y-m-d\TH:i:s.00\Z").'</dcterms:created>';//$date_time = '2014-10-25T15:54:37.00Z';
|
$core_xml .= '<dcterms:created xsi:type="dcterms:W3CDTF">' . date("Y-m-d\TH:i:s.00\Z") . '</dcterms:created>';//$date_time = '2014-10-25T15:54:37.00Z';
|
||||||
$core_xml .= '<dc:creator>'.self::xmlspecialchars($this->author).'</dc:creator>';
|
$core_xml .= '<dc:creator>' . self::xmlspecialchars($this->author) . '</dc:creator>';
|
||||||
$core_xml .= '<cp:revision>0</cp:revision>';
|
$core_xml .= '<cp:revision>0</cp:revision>';
|
||||||
$core_xml .= '</cp:coreProperties>';
|
$core_xml .= '</cp:coreProperties>';
|
||||||
return $core_xml;
|
return $core_xml;
|
||||||
@ -351,7 +351,7 @@ class XLSXWriter
|
|||||||
|
|
||||||
protected function buildRelationshipsXML() {
|
protected function buildRelationshipsXML() {
|
||||||
$rels_xml = "";
|
$rels_xml = "";
|
||||||
$rels_xml .= '<?xml version="1.0" encoding="UTF-8"?>'."\n";
|
$rels_xml .= '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
|
||||||
$rels_xml .= '<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">';
|
$rels_xml .= '<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">';
|
||||||
$rels_xml .= '<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>';
|
$rels_xml .= '<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument" Target="xl/workbook.xml"/>';
|
||||||
$rels_xml .= '<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>';
|
$rels_xml .= '<Relationship Id="rId2" Type="http://schemas.openxmlformats.org/package/2006/relationships/metadata/core-properties" Target="docProps/core.xml"/>';
|
||||||
@ -364,13 +364,13 @@ class XLSXWriter
|
|||||||
protected function buildWorkbookXML() {
|
protected function buildWorkbookXML() {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$workbook_xml = "";
|
$workbook_xml = "";
|
||||||
$workbook_xml .= '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>'."\n";
|
$workbook_xml .= '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>' . "\n";
|
||||||
$workbook_xml .= '<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">';
|
$workbook_xml .= '<workbook xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main" xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">';
|
||||||
$workbook_xml .= '<fileVersion appName="Calc"/><workbookPr backupFile="false" showObjects="all" date1904="false"/><workbookProtection/>';
|
$workbook_xml .= '<fileVersion appName="Calc"/><workbookPr backupFile="false" showObjects="all" date1904="false"/><workbookProtection/>';
|
||||||
$workbook_xml .= '<bookViews><workbookView activeTab="0" firstSheet="0" showHorizontalScroll="true" showSheetTabs="true" showVerticalScroll="true" tabRatio="212" windowHeight="8192" windowWidth="16384" xWindow="0" yWindow="0"/></bookViews>';
|
$workbook_xml .= '<bookViews><workbookView activeTab="0" firstSheet="0" showHorizontalScroll="true" showSheetTabs="true" showVerticalScroll="true" tabRatio="212" windowHeight="8192" windowWidth="16384" xWindow="0" yWindow="0"/></bookViews>';
|
||||||
$workbook_xml .= '<sheets>';
|
$workbook_xml .= '<sheets>';
|
||||||
foreach ($this->sheets as $sheet_name => $sheet) {
|
foreach ($this->sheets as $sheet_name => $sheet) {
|
||||||
$workbook_xml .= '<sheet name="'.self::xmlspecialchars($sheet->sheetname).'" sheetId="'.($i + 1).'" state="visible" r:id="rId'.($i + 2).'"/>';
|
$workbook_xml .= '<sheet name="' . self::xmlspecialchars($sheet->sheetname) . '" sheetId="' . ($i + 1) . '" state="visible" r:id="rId' . ($i + 2) . '"/>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
$workbook_xml .= '</sheets>';
|
$workbook_xml .= '</sheets>';
|
||||||
@ -381,15 +381,15 @@ class XLSXWriter
|
|||||||
protected function buildWorkbookRelsXML() {
|
protected function buildWorkbookRelsXML() {
|
||||||
$i = 0;
|
$i = 0;
|
||||||
$wkbkrels_xml = "";
|
$wkbkrels_xml = "";
|
||||||
$wkbkrels_xml .= '<?xml version="1.0" encoding="UTF-8"?>'."\n";
|
$wkbkrels_xml .= '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
|
||||||
$wkbkrels_xml .= '<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">';
|
$wkbkrels_xml .= '<Relationships xmlns="http://schemas.openxmlformats.org/package/2006/relationships">';
|
||||||
$wkbkrels_xml .= '<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>';
|
$wkbkrels_xml .= '<Relationship Id="rId1" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/styles" Target="styles.xml"/>';
|
||||||
foreach ($this->sheets as $sheet_name => $sheet) {
|
foreach ($this->sheets as $sheet_name => $sheet) {
|
||||||
$wkbkrels_xml .= '<Relationship Id="rId'.($i + 2).'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/'.($sheet->xmlname).'"/>';
|
$wkbkrels_xml .= '<Relationship Id="rId' . ($i + 2) . '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/worksheet" Target="worksheets/' . ($sheet->xmlname) . '"/>';
|
||||||
$i++;
|
$i++;
|
||||||
}
|
}
|
||||||
if (!empty($this->shared_strings)) {
|
if (!empty($this->shared_strings)) {
|
||||||
$wkbkrels_xml .= '<Relationship Id="rId'.(count($this->sheets) + 2).'" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/>';
|
$wkbkrels_xml .= '<Relationship Id="rId' . (count($this->sheets) + 2) . '" Type="http://schemas.openxmlformats.org/officeDocument/2006/relationships/sharedStrings" Target="sharedStrings.xml"/>';
|
||||||
}
|
}
|
||||||
$wkbkrels_xml .= "\n";
|
$wkbkrels_xml .= "\n";
|
||||||
$wkbkrels_xml .= '</Relationships>';
|
$wkbkrels_xml .= '</Relationships>';
|
||||||
@ -398,12 +398,12 @@ class XLSXWriter
|
|||||||
|
|
||||||
protected function buildContentTypesXML() {
|
protected function buildContentTypesXML() {
|
||||||
$content_types_xml = "";
|
$content_types_xml = "";
|
||||||
$content_types_xml .= '<?xml version="1.0" encoding="UTF-8"?>'."\n";
|
$content_types_xml .= '<?xml version="1.0" encoding="UTF-8"?>' . "\n";
|
||||||
$content_types_xml .= '<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">';
|
$content_types_xml .= '<Types xmlns="http://schemas.openxmlformats.org/package/2006/content-types">';
|
||||||
$content_types_xml .= '<Override PartName="/_rels/.rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>';
|
$content_types_xml .= '<Override PartName="/_rels/.rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>';
|
||||||
$content_types_xml .= '<Override PartName="/xl/_rels/workbook.xml.rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>';
|
$content_types_xml .= '<Override PartName="/xl/_rels/workbook.xml.rels" ContentType="application/vnd.openxmlformats-package.relationships+xml"/>';
|
||||||
foreach ($this->sheets as $sheet_name => $sheet) {
|
foreach ($this->sheets as $sheet_name => $sheet) {
|
||||||
$content_types_xml .= '<Override PartName="/xl/worksheets/'.($sheet->xmlname).'" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>';
|
$content_types_xml .= '<Override PartName="/xl/worksheets/' . ($sheet->xmlname) . '" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.worksheet+xml"/>';
|
||||||
}
|
}
|
||||||
if (!empty($this->shared_strings)) {
|
if (!empty($this->shared_strings)) {
|
||||||
$content_types_xml .= '<Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>';
|
$content_types_xml .= '<Override PartName="/xl/sharedStrings.xml" ContentType="application/vnd.openxmlformats-officedocument.spreadsheetml.sharedStrings+xml"/>';
|
||||||
@ -432,7 +432,7 @@ class XLSXWriter
|
|||||||
}
|
}
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
public static function log($string) {
|
public static function log($string) {
|
||||||
file_put_contents("php://stderr", date("Y-m-d H:i:s:").rtrim(is_array($string) ? json_encode($string) : $string)."\n");
|
file_put_contents("php://stderr", date("Y-m-d H:i:s:") . rtrim(is_array($string) ? json_encode($string) : $string) . "\n");
|
||||||
}
|
}
|
||||||
//------------------------------------------------------------------
|
//------------------------------------------------------------------
|
||||||
public static function sanitize_filename($filename) {
|
public static function sanitize_filename($filename) {
|
||||||
|
@ -28,6 +28,12 @@
|
|||||||
|
|
||||||
<!-- Only short array syntax is allowed -->
|
<!-- Only short array syntax is allowed -->
|
||||||
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
|
<rule ref="Generic.Arrays.DisallowLongArraySyntax"/>
|
||||||
|
<rule ref="Squiz.Strings.ConcatenationSpacing">
|
||||||
|
<properties>
|
||||||
|
<property name="ignoreNewlines" value="true" />
|
||||||
|
<property name="spacing" value="1" />
|
||||||
|
</properties>
|
||||||
|
</rule>
|
||||||
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
|
<rule ref="Squiz.WhiteSpace.OperatorSpacing">
|
||||||
<properties>
|
<properties>
|
||||||
<property name="ignoreNewlines" value="true" />
|
<property name="ignoreNewlines" value="true" />
|
||||||
|
@ -787,9 +787,9 @@ class NewslettersTest extends \MailPoetTest {
|
|||||||
expect($subscriber)->equals($subscriber);
|
expect($subscriber)->equals($subscriber);
|
||||||
expect($extra_params['unsubscribe_url'])->equals(home_url());
|
expect($extra_params['unsubscribe_url'])->equals(home_url());
|
||||||
// system links are replaced with hashes
|
// system links are replaced with hashes
|
||||||
expect($newsletter['body']['html'])->contains('href="'.$viewInBrowserLink.'">View in browser');
|
expect($newsletter['body']['html'])->contains('href="' . $viewInBrowserLink . '">View in browser');
|
||||||
expect($newsletter['body']['html'])->contains('href="'.$unsubscribeLink.'">Unsubscribe');
|
expect($newsletter['body']['html'])->contains('href="' . $unsubscribeLink . '">Unsubscribe');
|
||||||
expect($newsletter['body']['html'])->contains('href="'.$manageLink.'">Manage subscription');
|
expect($newsletter['body']['html'])->contains('href="' . $manageLink . '">Manage subscription');
|
||||||
return ['response' => true];
|
return ['response' => true];
|
||||||
},
|
},
|
||||||
]
|
]
|
||||||
|
@ -26,31 +26,31 @@ class EnvTest extends \MailPoetTest {
|
|||||||
Env::init('file', '1.0.0', 'localhost', 'db_user', 'pass123', 'db_name');
|
Env::init('file', '1.0.0', 'localhost', 'db_user', 'pass123', 'db_name');
|
||||||
expect(Env::$db_host)->equals('localhost');
|
expect(Env::$db_host)->equals('localhost');
|
||||||
expect(Env::$db_port)->equals('3306');
|
expect(Env::$db_port)->equals('3306');
|
||||||
expect(Env::$db_source_name)->equals('mysql:host=localhost;port=3306;dbname=db_name;charset='. ENV::$db_charset);
|
expect(Env::$db_source_name)->equals('mysql:host=localhost;port=3306;dbname=db_name;charset=' . ENV::$db_charset);
|
||||||
|
|
||||||
Env::init('file', '1.0.0', 'localhost:3307', 'db_user', 'pass123', 'db_name');
|
Env::init('file', '1.0.0', 'localhost:3307', 'db_user', 'pass123', 'db_name');
|
||||||
expect(Env::$db_host)->equals('localhost');
|
expect(Env::$db_host)->equals('localhost');
|
||||||
expect(Env::$db_port)->equals('3307');
|
expect(Env::$db_port)->equals('3307');
|
||||||
expect(Env::$db_source_name)->equals('mysql:host=localhost;port=3307;dbname=db_name;charset='. ENV::$db_charset);
|
expect(Env::$db_source_name)->equals('mysql:host=localhost;port=3307;dbname=db_name;charset=' . ENV::$db_charset);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testItProcessDBHostWithSocket() {
|
function testItProcessDBHostWithSocket() {
|
||||||
Env::init('file', '1.0.0', 'localhost:/var/lib/mysql/mysql55.sock', 'db_user', 'pass123', 'db_name');
|
Env::init('file', '1.0.0', 'localhost:/var/lib/mysql/mysql55.sock', 'db_user', 'pass123', 'db_name');
|
||||||
expect(Env::$db_host)->equals('localhost');
|
expect(Env::$db_host)->equals('localhost');
|
||||||
expect(Env::$db_socket)->equals('/var/lib/mysql/mysql55.sock');
|
expect(Env::$db_socket)->equals('/var/lib/mysql/mysql55.sock');
|
||||||
expect(Env::$db_source_name)->equals('mysql:host=localhost;port=3306;dbname=db_name;unix_socket=/var/lib/mysql/mysql55.sock;charset='. ENV::$db_charset);
|
expect(Env::$db_source_name)->equals('mysql:host=localhost;port=3306;dbname=db_name;unix_socket=/var/lib/mysql/mysql55.sock;charset=' . ENV::$db_charset);
|
||||||
}
|
}
|
||||||
|
|
||||||
function testItProcessDBHostWithIpV6Address() {
|
function testItProcessDBHostWithIpV6Address() {
|
||||||
Env::init('file', '1.0.0', '::1', 'db_user', 'pass123', 'db_name');
|
Env::init('file', '1.0.0', '::1', 'db_user', 'pass123', 'db_name');
|
||||||
expect(Env::$db_host)->equals('::1');
|
expect(Env::$db_host)->equals('::1');
|
||||||
expect(Env::$db_socket)->equals(null);
|
expect(Env::$db_socket)->equals(null);
|
||||||
expect(Env::$db_source_name)->equals('mysql:host=[::1];port=3306;dbname=db_name;charset='. ENV::$db_charset);
|
expect(Env::$db_source_name)->equals('mysql:host=[::1];port=3306;dbname=db_name;charset=' . ENV::$db_charset);
|
||||||
|
|
||||||
Env::init('file', '1.0.0', 'b57e:9b70:ab96:6a0b:5ba2:49e3:ebba:a036', 'db_user', 'pass123', 'db_name');
|
Env::init('file', '1.0.0', 'b57e:9b70:ab96:6a0b:5ba2:49e3:ebba:a036', 'db_user', 'pass123', 'db_name');
|
||||||
expect(Env::$db_host)->equals('b57e:9b70:ab96:6a0b:5ba2:49e3:ebba:a036');
|
expect(Env::$db_host)->equals('b57e:9b70:ab96:6a0b:5ba2:49e3:ebba:a036');
|
||||||
expect(Env::$db_socket)->equals(null);
|
expect(Env::$db_socket)->equals(null);
|
||||||
expect(Env::$db_source_name)->equals('mysql:host=[b57e:9b70:ab96:6a0b:5ba2:49e3:ebba:a036];port=3306;dbname=db_name;charset='. ENV::$db_charset);
|
expect(Env::$db_source_name)->equals('mysql:host=[b57e:9b70:ab96:6a0b:5ba2:49e3:ebba:a036];port=3306;dbname=db_name;charset=' . ENV::$db_charset);
|
||||||
|
|
||||||
}
|
}
|
||||||
function testItCanReturnDbName() {
|
function testItCanReturnDbName() {
|
||||||
|
@ -99,8 +99,8 @@ class BeaconTest extends \MailPoetTest {
|
|||||||
function testItReturnsSendingMethodDetails() {
|
function testItReturnsSendingMethodDetails() {
|
||||||
$mta = $this->settings->get('mta');
|
$mta = $this->settings->get('mta');
|
||||||
expect($this->beacon_data['Sending Method'])->equals($mta['method']);
|
expect($this->beacon_data['Sending Method'])->equals($mta['method']);
|
||||||
expect($this->beacon_data['Sending Frequency'])->contains($mta['frequency']['emails'].' emails');
|
expect($this->beacon_data['Sending Frequency'])->contains($mta['frequency']['emails'] . ' emails');
|
||||||
expect($this->beacon_data['Sending Frequency'])->contains($mta['frequency']['interval'].' minutes');
|
expect($this->beacon_data['Sending Frequency'])->contains($mta['frequency']['interval'] . ' minutes');
|
||||||
}
|
}
|
||||||
|
|
||||||
function testItReturnsSomeSettings() {
|
function testItReturnsSomeSettings() {
|
||||||
|
@ -315,13 +315,13 @@ class SubscriberTest extends \MailPoetTest {
|
|||||||
|
|
||||||
$subscriber_with_custom_field = Subscriber::createOrUpdate([
|
$subscriber_with_custom_field = Subscriber::createOrUpdate([
|
||||||
'email' => 'user.with.cf@mailpoet.com',
|
'email' => 'user.with.cf@mailpoet.com',
|
||||||
'cf_'.$custom_field->id => 'Paris',
|
'cf_' . $custom_field->id => 'Paris',
|
||||||
'cf_'.$custom_field_2->id => [
|
'cf_' . $custom_field_2->id => [
|
||||||
'day' => 9,
|
'day' => 9,
|
||||||
'month' => 3,
|
'month' => 3,
|
||||||
'year' => 1984,
|
'year' => 1984,
|
||||||
], // date as array value
|
], // date as array value
|
||||||
'cf_'.$custom_field_3->id => '2013-07', // date as string value
|
'cf_' . $custom_field_3->id => '2013-07', // date as string value
|
||||||
]);
|
]);
|
||||||
|
|
||||||
$subscriber = Subscriber::findOne($subscriber_with_custom_field->id)
|
$subscriber = Subscriber::findOne($subscriber_with_custom_field->id)
|
||||||
@ -329,11 +329,11 @@ class SubscriberTest extends \MailPoetTest {
|
|||||||
|
|
||||||
expect($subscriber->id)->equals($subscriber_with_custom_field->id);
|
expect($subscriber->id)->equals($subscriber_with_custom_field->id);
|
||||||
expect($subscriber->email)->equals('user.with.cf@mailpoet.com');
|
expect($subscriber->email)->equals('user.with.cf@mailpoet.com');
|
||||||
expect($subscriber->{'cf_'.$custom_field->id})->equals('Paris');
|
expect($subscriber->{'cf_' . $custom_field->id})->equals('Paris');
|
||||||
// date specified as array gets converted to string
|
// date specified as array gets converted to string
|
||||||
expect($subscriber->{'cf_'.$custom_field_2->id})->equals('1984-03-09 00:00:00');
|
expect($subscriber->{'cf_' . $custom_field_2->id})->equals('1984-03-09 00:00:00');
|
||||||
// date specified as string is stored as is
|
// date specified as string is stored as is
|
||||||
expect($subscriber->{'cf_'.$custom_field_3->id})->equals('2013-07');
|
expect($subscriber->{'cf_' . $custom_field_3->id})->equals('2013-07');
|
||||||
}
|
}
|
||||||
|
|
||||||
function testItShouldUnsubscribeFromAllSegments() {
|
function testItShouldUnsubscribeFromAllSegments() {
|
||||||
@ -459,7 +459,7 @@ class SubscriberTest extends \MailPoetTest {
|
|||||||
|
|
||||||
$subscriber = $subscriber->withCustomFields()->asArray();
|
$subscriber = $subscriber->withCustomFields()->asArray();
|
||||||
|
|
||||||
expect($subscriber['cf_'.$custom_field->id()])->equals(
|
expect($subscriber['cf_' . $custom_field->id()])->equals(
|
||||||
mktime(0, 0, 0, $value['month'], $value['day'], $value['year'])
|
mktime(0, 0, 0, $value['month'], $value['day'], $value['year'])
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -283,7 +283,7 @@ class RendererTest extends \MailPoetTest {
|
|||||||
];
|
];
|
||||||
$rendered_image = Image::render($image, self::COLUMN_BASE_WIDTH);
|
$rendered_image = Image::render($image, self::COLUMN_BASE_WIDTH);
|
||||||
$site_url = get_option('siteurl');
|
$site_url = get_option('siteurl');
|
||||||
expect($rendered_image)->contains('src="'.$site_url.'/relative-path"');
|
expect($rendered_image)->contains('src="' . $site_url . '/relative-path"');
|
||||||
|
|
||||||
$image = [
|
$image = [
|
||||||
'src' => '//path-without-protocol',
|
'src' => '//path-without-protocol',
|
||||||
|
@ -14,8 +14,8 @@ class DOMTest extends \MailPoetUnitTest {
|
|||||||
DOMUtil::splitOn($this->root, $this->root->query('a')->offsetGet(0));
|
DOMUtil::splitOn($this->root, $this->root->query('a')->offsetGet(0));
|
||||||
|
|
||||||
expect($this->root->html())->equals(
|
expect($this->root->html())->equals(
|
||||||
'<p><i>italic</i><em>previous text</em></p>'.
|
'<p><i>italic</i><em>previous text</em></p>' .
|
||||||
'<a href="#mylink"><img src="#myimage" /></a>'.
|
'<a href="#mylink"><img src="#myimage" /></a>' .
|
||||||
'<p><em>next text</em><b>bolded</b></p>'
|
'<p><em>next text</em><b>bolded</b></p>'
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -32,7 +32,7 @@ class PQueryTest extends \MailPoetUnitTest {
|
|||||||
$html_numbers = array_merge(range(40, 126), range(160, 255), [32, 33, 35, 36, 37, 38, 338, 339, 352, 353, 376, 402, 8211, 8212, 8216, 8217, 8218, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8364, 8482]);
|
$html_numbers = array_merge(range(40, 126), range(160, 255), [32, 33, 35, 36, 37, 38, 338, 339, 352, 353, 376, 402, 8211, 8212, 8216, 8217, 8218, 8220, 8221, 8222, 8224, 8225, 8226, 8230, 8240, 8364, 8482]);
|
||||||
|
|
||||||
foreach ($html_numbers as $char) {
|
foreach ($html_numbers as $char) {
|
||||||
$this->parseTest('&#'.$char.';', $equals = false);
|
$this->parseTest('&#' . $char . ';', $equals = false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user