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