PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.6
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.6
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 | formidable.php +38 -53 6.326.6 View file →
@@ -1,16 +1,14 @@
1 1 <?php
2 -/**
3 - * Plugin Name: Formidable Forms
4 - * Description: Quickly and easily create drag-and-drop forms
5 - * Version: 6.32
6 - * Plugin URI: https://formidableforms.com/
7 - * Author URI: https://formidableforms.com/
8 - * Author: Strategy11 Form Builder Team
9 - * Text Domain: formidable
10 - *
11 - * @package Formidable
12 - */
2 +/*
3 +Plugin Name: Formidable Forms
4 +Description: Quickly and easily create drag-and-drop forms
5 +Version: 6.6
6 +Plugin URI: https://formidableforms.com/
7 +Author URI: https://formidableforms.com/
8 +Author: Strategy11 Form Builder Team
9 +Text Domain: formidable
10 +*/
13 11
14 12 /*
15 13 Copyright 2010 Formidable Forms
16 14
@@ -41,37 +39,34 @@
41 39 'pro_is_authorized' => false,
42 40 );
43 41
44 42 // For reverse compatibility. Load Pro if it's still nested.
45 - $frm_path = __DIR__;
46 -
43 + $frm_path = dirname( __FILE__ );
47 44 if ( file_exists( $frm_path . '/pro/formidable-pro.php' ) ) {
48 - include $frm_path . '/pro/formidable-pro.php';
45 + include( $frm_path . '/pro/formidable-pro.php' );
49 46 }
50 47
51 48 FrmHooksController::trigger_load_hook();
52 49 }
53 50
54 -// If __autoload is active, put it on the spl_autoload stack.
51 +// if __autoload is active, put it on the spl_autoload stack
55 52 if ( is_array( spl_autoload_functions() ) && in_array( '__autoload', spl_autoload_functions(), true ) ) {
56 53 spl_autoload_register( '__autoload' );
57 54 }
58 55
59 -// Add the autoloader.
56 +// Add the autoloader
60 57 spl_autoload_register( 'frm_forms_autoloader' );
61 58
62 59 /**
63 - * @param string $class_name Class name.
64 - *
65 60 * @return void
66 61 */
67 62 function frm_forms_autoloader( $class_name ) {
68 - // Only load Frm classes here.
63 + // Only load Frm classes here
69 64 if ( ! preg_match( '/^Frm.+$/', $class_name ) || preg_match( '/^FrmPro.+$/', $class_name ) ) {
70 65 return;
71 66 }
72 67
73 - frm_class_autoloader( $class_name, __DIR__ );
68 + frm_class_autoloader( $class_name, dirname( __FILE__ ) );
74 69 }
75 70
76 71 /**
77 72 * Autoload the Formidable and Pro classes
@@ -77,30 +72,30 @@
77 72 * Autoload the Formidable and Pro classes
78 73 *
79 74 * @since 3.0
80 75 *
81 - * @param string $class_name Class name.
82 - * @param string $filepath File path.
83 - *
84 76 * @return void
85 77 */
86 78 function frm_class_autoloader( $class_name, $filepath ) {
79 + $deprecated = array( 'FrmPointers', 'FrmEDD_SL_Plugin_Updater' );
80 + $is_deprecated = in_array( $class_name, $deprecated, true ) || preg_match( '/^.+Deprecate/', $class_name );
87 81 $original_filepath = $filepath;
88 - $filepath .= '/classes/';
89 82
90 - if ( preg_match( '/^.+Helper$/', $class_name ) ) {
91 - $filepath .= 'helpers/';
92 - } elseif ( preg_match( '/^.+Controller$/', $class_name ) ) {
93 - $filepath .= 'controllers/';
94 - } elseif ( preg_match( '/^.+Factory$/', $class_name ) ) {
95 - $filepath .= 'factories/';
96 - } elseif ( preg_match( '/^.+StyleComponent$/', $class_name ) ) {
97 - $filepath .= 'views/styles/components/';
83 + if ( $is_deprecated ) {
84 + $filepath .= '/deprecated/';
98 85 } else {
99 - $filepath .= 'models/';
100 -
101 - if ( str_contains( $class_name, 'Field' ) && ! file_exists( $filepath . $class_name . '.php' ) ) {
102 - $filepath .= 'fields/';
86 + $filepath .= '/classes/';
87 + if ( preg_match( '/^.+Helper$/', $class_name ) ) {
88 + $filepath .= 'helpers/';
89 + } elseif ( preg_match( '/^.+Controller$/', $class_name ) ) {
90 + $filepath .= 'controllers/';
91 + } elseif ( preg_match( '/^.+Factory$/', $class_name ) ) {
92 + $filepath .= 'factories/';
93 + } else {
94 + $filepath .= 'models/';
95 + if ( strpos( $class_name, 'Field' ) && ! file_exists( $filepath . $class_name . '.php' ) ) {
96 + $filepath .= 'fields/';
97 + }
103 98 }
104 99 }
105 100
106 101 if ( file_exists( $filepath . $class_name . '.php' ) ) {
@@ -107,21 +102,15 @@
107 102 require $filepath . $class_name . '.php';
108 103 return;
109 104 }
110 105
111 - $filepath = $original_filepath;
112 -
113 - if ( preg_match( '/^FrmStrpLite.+$/', $class_name ) || preg_match( '/^FrmTransLite.+$/', $class_name ) ) {
114 - // Autoload for /stripe/ folder.
115 - $filepath .= '/stripe/';
116 - } elseif ( preg_match( '/^FrmSquareLite.+$/', $class_name ) ) {
117 - $filepath .= '/square/';
118 - } elseif ( preg_match( '/^FrmPayPalLite.+$/', $class_name ) ) {
119 - $filepath .= '/paypal/';
120 - } else {
106 + if ( ! preg_match( '/^FrmStrpLite.+$/', $class_name ) && ! preg_match( '/^FrmTransLite.+$/', $class_name ) ) {
107 + // Exit early if the class does not match the Stripe Lite prefix.
121 108 return;
122 109 }
123 110
111 + // Autoload for /stripe/ folder.
112 + $filepath = $original_filepath . '/stripe/';
124 113 if ( preg_match( '/^.+Helper$/', $class_name ) ) {
125 114 $filepath .= 'helpers/';
126 115 } elseif ( preg_match( '/^.+Controller$/', $class_name ) ) {
127 116 $filepath .= 'controllers/';
@@ -143,14 +132,10 @@
143 132 *
144 133 * @return void
145 134 */
146 135 function frm_maybe_install() {
147 - if ( get_transient( FrmOnboardingWizardController::TRANSIENT_NAME ) !== 'no' ) {
148 - set_transient(
149 - FrmOnboardingWizardController::TRANSIENT_NAME,
150 - FrmOnboardingWizardController::TRANSIENT_VALUE,
151 - 60
152 - );
136 + if ( get_transient( FrmWelcomeController::$option_name ) !== 'no' ) {
137 + set_transient( FrmWelcomeController::$option_name, FrmWelcomeController::$menu_slug, 60 );
153 138 }
154 139
155 140 FrmAppController::handle_activation();
156 141 }
@@ -156,9 +141,9 @@
156 141 }
157 142
158 143 register_deactivation_hook(
159 144 __FILE__,
160 - function () {
145 + function() {
161 146 if ( ! class_exists( 'FrmCronController', false ) ) {
162 147 require_once __DIR__ . '/classes/controllers/FrmCronController.php';
163 148 }
164 149