PluginProbe ʕ •ᴥ•ʔ
Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager / 3.1.2
Folders – Unlimited Folders to Organize Media Library Folder, Pages, Posts, File Manager v3.1.2
3.1.9 3.1.8 3.1.7 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7 2.9.8 3.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 trunk 1.3.7 2.0.1 2.0.2 2.0.3 2.0.4 2.0.5 2.1.1 2.1.2 2.1.3 2.1.4 2.1.5 2.1.6 2.1.7 2.1.8 2.1.9 2.2 2.2.1 2.2.2 2.2.3 2.2.4 2.2.5 2.2.6 2.2.7 2.2.8 2.2.9 2.3 2.3.1 2.3.2 2.3.3 2.3.4 2.3.5 2.3.6 2.3.7 2.3.8 2.3.9 2.4 2.4.1 2.4.2 2.4.3 2.4.4 2.4.5 2.4.6 2.4.7 2.4.8 2.4.9 2.5 2.5.1 2.5.2 2.5.3 2.5.4 2.5.5 2.5.6 2.5.7 2.5.8 2.5.9 2.6 2.6.1 2.6.2 2.6.3 2.6.4 2.6.5 2.6.6 2.6.7 2.6.8 2.6.9 2.7 2.7.1 2.7.2 2.7.3 2.7.4 2.7.5 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9 2.9.1 2.9.2
folders / includes / class-email-signup.php
folders / includes Last commit date
class-affiliate.php 1 year ago class-email-signup.php 1 year ago class-help.php 1 year ago class-polylang.php 1 year ago class-review-box.php 1 year ago class-upgrade-box.php 1 year ago class-wpml.php 1 year ago folders.class.php 1 year ago form.class.php 1 year ago form.fields.php 1 year ago import.export.class.php 1 year ago media.replace.php 1 year ago notifications.class.php 1 year ago plugins.class.php 1 year ago svg.class.php 1 year ago tree.class.php 1 year ago
class-email-signup.php
169 lines
1 <?php
2 /**
3 * Update Popup Class
4 *
5 * @author : Premio <contact@premio.io>
6 * @license : GPL2
7 * */
8
9 if (defined('ABSPATH') === false) {
10 exit;
11 }
12
13 /**
14 * Class FOLDER_SIGNUP_CLASS
15 *
16 * Handles signup modal status, update actions, and manages display configurations
17 * for the Folder plugin update-related content.
18 */
19 class FOLDER_SIGNUP_CLASS {
20
21 /**
22 * Option name used to store the update message for the "Folder" feature.
23 */
24 private static $update_message_option = 'folder_update_message';
25
26 /**
27 * Option name used to store the date for the next signup related to the "Folder" feature.
28 */
29 private static $next_signup_date = 'folder_next_signup_date';
30
31 /**
32 * Stores the status of the modal to be shown.
33 */
34 private static $show_modal_name = 'folder_show_signup_modal';
35
36 /**
37 * Constructor method for the class.
38 *
39 * Initializes the MSE_UPDATE_POPUP_CONTENT constant with predefined array values
40 * containing plugin metadata, asset URLs, and visual elements.
41 * Also registers the WordPress AJAX callback for updating status.
42 *
43 * @return void
44 */
45 public function __construct() {
46 // ajax callback
47 add_action( 'wp_ajax_folder_update_status', array($this, 'update_status'));
48
49
50 }//end __construct()
51
52
53 public static function load_signup_settings()
54 {
55 if(defined('FOLDER_UPDATE_POPUP_CONTENT')) {
56 return;
57 }
58
59 define('FOLDER_UPDATE_POPUP_CONTENT', array(
60 'plugin_name' => esc_html__('Folders', 'folders'),
61 'trust_user' => esc_html__('Join the list 80,000+ users trust', 'folders'),
62 'website_owners' => esc_html__('80,000+', 'folders'),
63 'rating' => esc_html__('5/5 Rating', 'folders'),
64 'review' => esc_html__('Based on 1,400+ Reviews', 'folders'),
65 'plugin_logo' => WCP_FOLDER_URL . "assets/images/signup/folder-icon.png",
66 'trust_user_img' => WCP_FOLDER_URL . "assets/images/signup/user-trust.svg",
67 'font_url' => WCP_FOLDER_URL . "assets/fonts/Lato-Regular.woff",
68 'background_image' => WCP_FOLDER_URL . "assets/images/signup/premio-update-bg.svg",
69 'shape_bottom' => WCP_FOLDER_URL . "assets/images/signup/premio-update-bg-btm.png",
70 'shape_bottom_right' => WCP_FOLDER_URL . "assets/images/signup/premio-update-bg-right.png",
71 'mail_icon' => WCP_FOLDER_URL . "assets/images/signup/mail-icon.svg",
72 'user_icon' => WCP_FOLDER_URL . "assets/images/signup/users.svg",
73 'slash_icon' => WCP_FOLDER_URL . "assets/images/signup/slash.svg",
74 'star_icon' => WCP_FOLDER_URL . "assets/images/signup/star.svg",
75 'arrow_right' => WCP_FOLDER_URL . "assets/images/signup/arrow-right.svg",
76 'check_circle' => WCP_FOLDER_URL . "assets/images/signup/check-circle.svg",
77 'pre_loader' => WCP_FOLDER_URL . "assets/images/signup/pre-loader.svg",
78 ));
79 }
80
81
82 /**
83 * Checks the status of a modal and determines whether it should be displayed.
84 *
85 * This method evaluates various conditions, such as predefined options and the HTTP referrer,
86 * to decide if the modal should be shown. It may also update specific modal-related options
87 * based on the results of these checks.
88 *
89 * @return bool Returns true if the modal should be displayed; otherwise, false.
90 */
91 public static function check_modal_status() {
92 if(get_option(self::$update_message_option) == -1 || get_option(self::$show_modal_name) == 2) {
93 return false;
94 }
95 $referer = isset($_SERVER['HTTP_REFERER']) ? sanitize_text_field($_SERVER['HTTP_REFERER']) : '';
96
97 if (!str_contains($referer, 'wcp_folders_settings')) {
98
99 $default_folders = get_option("default_folders");
100 if (!empty($default_folders) && is_array($default_folders)) {
101 add_option(self::$show_modal_name, 1);
102 }
103 }
104
105 if (get_option(self::$show_modal_name)) {
106 $next_signup_date = get_option(self::$next_signup_date);
107
108 if($next_signup_date === false) {
109 self::load_signup_settings();
110 return true;
111 } else {
112 if($next_signup_date < date('Y-m-d')) {
113
114 self::load_signup_settings();
115 return true;
116 }
117 }
118 }
119
120 return false;
121 }
122
123 /**
124 * Handles the AJAX request to update the status of the plugin.
125 *
126 * Verifies the nonce for security, processes the provided status and email,
127 * and executes specific actions based on the status, including sending data
128 * to an external API or updating WordPress options.
129 *
130 * @return void
131 */
132 public function update_status() {
133
134 if(!empty($_REQUEST['nonce']) && wp_verify_nonce($_REQUEST['nonce'], 'folder_update_nonce')) {
135 $status = sanitize_text_field($_REQUEST['status']);
136 $email = sanitize_text_field($_REQUEST['email']);
137 if($status == 1) {
138 update_option(self::$update_message_option, -1);
139 $url = 'https://premioapps.com/premio/signup/email.php';
140 $apiParams = [
141 'plugin' => 'folders',
142 'email' => $email,
143 ];
144
145 // Signup Email for Chaty
146 $apiResponse = wp_safe_remote_post($url, ['body' => $apiParams, 'timeout' => 15, 'sslverify' => true]);
147
148 if (is_wp_error($apiResponse)) {
149 wp_safe_remote_post($url, ['body' => $apiParams, 'timeout' => 15, 'sslverify' => false]);
150 }
151 } else {
152
153 $next_date = date('Y-m-d', strtotime('+7 days'));
154 $next_signup_date = get_option(self::$next_signup_date);
155
156 if($next_signup_date === false) {
157
158 add_option(self::$next_signup_date, $next_date);
159 } else {
160 update_option(self::$update_message_option, -1);
161 }
162 }
163 }
164 echo "1";
165 die;
166 }
167
168 }
169 new FOLDER_SIGNUP_CLASS();