PluginProbe ʕ •ᴥ•ʔ
Hustle – Email Marketing, Lead Generation, Optins, Popups / 7.8.11
Hustle – Email Marketing, Lead Generation, Optins, Popups v7.8.11
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 / popover.php
wordpress-popup Last commit date
assets 3 months ago inc 3 months ago languages 3 months ago lib 5 months ago vendor 3 months ago views 3 months ago humans.txt 2 years ago license.txt 5 years ago popover.php 3 months ago readme.txt 3 months ago uninstall.php 5 months ago
popover.php
228 lines
1 <?php // phpcs:ignore WordPress.Files.FileName.InvalidClassFileName
2 /**
3 * Hustle plugin.
4 *
5 * @link http://wpmudev.com/projects/hustle/
6 * @since 1.0.0
7 * @package Hustle
8 *
9 * @wordpress-plugin
10 * Plugin Name: Hustle
11 * Plugin URI: https://wordpress.org/plugins/wordpress-popup/
12 * Description: Start collecting email addresses and quickly grow your mailing list with big bold pop-ups, slide-ins, widgets, or in post opt-in forms.
13 * Version: 7.8.11
14 * Author: WPMU DEV
15 * Author URI: https://wpmudev.com
16 * Tested up to: 6.9
17 * Requires at least: 6.4
18 * Requires PHP: 7.4
19 * Text Domain: hustle
20 *
21 */
22
23 // +----------------------------------------------------------------------+
24 // | Copyright Incsub (http://incsub.com/) |
25 // +----------------------------------------------------------------------+
26 // | This program is free software; you can redistribute it and/or modify |
27 // | it under the terms of the GNU General Public License, version 2, as |
28 // | published by the Free Software Foundation. |
29 // | |
30 // | This program is distributed in the hope that it will be useful, |
31 // | but WITHOUT ANY WARRANTY; without even the implied warranty of |
32 // | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
33 // | GNU General Public License for more details. |
34 // | |
35 // | You should have received a copy of the GNU General Public License |
36 // | along with this program; if not, write to the Free Software |
37 // | Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, |
38 // | MA 02110-1301 USA |
39 // +----------------------------------------------------------------------+
40
41 if ( ! defined( 'HUSTLE_MIN_PHP_VERSION' ) ) {
42 define( 'HUSTLE_MIN_PHP_VERSION', '7.4' );
43 }
44
45 if ( ! defined( 'HUSTLE_BASE_FILE' ) ) {
46 define( 'HUSTLE_BASE_FILE', __FILE__ );
47 }
48
49 if ( ! function_exists( 'hustle_insecure_php_version_notice' ) ) {
50 /**
51 * Display admin notice, if the site is using unsupported PHP version.
52 */
53 function hustle_insecure_php_version_notice() {
54
55 ?>
56 <div class="notice notice-error">
57 <p>
58 <?php
59 printf(
60 wp_kses( /* translators: %1$s - URL to an article about our hosting benefits. */
61 __( 'Your site is running an outdated version of PHP that is no longer supported or receiving security updates. Please update PHP to at least version %1$s at your current hosting provider in order to activate Hustle, or consider switching to <a href="%2$s" target="_blank" rel="noopener noreferrer">WPMU DEV Hosting</a>.', 'hustle' ),
62 array(
63 'a' => array(
64 'href' => array(),
65 'target' => array(),
66 'rel' => array(),
67 ),
68 'strong' => array(),
69 )
70 ),
71 esc_html( HUSTLE_MIN_PHP_VERSION ),
72 'https://wpmudev.com/hosting/'
73 );
74 ?>
75 </p>
76 </div>
77
78 <?php
79
80 // In case this is on plugin activation.
81 if ( isset( $_GET['activate'] ) ) { //phpcs:ignore
82 unset( $_GET['activate'] ); //phpcs:ignore
83 }
84 }
85 }
86
87 /**
88 * Display admin notice and prevent plugin code execution, if the server is
89 * using old/insecure PHP version.
90 */
91 if ( version_compare( phpversion(), HUSTLE_MIN_PHP_VERSION, '<' ) ) {
92 add_action( 'admin_notices', 'hustle_insecure_php_version_notice' );
93
94 return;
95 }
96
97
98 add_action( 'activated_plugin', 'hustle_activated', 10, 2 );
99
100 if ( ! function_exists( 'hustle_activated' ) ) {
101
102 /**
103 * Handles the deactivation of the free version if "pro" is active, and activation flags.
104 *
105 * @since unknown
106 *
107 * @param string $plugin Path to the plugin file relative to the plugins directory.
108 * @param bool $network_activation Whether to enable the plugin for all sites in the network or just the current site.
109 */
110 function hustle_activated( $plugin, $network_activation ) {
111
112 if ( is_plugin_active( 'hustle/opt-in.php' ) && is_plugin_active( 'wordpress-popup/popover.php' ) ) {
113
114 // deactivate free version.
115 deactivate_plugins( 'wordpress-popup/popover.php' );
116
117 if ( 'hustle/opt-in.php' === $plugin ) {
118 // Store in database about free version deactivated, in order to show a notice on page load.
119 update_site_option( 'hustle_free_deactivated', 1 );
120 } elseif ( 'wordpress-popup/popover.php' === $plugin ) {
121 // Store in database about free version being activated even pro is already active.
122 update_site_option( 'hustle_free_activated', 1 );
123 }
124 }
125 }
126 }
127
128 // Require autoloader.
129 if ( ! class_exists( 'ComposerAutoloaderInitd45a15be3ceca75ee1c0c2f87d2b07c1' ) ) {
130 require_once __DIR__ . '/vendor/autoload.php';
131 }
132
133 if ( ! defined( 'HUSTLE_SUI_VERSION' ) ) {
134 define( 'HUSTLE_SUI_VERSION', '2.12.25' );
135 }
136
137 if ( ! class_exists( 'Opt_In' ) ) {
138 require_once __DIR__ . '/inc/class-opt-in.php';
139 }
140
141 if ( ! function_exists( 'hustle_init' ) ) {
142
143 /**
144 * Instantiate Opt_In
145 */
146 function hustle_init() {
147 new Opt_In();
148 }
149
150 add_action( 'after_setup_theme', 'hustle_init' );
151 }
152
153 if ( ! function_exists( 'hustle_activation' ) ) {
154
155 /**
156 * Handle tables creating if needed.
157 *
158 * @since unknown
159 */
160 function hustle_activation() {
161
162 if ( ! class_exists( 'Hustle_Db' ) ) {
163 require_once trailingslashit( __DIR__ ) . 'inc/hustle-db.php';
164 }
165 update_option( 'hustle_activated_flag', 1 );
166
167 Hustle_Db::maybe_create_tables( true );
168
169 /**
170 * Add Hustle's custom capabilities.
171 *
172 * @since 4.0.1
173 */
174 $hustle_capabilities = array(
175 'hustle_menu',
176 'hustle_edit_module',
177 'hustle_create',
178 'hustle_edit_integrations',
179 'hustle_access_emails',
180 'hustle_edit_settings',
181 'hustle_analytics',
182 );
183
184 $admin = get_role( 'administrator' );
185
186 if ( $admin ) {
187 // If there's an "administrator" role.
188 foreach ( $hustle_capabilities as $cap ) {
189 $admin->add_cap( $cap );
190 }
191 } else {
192 // If there's no "administrator".
193 $roles = get_editable_roles();
194
195 foreach ( $roles as $role_name => $data ) {
196
197 // Add the capabilities to anyone who can manage options. This was the checked capability in 3.x.
198 if ( isset( $data['capabilities']['manage_options'] ) && $data['capabilities']['manage_options'] ) {
199
200 $role = get_role( $role_name );
201 foreach ( $hustle_capabilities as $cap ) {
202 if ( $role ) {
203 $role->add_cap( $cap );
204 }
205 }
206 }
207 }
208 }
209 }
210 }
211 register_activation_hook( __FILE__, 'hustle_activation' );
212
213
214 if ( ! function_exists( 'hustle_deactivation' ) ) {
215 /**
216 * On deactivation hook
217 *
218 * @since 4.2.0
219 */
220 function hustle_deactivation() {
221 // Remove the cron for data protection cleanup.
222 wp_clear_scheduled_hook( 'hustle_general_data_protection_cleanup' );
223 wp_clear_scheduled_hook( 'hustle_background_conversion_log_cron' );
224 }
225 }
226
227 register_deactivation_hook( __FILE__, 'hustle_deactivation' );
228