PluginProbe
Survey Maker by AYS / 5.2.2.3
Survey Maker by AYS v5.2.2.3
5.2.4.1 5.2.4.0 5.2.3.9 5.2.3.8 5.2.3.7 5.2.3.6 5.2.3.5 5.2.3.4 5.2.3.3 5.2.3.2 5.2.3.1 5.2.3.0 5.2.2.9 5.2.2.8 5.2.2.7 5.2.2.6 5.2.2.5 5.2.2.4 5.2.2.3 5.2.2.2 5.2.2.1 5.2.2.0 5.2.1.9 5.2.1.8 5.2.0.8 All 154 releases
survey-maker / admin / class-survey-maker-admin.php

class-survey-maker-admin.php in Survey Maker by AYS 5.2.2.3, at admin/class-survey-maker-admin.php

5,341 lines 316.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * The admin-specific functionality of the plugin.
5 *
6 * @link https://ays-pro.com/
7 * @since 1.0.0
8 *
9 * @package Survey_Maker
10 * @subpackage Survey_Maker/admin
11 */
12
13 /**
14 * The admin-specific functionality of the plugin.
15 *
16 * Defines the plugin name, version, and two examples hooks for how to
17 * enqueue the admin-specific stylesheet and JavaScript.
18 *
19 * @package Survey_Maker
20 * @subpackage Survey_Maker/admin
21 * @author Survey Maker team <[email protected]>
22 */
23 class Survey_Maker_Admin {
24
25 /**
26 * The ID of this plugin.
27 *
28 * @since 1.0.0
29 * @access private
30 * @var string $plugin_name The ID of this plugin.
31 */
32 private $plugin_name;
33
34 /**
35 * The version of this plugin.
36 *
37 * @since 1.0.0
38 * @access private
39 * @var string $version The current version of this plugin.
40 */
41 private $version;
42
43 /**
44 * The surveys list table object.
45 *
46 * @since 1.0.0
47 * @access private
48 * @var object $surveys_obj The surveys list table object.
49 */
50 private $surveys_obj;
51
52 /**
53 * The surveys categories list table object.
54 *
55 * @since 1.0.0
56 * @access private
57 * @var object $surveys_categories_obj The surveys categories list table object.
58 */
59 private $surveys_categories_obj;
60
61 /**
62 * The survey questions list table object.
63 *
64 * @since 1.0.0
65 * @access private
66 * @var object $questions_obj The survey questions list table object.
67 */
68 private $questions_obj;
69
70 /**
71 * The survey questions categories list table object.
72 *
73 * @since 1.0.0
74 * @access private
75 * @var object $question_categories_obj The survey questions categories list table object.
76 */
77 private $question_categories_obj;
78
79 /**
80 * The survey submissions list table object.
81 *
82 * @since 1.0.0
83 * @access private
84 * @var object $results_obj The survey submissions list table object.
85 */
86 private $submissions_obj;
87
88 /**
89 * The survey questions categories list table object for each survey.
90 *
91 * @since 1.0.0
92 * @access private
93 * @var object $each_result_obj The survey submissions list table object for each survey.
94 */
95 private $each_submission_obj;
96
97 /**
98 * The settings object of this plugin.
99 *
100 * @since 1.0.0
101 * @access private
102 * @var object $settings_obj The settings object of this plugin.
103 */
104 private $settings_obj;
105
106 /**
107 * The capability of this plugin.
108 *
109 * @since 1.0.0
110 * @access private
111 * @var string $capability The capability for users access to this plugin.
112 */
113 private $capability;
114
115 private $popup_surveys_obj;
116 private $requests_obj;
117
118 /**
119 * Initialize the class and set its properties.
120 *
121 * @since 1.0.0
122 * @param string $plugin_name The name of this plugin.
123 * @param string $version The version of this plugin.
124 */
125 public function __construct( $plugin_name, $version ) {
126
127 $this->plugin_name = $plugin_name;
128 $this->version = $version;
129
130 add_filter('set-screen-option', array(__CLASS__, 'set_screen'), 10, 3);
131 // $per_page_array = array(
132 // 'quizes_per_page',
133 // 'questions_per_page',
134 // 'quiz_categories_per_page',
135 // 'question_categories_per_page',
136 // 'attributes_per_page',
137 // 'quiz_results_per_page',
138 // 'quiz_each_results_per_page',
139 // 'quiz_orders_per_page',
140 // );
141 // foreach($per_page_array as $option_name){
142 // add_filter('set_screen_option_'.$option_name, array(__CLASS__, 'set_screen'), 10, 3);
143 // }
144
145 }
146
147 /**
148 * Register the stylesheets for the admin area.
149 *
150 * @since 1.0.0
151 */
152 public function enqueue_styles( $hook_suffix ) {
153
154 wp_enqueue_style( $this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'css/admin.css', array(), $this->version, 'all');
155
156 if (false !== strpos($hook_suffix, "plugins.php")){
157 wp_enqueue_style( $this->plugin_name . '-sweetalert-css', SURVEY_MAKER_PUBLIC_URL . '/css/survey-maker-sweetalert2.min.css', array(), $this->version, 'all');
158 }
159
160 if (false === strpos($hook_suffix, $this->plugin_name))
161 return;
162
163 // You need styling for the datepicker. For simplicity I've linked to the jQuery UI CSS on a CDN.
164 // wp_register_style( 'jquery-ui', 'https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css' );
165 // wp_enqueue_style( 'jquery-ui' );
166
167 wp_enqueue_style('wp-color-picker');
168 wp_enqueue_style( $this->plugin_name . '-banner.css', plugin_dir_url(__FILE__) . 'css/banner.css', array(), $this->version, 'all');
169 // wp_enqueue_style( $this->plugin_name . '-banner-black-friday.css', plugin_dir_url(__FILE__) . 'css/survey-maker-banner-black-friday-2024.css', array(), $this->version, 'all');
170 // wp_enqueue_style( $this->plugin_name . '-banner-black-friday.css', plugin_dir_url(__FILE__) . 'css/survey-maker-banner.css', array(), $this->version, 'all');
171 // wp_enqueue_style( $this->plugin_name . '-mega-bundle-banner-2025.css', plugin_dir_url(__FILE__) . 'css/survey-maker-mega-bundle-banner-2025.css', array(), $this->version, 'all');
172 // wp_enqueue_style( $this->plugin_name . '-banner-christmas.css', plugin_dir_url(__FILE__) . 'css/survey-maker-banner-christmas-2024.css', array(), $this->version, 'all');
173 wp_enqueue_style( $this->plugin_name . '-animate.css', plugin_dir_url(__FILE__) . 'css/animate.css', array(), $this->version, 'all');
174 wp_enqueue_style( $this->plugin_name . '-animations.css', plugin_dir_url(__FILE__) . 'css/animations.css', array(), $this->version, 'all');
175 // wp_enqueue_style( $this->plugin_name . '-font-awesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', array(), $this->version, 'all');
176
177 wp_enqueue_style($this->plugin_name . '-font-awesome', SURVEY_MAKER_PUBLIC_URL . '/css/survey-maker-font-awesome.min.css', array(), $this->version, 'all');
178 wp_enqueue_style( $this->plugin_name . '-font-awesome-icons', plugin_dir_url(__FILE__) . 'css/ays-font-awesome.css', array(), $this->version, 'all');
179 wp_enqueue_style( $this->plugin_name . '-select2', SURVEY_MAKER_PUBLIC_URL . '/css/survey-maker-select2.min.css', array(), $this->version, 'all');
180 wp_enqueue_style( $this->plugin_name . '-transition', SURVEY_MAKER_PUBLIC_URL . '/css/transition.min.css', array(), $this->version, 'all');
181 wp_enqueue_style( $this->plugin_name . '-dropdown', SURVEY_MAKER_PUBLIC_URL . '/css/dropdown.min.css', array(), $this->version, 'all');
182 wp_enqueue_style( $this->plugin_name . '-popup', plugin_dir_url(__FILE__) . 'css/popup.min.css', array(), $this->version, 'all');
183 wp_enqueue_style( $this->plugin_name . '-bootstrap', plugin_dir_url(__FILE__) . 'css/bootstrap.min.css', array(), $this->version, 'all');
184 wp_enqueue_style( $this->plugin_name . '-data-bootstrap', plugin_dir_url(__FILE__) . 'css/dataTables.bootstrap4.min.css', array(), $this->version, 'all');
185 wp_enqueue_style( $this->plugin_name . '-datetimepicker', plugin_dir_url(__FILE__) . 'css/jquery-ui-timepicker-addon.css', array(), $this->version, 'all');
186
187 wp_enqueue_style( $this->plugin_name . "-general", plugin_dir_url( __FILE__ ) . 'css/survey-maker-general.css', array(), time(), 'all' );
188 wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/survey-maker-admin.css', array(), time(), 'all' );
189 wp_enqueue_style( $this->plugin_name . "-admin-dashboard", plugin_dir_url( __FILE__ ) . 'css/survey-maker-admin-dashboard.css', array(), time(), 'all' );
190 wp_enqueue_style( $this->plugin_name . "-pro-features", plugin_dir_url( __FILE__ ) . 'css/survey-maker-pro-features.css', array(), time(), 'all' );
191 wp_enqueue_style( $this->plugin_name . "-loaders", plugin_dir_url(__FILE__) . 'css/loaders.css', array(), $this->version, 'all');
192 if( isset( $_GET['page'] ) && sanitize_key($_GET['page']) == $this->plugin_name . '-admin-dashboard' ){
193 wp_enqueue_style( $this->plugin_name . "-dashboard", plugin_dir_url( __FILE__ ) . 'css/survey-maker-dashboard.css', array(), $this->version, 'all' );
194 }
195
196 }
197
198 /**
199 * Register the JavaScript for the admin area.
200 *
201 * @since 1.0.0
202 */
203 public function enqueue_scripts( $hook_suffix ) {
204 global $wp_version;
205
206 $version1 = $wp_version;
207 $operator = '>=';
208 $version2 = '5.5';
209 $versionCompare = $this->aysSurveyMakerVersionCompare($version1, $operator, $version2);
210
211 // $check_terms_agreement = get_option('survey_maker_agree_terms');
212
213 // if($check_terms_agreement === 'true' && strpos($hook_suffix, $this->plugin_name) !== false){
214 // wp_enqueue_script( $this->plugin_name.'-hotjar', plugin_dir_url(__FILE__) . 'js/extras/survey-maker-hotjar.js', array(), $this->version, false);
215 // }
216
217 if ($versionCompare) {
218 wp_enqueue_script( $this->plugin_name.'-wp-load-scripts', plugin_dir_url(__FILE__) . 'js/survey-maker-wp-load-scripts.js', array(), $this->version, true);
219 }
220
221 if (false !== strpos($hook_suffix, "plugins.php")){
222 wp_enqueue_script( $this->plugin_name . '-sweetalert-js', SURVEY_MAKER_PUBLIC_URL . '/js/survey-maker-sweetalert2.all.min.js', array('jquery'), $this->version, true );
223 wp_enqueue_script( $this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'js/admin.js', array( 'jquery' ), $this->version, true );
224 wp_localize_script( $this->plugin_name . '-admin', 'SurveyMakerAdmin', array(
225 'ajaxUrl' => admin_url( 'admin-ajax.php' )
226 ) );
227 }
228
229 if (false === strpos($hook_suffix, $this->plugin_name))
230 return;
231
232 $survey_banner_date = self::ays_survey_update_banner_time();
233 wp_enqueue_script( 'jquery' );
234 wp_enqueue_script( 'jquery-effects-core' );
235 wp_enqueue_script( 'jquery-ui-sortable' );
236 wp_enqueue_script( 'jquery-ui-datepicker' );
237 wp_enqueue_media();
238 wp_enqueue_script( $this->plugin_name . '-color-picker-alpha', plugin_dir_url(__FILE__) . 'js/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), $this->version, true );
239 $color_picker_strings = array(
240 'clear' => __( 'Clear', "survey-maker" ),
241 'clearAriaLabel' => __( 'Clear color', "survey-maker" ),
242 'defaultString' => __( 'Default', "survey-maker" ),
243 'defaultAriaLabel' => __( 'Select default color', "survey-maker" ),
244 'pick' => __( 'Select Color', "survey-maker" ),
245 'defaultLabel' => __( 'Color value', "survey-maker" ),
246 );
247 wp_localize_script( $this->plugin_name . '-color-picker-alpha', 'wpColorPickerL10n', $color_picker_strings );
248
249
250 /*
251 ==========================================
252 * Bootstrap
253 * select2
254 * jQuery DataTables
255 ==========================================
256 */
257 wp_enqueue_script( $this->plugin_name . "-popper", plugin_dir_url(__FILE__) . 'js/popper.min.js', array( 'jquery' ), $this->version, true );
258 wp_enqueue_script( $this->plugin_name . "-bootstrap", plugin_dir_url(__FILE__) . 'js/bootstrap.min.js', array( 'jquery' ), $this->version, true );
259 wp_enqueue_script( $this->plugin_name . '-select2js', SURVEY_MAKER_PUBLIC_URL . '/js/survey-maker-select2.min.js', array('jquery'), $this->version, true);
260 wp_enqueue_script( $this->plugin_name . '-sweetalert-js', SURVEY_MAKER_PUBLIC_URL . '/js/survey-maker-sweetalert2.all.min.js', array('jquery'), $this->version, true );
261 wp_enqueue_script( $this->plugin_name . '-datatable-min', SURVEY_MAKER_PUBLIC_URL . '/js/survey-maker-datatable.min.js', array('jquery'), $this->version, true);
262 wp_enqueue_script( $this->plugin_name . '-transition-min', SURVEY_MAKER_PUBLIC_URL . '/js/transition.min.js', array('jquery'), $this->version, true);
263 wp_enqueue_script( $this->plugin_name . '-dropdown-min', SURVEY_MAKER_PUBLIC_URL . '/js/dropdown.min.js', array('jquery'), $this->version, true);
264 wp_enqueue_script( $this->plugin_name . "-db4.min.js", plugin_dir_url( __FILE__ ) . 'js/dataTables.bootstrap4.min.js', array( 'jquery' ), $this->version, true );
265 wp_enqueue_script( $this->plugin_name . "-datetimepicker", plugin_dir_url( __FILE__ ) . 'js/jquery-ui-timepicker-addon.js', array( 'jquery' ), $this->version, true );
266 wp_enqueue_script( $this->plugin_name . '-autosize', SURVEY_MAKER_PUBLIC_URL . '/js/survey-maker-autosize.js', array( 'jquery' ), $this->version, false );
267
268 /*
269 ================================================
270 Survey admin dashboard scripts (Google charts)
271 ================================================
272 */
273 if ( strpos($hook_suffix, 'each-submission') !== false ) {
274 wp_enqueue_script( $this->plugin_name . '-charts-google', plugin_dir_url(__FILE__) . 'js/google-chart.js', array('jquery'), $this->version, true);
275 wp_enqueue_script( $this->plugin_name . '-charts', plugin_dir_url(__FILE__) . 'js/partials/survey-maker-admin-submissions-charts.js', array('jquery'), $this->version, true);
276 }
277
278 /*
279 ================================================
280 Quiz admin dashboard scripts (and for AJAX)
281 ================================================
282 */
283 wp_enqueue_script( $this->plugin_name . "-survey-styles", plugin_dir_url(__FILE__) . 'js/partials/survey-maker-admin-survey-styles.js', array('jquery', 'wp-color-picker'), $this->version, true);
284 wp_enqueue_script( $this->plugin_name . "-functions", plugin_dir_url(__FILE__) . 'js/functions.js', array( 'jquery', 'wp-color-picker' ), $this->version, true );
285 wp_enqueue_script( $this->plugin_name . '-ajax', plugin_dir_url(__FILE__) . 'js/survey-maker-admin-ajax.js', array('jquery'), $this->version, true);
286 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/survey-maker-admin.js', array( 'jquery' ), $this->version, true );
287 wp_localize_script( $this->plugin_name, 'SurveyMakerAdmin', array(
288 'surveyBannerDate' => $survey_banner_date,
289 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
290 'nonce' => wp_create_nonce( 'ajax-nonce' ),
291 'inputAnswerText' => __( 'Your answer', "survey-maker" ),
292 // 'shortAnswerText' => __( 'Short answer text', "survey-maker" ),
293 // 'numberAnswerText' => __( 'Number answer text', "survey-maker" ),
294 'emailField' => __( 'Your email', "survey-maker" ),
295 'nameField' => __( 'Your name', "survey-maker" ),
296 'selectUserRoles' => __( 'Select user roles', "survey-maker" ),
297 'phoneAnswerText' => __( 'Phone', "survey-maker" ),
298 'addQuestion' => __( 'Add question', "survey-maker" ),
299 'addSection' => __( 'Add section', "survey-maker" ),
300 'duplicate' => __( 'Duplicate', "survey-maker" ),
301 'delete' => __( 'Delete', "survey-maker" ),
302 'addImage' => __( 'Add Image', "survey-maker" ),
303 'editImage' => __( 'Edit Image', "survey-maker" ),
304 'removeImage' => __( 'Remove Image', "survey-maker" ),
305 'collapseSectionQuestions' => __( 'Collapse section questions', "survey-maker" ),
306 'expandSectionQuestions' => __( 'Expand section questions', "survey-maker" ),
307 'selectQuestionDefaultType' => __( 'Select question default type', "survey-maker" ),
308 'chooseAnswer' => __( 'Choose answer', "survey-maker" ),
309 'yes' => __( 'Yes', "survey-maker" ),
310 'cancel' => __( 'Cancel', "survey-maker" ),
311 'questionDeleteConfirmation' => __( 'Are you sure you want to delete this question?', "survey-maker" ),
312 'sectionDeleteConfirmation' => __( 'Are you sure you want to delete this section?', "survey-maker" ),
313 'loadResource' => __( "Can't load resource.", "survey-maker" ),
314 'somethingWentWrong' => __( "Maybe something went wrong.", "survey-maker" ),
315 'dataDeleted' => __( "Maybe the data has been deleted.", "survey-maker" ),
316 'minimumCountOfQuestions' => __( 'Sorry minimum count of questions should be 1', "survey-maker" ),
317 'enableMaxSelectionCount' => __( 'Enable selection count', "survey-maker" ),
318 'enableSelectionCount' => __( 'Enable selection count', "survey-maker" ),
319 'disableSelectionCount' => __( 'Disable selection count', "survey-maker" ),
320 'enableMaxSelectionCount' => __( 'Enable selection count', "survey-maker" ),
321 'disableMaxSelectionCount' => __( 'Disable max selection count', "survey-maker" ),
322 'enableWordLimitation' => __( 'Enable word limitation', "survey-maker" ),
323 'disableWordLimitation' => __( 'Disable word limitation', "survey-maker" ),
324 'enableNumberLimitation' => __( 'Enable limitation', "survey-maker" ),
325 'disableNumberLimitation' => __( 'Disable limitation', "survey-maker" ),
326 'successfullySent' => __( 'Successfully sent', "survey-maker" ),
327 'failed' => __( 'Failed', "survey-maker" ),
328 'selectPage' => __( 'Select page', "survey-maker" ),
329 'selectPostType' => __( 'Select post type', "survey-maker" ),
330 'copied' => __( 'Copied!', "survey-maker"),
331 'clickForCopy' => __( 'Click for copy', "survey-maker"),
332 'moveToSection' => __( 'Move to section', "survey-maker"),
333 'confirmMessageTemplate' => __( 'If you choose one of these templates, your questions will be deleted.', "survey-maker"),
334 'okSurvey' => __( 'OK', "survey-maker"),
335 'icons' => array(
336 'radioButtonUnchecked' => SURVEY_MAKER_ADMIN_URL . '/images/icons/radio-button-unchecked.svg',
337 'checkboxUnchecked' => SURVEY_MAKER_ADMIN_URL . '/images/icons/checkbox-unchecked.svg',
338 ),
339 'nextSurveyPage' => __( 'Are you sure you want to go to the next survey page?', "survey-maker"),
340 'prevSurveyPage' => __( 'Are you sure you want to go to the previous question page?', "survey-maker"),
341 'addQuestionImageCaption' => __( 'Add a caption', "survey-maker"),
342 'closeQuestionImageCaption' => __( 'Close caption', "survey-maker"),
343 'deleteElementFromListTable' => __( 'Are you sure you want to delete?', "survey-maker"),
344 'maxInputVarsWarningMessage' => __( 'Note: The survey has reached the limit of %t inputs out of a maximum of %f. To save changes, please contact your hosting provider to increase the max_input_vars limit.', "survey-maker"),
345 'rating' => __( 'Rating', "survey-maker"),
346 'stars_count' => __( 'Stars count', "survey-maker"),
347 "preivewSurvey" => __( "Preview Survey", 'survey-maker' ),
348 'activate' => __( 'Activate', "survey-maker" ),
349 'activated' => __( 'Activated', "survey-maker" ),
350 'successCopyCoupon' => __( "Coupon code copied!", 'survey-maker' ),
351 'failedCopyCoupon' => __( "Failed to copy coupon code", 'survey-maker' ),
352 ) );
353 wp_localize_script($this->plugin_name . '-ajax', 'survey_maker_ajax', array(
354 'ajax_url' => admin_url('admin-ajax.php'),
355 "emptyEmailError" => __( 'Email field is empty', "survey-maker"),
356 'selectUser' => __( 'Select user', 'survey-maker'),
357 'searching' => __( "Searching...", 'survey-maker' ),
358 'pleaseEnterMore' => __( "Please enter 1 or more characters", 'survey-maker' ),
359 "invalidEmailError" => __( 'Invalid Email address', "survey-maker"),
360 "emptyWebsiteError" => __( 'Website field is empty', "survey-maker"),
361 "invalidWebsiteError" => __( 'Invalid website address', "survey-maker"),
362 "thankYouMessage" => __( 'Your request was successfully submitted. We will get in touch with you until November 10. Thank you!', "survey-maker"),
363 ));
364
365 }
366
367 public function ays_survey_add_body_class( $classes ) {
368 global $pagenow;
369
370 if ( $pagenow === 'admin.php' ) {
371 $page = isset( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : '';
372
373 if ( strpos( $page, $this->plugin_name ) === 0 ) {
374 $classes .= ' ays-survey-plugin-admin';
375 }
376 }
377
378 return $classes;
379 }
380
381 /**
382 * De-register JavaScript files for the admin area.
383 *
384 * @since 1.0.0
385 */
386 public function disable_scripts($hook_suffix) {
387 if (false !== strpos($hook_suffix, $this->plugin_name)) {
388 if (is_plugin_active('ai-engine/ai-engine.php')) {
389 wp_deregister_script('mwai');
390 wp_deregister_script('mwai-vendor');
391 wp_dequeue_script('mwai');
392 wp_dequeue_script('mwai-vendor');
393 }
394 if (is_plugin_active('html5-video-player/html5-video-player.php')) {
395 wp_dequeue_style('h5vp-admin');
396 wp_dequeue_style('fs_common');
397 }
398 if (is_plugin_active('wp-social/wp-social.php')) {
399 wp_dequeue_style('wp_social_select2_css');
400 wp_deregister_script('wp_social_select2_js');
401 wp_dequeue_script('wp_social_select2_js');
402 }
403 if (is_plugin_active('real-media-library-lite/index.php')) {
404 wp_dequeue_style('real-media-library-lite-rml');
405 }
406
407 if (is_plugin_active('happyforms/happyforms.php')) {
408 wp_dequeue_style('happyforms-admin');
409 }
410
411 if (is_plugin_active('ultimate-viral-quiz/index.php')) {
412 wp_dequeue_style('select2');
413 wp_dequeue_style('dataTables');
414
415 wp_dequeue_script('sweetalert');
416 wp_dequeue_script('select2');
417 wp_dequeue_script('dataTables');
418 }
419
420 if (is_plugin_active('forms-by-made-it/madeit-form.php')) {
421 wp_dequeue_style('madeit-form-admin-style');
422 }
423
424 if (is_plugin_active('search-replace-for-block-editor/search-replace-for-block-editor.php')) {
425 wp_deregister_script('search-replace-for-block-editor');
426 wp_dequeue_script('search-replace-for-block-editor');
427 }
428
429
430 // Theme | Phlox 2.17.6
431 wp_dequeue_style('auxin-admin-style');
432
433 // Theme | Pixel Ebook Store
434 wp_dequeue_style('pixel-ebook-store-free-demo-content-style');
435
436 // Theme | Interactive Education
437 wp_dequeue_style('interactive-education-free-demo-content-style');
438
439
440
441 }
442 }
443
444 public function codemirror_enqueue_scripts($hook) {
445 if(strpos($hook, $this->plugin_name) !== false){
446 if(function_exists('wp_enqueue_code_editor')){
447 $cm_settings['codeEditor'] = wp_enqueue_code_editor(array(
448 'type' => 'text/css',
449 'codemirror' => array(
450 'inputStyle' => 'contenteditable',
451 'theme' => 'cobalt',
452 )
453 ));
454
455 wp_enqueue_script('wp-theme-plugin-editor');
456 wp_localize_script('wp-theme-plugin-editor', 'cm_settings', $cm_settings);
457
458 wp_enqueue_style('wp-codemirror');
459 }
460 }
461 }
462
463 public function aysSurveyMakerVersionCompare($version1, $operator, $version2) {
464
465 $_fv = intval ( trim ( str_replace ( '.', '', $version1 ) ) );
466 $_sv = intval ( trim ( str_replace ( '.', '', $version2 ) ) );
467
468 if (strlen ( $_fv ) > strlen ( $_sv )) {
469 $_sv = str_pad ( $_sv, strlen ( $_fv ), 0 );
470 }
471
472 if (strlen ( $_fv ) < strlen ( $_sv )) {
473 $_fv = str_pad ( $_fv, strlen ( $_sv ), 0 );
474 }
475
476 return version_compare ( ( string ) $_fv, ( string ) $_sv, $operator );
477 }
478
479 /**
480 * Register the administration menu for this plugin into the WordPress Dashboard menu.
481 *
482 * @since 1.0.0
483 */
484 public function add_plugin_admin_menu(){
485
486 /*
487 * Add a settings page for this plugin to the Settings menu.
488 *
489 * NOTE: Alternative menu locations are available via WordPress administration menu functions.
490 *
491 * Administration Menus: http://codex.wordpress.org/Administration_Menus
492 *
493 */
494
495 $setting_actions = new Survey_Maker_Settings_Actions($this->plugin_name);
496 $options = ($setting_actions->ays_get_setting('options') === false) ? array() : json_decode( stripcslashes( $setting_actions->ays_get_setting('options') ), true);
497
498 // Disable Survey Maker menu item notification
499 $options['survey_disable_survey_menu_notification'] = isset($options['survey_disable_survey_menu_notification']) ? esc_attr( $options['survey_disable_survey_menu_notification'] ) : 'off';
500 $survey_disable_survey_menu_notification = (isset($options['survey_disable_survey_menu_notification']) && esc_attr( $options['survey_disable_survey_menu_notification'] ) == "on") ? true : false;
501
502 if( $survey_disable_survey_menu_notification ){
503 $menu_item = 'Survey Maker';
504 } else {
505 global $wpdb;
506 // $sql = "SELECT COUNT(*) FROM " . esc_sql( $wpdb->prefix . SURVEY_MAKER_DB_PREFIX ) . "submissions WHERE `read` = 0 OR `read` = 2 ";
507 $sql = $wpdb->prepare("
508 SELECT COUNT(*)
509 FROM " . esc_sql($wpdb->prefix . SURVEY_MAKER_DB_PREFIX) . "submissions AS s
510 INNER JOIN " . esc_sql($wpdb->prefix . SURVEY_MAKER_DB_PREFIX) . "surveys AS surv
511 ON s.survey_id = surv.id
512 WHERE (s.read = 0 OR s.read = 2)
513 AND surv.status != %s
514 ", 'trashed');
515 $unread_results_count = intval( $wpdb->get_var( $sql ) );
516 $menu_item = ($unread_results_count == 0) ? 'Survey Maker' : 'Survey Maker' . '<span class="ays-survey-menu-badge ays-survey-results-bage">' . $unread_results_count . '</span>';
517 }
518
519 $this->capability = $this->survey_maker_capabilities();
520 $capability = $this->capability;
521
522 $hook_survey_maker =add_menu_page(
523 'Survey Maker',
524 $menu_item,
525 $this->capability,
526 $this->plugin_name,
527 array($this, 'display_plugin_surveys_page'),
528 SURVEY_MAKER_ADMIN_URL . '/images/icons/survey-make-menu-logo.svg',
529 '6.21'
530 );
531 add_action( "load-$hook_survey_maker", array( $this, 'add_tabs' ));
532 }
533
534 public function add_plugin_surveys_submenu(){
535 $hook_survey_maker = add_submenu_page(
536 $this->plugin_name,
537 __('Surveys', "survey-maker"),
538 __('Surveys', "survey-maker"),
539 $this->capability,
540 $this->plugin_name,
541 array($this, 'display_plugin_surveys_page')
542 );
543
544 add_action("load-$hook_survey_maker", array($this, 'screen_option_surveys'));
545 add_action("load-$hook_survey_maker", array($this, 'add_tabs'));
546 }
547
548 public function add_plugin_export_import_submenu(){
549 $hook_exp_imp = add_submenu_page(
550 $this->plugin_name,
551 __('Export / Import', "survey-maker"),
552 __('Export / Import', "survey-maker"),
553 $this->capability,
554 $this->plugin_name . '-export-import',
555 array($this, 'display_plugin_export_import_page')
556 );
557
558 // add_action("load-$hook_exp_imp", array($this, 'screen_option_questions'));
559 add_action("load-$hook_exp_imp", array($this, 'add_tabs'));
560 }
561
562 public function add_plugin_survey_categories_submenu(){
563 $hook_survey_categories = add_submenu_page(
564 $this->plugin_name,
565 __('Survey Categories', "survey-maker"),
566 __('Survey Categories', "survey-maker"),
567 $this->capability,
568 $this->plugin_name . '-survey-categories',
569 array($this, 'display_plugin_survey_categories_page')
570 );
571
572 add_action("load-$hook_survey_categories", array($this, 'screen_option_survey_categories'));
573 add_action("load-$hook_survey_categories", array($this, 'add_tabs'));
574 }
575
576 public function add_plugin_submissions_submenu(){
577 global $wpdb;
578
579 $setting_actions = new Survey_Maker_Settings_Actions($this->plugin_name);
580 $options = ($setting_actions->ays_get_setting('options') === false) ? array() : json_decode( stripcslashes( $setting_actions->ays_get_setting('options') ), true);
581
582 // Disable Submissions menu item notification
583 $options['survey_disable_submission_menu_notification'] = isset($options['survey_disable_submission_menu_notification']) ? esc_attr( $options['survey_disable_submission_menu_notification'] ) : 'off';
584 $survey_disable_submission_menu_notification = (isset($options['survey_disable_submission_menu_notification']) && esc_attr( $options['survey_disable_submission_menu_notification'] ) == "on") ? true : false;
585
586 if( $survey_disable_submission_menu_notification ){
587 $results_text = __('Submissions', "survey-maker");
588 $menu_item = __('Submissions', "survey-maker");
589 } else {
590 // $sql = "SELECT COUNT(*) FROM " . esc_sql( $wpdb->prefix . SURVEY_MAKER_DB_PREFIX ) . "submissions WHERE `read` = 0 OR `read` = 2 ";
591 $sql = $wpdb->prepare("
592 SELECT COUNT(*)
593 FROM " . esc_sql($wpdb->prefix . SURVEY_MAKER_DB_PREFIX) . "submissions AS subs
594 INNER JOIN " . esc_sql($wpdb->prefix . SURVEY_MAKER_DB_PREFIX) . "surveys AS survs
595 ON subs.survey_id = survs.id
596 WHERE (subs.read = 0 OR subs.read = 2)
597 AND survs.status != %s
598 ", 'trashed');
599 $unread_results_count = intval( $wpdb->get_var( $sql ) );
600
601 $results_text = __('Submissions', "survey-maker");
602 $menu_item = ( $unread_results_count == 0 ) ? $results_text : $results_text . '<span class="ays-survey-menu-badge ays-survey-results-bage">' . $unread_results_count . '</span>';
603 }
604
605
606 $hook_submissions = add_submenu_page(
607 $this->plugin_name,
608 $results_text,
609 $menu_item,
610 $this->capability,
611 $this->plugin_name . '-submissions',
612 array($this, 'display_plugin_submissions_page')
613 );
614
615 add_action("load-$hook_submissions", array($this, 'screen_option_submissions'));
616 add_action("load-$hook_submissions", array($this, 'add_tabs'));
617
618 $hook_each_submission = add_submenu_page(
619 'each_submission_slug',
620 __('Each', "survey-maker"),
621 null,
622 $this->capability,
623 $this->plugin_name . '-each-submission',
624 array($this, 'display_plugin_each_submission_page')
625 );
626
627 add_action("load-$hook_each_submission", array($this, 'screen_option_each_survey_submission'));
628 add_action("load-$hook_each_submission", array($this, 'add_tabs'));
629
630 add_filter('parent_file', array($this,'survey_maker_select_submenu'));
631 }
632
633 public function add_plugin_dashboard_submenu(){
634 $hook_quizes = add_submenu_page(
635 $this->plugin_name,
636 __('How to use', "survey-maker"),
637 __('How to use', "survey-maker"),
638 $this->capability,
639 $this->plugin_name . '-dashboard',
640 array($this, 'display_plugin_setup_page')
641 );
642 add_action("load-$hook_quizes", array($this, 'add_tabs'));
643 }
644
645 public function add_plugin_general_settings_submenu(){
646 $hook_settings = add_submenu_page( $this->plugin_name,
647 __('General Settings', "survey-maker"),
648 __('General Settings', "survey-maker"),
649 'manage_options',
650 $this->plugin_name . '-settings',
651 array($this, 'display_plugin_settings_page')
652 );
653 add_action("load-$hook_settings", array($this, 'screen_option_settings'));
654 add_action("load-$hook_settings", array($this, 'add_tabs'));
655 }
656
657 public function add_plugin_featured_plugins_submenu(){
658 $hook_featured_plugins = add_submenu_page( $this->plugin_name,
659 __('Our products', "survey-maker"),
660 __('Our products', "survey-maker"),
661 $this->capability,
662 $this->plugin_name . '-our-products',
663 array($this, 'display_plugin_featured_plugins_page')
664 );
665 add_action("load-$hook_featured_plugins", array($this, 'add_tabs'));
666 }
667
668 public function add_plugin_survey_features_plugins_submenu(){
669 $hook_pro_features = add_submenu_page( $this->plugin_name,
670 __('PRO Features', "survey-maker"),
671 __('PRO Features', "survey-maker"),
672 $this->capability,
673 $this->plugin_name . '-survey-features',
674 array($this, 'display_plugin_features_page')
675 );
676 add_action("load-$hook_pro_features", array($this, 'add_tabs'));
677 }
678
679 public function add_plugin_subscribe_email(){
680 $hook_grab_your_gift = add_submenu_page(
681 $this->plugin_name,
682 __('Grab your GIFT', "survey-maker"),
683 __('Grab your GIFT', "survey-maker"),
684 'manage_options',
685 $this->plugin_name . '-survey-subscribe-email',
686 array($this, 'display_plugin_subscribe_email')
687 );
688
689 add_action("load-$hook_grab_your_gift", array( $this, 'add_tabs' ));
690 }
691
692 public function add_plugin_popup_surveys_submenu(){
693 $hook_popup_surveys = add_submenu_page(
694 $this->plugin_name,
695 __('Popup Survey', "survey-maker"),
696 __('Popup Survey', "survey-maker"),
697 $this->capability,
698 $this->plugin_name . '-popup-surveys',
699 array($this, 'display_plugin_popup_surveys_page')
700 );
701
702 add_action("load-$hook_popup_surveys", array($this, 'screen_option_popup_surveys'));
703 add_action("load-$hook_popup_surveys", array($this, 'add_tabs'));
704 }
705
706 public function add_plugin_admin_dashboard_menu(){
707
708 if (!doing_action('admin_menu')) {
709 return;
710 }
711
712 $menuHook = add_submenu_page(
713 $this->plugin_name,
714 __('Dashboard', 'survey-maker'),
715 __('Dashboard', 'survey-maker'),
716 'manage_options',
717 $this->plugin_name . '-admin-dashboard',
718 array($this, 'display_plugin_admin_dashboard_page'),
719 40
720 );
721
722 if (!$menuHook) {
723 return;
724 }
725
726 add_action("load-$menuHook", array($this, 'add_tabs'));
727 }
728
729 public function add_plugin_survey_front_requests_submenu(){
730 $hook_requests = add_submenu_page(
731 $this->plugin_name,
732 __('Frontend Requests', "survey-maker"),
733 __('Frontend Requests', "survey-maker"),
734 $this->capability,
735 $this->plugin_name . '-requests',
736 array($this, 'display_plugin_requests_page')
737 );
738 $this->requests_obj = new Survey_Requests_List_Table($this->plugin_name);
739
740 add_action("load-$hook_requests", array($this, 'add_tabs'));
741 }
742
743 public function survey_maker_select_submenu($file) {
744 global $plugin_page;
745 if ($this->plugin_name."-each-submission" == $plugin_page) {
746 $plugin_page = $this->plugin_name."-submissions";
747 }
748 return $file;
749 }
750
751 protected function survey_maker_capabilities(){
752 global $wpdb;
753 return 'manage_options';
754
755 // $sql = "SELECT meta_value FROM {$wpdb->prefix}aysquiz_settings WHERE `meta_key` = 'user_roles'";
756 // $result = $wpdb->get_var($sql);
757
758 // $capability = 'manage_options';
759 // if($result !== null){
760 // $ays_user_roles = json_decode($result, true);
761 // if(is_user_logged_in()){
762 // $current_user = wp_get_current_user();
763 // $current_user_roles = $current_user->roles;
764 // $ishmar = 0;
765 // foreach($current_user_roles as $r){
766 // if(in_array($r, $ays_user_roles)){
767 // $ishmar++;
768 // }
769 // }
770 // if($ishmar > 0){
771 // $capability = "read";
772 // }
773 // }
774 // }
775 // return $capability;
776 }
777
778
779 /**
780 * Add settings action link to the plugins page.
781 *
782 * @since 1.0.0
783 */
784 public function add_action_links($links){
785 /*
786 * Documentation : https://codex.wordpress.org/Plugin_API/Filter_Reference/plugin_action_links_(plugin_file_name)
787 */
788
789 $survey_ajax_deactivate_plugin_nonce = wp_create_nonce( 'survey-maker-ajax-deactivate-plugin-nonce' );
790
791 $settings_link = array(
792 '<a href="' . admin_url('admin.php?page=' . $this->plugin_name) . '">' . __('Settings', "survey-maker") . '</a>',
793 '<a href="https://ays-demo.com/wordpress-survey-plugin-free-demo/" target="_blank">' . __('Demo', "survey-maker") . '</a>',
794 '<a href="https://ays-pro.com/wordpress/survey-maker?utm_source=survey-maker-free&utm_medium=dashboard&utm_campaign=buy-now-plugins" target="_blank" class="ays-survey-admin-upgrade-button">' . __('Upgrade', "survey-maker") . '</a>
795 <input type="hidden" id="ays_survey_ajax_deactivate_plugin_nonce" name="ays_survey_ajax_deactivate_plugin_nonce" value="' . $survey_ajax_deactivate_plugin_nonce .'">',
796 );
797 return array_merge($settings_link, $links);
798
799 }
800
801
802 public function add_survey_row_meta( $links, $file ) {
803 if ( SURVEY_MAKER_BASENAME == $file ) {
804 $row_meta = array(
805 'ays-survey-support' => '<a href="' . esc_url( 'https://wordpress.org/support/plugin/survey-maker/' ) . '" target="_blank">' . esc_html__( 'Free Support', "survey-maker" ) . '</a>',
806 'ays-survey-documentation' => '<a href="' . esc_url( 'https://ays-pro.com/wordpress-survey-maker-user-manual' ) . '" target="_blank">' . esc_html__( 'Documentation', "survey-maker" ) . '</a>',
807 'ays-survey-rate-us' => '<a href="' . esc_url( 'https://wordpress.org/support/plugin/survey-maker/reviews/?rate=5#new-post' ) . '" target="_blank">' . esc_html__( 'Rate us', "survey-maker" ) . '</a>',
808 'ays-survey-rate-us' => '<a href="' . esc_url( 'https://www.youtube.com/channel/UC-1vioc90xaKjE7stq30wmA' ) . '" target="_blank">' . esc_html__( 'Video tutorial', "survey-maker" ) . '</a>',
809 );
810
811 return array_merge( $links, $row_meta );
812 }
813 return $links;
814 }
815
816 /**
817 * Render the settings page for this plugin.
818 *
819 * @since 1.0.0
820 */
821 public function display_plugin_setup_page(){
822 include_once('partials/survey-maker-admin-display.php');
823 }
824
825 public function display_plugin_surveys_page(){
826 $action = (isset($_GET['action'])) ? sanitize_text_field($_GET['action']) : '';
827 switch ($action) {
828 case 'add':
829 include_once('partials/surveys/actions/survey-maker-surveys-actions.php');
830 break;
831 case 'edit':
832 include_once('partials/surveys/actions/survey-maker-surveys-actions.php');
833 break;
834 default:
835 include_once('partials/surveys/survey-maker-surveys-display.php');
836 }
837 }
838
839 public function display_plugin_survey_categories_page(){
840 $action = (isset($_GET['action'])) ? sanitize_text_field($_GET['action']) : '';
841
842 switch ($action) {
843 case 'add':
844 include_once('partials/surveys/actions/survey-maker-survey-categories-actions.php');
845 break;
846 case 'edit':
847 include_once('partials/surveys/actions/survey-maker-survey-categories-actions.php');
848 break;
849 default:
850 include_once('partials/surveys/survey-maker-survey-categories-display.php');
851 }
852 }
853
854
855 public function display_plugin_popup_surveys_page(){
856 $action = (isset($_GET['action'])) ? sanitize_text_field($_GET['action']) : '';
857
858 switch ($action) {
859 case 'add':
860 include_once('partials/popup/actions/survey-maker-popup-surveys-actions.php');
861 break;
862 case 'edit':
863 include_once('partials/popup/actions/survey-maker-popup-surveys-actions.php');
864 break;
865 default:
866 include_once('partials/popup/survey-maker-popups-display.php');
867 }
868 }
869
870 public function display_plugin_requests_page(){
871 include_once('partials/requests/survey-maker-requests-display.php');
872 }
873
874 public function display_plugin_submissions_page(){
875
876 include_once('partials/submissions/survey-maker-submissions-display.php');
877 }
878
879 public function display_plugin_each_submission_page(){
880 include_once 'partials/submissions/survey-maker-each-submission-display.php';
881 }
882
883 public function display_plugin_settings_page(){
884 include_once('partials/settings/survey-maker-settings.php');
885 }
886
887 public function display_plugin_export_import_page(){
888 include_once('partials/export-import/survey-maker-export-import-display.php');
889 }
890
891 public function display_plugin_subscribe_email(){
892 include_once('partials/subscribe/survey-maker-subscribe-email-display.php');
893 }
894
895 public function display_plugin_featured_plugins_page(){
896 include_once('partials/features/survey-maker-plugin-featured-display.php');
897 }
898
899 public function display_plugin_features_page(){
900 include_once('partials/features/survey-maker-features-display.php');
901 }
902
903 public function display_plugin_popup_page(){
904 include_once('partials/popup/survey-maker-popups-display.php');
905 }
906
907 public function display_plugin_admin_dashboard_page(){
908 include_once('partials/dashboard/survey-maker-dashboard-display.php');
909 }
910
911 public static function set_screen($status, $option, $value){
912 return $value;
913 }
914
915 public function screen_option_surveys(){
916 $option = 'per_page';
917 $args = array(
918 'label' => __('Surveys', "survey-maker"),
919 'default' => 20,
920 'option' => 'surveys_per_page'
921 );
922
923 if( ! ( isset( $_GET['action'] ) && ( $_GET['action'] == 'add' || $_GET['action'] == 'edit' ) ) ){
924 add_screen_option($option, $args);
925 }
926
927 $this->surveys_obj = new Surveys_List_Table($this->plugin_name);
928 $this->settings_obj = new Survey_Maker_Settings_Actions($this->plugin_name);
929 }
930
931 public function screen_option_survey_categories(){
932 $option = 'per_page';
933 $args = array(
934 'label' => __('Survey Categories', "survey-maker"),
935 'default' => 20,
936 'option' => 'survey_categories_per_page'
937 );
938
939 if( ! ( isset( $_GET['action'] ) && ( $_GET['action'] == 'add' || $_GET['action'] == 'edit' ) ) ){
940 add_screen_option($option, $args);
941 }
942
943 $this->surveys_categories_obj = new Survey_Categories_List_Table($this->plugin_name);
944 $this->settings_obj = new Survey_Maker_Settings_Actions($this->plugin_name);
945 }
946
947 public function screen_option_popup_surveys(){
948 $option = 'per_page';
949 $args = array(
950 'label' => __('Popup Survey', "survey-maker"),
951 'default' => 20,
952 'option' => 'popup_survey_per_page'
953 );
954
955 if( ! ( isset( $_GET['action'] ) && ( $_GET['action'] == 'add' || $_GET['action'] == 'edit' ) ) ){
956 add_screen_option( $option, $args );
957 }
958
959 $this->popup_surveys_obj = new Popup_Survey_List_Table( $this->plugin_name );
960 $this->settings_obj = new Survey_Maker_Settings_Actions($this->plugin_name);
961 }
962
963 public function screen_option_questions(){
964 $option = 'per_page';
965 $args = array(
966 'label' => __('Questions', "survey-maker"),
967 'default' => 20,
968 'option' => 'survey_questions_per_page'
969 );
970
971 add_screen_option($option, $args);
972 $this->questions_obj = new Survey_Questions_List_Table($this->plugin_name);
973 $this->settings_obj = new Survey_Maker_Settings_Actions($this->plugin_name);
974 }
975
976 public function screen_option_questions_categories(){
977 $option = 'per_page';
978 $args = array(
979 'label' => __('Question Categories', "survey-maker"),
980 'default' => 20,
981 'option' => 'survey_question_categories_per_page'
982 );
983
984 add_screen_option($option, $args);
985 $this->question_categories_obj = new Survey_Question_Categories_List_Table($this->plugin_name);
986 }
987
988 public function screen_option_submissions(){
989 $option = 'per_page';
990 $args = array(
991 'label' => __('Submissions', "survey-maker"),
992 'default' => 20,
993 'option' => 'survey_submissions_results_per_page'
994 );
995
996 add_screen_option($option, $args);
997 $this->submissions_obj = new Submissions_List_Table( $this->plugin_name );
998 }
999
1000 public function screen_option_each_survey_submission() {
1001 $option = 'per_page';
1002 $args = array(
1003 'label' => __('Results', "survey-maker"),
1004 'default' => 50,
1005 'option' => 'survey_each_submission_results_per_page',
1006 );
1007
1008 add_screen_option($option, $args);
1009 $this->each_submission_obj = new Survey_Each_Submission_List_Table($this->plugin_name);
1010 }
1011
1012 public function screen_option_settings(){
1013 $this->settings_obj = new Survey_Maker_Settings_Actions($this->plugin_name);
1014 }
1015
1016 public function deactivate_plugin_option(){
1017
1018 // Run a security check.
1019 check_ajax_referer( 'survey-maker-ajax-deactivate-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
1020
1021 // Check for permissions.
1022 if ( ! current_user_can( 'manage_options' ) ) {
1023 ob_end_clean();
1024 $ob_get_clean = ob_get_clean();
1025 echo json_encode(array(
1026 'option' => ''
1027 ));
1028 wp_die();
1029 }
1030
1031 if( is_user_logged_in() ) {
1032 $request_value = sanitize_text_field($_REQUEST['upgrade_plugin']);
1033 $upgrade_option = get_option( 'ays_survey_maker_upgrade_plugin', '' );
1034 if($upgrade_option === ''){
1035 add_option( 'ays_survey_maker_upgrade_plugin', $request_value );
1036 }else{
1037 update_option( 'ays_survey_maker_upgrade_plugin', $request_value );
1038 }
1039
1040 ob_end_clean();
1041 $ob_get_clean = ob_get_clean();
1042 echo json_encode(array(
1043 'option' => get_option( 'ays_survey_maker_upgrade_plugin', '' )
1044 ));
1045 wp_die();
1046 } else {
1047 ob_end_clean();
1048 $ob_get_clean = ob_get_clean();
1049 echo json_encode(array(
1050 'option' => ''
1051 ));
1052 wp_die();
1053 }
1054 }
1055
1056 public function survey_maker_admin_footer($a){
1057 if(isset($_REQUEST['page'])){
1058 if(false !== strpos( sanitize_text_field( $_REQUEST['page'] ), $this->plugin_name)){
1059 ?>
1060 <div class="ays-survey-footer-support-box">
1061 <span class="ays-survey-footer-link-row"><a href="https://wordpress.org/support/plugin/survey-maker/" target="_blank"><?php echo esc_html__( "Support", "survey-maker"); ?></a></span>
1062 <span class="ays-survey-footer-slash-row">/</span>
1063 <span class="ays-survey-footer-link-row"><a href="https://ays-pro.com/wordpress-survey-maker-user-manual" target="_blank"><?php echo esc_html__( "Docs", "survey-maker"); ?></a></span>
1064 <span class="ays-survey-footer-slash-row">/</span>
1065 <span class="ays-survey-footer-link-row"><a href="https://ays-demo.com/survey-maker-plugin-survey/" target="_blank"><?php echo esc_html__( "Suggest a Feature", "survey-maker"); ?></a></span>
1066 </div>
1067 <p class="ays-survey-footer-review-box" style="font-size:13px;text-align:center;font-style:italic;">
1068 <span style="margin-left:0px;margin-right:10px;" class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span>
1069 <span><?php echo esc_html__( "If you love our plugin, please do big favor and rate us on", "survey-maker"); ?> WordPress.org</span>
1070 <a target="_blank" href='https://wordpress.org/support/plugin/survey-maker/reviews/?rate=5#new-post'></a>
1071 <a target="_blank" class="ays-rated-link" href='https://wordpress.org/support/plugin/survey-maker/reviews'>
1072 <span class="ays-dashicons ays-dashicons-star-empty"></span>
1073 <span class="ays-dashicons ays-dashicons-star-empty"></span>
1074 <span class="ays-dashicons ays-dashicons-star-empty"></span>
1075 <span class="ays-dashicons ays-dashicons-star-empty"></span>
1076 <span class="ays-dashicons ays-dashicons-star-empty"></span>
1077 </a>
1078 <span class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span>
1079 </p>
1080 <?php
1081 }
1082 }
1083 }
1084
1085 public static function ays_restriction_string($type, $x, $length){
1086 $output = "";
1087 switch($type){
1088 case "char":
1089 if(strlen($x)<=$length){
1090 $output = $x;
1091 } else {
1092 $output = substr($x,0,$length) . '...';
1093 }
1094 break;
1095 case "word":
1096 $res = explode(" ", $x);
1097 if(count($res)<=$length){
1098 $output = implode(" ",$res);
1099 } else {
1100 $res = array_slice($res,0,$length);
1101 $output = implode(" ",$res) . '...';
1102 }
1103 break;
1104 }
1105 return $output;
1106 }
1107
1108 public static function validateDate($date, $format = 'Y-m-d H:i:s'){
1109 $d = DateTime::createFromFormat($format, $date);
1110 return $d && $d->format($format) == $date;
1111 }
1112
1113 public static function get_max_id( $table ) {
1114 global $wpdb;
1115 $db_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . $table;
1116
1117 $sql = "SELECT MAX(id) FROM {$db_table}";
1118
1119 $result = intval( $wpdb->get_var( $sql ) );
1120
1121 return $result;
1122 }
1123
1124 public function get_all_surveys(){
1125 global $wpdb;
1126 $surveys_table = $wpdb->prefix . "ayssurvey_surveys";
1127 $surveys = $wpdb->get_results("SELECT * FROM {$surveys_table}");
1128 return $surveys;
1129 }
1130
1131 public static function string_starts_with_number($string){
1132 $match = preg_match('/^\d/', $string);
1133 if($match === 1){
1134 return true;
1135 }else{
1136 return false;
1137 }
1138 }
1139
1140 public function get_question_answers( $question_id ) {
1141 global $wpdb;
1142
1143 $sql = "SELECT * FROM {$wpdb->prefix}ayssurvey_answers WHERE question_id=" . absint( $question_id );
1144
1145 $results = $wpdb->get_results( $sql, 'ARRAY_A' );
1146 foreach ($results as $key => &$result) {
1147 unset($result['id']);
1148 unset($result['question_id']);
1149 }
1150
1151 return $results;
1152 }
1153
1154 public function ays_survey_question_results( $survey_id, $submission_ids = null ){
1155 global $wpdb;
1156
1157 if($survey_id === null){
1158 return array(
1159 'total_count' => 0,
1160 'questions' => array()
1161 );
1162 }
1163
1164 $submitions_questiions_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions_questions";
1165 $answer_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "answers";
1166 $question_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "questions";
1167 $submitions_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions";
1168 $survey_section_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "sections";
1169 $surveys_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "surveys";
1170
1171 $survey_options_sql = "SELECT options FROM {$surveys_table} WHERE id =". absint( $survey_id );
1172 $survey_options = $wpdb->get_var( $survey_options_sql );
1173
1174 $survey_options = isset( $survey_options ) && $survey_options != '' ? json_decode( $survey_options, true ) : array();
1175
1176 // Allow HTML in answers
1177 $survey_options[ 'survey_allow_html_in_answers' ] = isset($survey_options[ 'survey_allow_html_in_answers' ]) ? $survey_options[ 'survey_allow_html_in_answers' ] : 'off';
1178 $allow_html_in_answers = (isset($survey_options[ 'survey_allow_html_in_answers' ]) && $survey_options[ 'survey_allow_html_in_answers' ] == 'on') ? true : false;
1179
1180 $question_ids = "SELECT question_ids FROM {$surveys_table} WHERE id =". absint( $survey_id );
1181 $question_ids_results = $wpdb->get_var( $question_ids );
1182 $ays_question_id = ($question_ids_results != '') ? $question_ids_results : null;
1183
1184 if($ays_question_id == null){
1185 return array(
1186 'total_count' => 0,
1187 'questions' => array()
1188 );
1189 }
1190
1191 $questions_ids_arr = explode(',',$ays_question_id);
1192 $answer_id = "SELECT a.id, a.answer, COUNT(s_q.answer_id) AS answer_count
1193 FROM {$answer_table} AS a
1194 LEFT JOIN {$submitions_questiions_table} AS s_q
1195 ON a.id = s_q.answer_id
1196 WHERE s_q.survey_id=".absint( $survey_id ) ."
1197 GROUP BY a.id";
1198
1199 $answer_id_result = $wpdb->get_results($answer_id,'ARRAY_A');
1200
1201 $for_checkbox = "SELECT a.id, a.answer, COUNT(s_q.answer_id) AS answer_count
1202 FROM {$answer_table} AS a
1203 LEFT JOIN {$submitions_questiions_table} AS s_q
1204 ON a.id = s_q.answer_id OR FIND_IN_SET( a.id, s_q.user_answer )
1205 WHERE s_q.type = 'checkbox'
1206 AND s_q.survey_id=".absint( $survey_id ) ."
1207 GROUP BY a.id";
1208
1209 $for_checkbox_result = $wpdb->get_results($for_checkbox,'ARRAY_A');
1210
1211 $for_text_type = "SELECT a.id, a.answer, COUNT(s_q.id) AS answer_count
1212 FROM {$answer_table} AS a
1213 LEFT JOIN {$submitions_questiions_table} AS s_q
1214 ON a.id = s_q.answer_id OR FIND_IN_SET( a.id, s_q.user_answer )
1215 WHERE s_q.type IN ('name', 'email', 'text', 'short_text', 'number')
1216 AND s_q.survey_id=".absint( $survey_id ) ."
1217 GROUP BY a.id";
1218
1219 $for_text_type_result = $wpdb->get_results($for_checkbox,'ARRAY_A');
1220 $answer_count = array();
1221 $question_type = '';
1222 foreach ($answer_id_result as $key => $answer_count_by_id) {
1223 $ays_survey_answer_count = (isset($answer_count_by_id['answer_count']) && $answer_count_by_id['answer_count'] !="") ? absint(intval($answer_count_by_id['answer_count'])) : '';
1224 $answer_count[$answer_count_by_id['id']] = $ays_survey_answer_count;
1225 }
1226
1227 foreach ($for_checkbox_result as $key => $answer_count_by_id) {
1228 $ays_survey_answer_count = (isset($answer_count_by_id['answer_count']) && $answer_count_by_id['answer_count'] !="") ? absint(intval($answer_count_by_id['answer_count'])) : '';
1229 $answer_count[$answer_count_by_id['id']] = $ays_survey_answer_count;
1230 }
1231
1232 foreach ($for_text_type_result as $key => $answer_count_by_id) {
1233 $ays_survey_answer_count = (isset($answer_count_by_id['answer_count']) && $answer_count_by_id['answer_count'] !="") ? absint(intval($answer_count_by_id['answer_count'])) : '';
1234 $answer_count[$answer_count_by_id['id']] = $ays_survey_answer_count;
1235 }
1236
1237 $question_by_ids = Survey_Maker_Data::get_question_by_ids( $questions_ids_arr );
1238
1239 $select_answer_q_type = "SELECT type, user_answer, id, question_id
1240 FROM {$submitions_questiions_table}
1241 WHERE user_answer != ''
1242 AND type != 'checkbox'
1243 AND survey_id=". absint( $survey_id );
1244
1245 $submission_answer_other = "SELECT question_id, user_variant
1246 FROM {$submitions_questiions_table}
1247 WHERE user_variant != ''
1248 AND survey_id=". absint( $survey_id );
1249
1250 if( $submission_ids !== null ){
1251 if( is_array( $submission_ids ) ){
1252 $select_answer_q_type .= " AND submission_id IN (" . esc_sql( implode( ',', $submission_ids ) ) . ") ";
1253 $submission_answer_other .= " AND submission_id IN (" . esc_sql( implode( ',', $submission_ids ) ) . ") ";
1254 }
1255 }
1256
1257 $result_answers_q_type = $wpdb->get_results($select_answer_q_type,'ARRAY_A');
1258 $result_answers_other = $wpdb->get_results($submission_answer_other,'ARRAY_A');
1259 $text_answer = array();
1260 foreach($result_answers_q_type as $key => $result_answer_q_type){
1261 $text_answer[$result_answer_q_type['type']][$result_answer_q_type['question_id']][] = $result_answer_q_type['user_answer'];
1262 }
1263
1264 $other_answers = array();
1265 foreach($result_answers_other as $key => $result_answer_other){
1266 $other_answers[$result_answer_other['question_id']][] = $result_answer_other['user_variant'];
1267 }
1268
1269 $text_types = array(
1270 'text',
1271 'short_text',
1272 'number',
1273 'date',
1274 'time',
1275 'date_time',
1276 'star',
1277 'phone',
1278 'name',
1279 'email',
1280 );
1281
1282 //Question types different charts
1283 $ays_submissions_count = array();
1284 $question_results = array();
1285
1286 $total_count = 0;
1287 foreach ($question_by_ids as $key => $question) {
1288 $answers = $question->answers;
1289 $question_id = $question->id;
1290 $question_title = $question->question;
1291 $question_type = $question->type;
1292 //questions
1293 $question_results[$question_id]['question_id'] = $question_id;
1294 $question_results[$question_id]['question'] = $question_title;
1295 $ays_answer = array();
1296 $question_answer_ids = array();
1297 //
1298
1299 foreach ($answers as $key => $answer) {
1300 $answer_id = $answer->id;
1301 $answer_title = $answer->answer;
1302
1303 $ays_answer[$answer_id] = isset( $answer_count[$answer_id] ) ? $answer_count[$answer_id] : 0;
1304 $question_answer_ids[$answer_id] = $allow_html_in_answers ? sanitize_text_field( $answer_title ) : $answer_title;
1305 }
1306
1307 //sum of submissions count per questions
1308 if($question_type == "checkbox"){
1309 $sub_checkbox_count = $this->ays_survey_get_submission_count($question->id, $question_type, $survey_id);
1310 $sum_of_count = $sub_checkbox_count;
1311 }else{
1312 $sum_of_count = array_sum( array_values( $ays_answer ) );
1313 }
1314 $question_results[$question_id]['otherAnswers'] = isset( $other_answers[$question->id] ) ? $other_answers[$question->id] : array();
1315
1316 if( in_array( $question->type, $text_types ) ){
1317 $question_ls_options = json_decode($question->options, true);
1318 if($question->type == 'star'){
1319 $scale_from = isset($question_ls_options['star_1']) && $question_ls_options['star_1'] != "" ? stripslashes($question_ls_options['star_1']) : "";
1320 $scale_to = isset($question_ls_options['star_2']) && $question_ls_options['star_2'] != "" ? stripslashes($question_ls_options['star_2']) : "";
1321 $scale_length = isset($question_ls_options['star_scale_length']) && $question_ls_options['star_scale_length'] != "" ? $question_ls_options['star_scale_length'] : "";
1322 $question_results[$question_id]['labels'] = array(
1323 'from' => $scale_from,
1324 'to' => $scale_to,
1325 'length' => $scale_length
1326 );
1327 }
1328 $question_results[$question_id]['answers'] = isset( $text_answer[$question->type] ) ? $text_answer[$question->type] : '';
1329 $question_results[$question_id]['answerTitles'] = isset( $text_answer[$question->type] ) ? $text_answer[$question->type] : '';
1330 $question_results[$question_id]['sum_of_answers_count'] = isset( $text_answer[$question->type][$question->id] ) ? count( $text_answer[$question->type][$question->id] ) : 0;
1331 $question_results[$question_id]['sum_of_same_answers'] = isset( $text_answer[$question->type][$question->id] ) ? array_count_values( $text_answer[$question->type][$question->id] ) : 0;
1332 }else{
1333 $question_results[$question_id]['answers'] = $ays_answer;
1334 $question_results[$question_id]['answerTitles'] = $question_answer_ids;
1335 $question_results[$question_id]['sum_of_answers_count'] = $sum_of_count;
1336 if( $sum_of_count == 0 ){
1337 $question_results[$question_id]['answers'] = array();
1338 }
1339 }
1340
1341 // Answers for charts
1342 if( !empty( $question_results[$question_id]['otherAnswers'] ) ){
1343 $question_results[$question_id]['answers'][0] = count( $question_results[$question_id]['otherAnswers'] );
1344 $question_results[$question_id]['answerTitles'][0] = __( '"Other" answer(s)', "survey-maker" );
1345 $question_results[$question_id]['same_other_count'] = array_count_values( $question_results[$question_id]['otherAnswers'] );
1346
1347 if($question_type == "radio" || $question_type == "yesorno"){
1348 $question_results[$question_id]['sum_of_answers_count'] += count( $question_results[$question_id]['otherAnswers'] );
1349 }
1350
1351 }
1352 //
1353
1354 $total_count += intval( $question_results[$question_id]['sum_of_answers_count'] );
1355
1356 $question_results[$question_id]['question_type'] = $question->type;
1357 }
1358
1359 return array(
1360 'total_count' => $total_count,
1361 'questions' => $question_results
1362 );
1363 }
1364
1365 public function ays_survey_get_last_submission_id( $survey_id ){
1366 global $wpdb;
1367
1368 if($survey_id === null){
1369 return array();
1370 }
1371
1372 $submitions_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions";
1373
1374 //submission of each result
1375 $submission = "SELECT * FROM {$submitions_table} WHERE survey_id=". absint( $survey_id ) ." ORDER BY id DESC LIMIT 1 ";
1376 $last_submission = $wpdb->get_row( $submission, 'ARRAY_A' );
1377
1378 if( $last_submission == null ){
1379 return array();
1380 }
1381 return $last_submission;
1382 }
1383
1384 public function ays_survey_individual_results_for_one_submission( $submission, $survey ){
1385 global $wpdb;
1386 $survey_id = isset( $survey['id'] ) ? absint( intval( $survey['id'] ) ) : null;
1387
1388 if( is_null( $survey_id ) || empty( $submission )){
1389 return array(
1390 'sections' => array()
1391 );
1392 }
1393
1394 $submitions_questiions_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions_questions";
1395 $submitions_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions";
1396
1397 $ays_individual_questions_for_one_submission = array();
1398 $question_answer_id = array();
1399 $submission_id = isset( $submission['id'] ) && $submission['id'] != '' ? $submission['id'] : null;
1400
1401 if( is_null( $submission_id ) ){
1402 return array(
1403 'sections' => array()
1404 );
1405 }
1406
1407 $checkbox_ids = '';
1408
1409 $individual_questions = "SELECT * FROM {$submitions_questiions_table} WHERE submission_id=" . absint( $submission_id );
1410 $individual_questions_results = $wpdb->get_results($individual_questions,'ARRAY_A');
1411
1412 // Get user info
1413 $which_needed = "id,user_ip,user_id,user_name,user_email,submission_date,options";
1414 $individual_users = "SELECT ".$which_needed." FROM ".$submitions_table." WHERE id=" . absint( $submission_id );
1415 $individual_users_results = $wpdb->get_row($individual_users,'ARRAY_A');
1416 $user_id = isset($individual_users_results['user_id']) && $individual_users_results['user_id'] != "" ? $individual_users_results['user_id'] : 0;
1417 $user_real_name = __("Guest" , "survey-maker");
1418 $user_real_email = "";
1419 if($user_id > 0){
1420 $user_data = get_userdata($user_id);
1421 $user_real_name = $user_data ? $user_data->data->display_name : __('Deleted User' , "survey-maker");
1422 $user_real_email = $user_data ? $user_data->data->user_email : '';
1423 }
1424 if(!isset($individual_users_results['user_name']) || (isset($individual_users_results['user_name']) && $individual_users_results['user_name'] == "")){
1425 $individual_users_results['user_name'] = $user_real_name;
1426 }
1427
1428 if(!isset($individual_users_results['user_email']) || (isset($individual_users_results['user_email']) && $individual_users_results['user_email'] == "")){
1429 $individual_users_results['user_email'] = $user_real_email;
1430 }
1431 $individual_users_results['user_name'] = stripslashes(nl2br( htmlentities($individual_users_results['user_name'])));
1432 // Survey questions IDs
1433 $question_ids = isset( $survey['question_ids'] ) && $survey['question_ids'] != '' ? $survey['question_ids'] : '';
1434
1435 // Section Ids
1436 $sections_ids = (isset( $survey['section_ids' ] ) && $survey['section_ids'] != '') ? $survey['section_ids'] : '';
1437
1438 $sections = Survey_Maker_Data::get_suervey_sections_with_questions( $sections_ids, $question_ids );
1439
1440 $text_types = array(
1441 'text',
1442 'short_text',
1443 'phone',
1444 'date',
1445 'time',
1446 'date_time',
1447 'star',
1448 'number',
1449 'name',
1450 'email',
1451 );
1452
1453 foreach ($individual_questions_results as $key => $individual_questions_result) {
1454 if($individual_questions_result['type'] == 'checkbox'){
1455 $checkbox_ids = $individual_questions_result['user_answer'] != '' ? explode(',', $individual_questions_result['user_answer']) : array();
1456 $question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = $checkbox_ids;
1457
1458 $question_answer_id[ $individual_questions_result['question_id'] ]['otherAnswer'] = isset($individual_questions_result['user_variant']) && $individual_questions_result['user_variant'] != '' ? stripslashes(htmlentities($individual_questions_result['user_variant'])) : '';
1459 }elseif( in_array( $individual_questions_result['type'], $text_types ) ){
1460
1461 if( $individual_questions_result['type'] == 'date' ){
1462 $question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = stripslashes(htmlentities($individual_questions_result['user_answer']));
1463
1464 if( $individual_questions_result['user_answer'] != '' ){
1465 $question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = date( 'd . m . Y', strtotime(nl2br(htmlentities($individual_questions_result['user_answer']))) );
1466 }else{
1467 $question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = '';
1468 }
1469 }
1470 elseif( $individual_questions_result['type'] == 'time' ){
1471 if( $individual_questions_result['user_answer'] != '' ){
1472 $question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = implode(" : ", explode( ":", $individual_questions_result['user_answer'] ));
1473 }else{
1474 $question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = '';
1475 }
1476 }
1477 elseif( $individual_questions_result['type'] == 'date_time' ){
1478 if( $individual_questions_result['user_answer'] != '' ){
1479 $user_date_time_answer = explode(" ", $individual_questions_result['user_answer'] );
1480 if((isset($user_date_time_answer[0]) && $user_date_time_answer[0] != '-') && (isset($user_date_time_answer[1]) && $user_date_time_answer[1] != '-')){
1481 $question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = date( 'd . m . Y', strtotime(nl2br(htmlentities($user_date_time_answer[0]))) ) . " " . implode(" : ", explode( ":", $user_date_time_answer[1] ));
1482 }
1483 }else{
1484 $question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = '';
1485 }
1486 }
1487 else{
1488 $question_answer_id[ $individual_questions_result['question_id'] ] = stripslashes(htmlentities($individual_questions_result['user_answer']));
1489 }
1490 }elseif($individual_questions_result['type'] == 'radio'){
1491
1492 $other_answer = isset($individual_questions_result['user_variant']) && $individual_questions_result['user_variant'] != '' ? stripslashes(htmlentities($individual_questions_result['user_variant'])) : '';
1493 $question_answer_id[ $individual_questions_result['question_id'] ]['otherAnswer'] = $other_answer;
1494 $question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = $individual_questions_result['answer_id'];
1495 }else{
1496 $question_answer_id[ $individual_questions_result['question_id'] ] = $individual_questions_result['answer_id'];
1497 }
1498 }
1499
1500 $ays_individual_questions_for_one_submission['submission_id'] = $submission['id'];
1501 $ays_individual_questions_for_one_submission['questions'] = $question_answer_id;
1502 $ays_individual_questions_for_one_submission['sections'] = $sections;
1503 $ays_individual_questions_for_one_submission['user_info'] = $individual_users_results;
1504 return $ays_individual_questions_for_one_submission;
1505 }
1506
1507 public function get_submission_count_and_ids(){
1508 global $wpdb;
1509 $survey_id = isset($_GET['survey']) ? intval($_GET['survey']) : null;
1510
1511 if($survey_id === null){
1512 return false;
1513 }
1514 $submitions_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions";
1515
1516 //submission of each result
1517 $submission_ids = "SELECT id,
1518 (SELECT COUNT(id) FROM {$submitions_table} i
1519 WHERE i.survey_id=j.survey_id) AS count_submission
1520 FROM {$submitions_table} j
1521 WHERE survey_id=". absint( $survey_id ) ."
1522 ORDER BY id";
1523 $submission_ids_result = $wpdb->get_results($submission_ids,'ARRAY_A');
1524 $submission_count = '';
1525 $submissions_id_arr = array();
1526 foreach ($submission_ids_result as $key => $submission_id_result) {
1527 $submission_id_count = $submission_id_result['count_submission'];
1528 $submission_count = intval($submission_id_count);
1529 $submissions_id_arr[] = $submission_id_result['id'];
1530 }
1531 $submissions_id_str = implode(',', $submissions_id_arr );
1532
1533 $submission_count_and_ids = array(
1534 'submission_count' => $submission_count,
1535 'submission_ids' => $submissions_id_str
1536 );
1537
1538 return $submission_count_and_ids;
1539 }
1540
1541 public function ays_survey_submission_report(){
1542 global $wpdb;
1543 if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'ays_survey_submission_report' && wp_verify_nonce( $_REQUEST['nonce'], 'ajax-nonce' )) {
1544
1545 $survey_id = (isset($_REQUEST['surveyId']) && $_REQUEST['surveyId'] != "") ? intval(sanitize_text_field($_REQUEST['surveyId'])) : null;
1546 if($survey_id === null){
1547 return false;
1548 }
1549
1550 $sql = "SELECT * FROM " . $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "surveys WHERE id =" . absint( $survey_id );
1551 $survey = $wpdb->get_row( $sql, 'ARRAY_A' );
1552
1553 $submission_id = (isset($_REQUEST['submissionId']) && $_REQUEST['submissionId'] != '') ? absint( sanitize_text_field( $_REQUEST['submissionId'] ) ) : null;
1554 if($submission_id == null){
1555 return false;
1556 }
1557 $submission = array(
1558 'id' => $submission_id
1559 );
1560
1561 $results = $this->ays_survey_individual_results_for_one_submission( $submission, $survey );
1562 $individual_user_name = isset($results['user_info']['user_name']) && isset($results['user_info']['user_name']) ? $results['user_info']['user_name'] : "";
1563 $individual_user_email = isset($results['user_info']['user_email']) && isset($results['user_info']['user_email']) ? wp_kses_post($results['user_info']['user_email']) : "";
1564 $individual_user_ip = isset($results['user_info']['user_ip']) && isset($results['user_info']['user_ip']) ? esc_attr($results['user_info']['user_ip']) : "";
1565 $individual_user_date = isset($results['user_info']['submission_date']) && isset($results['user_info']['submission_date']) ? esc_attr($results['user_info']['submission_date']) : "";
1566 $individual_user_sub_id = isset($results['user_info']['id']) && isset($results['user_info']['id']) ? esc_attr($results['user_info']['id']) : "";
1567
1568 $individual_user_extra_data = isset($results['user_info']['options']) && $results['user_info']['options'] != '' ? json_decode(($results['user_info']['options']) , 'true') : array();
1569 $individual_user_device_type = isset($individual_user_extra_data['device']) && $individual_user_extra_data['device'] != '' ? esc_attr(ucfirst($individual_user_extra_data['device'])) : '';
1570
1571 $survey_data_clipboard = array(
1572 "user_name" => $individual_user_name,
1573 "user_email" => $individual_user_email,
1574 "user_ip" => $individual_user_ip,
1575 "user_date" => $individual_user_date,
1576 "user_sub_id" => $individual_user_sub_id,
1577 "user_device_type" => $individual_user_device_type,
1578 );
1579 $results['user_info']['user_device_type'] = $individual_user_device_type;
1580 ob_end_clean();
1581 $ob_get_clean = ob_get_clean();
1582 $response = array(
1583 'status' => true,
1584 'questions' => $results['questions'],
1585 'user_info' => $results['user_info'],
1586 'user_info_for_copy' => Survey_Maker_Data::ays_survey_copy_text_formater($survey_data_clipboard)
1587 );
1588 echo json_encode($response);
1589 wp_die();
1590 }
1591 ob_end_clean();
1592 $ob_get_clean = ob_get_clean();
1593 $response = array(
1594 'status' => false
1595 );
1596 echo json_encode($response);
1597 wp_die();
1598 }
1599
1600 // Survey Maker Elementor widget init
1601 public function survey_maker_el_widgets_registered() {
1602 // We check if the Elementor plugin has been installed / activated.
1603 if ( defined( 'ELEMENTOR_PATH' ) && class_exists( 'Elementor\Widget_Base' ) ) {
1604 // get our own widgets up and running:
1605 // copied from widgets-manager.php
1606 if ( class_exists( 'Elementor\Plugin' ) ) {
1607 if ( is_callable( 'Elementor\Plugin', 'instance' ) ) {
1608 $elementor = Elementor\Plugin::instance();
1609 if ( isset( $elementor->widgets_manager ) ) {
1610 if ( method_exists( $elementor->widgets_manager, 'register_widget_type' ) ) {
1611 wp_enqueue_style($this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'css/admin.css', array(), $this->version, 'all');
1612 wp_enqueue_style( SURVEY_MAKER_NAME . "-dropdown", SURVEY_MAKER_PUBLIC_URL . '/css/dropdown.min.css', array(), SURVEY_MAKER_VERSION, 'all' );
1613 $widget_file = 'plugins/elementor/survey-maker-elementor.php';
1614 $template_file = locate_template( $widget_file );
1615 if ( !$template_file || !is_readable( $template_file ) ) {
1616 $template_file = SURVEY_MAKER_DIR . 'pb_templates/survey-maker-elementor.php';
1617 }
1618 if ( $template_file && is_readable( $template_file ) ) {
1619 require_once $template_file;
1620 Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Elementor\Widget_Survey_Maker_Elementor() );
1621 }
1622 }
1623 }
1624 }
1625 }
1626 }
1627 }
1628
1629 // Get Submissions count ( Checkbox )
1630 public function ays_survey_get_submission_count($id, $type, $survey_id){
1631 global $wpdb;
1632 $submitions_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions";
1633 $submitions_q_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions_questions";
1634 $results = array();
1635 if($type == 'checkbox'){
1636 $sql = "SELECT COUNT(submission_id) AS sub_count
1637 FROM {$submitions_q_table}
1638 WHERE question_id = ". absint( $id )."
1639 AND user_answer != ''
1640 AND type='". esc_sql( $type ) ."'
1641 AND survey_id=". absint( $survey_id );
1642 $results = $wpdb->get_row($sql,'ARRAY_A');
1643 }
1644 $submission_count = isset($results['sub_count']) && $results['sub_count'] != "" && $results['sub_count'] > 0 ? $results['sub_count'] : 0;
1645 return $submission_count;
1646 }
1647
1648 public function ays_survey_sale_baner(){
1649 /* OLD INFO OPEN AFTER HALLOWEN START */
1650 // if(isset($_POST['ays_survey_sale_btn'])){
1651 // update_option('ays_survey_sale_btn', 1);
1652 // update_option('ays_survey_maker_sale_date', current_time( 'mysql' ));
1653 // }
1654
1655 // if(isset($_POST['ays_survey_sale_btn_for_two_months'])){
1656 // update_option('ays_survey_sale_btn_for_two_months', 1);
1657 // update_option('ays_survey_maker_sale_date', current_time( 'mysql' ));
1658 // }
1659
1660 // $ays_survey_maker_sale_date = get_option('ays_survey_maker_sale_date');
1661 // $ays_survey_maker_sale_two_months = get_option('ays_survey_sale_btn_for_two_months');
1662
1663 // $val = 60*60*24*5;
1664 // if($ays_survey_maker_sale_two_months == 1){
1665 // $val = 60*60*24*61;
1666 // }
1667
1668 // $current_date = current_time( 'mysql' );
1669 // $date_diff = strtotime($current_date) - intval(strtotime($ays_survey_maker_sale_date)) ;
1670
1671 // $days_diff = $date_diff / $val;
1672
1673 // if(intval($days_diff) > 0 ){
1674 // update_option('ays_survey_sale_btn', 0);
1675 // update_option('ays_survey_sale_btn_for_two_months', 0);
1676 // }
1677
1678 // $ays_survey_maker_flag = intval(get_option('ays_survey_sale_btn'));
1679 // $ays_survey_maker_flag += intval(get_option('ays_survey_sale_btn_for_two_months'));
1680 // if( $ays_survey_maker_flag == 0 ){
1681 // if (isset($_GET['page']) && strpos($_GET['page'], SURVEY_MAKER_NAME) !== false) {
1682 // if( !(Survey_Maker_Admin::get_max_id('surveys') <= 1) ){
1683 // // $this->ays_survey_sale_message($ays_survey_maker_flag);
1684 // // $this->ays_survey_spring_bundle_small_message($ays_survey_maker_flag);
1685 // $this->ays_survey_maker_helloween_message($ays_survey_maker_flag);
1686 // }
1687 // }
1688 // }
1689 /* OLD INFO OPEN AFTER HALLOWEN END */
1690
1691 // ONLY FOR Black Friday
1692 if(isset($_POST['ays_survey_sale_btn']) &&
1693 (isset( $_POST[$this->plugin_name . '-sale-banner'] ) && wp_verify_nonce( $_POST[$this->plugin_name . '-sale-banner'], $this->plugin_name . '-sale-banner' )) &&
1694 current_user_can( 'manage_options' )){
1695
1696 update_option('ays_survey_sale_btn', 1);
1697 update_option('ays_survey_sale_date', current_time( 'mysql' ));
1698 }
1699
1700 $ays_survey_sale_date = get_option('ays_survey_sale_date');
1701
1702 $val = 60*60*24*5;
1703
1704 $current_date = current_time( 'mysql' );
1705 $date_diff = strtotime($current_date) - intval(strtotime($ays_survey_sale_date)) ;
1706
1707 $days_diff = $date_diff / $val;
1708
1709 if(intval($days_diff) > 0 ){
1710 update_option('ays_survey_sale_btn', 0);
1711 }
1712
1713
1714 $ays_survey_maker_flag = intval(get_option('ays_survey_sale_btn'));
1715 if( $ays_survey_maker_flag == 0 ){
1716 if (isset($_GET['page']) && strpos($_GET['page'], SURVEY_MAKER_NAME) !== false) {
1717 if(Survey_Maker_Admin::get_max_id('surveys') > 1){
1718 // $this->ays_survey_new_halloween_bundle_message_2025($ays_survey_maker_flag);
1719 // $this->ays_survey_black_friday_message($ays_survey_maker_flag);
1720 // $this->ays_survey_christmas_banner_message_2025($ays_survey_maker_flag);
1721 // $this->ays_survey_new_mega_bundle_message_2026($ays_survey_maker_flag);
1722 $this->ays_survey_footer_sale_banner_2026($ays_survey_maker_flag);
1723 }
1724 }
1725 }
1726
1727 }
1728
1729 // New Mega Bundle
1730 public function ays_quiz_new_mega_bundle_message_2025($ishmar){
1731 if($ishmar == 0 ){
1732 $content = array();
1733
1734 $survey_cta_button_link = esc_url('https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=mega-bundle-2025-sale-banner-' . SURVEY_MAKER_VERSION);
1735
1736 $content[] = '<div id="ays-survey-new-mega-bundle-2025-dicount-month-main" class="notice notice-success is-dismissible ays_survey_dicount_info">';
1737 $content[] = '<div id="ays-survey-dicount-month" class="ays_survey_dicount_month">';
1738
1739 $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-text-box">';
1740 $content[] = '<div>';
1741
1742 $content[] = '<span class="ays-survey-new-mega-bundle-2025-title">';
1743 $content[] = __( "<span><a href='". $survey_cta_button_link ."' target='_blank' style='color:#ffffff; text-decoration: underline;'>Mega Bundle</a></span> (Quiz + Survey + Poll)", 'survey-maker' );
1744 $content[] = '</span>';
1745
1746 $content[] = '</br>';
1747
1748 $content[] = '<span class="ays-survey-new-mega-bundle-2025-desc">';
1749 $content[] = __( "30 Day Money Back Guarantee", 'survey-maker' );
1750 $content[] = '</span>';
1751 $content[] = '</div>';
1752
1753 $content[] = '<div>';
1754 $content[] = '<img class="ays-survey-new-mega-bundle-guaranteeicon" src="' . SURVEY_MAKER_ADMIN_URL . '/images/ays-survey-mega-bundle-2025-discount.svg" style="width: 80px;">';
1755 $content[] = '</div>';
1756
1757 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form">';
1758
1759 $content[] = '<form action="" method="POST">';
1760 $content[] = '<div id="ays-survey-dismiss-buttons-content">';
1761 if( current_user_can( 'manage_options' ) ){
1762 $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">'. __( "Dismiss ad", 'survey-maker' ) .'</button>';
1763 $content[] = wp_nonce_field( SURVEY_MAKER_NAME . '-sale-banner' , SURVEY_MAKER_NAME . '-sale-banner' );
1764 }
1765 $content[] = '</div>';
1766 $content[] = '</form>';
1767
1768 $content[] = '</div>';
1769
1770 $content[] = '</div>';
1771
1772 $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-countdown-box">';
1773
1774 $content[] = '<div id="ays-survey-maker-countdown-main-container">';
1775 $content[] = '<div class="ays-survey-maker-countdown-container">';
1776
1777 $content[] = '<div id="ays-survey-countdown">';
1778
1779 $content[] = '<ul>';
1780 $content[] = '<li><span id="ays-survey-countdown-days"></span>'. __( "Days", 'survey-maker' ) .'</li>';
1781 $content[] = '<li><span id="ays-survey-countdown-hours"></span>'. __( "Hours", 'survey-maker' ) .'</li>';
1782 $content[] = '<li><span id="ays-survey-countdown-minutes"></span>'. __( "Minutes", 'survey-maker' ) .'</li>';
1783 $content[] = '<li><span id="ays-survey-countdown-seconds"></span>'. __( "Seconds", 'survey-maker' ) .'</li>';
1784 $content[] = '</ul>';
1785 $content[] = '</div>';
1786
1787 $content[] = '<div id="ays-survey-countdown-content" class="emoji">';
1788 $content[] = '<span></span>';
1789 $content[] = '<span></span>';
1790 $content[] = '<span></span>';
1791 $content[] = '<span></span>';
1792 $content[] = '</div>';
1793
1794 $content[] = '</div>';
1795 $content[] = '</div>';
1796
1797 $content[] = '</div>';
1798
1799 $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-button-box">';
1800 $content[] = '<a href="'. $survey_cta_button_link .'" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now', 'survey-maker' ) . '</a>';
1801 $content[] = '<span class="ays-survey-dicount-one-time-text">';
1802 $content[] = __( "One-time payment", 'survey-maker' );
1803 $content[] = '</span>';
1804 $content[] = '</div>';
1805 $content[] = '</div>';
1806 $content[] = '</div>';
1807
1808 $content = implode( '', $content );
1809 echo wp_kses_post($content);
1810 }
1811 }
1812
1813 // New Mega Bundle 2026
1814 public static function ays_survey_new_mega_bundle_message_2026($ishmar){
1815 if( $ishmar == 0 ){
1816 $content = array();
1817
1818 $date = time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
1819 $now_date = date('M d, Y H:i:s', $date);
1820
1821 $survey_banner_date = strtotime( self::ays_survey_update_banner_time() );
1822
1823 $diff = $survey_banner_date - $date;
1824
1825 $style_attr = '';
1826 if( $diff < 0 ){
1827 $style_attr = 'style="display:none;"';
1828 }
1829
1830 $survey_cta_button_link = esc_url( 'https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=top-20-sale-banner-' . SURVEY_MAKER_VERSION );
1831
1832 $content[] = '<div id="ays-survey-new-mega-bundle-dicount-month-main" class="ays-survey-admin-notice notice notice-success is-dismissible ays_survey_dicount_info">';
1833 $content[] = '<div id="ays-survey-dicount-month" class="ays_survey_dicount_month">';
1834
1835 $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-text-box">';
1836 $content[] = '<div>';
1837 $content[] = '<div class="ays-survey-dicount-logo-box">';
1838 $content[] = '<a href="' . $survey_cta_button_link . '" target="_blank" class="ays-survey-sale-banner-link"><img src="' . SURVEY_MAKER_ADMIN_URL . '/images/ays-survey-banner-announcement-icon.svg"></a>';
1839
1840 $content[] = '<div>';
1841 $content[] = '<span class="ays-survey-new-mega-bundle-title">';
1842 $content[] = sprintf(
1843 /* translators: 1: opening link wrapper with <a> tag, 2: closing </a> tag */
1844 __( 'Upgrade to %1$s Survey Maker PRO %2$s', 'survey-maker' ),
1845 '<span style="display:inline-block; margin-right:5px;"><a href="' . esc_url( $survey_cta_button_link ) . '" target="_blank" rel="noopener noreferrer" style="color:#ffffff !important; text-decoration: underline;">',
1846 '</a></span>'
1847 );
1848 $content[] = '</span>';
1849 $content[] = '</br>';
1850 $content[] = '<span class="ays-survey-new-mega-bundle-desc">';
1851 $content[] = __( "30 Day Money Back Guarantee", 'survey-maker' );
1852 $content[] = '</span>';
1853 $content[] = '</div>';
1854
1855 $content[] = '<div class="ays-survey-new-mega-bundle-title-icon-row" style="display: inline-block;">';
1856 $content[] = '<img src="' . SURVEY_MAKER_ADMIN_URL . '/images/ays-survey-banner-sale-20.svg" class="ays-survey-new-mega-bundle-mobile-image-display-none" style="width: 70px;">';
1857 $content[] = '</div>';
1858
1859 $content[] = '</div>';
1860
1861 $content[] = '</div>';
1862
1863 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form">';
1864
1865 $content[] = '<form action="" method="POST">';
1866 $content[] = '<div id="ays-survey-dismiss-buttons-content">';
1867 if( current_user_can( 'manage_options' ) ){
1868 $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">'. __( "Dismiss ad", 'survey-maker' ) .'</button>';
1869 $content[] = wp_nonce_field( SURVEY_MAKER_NAME . '-sale-banner' , SURVEY_MAKER_NAME . '-sale-banner' );
1870 }
1871 $content[] = '</div>';
1872 $content[] = '</form>';
1873
1874 $content[] = '</div>';
1875
1876 $content[] = '</div>';
1877
1878 $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-countdown-box">';
1879
1880 $content[] = '<div id="ays-survey-countdown-main-container">';
1881 $content[] = '<div class="ays-survey-countdown-container">';
1882
1883 $content[] = '<div ' . $style_attr . ' id="ays-survey-countdown">';
1884
1885 $content[] = '<ul>';
1886
1887 $content[] = '<li><span id="ays-survey-countdown-days"></span></li>';
1888 $content[] = '<li><span id="ays-survey-countdown-hours"></span></li>';
1889 $content[] = '<li><span id="ays-survey-countdown-minutes"></span></li>';
1890 $content[] = '<li><span id="ays-survey-countdown-seconds"></span></li>';
1891 $content[] = '</ul>';
1892 $content[] = '</div>';
1893
1894 $content[] = '<div id="ays-survey-countdown-content" class="emoji">';
1895 $content[] = '</div>';
1896
1897 $content[] = '</div>';
1898 $content[] = '</div>';
1899
1900 $content[] = '</div>';
1901
1902 $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-button-box">';
1903 $content[] = '<div class="ays-survey-dicount-banner-coupon-box" onclick="aysSurveyBundleCopyToClipboard(\'SURVEYPRO20\')" title="' . __( 'Click to copy coupon code', "survey-maker" ) . '">';
1904 $content[] = '<span class="ays-survey-dicount-banner-coupon-text">SURVEYPRO20</span>';
1905 $content[] = '<svg class="ays-survey-dicount-banner-copy-icon" width="16" height="16" viewBox="0 0 16 16" fill="none">';
1906 $content[] = '<path d="M13.5 2.5H6.5C5.67 2.5 5 3.17 5 4V10C5 10.83 5.67 11.5 6.5 11.5H13.5C14.33 11.5 15 10.83 15 10V4C15 3.17 14.33 2.5 13.5 2.5ZM13.5 10H6.5V4H13.5V10ZM2.5 6.5V12.5C2.5 13.33 3.17 14 4 14H10V12.5H4V6.5H2.5Z" fill="white"/>';
1907 $content[] = '</svg>';
1908 $content[] = '</div>';
1909 $content[] = '</div>';
1910
1911 $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-button-box">';
1912 $content[] = '<a href="'. $survey_cta_button_link .'" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now', 'survey-maker' ) . '</a>';
1913 $content[] = '<span class="ays-survey-dicount-one-time-text">';
1914 $content[] = __( "One-time payment", 'survey-maker' );
1915 $content[] = '</span>';
1916 $content[] = '</div>';
1917 $content[] = '</div>';
1918 $content[] = '</div>';
1919
1920 $content[] = '<script>';
1921 $content[] = "
1922 function aysSurveyBundleCopyToClipboard(text) {
1923 var textarea = document.createElement('textarea');
1924 textarea.value = text;
1925 textarea.style.position = 'fixed';
1926 textarea.style.opacity = '0';
1927 document.body.appendChild(textarea);
1928
1929 textarea.select();
1930 textarea.setSelectionRange(0, 99999);
1931
1932 try {
1933 document.execCommand('copy');
1934 aysSurveyBundleShowCopyNotification('" . __( 'Coupon code copied!', "survey-maker" ) . "');
1935 } catch (err) {
1936 console.error('Failed to copy text: ', err);
1937 }
1938
1939 document.body.removeChild(textarea);
1940 }
1941
1942 function aysSurveyBundleShowCopyNotification(message) {
1943 var existingNotification = document.querySelector('.ays-survey-dicount-banner-copy-notification');
1944 if (existingNotification) {
1945 document.body.removeChild(existingNotification);
1946 }
1947
1948 var notification = document.createElement('div');
1949 notification.className = 'ays-survey-dicount-banner-copy-notification';
1950 notification.textContent = message;
1951 document.body.appendChild(notification);
1952
1953 setTimeout(function() {
1954 notification.classList.add('show');
1955 }, 10);
1956
1957 setTimeout(function() {
1958 notification.classList.remove('show');
1959 setTimeout(function() {
1960 if (notification.parentNode) {
1961 document.body.removeChild(notification);
1962 }
1963 }, 300);
1964 }, 2000);
1965 }";
1966 $content[] = '</script>';
1967
1968 // /* New Mega Bundle Banner Survey | Start */
1969 $content[] = '<style id="ays-survey-mega-bundle-styles-inline-css">';
1970 $content[] = '
1971 div#ays-survey-new-mega-bundle-dicount-month-main{border:0;background:#fff;border-radius:20px;box-shadow:unset;position:relative;z-index:1;min-height:80px}div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info button{display:flex;align-items:center}div#ays-survey-new-mega-bundle-dicount-month-main div#ays-survey-dicount-month a.ays-survey-sale-banner-link:focus{outline:0;box-shadow:0}div#ays-survey-new-mega-bundle-dicount-month-main .btn-link{color:#007bff;background-color:transparent;display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem}div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info{background-image:url("'. SURVEY_MAKER_ADMIN_URL .'/images/new-mega-bundle-logo-background-20.svg");background-position:center right;background-repeat:no-repeat;background-size:cover;background-color:#5551ff;padding:1px 38px 1px 12px}#ays-survey-new-mega-bundle-dicount-month-main .ays_survey_dicount_month{display:flex;align-items:center;justify-content:space-between;color:#fff}#ays-survey-new-mega-bundle-dicount-month-main .ays_survey_dicount_month img{width:60px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-sale-banner-link{display:flex;justify-content:center;align-items:center;width:60px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box{font-size:14px;padding:12px;text-align:center}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{text-align:left;width:auto;display:flex;justify-content:space-around;align-items:flex-start}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:30%;display:flex;justify-content:center;align-items:center}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-button-box{width:20%;display:flex;justify-content:center;align-items:center;flex-direction:column}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-survey-dicount-logo-box{display:flex;justify-content:flex-start;align-items:center;gap:20px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box .ays-survey-new-mega-bundle-title{color:#fdfdfd;font-size:19px;font-style:normal;font-weight:600;line-height:normal}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box .ays-survey-new-mega-bundle-title-icon-row{display:inline-block}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box .ays-survey-new-mega-bundle-desc{display:inline-block;color:#fff;font-size:15px;font-style:normal;font-weight:400;line-height:normal;margin-top:10px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box strong{font-size:17px;font-weight:700;letter-spacing:.8px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-color{color:#971821}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-text-decoration{text-decoration:underline}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-buy-now-button-box{display:flex;justify-content:flex-end;align-items:center;width:30%}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-button,#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-buy-now-button{align-items:center;font-weight:500}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-buy-now-button{background:#971821;border-color:#fff;display:flex;justify-content:center;align-items:center;padding:5px 15px;font-size:16px;border-radius:5px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-buy-now-button:hover{background:#7d161d;border-color:#971821}#ays-survey-new-mega-bundle-dicount-month-main #ays-survey-dismiss-buttons-content{display:flex;justify-content:center}#ays-survey-new-mega-bundle-dicount-month-main #ays-survey-dismiss-buttons-content .ays-button{margin:0!important;font-size:13px;color:#fff}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-opacity-box{width:19%}#ays-survey-new-mega-bundle-dicount-month-main .ays-buy-now-opacity-button{padding:40px 15px;display:flex;justify-content:center;align-items:center;opacity:0}#ays-survey-countdown-main-container .ays-survey-countdown-container{margin:0 auto;text-align:center}#ays-survey-countdown-main-container #ays-survey-countdown-headline{letter-spacing:.125rem;text-transform:uppercase;font-size:18px;font-weight:400;margin:0;padding:9px 0 4px;line-height:1.3}#ays-survey-countdown-main-container li,#ays-survey-countdown-main-container ul{margin:0}#ays-survey-countdown-main-container li{display:inline-block;font-size:14px;list-style-type:none;padding:14px;text-transform:lowercase}#ays-survey-countdown-main-container li span{display:flex;justify-content:center;align-items:center;font-size:22px;min-height:40px;min-width:40px;border-radius:4.273px;border:.534px solid #f4f4f4;background:#9896ed;color:#fff}#ays-survey-countdown-main-container .emoji{display:none;padding:1rem}#ays-survey-countdown-main-container .emoji span{font-size:30px;padding:0 .5rem}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li{position:relative}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li span:after{content:":";color:#fff;position:absolute;top:0;right:-5px;font-size:40px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li span#ays-survey-countdown-seconds:after{content:unset}#ays-survey-new-mega-bundle-dicount-month-main #ays-button-top-buy-now{display:flex;align-items:center;border-radius:6.409px;background:#f66123;padding:12px 32px;color:#fff;font-size:15px;font-style:normal;line-height:normal;margin:0!important}div#ays-survey-new-mega-bundle-dicount-month-main button.notice-dismiss:before{color:#fff;content:"\f00d";font-family:fontawesome;font-size:22px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-new-mega-bundle-guaranteeicon{width:30px;margin-right:5px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-one-time-text{color:#fff;font-size:12px;font-style:normal;font-weight:600;line-height:normal}@media all and (max-width:768px){div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info.notice{display:none!important;background-position:bottom right;background-repeat:no-repeat;background-size:cover;border-radius:32px}div#ays-survey-new-mega-bundle-dicount-month-main{padding-right:0}div#ays-survey-new-mega-bundle-dicount-month-main .ays_survey_dicount_month{display:flex;align-items:center;justify-content:space-between;align-content:center;flex-wrap:wrap;flex-direction:column;padding:10px 0}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box{width:100%!important;text-align:center}#ays-survey-countdown-main-container #ays-survey-countdown-headline{font-size:15px;font-weight:600}#ays-survey-countdown-main-container ul{font-weight:500}div#ays-survey-countdown-main-container li{padding:10px}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-new-mega-bundle-mobile-image-display-none{display:none!important}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-new-mega-bundle-mobile-image-display-block{display:block!important;margin-top:5px}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{width:100%!important;text-align:center;flex-direction:column;margin-top:20px;justify-content:center;align-items:center}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li span:after{top:unset}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:100%;display:flex;justify-content:center;align-items:center}#ays-survey-new-mega-bundle-dicount-month-main .ays-button{margin:0 auto!important}#ays-survey-new-mega-bundle-dicount-month-main #ays-survey-dismiss-buttons-content .ays-button{padding-left:unset!important}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-buy-now-button-box{justify-content:center}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-buy-now-button{font-size:14px;padding:5px 10px}div#ays-survey-new-mega-bundle-dicount-month-main .ays-buy-now-opacity-button{display:none}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dismiss-buttons-container-for-form{position:static!important}.comparison .product img{width:70px}.ays-survey-features-wrap .comparison a.price-buy{padding:8px 5px;font-size:11px}}@media screen and (max-width:1350px) and (min-width:768px){div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info.notice{background-position:bottom right;background-repeat:no-repeat;background-size:cover}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box strong{font-size:15px}#ays-survey-countdown-main-container li{font-size:11px}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-opacity-box{display:none}}@media screen and (max-width:1680px) and (min-width:1551px){div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{width:29%}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:30%}}@media screen and (max-width:1410px){#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-coupon-row{width:150px}}@media screen and (max-width:1550px) and (min-width:1400px){div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:35%}}@media screen and (max-width:1400px) and (min-width:1250px){div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:35%}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{width:40%}}@media screen and (max-width:1274px){#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box .ays-survey-new-mega-bundle-title{font-size:15px}}@media screen and (max-width:1200px){#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-button-box{margin-bottom:16px}#ays-survey-countdown-main-container ul{padding-left:0}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-coupon-row{width:120px;font-size:18px}#ays-survey-new-mega-bundle-dicount-month-main #ays-button-top-buy-now{padding:12px 20px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box{font-size:12px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box .ays-survey-new-mega-bundle-desc{font-size:13px}}@media screen and (max-width:1076px) and (min-width:769px){#ays-survey-countdown-main-container li{padding:10px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-coupon-row{width:100px;font-size:16px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-button-box{margin-bottom:16px}#ays-survey-new-mega-bundle-dicount-month-main #ays-button-top-buy-now{padding:12px 15px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box{font-size:11px;padding:12px 0}}@media screen and (max-width:1250px) and (min-width:769px){div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:45%}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{width:35%}}';
1972
1973 $content[] = '
1974 .ays-survey-dicount-banner-coupon-box {
1975 border: 2px dashed rgba(255, 255, 255, 0.4);
1976 padding: 8px 16px;
1977 border-radius: 6px;
1978 background: rgba(255, 255, 255, 0.1);
1979 cursor: pointer;
1980 transition: all 0.3s;
1981 display: flex;
1982 align-items: center;
1983 gap: 8px;
1984 backdrop-filter: blur(10px);
1985 }
1986
1987 .ays-survey-dicount-banner-coupon-box:hover {
1988 background: rgba(255, 255, 255, 0.2);
1989 border-color: rgba(255, 255, 255, 0.6);
1990 transform: translateY(-1px);
1991 }
1992
1993 .ays-survey-dicount-banner-coupon-text {
1994 font-size: 16px;
1995 font-weight: 700;
1996 letter-spacing: 1px;
1997 color: #fff;
1998 font-family: monospace;
1999 }
2000
2001 .ays-survey-dicount-banner-copy-icon {
2002 opacity: 0.8;
2003 transition: opacity 0.3s;
2004 }
2005
2006 .ays-survey-dicount-banner-coupon-box:hover .ays-survey-dicount-banner-copy-icon {
2007 opacity: 1;
2008 }
2009
2010 .ays-survey-dicount-banner-btn-arrow {
2011 display: inline-block;
2012 transition: transform 0.3s;
2013 }
2014
2015 .ays-survey-dicount-banner-buy-now-btn:hover .ays-survey-dicount-banner-btn-arrow {
2016 transform: translateX(4px);
2017 }
2018
2019 /* Notification */
2020 .ays-survey-dicount-banner-copy-notification {
2021 position: fixed;
2022 top: 50%;
2023 left: 50%;
2024 transform: translate(-50%, -50%);
2025 background: rgba(0, 0, 0, 0.8);
2026 color: #fff;
2027 padding: 12px 24px;
2028 border-radius: 8px;
2029 font-size: 14px;
2030 z-index: 10000;
2031 opacity: 0;
2032 transition: opacity 0.3s;
2033 }
2034
2035 .ays-survey-dicount-banner-copy-notification.show {
2036 opacity: 1;
2037 }';
2038 $content[] = '</style>';
2039 // /* New Mega Bundle Banner Survey | End */
2040
2041 $content = implode( '', $content );
2042 echo ($content);
2043 }
2044 }
2045
2046 // Christmas Banner 2025
2047 public static function ays_survey_christmas_banner_message_2025($ishmar){
2048 if($ishmar == 0 ){
2049 $content = array();
2050
2051 $svg_icon = '<svg width="21" height="22" viewBox="0 0 21 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2052 <path fill-rule="evenodd" clip-rule="evenodd" d="M10.0445 0C10.4587 0 10.7945 0.33579 10.7945 0.75V2.93934L12.5141 1.21967C12.807 0.92678 13.2819 0.92678 13.5748 1.21967C13.8677 1.51256 13.8677 1.98744 13.5748 2.28033L10.7945 5.06066V9.451L14.5965 7.25588L15.6142 3.45788C15.7214 3.05778 16.1326 2.82034 16.5327 2.92755C16.9328 3.03475 17.1703 3.44601 17.0631 3.84611L16.4336 6.19522L18.3296 5.10055C18.6884 4.89344 19.147 5.01635 19.3542 5.37507C19.5613 5.73379 19.4384 6.19248 19.0796 6.39959L17.1836 7.49426L19.5327 8.1237C19.9328 8.23091 20.1703 8.64216 20.0631 9.0423C19.9558 9.4424 19.5446 9.6798 19.1445 9.5726L15.3465 8.55492L11.5445 10.75L15.3467 12.9452L19.1447 11.9275C19.5448 11.8203 19.956 12.0578 20.0633 12.4579C20.1705 12.858 19.933 13.2692 19.5329 13.3764L17.1838 14.0059L19.0798 15.1005C19.4386 15.3077 19.5615 15.7663 19.3544 16.1251C19.1472 16.4838 18.6886 16.6067 18.3298 16.3996L16.4338 15.3049L17.0633 17.654C17.1705 18.0541 16.933 18.4654 16.5329 18.5726C16.1328 18.6798 15.7216 18.4424 15.6144 18.0423L14.5967 14.2443L10.7945 12.049V16.4393L13.5748 19.2197C13.8677 19.5126 13.8677 19.9874 13.5748 20.2803C13.2819 20.5732 12.807 20.5732 12.5141 20.2803L10.7945 18.5607V20.75C10.7945 21.1642 10.4587 21.5 10.0445 21.5C9.63033 21.5 9.29453 21.1642 9.29453 20.75V18.5607L7.57484 20.2803C7.28195 20.5732 6.80707 20.5732 6.51418 20.2803C6.22129 19.9874 6.22129 19.5126 6.51418 19.2197L9.29453 16.4393V12.049L5.4923 14.2443L4.47463 18.0423C4.36742 18.4424 3.95617 18.6798 3.55607 18.5726C3.15597 18.4654 2.91853 18.0541 3.02574 17.654L3.65518 15.3049L1.75916 16.3996C1.40044 16.6067 0.941743 16.4838 0.734643 16.1251C0.527533 15.7663 0.650443 15.3077 1.00916 15.1005L2.90518 14.0059L0.556073 13.3764C0.155973 13.2692 -0.081467 12.858 0.0257431 12.4579C0.132943 12.0578 0.544203 11.8203 0.944303 11.9275L4.7423 12.9452L8.54453 10.75L4.74249 8.55492L0.944493 9.5726C0.544393 9.6798 0.133143 9.4424 0.0259331 9.0423C-0.0812669 8.64216 0.156163 8.23091 0.556263 8.1237L2.90538 7.49426L1.00935 6.39959C0.650633 6.19248 0.527733 5.73379 0.734833 5.37507C0.941943 5.01635 1.40063 4.89344 1.75935 5.10055L3.65538 6.19522L3.02593 3.84611C2.91873 3.44601 3.15616 3.03475 3.55626 2.92755C3.95636 2.82034 4.36762 3.05778 4.47482 3.45788L5.49249 7.25588L9.29453 9.451V5.06066L6.51418 2.28033C6.22129 1.98744 6.22129 1.51256 6.51418 1.21967C6.80707 0.92678 7.28195 0.92678 7.57484 1.21967L9.29453 2.93934V0.75C9.29453 0.33579 9.63033 0 10.0445 0Z" fill="white" fill-opacity="0.2"/>
2053 </svg>
2054 ';
2055
2056 $ays_survey_cta_button_link = esc_url('https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=christmas-sale-banner-' . SURVEY_MAKER_VERSION);
2057
2058 $content[] = '<div id="ays-survey-christmas-banner-main" class="notice notice-success is-dismissible ays-survey-christmas-banner-info ays_survey_dicount_info">';
2059 $content[] = '<div id="ays-survey-christmas-banner-month" class="ays-survey-christmas-banner-month">';
2060
2061 // Background effects
2062 $content[] = '<div class="ays-survey-christmas-banner-bg-effects">';
2063 $content[] = '<div class="ays-survey-christmas-banner-bg-gradient-1"></div>';
2064 $content[] = '<div class="ays-survey-christmas-banner-bg-gradient-2"></div>';
2065
2066 // Snowflakes
2067 $content[] = '<div class="ays-survey-christmas-banner-snowflake" style="left: 5%; animation-delay: 0s; animation-duration: 8s;">'. $svg_icon .'</div>';
2068 $content[] = '<div class="ays-survey-christmas-banner-snowflake" style="left: 15%; animation-delay: 2s; animation-duration: 10s;">'. $svg_icon .'</div>';
2069 $content[] = '<div class="ays-survey-christmas-banner-snowflake" style="left: 25%; animation-delay: 4s; animation-duration: 9s;">'. $svg_icon .'</div>';
2070 $content[] = '<div class="ays-survey-christmas-banner-snowflake" style="left: 75%; animation-delay: 1s; animation-duration: 11s;">'. $svg_icon .'</div>';
2071 $content[] = '<div class="ays-survey-christmas-banner-snowflake" style="left: 85%; animation-delay: 3s; animation-duration: 8s;">'. $svg_icon .'</div>';
2072 $content[] = '<div class="ays-survey-christmas-banner-snowflake" style="left: 92%; animation-delay: 5s; animation-duration: 10s;">'. $svg_icon .'</div>';
2073
2074 // Sparkles
2075 $content[] = '<svg class="ays-survey-christmas-banner-sparkle" style="top: 20%; left: 8%; animation-delay: 0s; width: 14px; height: 14px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">';
2076 $content[] = '<path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/>';
2077 $content[] = '</svg>';
2078 $content[] = '<svg class="ays-survey-christmas-banner-sparkle" style="top: 60%; left: 3%; animation-delay: 0.5s; width: 10px; height: 10px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">';
2079 $content[] = '<path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/>';
2080 $content[] = '</svg>';
2081 $content[] = '<svg class="ays-survey-christmas-banner-sparkle" style="top: 30%; right: 12%; animation-delay: 1s; width: 12px; height: 12px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">';
2082 $content[] = '<path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/>';
2083 $content[] = '</svg>';
2084 $content[] = '</div>';
2085
2086 // Main content
2087 $content[] = '<div class="ays-survey-christmas-banner-content">';
2088 $content[] = '<div class="ays-survey-christmas-banner-left">';
2089 // Gift icon with hat
2090 $content[] = '<div class="ays-survey-christmas-banner-gift-wrapper">';
2091 $content[] = '<svg class="ays-survey-christmas-banner-gift-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">';
2092 $content[] = '<rect x="3" y="8" width="18" height="4" rx="1"></rect>';
2093 $content[] = '<path d="M12 8v13"></path>';
2094 $content[] = '<path d="M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7"></path>';
2095 $content[] = '<path d="M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5"></path>';
2096 $content[] = '</svg>';
2097 $content[] = '<div class="ays-survey-christmas-banner-hat">';
2098 $content[] = '<svg viewBox="0 0 24 24" fill="none" class="ays-survey-christmas-banner-hat-svg">';
2099 $content[] = '<path d="M12 2L4 14h16L12 2z" fill="hsl(0 80% 45%)"></path>';
2100 $content[] = '<path d="M4 14c0 2 3.5 3 8 3s8-1 8-3" fill="hsl(0 0% 100%)"></path>';
2101 $content[] = '<circle cx="12" cy="3" r="2" fill="hsl(0 0% 100%)"></circle>';
2102 $content[] = '</svg>';
2103 $content[] = '</div>';
2104 $content[] = '</div>';
2105
2106 $content[] = '<div class="ays-survey-christmas-banner-special-label">';
2107 $content[] = '<div class="ays-survey-christmas-banner-special-label-name">';
2108 $content[] = '<a href="'. $ays_survey_cta_button_link .'" class="ays-survey-christmas-banner-special-label-name-link" target="_blank">';
2109 $content[] = __( 'Survey Maker', "survey-maker" );
2110 $content[] = '</a>';
2111 $content[] = '</div>';
2112
2113 $content[] = '<div>✦ ' . __( 'CHRISTMAS SPECIAL', "survey-maker" ) . ' ✦</div>';
2114 $content[] = '</div>';
2115 $content[] = '</div>';
2116
2117 $content[] = '<div class="ays-survey-christmas-banner-center">';
2118 $content[] = '<div class="ays-survey-christmas-banner-discount-text">25% OFF</div>';
2119 $content[] = '<div class="ays-survey-christmas-banner-limited-offer">' . __( 'Limited time offer', "survey-maker" ) . '</div>';
2120 $content[] = '</div>';
2121
2122 $content[] = '<div class="ays-survey-christmas-banner-right">';
2123 $content[] = '<div class="ays-survey-christmas-banner-coupon-box" onclick="aysSurveyChristmasCopyToClipboard(\'XMAS25\')" title="' . __( 'Click to copy', "survey-maker" ) . '">';
2124 $content[] = '<span class="ays-survey-christmas-banner-coupon-text">XMAS25</span>';
2125 $content[] = '<svg class="ays-survey-christmas-banner-copy-icon" width="16" height="16" viewBox="0 0 16 16" fill="none">';
2126 $content[] = '<path d="M13.5 2.5H6.5C5.67 2.5 5 3.17 5 4V10C5 10.83 5.67 11.5 6.5 11.5H13.5C14.33 11.5 15 10.83 15 10V4C15 3.17 14.33 2.5 13.5 2.5ZM13.5 10H6.5V4H13.5V10ZM2.5 6.5V12.5C2.5 13.33 3.17 14 4 14H10V12.5H4V6.5H2.5Z" fill="white"/>';
2127 $content[] = '</svg>';
2128 $content[] = '</div>';
2129
2130 $content[] = '<a href="'. $ays_survey_cta_button_link .'" class="ays-survey-christmas-banner-buy-now-btn" target="_blank">';
2131 $content[] = __( 'Buy Now', "survey-maker" );
2132 $content[] = '</a>';
2133 $content[] = '</div>';
2134 $content[] = '</div>';
2135
2136 $content[] = '</div>';
2137
2138 if( current_user_can( 'manage_options' ) ){
2139 $content[] = '<div id="ays-survey-dismiss-buttons-content">';
2140 $content[] = '<form action="" method="POST" style="position: absolute; bottom: 0; right: 0; color: #fff;">';
2141 $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="color: darkgrey; font-size: 11px; padding: 0 .75rem;">'. __( "Dismiss ad", 'survey-maker' ) .'</button>';
2142 $content[] = wp_nonce_field( SURVEY_MAKER_NAME . '-sale-banner' , SURVEY_MAKER_NAME . '-sale-banner' );
2143 $content[] = '</form>';
2144 $content[] = '</div>';
2145 }
2146
2147 $content[] = '</div>';
2148
2149 $content[] = '<script>';
2150 $content[] = "
2151 function aysSurveyChristmasCopyToClipboard(text) {
2152 var textarea = document.createElement('textarea');
2153 textarea.value = text;
2154 textarea.style.position = 'fixed';
2155 textarea.style.opacity = '0';
2156 document.body.appendChild(textarea);
2157
2158 textarea.select();
2159 textarea.setSelectionRange(0, 99999);
2160
2161 try {
2162 document.execCommand('copy');
2163 aysSurveyChristmasShowCopyNotification('" . __( 'Coupon code copied!', "survey-maker" ) . "');
2164 } catch (err) {
2165 console.error('Failed to copy text: ', err);
2166 }
2167
2168 document.body.removeChild(textarea);
2169 }
2170
2171 function aysSurveyChristmasShowCopyNotification(message) {
2172 var existingNotification = document.querySelector('.ays-survey-christmas-banner-copy-notification');
2173 if (existingNotification) {
2174 document.body.removeChild(existingNotification);
2175 }
2176
2177 var notification = document.createElement('div');
2178 notification.className = 'ays-survey-christmas-banner-copy-notification';
2179 notification.textContent = message;
2180 document.body.appendChild(notification);
2181
2182 setTimeout(function() {
2183 notification.classList.add('show');
2184 }, 10);
2185
2186 setTimeout(function() {
2187 notification.classList.remove('show');
2188 setTimeout(function() {
2189 if (notification.parentNode) {
2190 document.body.removeChild(notification);
2191 }
2192 }, 300);
2193 }, 2000);
2194 }";
2195 $content[] = '</script>';
2196
2197 $content[] = '<style>';
2198 $content[] = '
2199 /* Christmas banner start */
2200
2201 div#ays-survey-christmas-banner-main .btn-link {
2202 background-color: transparent;
2203 display: inline-block;
2204 font-weight: 400;
2205 text-align: center;
2206 white-space: nowrap;
2207 vertical-align: middle;
2208 -webkit-user-select: none;
2209 -moz-user-select: none;
2210 -ms-user-select: none;
2211 user-select: none;
2212 border: 1px solid transparent;
2213 padding: .375rem .75rem;
2214 font-size: 12px;
2215 line-height: 1.5;
2216 border-radius: .25rem;
2217 color: rgba(255, 255, 255, .6);
2218 }
2219
2220 div#ays-survey-christmas-banner-main.ays-survey-christmas-banner-info {
2221 background: linear-gradient(to right, hsl(0, 70%, 28%), hsl(0, 65%, 38%), hsl(0, 70%, 28%));
2222 padding: unset;
2223 border-left: 0;
2224 position: relative;
2225 }
2226
2227 #ays-survey-christmas-banner-main .ays-survey-christmas-banner-month {
2228 position: relative;
2229 padding: 15px 40px;
2230 overflow: hidden;
2231 }
2232
2233 /* Background effects */
2234 .ays-survey-christmas-banner-bg-effects {
2235 position: absolute;
2236 top: 0;
2237 left: 0;
2238 right: 0;
2239 bottom: 0;
2240 pointer-events: none;
2241 z-index: 1;
2242 }
2243
2244 .ays-survey-christmas-banner-bg-gradient-1 {
2245 position: absolute;
2246 top: 0;
2247 left: 30%;
2248 width: 40%;
2249 height: 100%;
2250 background: radial-gradient(circle, rgba(202, 43, 43, 0.5) 0%, transparent 60%);
2251 opacity: 0.4;
2252 }
2253
2254 .ays-survey-christmas-banner-bg-gradient-2 {
2255 position: absolute;
2256 top: 0;
2257 right: 15%;
2258 width: 35%;
2259 height: 100%;
2260 background: radial-gradient(circle, rgba(246, 201, 85, 0.15) 0%, transparent 50%);
2261 opacity: 0.3;
2262 }
2263
2264 .ays-survey-christmas-banner-snowflake {
2265 position: absolute;
2266 color: rgba(255, 255, 255, 0.2);
2267 font-size: 20px;
2268 animation: ays-survey-christmas-snowfall linear infinite;
2269 top: -10px;
2270 }
2271
2272 @keyframes ays-survey-christmas-snowfall {
2273 0% {
2274 transform: translateY(-10px) rotate(0deg);
2275 opacity: 0;
2276 }
2277 10% {
2278 opacity: 0.8;
2279 }
2280 90% {
2281 opacity: 0.8;
2282 }
2283 100% {
2284 transform: translateY(100%) rotate(360deg);
2285 opacity: 0;
2286 }
2287 }
2288
2289 .ays-survey-christmas-banner-sparkle {
2290 position: absolute;
2291 color: hsl(43, 90%, 65%);
2292 animation: ays-survey-christmas-twinkle 2s ease-in-out infinite;
2293 }
2294
2295 @keyframes ays-survey-christmas-twinkle {
2296 0%, 100% {
2297 opacity: 0.3;
2298 transform: scale(0.8);
2299 }
2300 50% {
2301 opacity: 1;
2302 transform: scale(1.2);
2303 }
2304 }
2305
2306 /* Main content */
2307 .ays-survey-christmas-banner-content {
2308 position: relative;
2309 display: flex;
2310 align-items: center;
2311 justify-content: space-between;
2312 z-index: 2;
2313 }
2314
2315 /* Left section */
2316 .ays-survey-christmas-banner-left {
2317 display: flex;
2318 align-items: center;
2319 gap: 50px;
2320 }
2321
2322 .ays-survey-christmas-banner-gift-wrapper {
2323 position: relative;
2324 animation: ays-survey-christmas-float 3s ease-in-out infinite;
2325 }
2326
2327 .ays-survey-christmas-banner-gift-icon {
2328 width: 48px;
2329 height: 48px;
2330 color: rgba(255, 247, 237, 0.9);
2331 }
2332
2333 @keyframes ays-survey-christmas-float {
2334 0%, 100% {
2335 transform: translateY(0);
2336 }
2337 50% {
2338 transform: translateY(-5px);
2339 }
2340 }
2341
2342 .ays-survey-christmas-banner-hat {
2343 position: absolute;
2344 top: -12px;
2345 right: -4px;
2346 width: 24px;
2347 height: 24px;
2348 }
2349
2350 .ays-survey-christmas-banner-hat-svg {
2351 width: 100%;
2352 height: 100%;
2353 }
2354
2355 .ays-survey-christmas-banner-special-label {
2356 color: hsl(43, 90%, 65%);
2357 font-size: 14px;
2358 font-weight: 500;
2359 text-transform: uppercase;
2360 letter-spacing: 1px;
2361 /* font-family: "Outfit", sans-serif; */
2362 }
2363
2364 .ays-survey-christmas-banner-special-label-name {
2365 color: #fffaf0;
2366 text-align: center;
2367 }
2368
2369 div#ays-survey-christmas-banner-main .ays-survey-christmas-banner-special-label-name-link {
2370 color: #fffaf0;
2371 box-shadow: unset;
2372 }
2373
2374 /* Center section */
2375 .ays-survey-christmas-banner-center {
2376 display: flex;
2377 flex-direction: row;
2378 text-align: center;
2379 justify-content: center;
2380 align-items: center;
2381 gap: 30px;
2382 }
2383
2384 .ays-survey-christmas-banner-discount-text {
2385 font-family: "Outfit", sans-serif;
2386 font-weight: 800;
2387 font-size: 30px;
2388 color: hsl(40, 100%, 97%);
2389 letter-spacing: -1px;
2390 line-height: 1;
2391 }
2392
2393 .ays-survey-christmas-banner-limited-offer {
2394 color: rgba(255, 247, 237, 0.7);
2395 font-size: 13px;
2396 font-weight: 500;
2397 }
2398
2399 /* Right section */
2400 .ays-survey-christmas-banner-right {
2401 display: flex;
2402 align-items: center;
2403 gap: 20px;
2404 }
2405
2406 .ays-survey-christmas-banner-coupon-box {
2407 border: 2px dashed rgba(255, 255, 255, 0.4);
2408 padding: 8px 16px;
2409 border-radius: 6px;
2410 background: rgba(255, 255, 255, 0.1);
2411 cursor: pointer;
2412 transition: all 0.3s;
2413 display: flex;
2414 align-items: center;
2415 gap: 8px;
2416 backdrop-filter: blur(10px);
2417 }
2418
2419 .ays-survey-christmas-banner-coupon-box:hover {
2420 background: rgba(255, 255, 255, 0.2);
2421 border-color: rgba(255, 255, 255, 0.6);
2422 transform: translateY(-1px);
2423 }
2424
2425 .ays-survey-christmas-banner-coupon-text {
2426 font-size: 16px;
2427 font-weight: 700;
2428 letter-spacing: 1px;
2429 color: #fff;
2430 font-family: monospace;
2431 }
2432
2433 .ays-survey-christmas-banner-copy-icon {
2434 opacity: 0.8;
2435 transition: opacity 0.3s;
2436 }
2437
2438 .ays-survey-christmas-banner-coupon-box:hover .ays-survey-christmas-banner-copy-icon {
2439 opacity: 1;
2440 }
2441
2442 #ays-survey-christmas-banner-main .ays-survey-christmas-banner-buy-now-btn {
2443 background-color: #fbe19f;
2444 color: hsl(0, 72%, 35%);
2445 padding: 10px 30px;
2446 border-radius: 9999px;
2447 font-size: 16px;
2448 font-weight: 600;
2449 font-family: "Outfit", sans-serif;
2450 border: none;
2451 cursor: pointer;
2452 transition: all 0.3s;
2453 text-decoration: none;
2454 display: flex;
2455 align-items: center;
2456 gap: 6px;
2457 box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 30px rgba(246, 201, 85, 0.2);
2458 }
2459
2460 #ays-survey-christmas-banner-main .ays-survey-christmas-banner-buy-now-btn:hover {
2461 background-color: #f2d58c;
2462 transform: scale(1.05);
2463 box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2), 0 0 40px rgba(246, 201, 85, 0.3);
2464 }
2465
2466 .ays-survey-christmas-banner-btn-arrow {
2467 display: inline-block;
2468 transition: transform 0.3s;
2469 }
2470
2471 .ays-survey-christmas-banner-buy-now-btn:hover .ays-survey-christmas-banner-btn-arrow {
2472 transform: translateX(4px);
2473 }
2474
2475 /* Notification */
2476 .ays-survey-christmas-banner-copy-notification {
2477 position: fixed;
2478 top: 50%;
2479 left: 50%;
2480 transform: translate(-50%, -50%);
2481 background: rgba(0, 0, 0, 0.8);
2482 color: #fff;
2483 padding: 12px 24px;
2484 border-radius: 8px;
2485 font-size: 14px;
2486 z-index: 10000;
2487 opacity: 0;
2488 transition: opacity 0.3s;
2489 }
2490
2491 .ays-survey-christmas-banner-copy-notification.show {
2492 opacity: 1;
2493 }
2494
2495 /* Dismiss button */
2496 #ays-survey-christmas-banner-main #ays-survey-christmas-banner-dismiss-content {
2497 display: flex;
2498 justify-content: center;
2499 }
2500
2501 #ays-survey-christmas-banner-main #ays-survey-christmas-banner-dismiss-content .ays-button {
2502 margin: 0 !important;
2503 font-size: 13px;
2504 color: rgba(150, 147, 147, 0.69);
2505 }
2506
2507 /* Responsive */
2508 @media (max-width: 1024px) {
2509 .ays-survey-christmas-banner-discount-text {
2510 font-size: 40px;
2511 }
2512 .ays-survey-christmas-banner-content {
2513 flex-wrap: wrap;
2514 }
2515 }
2516
2517 @media (max-width: 768px) {
2518 #ays-survey-christmas-banner-main {
2519 display: none !important;
2520 }
2521 }
2522 /* Christmas banner end */
2523 ';
2524 $content[] = '</style>';
2525
2526 $content = implode( '', $content );
2527
2528 echo $content;
2529 }
2530 }
2531
2532 // Black Friday
2533 public static function ays_survey_black_friday_message($ishmar){
2534 if($ishmar == 0 ){
2535 $content = array();
2536
2537 $ays_survey_cta_button_link = esc_url('https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=black-friday-sale-banner-' . SURVEY_MAKER_VERSION);
2538
2539 $content[] = '<div id="ays-survey-dicount-black-friday-month-main" class="notice notice-success is-dismissible ays_survey_dicount_info">';
2540 $content[] = '<div id="ays-survey-dicount-black-friday-month" class="ays_survey_dicount_month">';
2541 $content[] = '<div class="ays-survey-dicount-black-friday-box">';
2542 $content[] = '<div class="ays-survey-dicount-black-friday-wrap-box ays-survey-dicount-black-friday-wrap-box-80" style="width: 70%;">';
2543 $content[] = '<div class="">';
2544 $content[] = '<div class="ays-survey-dicount-black-friday-title-row" >' . __( 'Coupon Code', "survey-maker" ) .' ' . '</div>';
2545 $content[] = '<div class="ays-survey-dicount-black-friday-title-row">';
2546
2547 $content[] = '
2548 <span class="ays-survey-dicount-black-friday-banner-2025-coupon-wrapper">
2549 <span class="ays-survey-dicount-black-friday-banner-2025-coupon-box" onclick="aysSurveyHalloweenCopyToClipboard(\'FREE2PROBF\')" title="Click to copy">
2550 <span class="ays-survey-dicount-black-friday-banner-2025-coupon-text">FREE2PROBF</span>
2551 <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="ays-survey-dicount-black-friday-banner-2025-copy-icon">
2552 <path d="M13.5 2.5H6.5C5.67 2.5 5 3.17 5 4V10C5 10.83 5.67 11.5 6.5 11.5H13.5C14.33 11.5 15 10.83 15 10V4C15 3.17 14.33 2.5 13.5 2.5ZM13.5 10H6.5V4H13.5V10ZM2.5 6.5V12.5C2.5 13.33 3.17 14 4 14H10V12.5H4V6.5H2.5Z" fill="white"/>
2553 </svg>
2554 </span>
2555 </span>';
2556 $content[] = '</div> ';
2557 $content[] = '</div>';
2558
2559 $content[] = '</div>';
2560
2561 $content[] = '<div class="ays-survey-dicount-black-friday-wrap-box ays-survey-dicount-black-friday-wrap-text-box">';
2562 $content[] = '<div class="ays-survey-dicount-black-friday-text-row">' . '30% off' . '</div>';
2563 $content[] = '</div>';
2564
2565 $content[] = '<div class="ays-survey-dicount-black-friday-wrap-box" style="width: 25%;">';
2566 $content[] = '<div id="ays-survey-countdown-main-container">';
2567 $content[] = '<div class="ays-survey-countdown-container">';
2568 $content[] = '<div id="ays-survey-countdown" style="display: block;">';
2569 $content[] = '<ul>';
2570 $content[] = '<li><span id="ays-survey-countdown-days"></span>' . __( 'Days', "survey-maker" ) . '</li>';
2571 $content[] = '<li><span id="ays-survey-countdown-hours"></span>' . __( 'Hours', "survey-maker" ) . '</li>';
2572 $content[] = '<li><span id="ays-survey-countdown-minutes"></span>' . __( 'Minutes', "survey-maker" ) . '</li>';
2573 $content[] = '<li><span id="ays-survey-countdown-seconds"></span>' . __( 'Seconds', "survey-maker" ) . '</li>';
2574 $content[] = '</ul>';
2575 $content[] = '</div>';
2576 $content[] = '<div id="ays-survey-countdown-content" class="emoji" style="display: none;">';
2577 $content[] = '<span></span>';
2578 $content[] = '<span></span>';
2579 $content[] = '<span></span>';
2580 $content[] = '<span></span>';
2581 $content[] = '</div>';
2582 $content[] = '</div>';
2583 $content[] = '</div>';
2584 $content[] = '</div>';
2585
2586 $content[] = '<div class="ays-survey-dicount-black-friday-wrap-box" style="width: 25%;">';
2587 $content[] = '<a href="'. $ays_survey_cta_button_link .'" class="ays-survey-dicount-black-friday-button-buy-now" target="_blank">' . __( 'Get Your Deal', "survey-maker" ) . '</a>';
2588 $content[] = '</div>';
2589 $content[] = '</div>';
2590 $content[] = '</div>';
2591
2592 $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form-black-friday">';
2593 $content[] = '<form action="" method="POST">';
2594 $content[] = '<div id="ays-survey-dismiss-buttons-content">';
2595 if( current_user_can( 'manage_options' ) ){
2596 $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>';
2597 $content[] = wp_nonce_field( SURVEY_MAKER_NAME . '-sale-banner' , SURVEY_MAKER_NAME . '-sale-banner' );
2598 }
2599 $content[] = '</div>';
2600 $content[] = '</form>';
2601 $content[] = '</div>';
2602 $content[] = '</div>';
2603
2604 $content[] = '<script>';
2605 $content[] = "
2606 function aysSurveyHalloweenCopyToClipboard(text) {
2607 // Create a temporary textarea element
2608 var textarea = document.createElement('textarea');
2609 textarea.value = text;
2610 textarea.style.position = 'fixed';
2611 textarea.style.opacity = '0';
2612 document.body.appendChild(textarea);
2613
2614 // Select and copy the text
2615 textarea.select();
2616 textarea.setSelectionRange(0, 99999); // For mobile devices
2617
2618 try {
2619 document.execCommand('copy');
2620 aysSurveyHalloweenShowCopyNotification('Coupon code copied!');
2621 } catch (err) {
2622 console.error('Failed to copy text: ', err);
2623 }
2624
2625 // Remove the temporary textarea
2626 document.body.removeChild(textarea);
2627 }
2628
2629 function aysSurveyHalloweenShowCopyNotification(message) {
2630 // Check if notification already exists
2631 var existingNotification = document.querySelector('.ays-survey-discount-black-friday-banner-2025-copy-notification');
2632 if (existingNotification) {
2633 document.body.removeChild(existingNotification);
2634 }
2635
2636 // Create notification element
2637 var notification = document.createElement('div');
2638 notification.className = 'ays-survey-discount-black-friday-banner-2025-copy-notification';
2639 notification.textContent = message;
2640 document.body.appendChild(notification);
2641
2642 // Show notification with animation
2643 setTimeout(function() {
2644 notification.classList.add('show');
2645 }, 10);
2646
2647 // Hide and remove notification after 2 seconds
2648 setTimeout(function() {
2649 notification.classList.remove('show');
2650 setTimeout(function() {
2651 if (notification.parentNode) {
2652 document.body.removeChild(notification);
2653 }
2654 }, 300);
2655 }, 2000);
2656 }";
2657 $content[] = '</script>';
2658
2659 $content[] = '<style>';
2660 $content[] = '
2661 /* Black friday banner start */
2662 div#ays-survey-dicount-black-friday-month-main *{color:#fff}div#ays-survey-dicount-black-friday-month-main div#ays-survey-dicount-black-friday-month a.ays-survey-sale-banner-link:focus{outline:0;box-shadow:0}div#ays-survey-dicount-black-friday-month-main .btn-link{background-color:transparent;display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:12px;line-height:1.5;border-radius:.25rem;color:rgba(255,255,255,.6)}div#ays-survey-dicount-black-friday-month-main.ays_survey_dicount_info{background-image:linear-gradient(45deg,#1e101d,#c60af4);padding:unset;border-left:0}#ays-survey-dicount-black-friday-month-main .ays_survey_dicount_month{position:relative;background-image:url("'. esc_attr(SURVEY_MAKER_ADMIN_URL) .'/images/black-friday-plugins-background-image.webp");background-position:center right;background-repeat:no-repeat;background-size:100% 100%}#ays-survey-dicount-black-friday-month-main .ays_survey_dicount_month img{width:80px}#ays-survey-dicount-black-friday-month-main .ays-survey-sale-banner-link{display:flex;justify-content:center;align-items:center;width:200px}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-button-sale{font-style:normal;font-weight:600;font-size:24px;text-align:center;color:#b2ff00;text-transform:uppercase}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box{font-size:14px;padding:12px;text-align:center;width:50%;white-space:nowrap}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box strong{font-size:17px;font-weight:700;letter-spacing:.8px}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-color{color:#971821}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-text-decoration{text-decoration:underline}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box.ays-buy-now-button-box{display:flex;justify-content:flex-end;align-items:center;width:30%}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box .ays-button,#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box .ays-buy-now-button{align-items:center;font-weight:500}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box .ays-buy-now-button{background:#971821;border-color:#fff;display:flex;justify-content:center;align-items:center;padding:5px 15px;font-size:16px;border-radius:5px}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box .ays-buy-now-button:hover{background:#7d161d;border-color:#971821}#ays-survey-dicount-black-friday-month-main #ays-survey-dismiss-buttons-content{display:flex;justify-content:center}#ays-survey-dicount-black-friday-month-main #ays-survey-dismiss-buttons-content .ays-button{margin:0!important;font-size:13px;color:#969393b0}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-opacity-box{width:19%}#ays-survey-dicount-black-friday-month-main .ays-buy-now-opacity-button{padding:40px 15px;display:flex;justify-content:center;align-items:center;opacity:0}#ays-survey-countdown-main-container .ays-survey-countdown-container{margin:0 auto;text-align:center}#ays-survey-countdown-main-container #ays-survey-countdown-headline{letter-spacing:.125rem;text-transform:uppercase;font-size:18px;font-weight:400;margin:0;padding:9px 0 4px;line-height:1.3}#ays-survey-countdown-main-container li,#ays-survey-countdown-main-container ul{margin:0;font-weight:600}#ays-survey-countdown-main-container li{display:inline-block;font-size:10px;list-style-type:none;padding:10px;text-transform:uppercase}#ays-survey-countdown-main-container li span{display:block;font-size:22px;min-height:33px}#ays-survey-countdown-main-container .emoji{display:none;padding:1rem}#ays-survey-countdown-main-container .emoji span{font-size:25px;padding:0 .5rem}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-box{display:flex;justify-content:space-between;align-items:center;width:95%;margin:auto}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-title-row{text-align:center;padding-right:50px;font-style:normal;font-weight:900;font-size:19px;color:#fff;}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-button-buy-now{border:none;outline:0;padding:10px 20px;font-size:22px;text-transform:uppercase;font-weight:700;text-decoration:none;background:linear-gradient(180deg,#dd0bef 0,#82008d 100%);border-radius:16px}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-text-row{text-transform:uppercase;text-shadow:-1.5px 0 #dd0bef,0 1.5px #dd0bef,1.5px 0 #dd0bef,0 -1.5px #dd0bef;font-weight:900;font-style:normal;font-size:40px;line-height:40px;color:#fff}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-text-box{position:absolute;width:25%;top:10px;bottom:0;right:0;left:0;margin:0 auto}#ays-survey-countdown ul{padding:0}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-banner-2025-coupon-box{border:2px dashed rgba(255,255,255,.4);padding:0 12px;border-radius:6px;background:rgba(255,255,255,.1);cursor:pointer;transition:.3s;display:flex;align-items:center;justify-content:center;gap:6px;backdrop-filter:blur(10px);width:fit-content;margin:0 auto}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-banner-2025-coupon-box:hover{background:rgba(255,255,255,.2);border-color:rgba(255,255,255,.6);transform:translateY(-1px)}#ays-survey-dicount-black-friday-month-main .ays-survey-discount-black-friday-banner-2025-coupon-text{font-size:14px;font-weight:700;letter-spacing:1px;color:#fff;font-family:monospace}#ays-survey-dicount-black-friday-month-main .ays-survey-discount-black-friday-banner-2025-copy-icon{opacity:.8;transition:opacity .3s}#ays-survey-dicount-black-friday-month-main .ays-survey-discount-black-friday-banner-banner-2025-coupon-box:hover .ays-survey-discount-black-friday-banner-2025-copy-icon,.ays-survey-discount-black-friday-banner-2025-copy-notification.show{opacity:1}.ays-survey-discount-black-friday-banner-2025-copy-notification{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:rgba(0,0,0,.8);color:#fff;padding:12px 24px;border-radius:8px;font-size:14px;z-index:10000;opacity:0;transition:opacity .3s}@media screen and (max-width:1400px) and (min-width:1200px){div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-title-row{font-size:15px}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-text-row{font-size:27px}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-box{width:100%}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-button-buy-now{font-size:13px}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box-80{width:80%!important}}@media all and (max-width:1200px){div#ays-survey-dicount-black-friday-month-main .ays_survey_dicount_month{background:unset}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-text-row{font-size:30px}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-box{width:100%}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-button-buy-now{font-size:15px}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box-80{width:80%!important}}@media all and (max-width:1200px) and (min-width:1150px){div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-title-row{font-size:15px}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-button-buy-now{font-size:10px}}@media all and (max-width:1150px){div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box-80{width:80%!important}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-box{flex-direction:column}div#ays-survey-dicount-black-friday-month-main{padding-right:0}div#ays-survey-dicount-black-friday-month-main .ays_survey_dicount_month{display:flex;align-items:center;justify-content:space-between;align-content:center;flex-wrap:wrap;flex-direction:column;padding:10px 0}div#ays-survey-dicount-black-friday-month-main div.ays-survey-dicount-black-friday-wrap-box{width:100%!important;text-align:center}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-title-row,div#ays-survey-dicount-black-friday-month-main #ays-survey-countdown-main-container ul{padding:0;font-size:13px}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-button-sale,div#ays-survey-countdown-main-container li{font-size:15px}div#ays-survey-countdown-main-container li span{font-size:25px}div#ays-survey-dicount-black-friday-month-main div.ays-survey-dicount-black-friday-wrap-text-box{position:unset}#ays-survey-countdown-main-container #ays-survey-countdown-headline{font-size:15px;font-weight:600}#ays-survey-countdown-main-container ul{font-weight:500}#ays-survey-countdown-main-container li span{font-size:20px}#ays-survey-dicount-black-friday-month-main .ays-button{margin:0 auto!important}div#ays-survey-dicount-black-friday-month-main.ays_survey_dicount_info.notice{background-position:bottom right;background-repeat:no-repeat;background-size:contain;display:flex;justify-content:center;background-image:linear-gradient(45deg,#1e101d,#c60af4)}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box.ays-buy-now-button-box{justify-content:center}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box .ays-buy-now-button{font-size:14px;padding:5px 10px}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-button-buy-now{padding:10px 18px;font-size:15px}}@media all and (max-width:768px){#ays-survey-dicount-black-friday-month-main{display:none!important}}
2663 ';
2664 $content[] = '</style>';
2665
2666 $content = implode( '', $content );
2667
2668 echo $content;
2669 }
2670 }
2671
2672 // Halloween Bundle 2025
2673 public function ays_survey_new_halloween_bundle_message_2025($ishmar){
2674 if($ishmar == 0 ){
2675 $content = array();
2676
2677 $date = time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
2678 $now_date = date('M d, Y H:i:s', $date);
2679
2680 $start_date = strtotime('2025-09-08 00:00:01');
2681 $end_date = strtotime('2025-11-07 23:59:59');
2682 $diff_end = $end_date - $date;
2683
2684 $style_attr = '';
2685 if( $diff_end < 0 ){
2686 $style_attr = 'style="display:none;"';
2687 }
2688
2689 $ays_survey_cta_button_link = esc_url('https://ays-pro.com/halloween-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=survey-halloween-banner-' . SURVEY_MAKER_VERSION);
2690
2691 $content[] = '
2692 <div id="ays-survey-halloween-banner-2025-main" class="ays-survey-halloween-banner-2025-main ays_survey_dicount_info notice notice-success is-dismissible">
2693 <div class="ays-survey-halloween-banner-2025-content">
2694 <div class="ays-survey-halloween-banner-2025-left">
2695 <div class="ays-survey-halloween-banner-2025-text">
2696 <h2 class="ays-survey-halloween-banner-2025-title">Boo! Grab Your <a href="'. $ays_survey_cta_button_link .'" class="" target="_blank">Halloween Deal</a> <br/> Before It Vanishes!</h2>
2697 <p class="ays-survey-halloween-banner-2025-subtitle">Don’t get spooked by missing out!<br/> Get 50% off our exclusive Halloween Bundle (Survey + SCCP + Poll Maker + Popup Box) while the magic lasts!</p>
2698 </div>
2699 </div>
2700
2701 <div class="ays-survey-halloween-banner-2025-center">';
2702
2703 $content[] = '<div id="ays-survey-halloween-banner-2025-countdown" class="ays-survey-halloween-banner-2025-countdown" ' . $style_attr . '>';
2704 $content[] = '<div class="ays-survey-halloween-banner-2025-countdown-timer">';
2705 $content[] = '<div class="ays-survey-halloween-banner-2025-countdown-item">';
2706 $content[] = '<div class="ays-survey-halloween-banner-2025-countdown-value" id="ays-survey-halloween-banner-2025-days">00</div>';
2707 $content[] = '<div class="ays-survey-halloween-banner-2025-countdown-label">' . __('days', 'survey-maker') . '</div>';
2708 $content[] = '</div>';
2709 $content[] = '<div class="ays-survey-halloween-banner-2025-countdown-separator">:</div>';
2710 $content[] = '<div class="ays-survey-halloween-banner-2025-countdown-item">';
2711 $content[] = '<div class="ays-survey-halloween-banner-2025-countdown-value" id="ays-survey-halloween-banner-2025-hours">00</div>';
2712 $content[] = '<div class="ays-survey-halloween-banner-2025-countdown-label">' . __('hours', 'survey-maker') . '</div>';
2713 $content[] = '</div>';
2714 $content[] = '<div class="ays-survey-halloween-banner-2025-countdown-separator">:</div>';
2715 $content[] = '<div class="ays-survey-halloween-banner-2025-countdown-item">';
2716 $content[] = '<div class="ays-survey-halloween-banner-2025-countdown-value" id="ays-survey-halloween-banner-2025-minutes">00</div>';
2717 $content[] = '<div class="ays-survey-halloween-banner-2025-countdown-label">' . __('minutes', 'survey-maker') . '</div>';
2718 $content[] = '</div>';
2719 $content[] = '<div class="ays-survey-halloween-banner-2025-countdown-separator">:</div>';
2720 $content[] = '<div class="ays-survey-halloween-banner-2025-countdown-item">';
2721 $content[] = '<div class="ays-survey-halloween-banner-2025-countdown-value" id="ays-survey-halloween-banner-2025-seconds">00</div>';
2722 $content[] = '<div class="ays-survey-halloween-banner-2025-countdown-label">' . __('seconds', 'survey-maker') . '</div>';
2723 $content[] = '</div>';
2724 $content[] = '</div>';
2725 $content[] = '</div>';
2726
2727 $content[] = '</div>
2728
2729 <div class="ays-survey-halloween-banner-2025-right">
2730 <div class="ays-survey-halloween-banner-2025-pumpkin">
2731 <svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
2732 <g clip-path="url(#clip0_177_40)">
2733 <path d="M32.664 8.519C29.364 5.134 23.42 4.75 18 4.75C12.58 4.75 6.636 5.134 3.336 8.519C0.582 11.344 0 15.751 0 19.791C0 25.054 1.982 31.102 6.357 34.035C9.364 36.051 13.95 35.871 18 35.871C22.05 35.871 26.636 36.051 29.643 34.035C34.018 31.101 36 25.054 36 19.791C36 15.751 35.418 11.344 32.664 8.519Z" fill="#F4900C"/>
2734 <path d="M20.783 5.44401C20.852 5.86401 20.561 6.20801 20.136 6.20801H15.685C15.259 6.20801 14.968 5.86401 15.038 5.44401L15.783 0.972008C15.853 0.551008 16.259 0.208008 16.685 0.208008H19.136C19.562 0.208008 19.968 0.552008 20.037 0.972008L20.783 5.44401Z" fill="#3F7123"/>
2735 <path d="M20.6541 21.159L19.0561 18.563C18.7651 18.021 18.3831 17.75 17.9991 17.746C17.6161 17.75 17.2331 18.021 16.9421 18.563L15.3441 21.159C14.7571 22.252 16.2171 22.875 17.9981 22.875C19.7791 22.875 21.2411 22.251 20.6541 21.159ZM30.1621 24.351C30.1171 24.276 30.0361 24.23 29.9481 24.23H29.1071C29.0391 24.23 28.9731 24.258 28.9261 24.307L26.6951 26.641L23.9971 24.472C23.9461 24.431 23.8801 24.414 23.8121 24.419C23.7461 24.426 23.6851 24.46 23.6441 24.513L21.2361 27.575L18.1821 24.309C18.1691 24.295 18.1491 24.292 18.1341 24.281C18.1191 24.271 18.1091 24.254 18.0911 24.247C18.0851 24.245 18.0781 24.247 18.0721 24.245C18.0481 24.238 18.0251 24.24 18.0001 24.24C17.9751 24.24 17.9521 24.238 17.9281 24.246C17.9221 24.248 17.9151 24.245 17.9081 24.248C17.8901 24.255 17.8811 24.272 17.8651 24.282C17.8491 24.292 17.8301 24.295 17.8171 24.309L14.7641 27.575L12.3551 24.513C12.3141 24.46 12.2531 24.426 12.1871 24.419C12.1211 24.413 12.0541 24.431 12.0021 24.472L9.30411 26.641L7.07411 24.307C7.02711 24.258 6.96211 24.23 6.89311 24.23H6.05211C5.96511 24.23 5.88311 24.276 5.83811 24.351C5.79311 24.426 5.79011 24.519 5.83111 24.596L8.58511 29.815C8.61911 29.879 8.6781 29.925 8.7491 29.942C8.8201 29.959 8.8941 29.944 8.9521 29.902L10.9861 28.444L13.9901 32.077C14.0331 32.13 14.0961 32.162 14.1641 32.167L14.1831 32.168C14.2451 32.168 14.3041 32.146 14.3501 32.105L18.0001 28.836L21.6501 32.104C21.6961 32.145 21.7551 32.167 21.8171 32.167L21.8361 32.166C21.9041 32.161 21.9671 32.129 22.0101 32.076L25.0151 28.443L27.0491 29.901C27.1091 29.944 27.1821 29.961 27.2521 29.941C27.3221 29.924 27.3821 29.879 27.4151 29.815L30.1701 24.596C30.2101 24.519 30.2081 24.426 30.1621 24.351ZM27.9761 15.421C28.1051 17.548 27.1921 19.227 24.7711 19.374C22.3511 19.52 21.2421 17.963 21.1131 15.837C20.9841 13.711 22.3451 10.717 24.2401 10.603C26.1361 10.487 27.8481 13.294 27.9761 15.421ZM8.02411 15.421C7.89511 17.548 8.80811 19.227 11.2291 19.374C13.6491 19.52 14.7581 17.963 14.8871 15.837C15.0161 13.711 13.6551 10.717 11.7601 10.603C9.86511 10.489 8.15211 13.294 8.02411 15.421Z" fill="#642116"/>
2736 </g>
2737 <defs>
2738 <clipPath id="clip0_177_40">
2739 <rect width="36" height="36" fill="white"/>
2740 </clipPath>
2741 </defs>
2742 </svg>
2743 </div>
2744
2745
2746
2747 <div class="ays-survey-halloween-banner-2025-discount-section">
2748 <div class="ays-survey-halloween-banner-2025-discount">50% OFF</div>
2749 <div class="ays-survey-halloween-banner-2025-coupon-wrapper">
2750 <div class="ays-survey-halloween-banner-2025-coupon-box" onclick="aysSurveyHalloweenCopyToClipboard(\'HALLOWEEN25\')" title="Click to copy">
2751 <span class="ays-survey-halloween-banner-2025-coupon-text">HALLOWEEN25</span>
2752 <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="ays-survey-halloween-banner-2025-copy-icon">
2753 <path d="M13.5 2.5H6.5C5.67 2.5 5 3.17 5 4V10C5 10.83 5.67 11.5 6.5 11.5H13.5C14.33 11.5 15 10.83 15 10V4C15 3.17 14.33 2.5 13.5 2.5ZM13.5 10H6.5V4H13.5V10ZM2.5 6.5V12.5C2.5 13.33 3.17 14 4 14H10V12.5H4V6.5H2.5Z" fill="white"/>
2754 </svg>
2755 </div>
2756 </div>
2757 <a href="'. $ays_survey_cta_button_link .'" class="ays-survey-halloween-banner-2025-upgrade" target="_blank">Buy Now</a>
2758 </div>';
2759
2760 if( current_user_can( 'manage_options' ) ){
2761 $content[] = '<div id="ays-survey-dismiss-buttons-content">';
2762 $content[] = '<form action="" method="POST" style="position: absolute; bottom: -5px; right: 0; color: #fff;">';
2763 $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="color: darkgrey; font-size: 11px;">'. __( "Dismiss ad", 'survey-maker' ) .'</button>';
2764 $content[] = wp_nonce_field( SURVEY_MAKER_NAME . '-sale-banner' , SURVEY_MAKER_NAME . '-sale-banner' );
2765 $content[] = '</form>';
2766 $content[] = '</div>';
2767 }
2768
2769 $content[] = '
2770 </div>
2771 </div>
2772 </div>';
2773
2774 $content[] = '<style id="ays-survey-progress-banner-styles-inline-css">';
2775 $content[] = '
2776 .ays-survey-halloween-banner-2025-main {
2777 background: linear-gradient(135deg, #1A0F2E 100%, #2D1B4E 0%);
2778 background-image: url("' . esc_attr( SURVEY_MAKER_ADMIN_URL ) . '/images/halloween-banner-background-image-remove.png"), linear-gradient(135deg, #2D1B4E 0%, #1A0F2E 100%);
2779 background-position: left center, center;
2780 background-repeat: no-repeat, no-repeat;
2781 background-size: auto 100%, cover;
2782 padding: 20px 30px 20px 130px;
2783 border-radius: 12px;
2784 color: white;
2785 margin: 20px 0;
2786 border: 0;
2787 box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
2788 overflow: hidden;
2789 }
2790
2791 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-content {
2792 display: flex;
2793 align-items: center;
2794 justify-content: space-between;
2795 gap: 30px;
2796 }
2797
2798 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-left {
2799 display: flex;
2800 align-items: center;
2801 gap: 20px;
2802 }
2803
2804 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-center {
2805 display: flex;
2806 align-items: center;
2807 justify-content: center;
2808 flex: 1;
2809 max-width: 350px;
2810 }
2811
2812 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-right {
2813 display: flex;
2814 align-items: center;
2815 gap: 15px;
2816 flex-shrink: 0;
2817 }
2818
2819 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-icon {
2820 flex-shrink: 0;
2821 }
2822
2823 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-pumpkin svg {
2824 display: inline !important;
2825 border: none !important;
2826 box-shadow: none !important;
2827 height: 1em !important;
2828 width: 1em !important;
2829 margin: 0 0.07em !important;
2830 vertical-align: -0.1em !important;
2831 background: none !important;
2832 padding: 0 !important;
2833 }
2834
2835 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-orb {
2836 width: 80px;
2837 height: 80px;
2838 background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
2839 border-radius: 50%;
2840 display: flex;
2841 align-items: center;
2842 justify-content: center;
2843 box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
2844 border: 3px solid rgba(168, 85, 247, 0.4);
2845 }
2846
2847 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-question {
2848 font-size: 48px;
2849 font-weight: 700;
2850 color: #E9D5FF;
2851 }
2852
2853 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-bat {
2854 font-size: 20px;
2855 opacity: 0.8;
2856 }
2857
2858 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-bat-1 {
2859 margin-left: -100px;
2860 margin-top: -40px;
2861 }
2862
2863 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-bat-2 {
2864 margin-left: -110px;
2865 margin-top: 35px;
2866 }
2867
2868 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-sparkle {
2869 font-size: 12px;
2870 opacity: 0.7;
2871 }
2872
2873 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-sparkle-1 {
2874 margin-left: -95px;
2875 margin-top: -60px;
2876 }
2877
2878 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-sparkle-2 {
2879 margin-left: -70px;
2880 margin-top: -15px;
2881 }
2882
2883 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-sparkle-3 {
2884 margin-left: -120px;
2885 margin-top: 10px;
2886 }
2887
2888 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-text {
2889 flex: 1;
2890 }
2891
2892 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-title {
2893 font-size: 24px;
2894 font-weight: 700;
2895 margin: 0 0 8px 0;
2896 line-height: 1.2;
2897 color: #fff;
2898 text-transform: uppercase;
2899 letter-spacing: 1px;
2900 }
2901
2902 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-title a {
2903 color: #FB923C;
2904 text-decoration: underline;
2905 }
2906
2907 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-subtitle {
2908 font-size: 16px;
2909 margin: 0;
2910 opacity: 0.9;
2911 font-weight: 400;
2912 color: #E9D5FF;
2913 }
2914
2915 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-description {
2916 font-size: 14px;
2917 margin: 0;
2918 opacity: 0.85;
2919 line-height: 1.5;
2920 color: #D8B4FE;
2921 }
2922
2923 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-pumpkin {
2924 font-size: 64px;
2925 filter: drop-shadow(0 0 20px rgba(251, 146, 60, 0.8));
2926 flex-shrink: 0;
2927 }
2928
2929 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-discount-section {
2930 display: flex;
2931 flex-direction: column;
2932 align-items: center;
2933 gap: 10px;
2934 }
2935
2936 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-discount {
2937 font-size: 36px;
2938 font-weight: 700;
2939 color: #FB923C;
2940 text-shadow: 0 0 20px rgba(251, 146, 60, 0.6);
2941 margin: 0;
2942 line-height: 1;
2943 }
2944
2945 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-coupon-wrapper {
2946 display:none;
2947 margin-bottom: 5px;
2948 }
2949
2950 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-coupon-box {
2951 border: 2px dashed rgba(255, 255, 255, 0.4);
2952 padding: 6px 12px;
2953 border-radius: 6px;
2954 background: rgba(255, 255, 255, 0.1);
2955 cursor: pointer;
2956 transition: all 0.3s ease;
2957 display: flex;
2958 align-items: center;
2959 gap: 6px;
2960 backdrop-filter: blur(10px);
2961 }
2962
2963 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-coupon-box:hover {
2964 background: rgba(255, 255, 255, 0.2);
2965 border-color: rgba(255, 255, 255, 0.6);
2966 transform: translateY(-1px);
2967 }
2968
2969 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-coupon-text {
2970 font-size: 14px;
2971 font-weight: 700;
2972 letter-spacing: 1px;
2973 color: #fff;
2974 font-family: monospace;
2975 }
2976
2977 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-copy-icon {
2978 opacity: 0.8;
2979 transition: opacity 0.3s ease;
2980 }
2981
2982 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-coupon-box:hover .ays-survey-halloween-banner-2025-copy-icon {
2983 opacity: 1;
2984 }
2985
2986 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-upgrade {
2987 background: linear-gradient(135deg, #FB923C 0%, #F97316 100%);
2988 color: white;
2989 border: none;
2990 padding: 12px 28px;
2991 border-radius: 8px;
2992 font-size: 16px;
2993 font-weight: 600;
2994 cursor: pointer;
2995 transition: all 0.3s ease;
2996 box-shadow: 0 4px 16px rgba(251, 146, 60, 0.5);
2997 text-decoration: none;
2998 display: inline-flex;
2999 align-items: center;
3000 text-align: center;
3001 }
3002
3003 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-upgrade:hover {
3004 transform: translateY(-2px);
3005 box-shadow: 0 6px 20px rgba(251, 146, 60, 0.7);
3006 text-decoration: none;
3007 color: white;
3008 }
3009
3010 .ays-survey-halloween-banner-2025-main .notice-dismiss:before {
3011 color: #fff;
3012 }
3013
3014 .ays-survey-halloween-banner-2025-copy-notification {
3015 position: fixed;
3016 top: 50%;
3017 left: 50%;
3018 transform: translate(-50%, -50%);
3019 background: rgba(0, 0, 0, 0.8);
3020 color: white;
3021 padding: 12px 24px;
3022 border-radius: 8px;
3023 font-size: 14px;
3024 z-index: 10000;
3025 opacity: 0;
3026 transition: opacity 0.3s ease;
3027 }
3028
3029 .ays-survey-halloween-banner-2025-copy-notification.show {
3030 opacity: 1;
3031 }
3032
3033 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-countdown-timer {
3034 display: flex;
3035 align-items: center;
3036 justify-content: center;
3037 gap: 8px;
3038 }
3039
3040 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-countdown-item {
3041 background: rgba(255, 255, 255, 0.15);
3042 border-radius: 8px;
3043 padding: 8px 12px;
3044 min-width: 60px;
3045 backdrop-filter: blur(10px);
3046 }
3047
3048 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-countdown-value {
3049 font-size: 24px;
3050 font-weight: 700;
3051 line-height: 1;
3052 margin-bottom: 4px;
3053 color: #fff;
3054 text-align: center;
3055 }
3056
3057 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-countdown-label {
3058 font-size: 11px;
3059 opacity: 0.8;
3060 text-transform: lowercase;
3061 text-align: center;
3062 }
3063
3064 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-countdown-separator {
3065 font-size: 24px;
3066 font-weight: 700;
3067 opacity: 0.6;
3068 margin: 0 4px;
3069 }
3070
3071 @media (min-width: 1200px) {
3072 .ays-survey-halloween-banner-2025-main .wp-core-ui .notice.is-dismissible {
3073 padding-right: 60px;
3074 }
3075 }
3076
3077 @media (max-width: 1200px) {
3078
3079 div.ays-survey-halloween-banner-2025-main {
3080 padding: 20px 30px;
3081 }
3082
3083 div.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-pumpkin {
3084 display: none;
3085 }
3086
3087 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-subtitle,
3088 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-title {
3089 text-align: center;
3090 }
3091
3092 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-content {
3093 flex-wrap: wrap;
3094 gap: 20px;
3095 }
3096
3097 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-left {
3098 width: 100%;
3099 }
3100
3101 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-center {
3102 width: 100%;
3103 max-width: 100%;
3104 text-align: center;
3105 }
3106
3107 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-right {
3108 width: 100%;
3109 justify-content: center;
3110 }
3111 }
3112
3113 @media (max-width: 786px) {
3114 #ays-survey-halloween-banner-2025-main {
3115 display: none !important;
3116 }
3117 }
3118
3119 @media (max-width: 768px) {
3120 .ays-survey-halloween-banner-2025-main {
3121 padding: 15px 20px;
3122 margin: 15px 0;
3123 }
3124
3125 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-title {
3126 font-size: 20px;
3127 }
3128
3129 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-subtitle {
3130 font-size: 14px;
3131 }
3132
3133 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-description {
3134 font-size: 13px;
3135 }
3136
3137 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-pumpkin {
3138 font-size: 48px;
3139 }
3140
3141 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-discount {
3142 font-size: 28px;
3143 }
3144
3145 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-upgrade {
3146 padding: 10px 20px;
3147 font-size: 14px;
3148 }
3149 }
3150
3151 @media (max-width: 480px) {
3152 .ays-survey-halloween-banner-2025-main {
3153 padding: 12px 15px;
3154 }
3155
3156 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-orb {
3157 width: 60px;
3158 height: 60px;
3159 }
3160
3161 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-question {
3162 font-size: 36px;
3163 }
3164
3165 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-title {
3166 font-size: 18px;
3167 }
3168
3169 .ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-coupon-text {
3170 font-size: 12px;
3171 }
3172 }
3173 ';
3174
3175 $content[] = '</style>';
3176
3177 $content[] = '<script>';
3178 $content[] = "
3179 function aysSurveyHalloweenCopyToClipboard(text) {
3180 // Create a temporary textarea element
3181 var textarea = document.createElement('textarea');
3182 textarea.value = text;
3183 textarea.style.position = 'fixed';
3184 textarea.style.opacity = '0';
3185 document.body.appendChild(textarea);
3186
3187 // Select and copy the text
3188 textarea.select();
3189 textarea.setSelectionRange(0, 99999); // For mobile devices
3190
3191 try {
3192 document.execCommand('copy');
3193 aysSurveyHalloweenShowCopyNotification('Coupon code copied!');
3194 } catch (err) {
3195 console.error('Failed to copy text: ', err);
3196 }
3197
3198 // Remove the temporary textarea
3199 document.body.removeChild(textarea);
3200 }
3201
3202 function aysSurveyHalloweenShowCopyNotification(message) {
3203 // Check if notification already exists
3204 var existingNotification = document.querySelector('.ays-survey-halloween-banner-2025-copy-notification');
3205 if (existingNotification) {
3206 document.body.removeChild(existingNotification);
3207 }
3208
3209 // Create notification element
3210 var notification = document.createElement('div');
3211 notification.className = 'ays-survey-halloween-banner-2025-copy-notification';
3212 notification.textContent = message;
3213 document.body.appendChild(notification);
3214
3215 // Show notification with animation
3216 setTimeout(function() {
3217 notification.classList.add('show');
3218 }, 10);
3219
3220 // Hide and remove notification after 2 seconds
3221 setTimeout(function() {
3222 notification.classList.remove('show');
3223 setTimeout(function() {
3224 if (notification.parentNode) {
3225 document.body.removeChild(notification);
3226 }
3227 }, 300);
3228 }, 2000);
3229 }
3230
3231 (function() {
3232 var endDate = new Date('". date('Y-m-d H:i:s', $end_date) ."').getTime();
3233
3234 function updateCountdown() {
3235 var now = new Date().getTime();
3236 var distance = endDate - now;
3237
3238 if (distance < 0) {
3239 clearInterval(updateCountdown);
3240 document.getElementById('ays-survey-halloween-banner-2025-progress-banner-countdown').style.display = 'none';
3241 return;
3242 }
3243
3244 var days = Math.floor(distance / (1000 * 60 * 60 * 24));
3245 var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
3246 var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
3247 var seconds = Math.floor((distance % (1000 * 60)) / 1000);
3248
3249 function padZero(num) {
3250 return num < 10 ? '0' + num : num;
3251 }
3252
3253 document.getElementById('ays-survey-halloween-banner-2025-days').textContent = padZero(days);
3254 document.getElementById('ays-survey-halloween-banner-2025-hours').textContent = padZero(hours);
3255 document.getElementById('ays-survey-halloween-banner-2025-minutes').textContent = padZero(minutes);
3256 document.getElementById('ays-survey-halloween-banner-2025-seconds').textContent = padZero(seconds);
3257 }
3258
3259 updateCountdown();
3260 setInterval(updateCountdown, 1000);
3261 })()";
3262 $content[] = '</script>';
3263
3264 $content = implode( '', $content );
3265 echo ($content);
3266 }
3267 }
3268
3269 // Fox LMS Pro Banner
3270 public function ays_survey_discounted_licenses_banner_message($ishmar){
3271 if($ishmar == 0 ){
3272 $content = array();
3273
3274 $date = time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
3275 $now_date = date('M d, Y H:i:s', $date);
3276
3277 $start_date = strtotime('2025-09-21');
3278 $end_date = strtotime('2025-10-21');
3279 $diff_end = $end_date - $date;
3280
3281 $style_attr = '';
3282 if( $diff_end < 0 ){
3283 $style_attr = 'style="display:none;"';
3284 }
3285
3286 $total_licenses = 50;
3287 $progression_pattern = array(3, 2, 1, 4, 2, 3, 1, 2, 4, 3, 2, 1, 3, 2, 4, 1, 3, 2, 2, 3, 1, 2);
3288 $days_passed = floor(($date - $start_date) / (24 * 60 * 60));
3289 $used_licenses = 0;
3290
3291 for ($i = 0; $i < min($days_passed, count($progression_pattern)); $i++) {
3292 $used_licenses += $progression_pattern[$i];
3293 }
3294 $used_licenses = min($used_licenses, $total_licenses);
3295 $remaining_licenses = $total_licenses - $used_licenses;
3296 $progress_percentage = ($used_licenses / $total_licenses) * 100;
3297
3298 $ays_survey_cta_button_link = esc_url('https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=survey-maker-license-banner-' . SURVEY_MAKER_VERSION);
3299
3300 $content[] = '<div id="ays-survey-progress-banner-main" class="ays-survey-progress-banner-main ays_survey_dicount_info ays-survey-admin-notice notice notice-success is-dismissible" ' . $style_attr . '>';
3301 $content[] = '<div class="ays-survey-progress-banner-content">';
3302 $content[] = '<div class="ays-survey-progress-banner-left">';
3303 $content[] = '<div class="ays-survey-progress-banner-icon">';
3304 $content[] = '<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
3305 <path d="M1.33325 22.6668L11.9999 13.3335L33.3333 14.6668L34.6666 36.0002L25.3333 46.6668C25.3333 46.6668 25.3346 38.6682 17.3333 30.6668C9.33192 22.6655 1.33325 22.6668 1.33325 22.6668Z" fill="#A0041E"/>
3306 <path d="M1.29739 46.6665C1.29739 46.6665 1.24939 36.0278 5.27739 31.9998C9.30539 27.9718 20.0001 28.2492 20.0001 28.2492C20.0001 28.2492 19.9987 38.6665 15.9987 42.6665C11.9987 46.6665 1.29739 46.6665 1.29739 46.6665Z" fill="#FFAC33"/>
3307 <path d="M11.9986 41.3332C14.9441 41.3332 17.3319 38.9454 17.3319 35.9998C17.3319 33.0543 14.9441 30.6665 11.9986 30.6665C9.0531 30.6665 6.66528 33.0543 6.66528 35.9998C6.66528 38.9454 9.0531 41.3332 11.9986 41.3332Z" fill="#FFCC4D"/>
3308 <path d="M47.9986 0C47.9986 0 34.6653 0 18.6653 13.3333C10.6653 20 10.6653 32 13.3319 34.6667C15.9986 37.3333 27.9986 37.3333 34.6653 29.3333C47.9986 13.3333 47.9986 0 47.9986 0Z" fill="#55ACEE"/>
3309 <path d="M35.9987 6.6665C33.8347 6.6665 31.9814 7.96117 31.144 9.81317C31.8134 9.5105 32.5507 9.33317 33.332 9.33317C36.2774 9.33317 38.6654 11.7212 38.6654 14.6665C38.6654 15.4478 38.488 16.1852 38.1867 16.8532C40.0387 16.0172 41.332 14.1638 41.332 11.9998C41.332 9.0545 38.944 6.6665 35.9987 6.6665Z" fill="black"/>
3310 <path d="M10.6667 37.3332C10.6667 37.3332 10.6667 31.9998 12.0001 30.6665C13.3334 29.3332 29.3347 16.0012 30.6667 17.3332C31.9987 18.6652 18.6654 34.6665 17.3321 35.9998C15.9987 37.3332 10.6667 37.3332 10.6667 37.3332Z" fill="#A0041E"/>
3311 </svg>';
3312 $content[] = '</div>';
3313 $content[] = '<div class="ays-survey-progress-banner-text">';
3314 $content[] = '<h2 class="ays-survey-progress-banner-title">' . sprintf( __('Get the Pro Version of %s Survey Maker%s – 20%% OFF', 'survey-maker'), '<a href="'. $ays_survey_cta_button_link .'" target="_blank">', '</a>' ) . '</h2>';
3315 $content[] = '<p class="ays-survey-progress-banner-subtitle">' . __('Unlock advanced features + 30 day Money Back Guarantee', 'survey-maker') . '</p>';
3316 $content[] = '</div>';
3317 $content[] = '</div>';
3318
3319 $content[] = '<div class="ays-survey-progress-banner-center">';
3320 $content[] = '<div class="ays-survey-progress-banner-coupon">';
3321 $content[] = '<div class="ays-survey-progress-banner-coupon-box" onclick="surveyCopyToClipboard(\'FREE2PRO20\')" title="' . __('Click to copy', 'survey-maker') . '">';
3322 $content[] = '<span class="ays-survey-progress-banner-coupon-text">FREE2PRO20</span>';
3323 $content[] = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="ays-survey-progress-banner-copy-icon">';
3324 $content[] = '<path d="M13.5 2.5H6.5C5.67 2.5 5 3.17 5 4V10C5 10.83 5.67 11.5 6.5 11.5H13.5C14.33 11.5 15 10.83 15 10V4C15 3.17 14.33 2.5 13.5 2.5ZM13.5 10H6.5V4H13.5V10ZM2.5 6.5V12.5C2.5 13.33 3.17 14 4 14H10V12.5H4V6.5H2.5Z" fill="white"/>';
3325 $content[] = '</svg>';
3326 $content[] = '</div>';
3327 $content[] = '</div>';
3328
3329 $content[] = '<div class="ays-survey-progress-banner-progress">';
3330 $content[] = '<p class="ays-survey-progress-banner-progress-text">' . __('Only', 'survey-maker') . ' <span id="remaining-licenses">' . $remaining_licenses . '</span> ' . __('of 50 discounted licenses left', 'survey-maker') . '</p>';
3331 $content[] = '<div class="ays-survey-progress-banner-progress-bar">';
3332 $content[] = '<div class="ays-survey-progress-banner-progress-fill" id="progress-fill" style="width: ' . $progress_percentage . '%;"></div>';
3333 $content[] = '</div>';
3334 $content[] = '</div>';
3335 $content[] = '</div>';
3336
3337 $content[] = '<div class="ays-survey-progress-banner-right">';
3338 $content[] = '<a href="'. $ays_survey_cta_button_link .'" class="ays-survey-progress-banner-upgrade" target="_blank">';
3339 $content[] = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">';
3340 $content[] = '<path d="M14.6392 6.956C14.5743 6.78222 14.4081 6.66667 14.2223 6.66667H8.85565L11.9512 0.648C12.0485 0.458667 11.9983 0.227111 11.8308 0.0955556C11.7499 0.0315556 11.6525 0 11.5556 0C11.4521 0 11.3485 0.0364444 11.2654 0.108L8.00009 2.928L1.48765 8.55244C1.3472 8.67378 1.29653 8.86978 1.36142 9.04356C1.42631 9.21733 1.59209 9.33333 1.77787 9.33333H7.14454L4.04898 15.352C3.95165 15.5413 4.00187 15.7729 4.16942 15.9044C4.25031 15.9684 4.34765 16 4.44453 16C4.54809 16 4.65165 15.9636 4.73476 15.892L8.00009 13.072L14.5125 7.44756C14.6534 7.32622 14.7036 7.13022 14.6392 6.956Z" fill="white"/>';
3341 $content[] = '</svg>';
3342 $content[] = ' ' . __('Upgrade Now', 'survey-maker');
3343 $content[] = '</a>';
3344 $content[] = '</div>';
3345 $content[] = '</div>';
3346
3347 if( current_user_can( 'manage_options' ) ){
3348 $content[] = '<div id="ays-survey-dismiss-buttons-content">';
3349 $content[] = '<form action="" method="POST" style="position: absolute; bottom: 0; right: 0; color: #fff;">';
3350 $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="color: darkgrey; font-size: 11px;">'. __( "Dismiss ad", 'survey-maker' ) .'</button>';
3351 $content[] = wp_nonce_field( SURVEY_MAKER_NAME . '-sale-banner' , SURVEY_MAKER_NAME . '-sale-banner' );
3352 $content[] = '</form>';
3353 $content[] = '</div>';
3354 }
3355 $content[] = '</div>';
3356
3357 // Fox LMS Pro Banner Styles
3358 $content[] = '<style id="ays-survey-progress-banner-styles-inline-css">';
3359 $content[] = '
3360 .ays-survey-progress-banner-main {
3361 background: linear-gradient(135deg, #6344ED 0%, #8C2ABE 100%);
3362 padding: 20px 30px;
3363 border-radius: 16px;
3364 color: white;
3365 position: relative;
3366 margin: 20px 0;
3367 box-shadow: 0 8px 32px rgba(99, 68, 237, 0.3);
3368 border: 0;
3369 }
3370
3371 .ays-survey-progress-banner-main .ays-survey-progress-banner-content {
3372 display: flex;
3373 align-items: center;
3374 justify-content: space-between;
3375 gap: 30px;
3376 }
3377
3378 .ays-survey-progress-banner-main .ays-survey-progress-banner-left {
3379 display: flex;
3380 align-items: center;
3381 gap: 20px;
3382 flex: 1;
3383 }
3384
3385 .ays-survey-progress-banner-main .ays-survey-progress-banner-center {
3386 display: flex;
3387 align-items: center;
3388 gap: 15px;
3389 flex: 1;
3390 }
3391
3392 .ays-survey-progress-banner-main .ays-survey-progress-banner-right {
3393 display: flex;
3394 align-items: center;
3395 gap: 20px;
3396 flex-shrink: 0;
3397 }
3398
3399 .ays-survey-progress-banner-main .ays-survey-progress-banner-icon {
3400 font-size: 32px;
3401 filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
3402 }
3403
3404 .ays-survey-progress-banner-main .ays-survey-progress-banner-title {
3405 font-size: 21px;
3406 font-weight: 700;
3407 margin: 0 0 8px 0;
3408 line-height: 1.2;
3409 color: #fff;
3410 }
3411
3412 .ays-survey-progress-banner-main .ays-survey-progress-banner-title a {
3413 text-decoration: underline;
3414 color: #fff;
3415 }
3416
3417 .ays-survey-progress-banner-main .ays-survey-progress-banner-subtitle {
3418 font-size: 16px;
3419 margin: 0;
3420 opacity: 0.9;
3421 font-weight: 400;
3422 }
3423
3424 .ays-survey-progress-banner-main .ays-survey-progress-banner-coupon {
3425 margin-bottom: 5px;
3426 }
3427
3428 .ays-survey-progress-banner-main .ays-survey-progress-banner-coupon-box {
3429 border: 2px dotted rgba(255, 255, 255, 0.6);
3430 padding: 8px 16px;
3431 border-radius: 8px;
3432 background: rgba(255, 255, 255, 0.1);
3433 cursor: pointer;
3434 transition: all 0.3s ease;
3435 display: flex;
3436 align-items: center;
3437 gap: 8px;
3438 backdrop-filter: blur(10px);
3439 }
3440
3441 .ays-survey-progress-banner-main .ays-survey-progress-banner-coupon-box:hover {
3442 background: rgba(255, 255, 255, 0.2);
3443 border-color: rgba(255, 255, 255, 0.8);
3444 transform: translateY(-1px);
3445 }
3446
3447 .ays-survey-progress-banner-main .ays-survey-progress-banner-coupon-text {
3448 font-size: 16px;
3449 font-weight: 700;
3450 letter-spacing: 1px;
3451 color: #fff;
3452 font-family: monospace;
3453 }
3454
3455 .ays-survey-progress-banner-main .ays-survey-progress-banner-copy-icon {
3456 opacity: 0.8;
3457 transition: opacity 0.3s ease;
3458 }
3459
3460 .ays-survey-progress-banner-main .ays-survey-progress-banner-coupon-box:hover .ays-survey-progress-banner-copy-icon {
3461 opacity: 1;
3462 }
3463
3464 .ays-survey-progress-banner-main .ays-survey-progress-banner-progress {
3465 text-align: center;
3466 width: 100%;
3467 }
3468
3469 .ays-survey-progress-banner-main .ays-survey-progress-banner-progress-text {
3470 font-size: 14px;
3471 margin: 0 0 10px 0;
3472 opacity: 0.9;
3473 }
3474
3475 .ays-survey-progress-banner-main .ays-survey-progress-banner-progress-bar {
3476 width: 300px;
3477 height: 10px;
3478 background: rgba(255, 255, 255, 0.2);
3479 border-radius: 4px;
3480 overflow: hidden;
3481 margin: 0 auto;
3482 }
3483
3484 .ays-survey-progress-banner-main .ays-survey-progress-banner-progress-fill {
3485 height: 100%;
3486 background: linear-gradient(90deg, #4ADE80 0%, #22C55E 100%);
3487 border-radius: 4px;
3488 transition: width 0.8s ease;
3489 width: 70%;
3490 }
3491
3492 .ays-survey-progress-banner-main .ays-survey-progress-banner-upgrade {
3493 background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
3494 color: white;
3495 border: none;
3496 padding: 12px 24px;
3497 border-radius: 8px;
3498 font-size: 16px;
3499 font-weight: 600;
3500 cursor: pointer;
3501 transition: all 0.3s ease;
3502 box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
3503 text-decoration: none;
3504 display: inline-flex;
3505 align-items: center;
3506 gap: 8px;
3507 }
3508
3509 .ays-survey-progress-banner-main .ays-survey-progress-banner-upgrade:hover {
3510 transform: translateY(-2px);
3511 box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
3512 text-decoration: none;
3513 color: white;
3514 }
3515
3516 .ays-survey-progress-banner-main .notice-dismiss:before {
3517 color: #fff;
3518 }
3519
3520 /* Copy notification */
3521 .ays-survey-copy-notification {
3522 position: fixed;
3523 top: 50%;
3524 left: 50%;
3525 transform: translate(-50%, -50%);
3526 background: rgba(0, 0, 0, 0.8);
3527 color: white;
3528 padding: 12px 24px;
3529 border-radius: 8px;
3530 font-size: 14px;
3531 z-index: 10000;
3532 opacity: 0;
3533 transition: opacity 0.3s ease;
3534 }
3535
3536 .ays-survey-copy-notification.show {
3537 opacity: 1;
3538 }
3539
3540 @media (max-width: 1400px) {
3541 .ays-survey-progress-banner-main .ays-survey-progress-banner-center {
3542 flex-direction: column;
3543 }
3544 }
3545
3546 @media (max-width: 1200px) {
3547 .ays-survey-progress-banner-main .ays-survey-progress-banner-content {
3548 flex-direction: column;
3549 gap: 20px;
3550 }
3551
3552 .ays-survey-progress-banner-main .ays-survey-progress-banner-left {
3553 width: 100%;
3554 justify-content: center;
3555 text-align: center;
3556 flex-direction: column;
3557 }
3558
3559 .ays-survey-progress-banner-main .ays-survey-progress-banner-center {
3560 width: 100%;
3561 }
3562
3563 .ays-survey-progress-banner-main .ays-survey-progress-banner-right {
3564 width: 100%;
3565 justify-content: center;
3566 }
3567 }
3568
3569 @media (max-width: 768px) {
3570 #ays-survey-progress-banner-main {
3571 display: none !important;
3572 }
3573
3574 .ays-survey-progress-banner-main {
3575 padding: 15px 20px;
3576 margin: 15px 0;
3577 }
3578
3579 .ays-survey-progress-banner-main .ays-survey-progress-banner-title {
3580 font-size: 18px;
3581 }
3582
3583 .ays-survey-progress-banner-main .ays-survey-progress-banner-subtitle {
3584 font-size: 14px;
3585 }
3586
3587 .ays-survey-progress-banner-main .ays-survey-progress-banner-progress-bar {
3588 width: 100%;
3589 max-width: 280px;
3590 }
3591
3592 .ays-survey-progress-banner-main .ays-survey-progress-banner-upgrade {
3593 padding: 10px 20px;
3594 font-size: 14px;
3595 }
3596 }
3597
3598 @media (max-width: 480px) {
3599 .ays-survey-progress-banner-main {
3600 padding: 12px 15px;
3601 }
3602
3603 .ays-survey-progress-banner-main .ays-survey-progress-banner-coupon-text {
3604 font-size: 14px;
3605 }
3606
3607 .ays-survey-progress-banner-main .ays-survey-progress-banner-progress-bar {
3608 max-width: 250px;
3609 }
3610 }
3611 ';
3612
3613 $content[] = '</style>';
3614
3615 $content = implode( '', $content );
3616 echo ($content);
3617 }
3618 }
3619
3620 public function ays_survey_new_mega_bundle_message($ishmar){
3621 if($ishmar == 0 ){
3622 $content = array();
3623 $content[] = '<div id="ays-survey-new-mega-bundle-dicount-month-main" class="ays-survey-admin-notice notice notice-success is-dismissible ays_survey_dicount_info">';
3624 $content[] = '<div id="ays-survey-dicount-month" class="ays_survey_dicount_month">';
3625
3626 $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-text-box">';
3627
3628 $content[] = '<div class="ays-survey-dicount-wrap-text-box-texts">';
3629 $content[] = '<div>
3630 <a href="https://ays-pro.com/mega-bundle?utm_source=survey-maker-free&utm_medium=dashboard&utm_campaign=survey-mega-bundle-'.SURVEY_MAKER_VERSION.'" target="_blank" style="color:#ffffff; text-decoration: underline;">Mega Bundle </a> (Quiz + Survey + Poll)
3631 </div>
3632 <div style="position: relative;">
3633 <span class="ays-survey-sale-baner-mega-bundle-sale-text">50%</span>
3634 <img style="position: absolute;top: 30px;left: 0;" src="' . esc_attr(SURVEY_MAKER_ADMIN_URL) . '/images/icons/line.webp">
3635 </div>';
3636 $content[] = '</div>';
3637
3638 $content[] = '<div style="font-size: 17px; display: flex; align-items: center; margin-top: 10px;">';
3639 $content[] = '<img style="width: 30px;height: 25px;" src="' . esc_attr(SURVEY_MAKER_ADMIN_URL) . '/images/icons/guaranteeicon.webp">';
3640 $content[] = '<span style="padding-left: 8px"> 30 Day Money Back Guarantee</span>';
3641
3642 $content[] = '</div>';
3643
3644
3645
3646 $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form">';
3647
3648 $content[] = '<form action="" method="POST">';
3649 $content[] = '<div id="ays-survey-dismiss-buttons-content">';
3650 if( current_user_can( 'manage_options' ) ){
3651 $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>';
3652 $content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' );
3653 }
3654 $content[] = '</div>';
3655 $content[] = '</form>';
3656
3657 $content[] = '</div>';
3658
3659 $content[] = '</div>';
3660
3661 $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-countdown-box">';
3662
3663 $content[] = '<div id="ays-survey-maker-countdown-main-container">';
3664 $content[] = '<div class="ays-survey-maker-countdown-container">';
3665
3666 $content[] = '<div id="ays-survey-countdown">';
3667
3668 // $content[] = '<div>';
3669 // $content[] = __( "Offer ends in:", "survey-maker" );
3670 // $content[] = '</div>';
3671
3672 $content[] = '<ul>';
3673 $content[] = '<li><span id="ays-survey-countdown-days"></span>days</li>';
3674 $content[] = '<li><span id="ays-survey-countdown-hours"></span>Hours</li>';
3675 $content[] = '<li><span id="ays-survey-countdown-minutes"></span>Minutes</li>';
3676 $content[] = '<li><span id="ays-survey-countdown-seconds"></span>Seconds</li>';
3677 $content[] = '</ul>';
3678 $content[] = '</div>';
3679
3680 $content[] = '<div id="ays-survey-countdown-content" class="emoji">';
3681 $content[] = '<span>🚀</span>';
3682 $content[] = '<span>⌛</span>';
3683 $content[] = '<span>🔥</span>';
3684 $content[] = '<span>💣</span>';
3685 $content[] = '</div>';
3686
3687 $content[] = '</div>';
3688 $content[] = '</div>';
3689
3690 $content[] = '</div>';
3691
3692 $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-button-box">';
3693 $content[] = '<a href="https://ays-pro.com/mega-bundle?utm_source=survey-maker-free&utm_medium=dashboard&utm_campaign=survey-mega-bundle-'.SURVEY_MAKER_VERSION.'" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now !', "survey-maker" ) . '</a>';
3694 $content[] = '<span >One-time payment</span>';
3695 $content[] = '</div>';
3696 $content[] = '</div>';
3697 $content[] = '</div>';
3698
3699 $new_mega_bundle_logo_background = SURVEY_MAKER_ADMIN_URL . '/images/new-mega-bundle-logo-background.svg';
3700
3701 $content[] = '<style id="ays-survey-new-mega-bundle-styles-inline-css">';
3702 $content[] = '#ays-survey-maker-countdown-main-container li span,#ays-survey-new-mega-bundle-dicount-month-main #ays-button-top-buy-now,#ays-survey-new-mega-bundle-dicount-month-main #ays-survey-dismiss-buttons-content,#ays-survey-new-mega-bundle-dicount-month-main .ays-buy-now-opacity-button,#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-buy-now-button-box,#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-button-box,#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box,#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-sale-banner-link,#ays-survey-new-mega-bundle-dicount-month-main .ays_survey_dicount_month,div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info button{display:flex;display:flex;display:flex;display:flex}div#ays-survey-new-mega-bundle-dicount-month-main{border:0;background:#fff;border-radius:20px;box-shadow:unset;position:relative;z-index:1;min-height:80px}div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info button{align-items:center}div#ays-survey-new-mega-bundle-dicount-month-main div#ays-survey-dicount-month a.ays-survey-sale-banner-link:focus{outline:0;box-shadow:0}div#ays-survey-new-mega-bundle-dicount-month-main .btn-link{color:#007bff;background-color:transparent;display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem}div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info{background-image:url("'.$new_mega_bundle_logo_background.'");background-position:center;background-repeat:no-repeat;background-size:cover;background-color:#5551ff}#ays-survey-new-mega-bundle-dicount-month-main .ays_survey_dicount_month{align-items:center;justify-content:space-between;color:#fff}#ays-survey-new-mega-bundle-dicount-month-main .ays_survey_dicount_month img{width:80px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-sale-banner-link{justify-content:center;align-items:center;width:200px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box{font-size:14px;padding:12px;text-align:center}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{text-align:left;width:400px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:40%;justify-content:flex-start;align-items:center}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-button-box{justify-content:center;align-items:center;flex-direction:column}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-button-box span{font-size:10px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-survey-dicount-wrap-text-box-texts{font-size:17px;font-weight:700;letter-spacing:.8px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-color{color:#971821}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-text-decoration{text-decoration:underline}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-buy-now-button-box{justify-content:flex-end;align-items:center;width:30%}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-button,#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-buy-now-button{align-items:center;font-weight:500}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-buy-now-button{background:#971821;border-color:#fff;display:flex;justify-content:center;align-items:center;padding:5px 15px;font-size:16px;border-radius:5px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-buy-now-button:hover{background:#7d161d;border-color:#971821}#ays-survey-new-mega-bundle-dicount-month-main #ays-survey-dismiss-buttons-content{justify-content:center}#ays-survey-new-mega-bundle-dicount-month-main #ays-survey-dismiss-buttons-content .ays-button{margin:0!important;font-size:13px;color:#fff}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-opacity-box{width:19%}#ays-survey-new-mega-bundle-dicount-month-main .ays-buy-now-opacity-button{padding:40px 15px;justify-content:center;align-items:center;opacity:0}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li{position:relative}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li span:after{content:":";color:#fff;position:absolute;top:10px;right:-5px;font-size:40px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li span#ays-survey-countdown-seconds:after{content:unset}#ays-survey-new-mega-bundle-dicount-month-main #ays-button-top-buy-now{align-items:center;border-radius:6.409px;background:#f66123;padding:12px 32px;color:#fff;font-size:12.818px;font-style:normal;font-weight:800;line-height:normal}#ays-survey-maker-countdown-main-container li,#ays-survey-maker-countdown-main-container ul,#ays-survey-new-mega-bundle-dicount-month-main .button.ays-button{margin:0}div#ays-survey-new-mega-bundle-dicount-month-main button.notice-dismiss:before{color:#fff}@media all and (max-width:1024px){#ays-survey-new-mega-bundle-dicount-month-main{display:none!important}}@media all and (max-width:768px){div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info.notice{display:none!important;background-position:center;background-repeat:no-repeat;background-size:cover}div#ays-survey-new-mega-bundle-dicount-month-main{padding-right:0}div#ays-survey-new-mega-bundle-dicount-month-main .ays_survey_dicount_month{display:flex;align-items:center;justify-content:space-between;align-content:center;flex-wrap:wrap;flex-direction:column;padding:10px 0}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box,div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{width:100%;text-align:center}#ays-survey-maker-countdown-main-container #ays-survey-countdown-headline{font-size:15px;font-weight:600}#ays-survey-maker-countdown-main-container ul{font-weight:500}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:100%;display:flex;justify-content:center;align-items:center}#ays-survey-new-mega-bundle-dicount-month-main .ays-button{margin:0 auto!important}#ays-survey-new-mega-bundle-dicount-month-main #ays-survey-dismiss-buttons-content .ays-button{padding-left:unset!important}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-buy-now-button-box{justify-content:center}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-buy-now-button{font-size:14px;padding:5px 10px}div#ays-survey-new-mega-bundle-dicount-month-main .ays-buy-now-opacity-button{display:none}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dismiss-buttons-container-for-form{position:static!important}.comparison .product img{width:70px}.comparison a.price-buy{padding:5px 10px;font-size:11px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-survey-dicount-wrap-text-box-texts{height:64px}#ays-survey-maker-countdown-main-container .ays-survey-maker-countdown-container #ays-survey-countdown>ul{display:flex;justify-content:center;align-items:center}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li span:after{top:unset}#ays-survey-maker-countdown-main-container li{font-size:12px;padding:12px}#ays-survey-maker-countdown-main-container li span{font-size:26px;min-height:50px;min-width:50px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-button-box{width:100%}}@media screen and (max-width:1305px) and (min-width:768px){div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info.notice{background-position:bottom right;background-repeat:no-repeat;background-size:cover}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-survey-dicount-wrap-text-box-texts{font-size:15px}#ays-survey-maker-countdown-main-container li{font-size:11px}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-opacity-box{display:none}}@media screen and (max-width:436px){#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-survey-dicount-wrap-text-box-texts{height:110px;margin-bottom:25px}}#ays-survey-maker-countdown-main-container .ays-survey-maker-countdown-container{color:#fff;margin:0 auto;text-align:center}#ays-survey-maker-countdown-main-container li span{justify-content:center;align-items:center;background:#9896ed;justify-content:center;align-items:center;font-size:23px;height:56px;width:53px;border-radius:8px;border:.534px solid #f4f4f4;color:#fff}#ays-survey-maker-countdown-main-container #ays-survey-countdown-headline{letter-spacing:.125rem;text-transform:uppercase;font-size:18px;font-weight:400;margin:0;padding:9px 0 4px;line-height:1.3}#ays-survey-maker-countdown-main-container li{display:inline-block;font-size:14px;list-style-type:none;padding:14px;text-transform:capitalize;text-align:center;margin:auto}#ays-survey-maker-countdown-main-container .emoji{display:none;padding:1rem}#ays-survey-maker-countdown-main-container .emoji span{font-size:30px;padding:0 .5rem} .ays-survey-dicount-wrap-text-box-texts{font-size:17px;letter-spacing:.8px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-wrap:wrap}.ays-survey-sale-baner-mega-bundle-sale-text{font-size:23px;padding-left:5px;text-shadow:2px 1.3px 0 #f66123;-webkit-text-stroke-width:1px;-webkit-text-stroke-color:#4944FF;-moz-text-stroke-width:1px;-moz-text-stroke-color:#4944FF}';
3703 $content[] = '</style>';
3704
3705
3706 $content = implode( '', $content );
3707 echo html_entity_decode(esc_html( $content ));
3708 }
3709 }
3710
3711 // Survey Footer Blue Banner Sale 20%
3712 public function ays_survey_footer_sale_banner_2026($ishmar){
3713 if($ishmar == 0 ){
3714 $content = array();
3715
3716 $survey_cta_button_link = esc_url('https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=private-offer-20-off-' . SURVEY_MAKER_VERSION);
3717
3718 $content[] = '
3719 <div class="ays-survey-footer-banner-bottom-banner-wrapper" style="display: none;">
3720 <div class="ays-survey-footer-banner-bottom-banner-container">
3721 <div class="ays-survey-footer-banner-bottom-banner-content">
3722 <div class="ays-survey-footer-banner-bottom-banner-inner">
3723 <div class="ays-survey-footer-banner-bottom-banner-left">
3724 <div class="ays-survey-footer-banner-bottom-banner-icon">
3725 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
3726 <path d="M12 7v14"></path>
3727 <path d="M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8"></path>
3728 <path d="M7.5 7a1 1 0 0 1 0-5A4.8 8 0 0 1 12 7a4.8 8 0 0 1 4.5-5 1 1 0 0 1 0 5"></path>
3729 <rect x="3" y="7" width="18" height="4" rx="1"></rect>
3730 </svg>
3731 </div>
3732 <span class="ays-survey-footer-banner-bottom-banner-title">'. esc_html__('Survey Maker by AYS', 'survey-maker') .'</span>
3733 </div>
3734 <span class="ays-survey-footer-banner-bottom-banner-separator"></span>
3735 <span class="ays-survey-footer-banner-bottom-banner-discount">'. esc_html__('20% Off', 'survey-maker') .'</span>
3736 <div class="ays-survey-footer-banner-bottom-banner-code" onclick="aysSurveyFooterBannerCopyToClipboard()" title="'. esc_html__('Copy Coupon Code', 'survey-maker') .'">
3737 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
3738 <path d="M2 9a3 3 0 0 1 0 6v2a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-2a3 3 0 0 1 0-6V7a2 2 0 0 0-2-2H4a2 2 0 0 0-2 2Z"></path>
3739 <path d="M13 5v2"></path>
3740 <path d="M13 17v2"></path>
3741 <path d="M13 11v2"></path>
3742 </svg>
3743 <span>SURVEYPRO20</span>
3744 <button type="button" class="ays-survey-footer-banner-bottom-banner-copy" aria-label="'. esc_html__('Copy Coupon Code', 'survey-maker') .'">
3745 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
3746 <rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect>
3747 <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>
3748 </svg>
3749 </button>
3750 </div>
3751 <button type="button" class="ays-survey-footer-banner-bottom-banner-cta">
3752 '. esc_html__('Get Deal', 'survey-maker') .'
3753 </button>
3754 <button type="button" class="ays-survey-footer-banner-bottom-banner-close" aria-label="'. esc_html__('Close popup', 'survey-maker') .'">
3755 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2.2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true">
3756 <path d="M18 6 6 18"></path>
3757 <path d="m6 6 12 12"></path>
3758 </svg>
3759 </button>
3760 </div>
3761 </div>
3762 </div>
3763 </div>';
3764
3765 $content[] = '<style id="ays-survey-progress-banner-styles-inline-css">';
3766
3767 $content[] = '@keyframes ays-pro-slide-up{0%{opacity:0;transform:translateY(24px)}100%{opacity:1;transform:translateY(0)}}@keyframes ays-pro-slide-down{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(24px)}}.ays-survey-footer-banner-bottom-banner-wrapper{position:fixed;bottom:0;left:0;right:0;z-index:9999;padding:0 16px 28px;text-align:center;animation:.45s cubic-bezier(.16,1,.3,1) forwards ays-pro-slide-up}.ays-survey-footer-banner-bottom-banner-wrapper.ays-pro-banner-closing{animation:.32s cubic-bezier(.16,1,.3,1) forwards ays-pro-slide-down}.ays-survey-footer-banner-bottom-banner-container{display:inline-block;max-width:100%;border-radius:16px;background:linear-gradient(90deg,#2f6bff 0,#3e7bff 100%);box-shadow:0 20px 40px -15px rgba(47,107,255,.55),0 8px 20px -10px rgba(47,107,255,.35);overflow:hidden}.ays-survey-footer-banner-bottom-banner-code,.ays-survey-footer-banner-bottom-banner-content,.ays-survey-footer-banner-bottom-banner-inner,.ays-survey-footer-banner-bottom-banner-left{display:flex;align-items:center}.ays-survey-footer-banner-bottom-banner-inner{gap:16px;padding:8px 14px 8px 10px;color:#fff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif}.ays-survey-footer-banner-bottom-banner-left{gap:14px}.ays-survey-footer-banner-bottom-banner-icon{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:48px;height:48px;border-radius:50%;background:rgba(255,255,255,.15);color:#fff}.ays-survey-footer-banner-bottom-banner-icon svg{width:24px;height:24px}.ays-survey-footer-banner-bottom-banner-discount,.ays-survey-footer-banner-bottom-banner-title{font-size:17px;font-weight:600;line-height:1.25;letter-spacing:0;white-space:nowrap;color:#fff}.ays-survey-footer-banner-bottom-banner-separator{display:block;width:1px;height:24px;background:rgba(255,255,255,.4)}.ays-survey-footer-banner-bottom-banner-code{gap:6px;border:1px dashed rgba(255,255,255,.7);border-radius:999px;padding:6px 9px;color:#fff;cursor:pointer;transition:background-color .15s,border-color .15s}.ays-survey-footer-banner-bottom-banner-code:hover{background:rgba(255,255,255,.1);border-color:#fff}.ays-survey-footer-banner-bottom-banner-code button svg,.ays-survey-footer-banner-bottom-banner-code>svg{width:16px;height:16px}.ays-survey-footer-banner-bottom-banner-code span{font-size:14px;font-weight:600;line-height:1;letter-spacing:.05em;color:#fff}.ays-survey-footer-banner-bottom-banner-close,.ays-survey-footer-banner-bottom-banner-copy{display:flex;align-items:center;justify-content:center;margin:0;padding:0;background:0 0;border:0;color:rgba(255,255,255,.9);cursor:pointer;box-shadow:none;transition:color .15s,background-color .15s}.ays-survey-footer-banner-bottom-banner-close:hover,.ays-survey-footer-banner-bottom-banner-copy:hover{color:#fff;background:0 0}.ays-survey-footer-banner-bottom-banner-wrapper .ays-survey-footer-banner-bottom-banner-cta{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:8px 20px;border:0;border-radius:999px;background:#fff;color:#2f6bff;font-size:15px;font-weight:600;line-height:1;white-space:nowrap;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.08);transition:background-color .15s,transform .15s}.ays-survey-footer-banner-bottom-banner-wrapper .ays-survey-footer-banner-bottom-banner-cta:hover{background:rgba(255,255,255,.95);color:#2f6bff;transform:translateY(-1px)}.ays-survey-footer-banner-bottom-banner-close{width:22px;height:22px;margin-left:2px}.ays-survey-footer-banner-bottom-banner-close svg{width:20px;height:20px}.ays-survey-footer-banner-copy-notification{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:rgba(0,0,0,.8);color:#fff;padding:12px 24px;border-radius:8px;font-size:14px;z-index:10000;opacity:0;transition:opacity .3s}.ays-survey-footer-banner-copy-notification.show{opacity:1}@media (max-width:768px){.ays-survey-footer-banner-bottom-banner-wrapper{display:none}}';
3768 $content[] = '</style>';
3769
3770 $content[] = '<script>';
3771
3772 $content[] = "
3773 /**
3774 * Footer Banner JavaScript - ES5 Compatible
3775 * With delayed popup and visit tracking
3776 */
3777
3778 (function() {
3779 'use strict';
3780
3781 // Configuration
3782 var STORAGE_KEY = 'ays_survey_footer_banner_data';
3783 var POPUP_RULES = [
3784 { visit: 1, delay: 10000 }, // 1st visit: 10 seconds
3785 { visit: 2, delay: 10000 }, // 2nd visit: 10 seconds
3786 { visit: 3, delay: 15000 }, // 3th visit: 15 seconds
3787 { visit: 4, delay: 15000 }, // 4th visit: 15 seconds
3788 { visit: 5, delay: 20000 }, // 5th visit: 20 seconds
3789 { visit: 7, delay: 20000 }, // 7th visit: 20 seconds
3790 { visit: 10, delay: 30000 } // 10th visit: 30 seconds
3791 ];
3792 var MAX_SHOWS_PER_DAY = 7;
3793
3794 // Wait for DOM to be ready
3795 if (document.readyState === 'loading') {
3796 document.addEventListener('DOMContentLoaded', initBanner);
3797 } else {
3798 initBanner();
3799 }
3800
3801 function initBanner() {
3802 var banner = document.querySelector('.ays-survey-footer-banner-bottom-banner-wrapper');
3803 var closeButton = document.querySelector('.ays-survey-footer-banner-bottom-banner-close');
3804 var ctaButton = document.querySelector('.ays-survey-footer-banner-bottom-banner-cta');
3805
3806 if (!banner) {
3807 return;
3808 }
3809
3810 // Hide banner initially
3811 banner.style.display = 'none';
3812
3813 // Get or initialize banner data
3814 var bannerData = getBannerData();
3815
3816 // Check if we need to reset daily data
3817 if (shouldResetData(bannerData.lastResetDate)) {
3818 bannerData = resetDailyData();
3819 }
3820
3821 // Increment visit count
3822 bannerData.visitCount++;
3823 saveBannerData(bannerData);
3824
3825 // Check if banner should be shown
3826 var shouldShow = shouldShowBanner(bannerData);
3827
3828 if (shouldShow.show) {
3829 // Show banner after delay
3830 setTimeout(function() {
3831 banner.style.display = 'block';
3832
3833 // Increment show count
3834 bannerData.showCount++;
3835 saveBannerData(bannerData);
3836 }, shouldShow.delay);
3837 }
3838
3839 // Close button handler
3840 if (closeButton) {
3841 closeButton.addEventListener('click', function() {
3842 closeBanner(banner);
3843 });
3844 }
3845
3846 // CTA button handler
3847 if (ctaButton) {
3848 ctaButton.addEventListener('click', function() {
3849 window.open('https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=private-offer-20-off-". SURVEY_MAKER_VERSION ."', '_blank');
3850 // Optionally close banner after click
3851 closeBanner(banner);
3852 });
3853 }
3854 }
3855
3856 /**
3857 * Get banner data from localStorage
3858 */
3859 function getBannerData() {
3860 try {
3861 var data = localStorage.getItem(STORAGE_KEY);
3862 if (data) {
3863 return JSON.parse(data);
3864 }
3865 } catch (e) {
3866 // localStorage not available or parsing error
3867 }
3868
3869 // Return default data
3870 return {
3871 visitCount: 0,
3872 showCount: 0,
3873 lastResetDate: getTodayDate()
3874 };
3875 }
3876
3877 /**
3878 * Save banner data to localStorage
3879 */
3880 function saveBannerData(data) {
3881 try {
3882 localStorage.setItem(STORAGE_KEY, JSON.stringify(data));
3883 } catch (e) {
3884 // localStorage not available
3885 }
3886 }
3887
3888 /**
3889 * Check if data should be reset (new day)
3890 */
3891 function shouldResetData(lastResetDate) {
3892 var today = getTodayDate();
3893 return lastResetDate !== today;
3894 }
3895
3896 /**
3897 * Reset daily data
3898 */
3899 function resetDailyData() {
3900 var newData = {
3901 visitCount: 0,
3902 showCount: 0,
3903 lastResetDate: getTodayDate()
3904 };
3905 saveBannerData(newData);
3906 return newData;
3907 }
3908
3909 /**
3910 * Get today's date as string (YYYY-MM-DD)
3911 */
3912 function getTodayDate() {
3913 var date = new Date();
3914 var year = date.getFullYear();
3915 var month = String(date.getMonth() + 1).padStart(2, '0');
3916 var day = String(date.getDate()).padStart(2, '0');
3917 return year + '-' + month + '-' + day;
3918 }
3919
3920 /**
3921 * Check if banner should be shown based on rules
3922 */
3923 function shouldShowBanner(bannerData) {
3924 // Check if already shown max times today
3925 if (bannerData.showCount >= MAX_SHOWS_PER_DAY) {
3926 return { show: false, delay: 0 };
3927 }
3928
3929 // Check visit count against rules
3930 for (var i = 0; i < POPUP_RULES.length; i++) {
3931 var rule = POPUP_RULES[i];
3932 if (bannerData.visitCount === rule.visit) {
3933 return { show: true, delay: rule.delay };
3934 }
3935 }
3936
3937 return { show: false, delay: 0 };
3938 }
3939
3940 /**
3941 * Close banner with animation
3942 */
3943 function closeBanner(banner) {
3944 if (!banner) {
3945 return;
3946 }
3947
3948 // Add closing animation class
3949 banner.classList.add('ays-pro-banner-closing');
3950
3951 // Wait for animation to complete
3952 setTimeout(function() {
3953 banner.style.display = 'none';
3954 }, 400);
3955 }
3956
3957 // Polyfill for String.padStart (for older browsers)
3958 if (!String.prototype.padStart) {
3959 String.prototype.padStart = function(targetLength, padString) {
3960 targetLength = targetLength >> 0;
3961 padString = String(typeof padString !== 'undefined' ? padString : ' ');
3962 if (this.length >= targetLength) {
3963 return String(this);
3964 } else {
3965 targetLength = targetLength - this.length;
3966 if (targetLength > padString.length) {
3967 padString += padString.repeat(targetLength / padString.length);
3968 }
3969 return padString.slice(0, targetLength) + String(this);
3970 }
3971 };
3972 }
3973 })();
3974
3975 function aysSurveyFooterBannerCopyToClipboard() {
3976 var textarea = document.createElement('textarea');
3977 textarea.value = 'SURVEYPRO20';
3978 textarea.style.position = 'fixed';
3979 textarea.style.opacity = '0';
3980 document.body.appendChild(textarea);
3981
3982 textarea.select();
3983 textarea.setSelectionRange(0, 99999);
3984
3985 try {
3986 document.execCommand('copy');
3987 aysSurveyFooterBannerShowCopyNotification('". esc_html__('Coupon code copied', 'survey-maker') ."');
3988 } catch (err) {
3989 console.error('Failed to copy text: ', err);
3990 }
3991
3992 document.body.removeChild(textarea);
3993 }
3994
3995 function aysSurveyFooterBannerShowCopyNotification(message) {
3996 var existingNotification = document.querySelector('.ays-survey-footer-banner-copy-notification');
3997 if (existingNotification) {
3998 document.body.removeChild(existingNotification);
3999 }
4000
4001 var notification = document.createElement('div');
4002 notification.className = 'ays-survey-footer-banner-copy-notification';
4003 notification.textContent = message;
4004 document.body.appendChild(notification);
4005
4006 setTimeout(function() {
4007 notification.classList.add('show');
4008 }, 10);
4009
4010 setTimeout(function() {
4011 notification.classList.remove('show');
4012 setTimeout(function() {
4013 if (notification.parentNode) {
4014 document.body.removeChild(notification);
4015 }
4016 }, 300);
4017 }, 2000);
4018 }";
4019
4020 $content[] = '</script>';
4021
4022 $content = implode( '', $content );
4023 echo ($content);
4024 }
4025 }
4026
4027
4028 // public function ays_survey_new_mega_bundle_message_2024($ishmar){
4029 // if($ishmar == 0 ){
4030 // $content = array();
4031 // $content[] = '<div id="ays-survey-new-mega-bundle-dicount-month-main-2024" class="notice notice-success is-dismissible ays_survey_dicount_info">';
4032 // $content[] = '<div id="ays-survey-dicount-month" class="ays_survey_dicount_month">';
4033
4034 // $content[] = '<div class="ays-survey-discount-box-sale-image"></div>';
4035 // $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-text-box">';
4036
4037 // $content[] = '<div class="ays-survey-dicount-wrap-text-box-texts">';
4038 // $content[] = '<div>
4039 // <a href="https://ays-pro.com/mega-bundle?utm_source=survey-maker-free&utm_medium=dashboard&utm_campaign=survey-mega-bundle" target="_blank" style="color:#30499B;">
4040 // <span class="ays-survey-new-mega-bundle-limited-text">Limited</span> Offer for Mega bundle </a> <br>
4041
4042 // <span style="font-size: 19px ;">(Quiz + Survey + Poll)</span>
4043 // </div>';
4044 // $content[] = '</div>';
4045
4046 // $content[] = '<div style="font-size: 17px;">';
4047 // $content[] = '<img style="width: 24px;height: 24px;" src="' . esc_attr(SURVEY_MAKER_ADMIN_URL) . '/images/icons/guarantee-new.png">';
4048 // $content[] = '<span style="padding-left: 4px; font-size: 14px; font-weight: 600;"> 30 Day Money Back Guarantee</span>';
4049
4050 // $content[] = '</div>';
4051
4052
4053
4054 // $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form">';
4055
4056 // $content[] = '<form action="" method="POST">';
4057 // $content[] = '<div id="ays-survey-dismiss-buttons-content">';
4058 // if( current_user_can( 'manage_options' ) ){
4059 // $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0; color: #30499B;
4060 // ">Dismiss ad</button>';
4061 // $content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' );
4062 // }
4063 // $content[] = '</div>';
4064 // $content[] = '</form>';
4065
4066 // $content[] = '</div>';
4067
4068 // $content[] = '</div>';
4069
4070 // $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-countdown-box">';
4071
4072 // $content[] = '<div id="ays-survey-maker-countdown-main-container">';
4073 // $content[] = '<div class="ays-survey-maker-countdown-container">';
4074
4075 // $content[] = '<div id="ays-survey-countdown">';
4076
4077 // $content[] = '<div style="font-weight: 500;">';
4078 // $content[] = __( "Offer ends in:", "survey-maker" );
4079 // $content[] = '</div>';
4080
4081 // $content[] = '<ul>';
4082 // $content[] = '<li><span id="ays-survey-countdown-days"></span>days</li>';
4083 // $content[] = '<li><span id="ays-survey-countdown-hours"></span>Hours</li>';
4084 // $content[] = '<li><span id="ays-survey-countdown-minutes"></span>Minutes</li>';
4085 // $content[] = '<li><span id="ays-survey-countdown-seconds"></span>Seconds</li>';
4086 // $content[] = '</ul>';
4087 // $content[] = '</div>';
4088
4089 // $content[] = '<div id="ays-survey-countdown-content" class="emoji">';
4090 // $content[] = '<span>🚀</span>';
4091 // $content[] = '<span>⌛</span>';
4092 // $content[] = '<span>🔥</span>';
4093 // $content[] = '<span>💣</span>';
4094 // $content[] = '</div>';
4095
4096 // $content[] = '</div>';
4097 // $content[] = '</div>';
4098
4099 // $content[] = '</div>';
4100
4101 // $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-button-box">';
4102 // $content[] = '<a href="https://ays-pro.com/mega-bundle?utm_source=survey-maker-free&utm_medium=dashboard&utm_campaign=survey-mega-bundle" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now !', "survey-maker" ) . '</a>';
4103 // $content[] = '<span >One-time payment</span>';
4104 // $content[] = '</div>';
4105 // $content[] = '</div>';
4106 // $content[] = '</div>';
4107
4108 // $content = implode( '', $content );
4109 // echo html_entity_decode(esc_html( $content ));
4110 // }
4111 // }
4112
4113 // // Black Friday 2024
4114 // public function ays_survey_black_friday_message_2024($ishmar){
4115 // if($ishmar == 0 ){
4116 // $content = array();
4117
4118 // $content[] = '<div id="ays-survey-black-friday-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_survey_dicount_info">';
4119 // $content[] = '<div id="ays-survey-dicount-month" class="ays_survey_dicount_month">';
4120
4121 // $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-countdown-box">';
4122
4123 // $content[] = '<div id="ays-survey-maker-countdown-main-container">';
4124 // $content[] = '<div class="ays-survey-maker-countdown-container">';
4125
4126 // $content[] = '<div id="ays-survey-countdown">';
4127
4128 // $content[] = '<div>';
4129 // $content[] = __( "Offer ends in:", "survey-maker" );
4130 // $content[] = '</div>';
4131
4132 // $content[] = '<ul>';
4133 // $content[] = '<li><span id="ays-survey-countdown-days"></span>'. __( "Days", "survey-maker" ) .'</li>';
4134 // $content[] = '<li><span id="ays-survey-countdown-hours"></span>'. __( "Hours", "survey-maker" ) .'</li>';
4135 // $content[] = '<li><span id="ays-survey-countdown-minutes"></span>'. __( "Minutes", "survey-maker" ) .'</li>';
4136 // $content[] = '<li><span id="ays-survey-countdown-seconds"></span>'. __( "Seconds", "survey-maker" ) .'</li>';
4137 // $content[] = '</ul>';
4138 // $content[] = '</div>';
4139
4140 // $content[] = '<div id="ays-survey-countdown-content" class="emoji">';
4141 // $content[] = '<span>🚀</span>';
4142 // $content[] = '<span>⌛</span>';
4143 // $content[] = '<span>🔥</span>';
4144 // $content[] = '<span>💣</span>';
4145 // $content[] = '</div>';
4146
4147 // $content[] = '</div>';
4148 // $content[] = '</div>';
4149
4150 // $content[] = '</div>';
4151
4152 // $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-text-box">';
4153 // $content[] = '<div>';
4154
4155 // $content[] = '<span class="ays-survey-black-friday-bundle-title">';
4156 // $content[] = __( "<span><a href='https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=black-friday-mega-bundle-sale-banner' class='ays-survey-black-friday-bundle-title-link' target='_blank'>Black Friday Sale</a></span>", "survey-maker" );
4157 // $content[] = '</span>';
4158
4159 // $content[] = '</br>';
4160
4161 // $content[] = '<span class="ays-survey-black-friday-bundle-desc">';
4162 // $content[] = '<a class="ays-survey-black-friday-bundle-desc" href="https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=black-friday-mega-bundle-sale-banner" class="ays-survey-black-friday-bundle-title-link" target="_blank">';
4163 // $content[] = __( "50% OFF", "survey-maker" );
4164 // $content[] = '</a>';
4165 // $content[] = '</span>';
4166 // $content[] = '</div>';
4167
4168 // $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form">';
4169
4170 // $content[] = '<form action="" method="POST">';
4171 // $content[] = '<div id="ays-survey-dismiss-buttons-content">';
4172 // if( current_user_can( 'manage_options' ) ){
4173 // $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_bf_btn" style="height: 32px; margin-left: 0;padding-left: 0">'. __( "Dismiss ad", "survey-maker" ) .'</button>';
4174 // $content[] = wp_nonce_field( 'survey-maker-sale-bf-banner' , 'survey-maker-sale-bf-banner' );
4175 // }
4176 // $content[] = '</div>';
4177 // $content[] = '</form>';
4178
4179 // $content[] = '</div>';
4180
4181 // $content[] = '</div>';
4182
4183 // $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-black-friday-bundle-coupon-text-box">';
4184 // // $content[] = '<div class="ays-survey-black-friday-bundle-coupon-row">';
4185 // // $content[] = 'bfdeal20off';
4186 // // $content[] = '</div>';
4187
4188 // $content[] = '<div class="ays-survey-black-friday-bundle-data-title">';
4189 // $content[] = '<a href="https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=black-friday-mega-bundle-sale-banner" class="ays-survey-black-friday-bundle-data-title-text" target="_blank">';
4190 // $content[] = __( 'MEGA BUNDLE', "survey-maker" );
4191 // $content[] = '</a>';
4192 // $content[] = '</div>';
4193 // $content[] = '</div>';
4194
4195 // $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-button-box">';
4196 // $content[] = '<a href="https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=black-friday-mega-bundle-sale-banner" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Get Your Deal', "survey-maker" ) . '</a>';
4197 // $content[] = '<span class="ays-survey-dicount-one-time-text">';
4198 // $content[] = __( "One-time payment", "survey-maker" );
4199 // $content[] = '</span>';
4200 // $content[] = '</div>';
4201 // $content[] = '</div>';
4202 // $content[] = '</div>';
4203
4204 // $content = implode( '', $content );
4205 // echo $content;
4206 // }
4207 // }
4208
4209 // Christmas Top Banner 2024
4210 // public function ays_survey_christmas_top_message_2024($ishmar){
4211 // if($ishmar == 0 ){
4212 // $content = array();
4213
4214 // $content[] = '<div id="ays-survey-christmas-top-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_survey_dicount_info">';
4215 // $content[] = '<div id="ays-survey-dicount-month" class="ays_survey_dicount_month">';
4216
4217 // $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-countdown-box">';
4218
4219 // $content[] = '<div id="ays-survey-maker-countdown-main-container">';
4220 // $content[] = '<div class="ays-survey-maker-countdown-container">';
4221
4222 // $content[] = '<div id="ays-survey-countdown">';
4223
4224 // $content[] = '<div>';
4225 // $content[] = __( "Offer ends in:", "survey-maker" );
4226 // $content[] = '</div>';
4227
4228 // $content[] = '<ul>';
4229 // $content[] = '<li><span id="ays-survey-countdown-days"></span>'. __( "Days", "survey-maker" ) .'</li>';
4230 // $content[] = '<li><span id="ays-survey-countdown-hours"></span>'. __( "Hours", "survey-maker" ) .'</li>';
4231 // $content[] = '<li><span id="ays-survey-countdown-minutes"></span>'. __( "Minutes", "survey-maker" ) .'</li>';
4232 // $content[] = '<li><span id="ays-survey-countdown-seconds"></span>'. __( "Seconds", "survey-maker" ) .'</li>';
4233 // $content[] = '</ul>';
4234 // $content[] = '</div>';
4235
4236 // $content[] = '<div id="ays-survey-countdown-content" class="emoji">';
4237 // $content[] = '<span>🚀</span>';
4238 // $content[] = '<span>⌛</span>';
4239 // $content[] = '<span>🔥</span>';
4240 // $content[] = '<span>💣</span>';
4241 // $content[] = '</div>';
4242
4243 // $content[] = '</div>';
4244 // $content[] = '</div>';
4245
4246 // $content[] = '</div>';
4247
4248 // $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-text-box">';
4249 // $content[] = '<div>';
4250
4251 // $content[] = '<span class="ays-survey-christmas-top-bundle-title">';
4252 // $content[] = '<span>';
4253 // $content[] = sprintf('<a class="ays-survey-christmas-top-bundle-desc" href="https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=christmas-sale-banner%s" class="ays-survey-christmas-top-bundle-title-link" target="_blank">', SURVEY_MAKER_VERSION);
4254
4255 // $content[] = __( "Christmas Sale", "survey-maker" );
4256 // $content[] = '</a>';
4257 // $content[] = '</span>';
4258 // $content[] = '</br>';
4259
4260 // $content[] = '<span class="ays-survey-christmas-top-bundle-desc">';
4261 // $content[] = sprintf('<a class="ays-survey-christmas-top-bundle-desc" href="https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=christmas-sale-banner%s" class="ays-survey-christmas-top-bundle-title-link" target="_blank">', SURVEY_MAKER_VERSION);
4262 // $content[] = __( "20% Extra OFF", "survey-maker" );
4263 // $content[] = '</a>';
4264 // $content[] = '</span>';
4265 // $content[] = '</div>';
4266
4267 // $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form">';
4268
4269 // $content[] = '<form action="" method="POST">';
4270 // $content[] = '<div id="ays-survey-dismiss-buttons-content">';
4271 // if( current_user_can( 'manage_options' ) ){
4272 // $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">'. __( "Dismiss ad", "survey-maker" ) .'</button>';
4273 // $content[] = wp_nonce_field( "survey-maker" . '-sale-banner' , "survey-maker" . '-sale-banner' );
4274 // }
4275 // $content[] = '</div>';
4276 // $content[] = '</form>';
4277
4278 // $content[] = '</div>';
4279
4280 // $content[] = '</div>';
4281
4282 // $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-christmas-top-bundle-coupon-text-box">';
4283 // $content[] = '<div class="ays-survey-christmas-top-bundle-coupon-row">';
4284 // $content[] = 'xmas20off';
4285 // $content[] = '</div>';
4286
4287 // $content[] = '<div class="ays-survey-christmas-top-bundle-text-row">';
4288 // $content[] = __( '20% Extra Discount Coupon', "survey-maker" );
4289 // $content[] = '</div>';
4290 // $content[] = '</div>';
4291
4292 // $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-button-box">';
4293 // $content[] = sprintf('<a href="https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=christmas-sale-banner%s" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">', SURVEY_MAKER_VERSION);
4294 // $content[] = __( 'Get Your Deal', "survey-maker" );
4295 // $content[] = '</a>';
4296 // $content[] = '<span class="ays-survey-dicount-one-time-text">';
4297 // $content[] = __( "One-time payment", "survey-maker" );
4298 // $content[] = '</span>';
4299 // $content[] = '</div>';
4300 // $content[] = '</div>';
4301 // $content[] = '</div>';
4302
4303 // $content = implode( '', $content );
4304 // echo $content;
4305 // }
4306 // }
4307
4308
4309
4310 // Black Friday
4311 // public function ays_survey_black_friday_message($ishmar){
4312 // if($ishmar == 0 ){
4313 // $content = array();
4314
4315 // $content[] = '<div id="ays-survey-dicount-black-friday-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">';
4316 // $content[] = '<div id="ays-survey-dicount-black-friday-month" class="ays_chart_dicount_month">';
4317 // $content[] = '<div class="ays-survey-dicount-black-friday-box">';
4318 // $content[] = '<div class="ays-survey-dicount-black-friday-wrap-box ays-survey-dicount-black-friday-wrap-box-80" style="width: 70%;">';
4319 // $content[] = '<div class="ays-survey-dicount-black-friday-title-row">' . __( 'Limited Time', "survey-maker" ) .' '. '<a href="https://ays-pro.com/mega-bundle?utm_medium=survey-free&utm_campaign=black-friday-sale-banner&utm_source=dashboard" class="ays-survey-dicount-black-friday-button-sale" target="_blank">' . __( 'Sale', "chart-builder" ) . '</a>' . '</div>';
4320 // $content[] = '<div class="ays-survey-dicount-black-friday-title-row">' . __( 'Mega bundle', "survey-maker" ) . ' (Quiz+Survey+Poll)!</div> ';
4321 // $content[] = '</div>';
4322
4323 // $content[] = '<div class="ays-survey-dicount-black-friday-wrap-box ays-survey-dicount-black-friday-wrap-text-box">';
4324 // $content[] = '<div class="ays-survey-dicount-black-friday-text-row">' . __( '50% off', "survey-maker" ) . '</div>';
4325 // $content[] = '</div>';
4326
4327 // $content[] = '<div class="ays-survey-dicount-black-friday-wrap-box" style="width: 25%;">';
4328 // $content[] = '<div id="ays-survey-countdown-main-container">';
4329 // $content[] = '<div class="ays-survey-countdown-container">';
4330 // $content[] = '<div id="ays-survey-countdown" style="display: block;">';
4331 // $content[] = '<ul>';
4332 // $content[] = '<li><span id="ays-survey-countdown-days">0</span>' . __( 'Days', "survey-maker" ) . '</li>';
4333 // $content[] = '<li><span id="ays-survey-countdown-hours">0</span>' . __( 'Hours', "survey-maker" ) . '</li>';
4334 // $content[] = '<li><span id="ays-survey-countdown-minutes">0</span>' . __( 'Minutes', "survey-maker" ) . '</li>';
4335 // $content[] = '<li><span id="ays-survey-countdown-seconds">0</span>' . __( 'Seconds', "survey-maker" ) . '</li>';
4336 // $content[] = '</ul>';
4337 // $content[] = '</div>';
4338 // $content[] = '<div id="ays-survey-countdown-content" class="emoji" style="display: none;">';
4339 // $content[] = '<span>🚀</span>';
4340 // $content[] = '<span>⌛</span>';
4341 // $content[] = '<span>🔥</span>';
4342 // $content[] = '<span>💣</span>';
4343 // $content[] = '</div>';
4344 // $content[] = '</div>';
4345 // $content[] = '</div>';
4346 // $content[] = '</div>';
4347
4348 // $content[] = '<div class="ays-survey-dicount-black-friday-wrap-box" style="width: 25%;">';
4349 // $content[] = '<a href="https://ays-pro.com/mega-bundle?utm_medium=survey-free&utm_campaign=black-friday-sale-banner&utm_source=dashboard" class="ays-survey-dicount-black-friday-button-buy-now" target="_blank">' . __( 'Get Your Deal', "survey-maker" ) . '</a>';
4350 // $content[] = '</div>';
4351 // $content[] = '</div>';
4352 // $content[] = '</div>';
4353
4354 // $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form-black-friday">';
4355 // $content[] = '<form action="" method="POST">';
4356 // $content[] = '<div id="ays-survey-dismiss-buttons-content">';
4357 // if( current_user_can( 'manage_options' ) ){
4358 // $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>';
4359 // $content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' );
4360 // }
4361 // $content[] = '</div>';
4362 // $content[] = '</form>';
4363 // $content[] = '</div>';
4364 // $content[] = '</div>';
4365
4366 // $content = implode( '', $content );
4367
4368 // echo $content;
4369 // }
4370 // }
4371
4372 // Christmas banner
4373 // public static function ays_survey_christmas_message($ishmar){
4374 // if($ishmar == 0 ){
4375 // $content = array();
4376
4377 // $content[] = '<div id="ays-survey-dicount-christmas-month-main" class="notice notice-success is-dismissible ays_survey_dicount_info">';
4378 // $content[] = '<div id="ays-survey-dicount-christmas-month" class="ays_survey_dicount_month">';
4379 // $content[] = '<div class="ays-survey-dicount-christmas-box">';
4380 // $content[] = '<div class="ays-survey-dicount-christmas-wrap-box ays-survey-dicount-christmas-wrap-box-80">';
4381 // $content[] = '<div class="ays-survey-dicount-christmas-title-row">' . __( 'Limited Time', "survey-maker" ) .' '. '<a href="https://ays-pro.com/wordpress/survey-maker" class="ays-survey-dicount-christmas-button-sale" target="_blank">20%</a>' . ' SALE</div>';
4382 // $content[] = '<div class="ays-survey-dicount-christmas-title-row">' . __( 'Survey Maker Plugin', "survey-maker" ) . '</div>';
4383 // $content[] = '</div>';
4384
4385 // $content[] = '<div class="ays-survey-dicount-christmas-wrap-box" style="width: 25%;">';
4386 // $content[] = '<div id="ays-survey-maker-countdown-main-container">';
4387 // $content[] = '<div class="ays-survey-countdown-container">';
4388 // $content[] = '<div id="ays-survey-countdown" style="display: block;">';
4389 // $content[] = '<ul>';
4390 // $content[] = '<li><span id="ays-survey-countdown-days"></span>' . __( 'Days', "survey-maker" ) . '</li>';
4391 // $content[] = '<li><span id="ays-survey-countdown-hours"></span>' . __( 'Hours', "survey-maker" ) . '</li>';
4392 // $content[] = '<li><span id="ays-survey-countdown-minutes"></span>' . __( 'Minutes', "survey-maker" ) . '</li>';
4393 // $content[] = '<li><span id="ays-survey-countdown-seconds"></span>' . __( 'Seconds', "survey-maker" ) . '</li>';
4394 // $content[] = '</ul>';
4395 // $content[] = '</div>';
4396 // $content[] = '<div id="ays-survey-countdown-content" class="emoji" style="display: none;">';
4397 // $content[] = '<span>🚀</span>';
4398 // $content[] = '<span>⌛</span>';
4399 // $content[] = '<span>🔥</span>';
4400 // $content[] = '<span>💣</span>';
4401 // $content[] = '</div>';
4402 // $content[] = '</div>';
4403 // $content[] = '</div>';
4404 // $content[] = '</div>';
4405
4406 // $content[] = '<div class="ays-survey-dicount-christmas-wrap-box" style="width: 25%;">';
4407 // $content[] = '<a href="https://ays-pro.com/wordpress/survey-maker" class="ays-survey-dicount-christmas-button-buy-now" target="_blank">' . __( 'BUY NOW', "survey-maker" ) . '!</a>';
4408 // $content[] = '</div>';
4409 // $content[] = '</div>';
4410 // $content[] = '</div>';
4411
4412 // $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form-christmas">';
4413 // $content[] = '<form action="" method="POST">';
4414 // $content[] = '<div id="ays-survey-dismiss-buttons-content-christmas">';
4415 // $content[] = '<button class="btn btn-link ays-button-christmas" name="ays_survey_sale_btn" style="">' . __( 'Dismiss ad', "survey-maker" ) . '</button>';
4416 // $content[] = '</div>';
4417 // $content[] = '</form>';
4418 // $content[] = '</div>';
4419 // $content[] = '</div>';
4420
4421 // $content = implode( '', $content );
4422
4423 // echo $content;
4424 // }
4425 // }
4426
4427 public function ays_survey_add_survey_template() {
4428 global $wpdb;
4429
4430 $template_file_name = (isset($_REQUEST['template_file_name']) && $_REQUEST['template_file_name'] != "") ? sanitize_text_field($_REQUEST['template_file_name'] ) : null;
4431
4432 switch($template_file_name){
4433 case 'customer-feedback-form':
4434 $json = file_get_contents(SURVEY_MAKER_ADMIN_PATH . "/partials/surveys/templates/customer-feedback-form.json");
4435 break;
4436 case 'employee-satisfaction-survey':
4437 $json = file_get_contents(SURVEY_MAKER_ADMIN_PATH . "/partials/surveys/templates/employee-satisfaction-survey.json");
4438 break;
4439 case 'event-evaluation-survey':
4440 $json = file_get_contents(SURVEY_MAKER_ADMIN_PATH . "/partials/surveys/templates/event-evaluation-survey.json");
4441 break;
4442 case 'product-research-survey':
4443 $json = file_get_contents(SURVEY_MAKER_ADMIN_PATH . "/partials/surveys/templates/product-research-survey.json");
4444 break;
4445 case 'restaurant-evaluation-survey':
4446 $json = file_get_contents(SURVEY_MAKER_ADMIN_PATH . "/partials/surveys/templates/restaurant-evaluation-survey.json");
4447 break;
4448 case 'market-research-survey':
4449 $json = file_get_contents(SURVEY_MAKER_ADMIN_PATH . "/partials/surveys/templates/market-research-survey.json");
4450 break;
4451 case 'brand-awareness-survey':
4452 $json = file_get_contents(SURVEY_MAKER_ADMIN_PATH . "/partials/surveys/templates/brand-awareness-survey.json");
4453 break;
4454 case 'user-persona-survey':
4455 $json = file_get_contents(SURVEY_MAKER_ADMIN_PATH . "/partials/surveys/templates/user-persona-survey.json");
4456 break;
4457 }
4458
4459 $response = array();
4460 $json = json_decode($json, true);
4461 $json_key = isset($json['ays_survey_key']) ? $json['ays_survey_key'] : false;
4462
4463 if($json_key) {
4464 $response = array(
4465 'status' => true,
4466 'data' => $json
4467 );
4468
4469 echo json_encode( $response );
4470 wp_die();
4471 }else{
4472 $response = array(
4473 'status' => false
4474 );
4475
4476 echo json_encode( $response );
4477 wp_die();
4478 }
4479 }
4480
4481 // public static function ays_survey_spring_bundle_small_message($ishmar){
4482 // if($ishmar == 0 ){
4483 // $content = array();
4484
4485 // $content[] = '<div id="ays-survey-dicount-month-main" class="notice notice-success is-dismissible ays_survey_dicount_info">';
4486 // $content[] = '<div id="ays-survey-dicount-month" class="ays_survey_dicount_month">';
4487 // $content[] = '<a href="https://ays-pro.com/mega-bundle" target="_blank" class="ays-survey-sale-banner-link"><img src="' . SURVEY_MAKER_ADMIN_URL . '/images/mega_bundle_logo_box.png"></a>';
4488
4489 // $content[] = '<div class="ays-survey-dicount-wrap-box">';
4490 // $content[] = '<p>';
4491 // $content[] = '<strong>';
4492 // $content[] = __( "Spring is here! <span class='ays-survey-dicount-wrap-color'>50%</span> SALE on <span><a href='https://ays-pro.com/mega-bundle' target='_blank' class='ays-survey-dicount-wrap-color ays-survey-dicount-wrap-text-decoration'>Mega Bundle</a></span><span style='display: block;'>Quiz + Survey + Poll</span>", SURVEY_MAKER_ADMIN_URL );
4493 // $content[] = '</strong>';
4494 // $content[] = '</p>';
4495 // $content[] = '</div>';
4496
4497 // $content[] = '<div class="ays-survey-dicount-wrap-box">';
4498
4499 // $content[] = '<div id="ays-survey-countdown-main-container">';
4500
4501 // $content[] = '<form action="" method="POST" class="ays-survey-btn-form">';
4502 // $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn_small_spring" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>';
4503 // $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn_spring_small_for_two_months" style="height: 32px; padding-left: 0">Dismiss ad for 2 months</button>';
4504 // $content[] = '</form>';
4505
4506 // $content[] = '</div>';
4507
4508 // $content[] = '</div>';
4509
4510 // $content[] = '<a href="https://ays-pro.com/mega-bundle" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now !', SURVEY_MAKER_ADMIN_URL ) . '</a>';
4511 // $content[] = '</div>';
4512 // $content[] = '</div>';
4513
4514 // $content = implode( '', $content );
4515 // echo $content;
4516 // }
4517 // }
4518
4519 public function ays_survey_maker_live_preview_content(){
4520
4521 $content = isset($_REQUEST['content']) && $_REQUEST['content'] != '' ? wp_kses_post( $_REQUEST['content'] ) : null;
4522 if($content === null){
4523 ob_end_clean();
4524 $ob_get_clean = ob_get_clean();
4525 echo json_encode(array(
4526 'status' => false,
4527 ));
4528 }
4529 // $content = Survey_Maker_Data::ays_autoembed( $content );
4530 $content = stripslashes( wpautop( $content ) );
4531 ob_end_clean();
4532 $ob_get_clean = ob_get_clean();
4533 echo json_encode(array(
4534 'status' => true,
4535 'content' => $content,
4536 ));
4537 wp_die();
4538 }
4539
4540 public function add_tabs() {
4541 $screen = get_current_screen();
4542
4543 if ( ! $screen) {
4544 return;
4545 }
4546
4547 $title = __( 'General Information:', "survey-maker");
4548 $content_text = 'Get real-time feedback with the Survey Maker plugin. You are free to generate unlimited online surveys with unlimited questions and sections. Easily create your customer satisfaction surveys, employee engagement forms, market researches, event planning questionnaires with this plugin.
4549 <br><br>Increase users’ track to your WordPress website with the Survey Maker features. Build smarter surveys with LogicJump, advance your questionnaires with Conditional Results, earn money with Paid Surveys, generate leads super easily, get valuable feedback.';
4550
4551 $sidebar_content = '<p><strong>' . __( 'For more information:', "survey-maker") . '</strong></p>' .
4552 '<p>
4553 <a href="https://www.youtube.com/watch?v=Q1qi649acb0" target="_blank">' . __( 'YouTube video tutorials' , "survey-maker" ) . '</a>
4554 </p>' .
4555 '<p>
4556 <a href="https://ays-pro.com/wordpress-survey-maker-user-manual" target="_blank">' . __( 'Documentation', "survey-maker" ) . '</a>
4557 </p>' .
4558 '<p>
4559 <a href="https://ays-pro.com/wordpress/survey-maker" target="_blank">' . __( 'Survey Maker plugin pro version', "survey-maker" ) . '</a>
4560 </p>' .
4561 '<p>
4562 <a href="https://ays-demo.com/wordpress-survey-plugin-pro-demo/" target="_blank">' . __( 'Survey Maker plugin demo', "survey-maker" ) . '</a>
4563 </p>';
4564
4565
4566 $content = '<h2>' . __( 'Survey Maker Information', "survey-maker") . '</h2>'
4567 .'<p>' .sprintf(__( '%s', "survey-maker" ), $content_text).'</p>';
4568
4569 $help_tab_content = array(
4570 'id' => 'survey_maker_help_tab',
4571 'title' => $title,
4572 'content' => $content
4573 );
4574
4575 $screen->add_help_tab($help_tab_content);
4576
4577 $screen->set_help_sidebar($sidebar_content);
4578 }
4579
4580 public function get_next_or_prev_survey_by_id( $id, $type = "next" ) {
4581 global $wpdb;
4582
4583 $surveys_table = esc_sql( $wpdb->prefix . "ayssurvey_surveys" );
4584
4585 $where = array();
4586 $where_condition = "";
4587
4588 $id = (isset( $id ) && $id != "" && absint($id) != 0) ? absint( sanitize_text_field( $id ) ) : null;
4589 $type = (isset( $type ) && $type != "") ? sanitize_text_field( $type ) : "next";
4590
4591 if ( is_null( $id ) || $id == 0 ) {
4592 return null;
4593 }
4594
4595 switch ( $type ) {
4596 case 'prev':
4597 $where[] = ' `id` < ' . $id . ' ORDER BY `id` DESC ';
4598 break;
4599 case 'next':
4600 default:
4601 $where[] = ' `id` > ' . $id;
4602 break;
4603 }
4604
4605 if( ! empty($where) ){
4606 $where_condition = " WHERE " . implode( " AND ", $where );
4607 }
4608
4609 $sql = "SELECT `id` FROM {$surveys_table} ". $where_condition ." LIMIT 1;";
4610 $results = $wpdb->get_row( $sql, 'ARRAY_A' );
4611
4612 return $results;
4613
4614 }
4615
4616 public static function ays_survey_update_banner_time(){
4617
4618 $date = time() + ( 3 * 24 * 60 * 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
4619 // $date = time() + ( 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS); // for testing | 1 min
4620 $next_3_days = date('M d, Y H:i:s', $date);
4621
4622 $ays_survey_banner_time = get_option('ays_survey_banner_time');
4623
4624 if ( !$ays_survey_banner_time || is_null( $ays_survey_banner_time ) ) {
4625 update_option('ays_survey_banner_time', $next_3_days );
4626 }
4627
4628 $get_ays_survey_banner_time = get_option('ays_survey_banner_time');
4629
4630 $val = 60*60*24*0.5; // half day
4631 // $val = 60; // for testing | 1 min
4632
4633 $current_date = current_time( 'mysql' );
4634 $date_diff = strtotime($current_date) - intval(strtotime($get_ays_survey_banner_time));
4635
4636 $days_diff = $date_diff / $val;
4637 if(intval($days_diff) > 0 ){
4638 update_option('ays_survey_banner_time', $next_3_days);
4639 }
4640
4641 return $get_ays_survey_banner_time;
4642 }
4643
4644 //---------------- Survey submisson open results in popup ----------------
4645
4646
4647 public function ays_survey_show_results(){
4648
4649 // Run a security check.
4650 check_ajax_referer( 'survey-maker-ajax-results-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
4651
4652 global $wpdb;
4653 if( !is_user_logged_in() ) {
4654 echo json_encode( array(
4655 'status' => false,
4656 'rows' => ""
4657 ) );
4658
4659 };
4660
4661 // Check for permissions.
4662 if ( ! current_user_can( 'manage_options' ) ) {
4663 ob_end_clean();
4664 $ob_get_clean = ob_get_clean();
4665 echo json_encode(array(
4666 'status' => false,
4667 "rows" => ""
4668 ));
4669 wp_die();
4670 }
4671
4672 if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'ays_survey_show_results' && isset($_REQUEST['survey_id']) && !empty($_REQUEST['survey_id'])) {
4673
4674 ob_start();
4675
4676 $survey_id = absint(intval($_REQUEST['survey_id']));
4677
4678
4679 $this->settings_obj = new Survey_Maker_Settings_Actions($this->plugin_name);
4680
4681 $filters = array();
4682
4683 $submission_count_and_ids = Survey_Maker_Data::get_submission_count_and_ids( $survey_id, $filters );
4684 $submission_ids_arr = ( isset( $submission_count_and_ids['submission_ids_arr'] ) && ! empty( $submission_count_and_ids['submission_ids_arr'] ) ) ? Survey_Maker_Data::recursive_sanitize_text_field( $submission_count_and_ids['submission_ids_arr'] ) : array();
4685 $filters['filter_submission_ids'] = $submission_ids_arr;
4686
4687
4688 $sql = "SELECT * FROM " . $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "surveys WHERE id =" . absint( $survey_id );
4689 $survey_name = $wpdb->get_row( $sql, 'ARRAY_A' );
4690
4691 $survey_options = isset( $survey_name['options'] ) && $survey_name['options'] != '' ? json_decode( $survey_name['options'], true ) : array();
4692
4693 $survey_for_charts = isset( $survey_options['survey_color'] ) && $survey_options['survey_color'] != '' ? esc_attr($survey_options['survey_color']) : "rgb(255, 87, 34)";
4694 $survey_for_charts_text_color = isset( $survey_options['survey_text_color'] ) && $survey_options['survey_text_color'] != '' ? esc_attr($survey_options['survey_text_color']) : "rgb(255, 87, 34)";
4695 if(isset( $survey_options['survey_color'] ) && $survey_options['survey_color'] == 'rgba(0,0,0,0)'){
4696 $survey_for_charts = "rgba(0,0,0,1)";
4697 }
4698 if($survey_for_charts_text_color == 'rgba(0,0,0,0)'){
4699 $survey_for_charts_text_color = "rgba(0,0,0,1)";
4700 }
4701 // Allow HTML in answers
4702 $survey_options[ 'survey_allow_html_in_answers' ] = isset($survey_options[ 'survey_allow_html_in_answers' ]) ? $survey_options[ 'survey_allow_html_in_answers' ] : 'off';
4703 $allow_html_in_answers = (isset($survey_options[ 'survey_allow_html_in_answers' ]) && $survey_options[ 'survey_allow_html_in_answers' ] == 'on') ? true : false;
4704
4705 // Allow HTML in description
4706 $survey_options[ 'survey_allow_html_in_section_description' ] = isset($survey_options[ 'survey_allow_html_in_section_description' ]) ? $survey_options[ 'survey_allow_html_in_section_description' ] : 'off';
4707 $survey_allow_html_in_section_description = (isset($survey_options[ 'survey_allow_html_in_section_description' ]) && $survey_options[ 'survey_allow_html_in_section_description' ] == 'on') ? true : false;
4708
4709 $user_id = get_current_user_id();
4710
4711 $author_id = isset( $survey_name['author_id'] ) && $survey_name['author_id'] != "" ? intval( $survey_name['author_id'] ) : 0;
4712 $survey_title = isset( $survey_name['title'] ) && $survey_name['title'] != "" ? esc_html__( $survey_name['title'], "survey-maker" ) : "";
4713
4714 $owner = false;
4715 if( $user_id == $author_id ){
4716 $owner = true;
4717 }
4718
4719 if( !$owner ){
4720 $url = esc_url_raw( remove_query_arg( array( 'page', 'survey' ) ) ) . "?page=survey-maker-submissions";
4721 wp_redirect( $url );
4722 }
4723
4724 $gen_options = ($this->settings_obj->ays_get_setting('options') === false) ? array() : json_decode($this->settings_obj->ays_get_setting('options'), true);
4725
4726 $submission_id = (isset($_REQUEST['submission_id']) && $_REQUEST['submission_id'] != '') ? absint( sanitize_text_field( $_REQUEST['submission_id'] ) ) : null;
4727 if($submission_id == null){
4728
4729 return array(
4730 'status' => false,
4731 'rows' => ""
4732 );
4733 }
4734 $submission = array(
4735 'id' => $submission_id
4736 );
4737
4738
4739 $ays_survey_individual_questions = $this->ays_survey_individual_results_for_one_submission( $submission, $survey_name );
4740
4741 // Show question title as HTML
4742 $survey_options[ 'survey_show_questions_as_html' ] = isset($survey_options[ 'survey_show_questions_as_html' ]) ? $survey_options[ 'survey_show_questions_as_html' ] : 'on';
4743 $survey_show_questions_as_html = $survey_options[ 'survey_show_questions_as_html' ] == 'on' ? true : false;
4744
4745 // Get user info
4746 $individual_user_name = "";
4747 $individual_user_email = "";
4748 $individual_user_ip = "";
4749 $individual_user_date = "";
4750 $individual_user_sub_id = "";
4751 $individual_user_password = "";
4752 $dashboard_admin_note = "";
4753 $individual_user_device_type = "";
4754 if( isset($ays_survey_individual_questions['user_info']) && is_array( $ays_survey_individual_questions['user_info']) ){
4755 $individual_user_name = isset($ays_survey_individual_questions['user_info']['user_name']) && isset($ays_survey_individual_questions['user_info']['user_name']) ? stripslashes( $ays_survey_individual_questions['user_info']['user_name'] ) : "";
4756 $individual_user_email = isset($ays_survey_individual_questions['user_info']['user_email']) && isset($ays_survey_individual_questions['user_info']['user_email']) ? stripslashes( esc_attr( $ays_survey_individual_questions['user_info']['user_email'] ) ) : "";
4757 $individual_user_ip = isset($ays_survey_individual_questions['user_info']['user_ip']) && isset($ays_survey_individual_questions['user_info']['user_ip']) ? stripslashes( esc_attr( $ays_survey_individual_questions['user_info']['user_ip'] ) ) : "";
4758 $individual_user_date = isset($ays_survey_individual_questions['user_info']['submission_date']) && isset($ays_survey_individual_questions['user_info']['submission_date']) ? stripslashes( esc_attr( $ays_survey_individual_questions['user_info']['submission_date'] ) ) : "";
4759 $individual_user_sub_id = isset($ays_survey_individual_questions['user_info']['id']) && isset($ays_survey_individual_questions['user_info']['id']) ? stripslashes( esc_attr( $ays_survey_individual_questions['user_info']['id'] ) ) : "";
4760 $individual_user_password = isset($ays_survey_individual_questions['user_info']['password']) && isset($ays_survey_individual_questions['user_info']['password']) ? stripslashes( esc_attr( $ays_survey_individual_questions['user_info']['password'] ) ) : "";
4761 $individual_user_extra_data = isset($ays_survey_individual_questions['user_info']['options']) && $ays_survey_individual_questions['user_info']['options'] != '' ? json_decode(($ays_survey_individual_questions['user_info']['options']) , 'true') : array();
4762 $individual_user_device_type = isset($individual_user_extra_data['device']) && $individual_user_extra_data['device'] != '' ? esc_attr($individual_user_extra_data['device']) : '';
4763 $dashboard_admin_note = isset($ays_survey_individual_questions['user_info']['admin_note']) && isset($ays_survey_individual_questions['user_info']['admin_note']) ? stripslashes( esc_attr( $ays_survey_individual_questions['user_info']['admin_note'] ) ) : "";
4764 }
4765
4766 $text_types = array(
4767 'text',
4768 'short_text',
4769 'number',
4770 'phone',
4771 'name',
4772 'hidden',
4773 'email',
4774 'date',
4775 'time',
4776 'date_time',
4777 );
4778
4779 $submissions_count = 0;
4780 if(intval($submission_count_and_ids['submission_count']) > 0){
4781 $submissions_count = $submission_count_and_ids['submission_count'];
4782 }
4783
4784 $export_disabled = 'disabled';
4785 if( $submissions_count > 0 ){
4786 $export_disabled = '';
4787 }
4788
4789 $survey_data_clipboard = array(
4790 "user_name" => $individual_user_name,
4791 "user_email" => $individual_user_email,
4792 "user_ip" => $individual_user_ip,
4793 "user_date" => $individual_user_date,
4794 "user_sub_id" => $individual_user_sub_id,
4795 "user_device_type" => $individual_user_device_type,
4796 );
4797
4798 if($individual_user_password){
4799 $survey_data_clipboard['user_password'] = $individual_user_password;
4800 }
4801
4802 $survey_data_formated_for_clipboard = Survey_Maker_Data::ays_survey_copy_text_formater($survey_data_clipboard);
4803
4804
4805 Survey_Maker_Data::get_template_part( 'partials/submissions/partials/survey-maker-each-submission-individual', '', get_defined_vars() );
4806
4807 $wpdb->get_var("UPDATE " . $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions SET `read`= 1 WHERE `id`= $submission_id");
4808
4809 $html = ob_get_clean();
4810
4811 echo json_encode( array(
4812 'status' => true,
4813 'rows' => $html
4814 ) );
4815 wp_die();
4816 }
4817
4818 echo json_encode( array(
4819 'status' => false,
4820 'rows' => ""
4821 ) );
4822
4823 }
4824
4825 public function ays_survey_author_user_search() {
4826 $content_text = array(
4827 'results' => array()
4828 );
4829
4830 if( current_user_can( 'manage_options' ) ){
4831 $search = isset($_REQUEST['search']) && $_REQUEST['search'] != '' ? sanitize_text_field( $_REQUEST['search'] ) : null;
4832 $checked = isset($_REQUEST['val']) && $_REQUEST['val'] !='' ? sanitize_text_field( $_REQUEST['val'] ) : null;
4833
4834 $args = 'search=';
4835 if($search !== null){
4836 $args .= '*';
4837 $args .= $search;
4838 $args .= '*';
4839 }
4840
4841 $users = get_users($args);
4842
4843 foreach ($users as $key => $value) {
4844 if ($checked !== null) {
4845 if ( !is_array( $checked ) ) {
4846 $checked2 = $checked;
4847 $checked = array();
4848 $checked[] = absint($checked2);
4849 }
4850 if (in_array($value->ID, $checked)) {
4851 continue;
4852 }else{
4853 $content_text['results'][] = array(
4854 'id' => $value->ID,
4855 'text' => $value->data->display_name,
4856 );
4857 }
4858 }else{
4859 $content_text['results'][] = array(
4860 'id' => $value->ID,
4861 'text' => $value->data->display_name,
4862 );
4863 }
4864 }
4865 }
4866
4867 ob_end_clean();
4868 echo json_encode($content_text);
4869 wp_die();
4870 }
4871
4872 // public function ays_survey_subscribe_email(){
4873 // $subscribe_email = isset($_REQUEST['email']) && $_REQUEST['email'] != "" ? sanitize_email($_REQUEST['email']) : "";
4874 // $subscribe_website = isset($_REQUEST['website']) && $_REQUEST['website'] != "" ? sanitize_url($_REQUEST['website']) : "";
4875 // // $url = "http://localhost/survey-grab-gift/";
4876 // $url = "https://ays-pro.com/add-on-email/survey-grab-gift/";
4877 // if($subscribe_email != "" && $subscribe_website != ''){
4878 // $current_date = date("Y-m-d");
4879 // $current_user_ip = Survey_Maker_Data::get_user_ip();
4880 // $send_request = wp_remote_post($url, array(
4881 // 'headers' => array("Content-Type: application/json; charset=UTF-8"),
4882 // 'body' => json_encode( array(
4883 // "email" => $subscribe_email,
4884 // "website" => $subscribe_website,
4885 // "user_ip" => $current_user_ip,
4886 // "subscirbe_date" => $current_date
4887 // ) ),
4888 // ) );
4889 // $response = wp_remote_retrieve_body($send_request);
4890 // $response = json_decode($response, true);
4891 // if(isset($response) && is_array($response)){
4892 // $response_code = isset($response['code']) && $response['code'] != "" ? $response['code'] : "";
4893 // $response_message = isset($response['msg']) && $response['msg'] != "" ? $response['msg'] : "";
4894 // $response_status = $response_code > 0 ? true : false;
4895 // echo json_encode(array(
4896 // "status" => $response_code,
4897 // "message" => $response_message
4898 // ));
4899 // wp_die();
4900 // }
4901 // else{
4902 // echo json_encode(array(
4903 // "status" => false,
4904 // "message" => "Something went wrong. Please try again"
4905 // ));
4906 // wp_die();
4907 // }
4908 // }
4909 // }
4910
4911 /**
4912 * Check if plugin can be installed
4913 */
4914 public function ays_survey_can_install($plugin_slug) {
4915 if (!function_exists('get_plugins')) {
4916 require_once ABSPATH . 'wp-admin/includes/plugin.php';
4917 }
4918
4919 $plugins = get_plugins();
4920 foreach ($plugins as $plugin_file => $plugin_data) {
4921 if (strpos($plugin_file, $plugin_slug) !== false) {
4922 return false; // Plugin already exists
4923 }
4924 }
4925 return true; // Plugin can be installed
4926 }
4927
4928 /**
4929 * Check if plugin can be activated
4930 */
4931 public function ays_survey_can_activate($plugin_slug) {
4932 if (!function_exists('get_plugins')) {
4933 require_once ABSPATH . 'wp-admin/includes/plugin.php';
4934 }
4935
4936 $plugins = get_plugins();
4937 foreach ($plugins as $plugin_file => $plugin_data) {
4938 if (strpos($plugin_file, $plugin_slug) !== false) {
4939 return !is_plugin_active($plugin_file); // Can activate if not already active
4940 }
4941 }
4942 return false; // Plugin doesn't exist
4943 }
4944
4945 /**
4946 * Install plugin via AJAX
4947 */
4948 public function ays_survey_install_plugin() {
4949 if (!current_user_can('install_plugins')) {
4950 wp_die(json_encode(array('success' => false, 'message' => 'Insufficient permissions')));
4951 }
4952
4953 if (!wp_verify_nonce($_POST['nonce'], 'ajax-nonce')) {
4954 wp_die(json_encode(array('success' => false, 'message' => 'Security check failed')));
4955 }
4956
4957 $plugin_slug = sanitize_text_field($_POST['plugin_slug']);
4958
4959 if (!function_exists('plugins_api')) {
4960 require_once ABSPATH . 'wp-admin/includes/plugin-install.php';
4961 }
4962 if (!class_exists('WP_Upgrader')) {
4963 require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php';
4964 }
4965
4966 $api = plugins_api('plugin_information', array('slug' => $plugin_slug));
4967
4968 if (is_wp_error($api)) {
4969 wp_die(json_encode(array('success' => false, 'message' => esc_html__('Plugin not found'))));
4970 }
4971
4972 $upgrader = new Plugin_Upgrader(new WP_Ajax_Upgrader_Skin());
4973 $result = $upgrader->install($api->download_link);
4974
4975 if ($result) {
4976 // Load plugin.php for get_plugins() and activate_plugin() if not loaded yet
4977 if ( ! function_exists( 'get_plugins' ) ) {
4978 require_once ABSPATH . 'wp-admin/includes/plugin.php';
4979 }
4980
4981 // Clear plugins cache to ensure the newly installed plugin is visible
4982 if ( function_exists( 'wp_clean_plugins_cache' ) ) {
4983 wp_clean_plugins_cache();
4984 }
4985
4986 $plugins = get_plugins();
4987 $plugin_file = '';
4988
4989 foreach ( $plugins as $file => $plugin_data ) {
4990 if ( strpos( $file, $plugin_slug ) !== false ) {
4991 $plugin_file = $file;
4992 break;
4993 }
4994 }
4995
4996 if ( empty( $plugin_file ) ) {
4997 wp_die( json_encode( array( 'success' => false, 'message' => esc_html__('Plugin main file not found')) ) );
4998 }
4999
5000 // Ensure activate_plugin() is available
5001 if ( ! function_exists( 'activate_plugin' ) ) {
5002 require_once ABSPATH . 'wp-admin/includes/plugin.php';
5003 }
5004
5005 $activate = activate_plugin( $plugin_file );
5006
5007 if ( is_wp_error( $activate ) ) {
5008 wp_die( json_encode( array( 'success' => false, 'message' => $activate->get_error_message() ) ) );
5009 }
5010
5011 wp_die( json_encode( array( 'success' => true, 'message' => esc_html__('Plugin installed and activated successfully')) ) );
5012
5013 } else {
5014 wp_die(json_encode(array('success' => false, 'message' => esc_html__('Installation failed'))));
5015 }
5016 }
5017
5018 /**
5019 * Activate plugin via AJAX
5020 */
5021 public function ays_survey_activate_plugin() {
5022 if (!current_user_can('activate_plugins')) {
5023 wp_die(json_encode(array('success' => false, 'message' => esc_html__('Insufficient permissions'))));
5024 }
5025
5026 if (!wp_verify_nonce($_POST['nonce'], 'ajax-nonce')) {
5027 wp_die(json_encode(array('success' => false, 'message' => esc_html__('Security check failed'))));
5028 }
5029
5030 $plugin_slug = sanitize_text_field($_POST['plugin_slug']);
5031
5032 if (!function_exists('get_plugins')) {
5033 require_once ABSPATH . 'wp-admin/includes/plugin.php';
5034 }
5035
5036 $plugins = get_plugins();
5037 $plugin_file = '';
5038
5039 foreach ($plugins as $file => $plugin_data) {
5040 if (strpos($file, $plugin_slug) !== false) {
5041 $plugin_file = $file;
5042 break;
5043 }
5044 }
5045
5046 if (empty($plugin_file)) {
5047 wp_die(json_encode(array('success' => false, 'message' => esc_html__('Plugin not found'))));
5048 }
5049
5050 $result = activate_plugin($plugin_file);
5051
5052 if (is_wp_error($result)) {
5053 wp_die(json_encode(array('success' => false, 'message' => $result->get_error_message())));
5054 } else {
5055 wp_die(json_encode(array('success' => true, 'message' => esc_html__('Plugin activated successfully'))));
5056 }
5057 }
5058
5059 /**
5060 * Get AYS plugins data
5061 */
5062 public function get_am_plugins() {
5063 return array(
5064 'quiz-maker' => array(
5065 'name' => 'Quiz Maker',
5066 'slug' => 'quiz-maker',
5067 'description' => 'Create engaging quizzes with multiple question types'
5068 ),
5069 'poll-maker' => array(
5070 'name' => 'Poll Maker',
5071 'slug' => 'poll-maker',
5072 'description' => 'Build interactive polls for your audience'
5073 ),
5074 'popup-box' => array(
5075 'name' => 'Popup Box',
5076 'slug' => 'ays-popup-box',
5077 'description' => 'Create beautiful popups and modals'
5078 ),
5079 'gallery-photo-gallery' => array(
5080 'name' => 'Gallery Photo Gallery',
5081 'slug' => 'gallery-photo-gallery',
5082 'description' => 'Showcase your photos in stunning galleries'
5083 ),
5084 'secure-copy-content-protection' => array(
5085 'name' => 'Secure Copy Content Protection',
5086 'slug' => 'secure-copy-content-protection',
5087 'description' => 'Protect your content from copying'
5088 ),
5089 'ays-chatgpt-assistant' => array(
5090 'name' => 'ChatGPT Assistant',
5091 'slug' => 'ays-chatgpt-assistant',
5092 'description' => 'AI-powered chat assistant for your website'
5093 ),
5094 'personal-dictionary' => array(
5095 'name' => 'Personal Dictionary',
5096 'slug' => 'personal-dictionary',
5097 'description' => 'Create and manage custom dictionaries'
5098 ),
5099 'chartify' => array(
5100 'name' => 'Chartify',
5101 'slug' => 'chart-builder',
5102 'description' => 'Build beautiful charts and graphs'
5103 )
5104 );
5105 }
5106
5107 public function ays_survey_disable_all_notice_from_plugin() {
5108 if (!function_exists('get_current_screen')) {
5109 return;
5110 }
5111
5112 $screen = get_current_screen();
5113
5114 if (empty($screen) || strpos($screen->id, $this->plugin_name) === false) {
5115 return;
5116 }
5117
5118 global $wp_filter;
5119
5120 // Keep plugin-specific notices
5121 $our_plugin_notices = array();
5122
5123 $exclude_functions = [
5124 'survey_maker_general_admin_notice',
5125 ];
5126
5127 if (!empty($wp_filter['admin_notices'])) {
5128 foreach ($wp_filter['admin_notices']->callbacks as $priority => $callbacks) {
5129 foreach ($callbacks as $key => $callback) {
5130 // For class-based methods
5131 if (
5132 is_array($callback['function']) &&
5133 is_object($callback['function'][0]) &&
5134 get_class($callback['function'][0]) === __CLASS__
5135 ) {
5136 $our_plugin_notices[$priority][$key] = $callback;
5137 }
5138 // For standalone functions
5139 elseif (
5140 is_string($callback['function']) &&
5141 in_array($callback['function'], $exclude_functions)
5142 ) {
5143 $our_plugin_notices[$priority][$key] = $callback;
5144 }
5145 }
5146 }
5147 }
5148
5149 // Remove all notices
5150 remove_all_actions('admin_notices');
5151 remove_all_actions('all_admin_notices');
5152
5153 // Re-add only your plugin's notices
5154 foreach ($our_plugin_notices as $priority => $callbacks) {
5155 foreach ($callbacks as $callback) {
5156 add_action('admin_notices', $callback['function'], $priority);
5157 }
5158 }
5159 }
5160
5161 public function ays_survey_black_friady_popup_box(){
5162 if(!empty($_REQUEST['page']) && sanitize_text_field( $_REQUEST['page'] ) != $this->plugin_name . "-admin-dashboard"){
5163 if(false !== strpos( sanitize_text_field( $_REQUEST['page'] ), $this->plugin_name)){
5164
5165 $flag = true;
5166
5167 if( isset($_COOKIE['aysSurveyBlackFridayPopupCount']) && intval($_COOKIE['aysSurveyBlackFridayPopupCount']) >= 2 ){
5168 $flag = false;
5169 }
5170
5171 $ays_survey_cta_button_link = esc_url('https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=mega-bundle-popup-black-friday-sale-' . SURVEY_MAKER_VERSION);
5172
5173 if( $flag ){
5174 ?>
5175 <div class="ays-survey-black-friday-popup-overlay" style="opacity: 0; visibility: hidden; display: none;">
5176 <div class="ays-survey-black-friday-popup-dialog">
5177 <div class="ays-survey-black-friday-popup-content">
5178 <div class="ays-survey-black-friday-popup-background-pattern">
5179 <div class="ays-survey-black-friday-popup-pattern-row">
5180 <div class="ays-survey-black-friday-popup-pattern-text">SALE SALE SALE</div>
5181 <div class="ays-survey-black-friday-popup-pattern-text">SALE SALE SALE</div>
5182 </div>
5183 <div class="ays-survey-black-friday-popup-pattern-row">
5184 <div class="ays-survey-black-friday-popup-pattern-text">SALE SALE SALE</div>
5185 <div class="ays-survey-black-friday-popup-pattern-text">SALE SALE SALE</div>
5186 </div>
5187 <div class="ays-survey-black-friday-popup-pattern-row">
5188 <div class="ays-survey-black-friday-popup-pattern-text">SALE SALE SALE</div>
5189 <div class="ays-survey-black-friday-popup-pattern-text">SALE SALE SALE</div>
5190 </div>
5191 <div class="ays-survey-black-friday-popup-pattern-row">
5192 <div class="ays-survey-black-friday-popup-pattern-text">SALE SALE SALE</div>
5193 <div class="ays-survey-black-friday-popup-pattern-text">SALE SALE SALE</div>
5194 </div>
5195 </div>
5196
5197 <button class="ays-survey-black-friday-popup-close" aria-label="Close">
5198 <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round">
5199 <path d="M18 6 6 18"></path>
5200 <path d="m6 6 12 12"></path>
5201 </svg>
5202 </button>
5203
5204 <div class="ays-survey-black-friday-popup-badge">
5205 <div class="ays-survey-black-friday-popup-badge-content">
5206 <div class="ays-survey-black-friday-popup-badge-text-sm"><?php echo esc_html__( 'Up to', 'survey-maker' ); ?></div>
5207 <div class="ays-survey-black-friday-popup-badge-text-lg">50%</div>
5208 <div class="ays-survey-black-friday-popup-badge-text-md"><?php echo esc_html__( 'OFF', 'survey-maker' ); ?></div>
5209 </div>
5210 </div>
5211
5212 <div class="ays-survey-black-friday-popup-main-content">
5213 <div class="ays-survey-black-friday-popup-hashtag"><?php echo esc_html__( '#BLACKFRIDAY', 'survey-maker' ); ?></div>
5214 <h1 class="ays-survey-black-friday-popup-title-mega"><?php echo esc_html__( 'MEGA', 'survey-maker' ); ?></h1>
5215 <h1 class="ays-survey-black-friday-popup-title-bundle"><?php echo esc_html__( 'BUNDLE', 'survey-maker' ); ?></h1>
5216 <div class="ays-survey-black-friday-popup-offer-label">
5217 <h2 class="ays-survey-black-friday-popup-offer-text"><?php echo esc_html__( 'BLACK FRIDAY OFFER', 'survey-maker' ); ?></h2>
5218 </div>
5219 <p class="ays-survey-black-friday-popup-description"><?php echo esc_html__( 'Get our exclusive plugins in one bundle', 'survey-maker' ); ?></p>
5220 <a href="<?php echo esc_url($ays_survey_cta_button_link); ?>" target="_blank" class="ays-survey-black-friday-popup-cta-btn"><?php echo esc_html__( 'Get Mega Bundle', 'survey-maker' ); ?></a>
5221 </div>
5222 </div>
5223 </div>
5224 </div>
5225 <script type="text/javascript">
5226 (function() {
5227 var overlay = document.querySelector('.ays-survey-black-friday-popup-overlay');
5228 var closeBtn = document.querySelector('.ays-survey-black-friday-popup-close');
5229 var learnMoreBtn = document.querySelector('.ays-survey-black-friday-popup-learn-more');
5230 var ctaBtn = document.querySelector('.ays-survey-black-friday-popup-cta-btn');
5231
5232 // Cookie helper functions
5233 function setCookie(name, value, days) {
5234 var expires = "";
5235 if (days) {
5236 var date = new Date();
5237 date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
5238 expires = "; expires=" + date.toUTCString();
5239 }
5240 document.cookie = name + "=" + (value || "") + expires + "; path=/";
5241 }
5242
5243 function getCookie(name) {
5244 var nameEQ = name + "=";
5245 var ca = document.cookie.split(';');
5246 for (var i = 0; i < ca.length; i++) {
5247 var c = ca[i];
5248 while (c.charAt(0) == ' ') c = c.substring(1, c.length);
5249 if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
5250 }
5251 return null;
5252 }
5253
5254 // Get current show count from cookie
5255 var showCount = parseInt(getCookie('aysSurveyBlackFridayPopupCount') || '0', 10);
5256 var maxShows = 2;
5257
5258 // Show popup function
5259 function showPopup() {
5260 if (overlay && showCount < maxShows) {
5261 overlay.classList.add('ays-survey-black-friday-popup-active');
5262 showCount++;
5263 // Update cookie with new count (expires in 30 days)
5264 setCookie('aysSurveyBlackFridayPopupCount', showCount.toString(), 30);
5265 }
5266 }
5267
5268 // Close popup function
5269 function closePopup(e) {
5270 if (e) {
5271 e.preventDefault();
5272 e.stopPropagation();
5273 }
5274 if (overlay) {
5275 overlay.classList.remove('ays-survey-black-friday-popup-active');
5276 }
5277 }
5278
5279 // Determine timing based on show count
5280 if (showCount === 0) {
5281 // First time - show after 30 seconds
5282 setTimeout(function() {
5283 showPopup();
5284 }, 30000);
5285 } else if (showCount === 1) {
5286 // Second time - show after 200 seconds
5287 setTimeout(function() {
5288 showPopup();
5289 }, 200000);
5290 }
5291 // If showCount >= 2, don't show popup at all
5292
5293 // Close button
5294 if (closeBtn) {
5295 closeBtn.addEventListener('click', function(e) {
5296 closePopup(e);
5297 });
5298 }
5299
5300 // Learn more button
5301 if (learnMoreBtn) {
5302 learnMoreBtn.addEventListener('click', function(e) {
5303 closePopup(e);
5304 });
5305 }
5306
5307 // CTA button (optional - if you want it to close popup too)
5308 if (ctaBtn) {
5309 ctaBtn.addEventListener('click', function(e) {
5310 // You can add redirect logic here if needed
5311 // window.location.href = 'your-url';
5312 });
5313 }
5314
5315 // Close on overlay click
5316 if (overlay) {
5317 overlay.addEventListener('click', function(e) {
5318 if (e.target === overlay) {
5319 closePopup(e);
5320 }
5321 });
5322 }
5323
5324 // Close on Escape key
5325 document.addEventListener('keydown', function(e) {
5326 if (e.key === 'Escape' && overlay && overlay.classList.contains('ays-survey-black-friday-popup-active')) {
5327 closePopup();
5328 }
5329 });
5330 })();
5331 </script>
5332 <style>
5333 .ays-survey-black-friday-popup-overlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:9999;background-color:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;opacity:0;visibility:hidden;transition:opacity .2s,visibility .2s}.ays-survey-black-friday-popup-overlay.ays-survey-black-friday-popup-active{display:flex!important;opacity:1!important;visibility:visible!important}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-dialog{position:relative;max-width:470px;width:100%;border-radius:8px;overflow:hidden;background:0 0;box-shadow:0 25px 50px -12px rgba(0,0,0,.25);transform:scale(.95);transition:transform .2s}.ays-survey-black-friday-popup-overlay.ays-survey-black-friday-popup-active .ays-survey-black-friday-popup-dialog{transform:scale(1)}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-content{position:relative;width:470px;height:410px;background:linear-gradient(to right bottom,#c056f5,#f042f0,#7d7de8);overflow:hidden}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-background-pattern{position:absolute;top:0;left:0;right:0;bottom:0;opacity:.07;pointer-events:none;transform:rotate(-12deg) translateY(32px);overflow:hidden}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-pattern-row{display:flex;gap:16px;margin-bottom:16px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-pattern-text{color:#fff;font-weight:900;font-size:96px;white-space:nowrap;line-height:1}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-close{position:absolute;top:16px;right:16px;z-index:9999;background:0 0;border:none;color:rgba(255,255,255,.8);cursor:pointer;padding:4px;transition:color .2s;line-height:0}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-close:hover,.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-learn-more:hover{color:#fff}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge{position:absolute;top:32px;right:32px;width:96px;height:96px;background-color:#d4fc79;border-radius:50%;display:flex;align-items:center;justify-content:center;box-shadow:0 25px 50px -12px rgba(0,0,0,.25);animation:3s ease-in-out infinite ays-survey-black-friday-popup-float}@keyframes ays-survey-black-friday-popup-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-10px)}}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-content{text-align:center}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-sm{color:#1a1a1a;font-weight:900;font-size:24px;line-height:1}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-lg{color:#1a1a1a;font-weight:900;font-size:30px;line-height:1;margin-top:4px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-md{color:#1a1a1a;font-weight:900;font-size:20px;line-height:1}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-main-content{position:relative;z-index:10;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 48px;text-align:center}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-hashtag{color:rgba(255,255,255,.9);font-weight:700;font-size:14px;margin-bottom:16px;letter-spacing:.1em}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-title-mega{color:#fff;font-weight:900;font-size:60px;line-height:1;margin:0 0 12px;text-shadow:0 4px 6px rgba(0,0,0,.1)}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-title-bundle{color:#fff;font-weight:900;font-size:60px;line-height:1;margin:0 0 24px;text-shadow:0 4px 6px rgba(0,0,0,.1)}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-offer-label{background-color:#000;padding:12px 32px;margin-bottom:24px;display:inline-block}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-offer-text{color:#fff;font-weight:700;font-size:20px;letter-spacing:.05em;margin:0}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-description{color:rgba(255,255,255,.95);font-size:18px;font-weight:500;margin:0 0 32px!important}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-cta-btn{display:inline-flex;align-items:center;justify-content:center;height:48px;background-color:#fff;color:#a855f7;font-size:18px;font-weight:700;border:none;border-radius:24px;padding:0 40px;cursor:pointer;box-shadow:0 20px 25px -5px rgba(0,0,0,.1);transition:.2s;text-decoration:none}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-cta-btn:hover{background-color:rgba(255,255,255,.9);box-shadow:0 25px 50px -12px rgba(0,0,0,.25);transform:scale(1.05)}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-learn-more{background:0 0;border:none;color:rgba(255,255,255,.9);font-size:14px;text-decoration:underline;text-underline-offset:4px;cursor:pointer;padding:8px;margin-top:16px;transition:color .2s}@media (max-width:768px){.ays-survey-black-friday-popup-overlay{display:none!important}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-content{width:90vw;max-width:400px;height:380px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-main-content{padding:0 32px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge{width:80px;height:80px;top:24px;right:24px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-sm{font-size:20px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-lg{font-size:26px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-md,.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-offer-text{font-size:18px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-title-bundle,.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-title-mega{font-size:48px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-description{font-size:16px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-pattern-text{font-size:72px}}@media (max-width:480px){.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-content{width:95vw;max-width:340px;height:360px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-main-content{padding:0 24px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge{width:70px;height:70px;top:20px;right:20px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-sm,.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-offer-text{font-size:16px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-lg{font-size:22px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-md{font-size:14px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-hashtag{font-size:12px;margin-bottom:12px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-title-bundle,.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-title-mega{font-size:40px;margin-bottom:8px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-offer-label{padding:10px 24px;margin-bottom:20px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-description{font-size:15px;margin-bottom:24px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-cta-btn{font-size:16px;height:44px;padding:0 32px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-pattern-text{font-size:60px}}
5334 </style>
5335 <?php
5336 }
5337 }
5338 }
5339 }
5340 }
5341