| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Plugin Name: Multi Step for Contact Form 7 (Lite) |
| 5 |
* Plugin URI: https://ninjateam.org/contact-form-7-multi-step/ |
| 6 |
* Description: Break your long form into user-friendly steps. |
| 7 |
* Version: 2.8.0 |
| 8 |
* Author: NinjaTeam |
| 9 |
* Author URI: http://ninjateam.org |
| 10 |
* Text Domain: cf7-multi-step |
| 11 |
* Domain Path: /languages |
| 12 |
*/ |
| 13 |
if ( ! defined( 'ABSPATH' ) ) { |
| 14 |
exit; |
| 15 |
} |
| 16 |
|
| 17 |
if ( function_exists( 'cf7mls_plugin_init' ) ) { |
| 18 |
require_once plugin_dir_path( __FILE__ ) . 'inc/Fallback.php'; |
| 19 |
add_action( |
| 20 |
'admin_init', |
| 21 |
function() { |
| 22 |
deactivate_plugins( plugin_basename( __FILE__ ) ); |
| 23 |
} |
| 24 |
); |
| 25 |
return; |
| 26 |
} |
| 27 |
|
| 28 |
if ( ! defined( 'CF7MLS_PLUGIN_DIR' ) ) { |
| 29 |
define( 'CF7MLS_PLUGIN_DIR', plugin_dir_path( __FILE__ ) ); |
| 30 |
} |
| 31 |
if ( ! defined( 'CF7MLS_PLUGIN_URL' ) ) { |
| 32 |
define( 'CF7MLS_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
| 33 |
} |
| 34 |
if ( ! defined( 'CF7MLS_PLUGIN_BASENAME' ) ) { |
| 35 |
define( 'CF7MLS_PLUGIN_BASENAME', plugin_basename( __FILE__ ) ); |
| 36 |
} |
| 37 |
if ( ! defined( 'CF7MLS_NTA_VERSION' ) ) { |
| 38 |
define( 'CF7MLS_NTA_VERSION', '2.8.0' ); |
| 39 |
} |
| 40 |
|
| 41 |
spl_autoload_register( |
| 42 |
function ( $class ) { |
| 43 |
$prefix = __NAMESPACE__; |
| 44 |
$base_dir = __DIR__ . '/inc'; |
| 45 |
|
| 46 |
$len = strlen( $prefix ); |
| 47 |
if ( strncmp( $prefix, $class, $len ) !== 0 ) { |
| 48 |
return; |
| 49 |
} |
| 50 |
|
| 51 |
$relative_class_name = substr( $class, $len ); |
| 52 |
|
| 53 |
$file = $base_dir . str_replace( '\\', '/', $relative_class_name ) . '.php'; |
| 54 |
|
| 55 |
if ( file_exists( $file ) ) { |
| 56 |
require $file; |
| 57 |
} |
| 58 |
} |
| 59 |
); |
| 60 |
|
| 61 |
if ( ! function_exists( 'cf7mls_plugin_init' ) ) { |
| 62 |
function cf7mls_plugin_init() { |
| 63 |
// language load text domain |
| 64 |
require_once plugin_dir_path( __FILE__ ) . 'inc/I18n.php'; |
| 65 |
// CF7DB |
| 66 |
require_once plugin_dir_path( __FILE__ ) . 'inc/cf7db.php'; |
| 67 |
// admin |
| 68 |
require_once plugin_dir_path( __FILE__ ) . 'inc/admin/init.php'; |
| 69 |
require_once plugin_dir_path( __FILE__ ) . 'inc/admin/settings.php'; |
| 70 |
require_once plugin_dir_path( __FILE__ ) . 'inc/admin/review.php'; |
| 71 |
require_once plugin_dir_path( __FILE__ ) . 'inc/admin/dashboard-widget.php'; |
| 72 |
// frontend |
| 73 |
require_once plugin_dir_path( __FILE__ ) . 'inc/frontend/init.php'; |
| 74 |
require_once plugin_dir_path( __FILE__ ) . 'inc/frontend/validation.php'; |
| 75 |
} |
| 76 |
} |
| 77 |
if( ! function_exists( 'cf7mls_plugin_after_activate' ) ) { |
| 78 |
function cf7mls_plugin_after_activate() { |
| 79 |
if ( ! get_option( 'cf7mls_activated_time' ) ) { |
| 80 |
update_option( 'cf7mls_activated_time', time() ); |
| 81 |
} |
| 82 |
} |
| 83 |
} |
| 84 |
|
| 85 |
add_action( 'plugins_loaded', 'cf7mls_plugin_init' ); |
| 86 |
|
| 87 |
register_activation_hook( |
| 88 |
__FILE__, |
| 89 |
'cf7mls_plugin_after_activate' |
| 90 |
); |
| 91 |
|
| 92 |
|