diff --git a/languages/mailjet-for-wordpress-de_DE.po b/languages/mailjet-for-wordpress-de_DE.po index 2011c2f4..120e55c7 100644 --- a/languages/mailjet-for-wordpress-de_DE.po +++ b/languages/mailjet-for-wordpress-de_DE.po @@ -1578,10 +1578,10 @@ msgid "contactProperties0" msgstr "46827" msgid "propertyDataType0" -msgstr "0" +msgstr "1" msgid "EnglishLabel0" -msgstr "First Name" +msgstr "Set your name" msgid "FrenchLabel0" msgstr "" @@ -1596,13 +1596,13 @@ msgid "ItalianLabel0" msgstr "" msgid "contactProperties1" -msgstr "" +msgstr "67144" msgid "propertyDataType1" msgstr "0" msgid "EnglishLabel1" -msgstr "" +msgstr "Custom prop" msgid "FrenchLabel1" msgstr "" @@ -1617,13 +1617,13 @@ msgid "ItalianLabel1" msgstr "" msgid "contactProperties2" -msgstr "" +msgstr "46829" msgid "propertyDataType2" -msgstr "0" +msgstr "1" msgid "EnglishLabel2" -msgstr "" +msgstr "COUNTRY" msgid "FrenchLabel2" msgstr "" diff --git a/languages/mailjet-for-wordpress-en_US.po b/languages/mailjet-for-wordpress-en_US.po index 30b9c7f0..57306eb7 100644 --- a/languages/mailjet-for-wordpress-en_US.po +++ b/languages/mailjet-for-wordpress-en_US.po @@ -1113,19 +1113,19 @@ msgid "language_checkbox" msgstr "1" msgid "title" -msgstr "My custom form22" +msgstr "My custom form" msgid "list" -msgstr "21908" +msgstr "21933" msgid "language_mandatory_email" -msgstr "test@gmail.com" +msgstr "email here 1" msgid "language_mandatory_button" -msgstr "" +msgstr "Send" msgid "confirmation_email_message_input" -msgstr "test1" +msgstr "" msgid "subscription_confirmed_message_input" msgstr "" @@ -1137,22 +1137,22 @@ msgid "already_subscribed_message_input" msgstr "" msgid "invalid_data_format_message_input" -msgstr "sss" +msgstr "" msgid "generic_technical_error_message_input" -msgstr "ss" +msgstr "" msgid "email_subject" -msgstr "my subject" +msgstr "" msgid "email_content_title" -msgstr "please, please" +msgstr "" msgid "email_content_main_text" -msgstr "main tet" +msgstr "" msgid "email_content_confirm_button" -msgstr "hello moto" +msgstr "" msgid "email_content_after_button" msgstr "" @@ -1161,10 +1161,10 @@ msgid "contactProperties0" msgstr "46827" msgid "propertyDataType0" -msgstr "0" +msgstr "1" msgid "EnglishLabel0" -msgstr "First Name" +msgstr "Set your name" msgid "FrenchLabel0" msgstr "" @@ -1179,13 +1179,13 @@ msgid "ItalianLabel0" msgstr "" msgid "contactProperties1" -msgstr "" +msgstr "67144" msgid "propertyDataType1" msgstr "0" msgid "EnglishLabel1" -msgstr "" +msgstr "Custom prop" msgid "FrenchLabel1" msgstr "" @@ -1200,13 +1200,13 @@ msgid "ItalianLabel1" msgstr "" msgid "contactProperties2" -msgstr "" +msgstr "46829" msgid "propertyDataType2" -msgstr "0" +msgstr "1" msgid "EnglishLabel2" -msgstr "" +msgstr "COUNTRY" msgid "FrenchLabel2" msgstr "" diff --git a/languages/mailjet-for-wordpress-es_ES.po b/languages/mailjet-for-wordpress-es_ES.po index cd22d7de..6cda6eeb 100644 --- a/languages/mailjet-for-wordpress-es_ES.po +++ b/languages/mailjet-for-wordpress-es_ES.po @@ -1582,10 +1582,10 @@ msgid "contactProperties0" msgstr "46827" msgid "propertyDataType0" -msgstr "0" +msgstr "1" msgid "EnglishLabel0" -msgstr "First Name" +msgstr "Set your name" msgid "FrenchLabel0" msgstr "" @@ -1600,13 +1600,13 @@ msgid "ItalianLabel0" msgstr "" msgid "contactProperties1" -msgstr "" +msgstr "67144" msgid "propertyDataType1" msgstr "0" msgid "EnglishLabel1" -msgstr "" +msgstr "Custom prop" msgid "FrenchLabel1" msgstr "" @@ -1621,13 +1621,13 @@ msgid "ItalianLabel1" msgstr "" msgid "contactProperties2" -msgstr "" +msgstr "46829" msgid "propertyDataType2" -msgstr "0" +msgstr "1" msgid "EnglishLabel2" -msgstr "" +msgstr "COUNTRY" msgid "FrenchLabel2" msgstr "" diff --git a/languages/mailjet-for-wordpress-fr_FR.po b/languages/mailjet-for-wordpress-fr_FR.po index ad8dbb8b..59d34393 100644 --- a/languages/mailjet-for-wordpress-fr_FR.po +++ b/languages/mailjet-for-wordpress-fr_FR.po @@ -1596,10 +1596,10 @@ msgid "contactProperties0" msgstr "46827" msgid "propertyDataType0" -msgstr "0" +msgstr "1" msgid "EnglishLabel0" -msgstr "First Name" +msgstr "Set your name" msgid "FrenchLabel0" msgstr "" @@ -1614,13 +1614,13 @@ msgid "ItalianLabel0" msgstr "" msgid "contactProperties1" -msgstr "" +msgstr "67144" msgid "propertyDataType1" msgstr "0" msgid "EnglishLabel1" -msgstr "" +msgstr "Custom prop" msgid "FrenchLabel1" msgstr "" @@ -1635,13 +1635,13 @@ msgid "ItalianLabel1" msgstr "" msgid "contactProperties2" -msgstr "" +msgstr "46829" msgid "propertyDataType2" -msgstr "0" +msgstr "1" msgid "EnglishLabel2" -msgstr "" +msgstr "COUNTRY" msgid "FrenchLabel2" msgstr "" diff --git a/languages/mailjet-for-wordpress-it_IT.po b/languages/mailjet-for-wordpress-it_IT.po index 1f50dcbe..c850aa51 100644 --- a/languages/mailjet-for-wordpress-it_IT.po +++ b/languages/mailjet-for-wordpress-it_IT.po @@ -1570,10 +1570,10 @@ msgid "contactProperties0" msgstr "46827" msgid "propertyDataType0" -msgstr "0" +msgstr "1" msgid "EnglishLabel0" -msgstr "First Name" +msgstr "Set your name" msgid "FrenchLabel0" msgstr "" @@ -1588,13 +1588,13 @@ msgid "ItalianLabel0" msgstr "" msgid "contactProperties1" -msgstr "" +msgstr "67144" msgid "propertyDataType1" msgstr "0" msgid "EnglishLabel1" -msgstr "" +msgstr "Custom prop" msgid "FrenchLabel1" msgstr "" @@ -1609,13 +1609,13 @@ msgid "ItalianLabel1" msgstr "" msgid "contactProperties2" -msgstr "" +msgstr "46829" msgid "propertyDataType2" -msgstr "0" +msgstr "1" msgid "EnglishLabel2" -msgstr "" +msgstr "COUNTRY" msgid "FrenchLabel2" msgstr "" diff --git a/src/includes/SettingsPages/SubscriptionOptionsSettings.php b/src/includes/SettingsPages/SubscriptionOptionsSettings.php index 94ba5619..3bdc8369 100644 --- a/src/includes/SettingsPages/SubscriptionOptionsSettings.php +++ b/src/includes/SettingsPages/SubscriptionOptionsSettings.php @@ -358,7 +358,7 @@ public function mailjet_subscribe_confirmation_from_widget($subscription_email, $params['widget_id'] = $widgetId; } $params = http_build_query($params); - $subscriptionTemplate = apply_filters('mailjet_confirmation_email_filename', dirname(dirname(dirname(__FILE__))) . '/templates/confirm-subscription-email.php'); + $subscriptionTemplate = apply_filters('mailjet_confirmation_email_filename', dirname(__FILE__, 3) . '/templates/confirm-subscription-email.php'); $message = file_get_contents($subscriptionTemplate); $permalinkStructure = get_option('permalink_structure'); if (!$thankYouPageId) { @@ -378,7 +378,7 @@ public function mailjet_subscribe_confirmation_from_widget($subscription_email, ); $emailParams = apply_filters('mailjet_subscription_widget_email_params', $emailData); foreach ($emailParams as $key => $value) { - $message = \str_replace($key, $value, $message); + $message = str_replace($key, $value, $message); } add_filter('wp_mail_content_type', array($this, 'set_html_content_type')); return wp_mail($subscription_email, $email_subject, $message, array('From: ' . get_option('blogname') . ' <' . get_option('admin_email') . '>')); diff --git a/src/widget/WP_Mailjet_Subscribe_Widget.php b/src/widget/WP_Mailjet_Subscribe_Widget.php index a143aa44..67ad6f50 100644 --- a/src/widget/WP_Mailjet_Subscribe_Widget.php +++ b/src/widget/WP_Mailjet_Subscribe_Widget.php @@ -2,6 +2,7 @@ namespace MailjetWp\MailjetPlugin\Widget; +use DateTime; use Exception; use MailjetWp\MailjetPlugin\Includes\MailjetApi; use MailjetWp\MailjetPlugin\Includes\Mailjeti18n; @@ -14,8 +15,8 @@ */ class WP_Mailjet_Subscribe_Widget extends \WP_Widget { - const WIDGET_OPTIONS_NAME = 'mailjet_widget_options'; - const WIDGETS_OPTIONS_NAME = 'widget_wp_mailjet_subscribe_widget'; + public const WIDGET_OPTIONS_NAME = 'mailjet_widget_options'; + public const WIDGETS_OPTIONS_NAME = 'widget_wp_mailjet_subscribe_widget'; private $subscriptionOptionsSettings = null; protected $widget_slug = 'wp_mailjet_subscribe_widget'; private $propertyData = array(); @@ -46,7 +47,9 @@ public function __construct() add_action('wp_enqueue_scripts', array($this, 'register_widget_front_scripts')); add_action('wp_ajax_send_mailjet_subscription_form', array($this, 'sendSubscriptionEmail')); add_action('wp_ajax_nopriv_send_mailjet_subscription_form', array($this, 'sendSubscriptionEmail')); - $this->propertyData = get_site_transient('propertyData'); + if (!$this->propertyData) { + $this->initPropertyData(); + } // Subscribe user $this->activateConfirmSubscriptionUrl(); } @@ -64,12 +67,11 @@ public function get_widget_slug(): string } /** * Check if subscription form is submitted - * Send subscription email if need + * Send subscription email if you need * Used in an ajax call, wp_die() prevents server error for ajax calls */ - public function sendSubscriptionEmail() + public function sendSubscriptionEmail(): void { - file_put_contents(__DIR__ . '/test.txt', print_r($_POST, true)); $subscriptionOptionsSettings = $this->getSubscriptionOptionsSettings(); $instances = get_option(self::WIDGETS_OPTIONS_NAME); $locale = Mailjeti18n::getLocale(); @@ -78,16 +80,16 @@ public function sendSubscriptionEmail() wp_die(); } $widgetId = sanitize_text_field($_POST['widget_id']); - $widgetNumId = \sscanf($widgetId, 'wp_mailjet_subscribe_widget-%d')[0] ?? []; + $widgetNumId = sscanf($widgetId, 'wp_mailjet_subscribe_widget-%d')[0] ?? []; $instance = $instances[$widgetNumId] ?? get_option(self::WIDGET_OPTIONS_NAME); // Check if selected locale checkbox is not set if (!(isset($instance[$locale], $instance[$locale]['language_checkbox']) && $instance[$locale]['language_checkbox'])) { // Find other selected language locale - $selectedLocales = \array_filter($instance, function ($localeInstance) { + $selectedLocales = array_filter($instance, static function ($localeInstance) { return isset($localeInstance['language_checkbox']) && 1 === $localeInstance['language_checkbox']; }); if ($selectedLocales) { - $locale = \array_keys($selectedLocales)[0]; + $locale = array_keys($selectedLocales)[0]; } } $subscription_locale = $locale; @@ -105,17 +107,8 @@ public function sendSubscriptionEmail() echo Mailjeti18n::getTranslationsFromFile($locale, 'Invalid email'); wp_die(); } - // Additional properties - $this->propertyData = get_site_transient('propertyData'); - if (!$this->propertyData) { - $mailjetContactProperties = $this->getMailjetContactProperties(); - if (!empty($mailjetContactProperties) && \is_array($mailjetContactProperties)) { - foreach ($mailjetContactProperties as $mjContactProperty) { - $this->propertyData[$mjContactProperty['ID']] = array('Name' => $mjContactProperty['Name'], 'Datatype' => $mjContactProperty['Datatype']); - } - set_site_transient('propertyData', $this->propertyData, 43200); - } - } + $this->initPropertyData(); + $errors = []; // Check for the additional properties from the admin advanced settings for ($i = 0; $i < 5; $i++) { @@ -140,15 +133,15 @@ public function sendSubscriptionEmail() wp_die(); } $properties = isset($_POST['properties']) ? $_POST['properties'] : array(); - $isValueTypeIncorrect = \false; - if (!empty($properties) && \is_array($mailjetContactProperties) && !empty($mailjetContactProperties)) { + $isValueTypeIncorrect = false; + if (!empty($properties) && is_array($this->mailjetContactProperties) && !empty($this->mailjetContactProperties)) { foreach ($properties as $propertyId => $propertyValue) { $propertyValue = sanitize_text_field($propertyValue); if ($propertyValue === '') { continue; } - foreach ($mailjetContactProperties as $mailjetContactProperty) { - if ($propertyId === $mailjetContactProperty['ID']) { + foreach ($this->mailjetContactProperties as $mailjetContactProperty) { + if ((int)$propertyId === (int)$mailjetContactProperty['ID']) { $dataType = $mailjetContactProperty['Datatype']; switch ($dataType) { case 'str': @@ -156,24 +149,24 @@ public function sendSubscriptionEmail() break; case 'int': case 'float': - if (!\is_numeric($propertyValue)) { - $isValueTypeIncorrect = \true; + if (!is_numeric($propertyValue)) { + $isValueTypeIncorrect = true; } break; case 'datetime': - $datetime = \DateTime::createFromFormat("Y-m-d", $propertyValue); - $errors = \DateTime::getLastErrors(); - if (!$datetime instanceof \DateTime) { - $isValueTypeIncorrect = \true; + $datetime = DateTime::createFromFormat("Y-m-d", $propertyValue); + $errors = DateTime::getLastErrors(); + if (!$datetime instanceof DateTime) { + $isValueTypeIncorrect = true; } if (!empty($errors['warning_count'])) { - $isValueTypeIncorrect = \true; + $isValueTypeIncorrect = true; } break; case 'bool': - $booleans = array('on', '', 1, \true, \false, 0); - if (!\in_array($propertyValue, $booleans, \false)) { - $isValueTypeIncorrect = \true; + $booleans = array('on', '', 1, true, false, 0); + if (!in_array($propertyValue, $booleans, false)) { + $isValueTypeIncorrect = true; } break; } @@ -187,7 +180,12 @@ public function sendSubscriptionEmail() wp_die(); } } - $sendingResult = $subscriptionOptionsSettings->mailjet_subscribe_confirmation_from_widget($subscription_email, $instance, $subscription_locale, $widgetId); + $sendingResult = $subscriptionOptionsSettings->mailjet_subscribe_confirmation_from_widget( + $subscription_email, + $instance, + $subscription_locale, + $widgetId + ); if ($sendingResult) { echo !empty($instance[$locale]['confirmation_email_message_input']) ? $instance[$locale]['confirmation_email_message_input'] : Mailjeti18n::getTranslationsFromFile($locale, 'Subscription confirmation email sent. Please check your inbox and confirm your subscription.'); } else { @@ -195,24 +193,25 @@ public function sendSubscriptionEmail() } wp_die(); } + /** * Validate the confirmation link * Subscribe to mailjet list - * @param type $subscriptionOptionsSettings + * @return bool|void */ private function activateConfirmSubscriptionUrl() { $locale = Mailjeti18n::getLocale(); // Check if subscription email is confirmed if (empty($_GET['mj_sub_token'])) { - return \true; + return true; } if (!empty($_GET['subscription_locale'])) { $locale = sanitize_text_field($_GET['subscription_locale']); } $subscription_email = isset($_GET['subscription_email']) ? sanitize_email($_GET['subscription_email']) : ''; $list_id = isset($_GET['list_id']) ? sanitize_text_field($_GET['list_id']) : ''; - $widget_id = isset($_GET['widget_id']) ? sanitize_text_field($_GET['widget_id']) : \false; + $widget_id = isset($_GET['widget_id']) ? sanitize_text_field($_GET['widget_id']) : false; $thanks_id = isset($_GET['thanks_id']) ? sanitize_text_field($_GET['thanks_id']) : ''; if (!$subscription_email) { _e('Subscription email is missing', 'wordpress-for-mailjet'); @@ -223,8 +222,8 @@ private function activateConfirmSubscriptionUrl() if ($widget_id) { $params['widget_id'] = $widget_id; } - $params = \http_build_query($params); - if ($_GET['mj_sub_token'] !== \sha1($params . MailjetSettings::getCryptoHash())) { + $params = http_build_query($params); + if ($_GET['mj_sub_token'] !== sha1($params . MailjetSettings::getCryptoHash())) { // Invalid token _e('Invalid token', 'mailjet-for-wordpress'); die; @@ -236,18 +235,20 @@ private function activateConfirmSubscriptionUrl() die; } $dataProperties = array(); - $mailjetContactProperties = $this->getMailjetContactProperties(); - if (!empty($mailjetContactProperties)) { - foreach ($mailjetContactProperties as $property) { + if (!$this->mailjetContactProperties) { + $mailjetContactProperties = $this->getMailjetContactProperties(); + } + if (!empty($this->mailjetContactProperties)) { + foreach ($this->mailjetContactProperties as $property) { $propertyName = $property['Name']; if (!empty($properties[$property['ID']])) { $propertyValue = $properties[$property['ID']]; $dataType = $property['Datatype']; switch ($dataType) { case 'datetime': - $datetime = \DateTime::createFromFormat('Y-m-d', $propertyValue); - if ($datetime instanceof \DateTime) { - $dataProperties[$propertyName] = $datetime->format(\DateTime::RFC3339); + $datetime = DateTime::createFromFormat('Y-m-d', $propertyValue); + if ($datetime instanceof DateTime) { + $dataProperties[$propertyName] = $datetime->format(DateTime::RFC3339); } break; case 'int': @@ -257,11 +258,11 @@ private function activateConfirmSubscriptionUrl() $dataProperties[$propertyName] = (float) $propertyValue; break; case 'bool': - $positiveBooleans = array('true', '1', 'on', 1, \true); - if (\in_array($propertyValue, $positiveBooleans, \false)) { - $dataProperties[$propertyName] = \true; + $positiveBooleans = array('true', '1', 'on', 1, true); + if (in_array($propertyValue, $positiveBooleans, false)) { + $dataProperties[$propertyName] = true; } else { - $dataProperties[$propertyName] = \false; + $dataProperties[$propertyName] = false; } break; case 'str': @@ -292,7 +293,7 @@ private function activateConfirmSubscriptionUrl() $newsletterRegistration = Mailjeti18n::getTranslationsFromFile($locale, 'Newsletter Registration'); $congratsSubscribed = Mailjeti18n::getTranslationsFromFile($locale, 'Congratulations, you have successfully subscribed!'); wp_enqueue_style('ubuntu-google-font', 'http://fonts.googleapis.com/css?family=Ubuntu:300,400,500,700'); - $thankYouPageTemplate = apply_filters('mailjet_thank_you_page_template', plugin_dir_path(__FILE__) . 'templates' . \DIRECTORY_SEPARATOR . 'thankyou.php'); + $thankYouPageTemplate = apply_filters('mailjet_thank_you_page_template', plugin_dir_path(__FILE__) . 'templates' . DIRECTORY_SEPARATOR . 'thankyou.php'); include $thankYouPageTemplate; die; } @@ -308,12 +309,12 @@ private function activateConfirmSubscriptionUrl() */ public function widget($args, $instance) { - if (get_option(self::WIDGET_OPTIONS_NAME) === \false) { + if (get_option(self::WIDGET_OPTIONS_NAME) === false) { add_option(self::WIDGET_OPTIONS_NAME, $instance); } // Check if there is a cached output $cache = wp_cache_get($this->get_widget_slug(), 'widget'); - if (!\is_array($cache)) { + if (!is_array($cache)) { $cache = array(); } if (!isset($args['widget_id'])) { @@ -324,17 +325,17 @@ public function widget($args, $instance) } // Show front widget form // go on with your widget logic, put everything into a string and … - \extract($args, \EXTR_SKIP); - \ob_start(); + extract($args, EXTR_SKIP); + ob_start(); $front_widget_file = apply_filters('mailjet_widget_form_filename', plugin_dir_path(__FILE__) . 'views/widget.php'); include $front_widget_file; - $widget_string = \ob_get_clean(); + $widget_string = ob_get_clean(); $cache[$args['widget_id']] = $widget_string; wp_cache_set($this->get_widget_slug(), $cache, 'widget'); print $widget_string; } // Used in widget.php - private function getInputProperties($propType, $labelValue = '', $isHidden = \false, $isMandatory = \false) + private function getInputProperties($propType, $labelValue = '', $isHidden = false, $isMandatory = false) { $inputProperties = array(); switch ($propType) { @@ -385,14 +386,14 @@ public function update($new_instance, $old_instance) $languages = Mailjeti18n::getSupportedLocales(); $admin_locale = Mailjeti18n::getLocale(); $wp_version = get_bloginfo('version'); - if (\version_compare($wp_version, '4.4', '<')) { + if (version_compare($wp_version, '4.4', '<')) { foreach ($languages as $language => $locale) { // Do not save if language is active but there is no contact list chosen for it if (isset($new_instance[$locale . '[language_checkbox']) && $new_instance[$locale . '[list'] == "0") { continue; } // Initial - $instance[$locale]['language_checkbox'] = isset($new_instance[$locale . '[language_checkbox']) ? 1 : \false; + $instance[$locale]['language_checkbox'] = isset($new_instance[$locale . '[language_checkbox']) ? 1 : false; $instance[$locale]['title'] = isset($new_instance[$locale . '[title']) ? wp_strip_all_tags($new_instance[$locale . '[title']) : ''; $instance[$locale]['list'] = isset($new_instance[$locale . '[list']) ? wp_strip_all_tags($new_instance[$locale . '[list']) : ''; $customLanguages = Mailjeti18n::getSupportedLocales(); @@ -418,7 +419,7 @@ public function update($new_instance, $old_instance) continue; } // Initial - $instance[$locale]['language_checkbox'] = isset($new_instance[$locale]['language_checkbox']) ? 1 : \false; + $instance[$locale]['language_checkbox'] = isset($new_instance[$locale]['language_checkbox']) ? 1 : false; $instance[$locale]['title'] = isset($new_instance[$locale]['title']) ? wp_strip_all_tags($new_instance[$locale]['title']) : ''; $instance[$locale]['list'] = isset($new_instance[$locale]['list']) ? wp_strip_all_tags($new_instance[$locale]['list']) : ''; $customLanguages = Mailjeti18n::getSupportedLocales(); @@ -469,11 +470,11 @@ private function registerCustomLanguageTranslations() private function checkTransition($instance) { if (isset($instance['enableTaben']) && $instance['enableTaben'] == 'on') { - $contactProperties0name = isset($instance['metaPropertyName1en']) ? $instance['metaPropertyName1en'] : \false; + $contactProperties0name = isset($instance['metaPropertyName1en']) ? $instance['metaPropertyName1en'] : false; // -> contactProperties0 - $contactProperties1name = isset($instance['metaPropertyName2en']) ? $instance['metaPropertyName2en'] : \false; + $contactProperties1name = isset($instance['metaPropertyName2en']) ? $instance['metaPropertyName2en'] : false; // -> contactProperties1 - $contactProperties2name = isset($instance['metaPropertyName3en']) ? $instance['metaPropertyName3en'] : \false; + $contactProperties2name = isset($instance['metaPropertyName3en']) ? $instance['metaPropertyName3en'] : false; // -> contactProperties2 $property0Id = MailjetApi::getPropertyIdByName($contactProperties0name); $property1Id = MailjetApi::getPropertyIdByName($contactProperties1name); @@ -505,7 +506,7 @@ private function checkTransition($instance) $property1Es = isset($instance['metaProperty2es']) ? $instance['metaProperty2es'] : ''; $property2Es = isset($instance['metaProperty3es']) ? $instance['metaProperty3es'] : ''; $buttonТextЕs = isset($instance['button_textes']) ? $instance['button_textes'] : ''; - $data = array('en_US' => array('language_checkbox' => \true, 'title' => $titleEn, 'list' => $listEn, 'language_mandatory_email' => '', 'language_mandatory_button' => $buttonТextЕn, 'contactProperties0' => $property0Id, 'propertyDataType0' => '0', 'EnglishLabel0' => $property0En, 'FrenchLabel0' => $property0Fr, 'GermanLabel0' => $property0De, 'SpanishLabel0' => $property0Es, 'ItalianLabel0' => '', 'contactProperties1' => $property1Id, 'propertyDataType1' => '0', 'EnglishLabel1' => $property1En, 'FrenchLabel1' => $property1Fr, 'GermanLabel1' => $property1De, 'SpanishLabel1' => $property1Es, 'ItalianLabel1' => '', 'contactProperties2' => $property2Id, 'propertyDataType2' => '0', 'EnglishLabel2' => $property2En, 'FrenchLabel2' => $property2Fr, 'GermanLabel2' => $property2De, 'SpanishLabel2' => $property2Es, 'ItalianLabel2' => '', 'contactProperties3' => '', 'propertyDataType3' => '0', 'EnglishLabel3' => '', 'FrenchLabel3' => '', 'GermanLabel3' => '', 'SpanishLabel3' => '', 'ItalianLabel3' => '', 'contactProperties4' => '', 'propertyDataType4' => '0', 'EnglishLabel4' => '', 'FrenchLabel4' => '', 'GermanLabel4' => '', 'SpanishLabel4' => '', 'ItalianLabel4' => '', 'confirmation_email_message_input' => '', 'subscription_confirmed_message_input' => '', 'empty_email_message_input' => '', 'already_subscribed_message_input' => '', 'invalid_data_format_message_input' => '', 'generic_technical_error_message_input' => '', 'email_subject' => '', 'email_content_title' => '', 'email_content_main_text' => '', 'email_content_confirm_button' => '', 'email_content_after_button' => ''), 'English' => array('thank_you' => 0), 'fr_FR' => array('language_checkbox' => $enableFr, 'title' => $titleFr, 'list' => $listFr, 'language_mandatory_email' => '', 'language_mandatory_button' => $buttonТextFr, 'contactProperties0' => $property0Id, 'propertyDataType0' => '0', 'EnglishLabel0' => $property0En, 'FrenchLabel0' => $property0Fr, 'GermanLabel0' => $property0De, 'SpanishLabel0' => $property0Es, 'ItalianLabel0' => '', 'contactProperties1' => $property1Id, 'propertyDataType1' => '0', 'EnglishLabel1' => $property1En, 'FrenchLabel1' => $property1Fr, 'GermanLabel1' => $property1Fr, 'SpanishLabel1' => $property1Fr, 'ItalianLabel1' => '', 'contactProperties2' => $property2Id, 'propertyDataType2' => '0', 'EnglishLabel2' => $property2En, 'FrenchLabel2' => $property2Fr, 'GermanLabel2' => $property2De, 'SpanishLabel2' => $property2Es, 'ItalianLabel2' => '', 'contactProperties3' => '', 'propertyDataType3' => '', 'EnglishLabel3' => '', 'FrenchLabel3' => '', 'GermanLabel3' => '', 'SpanishLabel3' => '', 'ItalianLabel3' => '', 'contactProperties4' => '', 'propertyDataType4' => '', 'EnglishLabel4' => '', 'FrenchLabel4' => '', 'GermanLabel4' => '', 'SpanishLabel4' => '', 'ItalianLabel4' => '', 'confirmation_email_message_input' => '', 'subscription_confirmed_message_input' => '', 'empty_email_message_input' => '', 'already_subscribed_message_input' => '', 'invalid_data_format_message_input' => '', 'generic_technical_error_message_input' => '', 'email_subject' => '', 'email_content_title' => '', 'email_content_main_text' => '', 'email_content_confirm_button' => '', 'email_content_after_button' => ''), 'French' => array('thank_you' => 0), 'de_DE' => array('language_checkbox' => $enableDe, 'title' => $titleDe, 'list' => $listDe, 'language_mandatory_email' => '', 'language_mandatory_button' => $buttonТextDe, 'contactProperties0' => $property0Id, 'propertyDataType0' => '0', 'EnglishLabel0' => $property0En, 'FrenchLabel0' => $property0Fr, 'GermanLabel0' => $property0De, 'SpanishLabel0' => $property0Es, 'ItalianLabel0' => '', 'contactProperties1' => $property1Id, 'propertyDataType1' => '0', 'EnglishLabel1' => $property1En, 'FrenchLabel1' => $property1Fr, 'GermanLabel1' => $property1Fr, 'SpanishLabel1' => $property1Fr, 'ItalianLabel1' => '', 'contactProperties2' => $property2Id, 'propertyDataType2' => '0', 'EnglishLabel2' => $property2En, 'FrenchLabel2' => $property2Fr, 'GermanLabel2' => $property2De, 'SpanishLabel2' => $property2Es, 'ItalianLabel2' => '', 'contactProperties3' => '', 'propertyDataType3' => '', 'EnglishLabel3' => '', 'FrenchLabel3' => '', 'GermanLabel3' => '', 'SpanishLabel3' => '', 'ItalianLabel3' => '', 'contactProperties4' => '', 'propertyDataType4' => '', 'EnglishLabel4' => '', 'FrenchLabel4' => '', 'GermanLabel4' => '', 'SpanishLabel4' => '', 'ItalianLabel4' => '', 'confirmation_email_message_input' => '', 'subscription_confirmed_message_input' => '', 'empty_email_message_input' => '', 'already_subscribed_message_input' => '', 'invalid_data_format_message_input' => '', 'generic_technical_error_message_input' => '', 'email_subject' => '', 'email_content_title' => '', 'email_content_main_text' => '', 'email_content_confirm_button' => '', 'email_content_after_button' => ''), 'German' => array('thank_you' => 0), 'es_ES' => array('language_checkbox' => $enableEs, 'title' => $titleEs, 'list' => $listEs, 'language_mandatory_email' => '', 'language_mandatory_button' => $buttonТextЕs, 'contactProperties0' => $property0Id, 'propertyDataType0' => '0', 'EnglishLabel0' => $property0En, 'FrenchLabel0' => $property0Fr, 'GermanLabel0' => $property0De, 'SpanishLabel0' => $property0Es, 'ItalianLabel0' => '', 'contactProperties1' => $property1Id, 'propertyDataType1' => '0', 'EnglishLabel1' => $property1En, 'FrenchLabel1' => $property1Fr, 'GermanLabel1' => $property1Fr, 'SpanishLabel1' => $property1Fr, 'ItalianLabel1' => '', 'contactProperties2' => $property2Id, 'propertyDataType2' => '0', 'EnglishLabel2' => $property2En, 'FrenchLabel2' => $property2Fr, 'GermanLabel2' => $property2De, 'SpanishLabel2' => $property2Es, 'ItalianLabel2' => '', 'contactProperties3' => '', 'propertyDataType3' => '', 'EnglishLabel3' => '', 'FrenchLabel3' => '', 'GermanLabel3' => '', 'SpanishLabel3' => '', 'ItalianLabel3' => '', 'contactProperties4' => '', 'propertyDataType4' => '', 'EnglishLabel4' => '', 'FrenchLabel4' => '', 'GermanLabel4' => '', 'SpanishLabel4' => '', 'ItalianLabel4' => '', 'confirmation_email_message_input' => '', 'subscription_confirmed_message_input' => '', 'empty_email_message_input' => '', 'already_subscribed_message_input' => '', 'invalid_data_format_message_input' => '', 'generic_technical_error_message_input' => '', 'email_subject' => '', 'email_content_title' => '', 'email_content_main_text' => '', 'email_content_confirm_button' => '', 'email_content_after_button' => ''), 'Spanish' => array('thank_you' => 0), 'it_IT' => array('language_checkbox' => \false, 'title' => '', 'list' => '0', 'language_mandatory_email' => '', 'language_mandatory_button' => '', 'contactProperties0' => '', 'propertyDataType0' => '', 'EnglishLabel0' => '', 'FrenchLabel0' => '', 'GermanLabel0' => '', 'SpanishLabel0' => '', 'ItalianLabel0' => '', 'contactProperties1' => '', 'propertyDataType1' => '', 'EnglishLabel1' => '', 'FrenchLabel1' => '', 'GermanLabel1' => '', 'SpanishLabel1' => '', 'ItalianLabel1' => '', 'contactProperties2' => '', 'propertyDataType2' => '', 'EnglishLabel2' => '', 'FrenchLabel2' => '', 'GermanLabel2' => '', 'SpanishLabel2' => '', 'ItalianLabel2' => '', 'contactProperties3' => '', 'propertyDataType3' => '', 'EnglishLabel3' => '', 'FrenchLabel3' => '', 'GermanLabel3' => '', 'SpanishLabel3' => '', 'ItalianLabel3' => '', 'contactProperties4' => '', 'propertyDataType4' => '', 'EnglishLabel4' => '', 'FrenchLabel4' => '', 'GermanLabel4' => '', 'SpanishLabel4' => '', 'ItalianLabel4' => '', 'confirmation_email_message_input' => '', 'subscription_confirmed_message_input' => '', 'empty_email_message_input' => '', 'already_subscribed_message_input' => '', 'invalid_data_format_message_input' => '', 'generic_technical_error_message_input' => '', 'email_subject' => '', 'email_content_title' => '', 'email_content_main_text' => '', 'email_content_confirm_button' => '', 'email_content_after_button' => ''), 'Italian' => array('thank_you' => 0)); + $data = array('en_US' => array('language_checkbox' => true, 'title' => $titleEn, 'list' => $listEn, 'language_mandatory_email' => '', 'language_mandatory_button' => $buttonТextЕn, 'contactProperties0' => $property0Id, 'propertyDataType0' => '0', 'EnglishLabel0' => $property0En, 'FrenchLabel0' => $property0Fr, 'GermanLabel0' => $property0De, 'SpanishLabel0' => $property0Es, 'ItalianLabel0' => '', 'contactProperties1' => $property1Id, 'propertyDataType1' => '0', 'EnglishLabel1' => $property1En, 'FrenchLabel1' => $property1Fr, 'GermanLabel1' => $property1De, 'SpanishLabel1' => $property1Es, 'ItalianLabel1' => '', 'contactProperties2' => $property2Id, 'propertyDataType2' => '0', 'EnglishLabel2' => $property2En, 'FrenchLabel2' => $property2Fr, 'GermanLabel2' => $property2De, 'SpanishLabel2' => $property2Es, 'ItalianLabel2' => '', 'contactProperties3' => '', 'propertyDataType3' => '0', 'EnglishLabel3' => '', 'FrenchLabel3' => '', 'GermanLabel3' => '', 'SpanishLabel3' => '', 'ItalianLabel3' => '', 'contactProperties4' => '', 'propertyDataType4' => '0', 'EnglishLabel4' => '', 'FrenchLabel4' => '', 'GermanLabel4' => '', 'SpanishLabel4' => '', 'ItalianLabel4' => '', 'confirmation_email_message_input' => '', 'subscription_confirmed_message_input' => '', 'empty_email_message_input' => '', 'already_subscribed_message_input' => '', 'invalid_data_format_message_input' => '', 'generic_technical_error_message_input' => '', 'email_subject' => '', 'email_content_title' => '', 'email_content_main_text' => '', 'email_content_confirm_button' => '', 'email_content_after_button' => ''), 'English' => array('thank_you' => 0), 'fr_FR' => array('language_checkbox' => $enableFr, 'title' => $titleFr, 'list' => $listFr, 'language_mandatory_email' => '', 'language_mandatory_button' => $buttonТextFr, 'contactProperties0' => $property0Id, 'propertyDataType0' => '0', 'EnglishLabel0' => $property0En, 'FrenchLabel0' => $property0Fr, 'GermanLabel0' => $property0De, 'SpanishLabel0' => $property0Es, 'ItalianLabel0' => '', 'contactProperties1' => $property1Id, 'propertyDataType1' => '0', 'EnglishLabel1' => $property1En, 'FrenchLabel1' => $property1Fr, 'GermanLabel1' => $property1Fr, 'SpanishLabel1' => $property1Fr, 'ItalianLabel1' => '', 'contactProperties2' => $property2Id, 'propertyDataType2' => '0', 'EnglishLabel2' => $property2En, 'FrenchLabel2' => $property2Fr, 'GermanLabel2' => $property2De, 'SpanishLabel2' => $property2Es, 'ItalianLabel2' => '', 'contactProperties3' => '', 'propertyDataType3' => '', 'EnglishLabel3' => '', 'FrenchLabel3' => '', 'GermanLabel3' => '', 'SpanishLabel3' => '', 'ItalianLabel3' => '', 'contactProperties4' => '', 'propertyDataType4' => '', 'EnglishLabel4' => '', 'FrenchLabel4' => '', 'GermanLabel4' => '', 'SpanishLabel4' => '', 'ItalianLabel4' => '', 'confirmation_email_message_input' => '', 'subscription_confirmed_message_input' => '', 'empty_email_message_input' => '', 'already_subscribed_message_input' => '', 'invalid_data_format_message_input' => '', 'generic_technical_error_message_input' => '', 'email_subject' => '', 'email_content_title' => '', 'email_content_main_text' => '', 'email_content_confirm_button' => '', 'email_content_after_button' => ''), 'French' => array('thank_you' => 0), 'de_DE' => array('language_checkbox' => $enableDe, 'title' => $titleDe, 'list' => $listDe, 'language_mandatory_email' => '', 'language_mandatory_button' => $buttonТextDe, 'contactProperties0' => $property0Id, 'propertyDataType0' => '0', 'EnglishLabel0' => $property0En, 'FrenchLabel0' => $property0Fr, 'GermanLabel0' => $property0De, 'SpanishLabel0' => $property0Es, 'ItalianLabel0' => '', 'contactProperties1' => $property1Id, 'propertyDataType1' => '0', 'EnglishLabel1' => $property1En, 'FrenchLabel1' => $property1Fr, 'GermanLabel1' => $property1Fr, 'SpanishLabel1' => $property1Fr, 'ItalianLabel1' => '', 'contactProperties2' => $property2Id, 'propertyDataType2' => '0', 'EnglishLabel2' => $property2En, 'FrenchLabel2' => $property2Fr, 'GermanLabel2' => $property2De, 'SpanishLabel2' => $property2Es, 'ItalianLabel2' => '', 'contactProperties3' => '', 'propertyDataType3' => '', 'EnglishLabel3' => '', 'FrenchLabel3' => '', 'GermanLabel3' => '', 'SpanishLabel3' => '', 'ItalianLabel3' => '', 'contactProperties4' => '', 'propertyDataType4' => '', 'EnglishLabel4' => '', 'FrenchLabel4' => '', 'GermanLabel4' => '', 'SpanishLabel4' => '', 'ItalianLabel4' => '', 'confirmation_email_message_input' => '', 'subscription_confirmed_message_input' => '', 'empty_email_message_input' => '', 'already_subscribed_message_input' => '', 'invalid_data_format_message_input' => '', 'generic_technical_error_message_input' => '', 'email_subject' => '', 'email_content_title' => '', 'email_content_main_text' => '', 'email_content_confirm_button' => '', 'email_content_after_button' => ''), 'German' => array('thank_you' => 0), 'es_ES' => array('language_checkbox' => $enableEs, 'title' => $titleEs, 'list' => $listEs, 'language_mandatory_email' => '', 'language_mandatory_button' => $buttonТextЕs, 'contactProperties0' => $property0Id, 'propertyDataType0' => '0', 'EnglishLabel0' => $property0En, 'FrenchLabel0' => $property0Fr, 'GermanLabel0' => $property0De, 'SpanishLabel0' => $property0Es, 'ItalianLabel0' => '', 'contactProperties1' => $property1Id, 'propertyDataType1' => '0', 'EnglishLabel1' => $property1En, 'FrenchLabel1' => $property1Fr, 'GermanLabel1' => $property1Fr, 'SpanishLabel1' => $property1Fr, 'ItalianLabel1' => '', 'contactProperties2' => $property2Id, 'propertyDataType2' => '0', 'EnglishLabel2' => $property2En, 'FrenchLabel2' => $property2Fr, 'GermanLabel2' => $property2De, 'SpanishLabel2' => $property2Es, 'ItalianLabel2' => '', 'contactProperties3' => '', 'propertyDataType3' => '', 'EnglishLabel3' => '', 'FrenchLabel3' => '', 'GermanLabel3' => '', 'SpanishLabel3' => '', 'ItalianLabel3' => '', 'contactProperties4' => '', 'propertyDataType4' => '', 'EnglishLabel4' => '', 'FrenchLabel4' => '', 'GermanLabel4' => '', 'SpanishLabel4' => '', 'ItalianLabel4' => '', 'confirmation_email_message_input' => '', 'subscription_confirmed_message_input' => '', 'empty_email_message_input' => '', 'already_subscribed_message_input' => '', 'invalid_data_format_message_input' => '', 'generic_technical_error_message_input' => '', 'email_subject' => '', 'email_content_title' => '', 'email_content_main_text' => '', 'email_content_confirm_button' => '', 'email_content_after_button' => ''), 'Spanish' => array('thank_you' => 0), 'it_IT' => array('language_checkbox' => false, 'title' => '', 'list' => '0', 'language_mandatory_email' => '', 'language_mandatory_button' => '', 'contactProperties0' => '', 'propertyDataType0' => '', 'EnglishLabel0' => '', 'FrenchLabel0' => '', 'GermanLabel0' => '', 'SpanishLabel0' => '', 'ItalianLabel0' => '', 'contactProperties1' => '', 'propertyDataType1' => '', 'EnglishLabel1' => '', 'FrenchLabel1' => '', 'GermanLabel1' => '', 'SpanishLabel1' => '', 'ItalianLabel1' => '', 'contactProperties2' => '', 'propertyDataType2' => '', 'EnglishLabel2' => '', 'FrenchLabel2' => '', 'GermanLabel2' => '', 'SpanishLabel2' => '', 'ItalianLabel2' => '', 'contactProperties3' => '', 'propertyDataType3' => '', 'EnglishLabel3' => '', 'FrenchLabel3' => '', 'GermanLabel3' => '', 'SpanishLabel3' => '', 'ItalianLabel3' => '', 'contactProperties4' => '', 'propertyDataType4' => '', 'EnglishLabel4' => '', 'FrenchLabel4' => '', 'GermanLabel4' => '', 'SpanishLabel4' => '', 'ItalianLabel4' => '', 'confirmation_email_message_input' => '', 'subscription_confirmed_message_input' => '', 'empty_email_message_input' => '', 'already_subscribed_message_input' => '', 'invalid_data_format_message_input' => '', 'generic_technical_error_message_input' => '', 'email_subject' => '', 'email_content_title' => '', 'email_content_main_text' => '', 'email_content_confirm_button' => '', 'email_content_after_button' => ''), 'Italian' => array('thank_you' => 0)); update_option('widget_wp_mailjet_subscribe_widget', $data); $instance = get_option('widget_wp_mailjet_subscribe_widget'); } @@ -521,9 +522,9 @@ public function form($instance) wp_enqueue_style($this->get_widget_slug() . '-widget-styles', plugins_url('css/widget.css', __FILE__), array(), MAILJET_VERSION, 'all'); wp_enqueue_script($this->get_widget_slug() . '-script'); $validApiCredentials = MailjetApi::isValidAPICredentials(); - if ($validApiCredentials === \false) { - include plugin_dir_path(__FILE__) . 'views' . \DIRECTORY_SEPARATOR . 'designforfailure.php'; - return \false; + if ($validApiCredentials === false) { + include plugin_dir_path(__FILE__) . 'views' . DIRECTORY_SEPARATOR . 'designforfailure.php'; + return false; } $instance = $this->checkTransition($instance); // Define default values for your variables @@ -531,9 +532,9 @@ public function form($instance) // Mailjet contact lists try { $mailjetContactLists = MailjetApi::getMailjetContactLists(); - } catch (\Exception $ex) { - include plugin_dir_path(__FILE__) . 'views' . \DIRECTORY_SEPARATOR . 'designforfailure.php'; - return \false; + } catch (Exception $ex) { + include plugin_dir_path(__FILE__) . 'views' . DIRECTORY_SEPARATOR . 'designforfailure.php'; + return false; } $contactLists = !empty($mailjetContactLists) ? $mailjetContactLists : array(); $mailjetContactProperties = $this->getMailjetContactProperties(); @@ -544,7 +545,7 @@ public function form($instance) } } // Mailjet is down (widget can't be configured so show an error instead of form) - if ($mailjetContactLists === \false && $mailjetContactProperties === \false) { + if ($mailjetContactLists === false && $mailjetContactProperties === false) { $isMailjetDown = 'No connection with Mailjet.Please try a bit later.'; } $mailjetContactProperties = $propertiesOptions; @@ -552,7 +553,7 @@ public function form($instance) // Display the admin form $languages = Mailjeti18n::getSupportedLocales(); $pages = get_pages(); - include plugin_dir_path(__FILE__) . 'views' . \DIRECTORY_SEPARATOR . 'admin.php'; + include plugin_dir_path(__FILE__) . 'views' . DIRECTORY_SEPARATOR . 'admin.php'; } /* -------------------------------------------------- */ /* Public Functions @@ -562,8 +563,8 @@ public function form($instance) */ public function widget_textdomain() { - load_plugin_textdomain('mailjet-for-wordpress', \false, \dirname(\dirname(\dirname(plugin_basename(__FILE__)))) . '/languages/'); - MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ \'mailjet\' text domain loaded ] - ' . \dirname(\dirname(\dirname(plugin_basename(__FILE__)))) . '/languages/'); + load_plugin_textdomain('mailjet-for-wordpress', false, dirname(plugin_basename(__FILE__), 3) . '/languages/'); + MailjetLogger::info('[ Mailjet ] [ ' . __METHOD__ . ' ] [ Line #' . __LINE__ . ' ] [ mailjet text domain loaded ] - ' . dirname(plugin_basename(__FILE__), 3) . '/languages/'); } // end widget_textdomain public function register_widget_front_styles() @@ -584,15 +585,19 @@ public function register_widget_scripts() public function register_widget_front_scripts() { wp_enqueue_script('jquery'); - wp_register_script($this->get_widget_slug() . '-front-script', plugins_url('js/front-widget.js', __FILE__), array('jquery'), \false, \true); + wp_register_script($this->get_widget_slug() . '-front-script', plugins_url('js/front-widget.js', __FILE__), array('jquery'), false, true); wp_localize_script($this->get_widget_slug() . '-front-script', 'mjWidget', array('ajax_url' => admin_url('admin-ajax.php'))); wp_enqueue_script($this->get_widget_slug() . '-front-script'); wp_enqueue_style($this->get_widget_slug() . '-widget-front-styles', plugins_url('css/front-widget.css', __FILE__)); } // end register_widget_scripts + + /** + * @return array|false + */ private function getMailjetContactProperties() { - if ($this->mailjetContactProperties == null) { + if ($this->mailjetContactProperties === null) { try { $this->mailjetContactProperties = MailjetApi::getContactProperties(); } catch (Exception $ex) { @@ -601,9 +606,13 @@ private function getMailjetContactProperties() } return $this->mailjetContactProperties; } + + /** + * @return SubscriptionOptionsSettings|null + */ private function getSubscriptionOptionsSettings() { - if ($this->subscriptionOptionsSettings == null) { + if ($this->subscriptionOptionsSettings === null) { return SubscriptionOptionsSettings::getInstance(); } return $this->subscriptionOptionsSettings; @@ -613,7 +622,7 @@ function wp_ajax_mailjet_add_contact_property() if (!empty($_POST['propertyName'])) { $type = !empty($_POST['propertyType']) ? sanitize_text_field($_POST['propertyType']) : 'str'; $propertyName = sanitize_text_field($_POST['propertyName']); - echo \json_encode(MailjetApi::createMailjetContactProperty($propertyName, $type)); + echo json_encode(MailjetApi::createMailjetContactProperty($propertyName, $type)); } die; } @@ -639,4 +648,22 @@ private function getUpdateArrayKeysPairs() ]; return $result; } + + /** + * @return void + */ + public function initPropertyData(): void + { + if (!$this->propertyData) { + $this->mailjetContactProperties = $this->getMailjetContactProperties(); + if (!empty($this->mailjetContactProperties) && is_array($this->mailjetContactProperties)) { + foreach ($this->mailjetContactProperties as $mjContactProperty) { + $this->propertyData[$mjContactProperty['ID']] = [ + 'Name' => $mjContactProperty['Name'], + 'Datatype' => $mjContactProperty['Datatype'] + ]; + } + } + } + } } diff --git a/src/widget/views/admin.php b/src/widget/views/admin.php index 09b34bb0..47aca0c5 100644 --- a/src/widget/views/admin.php +++ b/src/widget/views/admin.php @@ -784,14 +784,14 @@ -
+*/?> + --> diff --git a/src/widget/views/widget.php b/src/widget/views/widget.php index 2cc0f9ff..d7e7e71f 100644 --- a/src/widget/views/widget.php +++ b/src/widget/views/widget.php @@ -53,15 +53,13 @@ ?>"> - propertyData[$contactPropertyId])) { continue;