PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.21
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.21
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 +32 -51 6.266.21 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.26
5 + * Version: 6.21
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
@@ -42,9 +42,8 @@
42 42 );
43 43
44 44 // For reverse compatibility. Load Pro if it's still nested.
45 45 $frm_path = __DIR__;
46 -
47 46 if ( file_exists( $frm_path . '/pro/formidable-pro.php' ) ) {
48 47 include $frm_path . '/pro/formidable-pro.php';
49 48 }
50 49
@@ -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.
@@ -77,75 +74,59 @@
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( 'FrmEDD_SL_Plugin_Updater' );
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 ( strpos( $class_name, 'Field' ) && ! file_exists( $filepath . $class_name . '.php' ) ) {
102 - $filepath .= 'fields/';
103 - }
104 - }
105 -
106 - if ( file_exists( $filepath . $class_name . '.php' ) ) {
107 - require $filepath . $class_name . '.php';
108 - return;
109 - }
110 -
111 - if ( preg_match( '/^FrmStrpLite.+$/', $class_name ) || preg_match( '/^FrmTransLite.+$/', $class_name ) ) {
112 - // Autoload for /stripe/ folder.
113 - $filepath = $original_filepath . '/stripe/';
114 -
88 + $filepath .= '/classes/';
115 89 if ( preg_match( '/^.+Helper$/', $class_name ) ) {
116 90 $filepath .= 'helpers/';
117 91 } elseif ( preg_match( '/^.+Controller$/', $class_name ) ) {
118 92 $filepath .= 'controllers/';
93 + } elseif ( preg_match( '/^.+Factory$/', $class_name ) ) {
94 + $filepath .= 'factories/';
95 + } elseif ( preg_match( '/^.+StyleComponent$/', $class_name ) ) {
96 + $filepath .= 'views/styles/components/';
119 97 } else {
120 98 $filepath .= 'models/';
99 + if ( strpos( $class_name, 'Field' ) && ! file_exists( $filepath . $class_name . '.php' ) ) {
100 + $filepath .= 'fields/';
101 + }
121 102 }
103 + }
122 104
123 - $filepath .= $class_name . '.php';
105 + if ( file_exists( $filepath . $class_name . '.php' ) ) {
106 + require $filepath . $class_name . '.php';
107 + return;
108 + }
124 109
125 - if ( file_exists( $filepath ) ) {
126 - require $filepath;
127 - }
128 -
110 + if ( ! preg_match( '/^FrmStrpLite.+$/', $class_name ) && ! preg_match( '/^FrmTransLite.+$/', $class_name ) ) {
111 + // Exit early if the class does not match the Stripe Lite prefix.
129 112 return;
130 113 }
131 114
132 - if ( preg_match( '/^FrmSquareLite.+$/', $class_name ) ) {
133 - $filepath = $original_filepath . '/square/';
115 + // Autoload for /stripe/ folder.
116 + $filepath = $original_filepath . '/stripe/';
117 + if ( preg_match( '/^.+Helper$/', $class_name ) ) {
118 + $filepath .= 'helpers/';
119 + } elseif ( preg_match( '/^.+Controller$/', $class_name ) ) {
120 + $filepath .= 'controllers/';
121 + } else {
122 + $filepath .= 'models/';
123 + }
134 124
135 - if ( preg_match( '/^.+Helper$/', $class_name ) ) {
136 - $filepath .= 'helpers/';
137 - } elseif ( preg_match( '/^.+Controller$/', $class_name ) ) {
138 - $filepath .= 'controllers/';
139 - } else {
140 - $filepath .= 'models/';
141 - }
125 + $filepath .= $class_name . '.php';
142 126
143 - $filepath .= $class_name . '.php';
144 -
145 - if ( file_exists( $filepath ) ) {
146 - require $filepath;
147 - }
127 + if ( file_exists( $filepath ) ) {
128 + require $filepath;
148 129 }
149 130 }
150 131
151 132 add_action( 'activate_' . FrmAppHelper::plugin_folder() . '/formidable.php', 'frm_maybe_install' );