PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / 7.8.14.1
Hustle – Email Marketing, Lead Generation, Optins, Popups v7.8.14.1
7.8.14 7.8.14.1 7.8.13 7.8.13.1 trunk 3.0 3.1 3.1.1 3.1.2 3.1.3 3.1.4 4.3.2 4.4.4 4.4.5 4.4.5.1 4.4.5.4 4.6 4.6.1.1 4.6.1.4 4.7.0.2 4.7.0.3 4.7.0.7 4.7.0.9 4.7.1.0 4.7.1.1 4.8.0.0 5.0.0 5.0.1 5.0.1.1 5.0.1.2 5.1 5.1.1 5.1.2 5.1.3 5.1.3.1 5.1.3.2 5.1.4 5.1.5 6.0 6.0.1 6.0.2 6.0.3 6.0.4.2 6.0.5 6.0.6.1 6.0.7 6.0.8.1 6.0.9 7.0.0.1 7.0.2 7.0.3 7.0.4 7.1.0 7.1.1 7.2.0 7.2.1 7.3.0 7.3.1 7.3.3 7.3.5 7.3.6 7.3.7 7.4.0 7.4.1 7.4.11 7.4.13 7.4.13.1 7.4.2 7.4.3 7.4.4 7.4.5 7.4.5.1 7.4.5.2 7.4.6 7.4.7 7.5.0 7.6.0 7.6.1 7.6.3 7.6.4 7.6.6 7.7.0 7.7.1 7.8.0 7.8.1 7.8.10 7.8.10.1 7.8.10.2 7.8.11 7.8.12 7.8.12.1 7.8.2 7.8.3 7.8.4 7.8.5 7.8.6 7.8.7 7.8.8 7.8.9 7.8.9.1 7.8.9.2 7.8.9.3
wordpress-popup / lib / plugins-cross-sell-page / plugin-cross-sell.php
wordpress-popup / lib / plugins-cross-sell-page Last commit date
app 5 months ago assets 5 months ago core 5 months ago languages 5 months ago vendor 5 months ago plugin-cross-sell.php 5 months ago
plugin-cross-sell.php
107 lines
1 <?php
2 /**
3 * WPMUDEV Plugin Cross-Sell module for free plugins.
4 *
5 * Used in free plugins to get a glimpse of other plugins offered by WPMU DEV.
6 *
7 * @version 1.1.0
8 * @author Panos Lyrakis
9 * @link https://wpmudev.com
10 * @package WPMUDEV\Plugin_Cross_Sell
11 */
12
13 namespace WPMUDEV\Modules;
14
15 // If this file is called directly, abort.
16 if ( ! defined( 'WPINC' ) ) {
17 die;
18 }
19
20 // Support for site-level autoloading.
21 if ( file_exists( __DIR__ . '/vendor/autoload.php' ) ) {
22 require_once __DIR__ . '/vendor/autoload.php';
23 }
24
25 // Sub-module version.
26 if ( ! defined( 'WPMUDEV_MODULE_PLUGIN_CROSS_SELL_VERSION' ) ) {
27 define( 'WPMUDEV_MODULE_PLUGIN_CROSS_SELL_VERSION', '1.1.0' );
28 }
29
30 // Sub-module directory.
31 if ( ! defined( 'WPMUDEV_MODULE_PLUGIN_CROSS_SELL_DIR' ) ) {
32 define( 'WPMUDEV_MODULE_PLUGIN_CROSS_SELL_DIR', plugin_dir_path( __FILE__ ) );
33 }
34
35 // Sub-module url.
36 if ( ! defined( 'WPMUDEV_MODULE_PLUGIN_CROSS_SELL_URL' ) ) {
37 define( 'WPMUDEV_MODULE_PLUGIN_CROSS_SELL_URL', plugin_dir_url( __FILE__ ) );
38 }
39
40 // Sub-module Assets url.
41 if ( ! defined( 'WPMUDEV_MODULE_PLUGIN_CROSS_SELL_ASSETS_URL' ) ) {
42 define( 'WPMUDEV_MODULE_PLUGIN_CROSS_SELL_ASSETS_URL', untrailingslashit( WPMUDEV_MODULE_PLUGIN_CROSS_SELL_URL ) . '/assets' );
43 }
44
45 // Shared UI Version.
46 if ( ! defined( 'WPMUDEV_MODULE_PLUGIN_CROSS_SELL_SUI_VERSION' ) ) {
47 define( 'WPMUDEV_MODULE_PLUGIN_CROSS_SELL_SUI_VERSION', '2.12.24' );
48 }
49
50 /**
51 * Sub-module Cross-Sell class.
52 *
53 * @since 1.0.0
54 */
55 if ( ! class_exists( 'WPMUDEV\Modules\Plugin_Cross_Sell' ) ) {
56 /**
57 * Module main class.
58 */
59 final class Plugin_Cross_Sell {
60 /**
61 * The DI container.
62 *
63 * @var Plugin_Cross_Sell\Container
64 */
65 private $container = null;
66
67 /**
68 * Initialize the module.
69 *
70 * @param array $props Module properties.
71 * @since 1.0.0
72 *
73 * @return void
74 */
75 public function __construct( array $props = array() ) {
76 // Prepare the translation directory.
77 $dir = ! empty( $props['translation_dir'] ) ? realpath( $props['translation_dir'] ) : false;
78 $props['translation_dir'] = $dir ? wp_normalize_path( $dir ) : WPMUDEV_MODULE_PLUGIN_CROSS_SELL_DIR . 'languages/';
79
80 // Self-initialization of DI container.
81 $this->container = new Plugin_Cross_Sell\Container();
82 $this->container->set( 'submenu_data', $props );
83 $this->container->set( 'utilities', new Plugin_Cross_Sell\Utilities() );
84
85 $this->load();
86 }
87
88 /**
89 * Class initializer.
90 */
91 public function load(): void {
92 $submenu_params = $this->container->get( 'submenu_data' );
93 $translation_dir = ! empty( $submenu_params['translation_dir'] ) ? $submenu_params['translation_dir'] : WPMUDEV_MODULE_PLUGIN_CROSS_SELL_DIR . 'languages/';
94
95 load_plugin_textdomain(
96 'plugin-cross-sell-textdomain',
97 false,
98 $translation_dir
99 );
100
101 // Create a new Loader instance and pass the DI container.
102 $loader = new Plugin_Cross_Sell\Loader( $this->container );
103 $loader->init();
104 }
105 }
106 }
107