Changeset 3433413
- Timestamp:
- 01/06/2026 09:39:11 AM (3 months ago)
- Location:
- mailjet-for-wordpress/trunk
- Files:
-
- 4 edited
-
README.md (modified) (1 diff)
-
readme.txt (modified) (1 diff)
-
src/includes/Mailjet.php (modified) (19 diffs)
-
wp-mailjet.php (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
mailjet-for-wordpress/trunk/README.md
r3396790 r3433413 3 3 - Contributors: Mailjet 4 4 - Tags: email, marketing, signup, newsletter, widget, smtp, woocommerce, contact form 7 5 - Requires at least: 4.46 - Tested up to: 6.8. 17 - Stable tag: 6.1. 65 - Requires at least: 5.6 6 - Tested up to: 6.8.3 7 - Stable tag: 6.1.7 8 8 - Requires PHP: 7.4 9 9 - License: GPLv2 or later -
mailjet-for-wordpress/trunk/readme.txt
r3396790 r3433413 3 3 - Contributors: Mailjet 4 4 - Tags: email, marketing, signup, newsletter, widget, smtp, woocommerce, contact form 7 5 - Requires at least: 4.46 - Tested up to: 6.8. 17 - Stable tag: 6.1. 65 - Requires at least: 5.6 6 - Tested up to: 6.8.3 7 - Stable tag: 6.1.7 8 8 - Requires PHP: 7.4 9 9 - License: GPLv2 or later -
mailjet-for-wordpress/trunk/src/includes/Mailjet.php
r3292624 r3433413 31 31 * @since 5.0.0 32 32 * @access protected 33 * @var Mailjet_Loader $loaderMaintains and registers all hooks for the plugin.33 * @var Mailjet_Loader $loader Maintains and registers all hooks for the plugin. 34 34 */ 35 35 protected $loader; … … 39 39 * @since 5.0.0 40 40 * @access protected 41 * @var string $plugin_nameThe string used to uniquely identify this plugin.41 * @var string $plugin_name The string used to uniquely identify this plugin. 42 42 */ 43 43 protected $plugin_name; … … 47 47 * @since 1.0.0 48 48 * @access protected 49 * @var string $versionThe current version of the plugin.49 * @var string $version The current version of the plugin. 50 50 */ 51 51 protected $version; 52 52 53 /** 53 54 * Define the core functionality of the plugin. … … 59 60 * @since 5.0.0 60 61 */ 61 public function __construct() { 62 public function __construct() 63 { 62 64 if (\defined('MAILJET_VERSION')) { 63 65 $this->version = MAILJET_VERSION; … … 75 77 $this->registerMailjetWidget(); 76 78 77 add_shortcode('mailjet_form_builder', array( $this, 'display_mailjet_form_builder_widget'));78 } 79 80 /** 81 * @param array $attr79 add_shortcode('mailjet_form_builder', array($this, 'display_mailjet_form_builder_widget')); 80 } 81 82 /** 83 * @param array $attr 82 84 * @param string $tag 83 85 * @return false|string 84 86 */ 85 public static function display_mailjet_form_builder_widget( array $attr = array(), string $tag = '' ) { 86 \extract(shortcode_atts(array( 'widget_id' => null ), $attr, $tag)); 87 public static function display_mailjet_form_builder_widget(array $attr = array(), string $tag = '') 88 { 89 \extract(shortcode_atts(array('widget_id' => null), $attr, $tag)); 87 90 // GET All Mailjet widgets - to find the one that user actually configured with the shortcode 88 91 $instance = self::getOption('mailjet_form_builder_widget_options'); … … 98 101 $widget_id = min($widgetIds); 99 102 } 100 if (isset($instance[ (int) $widget_id])) {103 if (isset($instance[(int)$widget_id])) { 101 104 ob_start(); 102 the_widget('MailjetWp\\MailjetPlugin\\WidgetFormBuilder\\WP_Mailjet_FormBuilder_Widget', $instance[ (int) $widget_id]);105 the_widget('MailjetWp\\MailjetPlugin\\WidgetFormBuilder\\WP_Mailjet_FormBuilder_Widget', $instance[(int)$widget_id]); 103 106 return ob_get_clean(); 104 107 } … … 123 126 * @access private 124 127 */ 125 private function load_dependencies() { 128 private function load_dependencies() 129 { 126 130 $this->loader = new MailjetLoader(); 127 131 } 132 128 133 /** 129 134 * Define the locale for this plugin for internationalization. … … 135 140 * @access private 136 141 */ 137 private function set_locale() { 142 private function set_locale() 143 { 138 144 $plugin_i18n = new Mailjeti18n(); 139 145 $this->loader->add_action('plugins_loaded', $plugin_i18n, 'load_plugin_textdomain'); 140 146 } 147 141 148 /** 142 149 * Register all of the hooks related to the admin area functionality … … 146 153 * @access private 147 154 */ 148 private function define_admin_hooks() { 155 private function define_admin_hooks() 156 { 149 157 $plugin_admin = new MailjetAdmin($this->get_plugin_name(), $this->get_version()); 150 158 $this->loader->add_action('admin_enqueue_scripts', $plugin_admin, 'enqueue_styles'); … … 164 172 * @access private 165 173 */ 166 private function define_public_hooks() { 174 private function define_public_hooks() 175 { 167 176 $plugin_public = new MailjetPublic($this->get_plugin_name(), $this->get_version()); 168 177 $this->loader->add_action('wp_enqueue_scripts', $plugin_public, 'enqueue_styles'); … … 173 182 * @return void 174 183 */ 175 private function addMailjetMenu(): void { 184 private function addMailjetMenu(): void 185 { 176 186 $plugin_menu = new MailjetMenu(); 177 187 $this->loader->add_action('admin_menu', $plugin_menu, 'display_menu'); … … 181 191 * @return void 182 192 */ 183 private function addMailjetSettings(): void { 193 private function addMailjetSettings(): void 194 { 184 195 $plugin_settings = new MailjetSettings(); 185 196 $this->loader->add_action('admin_init', $plugin_settings, 'mailjet_settings_admin_init'); … … 190 201 * @return void 191 202 */ 192 private function addMailjetPHPMailer(): void { 203 private function addMailjetPHPMailer(): void 204 { 193 205 $plugin_mails = new MailjetMail(); 194 206 $this->loader->add_action('phpmailer_init', $plugin_mails, 'phpmailer_init_smtp'); … … 199 211 * @return void 200 212 */ 201 private function registerMailjetWidget(): void { 213 private function registerMailjetWidget(): void 214 { 202 215 $this->loader->add_action('widgets_init', $this, 'wp_mailjet_register_widgets'); 203 216 } … … 206 219 * @return void 207 220 */ 208 public function wp_mailjet_register_widgets() { 221 public function wp_mailjet_register_widgets() 222 { 209 223 $widgetFormBuilder = 'MailjetWp\\MailjetPlugin\\WidgetFormBuilder\\WP_Mailjet_FormBuilder_Widget'; 210 224 register_widget($widgetFormBuilder); 211 225 } 226 212 227 /** 213 228 * Run the loader to execute all of the hooks with WordPress. … … 215 230 * @since 5.0.0 216 231 */ 217 public function run(): void { 232 public function run(): void 233 { 218 234 $this->loader->run(); 219 235 } 236 220 237 /** 221 238 * The name of the plugin used to uniquely identify it within the context of 222 239 * WordPress and to define internationalization functionality. 223 240 * 241 * @return string The name of the plugin. 224 242 * @since 1.0.0 225 * @return string The name of the plugin.226 */227 public function get_plugin_name(): string{243 */ 244 public function get_plugin_name(): string 245 { 228 246 return $this->plugin_name; 229 247 } 248 230 249 /** 231 250 * The reference to the class that orchestrates the hooks with the plugin. 232 251 * 252 * @return Mailjet_Loader Orchestrates the hooks of the plugin. 233 253 * @since 5.0.0 234 * @return Mailjet_Loader Orchestrates the hooks of the plugin.235 */236 public function get_loader(){254 */ 255 public function get_loader() 256 { 237 257 return $this->loader; 238 258 } 259 239 260 /** 240 261 * Retrieve the version number of the plugin. 241 262 * 263 * @return string The version number of the plugin. 242 264 * @since 5.0.0 243 * @return string The version number of the plugin.244 */245 public function get_version(): string{265 */ 266 public function get_version(): string 267 { 246 268 return $this->version; 247 269 } … … 250 272 * @return void 251 273 */ 252 private function addWoocommerceActions(): void { 274 private function addWoocommerceActions(): void 275 { 253 276 $wooCommerceSettings = WooCommerceSettings::getInstance(); 254 277 if (isset($_POST['action']) && $_POST['action'] === 'order_notification_settings_custom_hook') { … … 260 283 $this->loader->add_action('woocommerce_cheque_process_payment_order_status', $wooCommerceSettings, 'paid_by_cheque_order_edata_sync', 10, 2); 261 284 } 262 $activeActions = self::getOption('mailjet_wc_active_hooks');285 $activeActions = self::getOption('mailjet_wc_active_hooks'); 263 286 $abandonedCartActiveActions = self::getOption('mailjet_wc_abandoned_cart_active_hooks'); 264 if ($activeActions && ! empty($activeActions)) {287 if ($activeActions && !empty($activeActions)) { 265 288 foreach ($activeActions as $action) { 266 289 $this->loader->add_action($action['hook'], $wooCommerceSettings, $action['callable'], 10, 2); 267 290 } 268 291 } 269 if ($abandonedCartActiveActions && ! empty($abandonedCartActiveActions)) {292 if ($abandonedCartActiveActions && !empty($abandonedCartActiveActions)) { 270 293 foreach ($abandonedCartActiveActions as $action) { 271 294 $this->loader->add_action($action['hook'], $wooCommerceSettings, $action['callable'], 10, 2); … … 278 301 * @return mixed 279 302 */ 280 public static function getOption( string $key ) { 281 if ( ! is_multisite()) { 303 public static function getOption(string $key) 304 { 305 if (!is_multisite()) { 282 306 return get_option($key); 283 307 } -
mailjet-for-wordpress/trunk/wp-mailjet.php
r3396790 r3433413 15 15 * Plugin URI: https://www.mailjet.com/partners/wordpress/ 16 16 * Description: The Best WordPress Plugin For Email Newsletters. 17 * Version: 6.1. 618 * Tested up to: 6.8. 117 * Version: 6.1.7 18 * Tested up to: 6.8.3 19 19 * Author: Mailjet SAS 20 20 * Author URI: http://mailjet.com
Note: See TracChangeset
for help on using the changeset viewer.