| @@ -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.34 | |
| 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,30 +74,32 @@ | ||
| 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 ( 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 | + } elseif ( preg_match( '/^.+StyleComponent$/', $class_name ) ) { | |
| 96 | + $filepath .= 'views/styles/components/'; | |
| 97 | + } else { | |
| 98 | + $filepath .= 'models/'; | |
| 99 | + if ( strpos( $class_name, 'Field' ) && ! file_exists( $filepath . $class_name . '.php' ) ) { | |
| 100 | + $filepath .= 'fields/'; | |
| 101 | + } | |
| 103 | 102 | } |
| 104 | 103 | } |
| 105 | 104 | |
| 106 | 105 | if ( file_exists( $filepath . $class_name . '.php' ) ) { |
| @@ -107,21 +106,15 @@ | ||
| 107 | 106 | require $filepath . $class_name . '.php'; |
| 108 | 107 | return; |
| 109 | 108 | } |
| 110 | 109 | |
| 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 { | |
| 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. | |
| 121 | 112 | return; |
| 122 | 113 | } |
| 123 | 114 | |
| 115 | + // Autoload for /stripe/ folder. | |
| 116 | + $filepath = $original_filepath . '/stripe/'; | |
| 124 | 117 | if ( preg_match( '/^.+Helper$/', $class_name ) ) { |
| 125 | 118 | $filepath .= 'helpers/'; |
| 126 | 119 | } elseif ( preg_match( '/^.+Controller$/', $class_name ) ) { |
| 127 | 120 | $filepath .= 'controllers/'; |