PluginProbe
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More / 6.4.1
Formidable Forms – WordPress Form Builder for Contact Forms, Calculators, Quizzes & More v6.4.1
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 6.5.4 All 140 releases
formidable / formidable.php

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

127 lines 3.4 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: 6.4.1
6 Plugin URI: https://formidableforms.com/
7 Author URI: https://formidableforms.com/
8 Author: Strategy11 Form Builder Team
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 /**
31 * @return void
32 */
33 function load_formidable_forms() {
34 global $frm_vars;
35 $frm_vars = array(
36 'load_css' => false,
37 'forms_loaded' => array(),
38 'created_entries' => array(),
39 'pro_is_authorized' => false,
40 );
41
42 // For reverse compatibility. Load Pro if it's still nested.
43 $frm_path = dirname( __FILE__ );
44 if ( file_exists( $frm_path . '/pro/formidable-pro.php' ) ) {
45 include( $frm_path . '/pro/formidable-pro.php' );
46 }
47
48 FrmHooksController::trigger_load_hook();
49 }
50
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() ) ) {
53 spl_autoload_register( '__autoload' );
54 }
55
56 // Add the autoloader
57 spl_autoload_register( 'frm_forms_autoloader' );
58
59 /**
60 * @return void
61 */
62 function frm_forms_autoloader( $class_name ) {
63 // Only load Frm classes here
64 if ( ! preg_match( '/^Frm.+$/', $class_name ) || preg_match( '/^FrmPro.+$/', $class_name ) ) {
65 return;
66 }
67
68 frm_class_autoloader( $class_name, dirname( __FILE__ ) );
69 }
70
71 /**
72 * Autoload the Formidable and Pro classes
73 *
74 * @since 3.0
75 *
76 * @return void
77 */
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 );
81
82 if ( $is_deprecated ) {
83 $filepath .= '/deprecated/';
84 } else {
85 $filepath .= '/classes/';
86 if ( preg_match( '/^.+Helper$/', $class_name ) ) {
87 $filepath .= 'helpers/';
88 } else if ( preg_match( '/^.+Controller$/', $class_name ) ) {
89 $filepath .= 'controllers/';
90 } else if ( preg_match( '/^.+Factory$/', $class_name ) ) {
91 $filepath .= 'factories/';
92 } else {
93 $filepath .= 'models/';
94 if ( strpos( $class_name, 'Field' ) && ! file_exists( $filepath . $class_name . '.php' ) ) {
95 $filepath .= 'fields/';
96 }
97 }
98 }
99
100 $filepath .= $class_name . '.php';
101
102 if ( file_exists( $filepath ) ) {
103 require( $filepath );
104 }
105 }
106
107 add_action( 'activate_' . FrmAppHelper::plugin_folder() . '/formidable.php', 'frm_maybe_install' );
108 /**
109 * @return void
110 */
111 function frm_maybe_install() {
112 if ( get_transient( FrmWelcomeController::$option_name ) !== 'no' ) {
113 set_transient( FrmWelcomeController::$option_name, FrmWelcomeController::$menu_slug, 60 );
114 }
115 }
116
117 register_deactivation_hook(
118 __FILE__,
119 function() {
120 if ( ! class_exists( 'FrmCronController', false ) ) {
121 require_once __DIR__ . '/classes/controllers/FrmCronController.php';
122 }
123
124 FrmCronController::remove_crons();
125 }
126 );
127