PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.0
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.0
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/models/FrmSolution.php +64 -209 6.276.0 View file →
@@ -3,10 +3,8 @@
3 3 * Handles the installation of a solution and any dependencies.
4 4 * This page is shown when a Formidable plugin is activated.
5 5 *
6 6 * @since 4.06.02
7 - *
8 - * @package Formidable
9 7 */
10 8
11 9 if ( ! defined( 'ABSPATH' ) ) {
12 10 die( 'You are not allowed to call this page directly.' );
@@ -13,16 +11,10 @@
13 11 }
14 12
15 13 class FrmSolution {
16 14
17 - /**
18 - * @var string
19 - */
20 15 protected $plugin_slug = '';
21 16
22 - /**
23 - * @var string
24 - */
25 17 protected $plugin_file = '';
26 18
27 19 /**
28 20 * Hidden welcome page slug.
@@ -27,21 +19,13 @@
27 19 /**
28 20 * Hidden welcome page slug.
29 21 *
30 22 * @since 4.06.02
31 - *
32 - * @var string
33 23 */
34 24 protected $page = '';
35 25
36 - /**
37 - * @var string
38 - */
39 - protected $icon = 'frmfont frm_settings_icon';
26 + protected $icon = 'frm_icon_font frm_settings_icon';
40 27
41 - /**
42 - * @param array $atts
43 - */
44 28 public function __construct( $atts = array() ) {
45 29 if ( empty( $this->plugin_slug ) ) {
46 30 return;
47 31 }
@@ -57,10 +41,8 @@
57 41 /**
58 42 * Register all WP hooks.
59 43 *
60 44 * @since 4.06.02
61 - *
62 - * @return void
63 45 */
64 46 public function load_hooks() {
65 47 // If user is in admin ajax or doing cron, return.
66 48 if ( wp_doing_cron() ) {
@@ -82,13 +64,8 @@
82 64 add_action( 'admin_menu', array( $this, 'register' ) );
83 65 add_action( 'admin_head', array( $this, 'hide_menu' ) );
84 66 }
85 67
86 - /**
87 - * @param array $links
88 - *
89 - * @return array
90 - */
91 68 public function plugin_links( $links ) {
92 69 if ( ! $this->is_complete() ) {
93 70 $settings = '<a href="' . esc_url( $this->settings_link() ) . '">' . __( 'Setup', 'formidable' ) . '</a>';
94 71 array_unshift( $links, $settings );
@@ -103,12 +80,11 @@
103 80 * These pages will be removed from the Dashboard menu, so they will
104 81 * not actually show. Sneaky, sneaky.
105 82 *
106 83 * @since 4.06.02
107 - *
108 - * @return void
109 84 */
110 85 public function register() {
86 +
111 87 // Getting started - shows after installation.
112 88 add_dashboard_page(
113 89 esc_html( $this->page_title() ),
114 90 esc_html( $this->page_title() ),
@@ -123,34 +99,21 @@
123 99 *
124 100 * This means the pages are still available to us, but hidden.
125 101 *
126 102 * @since 4.06.02
127 - *
128 - * @return void
129 103 */
130 104 public function hide_menu() {
131 105 remove_submenu_page( 'index.php', $this->page );
132 106 }
133 107
134 - /**
135 - * @return string
136 - *
137 - * @psalm-return ''
138 - */
139 108 protected function plugin_name() {
140 109 return '';
141 110 }
142 111
143 - /**
144 - * @return string
145 - */
146 112 protected function page_title() {
147 113 return __( 'Welcome to Formidable Forms', 'formidable' );
148 114 }
149 115
150 - /**
151 - * @return string
152 - */
153 116 protected function page_description() {
154 117 return __( 'Follow the steps below to get started.', 'formidable' );
155 118 }
156 119
@@ -160,14 +123,12 @@
160 123 * This function checks if a new install or update has just occurred. If so,
161 124 * then we redirect the user to the appropriate page.
162 125 *
163 126 * @since 4.06.02
164 - *
165 - * @return void
166 127 */
167 128 public function redirect() {
129 +
168 130 $current_page = FrmAppHelper::simple_get( 'page', 'sanitize_title' );
169 -
170 131 if ( $current_page === $this->page ) {
171 132 // Prevent endless loop.
172 133 return;
173 134 }
@@ -181,9 +142,9 @@
181 142 if ( ! $this->is_current_plugin() ) {
182 143 return;
183 144 }
184 145
185 - delete_transient( FrmOnboardingWizardController::TRANSIENT_NAME );
146 + delete_transient( 'frm_activation_redirect' );
186 147
187 148 // Initial install.
188 149 wp_safe_redirect( $this->settings_link() );
189 150 exit;
@@ -188,21 +149,14 @@
188 149 wp_safe_redirect( $this->settings_link() );
189 150 exit;
190 151 }
191 152
192 - /**
193 - * @return string
194 - */
195 153 protected function settings_link() {
196 154 return admin_url( 'index.php?page=' . $this->page );
197 155 }
198 156
199 - /**
157 + /*
200 158 * Add page to global settings.
201 - *
202 - * @param array $sections Sections.
203 - *
204 - * @return array
205 159 */
206 160 public function add_settings( $sections ) {
207 161 wp_enqueue_style( 'formidable-pro-fields' );
208 162 $sections[ $this->plugin_slug ] = array(
@@ -217,14 +171,10 @@
217 171
218 172 /*
219 173 * Output for global settings.
220 174 */
221 - /**
222 - * @return void
223 - */
224 175 public function settings_page() {
225 176 $steps = $this->get_steps_data();
226 -
227 177 if ( ! $steps['license']['complete'] || ( isset( $steps['plugin'] ) && ! $steps['plugin']['complete'] ) ) {
228 178 // Redirect to the welcome page if install hasn't been done.
229 179 $url = $this->settings_link();
230 180 echo '<script>window.location.replace("' . esc_url_raw( $url ) . '");</script>';
@@ -230,9 +180,10 @@
230 180 echo '<script>window.location.replace("' . esc_url_raw( $url ) . '");</script>';
231 181 return;
232 182 }
233 183
234 - $all_imported = $this->is_complete( 'all' );
184 + $all_imported = $this->is_complete( 'all' );
185 +
235 186 $step = $steps['import'];
236 187 $step['label'] = '';
237 188 $step['nested'] = true;
238 189
@@ -239,12 +190,11 @@
239 190 if ( $steps['complete']['current'] ) {
240 191 // Always show this step in settings.
241 192 $step['current'] = true;
242 193
243 - $new_class = $all_imported ? ' button frm_hidden' : '';
194 + $new_class = $all_imported ? ' button frm_hidden' : '';
244 195 $step['button_class'] = str_replace( 'frm_grey disabled', $new_class, $step['button_class'] );
245 196 }
246 -
247 197 if ( $all_imported ) {
248 198 $step['description'] = __( 'The following form(s) have been created.', 'formidable' );
249 199 }
250 200 $this->show_app_install( $step );
@@ -249,10 +199,10 @@
249 199 }
250 200 $this->show_app_install( $step );
251 201
252 202 if ( ! $all_imported ) {
253 - $step = $steps['complete'];
254 - $step['current'] = false;
203 + $step = $steps['complete'];
204 + $step['current'] = false;
255 205 $step['button_class'] .= ' frm_grey disabled';
256 206 $this->show_page_links( $step );
257 207 }
258 208 }
@@ -258,10 +208,8 @@
258 208 }
259 209
260 210 /**
261 211 * Getting Started screen. Shows after first install.
262 - *
263 - * @return void
264 212 */
265 213 public function output() {
266 214 FrmAppHelper::include_svg();
267 215 $this->css();
@@ -276,10 +224,8 @@
276 224 }
277 225
278 226 /**
279 227 * Heading section.
280 - *
281 - * @return void
282 228 */
283 229 protected function header() {
284 230 $size = array(
285 231 'height' => 90,
@@ -315,15 +261,12 @@
315 261
316 262 /**
317 263 * This is the welcome page content.
318 264 * Override me to insert different content.
319 - *
320 - * @return void
321 265 */
322 266 protected function main_content() {
323 267 $steps = $this->get_steps_data();
324 268 $this->license_box( $steps['license'] );
325 -
326 269 if ( isset( $steps['plugin'] ) ) {
327 270 $this->show_plugin_install( $steps['plugin'] );
328 271 }
329 272 $this->show_app_install( $steps['import'] );
@@ -329,44 +272,41 @@
329 272 $this->show_app_install( $steps['import'] );
330 273 $this->show_page_links( $steps['complete'] );
331 274 }
332 275
333 - /**
334 - * @return array
335 - */
336 276 protected function get_steps_data() {
337 277 $pro_installed = FrmAppHelper::pro_is_connected();
338 278
339 279 $steps = array(
340 - 'license' => array(
341 - 'label' => __( 'Connect to FormidableForms.com', 'formidable' ),
342 - 'description' => __( 'Create a connection to get plugin downloads.', 'formidable' ),
343 - 'button_label' => __( 'Connect an Account', 'formidable' ),
344 - 'current' => empty( $pro_installed ),
345 - 'complete' => $pro_installed,
346 - 'num' => 1,
280 + 'license' => array(
281 + 'label' => __( 'Connect to FormidableForms.com', 'formidable' ),
282 + 'description' => __( 'Create a connection to get plugin downloads.', 'formidable' ),
283 + 'button_label' => __( 'Connect an Account', 'formidable' ),
284 + 'current' => empty( $pro_installed ),
285 + 'complete' => $pro_installed,
286 + 'num' => 1,
347 287 ),
348 - 'plugin' => array(
349 - 'label' => __( 'Install and Activate Add-Ons', 'formidable' ),
350 - 'description' => __( 'Install any required add-ons from FormidableForms.com.', 'formidable' ),
351 - 'button_label' => __( 'Install & Activate', 'formidable' ),
352 - 'current' => false,
353 - 'complete' => false,
354 - 'num' => 2,
288 + 'plugin' => array(
289 + 'label' => __( 'Install and Activate Add-Ons', 'formidable' ),
290 + 'description' => __( 'Install any required add-ons from FormidableForms.com.', 'formidable' ),
291 + 'button_label' => __( 'Install & Activate', 'formidable' ),
292 + 'current' => false,
293 + 'complete' => false,
294 + 'num' => 2,
355 295 ),
356 - 'import' => array(
357 - 'label' => __( 'Setup Forms, Views, and Pages', 'formidable' ),
358 - 'description' => __( 'Build the forms, views, and pages automatically.', 'formidable' ),
359 - 'button_label' => __( 'Create Now', 'formidable' ),
360 - 'complete' => $this->is_complete(),
361 - 'num' => 3,
296 + 'import' => array(
297 + 'label' => __( 'Setup Forms, Views, and Pages', 'formidable' ),
298 + 'description' => __( 'Build the forms, views, and pages automatically.', 'formidable' ),
299 + 'button_label' => __( 'Create Now', 'formidable' ),
300 + 'complete' => $this->is_complete(),
301 + 'num' => 3,
362 302 ),
363 303 'complete' => array(
364 - 'label' => __( 'Customize Your New Pages', 'formidable' ),
365 - 'description' => __( 'Make any required changes and publish the page.', 'formidable' ),
366 - 'button_label' => __( 'View Page', 'formidable' ),
367 - 'complete' => false,
368 - 'num' => 4,
304 + 'label' => __( 'Customize Your New Pages', 'formidable' ),
305 + 'description' => __( 'Make any required changes and publish the page.', 'formidable' ),
306 + 'button_label' => __( 'View Page', 'formidable' ),
307 + 'complete' => false,
308 + 'num' => 4,
369 309 ),
370 310 );
371 311
372 312 $this->adjust_plugin_install_step( $steps );
@@ -371,9 +311,8 @@
371 311
372 312 $this->adjust_plugin_install_step( $steps );
373 313
374 314 $has_current = false;
375 -
376 315 foreach ( $steps as $k => $step ) {
377 316 // Set the current step.
378 317 if ( ! isset( $step['current'] ) ) {
379 318 if ( $step['complete'] ) {
@@ -379,9 +318,9 @@
379 318 if ( $step['complete'] ) {
380 319 $steps[ $k ]['current'] = false;
381 320 } else {
382 321 $steps[ $k ]['current'] = ! $has_current;
383 - $has_current = true;
322 + $has_current = true;
384 323 }
385 324 } elseif ( $step['current'] ) {
386 325 $has_current = true;
387 326 }
@@ -386,29 +325,22 @@
386 325 $has_current = true;
387 326 }
388 327
389 328 // Set disabled buttons.
390 - $class = $step['button_class'] ?? '';
329 + $class = isset( $step['button_class'] ) ? $step['button_class'] : '';
391 330 $class .= ' button-primary frm-button-primary';
392 -
393 331 if ( ! $steps[ $k ]['current'] ) {
394 332 $class .= ' frm_grey disabled';
395 333 }
396 334 $steps[ $k ]['button_class'] = $class;
397 - }//end foreach
335 + }
398 336
399 337 return $steps;
400 338 }
401 339
402 - /**
403 - * @param array $steps
404 - *
405 - * @return void
406 - */
407 340 protected function adjust_plugin_install_step( &$steps ) {
408 341 $plugins = $this->required_plugins();
409 -
410 - if ( ! $plugins ) {
342 + if ( empty( $plugins ) ) {
411 343 unset( $steps['plugin'] );
412 344 $steps['import']['num'] = 2;
413 345 $steps['complete']['num'] = 3;
414 346 return;
@@ -415,16 +347,14 @@
415 347 }
416 348
417 349 $missing = array();
418 350 $rel = array();
419 -
420 351 foreach ( $plugins as $plugin_key ) {
421 352 $plugin = FrmAddonsController::install_link( $plugin_key );
422 -
423 353 if ( $plugin['status'] === 'active' ) {
424 354 continue;
425 355 }
426 -
356 + $links[ $plugin_key ] = $plugin;
427 357 if ( isset( $plugin['url'] ) ) {
428 358 $rel[] = $plugin['url'];
429 359 } else {
430 360 // Add-on is required but not allowed.
@@ -430,12 +360,11 @@
430 360 // Add-on is required but not allowed.
431 361 $missing[] = $plugin_key;
432 362 }
433 363 }
434 -
435 - if ( ! $rel && ! $missing ) {
364 + if ( empty( $rel ) && empty( $missing ) ) {
436 365 $steps['plugin']['complete'] = true;
437 - } elseif ( $missing ) {
366 + } elseif ( ! empty( $missing ) ) {
438 367 $steps['plugin']['error'] = sprintf(
439 368 /* translators: %1$s: Plugin name */
440 369 esc_html__( 'You need permission to download the Formidable %1$s plugin', 'formidable' ),
441 370 implode( ', ', $missing )
@@ -440,9 +369,9 @@
440 369 esc_html__( 'You need permission to download the Formidable %1$s plugin', 'formidable' ),
441 370 implode( ', ', $missing )
442 371 );
443 372 } else {
444 - $steps['plugin']['links'] = $rel;
373 + $steps['plugin']['links'] = $rel;
445 374 $steps['plugin']['button_class'] = 'frm-solution-multiple ';
446 375 }
447 376
448 377 if ( $steps['license']['complete'] && ! $steps['plugin']['complete'] ) {
@@ -449,21 +378,16 @@
449 378 $steps['plugin']['current'] = true;
450 379 }
451 380 }
452 381
453 - /**
454 - * @param array $step Step.
455 - *
456 - * @return void
457 - */
458 382 protected function step_top( $step ) {
459 - $section_class = empty( $step['current'] ) ? 'frm_grey' : '';
383 + $section_class = ( ! isset( $step['current'] ) || ! $step['current'] ) ? 'frm_grey' : '';
460 384
461 385 ?>
462 386 <section class="step step-install <?php echo esc_attr( $section_class ); ?>">
463 387 <aside class="num">
464 388 <?php
465 - if ( ! empty( $step['complete'] ) ) {
389 + if ( isset( $step['complete'] ) && $step['complete'] ) {
466 390 FrmAppHelper::icon_by_class(
467 391 'frmfont frm_step_complete_icon',
468 392 array(
469 393 /* translators: %1$s: Step number */
@@ -472,9 +396,9 @@
472 396 )
473 397 );
474 398 } else {
475 399 ?>
476 - <svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 100 100"><circle cx="50" cy="50" r="50" fill="#ccc"/><text x="50%" y="50%" text-anchor="middle" fill="#fff" stroke="#fff" stroke-width="2px" dy=".3em" font-size="3.7em"><?php echo esc_html( $step['num'] ); ?></text></svg><?php // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ?>
400 + <svg xmlns="http://www.w3.org/2000/svg" width="50" height="50" viewBox="0 0 100 100"><circle cx="50" cy="50" r="50" fill="#ccc"/><text x="50%" y="50%" text-anchor="middle" fill="#fff" stroke="#fff" stroke-width="2px" dy=".3em" font-size="3.7em"><?php echo esc_html( $step['num'] ); ?></text></svg>
477 401 <?php
478 402 }
479 403 ?>
480 404 <i class="loader hidden"></i>
@@ -489,13 +413,8 @@
489 413 <?php } ?>
490 414 <?php
491 415 }
492 416
493 - /**
494 - * @param array $step Step.
495 - *
496 - * @return void
497 - */
498 417 protected function step_bottom( $step ) {
499 418 ?>
500 419 </div>
501 420 </section>
@@ -503,12 +422,8 @@
503 422 }
504 423
505 424 /**
506 425 * Generate and output Connect step section HTML.
507 - *
508 - * @param array $step Step.
509 - *
510 - * @return void
511 426 */
512 427 protected function license_box( $step ) {
513 428 $this->step_top( $step );
514 429
@@ -524,18 +439,13 @@
524 439
525 440 $this->step_bottom( $step );
526 441 }
527 442
528 - /**
529 - * @param array $step Step.
530 - *
531 - * @return void
532 - */
533 443 protected function show_plugin_install( $step ) {
534 444 $this->step_top( $step );
535 445
536 446 if ( ! isset( $step['error'] ) ) {
537 - $rel = $step['links'] ?? array();
447 + $rel = isset( $step['links'] ) ? $step['links'] : array();
538 448
539 449 ?>
540 450 <a rel="<?php echo esc_attr( implode( ',', $rel ) ); ?>" class="<?php echo esc_attr( $step['button_class'] ); ?>">
541 451 <?php echo esc_html( $step['button_label'] ); ?>
@@ -545,16 +455,10 @@
545 455
546 456 $this->step_bottom( $step );
547 457 }
548 458
549 - /**
550 - * @param array $step Step.
551 - *
552 - * @return void
553 - */
554 459 protected function show_app_install( $step ) {
555 460 $is_complete = $step['complete'];
556 -
557 461 if ( ! empty( $this->form_options() ) && ! $is_complete ) {
558 462 $step['description'] = __( 'Select the form or view you would like to create.', 'formidable' );
559 463 }
560 464
@@ -559,11 +463,12 @@
559 463 }
560 464
561 465 $this->step_top( $step );
562 466
563 - $api = new FrmFormApi();
564 - $addons = $api->get_api_info();
565 - $id = $this->download_id();
467 + $api = new FrmFormApi();
468 + $addons = $api->get_api_info();
469 +
470 + $id = $this->download_id();
566 471 $has_file = isset( $addons[ $id ] ) && isset( $addons[ $id ]['beta'] );
567 472
568 473 if ( ! $step['current'] ) {
569 474 ?>
@@ -578,12 +483,11 @@
578 483
579 484 if ( ! $has_file ) {
580 485 echo '<p class="frm_error_style">' . esc_html__( 'We didn\'t find anything to import. Please contact our team.', 'formidable' ) . '</p>';
581 486 } elseif ( ! isset( $addons[ $id ]['beta']['package'] ) ) {
582 - echo '<p class="frm_error_style">' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '</p>'; // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong
487 + echo '<p class="frm_error_style">' . esc_html__( 'Looks like you may not have a current subscription for this solution. Please check your account.', 'formidable' ) . '</p>';
583 488 } else {
584 489 $xml = $addons[ $id ]['beta']['package'];
585 -
586 490 if ( is_array( $xml ) ) {
587 491 $xml = reset( $xml );
588 492 }
589 493
@@ -620,73 +524,49 @@
620 524 echo '</fieldset>';
621 525 } else {
622 526 echo '</form>';
623 527 }
624 - }//end if
528 + }
625 529
626 530 $this->step_bottom( $step );
627 531 }
628 532
629 - /**
630 - * @param string $xml
631 - *
632 - * @return void
633 - */
634 533 protected function show_form_options( $xml ) {
635 534 $this->show_import_options( $this->form_options(), 'form', $xml );
636 535 }
637 536
638 - /**
639 - * @return void
640 - */
641 537 protected function show_view_options() {
642 538 $this->show_import_options( $this->view_options(), 'view' );
643 539 }
644 540
645 - /**
646 - * @param array $options
647 - * @param string $importing
648 - * @param string $xml
649 - *
650 - * @psalm-param 'form'|'view' $importing
651 - *
652 - * @return void
653 - */
654 541 protected function show_import_options( $options, $importing, $xml = '' ) {
655 - if ( ! $options ) {
542 + if ( empty( $options ) ) {
656 543 return;
657 544 }
658 545
659 546 $imported = $this->previously_imported_forms();
660 547 $count = count( $options );
661 -
662 548 foreach ( $options as $info ) {
663 549 // Count the number of options displayed for css.
664 550 if ( $count > 1 && ! isset( $info['img'] ) ) {
665 - --$count;
551 + $count --;
666 552 }
667 553 }
668 -
669 554 $width = floor( ( 533 - ( ( $count - 1 ) * 20 ) ) / $count );
670 555 unset( $count );
671 556
672 557 $selected = false;
673 558
674 - include FrmAppHelper::plugin_path() . '/classes/views/solutions/_import.php';
559 + include( FrmAppHelper::plugin_path() . '/classes/views/solutions/_import.php' );
675 560 }
676 561
677 - /**
678 - * @return void
679 - */
680 562 protected function show_page_options() {
681 563 $pages = $this->needed_pages();
682 -
683 - if ( ! $pages ) {
564 + if ( empty( $pages ) ) {
684 565 return;
685 566 }
686 567
687 568 echo '<h3>Choose New Page Title</h3>';
688 -
689 569 foreach ( $pages as $page ) {
690 570 ?>
691 571 <p>
692 572 <label for="pages_<?php echo esc_html( $page['type'] ); ?>">
@@ -691,19 +571,14 @@
691 571 <p>
692 572 <label for="pages_<?php echo esc_html( $page['type'] ); ?>">
693 573 <?php echo esc_html( $page['label'] ); ?>
694 574 </label>
695 - <input type="text" name="pages[<?php echo esc_html( $page['type'] ); ?>]" value="<?php echo esc_attr( $page['name'] ); ?>" id="pages_<?php echo esc_html( $page['type'] ); ?>" required /><?php // phpcs:ignore SlevomatCodingStandard.Files.LineLength.LineTooLong ?>
575 + <input type="text" name="pages[<?php echo esc_html( $page['type'] ); ?>]" value="<?php echo esc_attr( $page['name'] ); ?>" id="pages_<?php echo esc_html( $page['type'] ); ?>" required />
696 576 </p>
697 577 <?php
698 578 }
699 579 }
700 580
701 - /**
702 - * @param array $step
703 - *
704 - * @return void
705 - */
706 581 protected function show_page_links( $step ) {
707 582 if ( $step['current'] ) {
708 583 return;
709 584 }
@@ -720,32 +595,22 @@
720 595 }
721 596
722 597 /**
723 598 * Only show the content for the correct plugin.
724 - *
725 - * @return bool
726 599 */
727 600 protected function is_current_plugin() {
728 - $to_redirect = get_transient( FrmOnboardingWizardController::TRANSIENT_NAME );
601 + $to_redirect = get_transient( 'frm_activation_redirect' );
729 602 return $to_redirect === $this->plugin_slug && empty( $this->is_complete() );
730 603 }
731 604
732 605 /**
733 606 * Override this function to indicate when install is complete.
734 - *
735 - * @param int|string $count
736 - *
737 - * @psalm-param 'all'|1 $count
738 - *
739 - * @return bool
740 607 */
741 608 protected function is_complete( $count = 1 ) {
742 609 $imported = $this->previously_imported_forms();
743 -
744 610 if ( $count === 'all' ) {
745 611 return count( $imported ) >= count( $this->form_options() );
746 612 }
747 -
748 613 return ! empty( $imported );
749 614 }
750 615
751 616 /**
@@ -755,12 +620,10 @@
755 620 */
756 621 protected function previously_imported_forms() {
757 622 $imported = array();
758 623 $forms = $this->form_options();
759 -
760 624 foreach ( $forms as $form ) {
761 625 $was_imported = isset( $form['form'] ) ? FrmForm::get_id_by_key( $form['form'] ) : false;
762 -
763 626 if ( $was_imported ) {
764 627 $imported[ $form['form'] ] = $was_imported;
765 628 }
766 629 }
@@ -769,10 +632,8 @@
769 632 }
770 633
771 634 /**
772 635 * In the new plugin has any dependencies, include them here.
773 - *
774 - * @return array
775 636 */
776 637 protected function required_plugins() {
777 638 return array();
778 639 }
@@ -778,10 +639,8 @@
778 639 }
779 640
780 641 /**
781 642 * This needs to be overridden.
782 - *
783 - * @return int
784 643 */
785 644 protected function download_id() {
786 645 return 0;
787 646 }
@@ -787,10 +646,8 @@
787 646 }
788 647
789 648 /**
790 649 * Give options for which forms to import.
791 - *
792 - * @return array
793 650 */
794 651 protected function form_options() {
795 652 /**
796 653 * Example:
@@ -806,10 +663,8 @@
806 663 }
807 664
808 665 /**
809 666 * Give options for which view to use.
810 - *
811 - * @return array
812 667 */
813 668 protected function view_options() {
814 669 return array();
815 670 }
@@ -815,10 +670,8 @@
815 670 }
816 671
817 672 /**
818 673 * If the pages aren't imported automatically, set the page names.
819 - *
820 - * @return array
821 674 */
822 675 protected function needed_pages() {
823 676 /**
824 677 * Example:
@@ -833,16 +686,15 @@
833 686
834 687 return array();
835 688 }
836 689
837 - /**
838 - * @return void
839 - */
840 690 private function css() {
841 691 wp_enqueue_style( 'formidable-pro-fields' );
842 692 ?>
843 693 <style>
844 694 #frm-welcome *, #frm-welcome *::before, #frm-welcome *::after {
695 + -webkit-box-sizing: border-box;
696 + -moz-box-sizing: border-box;
845 697 box-sizing: border-box;
846 698 }
847 699 #frm-welcome{
848 700 width: 700px;
@@ -901,8 +753,10 @@
901 753 border-radius: 3px;
902 754 }
903 755 #frm-welcome .step,
904 756 #frm-welcome .screenshot .cont {
757 + -webkit-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.05);
758 + -moz-box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.05);
905 759 box-shadow: 0px 2px 5px 0px rgba(0, 0, 0, 0.05);
906 760 }
907 761 #frm-welcome .step {
908 762 background-color: #F9F9F9;
@@ -945,5 +799,6 @@
945 799 }
946 800 </style>
947 801 <?php
948 802 }
803 +
949 804 }