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 +33 -7 6.46.6 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.4
5 +Version: 6.6
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
@@ -48,9 +48,9 @@
48 48 FrmHooksController::trigger_load_hook();
49 49 }
50 50
51 51 // if __autoload is active, put it on the spl_autoload stack
52 -if ( is_array( spl_autoload_functions() ) && in_array( '__autoload', spl_autoload_functions() ) ) {
52 +if ( is_array( spl_autoload_functions() ) && in_array( '__autoload', spl_autoload_functions(), true ) ) {
53 53 spl_autoload_register( '__autoload' );
54 54 }
55 55
56 56 // Add the autoloader
@@ -75,10 +75,11 @@
75 75 *
76 76 * @return void
77 77 */
78 78 function frm_class_autoloader( $class_name, $filepath ) {
79 - $deprecated = array( 'FrmEntryFormat', 'FrmPointers', 'FrmEDD_SL_Plugin_Updater' );
80 - $is_deprecated = in_array( $class_name, $deprecated ) || preg_match( '/^.+Deprecate/', $class_name );
79 + $deprecated = array( 'FrmPointers', 'FrmEDD_SL_Plugin_Updater' );
80 + $is_deprecated = in_array( $class_name, $deprecated, true ) || preg_match( '/^.+Deprecate/', $class_name );
81 + $original_filepath = $filepath;
81 82
82 83 if ( $is_deprecated ) {
83 84 $filepath .= '/deprecated/';
84 85 } else {
@@ -84,11 +85,11 @@
84 85 } else {
85 86 $filepath .= '/classes/';
86 87 if ( preg_match( '/^.+Helper$/', $class_name ) ) {
87 88 $filepath .= 'helpers/';
88 - } else if ( preg_match( '/^.+Controller$/', $class_name ) ) {
89 + } elseif ( preg_match( '/^.+Controller$/', $class_name ) ) {
89 90 $filepath .= 'controllers/';
90 - } else if ( preg_match( '/^.+Factory$/', $class_name ) ) {
91 + } elseif ( preg_match( '/^.+Factory$/', $class_name ) ) {
91 92 $filepath .= 'factories/';
92 93 } else {
93 94 $filepath .= 'models/';
94 95 if ( strpos( $class_name, 'Field' ) && ! file_exists( $filepath . $class_name . '.php' ) ) {
@@ -96,17 +97,40 @@
96 97 }
97 98 }
98 99 }
99 100
101 + if ( file_exists( $filepath . $class_name . '.php' ) ) {
102 + require $filepath . $class_name . '.php';
103 + return;
104 + }
105 +
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.
108 + return;
109 + }
110 +
111 + // Autoload for /stripe/ folder.
112 + $filepath = $original_filepath . '/stripe/';
113 + if ( preg_match( '/^.+Helper$/', $class_name ) ) {
114 + $filepath .= 'helpers/';
115 + } elseif ( preg_match( '/^.+Controller$/', $class_name ) ) {
116 + $filepath .= 'controllers/';
117 + } else {
118 + $filepath .= 'models/';
119 + }
120 +
100 121 $filepath .= $class_name . '.php';
101 122
102 123 if ( file_exists( $filepath ) ) {
103 - require( $filepath );
124 + require $filepath;
104 125 }
105 126 }
106 127
107 128 add_action( 'activate_' . FrmAppHelper::plugin_folder() . '/formidable.php', 'frm_maybe_install' );
129 +
108 130 /**
131 + * This function is triggered when Formidable is activated.
132 + *
109 133 * @return void
110 134 */
111 135 function frm_maybe_install() {
112 136 if ( get_transient( FrmWelcomeController::$option_name ) !== 'no' ) {
@@ -111,8 +135,10 @@
111 135 function frm_maybe_install() {
112 136 if ( get_transient( FrmWelcomeController::$option_name ) !== 'no' ) {
113 137 set_transient( FrmWelcomeController::$option_name, FrmWelcomeController::$menu_slug, 60 );
114 138 }
139 +
140 + FrmAppController::handle_activation();
115 141 }
116 142
117 143 register_deactivation_hook(
118 144 __FILE__,