| @@ -41,10 +41,8 @@ | ||
| 41 | 41 | /** |
| 42 | 42 | * Register all WP hooks. |
| 43 | 43 | * |
| 44 | 44 | * @since 4.06.02 |
| 45 | - * | |
| 46 | - * @return void | |
| 47 | 45 | */ |
| 48 | 46 | public function load_hooks() { |
| 49 | 47 | // If user is in admin ajax or doing cron, return. |
| 50 | 48 | if ( wp_doing_cron() ) { |
| @@ -82,10 +80,8 @@ | ||
| 82 | 80 | * These pages will be removed from the Dashboard menu, so they will |
| 83 | 81 | * not actually show. Sneaky, sneaky. |
| 84 | 82 | * |
| 85 | 83 | * @since 4.06.02 |
| 86 | - * | |
| 87 | - * @return void | |
| 88 | 84 | */ |
| 89 | 85 | public function register() { |
| 90 | 86 | |
| 91 | 87 | // Getting started - shows after installation. |
| @@ -103,34 +99,21 @@ | ||
| 103 | 99 | * |
| 104 | 100 | * This means the pages are still available to us, but hidden. |
| 105 | 101 | * |
| 106 | 102 | * @since 4.06.02 |
| 107 | - * | |
| 108 | - * @return void | |
| 109 | 103 | */ |
| 110 | 104 | public function hide_menu() { |
| 111 | 105 | remove_submenu_page( 'index.php', $this->page ); |
| 112 | 106 | } |
| 113 | 107 | |
| 114 | - /** | |
| 115 | - * @return string | |
| 116 | - * | |
| 117 | - * @psalm-return '' | |
| 118 | - */ | |
| 119 | 108 | protected function plugin_name() { |
| 120 | 109 | return ''; |
| 121 | 110 | } |
| 122 | 111 | |
| 123 | - /** | |
| 124 | - * @return string | |
| 125 | - */ | |
| 126 | 112 | protected function page_title() { |
| 127 | 113 | return __( 'Welcome to Formidable Forms', 'formidable' ); |
| 128 | 114 | } |
| 129 | 115 | |
| 130 | - /** | |
| 131 | - * @return string | |
| 132 | - */ | |
| 133 | 116 | protected function page_description() { |
| 134 | 117 | return __( 'Follow the steps below to get started.', 'formidable' ); |
| 135 | 118 | } |
| 136 | 119 | |
| @@ -140,10 +123,8 @@ | ||
| 140 | 123 | * This function checks if a new install or update has just occurred. If so, |
| 141 | 124 | * then we redirect the user to the appropriate page. |
| 142 | 125 | * |
| 143 | 126 | * @since 4.06.02 |
| 144 | - * | |
| 145 | - * @return void | |
| 146 | 127 | */ |
| 147 | 128 | public function redirect() { |
| 148 | 129 | |
| 149 | 130 | $current_page = FrmAppHelper::simple_get( 'page', 'sanitize_title' ); |
| @@ -168,11 +149,8 @@ | ||
| 168 | 149 | wp_safe_redirect( $this->settings_link() ); |
| 169 | 150 | exit; |
| 170 | 151 | } |
| 171 | 152 | |
| 172 | - /** | |
| 173 | - * @return string | |
| 174 | - */ | |
| 175 | 153 | protected function settings_link() { |
| 176 | 154 | return admin_url( 'index.php?page=' . $this->page ); |
| 177 | 155 | } |
| 178 | 156 | |
| @@ -193,11 +171,8 @@ | ||
| 193 | 171 | |
| 194 | 172 | /* |
| 195 | 173 | * Output for global settings. |
| 196 | 174 | */ |
| 197 | - /** | |
| 198 | - * @return void | |
| 199 | - */ | |
| 200 | 175 | public function settings_page() { |
| 201 | 176 | $steps = $this->get_steps_data(); |
| 202 | 177 | if ( ! $steps['license']['complete'] || ( isset( $steps['plugin'] ) && ! $steps['plugin']['complete'] ) ) { |
| 203 | 178 | // Redirect to the welcome page if install hasn't been done. |
| @@ -233,10 +208,8 @@ | ||
| 233 | 208 | } |
| 234 | 209 | |
| 235 | 210 | /** |
| 236 | 211 | * Getting Started screen. Shows after first install. |
| 237 | - * | |
| 238 | - * @return void | |
| 239 | 212 | */ |
| 240 | 213 | public function output() { |
| 241 | 214 | FrmAppHelper::include_svg(); |
| 242 | 215 | $this->css(); |
| @@ -251,10 +224,8 @@ | ||
| 251 | 224 | } |
| 252 | 225 | |
| 253 | 226 | /** |
| 254 | 227 | * Heading section. |
| 255 | - * | |
| 256 | - * @return void | |
| 257 | 228 | */ |
| 258 | 229 | protected function header() { |
| 259 | 230 | $size = array( |
| 260 | 231 | 'height' => 90, |
| @@ -290,10 +261,8 @@ | ||
| 290 | 261 | |
| 291 | 262 | /** |
| 292 | 263 | * This is the welcome page content. |
| 293 | 264 | * Override me to insert different content. |
| 294 | - * | |
| 295 | - * @return void | |
| 296 | 265 | */ |
| 297 | 266 | protected function main_content() { |
| 298 | 267 | $steps = $this->get_steps_data(); |
| 299 | 268 | $this->license_box( $steps['license'] ); |
| @@ -367,13 +336,8 @@ | ||
| 367 | 336 | |
| 368 | 337 | return $steps; |
| 369 | 338 | } |
| 370 | 339 | |
| 371 | - /** | |
| 372 | - * @param array $steps | |
| 373 | - * | |
| 374 | - * @return void | |
| 375 | - */ | |
| 376 | 340 | protected function adjust_plugin_install_step( &$steps ) { |
| 377 | 341 | $plugins = $this->required_plugins(); |
| 378 | 342 | if ( empty( $plugins ) ) { |
| 379 | 343 | unset( $steps['plugin'] ); |
| @@ -414,11 +378,8 @@ | ||
| 414 | 378 | $steps['plugin']['current'] = true; |
| 415 | 379 | } |
| 416 | 380 | } |
| 417 | 381 | |
| 418 | - /** | |
| 419 | - * @return void | |
| 420 | - */ | |
| 421 | 382 | protected function step_top( $step ) { |
| 422 | 383 | $section_class = ( ! isset( $step['current'] ) || ! $step['current'] ) ? 'frm_grey' : ''; |
| 423 | 384 | |
| 424 | 385 | ?> |
| @@ -452,11 +413,8 @@ | ||
| 452 | 413 | <?php } ?> |
| 453 | 414 | <?php |
| 454 | 415 | } |
| 455 | 416 | |
| 456 | - /** | |
| 457 | - * @return void | |
| 458 | - */ | |
| 459 | 417 | protected function step_bottom( $step ) { |
| 460 | 418 | ?> |
| 461 | 419 | </div> |
| 462 | 420 | </section> |
| @@ -464,10 +422,8 @@ | ||
| 464 | 422 | } |
| 465 | 423 | |
| 466 | 424 | /** |
| 467 | 425 | * Generate and output Connect step section HTML. |
| 468 | - * | |
| 469 | - * @return void | |
| 470 | 426 | */ |
| 471 | 427 | protected function license_box( $step ) { |
| 472 | 428 | $this->step_top( $step ); |
| 473 | 429 | |
| @@ -483,11 +439,8 @@ | ||
| 483 | 439 | |
| 484 | 440 | $this->step_bottom( $step ); |
| 485 | 441 | } |
| 486 | 442 | |
| 487 | - /** | |
| 488 | - * @return void | |
| 489 | - */ | |
| 490 | 443 | protected function show_plugin_install( $step ) { |
| 491 | 444 | $this->step_top( $step ); |
| 492 | 445 | |
| 493 | 446 | if ( ! isset( $step['error'] ) ) { |
| @@ -502,11 +455,8 @@ | ||
| 502 | 455 | |
| 503 | 456 | $this->step_bottom( $step ); |
| 504 | 457 | } |
| 505 | 458 | |
| 506 | - /** | |
| 507 | - * @return void | |
| 508 | - */ | |
| 509 | 459 | protected function show_app_install( $step ) { |
| 510 | 460 | $is_complete = $step['complete']; |
| 511 | 461 | if ( ! empty( $this->form_options() ) && ! $is_complete ) { |
| 512 | 462 | $step['description'] = __( 'Select the form or view you would like to create.', 'formidable' ); |
| @@ -579,29 +529,16 @@ | ||
| 579 | 529 | |
| 580 | 530 | $this->step_bottom( $step ); |
| 581 | 531 | } |
| 582 | 532 | |
| 583 | - /** | |
| 584 | - * @return void | |
| 585 | - */ | |
| 586 | 533 | protected function show_form_options( $xml ) { |
| 587 | 534 | $this->show_import_options( $this->form_options(), 'form', $xml ); |
| 588 | 535 | } |
| 589 | 536 | |
| 590 | - /** | |
| 591 | - * @return void | |
| 592 | - */ | |
| 593 | 537 | protected function show_view_options() { |
| 594 | 538 | $this->show_import_options( $this->view_options(), 'view' ); |
| 595 | 539 | } |
| 596 | 540 | |
| 597 | - /** | |
| 598 | - * @param string $importing | |
| 599 | - * | |
| 600 | - * @psalm-param 'form'|'view' $importing | |
| 601 | - * | |
| 602 | - * @return void | |
| 603 | - */ | |
| 604 | 541 | protected function show_import_options( $options, $importing, $xml = '' ) { |
| 605 | 542 | if ( empty( $options ) ) { |
| 606 | 543 | return; |
| 607 | 544 | } |
| @@ -621,11 +558,8 @@ | ||
| 621 | 558 | |
| 622 | 559 | include( FrmAppHelper::plugin_path() . '/classes/views/solutions/_import.php' ); |
| 623 | 560 | } |
| 624 | 561 | |
| 625 | - /** | |
| 626 | - * @return void | |
| 627 | - */ | |
| 628 | 562 | protected function show_page_options() { |
| 629 | 563 | $pages = $this->needed_pages(); |
| 630 | 564 | if ( empty( $pages ) ) { |
| 631 | 565 | return; |
| @@ -643,11 +577,8 @@ | ||
| 643 | 577 | <?php |
| 644 | 578 | } |
| 645 | 579 | } |
| 646 | 580 | |
| 647 | - /** | |
| 648 | - * @return void | |
| 649 | - */ | |
| 650 | 581 | protected function show_page_links( $step ) { |
| 651 | 582 | if ( $step['current'] ) { |
| 652 | 583 | return; |
| 653 | 584 | } |
| @@ -664,10 +595,8 @@ | ||
| 664 | 595 | } |
| 665 | 596 | |
| 666 | 597 | /** |
| 667 | 598 | * Only show the content for the correct plugin. |
| 668 | - * | |
| 669 | - * @return bool | |
| 670 | 599 | */ |
| 671 | 600 | protected function is_current_plugin() { |
| 672 | 601 | $to_redirect = get_transient( 'frm_activation_redirect' ); |
| 673 | 602 | return $to_redirect === $this->plugin_slug && empty( $this->is_complete() ); |
| @@ -674,14 +603,8 @@ | ||
| 674 | 603 | } |
| 675 | 604 | |
| 676 | 605 | /** |
| 677 | 606 | * Override this function to indicate when install is complete. |
| 678 | - * | |
| 679 | - * @param int|string $count | |
| 680 | - * | |
| 681 | - * @psalm-param 'all'|1 $count | |
| 682 | - * | |
| 683 | - * @return bool | |
| 684 | 607 | */ |
| 685 | 608 | protected function is_complete( $count = 1 ) { |
| 686 | 609 | $imported = $this->previously_imported_forms(); |
| 687 | 610 | if ( $count === 'all' ) { |
| @@ -709,10 +632,8 @@ | ||
| 709 | 632 | } |
| 710 | 633 | |
| 711 | 634 | /** |
| 712 | 635 | * In the new plugin has any dependencies, include them here. |
| 713 | - * | |
| 714 | - * @return array | |
| 715 | 636 | */ |
| 716 | 637 | protected function required_plugins() { |
| 717 | 638 | return array(); |
| 718 | 639 | } |
| @@ -718,10 +639,8 @@ | ||
| 718 | 639 | } |
| 719 | 640 | |
| 720 | 641 | /** |
| 721 | 642 | * This needs to be overridden. |
| 722 | - * | |
| 723 | - * @return int | |
| 724 | 643 | */ |
| 725 | 644 | protected function download_id() { |
| 726 | 645 | return 0; |
| 727 | 646 | } |
| @@ -727,10 +646,8 @@ | ||
| 727 | 646 | } |
| 728 | 647 | |
| 729 | 648 | /** |
| 730 | 649 | * Give options for which forms to import. |
| 731 | - * | |
| 732 | - * @return array | |
| 733 | 650 | */ |
| 734 | 651 | protected function form_options() { |
| 735 | 652 | /** |
| 736 | 653 | * Example: |
| @@ -746,10 +663,8 @@ | ||
| 746 | 663 | } |
| 747 | 664 | |
| 748 | 665 | /** |
| 749 | 666 | * Give options for which view to use. |
| 750 | - * | |
| 751 | - * @return array | |
| 752 | 667 | */ |
| 753 | 668 | protected function view_options() { |
| 754 | 669 | return array(); |
| 755 | 670 | } |
| @@ -755,10 +670,8 @@ | ||
| 755 | 670 | } |
| 756 | 671 | |
| 757 | 672 | /** |
| 758 | 673 | * If the pages aren't imported automatically, set the page names. |
| 759 | - * | |
| 760 | - * @return array | |
| 761 | 674 | */ |
| 762 | 675 | protected function needed_pages() { |
| 763 | 676 | /** |
| 764 | 677 | * Example: |
| @@ -773,11 +686,8 @@ | ||
| 773 | 686 | |
| 774 | 687 | return array(); |
| 775 | 688 | } |
| 776 | 689 | |
| 777 | - /** | |
| 778 | - * @return void | |
| 779 | - */ | |
| 780 | 690 | private function css() { |
| 781 | 691 | wp_enqueue_style( 'formidable-pro-fields' ); |
| 782 | 692 | ?> |
| 783 | 693 | <style> |