| 1 |
<?php |
| 2 |
/** |
| 3 |
* Plugin name: Email Marketing for WordPress and WooCommerce - Retainful |
| 4 |
* Plugin URI: https://www.retainful.com |
| 5 |
* Description: Email marketing, newsletters for WordPress and WooCommerce. Send newsletters and campaigns, recover abandoned carts, signup forms, and more |
| 6 |
* Author: Retainful |
| 7 |
* Version: 1.0.7 |
| 8 |
* Slug: retainful |
| 9 |
* Text Domain: retainful |
| 10 |
* Domain Path: /i18n/languages/ |
| 11 |
* Requires at least: 6.5 |
| 12 |
* License: GPLv2 or later |
| 13 |
* Requires PHP: 7.4 |
| 14 |
*/ |
| 15 |
|
| 16 |
use RTFL\App\Helpers\Plugins; |
| 17 |
use RTFL\App\Route; |
| 18 |
use RTFL\App\Setup; |
| 19 |
use Automattic\WooCommerce\Utilities\FeaturesUtil; |
| 20 |
|
| 21 |
defined( 'ABSPATH' ) or exit; |
| 22 |
|
| 23 |
// declare WooCommerce feature compatibility |
| 24 |
add_action( 'before_woocommerce_init', function () { |
| 25 |
if ( class_exists( FeaturesUtil::class ) ) { |
| 26 |
FeaturesUtil::declare_compatibility( 'custom_order_tables', __FILE__, true ); |
| 27 |
} |
| 28 |
} ); |
| 29 |
|
| 30 |
defined( 'RTFL_PLUGIN_NAME' ) or define( 'RTFL_PLUGIN_NAME', 'Retainful' ); |
| 31 |
defined( 'RTFL_VERSION' ) or define( 'RTFL_VERSION', "1.0.7" ); |
| 32 |
defined( 'RTFL_PLUGIN_SLUG' ) or define( 'RTFL_PLUGIN_SLUG', "retainful" ); |
| 33 |
defined( 'RTFL_PLUGIN_PATH' ) or define( 'RTFL_PLUGIN_PATH', plugin_dir_path( __FILE__ ) ); |
| 34 |
defined( 'RTFL_PLUGIN_URL' ) or define( 'RTFL_PLUGIN_URL', plugin_dir_url( __FILE__ ) ); |
| 35 |
defined( 'RTFL_PLUGIN_FILE' ) or define( 'RTFL_PLUGIN_FILE', __FILE__ ); |
| 36 |
defined( 'RTFL_PLUGIN_PREFIX' ) or define( 'RTFL_PLUGIN_PREFIX', 'rtfl_' ); |
| 37 |
defined( 'RTFL_REQUIRED_PHP_VERSION' ) or define( 'RTFL_REQUIRED_PHP_VERSION', '7.4.0' ); |
| 38 |
defined( 'RTFL_REQUIRED_WP_VERSION' ) or define( 'RTFL_REQUIRED_WP_VERSION', '6.5.0' ); |
| 39 |
defined( 'RTFL_WC_REQUIRED_VERSION' ) or define( 'RTFL_WC_REQUIRED_VERSION', '7.1.0' ); |
| 40 |
|
| 41 |
|
| 42 |
//autoloader |
| 43 |
if ( ! file_exists( RTFL_PLUGIN_PATH . '/vendor/autoload.php' ) ) { |
| 44 |
return; |
| 45 |
} |
| 46 |
require RTFL_PLUGIN_PATH . '/vendor/autoload.php'; // Autoload the vendor |
| 47 |
|
| 48 |
if ( ! class_exists( '\RTFL\App\Setup' ) ) { |
| 49 |
return; |
| 50 |
} |
| 51 |
// Setup init, it will check plugin activation and other stuff |
| 52 |
if ( class_exists( '\RTFL\App\Setup' ) ) { |
| 53 |
Setup::init(); |
| 54 |
} |
| 55 |
|
| 56 |
// Initialize the plugin on the 'init' hook to ensure translations are loaded properly |
| 57 |
add_action( 'plugins_loaded', function () { |
| 58 |
if ( Plugins::checkDependencies() ) { |
| 59 |
Route::init(); |
| 60 |
} |
| 61 |
} ); |