PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 5.4
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v5.4
6.35 6.34 6.33.1 6.33 6.32.1 6.32 6.31 6.25 6.25.1 6.26 6.26.1 6.27 6.28 6.29 6.3 6.3.1 6.3.2 6.30 6.4 6.4.1 6.4.2 6.5 6.5.1 6.5.2 6.5.3 All 141 releases
← All changes | classes/controllers/FrmSMTPController.php +26 -44 6.275.4 View file →
@@ -43,16 +43,14 @@
43 43 /**
44 44 * Hooks.
45 45 *
46 46 * @since 4.04.04
47 - *
48 - * @return void
49 47 */
50 48 public static function load_hooks() {
49 +
51 50 add_filter( 'wp_mail_smtp_is_white_labeled', '__return_true' );
52 51
53 52 $self = new self();
54 -
55 53 if ( wp_doing_ajax() ) {
56 54 add_action( 'wp_ajax_frm_smtp_page_check_plugin_status', array( $self, 'ajax_check_plugin_status' ) );
57 55 }
58 56
@@ -72,16 +70,13 @@
72 70 }
73 71
74 72 /**
75 73 * Customize the upgrade link.
76 - *
77 - * @param string $link
78 - *
79 - * @return string
80 74 */
81 75 public function link( $link ) {
82 76 $new_link = 'formidableforms.com/go-wp-mail-smtp/?urllink=wpmailsmtp%2Ecom%2Flite%2Dupgrade&';
83 - return str_replace( 'wpmailsmtp.com/lite-upgrade/?', $new_link, $link );
77 + $link = str_replace( 'wpmailsmtp.com/lite-upgrade/?', $new_link, $link );
78 + return $link;
84 79 }
85 80
86 81 /**
87 82 * Don't nag people to install WPForms
@@ -86,17 +81,13 @@
86 81 /**
87 82 * Don't nag people to install WPForms
88 83 *
89 84 * @since 4.04.04
90 - *
91 - * @param array $upsell
92 - *
93 - * @return array
94 85 */
95 86 public static function remove_wpforms_nag( $upsell ) {
96 87 if ( is_array( $upsell ) ) {
97 88 foreach ( $upsell as $k => $plugin ) {
98 - if ( str_contains( $plugin['slug'], 'wpforms' ) ) {
89 + if ( strpos( $plugin['slug'], 'wpforms' ) !== false ) {
99 90 unset( $upsell[ $k ] );
100 91 }
101 92 }
102 93 }
@@ -105,10 +96,8 @@
105 96 }
106 97
107 98 /**
108 99 * SMTP submenu page.
109 - *
110 - * @return void
111 100 */
112 101 public function menu() {
113 102 add_submenu_page( 'formidable', __( 'SMTP', 'formidable' ) . ' | Formidable', __( 'SMTP', 'formidable' ), 'activate_plugins', $this->slug, array( $this, 'output' ) );
114 103 }
@@ -116,10 +105,8 @@
116 105 /**
117 106 * Generate and output page HTML.
118 107 *
119 108 * @since 4.04.04
120 - *
121 - * @return void
122 109 */
123 110 public function output() {
124 111 FrmAppHelper::include_svg();
125 112 $this->css();
@@ -137,10 +124,8 @@
137 124 /**
138 125 * Generate and output heading section HTML.
139 126 *
140 127 * @since 4.04.04
141 - *
142 - * @return void
143 128 */
144 129 protected function output_section_heading() {
145 130 $size = array(
146 131 'height' => 90,
@@ -164,9 +149,9 @@
164 149 $this->stmp_logo();
165 150 ?>
166 151 </div>
167 152 <h1><?php esc_html_e( 'Making Email Deliverability Easy for WordPress', 'formidable' ); ?></h1>
168 - <p><?php esc_html_e( 'WP Mail SMTP allows you to easily set up WordPress to use a trusted provider to reliably send emails, including form notifications.', 'formidable' ); ?></p><?php // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ?>
153 + <p><?php esc_html_e( 'WP Mail SMTP allows you to easily set up WordPress to use a trusted provider to reliably send emails, including form notifications.', 'formidable' ); ?></p>
169 154 </section>
170 155 <?php
171 156 }
172 157
@@ -173,12 +158,11 @@
173 158 /**
174 159 * Generate and output screenshot section HTML.
175 160 *
176 161 * @since 4.04.04
177 - *
178 - * @return void
179 162 */
180 163 protected function output_section_screenshot() {
164 +
181 165 printf(
182 166 '<section class="screenshot">
183 167 <div class="cont">
184 168 <img src="%1$s" alt="%2$s"/>
@@ -191,9 +175,9 @@
191 175 </ul>
192 176 </section>',
193 177 esc_url( FrmAppHelper::plugin_url() . '/images/smtp-screenshot-tnail.png' ),
194 178 esc_attr__( 'WP Mail SMTP screenshot', 'formidable' ),
195 - '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 492 492" width="14" height="14"><path d="M484 227L306 49a27 27 0 00-38 0l-16 16a27 27 0 000 38l104 105H27c-15 0-27 11-27 26v23c0 15 12 27 27 27h330L252 389a27 27 0 000 38l16 16a27 27 0 0038 0l178-178a27 27 0 000-38z" fill="#5bbfa5"/></svg> &nbsp;', // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
179 + '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 492 492" width="14" height="14"><path d="M484 227L306 49a27 27 0 00-38 0l-16 16a27 27 0 000 38l104 105H27c-15 0-27 11-27 26v23c0 15 12 27 27 27h330L252 389a27 27 0 000 38l16 16a27 27 0 0038 0l178-178a27 27 0 000-38z" fill="#5bbfa5"/></svg> &nbsp;',
196 180 esc_html__( 'Over 1,000,000 websites use WP Mail SMTP.', 'formidable' ),
197 181 esc_html__( 'Send emails authenticated via trusted parties.', 'formidable' ),
198 182 esc_html__( 'Transactional Mailers: Pepipost, SendinBlue, Mailgun, SendGrid, Amazon SES.', 'formidable' ),
199 183 esc_html__( 'Web Mailers: Gmail, G Suite, Office 365, Outlook.com.', 'formidable' )
@@ -203,15 +187,14 @@
203 187 /**
204 188 * Generate and output step 'Install' section HTML.
205 189 *
206 190 * @since 4.04.04
207 - *
208 - * @return void
209 191 */
210 192 protected function output_section_step_install() {
193 +
211 194 $step = $this->get_data_step_install();
212 195
213 - if ( ! $step ) {
196 + if ( empty( $step ) ) {
214 197 return;
215 198 }
216 199
217 200 $icon = FrmAppHelper::icon_by_class(
@@ -251,15 +234,14 @@
251 234 /**
252 235 * Generate and output step 'Setup' section HTML.
253 236 *
254 237 * @since 4.04.04
255 - *
256 - * @return void
257 238 */
258 239 protected function output_section_step_setup() {
240 +
259 241 $step = $this->get_data_step_setup();
260 242
261 - if ( ! $step ) {
243 + if ( empty( $step ) ) {
262 244 return;
263 245 }
264 246
265 247 $icon = FrmAppHelper::icon_by_class(
@@ -300,8 +282,9 @@
300 282 *
301 283 * @return array Step data.
302 284 */
303 285 protected function get_data_step_install() {
286 +
304 287 $lite_plugin = new FrmInstallPlugin( array( 'plugin_file' => $this->config['lite_plugin'] ) );
305 288 $pro_plugin = new FrmInstallPlugin( array( 'plugin_file' => $this->config['pro_plugin'] ) );
306 289
307 290 $this->output_data['plugin_installed'] = $lite_plugin->is_installed();
@@ -314,9 +297,8 @@
314 297 'button_action' => '',
315 298 );
316 299
317 300 $is_installed = $this->output_data['plugin_installed'] || $this->output_data['pro_plugin_installed'];
318 -
319 301 if ( ! $is_installed ) {
320 302 // Return the download url.
321 303 $step['button_text'] = __( 'Install WP Mail SMTP', 'formidable' );
322 304 $step['button_class'] = 'frm-install-addon';
@@ -330,11 +312,11 @@
330 312
331 313 $step['plugin'] = $this->output_data['pro_plugin_installed'] ? $this->config['pro_plugin'] : $this->config['lite_plugin'];
332 314
333 315 if ( $this->output_data['plugin_activated'] ) {
334 - $step['icon'] = 'frm_step_complete_icon';
335 - $step['button_text'] = __( 'WP Mail SMTP Installed & Activated', 'formidable' );
336 - $step['button_class'] = 'grey disabled';
316 + $step['icon'] = 'frm_step_complete_icon';
317 + $step['button_text'] = __( 'WP Mail SMTP Installed & Activated', 'formidable' );
318 + $step['button_class'] = 'grey disabled';
337 319 } else {
338 320 $step['button_text'] = __( 'Activate WP Mail SMTP', 'formidable' );
339 321 $step['button_class'] = 'frm-activate-addon';
340 322 $step['button_action'] = __( 'Activate', 'formidable' );
@@ -350,8 +332,9 @@
350 332 *
351 333 * @return array Step data.
352 334 */
353 335 protected function get_data_step_setup() {
336 +
354 337 $step = array();
355 338
356 339 $step['icon'] = 'frm_step2_icon';
357 340 $step['section_class'] = $this->output_data['plugin_activated'] ? '' : 'grey';
@@ -376,13 +359,15 @@
376 359 *
377 360 * @return bool True if some mailer is selected and configured properly.
378 361 */
379 362 protected function is_smtp_configured() {
363 +
380 364 if ( ! $this->is_smtp_activated() ) {
381 365 return false;
382 366 }
383 367
384 - $phpmailer = $this->get_phpmailer();
368 + $phpmailer = $this->get_phpmailer();
369 +
385 370 $mailer = WPMailSMTP\Options::init()->get( 'mail', 'mailer' );
386 371 $is_mailer_complete = wp_mail_smtp()->get_providers()->get_mailer( $mailer, $phpmailer )->is_mailer_complete();
387 372
388 373 return 'mail' !== $mailer && $is_mailer_complete;
@@ -398,14 +383,15 @@
398 383 protected function is_smtp_activated() {
399 384 return function_exists( 'wp_mail_smtp' ) && ( is_plugin_active( $this->config['lite_plugin'] ) || is_plugin_active( $this->config['pro_plugin'] ) );
400 385 }
401 386
387 +
402 388 /**
403 389 * Get $phpmailer instance.
404 390 *
405 391 * @since 4.04.04
406 392 *
407 - * @return PHPMailer|\WPMailSMTP\Providers\MailCatcherInterface Instance of PHPMailer.
393 + * @return PHPMailer Instance of PHPMailer.
408 394 */
409 395 protected function get_phpmailer() {
410 396 global $phpmailer;
411 397
@@ -424,10 +410,8 @@
424 410 /**
425 411 * Redirect to SMTP settings page if it is activated..
426 412 *
427 413 * @since 4.04.04
428 - *
429 - * @return void
430 414 */
431 415 public function redirect_to_smtp_settings() {
432 416 if ( $this->is_smtp_configured() ) {
433 417 wp_safe_redirect( admin_url( $this->config['smtp_settings'] ) );
@@ -434,24 +418,20 @@
434 418 exit;
435 419 }
436 420 }
437 421
438 - /**
439 - * @return void
440 - */
441 422 private function stmp_logo() {
442 423 ?>
443 - <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60" height="90" width="90"><defs><style>.cls-11,.cls-12{fill-rule:evenodd}.cls-4{fill:none}.cls-11{fill:#86a196}.cls-12{fill:#fff}</style></defs><path class="cls-4" d="M-6.3 0h60v60h-60z"/><path d="M16.7 8.1a15.4 15.4 0 00-8 10.2 23.5 23.5 0 1030 0 15.4 15.4 0 00-9.3-10.8 3.4 3.4 0 00-2.1-2.7A4.6 4.6 0 0018.4 3a24.4 24.4 0 00-1.7 5z" fill="#395360" fill-rule="evenodd"/><path fill="#fbaa6f" d="M18 26h12v14H18z"/><path d="M25.9 33.2l-.1-.1a1.4 1.4 0 111.6-2.3 1.9 1.9 0 00-1.2.8 1.9 1.9 0 00-.3 1.6zm-4.5 0a1.8 1.8 0 00-.4-1.6 2 2 0 00-1.2-.8 1.4 1.4 0 011.6 2.3zm7.2-3.2h.5l-1 4.8-2.2 6.5h-4.3l-3.2-5.4 1.1-3.2 2.1 2.7c.6.5 2.7.5 3.8-.6a26.2 26.2 0 003.2-4.8z" fill="#dc7f3c" fill-rule="evenodd"/><path d="M9.7 29H15v-9h-4a13 13 0 017.4-10q1.2-5 2.8-6.8l.1-.1.1-.1a2.3 2.3 0 011.1-.5 2.3 2.3 0 012.2 3.8 1.6 1.6 0 01-.4.3A15 15 0 0023 8a5 5 0 013-1.5 1.4 1.4 0 01.7.2 1.3 1.3 0 01.5 1.8 1.3 1.3 0 01-.6.6 13 13 0 0110.1 11l.1.8H33v8h4.8l1.8 13.4q-6.3 4-15.8 4T8 42.4zM25 38.4q3.8-6.4 3.8-7.6c0-2.2-3.2-4-4.8-4s-4.9 1.7-4.9 4q0 1.2 3.8 7.6a1.2 1.2 0 001 .6 1 1 0 001-.6z" fill="#bdcfc8" fill-rule="evenodd"/><path class="cls-4" d="M19 31h9.6L27 47.2h-6.4l-1.6-16z"/><path d="M39.8 48.8a20 20 0 01-32 0l.8-6a2.7 2.7 0 001 .1 2.8 2.8 0 002.8-2.4v1.2a2.8 2.8 0 005.6 0v1.6a2.9 2.9 0 005.7 0 2.8 2.8 0 005.7 0v-1.6a2.8 2.8 0 105.7 0v-1.2A2.8 2.8 0 0038 43a2.9 2.9 0 001-.2l.8 6z" fill="#809eb0" fill-rule="evenodd"/><path d="M8.3 44.6l.3-1.8a2.7 2.7 0 001 .2 2.8 2.8 0 002.8-2.5v1.2a2.8 2.8 0 005.7 0v1.7a2.9 2.9 0 005.6 0 2.8 2.8 0 005.7 0v-1.7a2.8 2.8 0 105.7 0v-1.2A2.8 2.8 0 0038 43a2.9 2.9 0 001-.2l.3 2a2.9 2.9 0 01-4.1-2.2v1.2a2.8 2.8 0 11-5.7 0v1.6a2.8 2.8 0 01-5.7 0 2.9 2.9 0 01-5.7 0v-1.7a2.8 2.8 0 01-5.7 0v-1.2A2.8 2.8 0 019.6 45a2.9 2.9 0 01-1.3-.3z" fill="#738e9e" fill-rule="evenodd"/><path class="cls-11" d="M37.8 22.4c-1-2.9-3-4.7-4.7-4.5-2.2.2-2.8 3.7-2.3 8s1.7 7.5 3.9 7.3 4-3.9 3.6-8c0 1.2-.5 2.3-1.3 2.4-1.2 0-1.5-1.2-1.6-2.9s-.2-3 1-3a1.5 1.5 0 011.4.7z"/><path class="cls-12" d="M37 21.8c-.6-1.3-1.5-2-2.4-1.9-1.5.1-1.9 2.6-1.6 5.5s1.2 5.1 2.7 5c1.1-.2 2-1.5 2.2-3.4a1.2 1.2 0 01-1 .6c-1 0-1.4-1.2-1.5-2.9s-.1-3 1-3a1.6 1.6 0 01.6 0z"/><path class="cls-11" d="M9.6 22.4c1-2.9 3-4.7 4.7-4.5 2.2.2 2.8 3.7 2.3 8s-1.7 7.5-3.9 7.3-4-3.9-3.7-8c.1 1.2.5 2.3 1.4 2.4 1.1 0 1.5-1.2 1.6-2.9s.1-3-1-3a1.5 1.5 0 00-1.4.7z"/><path class="cls-12" d="M10.4 21.8c.6-1.3 1.5-2 2.4-1.9 1.5.1 1.8 2.6 1.5 5.5s-1.1 5.1-2.6 5c-1.1-.2-2-1.5-2.2-3.4a1.2 1.2 0 00.9.6c1.1 0 1.4-1.2 1.6-2.9s.1-3-1-3a1.7 1.7 0 00-.7 0z"/><path d="M19 28.6a5.3 5.3 0 010-.7c0-2.4 1.2-5.2 4.9-5.2s4.8 2.8 4.8 5.2a4.4 4.4 0 010 1c-.9-1.3-2.4-2.1-4.9-2.1-2.4 0-3.9.7-4.8 1.8z" fill="#f4f8ff" fill-rule="evenodd"/><path class="cls-11" d="M26.5 9.2L23.3 9l4-1.2a1.4 1.4 0 01-.8 1.4zm-3.5-1l-1.3 1a16.8 16.8 0 002-3.8 6.6 6.6 0 00.3-2.7A2.4 2.4 0 0125.2 5a2.4 2.4 0 01-.7 1.5A15 15 0 0023 8.1z"/></svg><?php // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ?>
424 + <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 60 60" height="90" width="90"><defs><style>.cls-11,.cls-12{fill-rule:evenodd}.cls-4{fill:none}.cls-11{fill:#86a196}.cls-12{fill:#fff}</style></defs><path class="cls-4" d="M-6.3 0h60v60h-60z"/><path d="M16.7 8.1a15.4 15.4 0 00-8 10.2 23.5 23.5 0 1030 0 15.4 15.4 0 00-9.3-10.8 3.4 3.4 0 00-2.1-2.7A4.6 4.6 0 0018.4 3a24.4 24.4 0 00-1.7 5z" fill="#395360" fill-rule="evenodd"/><path fill="#fbaa6f" d="M18 26h12v14H18z"/><path d="M25.9 33.2l-.1-.1a1.4 1.4 0 111.6-2.3 1.9 1.9 0 00-1.2.8 1.9 1.9 0 00-.3 1.6zm-4.5 0a1.8 1.8 0 00-.4-1.6 2 2 0 00-1.2-.8 1.4 1.4 0 011.6 2.3zm7.2-3.2h.5l-1 4.8-2.2 6.5h-4.3l-3.2-5.4 1.1-3.2 2.1 2.7c.6.5 2.7.5 3.8-.6a26.2 26.2 0 003.2-4.8z" fill="#dc7f3c" fill-rule="evenodd"/><path d="M9.7 29H15v-9h-4a13 13 0 017.4-10q1.2-5 2.8-6.8l.1-.1.1-.1a2.3 2.3 0 011.1-.5 2.3 2.3 0 012.2 3.8 1.6 1.6 0 01-.4.3A15 15 0 0023 8a5 5 0 013-1.5 1.4 1.4 0 01.7.2 1.3 1.3 0 01.5 1.8 1.3 1.3 0 01-.6.6 13 13 0 0110.1 11l.1.8H33v8h4.8l1.8 13.4q-6.3 4-15.8 4T8 42.4zM25 38.4q3.8-6.4 3.8-7.6c0-2.2-3.2-4-4.8-4s-4.9 1.7-4.9 4q0 1.2 3.8 7.6a1.2 1.2 0 001 .6 1 1 0 001-.6z" fill="#bdcfc8" fill-rule="evenodd"/><path class="cls-4" d="M19 31h9.6L27 47.2h-6.4l-1.6-16z"/><path d="M39.8 48.8a20 20 0 01-32 0l.8-6a2.7 2.7 0 001 .1 2.8 2.8 0 002.8-2.4v1.2a2.8 2.8 0 005.6 0v1.6a2.9 2.9 0 005.7 0 2.8 2.8 0 005.7 0v-1.6a2.8 2.8 0 105.7 0v-1.2A2.8 2.8 0 0038 43a2.9 2.9 0 001-.2l.8 6z" fill="#809eb0" fill-rule="evenodd"/><path d="M8.3 44.6l.3-1.8a2.7 2.7 0 001 .2 2.8 2.8 0 002.8-2.5v1.2a2.8 2.8 0 005.7 0v1.7a2.9 2.9 0 005.6 0 2.8 2.8 0 005.7 0v-1.7a2.8 2.8 0 105.7 0v-1.2A2.8 2.8 0 0038 43a2.9 2.9 0 001-.2l.3 2a2.9 2.9 0 01-4.1-2.2v1.2a2.8 2.8 0 11-5.7 0v1.6a2.8 2.8 0 01-5.7 0 2.9 2.9 0 01-5.7 0v-1.7a2.8 2.8 0 01-5.7 0v-1.2A2.8 2.8 0 019.6 45a2.9 2.9 0 01-1.3-.3z" fill="#738e9e" fill-rule="evenodd"/><path class="cls-11" d="M37.8 22.4c-1-2.9-3-4.7-4.7-4.5-2.2.2-2.8 3.7-2.3 8s1.7 7.5 3.9 7.3 4-3.9 3.6-8c0 1.2-.5 2.3-1.3 2.4-1.2 0-1.5-1.2-1.6-2.9s-.2-3 1-3a1.5 1.5 0 011.4.7z"/><path class="cls-12" d="M37 21.8c-.6-1.3-1.5-2-2.4-1.9-1.5.1-1.9 2.6-1.6 5.5s1.2 5.1 2.7 5c1.1-.2 2-1.5 2.2-3.4a1.2 1.2 0 01-1 .6c-1 0-1.4-1.2-1.5-2.9s-.1-3 1-3a1.6 1.6 0 01.6 0z"/><path class="cls-11" d="M9.6 22.4c1-2.9 3-4.7 4.7-4.5 2.2.2 2.8 3.7 2.3 8s-1.7 7.5-3.9 7.3-4-3.9-3.7-8c.1 1.2.5 2.3 1.4 2.4 1.1 0 1.5-1.2 1.6-2.9s.1-3-1-3a1.5 1.5 0 00-1.4.7z"/><path class="cls-12" d="M10.4 21.8c.6-1.3 1.5-2 2.4-1.9 1.5.1 1.8 2.6 1.5 5.5s-1.1 5.1-2.6 5c-1.1-.2-2-1.5-2.2-3.4a1.2 1.2 0 00.9.6c1.1 0 1.4-1.2 1.6-2.9s.1-3-1-3a1.7 1.7 0 00-.7 0z"/><path d="M19 28.6a5.3 5.3 0 010-.7c0-2.4 1.2-5.2 4.9-5.2s4.8 2.8 4.8 5.2a4.4 4.4 0 010 1c-.9-1.3-2.4-2.1-4.9-2.1-2.4 0-3.9.7-4.8 1.8z" fill="#f4f8ff" fill-rule="evenodd"/><path class="cls-11" d="M26.5 9.2L23.3 9l4-1.2a1.4 1.4 0 01-.8 1.4zm-3.5-1l-1.3 1a16.8 16.8 0 002-3.8 6.6 6.6 0 00.3-2.7A2.4 2.4 0 0125.2 5a2.4 2.4 0 01-.7 1.5A15 15 0 0023 8.1z"/></svg>
444 425 <?php
445 426 }
446 427
447 - /**
448 - * @return void
449 - */
450 428 private function css() {
451 429 ?>
452 430 <style>
453 431 #frm-admin-smtp *, #frm-admin-smtp *::before, #frm-admin-smtpp *::after {
432 + -webkit-box-sizing: border-box;
433 + -moz-box-sizing: border-box;
454 434 box-sizing: border-box;
455 435 }
456 436 #frm-admin-smtp{
457 437 width: 700px;
@@ -510,8 +490,10 @@
510 490 border-radius: 3px;
511 491 }
512 492 #frm-admin-smtp .step,
513 493 #frm-admin-smtp .screenshot .cont {
494 + -webkit-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.05);
495 + -moz-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.05);
514 496 box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.05);
515 497 }
516 498 #frm-admin-smtp .step {
517 499 background-color: #F9F9F9;