PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 4.01.02
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v4.01.02
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
formidable / formidable.php

formidable.php in Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More 4.01.02, at formidable.php

97 lines 2.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: Formidable Forms
4 Description: Quickly and easily create drag-and-drop forms
5 Version: 4.01.02
6 Plugin URI: https://formidableforms.com/
7 Author URI: https://formidableforms.com/
8 Author: Strategy11
9 Text Domain: formidable
10 */
11
12 /*
13 Copyright 2010 Formidable Forms
14
15 This program is free software; you can redistribute it and/or modify
16 it under the terms of the GNU General Public License, version 2, as
17 published by the Free Software Foundation.
18
19 This program is distributed in the hope that it will be useful,
20 but WITHOUT ANY WARRANTY; without even the implied warranty of
21 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
22 GNU General Public License for more details.
23 */
24
25 if ( ! defined( 'ABSPATH' ) ) {
26 die( 'You are not allowed to call this page directly.' );
27 }
28
29 add_action( 'plugins_loaded', 'load_formidable_forms', 0 );
30 function load_formidable_forms() {
31 global $frm_vars;
32 $frm_vars = array(
33 'load_css' => false,
34 'forms_loaded' => array(),
35 'created_entries' => array(),
36 'pro_is_authorized' => false,
37 );
38
39 $frm_path = dirname( __FILE__ );
40 if ( file_exists( $frm_path . '/pro/formidable-pro.php' ) ) {
41 include( $frm_path . '/pro/formidable-pro.php' );
42 }
43
44 FrmHooksController::trigger_load_hook();
45 }
46
47 // if __autoload is active, put it on the spl_autoload stack
48 if ( is_array( spl_autoload_functions() ) && in_array( '__autoload', spl_autoload_functions() ) ) {
49 spl_autoload_register( '__autoload' );
50 }
51
52 // Add the autoloader
53 spl_autoload_register( 'frm_forms_autoloader' );
54
55 function frm_forms_autoloader( $class_name ) {
56 // Only load Frm classes here
57 if ( ! preg_match( '/^Frm.+$/', $class_name ) || preg_match( '/^FrmPro.+$/', $class_name ) ) {
58 return;
59 }
60
61 frm_class_autoloader( $class_name, dirname( __FILE__ ) );
62 }
63
64 /**
65 * Autoload the Formidable and Pro classes
66 *
67 * @since 3.0
68 */
69 function frm_class_autoloader( $class_name, $filepath ) {
70 $deprecated = array( 'FrmEntryFormat', 'FrmPointers', 'FrmEDD_SL_Plugin_Updater' );
71 $is_deprecated = in_array( $class_name, $deprecated ) || preg_match( '/^.+Deprecate/', $class_name );
72
73 if ( $is_deprecated ) {
74 $filepath .= '/deprecated/';
75 } else {
76 $filepath .= '/classes/';
77 if ( preg_match( '/^.+Helper$/', $class_name ) ) {
78 $filepath .= 'helpers/';
79 } else if ( preg_match( '/^.+Controller$/', $class_name ) ) {
80 $filepath .= 'controllers/';
81 } else if ( preg_match( '/^.+Factory$/', $class_name ) ) {
82 $filepath .= 'factories/';
83 } else {
84 $filepath .= 'models/';
85 if ( strpos( $class_name, 'Field' ) && ! file_exists( $filepath . $class_name . '.php' ) ) {
86 $filepath .= 'fields/';
87 }
88 }
89 }
90
91 $filepath .= $class_name . '.php';
92
93 if ( file_exists( $filepath ) ) {
94 require( $filepath );
95 }
96 }
97