| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* Plugin Name: SiteLeads |
| 5 |
* Description: Capture more leads automatically with a multi-channel contact widget and a free AI assistant that works 24/7. |
| 6 |
* Author: ExtendThemes |
| 7 |
* Author URI: https://extendthemes.com |
| 8 |
* Version: 1.2.1 |
| 9 |
* License: GPL3+ |
| 10 |
* License URI: https://www.gnu.org/licenses/gpl-2.0.txt |
| 11 |
* Text Domain: siteleads |
| 12 |
* Requires PHP: 7.2 |
| 13 |
* Requires at least: 6.8 |
| 14 |
*/ |
| 15 |
|
| 16 |
|
| 17 |
// Exit if accessed directly. |
| 18 |
if ( ! defined( 'ABSPATH' ) ) { |
| 19 |
exit; |
| 20 |
} |
| 21 |
|
| 22 |
|
| 23 |
// skip loading free version if the Pro version is active |
| 24 |
if ( ! function_exists( 'siteleads_is_free_and_pro_already_active' ) ) { |
| 25 |
|
| 26 |
function siteleads_is_free_and_pro_already_active( $base_path ) { |
| 27 |
$free_plugin_slug = 'siteleads'; |
| 28 |
$pro_plugin_slug = "{$free_plugin_slug}-pro"; |
| 29 |
|
| 30 |
$current_slug = dirname( plugin_basename( $base_path ) ); |
| 31 |
|
| 32 |
// if we are not in the free plugin, return false |
| 33 |
if ( $current_slug !== $free_plugin_slug ) { |
| 34 |
return false; |
| 35 |
} |
| 36 |
|
| 37 |
$active_plugins = get_option( 'active_plugins' ); |
| 38 |
|
| 39 |
// check if pro plugin is active |
| 40 |
foreach ( $active_plugins as $plugin ) { |
| 41 |
$active_plugin_slug = dirname( $plugin ); |
| 42 |
if ( $active_plugin_slug === $pro_plugin_slug ) { |
| 43 |
return true; |
| 44 |
} |
| 45 |
} |
| 46 |
|
| 47 |
return false; |
| 48 |
} |
| 49 |
} |
| 50 |
|
| 51 |
if ( siteleads_is_free_and_pro_already_active( __FILE__ ) ) { |
| 52 |
return; |
| 53 |
} |
| 54 |
|
| 55 |
|
| 56 |
if ( defined( 'SITELEADS_VERSION' ) ) { |
| 57 |
return; |
| 58 |
} |
| 59 |
|
| 60 |
|
| 61 |
define( 'SITELEADS_VERSION', '1.2.1' ); |
| 62 |
define( 'SITELEADS_BUILD_NUMBER', '144' ); |
| 63 |
|
| 64 |
define( 'SITELEADS_ROOT_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) ); |
| 65 |
define( 'SITELEADS_ENTRY_FILE', __FILE__ ); |
| 66 |
define( 'SITELEADS_ROOT_DIR', plugin_dir_path( __FILE__ ) ); |
| 67 |
define( 'SITELEADS_LOGO_PATH', SITELEADS_ROOT_DIR . '/assets/icons/logo-icon.svg' ); |
| 68 |
define( 'SITELEADS_LOGO_URL', SITELEADS_ROOT_URL . '/assets/icons/logo-icon.svg' ); |
| 69 |
define( 'SITELEADS_LOGO_SVG', file_get_contents( SITELEADS_LOGO_PATH ) ); |
| 70 |
|
| 71 |
if ( ! defined( 'SITELEADS_DASHBOARD_ROOT_URL' ) ) { |
| 72 |
define( 'SITELEADS_DASHBOARD_ROOT_URL', 'https://cloud.siteleads.ai' ); |
| 73 |
} |
| 74 |
|
| 75 |
if ( ! defined( 'SITELEADS_WEBSITE_URL' ) ) { |
| 76 |
define( 'SITELEADS_WEBSITE_URL', 'https://siteleads.ai' ); |
| 77 |
} |
| 78 |
|
| 79 |
if ( ! function_exists( 'siteleads_url' ) ) { |
| 80 |
function siteleads_url( $path = '' ) { |
| 81 |
return plugins_url( $path, __FILE__ ); |
| 82 |
} |
| 83 |
} |
| 84 |
|
| 85 |
global $siteleads_autoloader; |
| 86 |
$siteleads_autoloader = require_once __DIR__ . '/vendor/autoload.php'; |
| 87 |
|
| 88 |
|
| 89 |
SiteLeads\Bootstrap::load(); |
| 90 |
|