| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* The plugin bootstrap file |
| 5 |
* |
| 6 |
* This file is read by WordPress to generate the plugin information in the plugin |
| 7 |
* admin area. This file also includes all of the dependencies used by the plugin, |
| 8 |
* registers the activation and deactivation functions, and defines a function |
| 9 |
* that starts the plugin. |
| 10 |
* |
| 11 |
* @link http://example.com |
| 12 |
* @since 1.0.0 |
| 13 |
* @package Doppler |
| 14 |
* |
| 15 |
* @wordpress-plugin |
| 16 |
* Plugin Name: Doppler Forms |
| 17 |
* Description: Crea Formularios de Suscripción con la misma estética de tu sitio web o blog en minutos. Conéctalo con Doppler y envía a tus nuevos contactos automáticamente a una Lista de Suscriptores. |
| 18 |
* Version: 2.5.0 |
| 19 |
* Author: Doppler LLC |
| 20 |
* Author URI: https://www.fromdoppler.com/ |
| 21 |
* License: GPL-2.0+ |
| 22 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 23 |
* Text Domain: doppler-form |
| 24 |
* Domain Path: /languages |
| 25 |
*/ |
| 26 |
|
| 27 |
// If this file is called directly, abort. |
| 28 |
if ( ! defined( 'WPINC' ) ) { |
| 29 |
die; |
| 30 |
} |
| 31 |
|
| 32 |
if( !defined('DOPPLER_FORM_VERSION') ) define( 'DOPPLER_FORM_VERSION', '2.5.0' ); |
| 33 |
if( !defined('WP_DEBUG_LOG_DOPPLER_PLUGINS') ) define( 'WP_DEBUG_LOG_DOPPLER_PLUGINS', false ); |
| 34 |
|
| 35 |
if( !defined('DOPPLER_PLUGINS_PATH') ) define('DOPPLER_PLUGINS_PATH', plugin_dir_path(__DIR__)); |
| 36 |
if( !defined('DOPPLER_PLUGIN_URL') ) define('DOPPLER_PLUGIN_URL', plugin_dir_url( __FILE__ )); |
| 37 |
|
| 38 |
include_once( ABSPATH . 'wp-admin/includes/plugin.php' ); |
| 39 |
if( is_plugin_active('Plugin/doppler-form.php') ) { |
| 40 |
|
| 41 |
deactivate_plugins( plugin_basename( __FILE__ ) ); |
| 42 |
// Throw an error in the WordPress admin console. |
| 43 |
$error_message = '<p style="font-family:-apple-system,BlinkMacSystemFont,\'Segoe UI\',Roboto,Oxygen-Sans,Ubuntu,Cantarell,\'Helvetica Neue\',sans-serif;font-size: 13px;line-height: 1.5;color:#444;">' . esc_html__( 'You have to uninstall version 1.1 of Doppler Form before installing version 2.0 ', 'doppler-form' ) . '</p>'; |
| 44 |
die( $error_message ); // WPCS: XSS ok. |
| 45 |
|
| 46 |
} |
| 47 |
|
| 48 |
/** |
| 49 |
* The code that runs during plugin activation. |
| 50 |
* This action is documented in includes/class-plugin-name-activator.php |
| 51 |
*/ |
| 52 |
function activate_doppler() { |
| 53 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-doppler-form-activator.php'; |
| 54 |
Doppler_Activator::activate(); |
| 55 |
} |
| 56 |
|
| 57 |
/** |
| 58 |
* The code that runs during plugin deactivation. |
| 59 |
* This action is documented in includes/class-plugin-name-deactivator.php |
| 60 |
*/ |
| 61 |
function deactivate_doppler() { |
| 62 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-doppler-form-deactivator.php'; |
| 63 |
Doppler_Deactivator::deactivate(); |
| 64 |
} |
| 65 |
|
| 66 |
register_activation_hook( __FILE__, 'activate_doppler' ); |
| 67 |
//register_deactivation_hook( __FILE__, 'deactivate_doppler' ); |
| 68 |
|
| 69 |
/** |
| 70 |
* The core plugin class that is used to define internationalization, |
| 71 |
* admin-specific hooks, and public-facing site hooks. |
| 72 |
*/ |
| 73 |
require plugin_dir_path( __FILE__ ) . 'includes/class-doppler-form.php'; |
| 74 |
|
| 75 |
//This action has to be added to the main plugin file to ensure that the Elementor integration script is loaded correctly. |
| 76 |
add_action('elementor/editor/after_enqueue_scripts', function() { |
| 77 |
wp_enqueue_script( |
| 78 |
'doppler-elementor', |
| 79 |
plugin_dir_url(__FILE__) . 'admin/js/doppler-elementor.js', |
| 80 |
array('jquery'), |
| 81 |
'1.0.0', |
| 82 |
true |
| 83 |
); |
| 84 |
}); |
| 85 |
/** |
| 86 |
* Begins execution of the plugin. |
| 87 |
* |
| 88 |
* Since everything within the plugin is registered via hooks, |
| 89 |
* then kicking off the plugin from this point in the file does |
| 90 |
* not affect the page life cycle. |
| 91 |
* |
| 92 |
* @since 1.0.0 |
| 93 |
*/ |
| 94 |
function run_doppler() { |
| 95 |
|
| 96 |
$plugin = new DPLR_Doppler(); |
| 97 |
$plugin->run(); |
| 98 |
|
| 99 |
} |
| 100 |
run_doppler(); |
| 101 |
|