PluginProbe ʕ •ᴥ•ʔ
Hostinger Reach – AI-Powered Email Marketing for WordPress / 1.7.0
Hostinger Reach – AI-Powered Email Marketing for WordPress v1.7.0
1.7.1 1.7.0 1.6.0 1.5.9 1.5.8 1.5.7 1.5.6 1.5.5 1.5.4 1.5.3 1.5.2 1.5.1 1.5.0 1.4.12 1.4.11 1.4.10 1.4.9 1.4.8 1.4.7 trunk 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.2.0 1.2.1 1.2.2 1.2.3 1.2.4 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6
hostinger-reach / hostinger-reach.php
hostinger-reach Last commit date
frontend 1 week ago languages 1 month ago src 1 week ago templates 9 months ago vendor 1 week ago changelog.txt 1 week ago composer.json 2 months ago hostinger-reach.php 1 week ago package.json 1 week ago readme.txt 1 week ago
hostinger-reach.php
99 lines
1 <?php
2 /**
3 * Plugin Name: Hostinger Reach
4 * Plugin URI: https://hostinger.com
5 * Description: Integrate your WordPress site with Hostinger Reach.
6 * Version: 1.7.0
7 * Author: Hostinger
8 * Requires PHP: 8.1
9 * Requires at least: 6.0
10 * Tested up to: 7.0
11 * Author URI: https://www.hostinger.com/email-marketing
12 * License: GPL-2.0+
13 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
14 * Text Domain: hostinger-reach
15 * Domain Path: /languages
16 *
17 * @package HostingerReach
18 */
19
20 use Hostinger\Reach\Setup\Activator;
21 use Hostinger\WpMenuManager\Manager;
22 use Hostinger\Surveys\Loader;
23
24 if ( ! defined( 'ABSPATH' ) ) {
25 die;
26 }
27
28 define( 'HOSTINGER_REACH_PLUGIN_VERSION', '1.7.0' );
29 define( 'HOSTINGER_REACH_DB_VERSION', '1.2.1' );
30 define( 'HOSTINGER_REACH_MINIMUM_PHP_VERSION', '8.0' );
31 define( 'HOSTINGER_REACH_PLUGIN_FILE', __FILE__ );
32 define( 'HOSTINGER_REACH_PLUGIN_SLUG', basename( __FILE__, '.php' ) );
33 define( 'HOSTINGER_REACH_PLUGIN_URL', plugin_dir_url( HOSTINGER_REACH_PLUGIN_FILE ) );
34 define( 'HOSTINGER_REACH_PLUGIN_DIR', plugin_dir_path( __FILE__ ) );
35 define( 'HOSTINGER_REACH_PLUGIN_REST_API_BASE', 'hostinger-reach/v1' );
36 define( 'HOSTINGER_REACH_REST_URI', 'https://reach.hostinger.com' );
37 define( 'HOSTINGER_REACH_DEFAULT_CONTACT_LIST', 'WordPress' );
38 define( 'HOSTINGER_INTEGRATIONS_SUPPORTED', true );
39 define( 'HOSTINGER_REACH_DEFAULT_ABANDONED_CART_THRESHOLD', 4 * HOUR_IN_SECONDS );
40
41 $hostinger_dir_parts = explode( '/', __DIR__ );
42 $hostinger_server_root_path = '/' . $hostinger_dir_parts[1] . '/' . $hostinger_dir_parts[2];
43 define( 'HOSTINGER_REACH_WP_TOKEN', $hostinger_server_root_path . '/.api_token' );
44
45 if ( ! version_compare( phpversion(), HOSTINGER_REACH_MINIMUM_PHP_VERSION, '>=' ) ) {
46 add_action(
47 'admin_notices',
48 function (): void {
49 ?>
50 <div class="notice notice-error is-dismissible hts-theme-settings">
51 <p>
52 <strong><?php echo esc_html( __( 'Attention:', 'hostinger-reach' ) ); ?></strong>
53 <?php /* translators: %s: PHP version */ ?>
54 <?php echo esc_html( sprintf( __( 'Hostinger Reach requires minimum PHP version of <b>%s</b>. ', 'hostinger-reach' ), HOSTINGER_REACH_MINIMUM_PHP_VERSION ) ); ?>
55 </p>
56 <p>
57 <?php /* translators: %s: PHP version */ ?>
58 <?php echo esc_html( sprintf( __( 'You are running <b>%s</b> PHP version.', 'hostinger-reach' ), phpversion() ) ); ?>
59 </p>
60 </div>
61 <?php
62 }
63 );
64
65 return;
66 }
67
68 $vendor_file = __DIR__ . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload_packages.php';
69
70 if ( file_exists( $vendor_file ) ) {
71 require_once $vendor_file;
72 }
73
74 if ( class_exists( 'Hostinger\Reach\Setup\Activator' ) ) {
75 new Activator( __FILE__ );
76 }
77
78 if ( ! function_exists( 'hostinger_load_menus' ) ) {
79 function hostinger_load_menus(): void {
80 $manager = Manager::getInstance();
81 $manager->boot();
82 }
83 }
84
85 if ( ! has_action( 'plugins_loaded', 'hostinger_load_menus' ) ) {
86 add_action( 'plugins_loaded', 'hostinger_load_menus' );
87 }
88
89 if ( ! function_exists( 'hostinger_add_surveys' ) ) {
90 function hostinger_add_surveys(): void {
91 $surveys = Loader::getInstance();
92 $surveys->boot();
93 }
94 }
95
96 if ( ! empty( $_SERVER['H_PLATFORM'] ) && ! has_action( 'plugins_loaded', 'hostinger_add_surveys' ) ) {
97 add_action( 'plugins_loaded', 'hostinger_add_surveys' );
98 }
99