| @@ -1,12 +1,12 @@ | ||
| 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.5 | |
| 5 | +Version: 5.0 | |
| 6 | 6 | Plugin URI: https://formidableforms.com/ |
| 7 | 7 | Author URI: https://formidableforms.com/ |
| 8 | -Author: Strategy11 Form Builder Team | |
| 8 | +Author: Strategy11 | |
| 9 | 9 | Text Domain: formidable |
| 10 | 10 | */ |
| 11 | 11 | |
| 12 | 12 | /* |
| @@ -26,11 +26,8 @@ | ||
| 26 | 26 | die( 'You are not allowed to call this page directly.' ); |
| 27 | 27 | } |
| 28 | 28 | |
| 29 | 29 | add_action( 'plugins_loaded', 'load_formidable_forms', 0 ); |
| 30 | -/** | |
| 31 | - * @return void | |
| 32 | - */ | |
| 33 | 30 | function load_formidable_forms() { |
| 34 | 31 | global $frm_vars; |
| 35 | 32 | $frm_vars = array( |
| 36 | 33 | 'load_css' => false, |
| @@ -48,9 +45,9 @@ | ||
| 48 | 45 | FrmHooksController::trigger_load_hook(); |
| 49 | 46 | } |
| 50 | 47 | |
| 51 | 48 | // if __autoload is active, put it on the spl_autoload stack |
| 52 | -if ( is_array( spl_autoload_functions() ) && in_array( '__autoload', spl_autoload_functions(), true ) ) { | |
| 49 | +if ( is_array( spl_autoload_functions() ) && in_array( '__autoload', spl_autoload_functions() ) ) { | |
| 53 | 50 | spl_autoload_register( '__autoload' ); |
| 54 | 51 | } |
| 55 | 52 | |
| 56 | 53 | // Add the autoloader |
| @@ -55,11 +52,8 @@ | ||
| 55 | 52 | |
| 56 | 53 | // Add the autoloader |
| 57 | 54 | spl_autoload_register( 'frm_forms_autoloader' ); |
| 58 | 55 | |
| 59 | -/** | |
| 60 | - * @return void | |
| 61 | - */ | |
| 62 | 56 | function frm_forms_autoloader( $class_name ) { |
| 63 | 57 | // Only load Frm classes here |
| 64 | 58 | if ( ! preg_match( '/^Frm.+$/', $class_name ) || preg_match( '/^FrmPro.+$/', $class_name ) ) { |
| 65 | 59 | return; |
| @@ -71,15 +65,12 @@ | ||
| 71 | 65 | /** |
| 72 | 66 | * Autoload the Formidable and Pro classes |
| 73 | 67 | * |
| 74 | 68 | * @since 3.0 |
| 75 | - * | |
| 76 | - * @return void | |
| 77 | 69 | */ |
| 78 | 70 | 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 ); | |
| 81 | - $original_filepath = $filepath; | |
| 71 | + $deprecated = array( 'FrmEntryFormat', 'FrmPointers', 'FrmEDD_SL_Plugin_Updater' ); | |
| 72 | + $is_deprecated = in_array( $class_name, $deprecated ) || preg_match( '/^.+Deprecate/', $class_name ); | |
| 82 | 73 | |
| 83 | 74 | if ( $is_deprecated ) { |
| 84 | 75 | $filepath .= '/deprecated/'; |
| 85 | 76 | } else { |
| @@ -85,11 +76,11 @@ | ||
| 85 | 76 | } else { |
| 86 | 77 | $filepath .= '/classes/'; |
| 87 | 78 | if ( preg_match( '/^.+Helper$/', $class_name ) ) { |
| 88 | 79 | $filepath .= 'helpers/'; |
| 89 | - } elseif ( preg_match( '/^.+Controller$/', $class_name ) ) { | |
| 80 | + } else if ( preg_match( '/^.+Controller$/', $class_name ) ) { | |
| 90 | 81 | $filepath .= 'controllers/'; |
| 91 | - } elseif ( preg_match( '/^.+Factory$/', $class_name ) ) { | |
| 82 | + } else if ( preg_match( '/^.+Factory$/', $class_name ) ) { | |
| 92 | 83 | $filepath .= 'factories/'; |
| 93 | 84 | } else { |
| 94 | 85 | $filepath .= 'models/'; |
| 95 | 86 | if ( strpos( $class_name, 'Field' ) && ! file_exists( $filepath . $class_name . '.php' ) ) { |
| @@ -97,56 +88,17 @@ | ||
| 97 | 88 | } |
| 98 | 89 | } |
| 99 | 90 | } |
| 100 | 91 | |
| 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 | - | |
| 121 | 92 | $filepath .= $class_name . '.php'; |
| 122 | 93 | |
| 123 | 94 | if ( file_exists( $filepath ) ) { |
| 124 | - require $filepath; | |
| 95 | + require( $filepath ); | |
| 125 | 96 | } |
| 126 | 97 | } |
| 127 | 98 | |
| 128 | 99 | add_action( 'activate_' . FrmAppHelper::plugin_folder() . '/formidable.php', 'frm_maybe_install' ); |
| 129 | - | |
| 130 | -/** | |
| 131 | - * This function is triggered when Formidable is activated. | |
| 132 | - * | |
| 133 | - * @return void | |
| 134 | - */ | |
| 135 | 100 | function frm_maybe_install() { |
| 136 | 101 | if ( get_transient( FrmWelcomeController::$option_name ) !== 'no' ) { |
| 137 | 102 | set_transient( FrmWelcomeController::$option_name, FrmWelcomeController::$menu_slug, 60 ); |
| 138 | 103 | } |
| 139 | - | |
| 140 | - FrmAppController::handle_activation(); | |
| 141 | 104 | } |
| 142 | - | |
| 143 | -register_deactivation_hook( | |
| 144 | - __FILE__, | |
| 145 | - function() { | |
| 146 | - if ( ! class_exists( 'FrmCronController', false ) ) { | |
| 147 | - require_once __DIR__ . '/classes/controllers/FrmCronController.php'; | |
| 148 | - } | |
| 149 | - | |
| 150 | - FrmCronController::remove_crons(); | |
| 151 | - } | |
| 152 | -); | |