| 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 https://catchplugins.com |
| 12 |
* @since 1.0.0 |
| 13 |
* @package Essential_Widgets |
| 14 |
* |
| 15 |
* @wordpress-plugin |
| 16 |
* Plugin Name: Essential Widgets |
| 17 |
* Plugin URI: https://catchplugins.com/plugins/essential-widgets/ |
| 18 |
* Description: Essential Widgets is a WordPress plugin for widgets that allows you to create and add amazing widgets with high customization option on your website without affecting your wallet. |
| 19 |
* Version: 1.1 |
| 20 |
* Author: Catch Plugins |
| 21 |
* Author URI: https://catchplugins.com/ |
| 22 |
* License: GPL-2.0+ |
| 23 |
* License URI: http://www.gnu.org/licenses/gpl-2.0.txt |
| 24 |
* Text Domain: essential-widgets |
| 25 |
* Domain Path: /languages |
| 26 |
*/ |
| 27 |
|
| 28 |
// If this file is called directly, abort. |
| 29 |
if ( ! defined( 'WPINC' ) ) { |
| 30 |
die; |
| 31 |
} |
| 32 |
|
| 33 |
/** |
| 34 |
* The code that runs during plugin activation. |
| 35 |
* This action is documented in includes/class-essential-widgets-activator.php |
| 36 |
*/ |
| 37 |
function activate_essential_widgets() { |
| 38 |
$required = 'essential-widgets-pro/essential-widgets-pro.php'; |
| 39 |
if ( is_plugin_active( $required ) ) { |
| 40 |
$message = esc_html__( 'Sorry, Pro version is already active. No need to activate Free version. If you still want to activate the Free version, please deactivate the Pro version first. %1$s« Return to Plugins%2$s.', 'essential-widgets' ); |
| 41 |
$message = sprintf( $message, '<br><a href="' . esc_url( admin_url( 'plugins.php' ) ) . '">', '</a>' ); |
| 42 |
wp_die( $message ); |
| 43 |
} |
| 44 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-essential-widgets-activator.php'; |
| 45 |
Essential_Widgets_Activator::activate(); |
| 46 |
} |
| 47 |
|
| 48 |
/** |
| 49 |
* The code that runs during plugin deactivation. |
| 50 |
* This action is documented in includes/class-essential-widgets-deactivator.php |
| 51 |
*/ |
| 52 |
function deactivate_essential_widgets() { |
| 53 |
require_once plugin_dir_path( __FILE__ ) . 'includes/class-essential-widgets-deactivator.php'; |
| 54 |
Essential_Widgets_Deactivator::deactivate(); |
| 55 |
} |
| 56 |
|
| 57 |
register_activation_hook( __FILE__, 'activate_essential_widgets' ); |
| 58 |
register_deactivation_hook( __FILE__, 'deactivate_essential_widgets' ); |
| 59 |
|
| 60 |
/** |
| 61 |
* The core plugin class that is used to define internationalization, |
| 62 |
* admin-specific hooks, and public-facing site hooks. |
| 63 |
*/ |
| 64 |
require plugin_dir_path( __FILE__ ) . 'includes/class-essential-widgets.php'; |
| 65 |
|
| 66 |
|
| 67 |
function essential_widgets_sanitize_checkbox( $checked ) { |
| 68 |
// Boolean check. |
| 69 |
return ( ( isset( $checked ) && true == $checked ) ? true : false ); |
| 70 |
} |
| 71 |
|
| 72 |
/** |
| 73 |
* Begins execution of the plugin. |
| 74 |
* |
| 75 |
* Since everything within the plugin is registered via hooks, |
| 76 |
* then kicking off the plugin from this point in the file does |
| 77 |
* not affect the page life cycle. |
| 78 |
* |
| 79 |
* @since 1.0.0 |
| 80 |
*/ |
| 81 |
function run_essential_widgets() { |
| 82 |
|
| 83 |
$plugin = new Essential_Widgets(); |
| 84 |
$plugin->run(); |
| 85 |
|
| 86 |
} |
| 87 |
run_essential_widgets(); |
| 88 |
|