-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsmaily-for-contact-form-7.php
82 lines (76 loc) · 2.85 KB
/
smaily-for-contact-form-7.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
<?php
/**
* The plugin bootstrap file
*
* This file is read by WordPress to generate the plugin information in the plugin
* admin area. This file also includes all of the dependencies used by the plugin,
* registers the activation and deactivation functions, and defines a function
* that starts the plugin.
*
* @link https://github.com/sendsmaily/smaily-cf7-plugin
* @since 1.0.0
* @package Smaily_For_CF7
*
* @wordpress-plugin
* Plugin Name: Smaily for Contact Form 7
* Plugin URI: https://github.com/sendsmaily/smaily-cf7-plugin
* Description: Integrate Contact Form 7 form(s) with Smaily to add subscribers directly to Smaily and trigger marketing automations.
* Version: 1.0.9
* License: GPL3
* Author: Smaily
* Author URI: https://smaily.com/
* Text Domain: smaily-for-contact-form-7
* Domain Path: languages
*
* Smaily for Contact Form 7 is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* any later version.
*
* Smaily for Contact Form 7 is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with Smaily for Contact Form 7. If not, see <http://www.gnu.org/licenses/>.
*/
// If accessed directly exit program.
defined( 'ABSPATH' ) || die( "This is a plugin you can't access directly" );
// Required to use functions is_plugin_active and deactivate_plugins.
require_once ABSPATH . 'wp-admin/includes/plugin.php';
define( 'SMAILY_FOR_CF7_VERSION', '1.0.9' );
/**
* The core plugin class that is used to define
* admin-specific hook and public-facing site hooks.
*/
require plugin_dir_path( __FILE__ ) . 'includes/class-smaily-for-cf7.php';
/**
* Load translations files.
*
* @since 1.0.2
*/
function smaily_for_cf7_load_textdomain() {
load_plugin_textdomain( 'smaily-for-contact-form-7', false, plugin_dir_path( __FILE__ ) . '/languages/' );
}
add_action( 'plugins_loaded', 'smaily_for_cf7_load_textdomain' );
/**
* Begins execution of the plugin.
*
* @since 1.0.0
*/
function run_smaily_for_cf7() {
$plugin = new Smaily_For_CF7();
// Check if Contact Form 7 is installed and activate plugin only if it is.
if ( ! is_plugin_active( 'contact-form-7/wp-contact-form-7.php' ) ) {
deactivate_plugins( plugin_basename( __FILE__ ), false );
$message = __(
'Smaily for Contact Form 7 is not able to activate. ' .
'Contact Form 7 is needed to function properly. Is Contact Form 7 installed and activated?',
'smaily-for-contact-form-7'
);
wp_die( esc_html( $message ) );
}
$plugin->run();
}
run_smaily_for_cf7();