Use phpstan level 2
[MAILPOET-1822]
This commit is contained in:
@ -388,7 +388,7 @@ class RoboFile extends \Robo\Tasks {
|
|||||||
'php -d memory_limit=2G '.
|
'php -d memory_limit=2G '.
|
||||||
"$dir/phpstan.phar analyse ".
|
"$dir/phpstan.phar analyse ".
|
||||||
"--configuration $dir/tasks/phpstan/phpstan.neon ".
|
"--configuration $dir/tasks/phpstan/phpstan.neon ".
|
||||||
'--level 1 '.
|
'--level 2 '.
|
||||||
"$dir/lib"
|
"$dir/lib"
|
||||||
)
|
)
|
||||||
->dir(__DIR__ . '/tasks/phpstan')
|
->dir(__DIR__ . '/tasks/phpstan')
|
||||||
|
@ -34,12 +34,14 @@ class Reporter {
|
|||||||
$has_wc = $this->woocommerce_helper->isWooCommerceActive();
|
$has_wc = $this->woocommerce_helper->isWooCommerceActive();
|
||||||
$wc_customers_count = 0;
|
$wc_customers_count = 0;
|
||||||
if ($has_wc) {
|
if ($has_wc) {
|
||||||
$wc_customers_count = (int)Newsletter::rawQuery(
|
/** @var \stdClass */
|
||||||
|
$wc_customers = Newsletter::rawQuery(
|
||||||
"SELECT COUNT(DISTINCT m.meta_value) as count FROM ".$wpdb->prefix."posts p ".
|
"SELECT COUNT(DISTINCT m.meta_value) as count FROM ".$wpdb->prefix."posts p ".
|
||||||
"JOIN ".$wpdb->prefix."postmeta m ON m.post_id = p.id ".
|
"JOIN ".$wpdb->prefix."postmeta m ON m.post_id = p.id ".
|
||||||
"WHERE p.post_type = 'shop_order' ".
|
"WHERE p.post_type = 'shop_order' ".
|
||||||
"AND m.meta_key = '_customer_user' AND m.meta_value <> 0"
|
"AND m.meta_key = '_customer_user' AND m.meta_value <> 0"
|
||||||
)->findOne()->count;
|
)->findOne();
|
||||||
|
$wc_customers_count = (int)$wc_customers->count;
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
return array(
|
||||||
|
@ -116,7 +116,7 @@ abstract class SimpleWorker {
|
|||||||
$wp = new WPFunctions();
|
$wp = new WPFunctions();
|
||||||
$date = Carbon::createFromTimestamp($wp->currentTime('timestamp'));
|
$date = Carbon::createFromTimestamp($wp->currentTime('timestamp'));
|
||||||
// Random day of the next week
|
// Random day of the next week
|
||||||
$date->setISODate($date->format('o'), $date->format('W') + 1, mt_rand(1, 7));
|
$date->setISODate($date->format('o'), ((int)$date->format('W')) + 1, mt_rand(1, 7));
|
||||||
$date->startOfDay();
|
$date->startOfDay();
|
||||||
return $date;
|
return $date;
|
||||||
}
|
}
|
||||||
|
@ -105,7 +105,12 @@ class Worker {
|
|||||||
->withStatistics();
|
->withStatistics();
|
||||||
}
|
}
|
||||||
|
|
||||||
private function prepareContext(Newsletter $newsletter, NewsletterLink $link = null) {
|
/**
|
||||||
|
* @param Newsletter $newsletter
|
||||||
|
* @param \stdClass|NewsletterLink $link
|
||||||
|
* @return array
|
||||||
|
*/
|
||||||
|
private function prepareContext(Newsletter $newsletter, $link = null) {
|
||||||
$clicked = ($newsletter->statistics['clicked'] * 100) / $newsletter->total_sent;
|
$clicked = ($newsletter->statistics['clicked'] * 100) / $newsletter->total_sent;
|
||||||
$opened = ($newsletter->statistics['opened'] * 100) / $newsletter->total_sent;
|
$opened = ($newsletter->statistics['opened'] * 100) / $newsletter->total_sent;
|
||||||
$unsubscribed = ($newsletter->statistics['unsubscribed'] * 100) / $newsletter->total_sent;
|
$unsubscribed = ($newsletter->statistics['unsubscribed'] * 100) / $newsletter->total_sent;
|
||||||
|
@ -2,6 +2,7 @@
|
|||||||
|
|
||||||
namespace MailPoet\DI;
|
namespace MailPoet\DI;
|
||||||
|
|
||||||
|
use MailPoetVendor\Symfony\Component\DependencyInjection\Container;
|
||||||
use MailPoetVendor\Symfony\Component\DependencyInjection\ContainerBuilder;
|
use MailPoetVendor\Symfony\Component\DependencyInjection\ContainerBuilder;
|
||||||
|
|
||||||
class ContainerFactory {
|
class ContainerFactory {
|
||||||
@ -21,6 +22,9 @@ class ContainerFactory {
|
|||||||
$this->configurator = $configurator;
|
$this->configurator = $configurator;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @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)) {
|
||||||
|
@ -4,6 +4,7 @@ namespace MailPoet\DI;
|
|||||||
|
|
||||||
use MailPoetVendor\Psr\Container\ContainerInterface;
|
use MailPoetVendor\Psr\Container\ContainerInterface;
|
||||||
use MailPoetVendor\Psr\Container\NotFoundExceptionInterface;
|
use MailPoetVendor\Psr\Container\NotFoundExceptionInterface;
|
||||||
|
use MailPoetVendor\Symfony\Component\DependencyInjection\Container;
|
||||||
|
|
||||||
class ContainerWrapper implements ContainerInterface {
|
class ContainerWrapper implements ContainerInterface {
|
||||||
|
|
||||||
@ -60,8 +61,8 @@ class ContainerWrapper implements ContainerInterface {
|
|||||||
return self::$instance;
|
return self::$instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
private static function createPremiumContainer(ContainerInterface $free_container, $debug = false) {
|
private static function createPremiumContainer(Container $free_container, $debug = false) {
|
||||||
$premium_container_factory = new ContainerFactory(new \MailPoet\Premium\DI\ContainerConfigurator(), $debug);
|
$premium_container_factory = new ContainerFactory(new \MailPoet\Premium\DI\ContainerConfigurator(), $debug);
|
||||||
$premium_container = $premium_container_factory->getContainer();
|
$premium_container = $premium_container_factory->getContainer();
|
||||||
$premium_container->set(IContainerConfigurator::FREE_CONTAINER_SERVICE_SLUG, $free_container);
|
$premium_container->set(IContainerConfigurator::FREE_CONTAINER_SERVICE_SLUG, $free_container);
|
||||||
$free_container->set(IContainerConfigurator::PREMIUM_CONTAINER_SERVICE_SLUG, $premium_container);
|
$free_container->set(IContainerConfigurator::PREMIUM_CONTAINER_SERVICE_SLUG, $premium_container);
|
||||||
|
@ -6,6 +6,7 @@ if (!defined('ABSPATH')) exit;
|
|||||||
/**
|
/**
|
||||||
* @property string|array $settings
|
* @property string|array $settings
|
||||||
* @property string|array $body
|
* @property string|array $body
|
||||||
|
* @property string $name
|
||||||
*/
|
*/
|
||||||
class Form extends Model {
|
class Form extends Model {
|
||||||
public static $_table = MP_FORMS_TABLE;
|
public static $_table = MP_FORMS_TABLE;
|
||||||
|
@ -7,7 +7,7 @@ if (!defined('ABSPATH')) exit;
|
|||||||
/**
|
/**
|
||||||
* @method static array|string getConfig($key = null, $connection_name = self::DEFAULT_CONNECTION)
|
* @method static array|string getConfig($key = null, $connection_name = self::DEFAULT_CONNECTION)
|
||||||
* @method static null resetConfig()
|
* @method static null resetConfig()
|
||||||
* @method static \ORM forTable($table_name, $connection_name = self::DEFAULT_CONNECTION)
|
* @method static self forTable($table_name, $connection_name = self::DEFAULT_CONNECTION)
|
||||||
* @method static null setDb($db, $connection_name = self::DEFAULT_CONNECTION)
|
* @method static null setDb($db, $connection_name = self::DEFAULT_CONNECTION)
|
||||||
* @method static null resetDb()
|
* @method static null resetDb()
|
||||||
* @method static null setupLimitClauseStyle($connection_name)
|
* @method static null setupLimitClauseStyle($connection_name)
|
||||||
@ -18,14 +18,15 @@ if (!defined('ABSPATH')) exit;
|
|||||||
* @method static array getQueryLog($connection_name = self::DEFAULT_CONNECTION)
|
* @method static array getQueryLog($connection_name = self::DEFAULT_CONNECTION)
|
||||||
* @method array getConnectionNames()
|
* @method array getConnectionNames()
|
||||||
* @method $this useIdColumn($id_column)
|
* @method $this useIdColumn($id_column)
|
||||||
* @method \ORM|bool findOne($id=null)
|
* @method $this|bool findOne($id=null)
|
||||||
* @method static \ORM|bool findOne($id=null)
|
* @method static static|bool findOne($id=null)
|
||||||
* @method array|\IdiormResultSet findMany()
|
* @method array|\IdiormResultSet findMany()
|
||||||
* @method static array|\IdiormResultSet findMany()
|
* @method static array|\IdiormResultSet findMany()
|
||||||
* @method \IdiormResultSet findResultSet()
|
* @method \IdiormResultSet findResultSet()
|
||||||
* @method array findArray()
|
* @method array findArray()
|
||||||
* @method static array findArray()
|
* @method static array findArray()
|
||||||
* @method $this forceAllDirty()
|
* @method $this forceAllDirty()
|
||||||
|
* @method $this select_expr(string $expr, string $alias=null)
|
||||||
* @method $this rawQuery($query, $parameters = array())
|
* @method $this rawQuery($query, $parameters = array())
|
||||||
* @method static $this rawQuery($query, $parameters = array())
|
* @method static $this rawQuery($query, $parameters = array())
|
||||||
* @method $this tableAlias($alias)
|
* @method $this tableAlias($alias)
|
||||||
@ -35,11 +36,12 @@ if (!defined('ABSPATH')) exit;
|
|||||||
* @method static $this select($column, $alias=null)
|
* @method static $this select($column, $alias=null)
|
||||||
* @method $this selectExpr($expr, $alias=null)
|
* @method $this selectExpr($expr, $alias=null)
|
||||||
* @method static $this selectExpr($expr, $alias=null)
|
* @method static $this selectExpr($expr, $alias=null)
|
||||||
* @method \ORM selectMany(...$values)
|
* @method $this selectMany(...$values)
|
||||||
* @method static \ORM selectMany(...$values)
|
* @method static static selectMany(...$values)
|
||||||
* @method \ORM selectManyExpr($values)
|
* @method static selectManyExpr($values)
|
||||||
* @method $this rawJoin($table, $constraint, $table_alias, $parameters = array())
|
* @method $this rawJoin($table, $constraint, $table_alias, $parameters = array())
|
||||||
* @method $this innerJoin($table, $constraint, $table_alias=null)
|
* @method $this innerJoin($table, $constraint, $table_alias=null)
|
||||||
|
* @method $this join(string $table, string $constraint, $table_alias=null)
|
||||||
* @method $this leftOuterJoin($table, $constraint, $table_alias=null)
|
* @method $this leftOuterJoin($table, $constraint, $table_alias=null)
|
||||||
* @method $this rightOuterJoin($table, $constraint, $table_alias=null)
|
* @method $this rightOuterJoin($table, $constraint, $table_alias=null)
|
||||||
* @method $this fullOuterJoin($table, $constraint, $table_alias=null)
|
* @method $this fullOuterJoin($table, $constraint, $table_alias=null)
|
||||||
@ -51,8 +53,8 @@ if (!defined('ABSPATH')) exit;
|
|||||||
* @method static $this whereNotEqual($column_name, $value=null)
|
* @method static $this whereNotEqual($column_name, $value=null)
|
||||||
* @method $this whereIdIs($id)
|
* @method $this whereIdIs($id)
|
||||||
* @method $this whereAnyIs($values, $operator='=')
|
* @method $this whereAnyIs($values, $operator='=')
|
||||||
* @method array|string whereIdIn($ids)
|
* @method $this whereIdIn($ids)
|
||||||
* @method static array|string whereIdIn($ids)
|
* @method static static whereIdIn($ids)
|
||||||
* @method $this whereLike($column_name, $value=null)
|
* @method $this whereLike($column_name, $value=null)
|
||||||
* @method $this whereNotLike($column_name, $value=null)
|
* @method $this whereNotLike($column_name, $value=null)
|
||||||
* @method $this whereGt($column_name, $value=null)
|
* @method $this whereGt($column_name, $value=null)
|
||||||
@ -94,16 +96,21 @@ if (!defined('ABSPATH')) exit;
|
|||||||
* @method static $this clearCache($table_name = null, $connection_name = self::DEFAULT_CONNECTION)
|
* @method static $this clearCache($table_name = null, $connection_name = self::DEFAULT_CONNECTION)
|
||||||
* @method bool setExpr($key, $value = null)
|
* @method bool setExpr($key, $value = null)
|
||||||
* @method bool isDirty($key)
|
* @method bool isDirty($key)
|
||||||
* @method static ORMWrapper filter(...$args)
|
* @method static static filter(...$args)
|
||||||
* @method \ORMWrapper hasMany($associated_class_name, $foreign_key_name=null, $foreign_key_name_in_current_models_table=null, $connection_name=null)
|
* @method $this hasMany($associated_class_name, $foreign_key_name=null, $foreign_key_name_in_current_models_table=null, $connection_name=null)
|
||||||
* @method \ORMWrapper hasManyThrough($associated_class_name, $join_class_name=null, $key_to_base_table=null, $key_to_associated_table=null, $key_in_base_table=null, $key_in_associated_table=null, $connection_name=null)
|
* @method $this hasManyThrough($associated_class_name, $join_class_name=null, $key_to_base_table=null, $key_to_associated_table=null, $key_in_base_table=null, $key_in_associated_table=null, $connection_name=null)
|
||||||
* @method \ORMWrapper hasOne($associated_class_name, $foreign_key_name=null, $foreign_key_name_in_current_models_table=null, $connection_name=null)
|
* @method $this hasOne($associated_class_name, $foreign_key_name=null, $foreign_key_name_in_current_models_table=null, $connection_name=null)
|
||||||
* @method \ORMWrapper|bool create($data=null)
|
* @method $this|bool create($data=null)
|
||||||
* @method static \ORMWrapper|bool create($data=null)
|
* @method static $this|bool create($data=null)
|
||||||
* @method int count()
|
* @method int count()
|
||||||
* @method static int count()
|
* @method static int count()
|
||||||
|
* @method static static limit(int $limit)
|
||||||
|
* @method static static distinct()
|
||||||
|
* @method $this set(string|array $key, string|null $value = null)
|
||||||
*
|
*
|
||||||
* @property string|null $created_at
|
* @property string|null $created_at
|
||||||
|
* @property string|null $updated_at
|
||||||
|
* @property string|null $id
|
||||||
*/
|
*/
|
||||||
class Model extends \Sudzy\ValidModel {
|
class Model extends \Sudzy\ValidModel {
|
||||||
const DUPLICATE_RECORD = 23000;
|
const DUPLICATE_RECORD = 23000;
|
||||||
@ -129,7 +136,7 @@ class Model extends \Sudzy\ValidModel {
|
|||||||
*
|
*
|
||||||
* @param array $data
|
* @param array $data
|
||||||
* @param boolean $keys
|
* @param boolean $keys
|
||||||
* @param callable $onCreate
|
* @param callable|bool $onCreate
|
||||||
* @return self
|
* @return self
|
||||||
*/
|
*/
|
||||||
static protected function _createOrUpdate($data = array(), $keys = false, $onCreate = false) {
|
static protected function _createOrUpdate($data = array(), $keys = false, $onCreate = false) {
|
||||||
|
@ -22,10 +22,12 @@ if (!defined('ABSPATH')) exit;
|
|||||||
* @property int $children_count
|
* @property int $children_count
|
||||||
* @property bool|array $statistics
|
* @property bool|array $statistics
|
||||||
* @property string $deleted_at
|
* @property string $deleted_at
|
||||||
* @property int $children_count
|
|
||||||
* @property int $total_sent
|
* @property int $total_sent
|
||||||
* @property int $total_scheduled
|
* @property int $total_scheduled
|
||||||
* @property array $segments
|
* @property array $segments
|
||||||
|
* @property string $subject
|
||||||
|
* @property string $body
|
||||||
|
* @property string|null $schedule
|
||||||
*/
|
*/
|
||||||
class Newsletter extends Model {
|
class Newsletter extends Model {
|
||||||
public static $_table = MP_NEWSLETTERS_TABLE;
|
public static $_table = MP_NEWSLETTERS_TABLE;
|
||||||
@ -585,16 +587,17 @@ class Newsletter extends Model {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function wasScheduledForSubscriber($subscriber_id) {
|
function wasScheduledForSubscriber($subscriber_id) {
|
||||||
$count = (int)SendingQueue::rawQuery(
|
/** @var \stdClass */
|
||||||
|
$queue = SendingQueue::rawQuery(
|
||||||
"SELECT COUNT(*) as count
|
"SELECT COUNT(*) as count
|
||||||
FROM `" . SendingQueue::$_table . "`
|
FROM `" . SendingQueue::$_table . "`
|
||||||
JOIN `" . ScheduledTask::$_table . "` ON " . SendingQueue::$_table . ".task_id = " . ScheduledTask::$_table . ".id
|
JOIN `" . ScheduledTask::$_table . "` ON " . SendingQueue::$_table . ".task_id = " . ScheduledTask::$_table . ".id
|
||||||
JOIN `" . ScheduledTaskSubscriber::$_table . "` ON " . ScheduledTask::$_table . ".id = " . ScheduledTaskSubscriber::$_table . ".task_id
|
JOIN `" . ScheduledTaskSubscriber::$_table . "` ON " . ScheduledTask::$_table . ".id = " . ScheduledTaskSubscriber::$_table . ".task_id
|
||||||
WHERE " . ScheduledTaskSubscriber::$_table . ".subscriber_id = " . $subscriber_id . "
|
WHERE " . ScheduledTaskSubscriber::$_table . ".subscriber_id = " . $subscriber_id . "
|
||||||
AND " . SendingQueue::$_table . ".newsletter_id = " . $this->id
|
AND " . SendingQueue::$_table . ".newsletter_id = " . $this->id
|
||||||
)->findOne()->count;
|
)->findOne();
|
||||||
|
|
||||||
return $count > 0;
|
return ((int)$queue->count) > 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -3,9 +3,19 @@ namespace MailPoet\Models;
|
|||||||
|
|
||||||
if (!defined('ABSPATH')) exit;
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property int $newsletter_id
|
||||||
|
* @property int $queue_id
|
||||||
|
* @property string $url
|
||||||
|
* @property string $hash
|
||||||
|
*/
|
||||||
class NewsletterLink extends Model {
|
class NewsletterLink extends Model {
|
||||||
public static $_table = MP_NEWSLETTER_LINKS_TABLE;
|
public static $_table = MP_NEWSLETTER_LINKS_TABLE;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param Newsletter $newsletter
|
||||||
|
* @return \stdClass|null
|
||||||
|
*/
|
||||||
static function findTopLinkForNewsletter(Newsletter $newsletter) {
|
static function findTopLinkForNewsletter(Newsletter $newsletter) {
|
||||||
$link = self::selectExpr('links.*')
|
$link = self::selectExpr('links.*')
|
||||||
->selectExpr('count(*)', 'clicksCount')
|
->selectExpr('count(*)', 'clicksCount')
|
||||||
|
@ -3,6 +3,15 @@ namespace MailPoet\Models;
|
|||||||
|
|
||||||
if (!defined('ABSPATH')) exit;
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property string $name
|
||||||
|
* @property int|null $newsletter_id
|
||||||
|
* @property string $categories
|
||||||
|
* @property string $description
|
||||||
|
* @property string|null $body
|
||||||
|
* @property string|null $thumbnail
|
||||||
|
* @property int|null $readonly
|
||||||
|
*/
|
||||||
class NewsletterTemplate extends Model {
|
class NewsletterTemplate extends Model {
|
||||||
public static $_table = MP_NEWSLETTER_TEMPLATES_TABLE;
|
public static $_table = MP_NEWSLETTER_TEMPLATES_TABLE;
|
||||||
|
|
||||||
|
@ -9,7 +9,10 @@ if (!defined('ABSPATH')) exit;
|
|||||||
/**
|
/**
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string $processed_at
|
* @property string $processed_at
|
||||||
|
* @property string|null $status
|
||||||
|
* @property string|null $type
|
||||||
* @property int $priority
|
* @property int $priority
|
||||||
|
* @property string $scheduled_at
|
||||||
*/
|
*/
|
||||||
class ScheduledTask extends Model {
|
class ScheduledTask extends Model {
|
||||||
public static $_table = MP_SCHEDULED_TASKS_TABLE;
|
public static $_table = MP_SCHEDULED_TASKS_TABLE;
|
||||||
|
@ -4,8 +4,10 @@ namespace MailPoet\Models;
|
|||||||
if (!defined('ABSPATH')) exit;
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @property int $id
|
|
||||||
* @property array $subscribers_count
|
* @property array $subscribers_count
|
||||||
|
* @property string $name
|
||||||
|
* @property string $type
|
||||||
|
* @property string $description
|
||||||
*/
|
*/
|
||||||
class Segment extends Model {
|
class Segment extends Model {
|
||||||
static $_table = MP_SEGMENTS_TABLE;
|
static $_table = MP_SEGMENTS_TABLE;
|
||||||
|
@ -9,11 +9,15 @@ if (!defined('ABSPATH')) exit;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @property int $count_processed
|
* @property int $count_processed
|
||||||
|
* @property int $count_to_process
|
||||||
* @property int $count_total
|
* @property int $count_total
|
||||||
* @property string $newsletter_rendered_body
|
* @property string $newsletter_rendered_body
|
||||||
|
* @property string $newsletter_rendered_subject
|
||||||
* @property int $task_id
|
* @property int $task_id
|
||||||
|
* @property int $newsletter_id
|
||||||
* @property string|object $meta
|
* @property string|object $meta
|
||||||
* @property string|array $subscribers
|
* @property string|array $subscribers
|
||||||
|
* @property string|null $deleted_at
|
||||||
*/
|
*/
|
||||||
class SendingQueue extends Model {
|
class SendingQueue extends Model {
|
||||||
public static $_table = MP_SENDING_QUEUES_TABLE;
|
public static $_table = MP_SENDING_QUEUES_TABLE;
|
||||||
|
@ -5,6 +5,10 @@ use MailPoet\Settings\SettingsController;
|
|||||||
|
|
||||||
if (!defined('ABSPATH')) exit;
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property string $name
|
||||||
|
* @property string|null $value
|
||||||
|
*/
|
||||||
class Setting extends Model {
|
class Setting extends Model {
|
||||||
public static $_table = MP_SETTINGS_TABLE;
|
public static $_table = MP_SETTINGS_TABLE;
|
||||||
|
|
||||||
|
@ -3,6 +3,13 @@ namespace MailPoet\Models;
|
|||||||
|
|
||||||
if (!defined('ABSPATH')) exit;
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property int $newsletter_id
|
||||||
|
* @property int $subscriber_id
|
||||||
|
* @property int $queue_id
|
||||||
|
* @property int $link_id
|
||||||
|
* @property int $count
|
||||||
|
*/
|
||||||
class StatisticsClicks extends Model {
|
class StatisticsClicks extends Model {
|
||||||
public static $_table = MP_STATISTICS_CLICKS_TABLE;
|
public static $_table = MP_STATISTICS_CLICKS_TABLE;
|
||||||
|
|
||||||
|
@ -11,6 +11,15 @@ if (!defined('ABSPATH')) exit;
|
|||||||
/**
|
/**
|
||||||
* @property int $id
|
* @property int $id
|
||||||
* @property string $email
|
* @property string $email
|
||||||
|
* @property string $first_name
|
||||||
|
* @property string $last_name
|
||||||
|
* @property string $status
|
||||||
|
* @property string|null $subscribed_ip
|
||||||
|
* @property string|null $confirmed_ip
|
||||||
|
* @property string|null $confirmed_at
|
||||||
|
* @property string|null $deleted_at
|
||||||
|
* @property string|null $source
|
||||||
|
* @property int $count_confirmations
|
||||||
* @property int $wp_user_id
|
* @property int $wp_user_id
|
||||||
* @property array $segments
|
* @property array $segments
|
||||||
* @property array $subscriptions
|
* @property array $subscriptions
|
||||||
@ -26,6 +35,9 @@ class Subscriber extends Model {
|
|||||||
const STATUS_BOUNCED = 'bounced';
|
const STATUS_BOUNCED = 'bounced';
|
||||||
const SUBSCRIBER_TOKEN_LENGTH = 6;
|
const SUBSCRIBER_TOKEN_LENGTH = 6;
|
||||||
|
|
||||||
|
/** @var string|bool */
|
||||||
|
public $token;
|
||||||
|
|
||||||
function __construct() {
|
function __construct() {
|
||||||
parent::__construct();
|
parent::__construct();
|
||||||
|
|
||||||
|
@ -5,6 +5,11 @@ use MailPoet\Util\Helpers;
|
|||||||
|
|
||||||
if (!defined('ABSPATH')) exit;
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @property int $subscriber_id
|
||||||
|
* @property int $custom_field_id
|
||||||
|
* @property string $value
|
||||||
|
*/
|
||||||
class SubscriberCustomField extends Model {
|
class SubscriberCustomField extends Model {
|
||||||
public static $_table = MP_SUBSCRIBER_CUSTOM_FIELD_TABLE;
|
public static $_table = MP_SUBSCRIBER_CUSTOM_FIELD_TABLE;
|
||||||
|
|
||||||
|
@ -43,6 +43,10 @@ class ViewInBrowser {
|
|||||||
$this->_abort();
|
$this->_abort();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param \stdClass $data
|
||||||
|
* @return bool|\stdClass
|
||||||
|
*/
|
||||||
function _validateBrowserPreviewData($data) {
|
function _validateBrowserPreviewData($data) {
|
||||||
// either newsletter ID or hash must be defined, and newsletter must exist
|
// either newsletter ID or hash must be defined, and newsletter must exist
|
||||||
if (empty($data->newsletter_id) && empty($data->newsletter_hash)) return false;
|
if (empty($data->newsletter_id) && empty($data->newsletter_hash)) return false;
|
||||||
|
@ -8,6 +8,9 @@ use MailPoet\Newsletter\Shortcodes\Shortcodes;
|
|||||||
if (!defined('ABSPATH')) exit;
|
if (!defined('ABSPATH')) exit;
|
||||||
|
|
||||||
class Clicks {
|
class Clicks {
|
||||||
|
/**
|
||||||
|
* @param \stdClass $data
|
||||||
|
*/
|
||||||
function track($data) {
|
function track($data) {
|
||||||
if (!$data || empty($data->link)) {
|
if (!$data || empty($data->link)) {
|
||||||
return $this->abort();
|
return $this->abort();
|
||||||
|
@ -13,6 +13,9 @@ if (!defined('ABSPATH')) exit;
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* A facade class containing all necessary models to work with a sending queue
|
* A facade class containing all necessary models to work with a sending queue
|
||||||
|
* @property string $status
|
||||||
|
* @property int $task_id
|
||||||
|
* @property int $id
|
||||||
*/
|
*/
|
||||||
class Sending {
|
class Sending {
|
||||||
const TASK_TYPE = 'sending';
|
const TASK_TYPE = 'sending';
|
||||||
|
@ -62,6 +62,7 @@ class ConflictResolver {
|
|||||||
// unload all styles except from the list of allowed
|
// unload all styles except from the list of allowed
|
||||||
$dequeue_styles = function() use($_this) {
|
$dequeue_styles = function() use($_this) {
|
||||||
global $wp_styles;
|
global $wp_styles;
|
||||||
|
if (!isset($wp_styles->registered)) return;
|
||||||
if (empty($wp_styles->queue)) return;
|
if (empty($wp_styles->queue)) return;
|
||||||
foreach ($wp_styles->queue as $wp_style) {
|
foreach ($wp_styles->queue as $wp_style) {
|
||||||
if (empty($wp_styles->registered[$wp_style])) continue;
|
if (empty($wp_styles->registered[$wp_style])) continue;
|
||||||
|
@ -17,7 +17,7 @@ if (!function_exists('mb_convert_encoding')) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if (!function_exists('mb_strtoupper')) {
|
if (!function_exists('mb_strtoupper')) {
|
||||||
function mb_strtoupper($s, $encoding = null) {
|
function mb_strtoupper($s, $encoding = 'UTF-8') {
|
||||||
return MbstringPolyfill::mb_strtoupper($s, $encoding);
|
return MbstringPolyfill::mb_strtoupper($s, $encoding);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -41,9 +41,10 @@ class Engine
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string label used to call function
|
* @param string $label label used to call function
|
||||||
* @param Callable function with params (value, additional params as array)
|
* @param Callable $function function with params (value, additional params as array)
|
||||||
*/
|
* @throws \Exception
|
||||||
|
*/
|
||||||
public function addValidator($label, $function)
|
public function addValidator($label, $function)
|
||||||
{
|
{
|
||||||
if (isset($this->_checks[$label])) throw new \Exception();
|
if (isset($this->_checks[$label])) throw new \Exception();
|
||||||
|
@ -4,4 +4,5 @@ parameters:
|
|||||||
ignoreErrors:
|
ignoreErrors:
|
||||||
- '#Function members_register_.+ not found#'
|
- '#Function members_register_.+ not found#'
|
||||||
- '#MailPoet\\Premium\\DI\\ContainerConfigurator not found#' # this class is not available when premium is not active
|
- '#MailPoet\\Premium\\DI\\ContainerConfigurator not found#' # this class is not available when premium is not active
|
||||||
|
- '#Call to an undefined method IdiormResultSet::set()#'
|
||||||
reportUnmatchedIgnoredErrors: false
|
reportUnmatchedIgnoredErrors: false
|
||||||
|
Reference in New Issue
Block a user