PluginProbe
Poll Maker by AYS – Versus Polls, Anonymous Polls, Image Polls / 6.5.1
Poll Maker by AYS – Versus Polls, Anonymous Polls, Image Polls v6.5.1
6.5.1 6.5.0 6.4.9 6.4.8 6.4.7 6.4.6 6.4.5 6.4.4 6.4.3 6.4.2 6.4.1 6.4.0 6.3.9 6.3.8 6.3.7 6.3.6 6.3.5 6.3.4 6.3.3 5.6.0 5.6.1 5.6.2 5.6.3 5.6.4 5.6.5 All 154 releases
← All changes | admin/class-poll-maker-ays-admin.php +3301 -937 5.6.2 → 6.5.1 View file →
@@ -159,8 +159,9 @@
159 159 wp_enqueue_style('ays_poll_bootstrap', plugin_dir_url(__FILE__) . 'css/bootstrap.min.css', array(), $this->version, 'all');
160 160 wp_enqueue_style($this->plugin_name.'-jquery-datetimepicker', plugin_dir_url(__FILE__) . 'css/jquery-ui-timepicker-addon.css', array(), $this->version, 'all');
161 161 wp_enqueue_style('ays-poll-select2', plugin_dir_url(__FILE__) . 'css/select2.min.css', array(), $this->version, 'all');
162 162 wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/poll-maker-ays-admin.css', array(), $this->version, 'all');
163 + wp_enqueue_style($this->plugin_name . '-banner-all', plugin_dir_url(__FILE__) . 'css/poll-maker-banner-all.css', array(), $this->version, 'all');
163 164 wp_enqueue_style($this->plugin_name.'popup-layer', plugin_dir_url(__FILE__) . 'css/poll-maker-ays-admin-popup-layer.css', array(), $this->version, 'all');
164 165 wp_enqueue_style( $this->plugin_name . '-dropdown', plugin_dir_url(__FILE__) . '/css/dropdown.min.css', array(), $this->version, 'all');
165 166 wp_enqueue_style( $this->plugin_name . '-transition', plugin_dir_url(__FILE__) . '/css/transition.min.css', array(), $this->version, 'all');
166 167
@@ -179,9 +180,16 @@
179 180 if (false !== strpos($hook_suffix, "plugins.php")){
180 181 wp_enqueue_script('sweetalert-js-poll', plugin_dir_url(__FILE__) . 'js/sweetalert2.all.min.js', array('jquery'), $this->version, true);
181 182
182 183 wp_enqueue_script($this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'js/admin.js', array('jquery'), $this->version, true);
183 - wp_localize_script($this->plugin_name . '-admin', 'apm_admin_ajax_obj', array('ajaxUrl' => admin_url('admin-ajax.php')));
184 + wp_localize_script($this->plugin_name . '-admin', 'apm_admin_ajax_obj',
185 + array(
186 + 'ajaxUrl' => admin_url('admin-ajax.php'),
187 +
188 + 'errorMsg' => __( "Error", 'poll-maker' ),
189 + 'loadResource' => __( "Can't load resource.", 'poll-maker' ),
190 + 'somethingWentWrong' => __( "Maybe something went wrong.", 'poll-maker' ),
191 + ));
184 192 }
185 193
186 194 $version1 = $wp_version;
187 195 $operator = '>=';
@@ -219,45 +227,100 @@
219 227 wp_enqueue_script( $this->plugin_name."-jquery.datetimepicker.js", plugin_dir_url( __FILE__ ) . 'js/jquery-ui-timepicker-addon.js', array( 'jquery' ), $this->version, true );
220 228 wp_enqueue_script('ays-poll-admin-js', plugin_dir_url(__FILE__) . 'js/poll-maker-ays-admin.js', array('jquery', 'wp-color-picker'), $this->version, true);
221 229 wp_enqueue_script( $this->plugin_name . '-charts-google', plugin_dir_url(__FILE__) . 'js/google-chart.js', array('jquery'), $this->version, false);
222 230 wp_localize_script('ays-poll-admin-js', 'pollLangObj', array(
223 - 'pollBannerDate' => $poll_banner_date,
224 - 'errorMsg' => __('Error', "poll-maker"),
225 - 'somethingWentWrong' => __('Maybe something went wrong.', "poll-maker"),
226 - 'add' => __('Add', "poll-maker"),
227 - 'answersMinCount' => __('Sorry minimum count of answers should be 2', "poll-maker"),
228 - 'copied' => __('Copied!', "poll-maker"),
229 - 'clickForCopy' => __('Click for copy.', "poll-maker"),
230 - 'areYouSure' => __('Are you sure you want to redirect to another poll? Note that the changes made in this poll will not be saved.', "poll-maker"),
231 - 'deleteAnswer' => __('Are you sure you want to delete this answer?', "poll-maker"),
232 - 'youCanUuseThisShortcode' => __('Your Poll is Created!<br>Copy the generated shortcode and paste it into any post or page to display Poll', "poll-maker"),
233 - 'greateJob' => __('Great job', "poll-maker"),
234 - 'formMoreDetailed' => __('For more detailed configuration visit', "poll-maker"),
235 - 'done' => __('Done', "poll-maker"),
236 - 'thumbsUpGreat' => __('Thumbs up, Done', "poll-maker"),
231 + 'pollBannerDate' => $poll_banner_date,
232 + 'errorMsg' => esc_html__('Error', "poll-maker"),
233 + 'somethingWentWrong' => esc_html__('Maybe something went wrong.', "poll-maker"),
234 + 'add' => esc_html__('Add', "poll-maker"),
235 + 'answersMinCount' => esc_html__('Sorry minimum count of answers should be 2', "poll-maker"),
236 + 'copied' => esc_html__('Copied!', "poll-maker"),
237 + 'clickForCopy' => esc_html__('Click for copy.', "poll-maker"),
238 + 'areYouSure' => esc_html__('Are you sure you want to redirect to another poll? Note that the changes made in this poll will not be saved.', "poll-maker"),
239 + 'deleteAnswer' => esc_html__('Are you sure you want to delete this answer?', "poll-maker"),
240 + 'youPollIsCreated' => esc_html__('Your Poll is Created!', 'poll-maker'),
241 + 'youCanUuseThisShortcode' => esc_html__('Copy the generated shortcode and paste it into any post or page to display Poll', "poll-maker"),
242 + 'greateJob' => esc_html__('Great job', "poll-maker"),
243 + 'editPollPage' => esc_html__( 'edit poll page', 'poll-maker'),
244 + 'formMoreDetailed' => esc_html__('For more detailed configuration visit', "poll-maker"),
245 + 'done' => esc_html__('Done', "poll-maker"),
246 + 'thumbsUpGreat' => esc_html__('Thumbs up, Done', "poll-maker"),
247 + "preivewPoll" => esc_html__( "Preview Poll", 'poll-maker' ),
248 + 'successCopyCoupon' => esc_html__( "Coupon code copied!", 'poll-maker' ),
249 + 'failedCopyCoupon' => esc_html__( "Failed to copy coupon code", 'poll-maker' ),
237 250 ) );
238 251
239 252 wp_localize_script('ays-poll-admin-js', 'poll', array(
240 253 'ajax' => admin_url('admin-ajax.php'),
241 - 'pleaseEnterMore' => __('Please select more', "poll-maker"),
242 - 'urlImg' => (POLL_MAKER_AYS_ADMIN_URL . '/images/'),
254 + 'pleaseEnterMore' =>esc_html__('Please select more', "poll-maker"),
255 + 'urlImg' => (esc_url(POLL_MAKER_AYS_ADMIN_URL) . '/images/'),
256 + "emptyEmailError" => esc_html__( 'Email field is empty', 'poll-maker'),
257 + "invalidEmailError" => esc_html__( 'Invalid Email address', 'poll-maker'),
258 + 'selectUser' => esc_html__( 'Select user', 'poll-maker'),
259 + 'pleaseEnterMore' => esc_html__( "Please enter 1 or more characters", 'poll-maker' ),
260 + 'searching' => esc_html__( "Searching...", 'poll-maker' ),
261 + 'activated' => esc_html__( "Activated", 'poll-maker' ),
262 + 'errorMsg' => esc_html__( "Error", 'poll-maker' ),
263 + 'loadResource' => esc_html__( "Can't load resource.", 'poll-maker' ),
264 + 'somethingWentWrong' => esc_html__( "Maybe something went wrong.", 'poll-maker' ),
265 + 'greateJob' => esc_html__( 'Great job', 'poll-maker'),
266 + 'formMoreDetailed' => esc_html__( 'For more detailed configuration visit', 'poll-maker'),
267 + 'greate' => esc_html__( 'Great!', 'poll-maker'),
268 +
243 269 ));
244 270
245 271 wp_enqueue_script( $this->plugin_name . '-quick-start-js', plugin_dir_url(__FILE__) . 'js/poll-maker-poll-quick-start.js', array('jquery'), $this->version, true);
246 272 wp_enqueue_script( $this->plugin_name . '-admin-ajax', plugin_dir_url(__FILE__) . 'js/poll-maker-ays-ajax-admin.js', array('jquery'), $this->version, true);
247 - wp_localize_script($this->plugin_name . '-admin-ajax', 'apm_ajax_obj', array('ajaxUrl' => admin_url('admin-ajax.php')));
273 +
274 + wp_localize_script($this->plugin_name . '-admin-ajax', 'poll_maker_ajax', array(
275 + 'ajax_url' => admin_url('admin-ajax.php'),
276 + 'nonce' => wp_create_nonce('ays_poll_nonce'),
277 + "emptyEmailError" => esc_html__( 'Email field is empty', 'poll-maker'),
278 + "invalidEmailError" => esc_html__( 'Invalid Email address', 'poll-maker'),
279 + 'selectUser' => esc_html__( 'Select user', 'poll-maker'),
280 + 'pleaseEnterMore' => esc_html__( "Please enter 1 or more characters", 'poll-maker' ),
281 + 'searching' => esc_html__( "Searching...", 'poll-maker' ),
282 + 'activated' => esc_html__( "Activated", 'poll-maker' ),
283 + 'errorMsg' => esc_html__( "Error", 'poll-maker' ),
284 + 'loadResource' => esc_html__( "Can't load resource.", 'poll-maker' ),
285 + 'somethingWentWrong' => esc_html__( "Maybe something went wrong.", 'poll-maker' ),
286 + 'youCanUuseThisShortcode' => esc_html__( 'Copy the generated shortcode and paste it into any post or page to display Poll.', 'poll-maker'),
287 + 'youPollIsCreated' => esc_html__( 'Your Poll is Created!', 'poll-maker'),
288 + 'greateJob' => esc_html__( 'Great job', 'poll-maker'),
289 + 'formMoreDetailed' => esc_html__( 'For more detailed configuration visit', 'poll-maker'),
290 + 'editpollPage' => esc_html__( 'edit poll page', 'poll-maker'),
291 + 'greate' => esc_html__( 'Great!', 'poll-maker'),
292 + 'thumbsUpGreat' => esc_html__( 'Thumbs up, great!', 'poll-maker'),
293 + "preivewPoll" => esc_html__( "Preview Poll", 'poll-maker' ),
248 294
295 + "checklistMarkAsDone" => esc_html__( "Mark as done", 'poll-maker' ),
296 + "checklistUnmarkAsDone" => esc_html__( "Unmark as done", 'poll-maker' ),
297 + ));
249 298 $color_picker_strings = array(
250 - 'clear' => __('Clear', "poll-maker"),
251 - 'clearAriaLabel' => __('Clear color', "poll-maker"),
252 - 'defaultString' => __('Default', "poll-maker"),
253 - 'defaultAriaLabel' => __('Select default color', "poll-maker"),
254 - 'pick' => __('Select Color', "poll-maker"),
255 - 'defaultLabel' => __('Color value', "poll-maker"),
299 + 'clear' =>esc_html__('Clear', "poll-maker"),
300 + 'clearAriaLabel' =>esc_html__('Clear color', "poll-maker"),
301 + 'defaultString' =>esc_html__('Default', "poll-maker"),
302 + 'defaultAriaLabel' =>esc_html__('Select default color', "poll-maker"),
303 + 'pick' =>esc_html__('Select Color', "poll-maker"),
304 + 'defaultLabel' =>esc_html__('Color value', "poll-maker"),
256 305 );
257 306 wp_localize_script( $this->plugin_name.'-wp-color-picker-alpha', 'wpColorPickerL10n', $color_picker_strings );
258 307 }
259 308
309 + public function ays_poll_add_body_class( $classes ) {
310 + global $pagenow;
311 +
312 + if ( $pagenow === 'admin.php' ) {
313 + $page = isset( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : '';
314 +
315 + if ( strpos( $page, $this->plugin_name ) === 0 ) {
316 + $classes .= ' ays-poll-plugin-admin';
317 + }
318 + }
319 +
320 + return $classes;
321 + }
322 +
260 323 /**
261 324 * De-register JavaScript files for the admin area.
262 325 *
263 326 * @since 1.0.0
@@ -269,19 +332,102 @@
269 332 wp_deregister_script('mwai-vendor');
270 333 wp_dequeue_script('mwai');
271 334 wp_dequeue_script('mwai-vendor');
272 335 }
336 +
337 + if (is_plugin_active('html5-video-player/html5-video-player.php')) {
338 + wp_dequeue_style('h5vp-admin');
339 + wp_dequeue_style('fs_common');
340 + }
341 +
342 + if (is_plugin_active('panorama/panorama.php')) {
343 + wp_dequeue_style('bppiv_admin_custom_css');
344 + wp_dequeue_style('bppiv-custom-style');
345 + }
346 +
347 + if (is_plugin_active('wp-social/wp-social.php')) {
348 + wp_dequeue_style('wp_social_select2_css');
349 + wp_deregister_script('wp_social_select2_js');
350 + wp_dequeue_script('wp_social_select2_js');
351 + }
352 +
353 + if (is_plugin_active('real-media-library-lite/index.php')) {
354 + wp_dequeue_style('real-media-library-lite-rml');
355 + }
356 +
357 + // Theme | Pixel Ebook Store
358 + wp_dequeue_style('pixel-ebook-store-free-demo-content-style');
359 +
360 + // Theme | Interactive Education
361 + wp_dequeue_style('interactive-education-free-demo-content-style');
362 +
363 + // Theme | Phlox 2.17.6
364 + wp_dequeue_style('auxin-admin-style');
273 365 }
274 366 }
275 367
368 + public function ays_poll_disable_all_notice_from_plugin() {
369 + if (!function_exists('get_current_screen')) {
370 + return;
371 + }
372 +
373 + $screen = get_current_screen();
374 +
375 + if (empty($screen) || strpos($screen->id, $this->plugin_name) === false) {
376 + return;
377 + }
378 +
379 + global $wp_filter;
380 +
381 + // Keep plugin-specific notices
382 + $our_plugin_notices = array();
383 +
384 + $exclude_functions = [
385 + 'poll_maker_admin_notice',
386 + ];
387 +
388 + if (!empty($wp_filter['admin_notices'])) {
389 + foreach ($wp_filter['admin_notices']->callbacks as $priority => $callbacks) {
390 + foreach ($callbacks as $key => $callback) {
391 + // For class-based methods
392 + if (
393 + is_array($callback['function']) &&
394 + is_object($callback['function'][0]) &&
395 + get_class($callback['function'][0]) === __CLASS__
396 + ) {
397 + $our_plugin_notices[$priority][$key] = $callback;
398 + }
399 + // For standalone functions
400 + elseif (
401 + is_string($callback['function']) &&
402 + in_array($callback['function'], $exclude_functions)
403 + ) {
404 + $our_plugin_notices[$priority][$key] = $callback;
405 + }
406 + }
407 + }
408 + }
409 +
410 + // Remove all notices
411 + remove_all_actions('admin_notices');
412 + remove_all_actions('all_admin_notices');
413 +
414 + // Re-add only your plugin's notices
415 + foreach ($our_plugin_notices as $priority => $callbacks) {
416 + foreach ($callbacks as $callback) {
417 + add_action('admin_notices', $callback['function'], $priority);
418 + }
419 + }
420 + }
421 +
276 422 public function codemirror_enqueue_scripts($hook) {
277 423 if(strpos($hook, $this->plugin_name) !== false){
278 424 if(function_exists('wp_enqueue_code_editor')){
279 425 $cm_settings['codeEditor'] = wp_enqueue_code_editor(array(
280 - 'type' => 'text/css',
281 - 'codemirror' => array(
282 - 'inputStyle' => 'contenteditable',
283 - 'theme' => 'cobalt',
426 + 'type' => 'text/css',
427 + 'codemirror' => array(
428 + 'inputStyle' => 'contenteditable',
429 + 'theme' => 'cobalt',
284 430 )
285 431 ));
286 432
287 433 wp_enqueue_script('wp-theme-plugin-editor');
@@ -309,17 +455,30 @@
309 455 }
310 456
311 457 public function add_plugin_admin_menu() {
312 458
459 + $settings_actions = new Poll_Maker_Settings_Actions($this->plugin_name);
460 + $options_setting = $settings_actions->ays_get_setting('options');
461 + $options = ($options_setting === false) ? array() : json_decode(stripcslashes($options_setting), true);
462 + $options = is_array($options) ? $options : array();
463 + $disable_poll_menu_notification = isset($options['poll_disable_poll_menu_notification']) && esc_attr($options['poll_disable_poll_menu_notification']) === 'on';
464 +
465 + $menu_item = 'Poll Maker';
466 + if (!$disable_poll_menu_notification) {
467 + /*
468 + * Check unread results
469 + *
470 + */
471 + global $wpdb;
472 + $sql = "SELECT COUNT(unread) FROM {$wpdb->prefix}ayspoll_reports WHERE unread=1";
473 + $unread_results = $wpdb->get_var($sql);
474 +
475 + if ($unread_results > 0) {
476 + $menu_item .= '<span style="margin-right: 10px;" class="apm-badge badge badge-danger">' . $unread_results . '</span>';
477 + }
478 + }
479 +
313 480 /*
314 - * Check unread results
315 - *
316 - */
317 - global $wpdb;
318 - $sql = "SELECT COUNT(unread) FROM {$wpdb->prefix}ayspoll_reports WHERE unread=1";
319 - $unread_results = $wpdb->get_var($sql);
320 - $show = $unread_results > 0 ? '' : "apm-no-results";
321 - /*
322 481 * Add a settings page for this plugin to the Settings menu.
323 482 *
324 483 * NOTE: Alternative menu locations are available via WordPress administration menu functions.
325 484 *
@@ -326,10 +485,8 @@
326 485 * Administration Menus: http://codex.wordpress.org/Administration_Menus
327 486 *
328 487 */
329 488
330 - $menu_item = ($unread_results == 0) ? 'Poll Maker' : 'Poll Maker' . '<span class="apm-badge badge badge-danger '.$show.'">' . $unread_results . '</span>';
331 -
332 489 $this->capability = $this->poll_maker_capabilities();
333 490 $capability = $this->poll_maker_capabilities();
334 491 $hook_poll = add_menu_page(
335 492 'Poll Maker',
@@ -336,10 +493,10 @@
336 493 $menu_item,
337 494 $capability,
338 495 $this->plugin_name,
339 496 array($this,'display_plugin_polls_page'),
340 - POLL_MAKER_AYS_ADMIN_URL . '/images/icons/icon-poll-maker-128x128.svg',
341 - '6.33'
497 + esc_url(POLL_MAKER_AYS_ADMIN_URL) . '/images/icons/icon-poll-maker-128x128.svg',
498 + '25.20'
342 499 );
343 500
344 501 add_action("load-$hook_poll", array($this, 'screen_option_polls'));
345 502 add_action("load-$hook_poll", array($this, 'add_tabs'));
@@ -345,10 +502,10 @@
345 502 add_action("load-$hook_poll", array($this, 'add_tabs'));
346 503
347 504 $hook_results_each = add_submenu_page(
348 505 'all_results_slug',
349 - __('Results per poll', "poll-maker"),
350 - __('Results per poll', "poll-maker"),
506 + esc_html__('Results per poll', "poll-maker"),
507 + esc_html__('Results per poll', "poll-maker"),
351 508 $capability,
352 509 $this->plugin_name . '-results-each',
353 510 array($this, 'display_plugin_results_each_page')
354 511 );
@@ -356,15 +513,29 @@
356 513
357 514 }
358 515
359 516
517 + public function add_plugin_dashboard_submenu() {
518 + $capability = $this->poll_maker_capabilities();
519 +
520 + $hook_polls = add_submenu_page(
521 + $this->plugin_name,
522 + esc_html__('Dashboard', "poll-maker"),
523 + esc_html__('Dashboard', "poll-maker"),
524 + $capability,
525 + $this->plugin_name . "-dashboard",
526 + array($this, 'display_plugin_dashboard_page')
527 + );
528 + }
529 +
530 +
360 531 public function add_plugin_polls_submenu() {
361 532 $capability = $this->poll_maker_capabilities();
362 533
363 534 $hook_polls = add_submenu_page(
364 535 $this->plugin_name,
365 - __('All Polls', "poll-maker"),
366 - __('All Polls', "poll-maker"),
536 + esc_html__('All Polls', "poll-maker"),
537 + esc_html__('All Polls', "poll-maker"),
367 538 $capability,
368 539 $this->plugin_name,
369 540 array($this, 'display_plugin_polls_page')
370 541 );
@@ -376,10 +547,10 @@
376 547 $capability = $this->poll_maker_capabilities();
377 548
378 549 $hook_polls = add_submenu_page(
379 550 $this->plugin_name,
380 - __('Add new', "poll-maker"),
381 - __('Add new', "poll-maker"),
551 + esc_html__('Add new', "poll-maker"),
552 + esc_html__('Add new', "poll-maker"),
382 553 $capability,
383 554 $this->plugin_name . '-add-new',
384 555 array($this, 'display_plugin_add_new_poll_page')
385 556 );
@@ -389,10 +560,10 @@
389 560 $capability = $this->poll_maker_capabilities();
390 561
391 562 $hook_cats = add_submenu_page(
392 563 $this->plugin_name,
393 - __('Categories', "poll-maker"),
394 - __('Categories', "poll-maker"),
564 + esc_html__('Categories', "poll-maker"),
565 + esc_html__('Categories', "poll-maker"),
395 566 $capability,
396 567 $this->plugin_name . '-cats',
397 568 array($this, 'display_plugin_cats_page')
398 569 );
@@ -413,10 +584,10 @@
413 584 $capability = $this->poll_maker_capabilities();
414 585
415 586 $hook_results = add_submenu_page(
416 587 $this->plugin_name,
417 - __('Results', "poll-maker"),
418 - __('Results', "poll-maker") . " <span class=\"apm-badge badge badge-danger $show\">$unread_results</span>",
588 + esc_html__('Results', "poll-maker"),
589 + esc_html__('Results', "poll-maker") . " <span class=\"apm-badge badge badge-danger $show\">$unread_results</span>",
419 590 $capability,
420 591 $this->plugin_name . '-results',
421 592 array($this, 'display_plugin_results_page')
422 593 );
@@ -424,9 +595,9 @@
424 595 add_action("load-$hook_results", array($this, 'add_tabs'));
425 596
426 597 $hook_all_results = add_submenu_page(
427 598 'all_results_slug',
428 - __('Results', "poll-maker"),
599 + esc_html__('Results', "poll-maker"),
429 600 $capability,
430 601 $this->capability,
431 602 $this->plugin_name . '-all-results',
432 603 array($this, 'display_plugin_all_results_page')
@@ -440,10 +611,10 @@
440 611 public function add_plugin_formfields_submenu() {
441 612
442 613 $hook_formfields = add_submenu_page(
443 614 $this->plugin_name,
444 - __('Custom Fields', "poll-maker"),
445 - __('Custom Fields', "poll-maker"),
615 + esc_html__('Custom Fields', "poll-maker"),
616 + esc_html__('Custom Fields', "poll-maker"),
446 617 'manage_options',
447 618 $this->plugin_name . '-formfields',
448 619 array($this, 'display_plugin_formfields_page')
449 620 );
@@ -451,10 +622,10 @@
451 622 }
452 623
453 624 public function add_plugin_general_settings_submenu() {
454 625 $hook_settings = add_submenu_page($this->plugin_name,
455 - __('General Settings', "poll-maker"),
456 - __('General Settings', "poll-maker"),
626 + esc_html__('General Settings', "poll-maker"),
627 + esc_html__('General Settings', "poll-maker"),
457 628 'manage_options',
458 629 $this->plugin_name . '-settings',
459 630 array($this, 'display_plugin_settings_page')
460 631 );
@@ -464,10 +635,10 @@
464 635
465 636 public function add_plugin_how_to_use_submenu() {
466 637 $hook_pro_features = add_submenu_page(
467 638 $this->plugin_name,
468 - __('How to use', "poll-maker"),
469 - __('How to use', "poll-maker"),
639 + esc_html__('How to use', "poll-maker"),
640 + esc_html__('How to use', "poll-maker"),
470 641 'manage_options',
471 642 $this->plugin_name . '-how-to-use',
472 643 array($this, 'display_plugin_how_to_use_page')
473 644 );
@@ -476,10 +647,10 @@
476 647
477 648 public function add_plugin_pro_features_submenu() {
478 649 $hook_pro_features = add_submenu_page(
479 650 $this->plugin_name,
480 - __('PRO features', "poll-maker"),
481 - __('PRO features', "poll-maker"),
651 + esc_html__('PRO features', "poll-maker"),
652 + esc_html__('PRO features', "poll-maker"),
482 653 'manage_options',
483 654 $this->plugin_name . '-pro-features',
484 655 array($this, 'display_plugin_pro_features_page')
485 656 );
@@ -487,73 +658,17 @@
487 658 }
488 659
489 660 public function add_plugin_featured_plugins_submenu(){
490 661 $hook_pro_features = add_submenu_page( $this->plugin_name,
491 - __('Our products', "poll-maker"),
492 - __('Our products', "poll-maker"),
662 + esc_html__('Our products', "poll-maker"),
663 + esc_html__('Our products', "poll-maker"),
493 664 'manage_options',
494 665 $this->plugin_name . '-featured-plugins',
495 666 array($this, 'display_plugin_featured_plugins_page')
496 667 );
497 668 add_action("load-$hook_pro_features", array($this, 'add_tabs'));
498 - }
669 + }
499 670
500 - public function display_poll_creation_popup() {
501 - $is_challange_enabled = get_option('ays_poll_maker_poll_creation_challange', false);
502 -
503 - if (!$is_challange_enabled) {
504 - return;
505 - }
506 -
507 - if (isset($_GET['page']) && strpos($_GET['page'], POLL_MAKER_AYS_NAME) !== false) {
508 - $poll_ajax_challenge_cancel_nonce = wp_create_nonce( 'poll-maker-ajax-challenge-cancel-nonce' );
509 - ?>
510 - <div class="poll-maker-challenge">
511 - <div class="poll-maker-challenge-list-block">
512 - <i class="fa fa-times-circle list-block-button poll-maker-challenge-cancel" aria-hidden="true" title="Cancel challenge"></i>
513 - <input type="hidden" id="poll_maker_ajax_challenge_cancel_nonce" name="poll_maker_ajax_challenge_cancel_nonce" value="<?php echo $poll_ajax_challenge_cancel_nonce ?>">
514 - <ul class="poll-maker-challenge-list">
515 - <li class="poll-maker-challenge-step-item"><?php echo __('Add a New Poll', "poll-maker"); ?></li>
516 - <li class="poll-maker-challenge-step-item"><?php echo __('Name Your Poll', "poll-maker"); ?></li>
517 - <li class="poll-maker-challenge-step-item"><?php echo __('Add Options', "poll-maker"); ?></li>
518 - <li class="poll-maker-challenge-step-item"><?php echo __('Save the Poll', "poll-maker"); ?></li>
519 - <li class="poll-maker-challenge-step-item"><?php echo __('Copy the Shortcode', "poll-maker"); ?></li>
520 - <li class="poll-maker-challenge-step-item"><?php echo __('Embed in a Page', "poll-maker"); ?></li>
521 - </ul>
522 - </div>
523 - <div class="poll-maker-challenge-block-timer">
524 - <img src="<?php echo POLL_MAKER_AYS_ADMIN_URL ?>/images/icons/poll-maker-logo.png" alt="Poll Maker logo">
525 - <h3>Poll Maker</h3>
526 - </div>
527 - </div>
528 - <?php
529 - }
530 - }
531 -
532 - public function delete_challenge_box() {
533 - // Run a security check.
534 - check_ajax_referer( 'poll-maker-ajax-challenge-cancel-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
535 -
536 - // Check for permissions.
537 - if ( ! current_user_can( 'manage_options' ) ) {
538 - ob_end_clean();
539 - $ob_get_clean = ob_get_clean();
540 - echo json_encode(array("success" => false));
541 - wp_die();
542 - }
543 -
544 - $result = array("success" => false);
545 - if( is_user_logged_in() ) {
546 - delete_option('ays_poll_maker_poll_creation_challange');
547 - $result = array("success" => true);
548 - }
549 -
550 - ob_end_clean();
551 - $ob_get_clean = ob_get_clean();
552 - echo json_encode($result);
553 - wp_die();
554 - }
555 -
556 671 /**
557 672 * Add settings action link to the plugins page.
558 673 *
559 674 * @since 1.0.0
@@ -565,11 +680,11 @@
565 680 */
566 681 $poll_ajax_deactivate_plugin_nonce = wp_create_nonce( 'poll-maker-ajax-deactivate-plugin-nonce' );
567 682
568 683 $settings_link = array(
569 - '<a href="' . admin_url('admin.php?page=' . $this->plugin_name) . '">' . __('Settings', "poll-maker") . '</a>',
570 - '<a href="https://poll-plugin.com/wordpress-poll-plugin-free-demo/" target="_blank">' . __('Demo', "poll-maker") . '</a>',
571 - '<a href="https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=plugins-buy-now-button" class="ays-poll-upgrade-plugin-btn" style="font-weight:bold;color:#01A32A;" target="_blank">' . __('Upgrade 50% Sale', "poll-maker") . '</a><input type="hidden" id="ays_poll_maker_ajax_deactivate_plugin_nonce" name="ays_poll_maker_ajax_deactivate_plugin_nonce" value="' . $poll_ajax_deactivate_plugin_nonce .'">',
684 + '<a href="' . admin_url('admin.php?page=' . $this->plugin_name) . '">' .esc_html__('Settings', "poll-maker") . '</a>',
685 + '<a href="https://poll-plugin.com/wordpress-poll-plugin-free-demo/" target="_blank">' .esc_html__('Demo', "poll-maker") . '</a>',
686 + '<a href="https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=plugins-buy-now-button" class="ays-poll-upgrade-plugin-btn" style="font-weight:bold;color:#01A32A;" target="_blank">' .esc_html__('Upgrade 50% Sale', "poll-maker") . '</a><input type="hidden" id="ays_poll_maker_ajax_deactivate_plugin_nonce" name="ays_poll_maker_ajax_deactivate_plugin_nonce" value="' . $poll_ajax_deactivate_plugin_nonce .'">',
572 687 );
573 688
574 689 return array_merge($settings_link, $links);
575 690
@@ -593,9 +708,22 @@
593 708 * Render the settings page for this plugin.
594 709 *
595 710 * @since 1.0.0
596 711 */
712 + public function display_plugin_dashboard_page() {
713 + if ( ! class_exists( 'Poll_Maker_Ays_Welcome' ) ) {
714 + require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-poll-maker-ays-welcome.php';
715 + }
716 + $welcome_page = new Poll_Maker_Ays_Welcome();
717 + $welcome_page->output(true);
718 + }
597 719
720 + /**
721 + * Render the settings page for this plugin.
722 + *
723 + * @since 1.0.0
724 + */
725 +
598 726 public function display_plugin_polls_page() {
599 727 $action = (isset($_GET['action'])) ? sanitize_text_field($_GET['action']) : '';
600 728
601 729 switch ( $action ) {
@@ -655,19 +783,42 @@
655 783 }
656 784
657 785 public static function set_screen( $status, $option, $value ) {
658 786 return $value;
787 + }
788 +
789 + public function poll_hide_screen_options( $show_screen, $screen ) {
790 + // How check screen ID: get_current_screen()->id
791 +
792 + if ( empty( $screen->id ) ) {
793 + return $show_screen;
794 + }
795 +
796 + if (
797 + strpos( $screen->id, 'toplevel_page_poll-maker-ays' ) !== false ||
798 + strpos( $screen->id, '_page_poll-maker-ays-cats' ) !== false ||
799 + strpos( $screen->id, '_page_poll-maker-ays-settings' ) !== false
800 + ) {
801 + return false;
802 + }
803 +
804 + return $show_screen;
659 805 }
660 806
661 807 public function screen_option_polls() {
662 808 $option = 'per_page';
663 809 $args = array(
664 - 'label' => __('Polls', "poll-maker"),
810 + 'label' =>esc_html__('Polls', "poll-maker"),
665 811 'default' => 20,
666 812 'option' => 'polls_per_page',
667 813 );
668 814
669 - add_screen_option($option, $args);
815 + if( ! ( isset( $_GET['action'] ) && ( $_GET['action'] == 'add' || $_GET['action'] == 'edit' ) ) ){
816 + add_screen_option($option, $args);
817 + }else{
818 + add_filter('screen_options_show_screen', array($this, 'poll_hide_screen_options'), 10, 2);
819 + }
820 +
670 821 $this->polls_obj = new Polls_List_Table($this->plugin_name);
671 822 $this->settings_obj = new Poll_Maker_Settings_Actions($this->plugin_name);
672 823
673 824 }
@@ -674,14 +825,19 @@
674 825
675 826 public function screen_option_cats() {
676 827 $option = 'per_page';
677 828 $args = array(
678 - 'label' => __('Categories', "poll-maker"),
829 + 'label' =>esc_html__('Categories', "poll-maker"),
679 830 'default' => 5,
680 831 'option' => 'poll_cats_per_page',
681 832 );
682 833
683 - add_screen_option($option, $args);
834 + if( ! ( isset( $_GET['action'] ) && ( $_GET['action'] == 'add' || $_GET['action'] == 'edit' ) ) ){
835 + add_screen_option($option, $args);
836 + }else{
837 + add_filter('screen_options_show_screen', array($this, 'poll_hide_screen_options'), 10, 2);
838 + }
839 +
684 840 $this->cats_obj = new Pma_Categories_List_Table($this->plugin_name);
685 841 $this->settings_obj = new Poll_Maker_Settings_Actions($this->plugin_name);
686 842 }
687 843
@@ -687,13 +843,13 @@
687 843
688 844 public function screen_option_results() {
689 845 $option = 'per_page';
690 846 $args = array(
691 - 'label' => __('Results', "poll-maker"),
847 + 'label' =>esc_html__('Results', "poll-maker"),
692 848 'default' => 50,
693 849 'option' => 'poll_results_per_page',
694 850 );
695 -
851 +
696 852 add_screen_option($option, $args);
697 853 $this->results_obj = new Pma_Results_List_Table($this->plugin_name);
698 854 // $this->answer_results_obj = new Poll_Answer_Results($this->plugin_name);
699 855 }
@@ -700,9 +856,9 @@
700 856
701 857 public function screen_option_each_results() {
702 858 $option = 'per_page';
703 859 $args = array(
704 - 'label' => __('Results per poll', "poll-maker"),
860 + 'label' =>esc_html__('Results per poll', "poll-maker"),
705 861 'default' => 50,
706 862 'option' => 'poll_each_results_per_page',
707 863 );
708 864
@@ -765,10 +921,19 @@
765 921 }
766 922
767 923 public function apm_deactivate_plugin_option() {
768 924 // Run a security check.
769 - check_ajax_referer( 'poll-maker-ajax-deactivate-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
770 -
925 + if (isset($_REQUEST['_ajax_nonce'])) {
926 + check_ajax_referer('poll-maker-ajax-deactivate-plugin-nonce', sanitize_key($_REQUEST['_ajax_nonce']));
927 + } else {
928 + // For multisite, if nonce is missing
929 + if (function_exists('is_multisite') && is_multisite()) {
930 + // Skip nonce verification for multisite
931 + } else {
932 + wp_send_json_error('Nonce verification failed');
933 + wp_die();
934 + }
935 + }
771 936 // Check for permissions.
772 937 if ( ! current_user_can( 'manage_options' ) ) {
773 938 ob_end_clean();
774 939 $ob_get_clean = ob_get_clean();
@@ -779,19 +944,19 @@
779 944 }
780 945
781 946 if( is_user_logged_in() ) {
782 947 $request_value = esc_sql( sanitize_text_field( $_REQUEST['upgrade_plugin'] ) );
783 - $upgrade_option = get_option('ays_poll_maker_upgrade_plugin','');
784 - if($upgrade_option === ''){
785 - add_option('ays_poll_maker_upgrade_plugin',$request_value);
786 - }else{
787 - update_option('ays_poll_maker_upgrade_plugin',$request_value);
788 - }
789 - ob_end_clean();
790 - $ob_get_clean = ob_get_clean();
791 - echo json_encode(array(
792 - 'option' => get_option('ays_poll_maker_upgrade_plugin', '')
793 - ));
948 + $upgrade_option = get_option('ays_poll_maker_upgrade_plugin','');
949 + if($upgrade_option === ''){
950 + add_option('ays_poll_maker_upgrade_plugin',$request_value);
951 + }else{
952 + update_option('ays_poll_maker_upgrade_plugin',$request_value);
953 + }
954 + ob_end_clean();
955 + $ob_get_clean = ob_get_clean();
956 + echo json_encode(array(
957 + 'option' => get_option('ays_poll_maker_upgrade_plugin', '')
958 + ));
794 959 wp_die();
795 960 } else {
796 961 ob_end_clean();
797 962 $ob_get_clean = ob_get_clean();
@@ -864,17 +1029,17 @@
864 1029 $region = isset($json->region) && $json->region != '' ? $json->region : '';
865 1030 $city = isset($json->city) && $json->city != '' ? $json->city : '';
866 1031 }
867 1032 $from = "$city, $region, $country, $user_ip";
868 - $row = '<tr><td colspan="4"><h1>' . __('Poll Information', "poll-maker") . "</h1></td></tr>
1033 + $row = '<tr><td colspan="4"><h1>' .esc_html__('Poll Information', "poll-maker") . "</h1></td></tr>
869 1034 <tr class='ays_result_element'>
870 - <td>". __('Poll Title', "poll-maker")."</td>
1035 + <td>".esc_html__('Poll Title', "poll-maker")."</td>
871 1036 <td>{$poll['title']}</td>
872 1037 <td></td>
873 1038 <td></td>
874 1039 </tr>";
875 1040 $row .= "<tr class='ays_result_element'>
876 - <td>". __('Poll Type', "poll-maker")."</td>
1041 + <td>".esc_html__('Poll Type', "poll-maker")."</td>
877 1042 <td>" . ucfirst($poll['type']) . "</td>
878 1043 <td></td>
879 1044 <td></td>
880 1045 </tr>";
@@ -880,9 +1045,9 @@
880 1045 </tr>";
881 1046 switch ( $poll['type'] ) {
882 1047 case 'choosing':
883 1048 $row .= "<tr class='ays_result_element'>
884 - <td>". __('Answer', "poll-maker")."</td>
1049 + <td>".esc_html__('Answer', "poll-maker")."</td>
885 1050 <td>" . (in_array($poll['answers'][0]['answer'], $multivote_answers) ? "<b><em>" . stripslashes($poll['answers'][0]['answer']) . "</em></b>" : stripslashes($poll['answers'][0]['answer'])) . "</td>
886 1051 <td></td>
887 1052 <td></td>
888 1053 </tr>";
@@ -899,9 +1064,9 @@
899 1064 }
900 1065 break;
901 1066 case 'text':
902 1067 $row .= "<tr class='ays_result_element'>
903 - <td>". __('Answer', "poll-maker")."</td>
1068 + <td>".esc_html__('Answer', "poll-maker")."</td>
904 1069 <td><b><em>" . $answer['answer'] . "</em></b></td>
905 1070 <td></td>
906 1071 <td></td>
907 1072 </tr>";
@@ -907,9 +1072,9 @@
907 1072 </tr>";
908 1073 break;
909 1074 case 'rating':
910 1075 $row .= "<tr class='ays_result_element'>
911 - <td>". __('Answer', "poll-maker")."</td>
1076 + <td>".esc_html__('Answer', "poll-maker")."</td>
912 1077 <td><div class='apm-rating-res'>";
913 1078 if ($poll['view_type'] == 'star') {
914 1079 foreach ( $poll['answers'] as $ans ) {
915 1080 $row .= "<i class='" . ($ans['answer'] <= $answer['answer'] ? "ays_poll_fas" : "ays_poll_far") . " ays_poll_fa-star'></i>";
@@ -933,9 +1098,9 @@
933 1098 </tr>";
934 1099 break;
935 1100 case 'voting':
936 1101 $row .= "<tr class='ays_result_element'>
937 - <td>". __('Answer', "poll-maker")."</td>
1102 + <td>".esc_html__('Answer', "poll-maker")."</td>
938 1103 <td><div class='apm-rating-res'>";
939 1104 $icons = array(
940 1105 'hand' => array(
941 1106 "ays_poll_fa-thumbs-up",
@@ -955,18 +1120,18 @@
955 1120 </tr>";
956 1121 break;
957 1122 }
958 1123 $row .= "<tr class='ays_result_element'>
959 - <td>". __('Answer Datetime', "poll-maker")."</td>
1124 + <td>".esc_html__('Answer Datetime', "poll-maker")."</td>
960 1125 <td>" . (date('H:i:s d.m.Y', strtotime($time))) . "</td>
961 1126 <td></td>
962 1127 <td></td>
963 1128 </tr>";
964 1129 $row .= "<tr class='hr-line'><td colspan='4'><hr></td></tr>";
965 - $row .= '<tr><td colspan="4"><h1>' . __('User Information', "poll-maker") . "</h1></td></tr>";
1130 + $row .= '<tr><td colspan="4"><h1>' .esc_html__('User Information', "poll-maker") . "</h1></td></tr>";
966 1131 if ($json !== null) {
967 1132 $row .= "<tr class='ays_result_element'>
968 - <td>". __('User IP', "poll-maker")."</td>
1133 + <td>".esc_html__('User IP', "poll-maker")."</td>
969 1134 <td>$from</td>
970 1135 <td></td>
971 1136 <td></td>
972 1137 </tr>";
@@ -972,9 +1137,9 @@
972 1137 </tr>";
973 1138 }
974 1139 if(!empty($user_email)){
975 1140 $row .= "<tr class='ays_result_element'>
976 - <td>". __('User E-mail', "poll-maker")."</td>
1141 + <td>".esc_html__('User E-mail', "poll-maker")."</td>
977 1142 <td>$user_email</td>
978 1143 <td></td>
979 1144 <td></td>
980 1145 </tr>";
@@ -984,9 +1149,9 @@
984 1149 continue;
985 1150 }
986 1151
987 1152 $row .= "<tr class='ays_result_element'>
988 - <td>". $key ."</td>
1153 + <td>". esc_html__( $key, "poll-maker") ."</td>
989 1154 <td>". $value ."</td>
990 1155 <td></td>
991 1156 <td></td>
992 1157 </tr>";
@@ -1074,8 +1239,9 @@
1074 1239 return $all;
1075 1240 }
1076 1241
1077 1242 public function screen_option_settings() {
1243 + add_filter('screen_options_show_screen', array($this, 'poll_hide_screen_options'), 10, 2);
1078 1244 $this->polls_obj = new Polls_List_Table($this->plugin_name);
1079 1245 $this->settings_obj = new Poll_Maker_Settings_Actions($this->plugin_name);
1080 1246 }
1081 1247
@@ -1089,18 +1255,18 @@
1089 1255
1090 1256 $curl = curl_init();
1091 1257
1092 1258 curl_setopt_array($curl, array(
1093 - CURLOPT_URL => "https://" . $api_postfix . ".api.mailchimp.com/3.0/lists",
1094 - CURLOPT_RETURNTRANSFER => true,
1095 - CURLOPT_ENCODING => "",
1096 - CURLOPT_MAXREDIRS => 10,
1097 - CURLOPT_TIMEOUT => 30,
1098 - CURLOPT_SSL_VERIFYPEER => false,
1099 - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
1100 - CURLOPT_CUSTOMREQUEST => "GET",
1101 - CURLOPT_USERPWD => "$username:$api_key",
1102 - CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
1259 + CURLOPT_URL => "https://" . $api_postfix . ".api.mailchimp.com/3.0/lists",
1260 + CURLOPT_RETURNTRANSFER => true,
1261 + CURLOPT_ENCODING => "",
1262 + CURLOPT_MAXREDIRS => 10,
1263 + CURLOPT_TIMEOUT => 30,
1264 + CURLOPT_SSL_VERIFYPEER => false,
1265 + CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
1266 + CURLOPT_CUSTOMREQUEST => "GET",
1267 + CURLOPT_USERPWD => "$username:$api_key",
1268 + CURLOPT_HTTPAUTH => CURLAUTH_BASIC,
1103 1269 // CURLOPT_POSTFIELDS => "undefined=",
1104 1270 CURLOPT_HTTPHEADER => array(
1105 1271 "Content-Type: application/json",
1106 1272 "cache-control: no-cache"
@@ -1300,8 +1466,144 @@
1300 1466 }
1301 1467 return $capability;
1302 1468 }
1303 1469
1470 + public function ays_poll_exclude_custom_post_type_from_sitemap($exclude, $type){
1471 + if($type == 'ays-poll-maker'){
1472 + return $type;
1473 + }
1474 + }
1475 +
1476 + public function ays_poll_add_checklist_guide(){
1477 +
1478 + if(!empty($_REQUEST['page']) && sanitize_text_field( $_REQUEST['page'] ) != $this->plugin_name . "-getting-started"){
1479 + if(false !== strpos( sanitize_text_field( $_REQUEST['page'] ), $this->plugin_name)){
1480 + $current_user_id = get_current_user_id();
1481 + $completed_steps = get_user_meta($current_user_id, 'ays_poll_checklist_completed_steps', true);
1482 +
1483 + // Make sure we always get an array
1484 + if (!is_array($completed_steps)) {
1485 + $completed_steps = array();
1486 + }
1487 +
1488 + $popup_closed = get_user_meta($current_user_id, 'ays_poll_checklist_popup_closed', true);
1489 +
1490 + $checklist_steps = array(
1491 + array(
1492 + 'title' => esc_html__('Add a New Poll', 'poll-maker'),
1493 + ),
1494 + array(
1495 + 'title' => esc_html__('Add Options', 'poll-maker'),
1496 + ),
1497 + array(
1498 + 'title' => esc_html__('Save the Poll', 'poll-maker'),
1499 + ),
1500 + array(
1501 + 'title' => esc_html__('Copy the Shortcode', 'poll-maker'),
1502 + 'img_style' => 'object-fit:contain; height:auto;',
1503 + ),
1504 + );
1505 + ?>
1506 + <div class="ays-poll-checklist-panel" id="ays-poll-checklist-container" style="<?php echo ($popup_closed) ? 'display: none;' : ''; ?>">
1507 + <header class="ays-poll-checklist-header">
1508 + <h3><?php echo esc_html__('Create a Poll with 4 Easy Steps', 'poll-maker'); ?></h3>
1509 +
1510 + <!-- Minimize Button -->
1511 + <button class="ays-poll-checklist-minimize-btn" aria-label="Minimize">
1512 + <svg class="ays-poll-checklist-minimize-icon-expanded" width="24" height="24" viewBox="0 0 24 24" fill="none">
1513 + <path d="M6 12h12" stroke="#000" stroke-width="2" stroke-linecap="round"/>
1514 + </svg>
1515 + <svg class="ays-poll-checklist-minimize-icon-collapsed" style="display:none;" width="24" height="24" viewBox="0 0 24 24">
1516 + <path fill-rule="evenodd" clip-rule="evenodd" d="M4 3.25H8C8.41421 3.25 8.75 3.58579 8.75 4C8.75 4.41421 8.41421 4.75 8 4.75H5.81066L10.5303 9.46967C10.8232 9.76256 10.8232 10.2374 10.5303 10.5303C10.2374 10.8232 9.76256 10.8232 9.46967 10.5303L4.75 5.81066V8C4.75 8.41421 4.41421 8.75 4 8.75C3.58579 8.75 3.25 8.41421 3.25 8V4C3.25 3.58579 3.58579 3.25 4 3.25ZM13.4697 13.4697C13.7626 13.1768 14.2374 13.1768 14.5303 13.4697L19.25 18.1893V16C19.25 15.5858 19.5858 15.25 20 15.25C20.4142 15.25 20.75 15.5858 20.75 16V20C20.75 20.4142 20.4142 20.75 20 20.75H16C15.5858 20.75 15.25 20.4142 15.25 20C15.25 19.5858 15.5858 19.25 16 19.25H18.1893L13.4697 14.5303C13.1768 14.2374 13.1768 13.7626 13.4697 13.4697Z"></path>
1517 + </svg>
1518 + </button>
1519 +
1520 + <!-- Close Button -->
1521 + <button class="ays-poll-checklist-close-btn" aria-label="Close"><svg width="24" height="24" class="" focusable="false" aria-hidden="true" viewBox="0 0 24 24"><path fill-rule="evenodd" clip-rule="evenodd" d="M18.5303 5.46967C18.8232 5.76256 18.8232 6.23744 18.5303 6.53033L6.53033 18.5303C6.23744 18.8232 5.76256 18.8232 5.46967 18.5303C5.17678 18.2374 5.17678 17.7626 5.46967 17.4697L17.4697 5.46967C17.7626 5.17678 18.2374 5.17678 18.5303 5.46967Z"></path><path fill-rule="evenodd" clip-rule="evenodd" d="M5.46967 5.46967C5.76256 5.17678 6.23744 5.17678 6.53033 5.46967L18.5303 17.4697C18.8232 17.7626 18.8232 18.2374 18.5303 18.5303C18.2374 18.8232 17.7626 18.8232 17.4697 18.5303L5.46967 6.53033C5.17678 6.23744 5.17678 5.76256 5.46967 5.46967Z"></path></svg></button>
1522 + </header>
1523 +
1524 + <ol class="ays-poll-checklist-items">
1525 + <?php foreach ($checklist_steps as $index => $step):
1526 + $is_checked = in_array($index, $completed_steps);
1527 + ?>
1528 + <li class="ays-poll-checklist-step<?php echo $is_checked ? ' completed' : ''; ?>" data-step="<?php echo esc_attr($index); ?>">
1529 + <div class="ays-poll-checklist-header-row">
1530 + <span class="ays-poll-checklist-step-number"><?php echo esc_html($index + 1 . '.'); ?></span>
1531 + <span class="ays-poll-checklist-step-title"><?php echo esc_html($step['title']); ?></span>
1532 + </div>
1533 + </li>
1534 + <?php endforeach; ?>
1535 + </ol>
1536 + <style>
1537 + #ays-poll-checklist-container.ays-poll-checklist-panel{max-width:100%;background:#fff;font-family:Arial,sans-serif;overflow:hidden;margin:0 auto;color:#0c0d0e;box-shadow:rgba(0,0,0,.2) 0 3px 5px -1px,rgba(0,0,0,.14) 0 5px 8px 0,rgba(0,0,0,.12) 0 1px 14px 0;position:fixed;width:300px;bottom:40px;inset-inline-end:40px;z-index:999;max-height:730px;overflow-y:auto;transition:box-shadow .3s cubic-bezier(.4, 0, .2, 1);border-radius:4px}#ays-poll-checklist-container .ays-poll-checklist-header{box-shadow:none;display:flex;flex-direction:row;align-items:center;width:100%;box-sizing:border-box;flex-shrink:0;position:sticky;z-index:1100;top:0;left:auto;right:0;color:rgba(0,0,0,.87);background-color:#fff;transition:box-shadow .3s cubic-bezier(.4, 0, .2, 1);padding:16px}#ays-poll-checklist-container .ays-poll-checklist-header-row{-webkit-tap-highlight-color:transparent;background-color:transparent;user-select:none;vertical-align:middle;appearance:none;display:flex;-webkit-box-flex:1;flex-grow:1;-webkit-box-pack:start;-webkit-box-align:center;align-items:center;position:relative;min-width:0;box-sizing:border-box;text-align:left;padding:0;color:#0c0d0e;outline:0;border:0;margin:0;border-radius:0;text-decoration:none;transition:background-color 150ms cubic-bezier(.4, 0, .2, 1)}#ays-poll-checklist-container .ays-poll-checklist-header h3{box-sizing:content-box;display:inline;height:auto;padding:0;width:auto;text-transform:none;margin:0;font-weight:600;line-height:1.3;font-family:Arial,sans-serif;font-size:1rem;letter-spacing:.00938em;-webkit-box-flex:1;flex-grow:1}#ays-poll-checklist-container .ays-poll-checklist-close-btn,#ays-poll-checklist-container .ays-poll-checklist-minimize-btn{border:none;background:0 0;font-size:20px;cursor:pointer;outline:unset;transition:background-color .3s ease-in-out;border-radius:4px}#ays-poll-checklist-container .ays-poll-checklist-close-btn:hover,#ays-poll-checklist-container .ays-poll-checklist-minimize-btn:hover{background-color:rgba(0,0,0,.04)}#ays-poll-checklist-container .ays-poll-checklist-items{list-style:none;padding:0;margin:0}#ays-poll-checklist-container .ays-poll-checklist-step{padding:12px 16px;border-bottom:1px solid #f0f0f0;transition:background .2s}#ays-poll-checklist-container .ays-poll-checklist-step:hover{background-color:#f9f9f9}#ays-poll-checklist-container .ays-poll-checklist-step label{display:flex;align-items:center;cursor:pointer}#ays-poll-checklist-container .ays-poll-checklist-step.completed label span{text-decoration:line-through;opacity:.6}#ays-poll-checklist-container .ays-poll-checklist-step-title{margin:0;margin-left:5px;font-family:Arial,sans-serif;font-weight:400;font-size:.875rem;letter-spacing:.01071em;display:block}#ays-poll-checklist-container .ays-poll-checklist-step-content{display:none;margin-top:12px}#ays-poll-checklist-container .ays-poll-checklist-step-content img{width:100%;max-width:100%;border-radius:4px;margin-bottom:0;height:180px;object-fit:contain}#wpwrap #wpfooter #ays-poll-checklist-container .ays-poll-checklist-step-content p{margin:0;font-size:13px;padding:16px 0}#ays-poll-checklist-container .ays-poll-checklist-step-content a:not(.ays-poll-checklist-primary-action){color:#0073aa;text-decoration:underline}#ays-poll-checklist-container .ays-poll-checklist-actions{display:flex;-webkit-box-align:center;align-items:center;-webkit-box-pack:end;justify-content:flex-end;padding-bottom:12px}#ays-poll-checklist-container .ays-poll-checklist-mark-done,#ays-poll-checklist-container .ays-poll-checklist-primary-action{display:inline-flex;position:relative;box-sizing:border-box;-webkit-tap-highlight-color:transparent;user-select:none;vertical-align:middle;appearance:none;text-transform:none;font-family:Arial,sans-serif;font-weight:500;font-size:.8125rem;line-height:1.75;letter-spacing:.02857em;min-width:64px;box-shadow:none;outline:0;text-decoration:none;padding:4px 10px;transition:background-color 250ms cubic-bezier(.4, 0, .2, 1),box-shadow 250ms cubic-bezier(.4, 0, .2, 1),border-color 250ms cubic-bezier(.4, 0, .2, 1),color 250ms cubic-bezier(.4, 0, .2, 1);white-space:nowrap;cursor:pointer}#ays-poll-checklist-container .ays-poll-checklist-mark-done{-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;background-color:transparent;color:#515962;border:0;margin:0;border-radius:4px}#ays-poll-checklist-container .ays-poll-checklist-mark-done:hover{color:#515962;text-decoration:none;background-color:rgba(81,89,98,.04)}#ays-poll-checklist-container .ays-poll-checklist-primary-action{-webkit-box-align:center;align-items:center;-webkit-box-pack:center;justify-content:center;color:#fff;background-color:#00a0d2;border:0 initial initial;border-image:initial;margin:0 0 0 8px;border-radius:4px}#ays-poll-checklist-container .ays-poll-checklist-toggle-step{background:0 0;border:none;font-size:16px;cursor:pointer;transform:rotate(0);transition:transform .2s}#ays-poll-checklist-container .ays-poll-checklist-toggle-step.open{transform:rotate(180deg)}#ays-poll-checklist-container.ays-poll-checklist-panel.ays-poll-checklist-minimized .ays-poll-checklist-items{display:none}.ays-poll-launch-icon::after{content:"";width:8px;height:8px;background-color:#d179f2;border-radius:50%;position:absolute;top:0;right:0}.ays-poll-checklist-open-icon{position:absolute;bottom:36px;right:20px;cursor:pointer}@media (max-width:1280px){div#ays-poll-checklist-container.ays-poll-checklist-panel{max-height:580px;width:300px;bottom:20px;inset-inline-end:20px}div#ays-poll-checklist-container .ays-poll-checklist-step-content img{height:150px}}@media (max-width:782px){#ays-poll-checklist-container.ays-poll-checklist-panel,.ays-poll-checklist-open-icon{display:none}}@media (max-width:480px){#ays-poll-checklist-container.ays-poll-checklist-panel{border-radius:0;max-width:100%}#ays-poll-checklist-container .ays-poll-checklist-header h3{font-size:16px}#ays-poll-checklist-container .ays-poll-checklist-step-content p{font-size:13px}#ays-poll-checklist-container .ays-poll-checklist-actions{flex-direction:column}}
1538 + </style>
1539 + </div>
1540 + <?php
1541 + }
1542 + }
1543 +
1544 + }
1545 +
1546 + public function ays_poll_save_checklist_progress() {
1547 + check_ajax_referer('ays_poll_nonce', 'nonce');
1548 +
1549 + $user_can_capability = self::poll_maker_capabilities();
1550 +
1551 + // Check for permissions.
1552 + if ( ! current_user_can( $user_can_capability ) ) {
1553 + wp_send_json_error( esc_html__( 'Something went wrong', 'poll-maker' ) );
1554 + }
1555 +
1556 + if( !is_user_logged_in() ) {
1557 + wp_send_json_error( esc_html__( 'Something went wrong', 'poll-maker' ) );
1558 + }
1559 +
1560 + $user_id = get_current_user_id();
1561 + $steps = isset($_POST['steps']) ? array_map('sanitize_text_field', $_POST['steps']) : array();
1562 +
1563 + update_user_meta($user_id, 'ays_poll_checklist_completed_steps', $steps);
1564 +
1565 + wp_send_json_success(array('saved' => true));
1566 + }
1567 +
1568 + public function ays_poll_checklist_close_popup() {
1569 + check_ajax_referer('ays_poll_nonce', 'nonce');
1570 +
1571 + $user_can_capability = self::poll_maker_capabilities();
1572 +
1573 + // Check for permissions.
1574 + if ( ! current_user_can( $user_can_capability ) ) {
1575 + wp_send_json_error( esc_html__( 'Something went wrong', 'poll-maker' ) );
1576 + }
1577 +
1578 + if (is_user_logged_in()) {
1579 + $user_id = get_current_user_id();
1580 + update_user_meta($user_id, 'ays_poll_checklist_popup_closed', 1);
1581 + wp_send_json_success( esc_html__( 'Popup marked as closed.', 'poll-maker' ) );
1582 + }
1583 +
1584 + wp_send_json_error( esc_html__( 'User not logged in.', 'poll-maker' ) );
1585 + }
1586 +
1587 + public function ays_poll_checklist_reopen_callback() {
1588 + check_ajax_referer('ays_poll_nonce', 'nonce');
1589 +
1590 + $user_can_capability = self::poll_maker_capabilities();
1591 +
1592 + // Check for permissions.
1593 + if ( ! current_user_can( $user_can_capability ) ) {
1594 + wp_send_json_error( esc_html__( 'Something went wrong', 'poll-maker' ) );
1595 + }
1596 +
1597 + if (is_user_logged_in()) {
1598 + $user_id = get_current_user_id();
1599 + delete_user_meta($user_id, 'ays_poll_checklist_popup_closed');
1600 + wp_send_json_success('Popup reopened.');
1601 + }
1602 +
1603 + wp_send_json_error( esc_html__( 'User not logged in.', 'poll-maker' ) );
1604 + }
1605 +
1304 1606 public function get_next_or_prev_row_by_id( $id, $type = "next", $table = "ayspoll_polls" ) {
1305 1607 global $wpdb;
1306 1608
1307 1609 if ( is_null( $table ) || empty( $table ) ) {
@@ -1345,17 +1647,17 @@
1345 1647 if(isset($_REQUEST['page'])){
1346 1648 if(false !== strpos($_REQUEST['page'], $this->plugin_name)){
1347 1649 ?>
1348 1650 <div class="ays-poll-footer-support-box">
1349 - <span class="ays-poll-footer-link-row"><a href="https://wordpress.org/support/plugin/poll-maker/" target="_blank"><?php echo __( "Support", "poll-maker"); ?></a></span>
1651 + <span class="ays-poll-footer-link-row"><a href="https://wordpress.org/support/plugin/poll-maker/" target="_blank"><?php echo esc_html__( "Support", "poll-maker"); ?></a></span>
1350 1652 <span class="ays-poll-footer-slash-row">/</span>
1351 - <span class="ays-poll-footer-link-row"><a href="https://ays-pro.com/wordpress-poll-maker-user-manual" target="_blank"><?php echo __( "Docs", "poll-maker"); ?></a></span>
1653 + <span class="ays-poll-footer-link-row"><a href="https://ays-pro.com/wordpress-poll-maker-user-manual" target="_blank"><?php echo esc_html__( "Docs", "poll-maker"); ?></a></span>
1352 1654 <span class="ays-poll-footer-slash-row">/</span>
1353 - <span class="ays-poll-footer-link-row"><a href="https://ays-demo.com/poll-maker-plugin-survey/" target="_blank"><?php echo __( "Suggest a Feature", "poll-maker"); ?></a></span>
1655 + <span class="ays-poll-footer-link-row"><a href="https://ays-demo.com/poll-maker-plugin-survey/" target="_blank"><?php echo esc_html__( "Suggest a Feature", "poll-maker"); ?></a></span>
1354 1656 </div>
1355 1657 <p style="font-size:13px;text-align:center;font-style:italic;">
1356 1658 <span style="margin-left:0px;margin-right:10px;" class="ays_heart_beat"><i class="ays_fa ays_poll_fa_heart_o animated"></i></span>
1357 - <span><?php echo __( "If you love our plugin, please do big favor and rate us on WordPress.org", "poll-maker"); ?></span>
1659 + <span><?php echo esc_html__( "If you love our plugin, please do big favor and rate us on WordPress.org", "poll-maker"); ?></span>
1358 1660 <a target="_blank" class="ays-rated-link" href='http://bit.ly/3l5I2iG'>
1359 1661 <span class="ays-dashicons ays-dashicons-star-empty"></span>
1360 1662 <span class="ays-dashicons ays-dashicons-star-empty"></span>
1361 1663 <span class="ays-dashicons ays-dashicons-star-empty"></span>
@@ -1462,9 +1764,13 @@
1462 1764 $ays_poll_flag += intval(get_option('ays_poll_sale_btn_'.$sale));
1463 1765 $ays_poll_flag += $ays_poll_two_months_flag;
1464 1766 if($ays_poll_flag == 0){
1465 1767 $ays_poll_sale_message = 'ays_poll_sale_message_'.$sale;
1466 - $this->ays_poll_sale_message_poll_pro();
1768 + // $this->ays_poll_new_halloween_bundle_message_2025();
1769 + // $this->ays_poll_black_friday_message();
1770 + // $this->ays_poll_christmas_banner_message_2025();
1771 + // $this->ays_poll_footer_sale_banner_2026($ays_poll_flag);
1772 + $this->ays_poll_back_to_school_banner_2026($ays_poll_flag);
1467 1773 }
1468 1774 }
1469 1775 }
1470 1776 }
@@ -1469,8 +1775,418 @@
1469 1775 }
1470 1776 }
1471 1777 }
1472 1778
1779 + // Back to School top banner
1780 + public function ays_poll_back_to_school_banner_2026($ishmar){
1781 + if($ishmar == 0 ){
1782 + $content = array();
1783 + $poll_cta_button_link = esc_url('https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=back-to-school-sale-banner-' . POLL_MAKER_AYS_VERSION);
1784 + $content[] = '<div id="ays-poll-back-to-school-banner-2026" class="ays-poll-back-to-school-banner-2026 ays-poll-admin-notice notice notice-success is-dismissible ays_poll_dicount_info">';
1785 + $content[] = '<svg class="ays-poll-bts-decoration ays-poll-bts-plane" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M22 2 11 13"></path><path d="M22 2 15 22l-4-9-9-4Z"></path></svg>';
1786 + $content[] = '<svg class="ays-poll-bts-decoration ays-poll-bts-ruler" viewBox="0 0 36 20" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" aria-hidden="true"><rect x="1" y="6" width="34" height="9" rx="2"></rect><path d="M8 6v3M14 6v4M20 6v3M26 6v4"></path></svg>';
1787 + $content[] = '<svg class="ays-poll-bts-decoration ays-poll-bts-star" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="m12 2 2.6 6.6L21.5 9l-5 4.6 1.4 7-5.9-3.5L6.1 20.6l1.4-7L2.5 9l6.9-.4Z"></path></svg>';
1788 + $content[] = '<svg class="ays-poll-bts-decoration ays-poll-bts-pencil" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 20h9"></path><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg>';
1789 + $content[] = '<svg class="ays-poll-bts-decoration ays-poll-bts-wave" viewBox="0 0 96 12" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" aria-hidden="true"><path d="M2 8c8-8 16 8 24 0s16 8 24 0 16 8 24 0 16 8 20 2"></path></svg>';
1790 + $content[] = '<div class="ays-poll-bts-content">';
1791 + $content[] = '<div class="ays-poll-bts-offer">';
1792 + $content[] = '<img class="ays-poll-bts-handwritten" src="'. esc_url(POLL_MAKER_AYS_ADMIN_URL . '/images/ays-poll-back-to-school-handwritten.svg') .'" alt="Back to School Sale">';
1793 + $content[] = '<span class="ays-poll-bts-dot" aria-hidden="true"></span>';
1794 + $content[] = '<span class="ays-poll-bts-discount">'. esc_html__('20% OFF', 'poll-maker') .'</span>';
1795 + $content[] = '</div>';
1796 + $content[] = '<div class="ays-poll-bts-actions">';
1797 + $content[] = '<span class="ays-poll-bts-use-code">'. esc_html__('Use code', 'poll-maker') .'</span>';
1798 + $content[] = '<button type="button" class="ays-poll-bts-coupon" data-coupon="SCHOOL20" aria-label="'. esc_attr__('Copy coupon code SCHOOL20', 'poll-maker') .'"> <span>SCHOOL20</span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="14" height="14" x="8" y="8" rx="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1 0-2 2-2h10c1.1 0 2 .9 2 2"></path></svg></button>';
1799 + $content[] = '<a href="'. esc_url($poll_cta_button_link).'" class="ays-poll-bts-cta" target="_blank" rel="noopener noreferrer">'. esc_html__('Upgrade Now', 'poll-maker') .'</a>';
1800 + $content[] = '</div>';
1801 + $content[] = '</div>';
1802 + $content[] = '<div class="ays-poll-bts-dismiss"><form action="" method="POST"><div id="ays-poll-dismiss-buttons-content">';
1803 + if( current_user_can( 'manage_options' ) ){
1804 + $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn">'. esc_html__('Dismiss ad', 'poll-maker') .'</button>';
1805 + $content[] = wp_nonce_field( POLL_MAKER_AYS_NAME . '-sale-banner', POLL_MAKER_AYS_NAME . '-sale-banner', true, false );
1806 + }
1807 + $content[] = '</div></form></div>';
1808 + $content[] = '</div>';
1809 + $content[] = '<style id="ays-poll-back-to-school-banner-2026-inline-css">';
1810 + $content[] = '#ays-quiz-back-to-school-banner-2026{box-sizing:border-box;position:relative;isolation:isolate;width:calc(100% - 20px);max-width:none;min-height:112px;margin:20px 20px 16px 0;padding:0 38px;overflow:hidden;border:1px solid #e8dcc9;border-left-width:1px;border-radius:12px;background-color:#fffdf8;background-image:radial-gradient(circle at 1px 1px,rgba(91,72,45,.09) 1px,transparent 1px),radial-gradient(120% 140% at 0 0,rgba(20,75,220,.07),transparent 55%),radial-gradient(120% 140% at 100% 100%,rgba(126,34,206,.09),transparent 55%);background-size:6px 6px,100% 100%,100% 100%;box-shadow:0 10px 30px -18px rgba(76,45,140,.55);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.ays-quiz-bts-content{position:relative;z-index:2;display:flex;min-height:110px;align-items:center;justify-content:space-between;gap:28px}.ays-quiz-bts-offer,.ays-quiz-bts-actions{display:flex;align-items:center}.ays-quiz-bts-offer{min-width:0;gap:9px}.ays-quiz-bts-handwritten{width:280px;max-width:23vw;height:auto;color:#0755df;overflow:visible;flex:0 1 auto}.ays-quiz-bts-dot{width:7px;height:7px;flex:0 0 auto;border-radius:50%;background:#ffc51b;align-self:flex-start;margin-top:27px}.ays-quiz-bts-discount{color:#8127df;font-size:38px;font-weight:800;line-height:1;letter-spacing:-1.2px;white-space:nowrap}.ays-quiz-bts-actions{flex:0 0 auto;gap:12px}.ays-quiz-bts-use-code{color:#5f5b69;font-size:11px;font-weight:600;line-height:1;text-transform:uppercase;letter-spacing:.14em;white-space:nowrap}.ays-quiz-bts-coupon{box-sizing:border-box;display:flex;min-height:50px;align-items:center;gap:12px;padding:8px 14px;border:2px dashed rgba(129,39,223,.5);border-radius:10px;background:#fff;color:#1147c8;cursor:pointer;box-shadow:none}.ays-quiz-bts-coupon:hover,.ays-quiz-bts-coupon:focus{border-color:#8127df;background:rgba(129,39,223,.05);color:#1147c8}.ays-quiz-bts-coupon span{font-size:19px;font-weight:700;letter-spacing:.04em}.ays-quiz-bts-coupon svg{width:16px;height:16px;color:#8127df}.ays-quiz-bts-cta{display:inline-flex;min-height:48px;align-items:center;justify-content:center;padding:0 27px;border-radius:9px;background:linear-gradient(90deg,#1249e7,#8127df);color:#fff!important;font-size:16px;font-weight:700;text-decoration:none!important;white-space:nowrap;box-shadow:0 8px 18px -8px rgba(91,37,194,.9);transition:transform .15s,box-shadow .15s}.ays-quiz-bts-cta:hover,.ays-quiz-bts-cta:focus{color:#fff;transform:translateY(-1px);box-shadow:0 10px 20px -8px rgba(91,37,194,.95)}.ays-quiz-bts-decoration{position:absolute;z-index:1;pointer-events:none}.ays-quiz-bts-plane{top:8px;left:12px;width:24px;color:rgba(129,39,223,.55)}.ays-quiz-bts-ruler{bottom:7px;left:24px;width:36px;color:rgba(20,73,230,.35)}.ays-quiz-bts-star{top:8px;right:14px;width:19px;color:#ffc51b}.ays-quiz-bts-pencil{right:31px;bottom:7px;width:21px;color:rgba(129,39,223,.5);transform:rotate(-12deg)}.ays-quiz-bts-wave{bottom:3px;left:50%;width:96px;color:rgba(20,73,230,.22);transform:translateX(-50%)}#ays-quiz-back-to-school-banner-2026 .notice-dismiss{top:1px;right:1px;color:#756b82}#ays-quiz-back-to-school-banner-2026 .notice-dismiss:before{font-size:18px}.ays-quiz-bts-dismiss{position:absolute;right:39px;bottom:0;z-index:3}.ays-quiz-bts-dismiss form{margin:0}.ays-quiz-bts-dismiss #ays-quiz-dismiss-buttons-content .ays-button{height:22px!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;color:#777!important;font-size:10px!important;line-height:22px!important;text-decoration:underline;box-shadow:none!important}.ays-quiz-bts-copy-notification{position:fixed;top:50%;left:50%;z-index:10000;transform:translate(-50%,-50%);padding:12px 24px;border-radius:8px;background:rgba(0,0,0,.82);color:#fff;font-size:14px;opacity:0;transition:opacity .25s}.ays-quiz-bts-copy-notification.ays-quiz-bts-show{opacity:1}@media screen and (max-width:1200px){.ays-quiz-bts-content{gap:18px}.ays-quiz-bts-handwritten{width:225px}.ays-quiz-bts-discount{font-size:31px}.ays-quiz-bts-actions{gap:8px}.ays-quiz-bts-coupon{min-height:44px;padding:7px 10px}.ays-quiz-bts-cta{min-height:44px;padding:0 18px;font-size:14px}}@media screen and (max-width:960px){#ays-quiz-back-to-school-banner-2026{padding:15px 38px 20px}.ays-quiz-bts-content{min-height:90px;flex-wrap:wrap;justify-content:center;gap:12px 24px}.ays-quiz-bts-handwritten{max-width:none}.ays-quiz-bts-actions{justify-content:center}.ays-quiz-bts-dismiss{right:38px}}@media screen and (max-width:600px){#ays-quiz-back-to-school-banner-2026{width:calc(100% - 20px);margin-right:10px;padding:18px 30px 23px 18px}.ays-quiz-bts-content{flex-direction:column}.ays-quiz-bts-offer{flex-wrap:wrap;justify-content:center}.ays-quiz-bts-handwritten{width:210px}.ays-quiz-bts-discount{font-size:28px}.ays-quiz-bts-actions{flex-wrap:wrap}.ays-quiz-bts-use-code{width:100%;text-align:center}.ays-quiz-bts-coupon{min-height:40px}.ays-quiz-bts-coupon span{font-size:16px}.ays-quiz-bts-cta{min-height:40px}.ays-quiz-bts-plane,.ays-quiz-bts-ruler,.ays-quiz-bts-pencil,.ays-quiz-bts-wave{display:none}.ays-quiz-bts-dismiss{right:30px}}';
1811 + $content[] = '</style>';
1812 + $content[] = '<script>
1813 + (function() {
1814 + "use strict";
1815 + function initBackToSchoolBanner() {
1816 + var banner = document.getElementById("ays-poll-back-to-school-banner-2026");
1817 + if (!banner) {
1818 + return;
1819 + }
1820 + var couponButton = banner.querySelector(".ays-poll-bts-coupon");
1821 + if (!couponButton) {
1822 + return;
1823 + }
1824 + couponButton.addEventListener("click", function() {
1825 + var couponCode = couponButton.getAttribute("data-coupon");
1826 + var textarea = document.createElement("textarea");
1827 + textarea.value = couponCode;
1828 + textarea.style.position = "fixed";
1829 + textarea.style.opacity = "0";
1830 + document.body.appendChild(textarea);
1831 + textarea.focus();
1832 + textarea.select();
1833 + try {
1834 + document.execCommand("copy");
1835 + showCopyNotification();
1836 + } catch (error) {
1837 + // Keep the banner usable when clipboard access is unavailable.
1838 + }
1839 + document.body.removeChild(textarea);
1840 + });
1841 + }
1842 + function showCopyNotification() {
1843 + var notification = document.createElement("div");
1844 + notification.className = "ays-poll-bts-copy-notification";
1845 + notification.textContent = "'. esc_js(__('Coupon code copied', 'poll-maker')) .'";
1846 + document.body.appendChild(notification);
1847 + setTimeout(function() {
1848 + notification.classList.add("ays-poll-bts-show");
1849 + }, 10);
1850 + setTimeout(function() {
1851 + notification.classList.remove("ays-poll-bts-show");
1852 + setTimeout(function() {
1853 + if (notification.parentNode) {
1854 + notification.parentNode.removeChild(notification);
1855 + }
1856 + }, 250);
1857 + }, 2000);
1858 + }
1859 + if (document.readyState === "loading") {
1860 + document.addEventListener("DOMContentLoaded", initBackToSchoolBanner);
1861 + } else {
1862 + initBackToSchoolBanner();
1863 + }
1864 + })();
1865 + </script>';
1866 +
1867 + echo implode('', $content); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Static banner markup; dynamic values are escaped above.
1868 + }
1869 + }
1870 +
1871 +
1872 +// Poll Footer Blue Banner Sale 20%
1873 + public function ays_poll_footer_sale_banner_2026($ishmar){
1874 + if($ishmar == 0 ){
1875 + $content = array();
1876 +
1877 + $poll_cta_button_link = esc_url('https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=private-offer-20-off-' . POLL_MAKER_AYS_VERSION);
1878 +
1879 + $content[] = '
1880 + <div class="ays-poll-footer-banner-bottom-banner-wrapper" style="display: none;">
1881 + <div class="ays-poll-footer-banner-bottom-banner-container">
1882 + <div class="ays-poll-footer-banner-bottom-banner-content">
1883 + <div class="ays-poll-footer-banner-bottom-banner-inner">
1884 + <div class="ays-poll-footer-banner-bottom-banner-left">
1885 + <div class="ays-poll-footer-banner-bottom-banner-icon">
1886 + <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">
1887 + <path d="M12 7v14"></path>
1888 + <path d="M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8"></path>
1889 + <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>
1890 + <rect x="3" y="7" width="18" height="4" rx="1"></rect>
1891 + </svg>
1892 + </div>
1893 + <span class="ays-poll-footer-banner-bottom-banner-title">'. esc_html__('Poll Maker by AYS', 'poll-maker') .'</span>
1894 + </div>
1895 + <span class="ays-poll-footer-banner-bottom-banner-separator"></span>
1896 + <span class="ays-poll-footer-banner-bottom-banner-discount">'. esc_html__('20% Off', 'poll-maker') .'</span>
1897 + <div class="ays-poll-footer-banner-bottom-banner-code" onclick="aysPollFooterBannerCopyToClipboard()" title="'. esc_html__('Copy Coupon Code', 'poll-maker') .'">
1898 + <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">
1899 + <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>
1900 + <path d="M13 5v2"></path>
1901 + <path d="M13 17v2"></path>
1902 + <path d="M13 11v2"></path>
1903 + </svg>
1904 + <span>POLLPRO20</span>
1905 + <button type="button" class="ays-poll-footer-banner-bottom-banner-copy" aria-label="'. esc_html__('Copy Coupon Code', 'poll-maker') .'">
1906 + <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">
1907 + <rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect>
1908 + <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>
1909 + </svg>
1910 + </button>
1911 + </div>
1912 + <button type="button" class="ays-poll-footer-banner-bottom-banner-cta">
1913 + '. esc_html__('Get Deal', 'poll-maker') .'
1914 + </button>
1915 + <button type="button" class="ays-poll-footer-banner-bottom-banner-close" aria-label="'. esc_html__('Close popup', 'poll-maker') .'">
1916 + <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">
1917 + <path d="M18 6 6 18"></path>
1918 + <path d="m6 6 12 12"></path>
1919 + </svg>
1920 + </button>
1921 + </div>
1922 + </div>
1923 + </div>
1924 + </div>';
1925 +
1926 + $content[] = '<style id="ays-poll-progress-banner-styles-inline-css">';
1927 +
1928 + $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-poll-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-poll-footer-banner-bottom-banner-wrapper.ays-pro-banner-closing{animation:.32s cubic-bezier(.16,1,.3,1) forwards ays-pro-slide-down}.ays-poll-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-poll-footer-banner-bottom-banner-code,.ays-poll-footer-banner-bottom-banner-content,.ays-poll-footer-banner-bottom-banner-inner,.ays-poll-footer-banner-bottom-banner-left{display:flex;align-items:center}.ays-poll-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-poll-footer-banner-bottom-banner-left{gap:14px}.ays-poll-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-poll-footer-banner-bottom-banner-icon svg{width:24px;height:24px}.ays-poll-footer-banner-bottom-banner-discount,.ays-poll-footer-banner-bottom-banner-title{font-size:17px;font-weight:600;line-height:1.25;letter-spacing:0;white-space:nowrap;color:#fff}.ays-poll-footer-banner-bottom-banner-separator{display:block;width:1px;height:24px;background:rgba(255,255,255,.4)}.ays-poll-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-poll-footer-banner-bottom-banner-code:hover{background:rgba(255,255,255,.1);border-color:#fff}.ays-poll-footer-banner-bottom-banner-code button svg,.ays-poll-footer-banner-bottom-banner-code>svg{width:16px;height:16px}.ays-poll-footer-banner-bottom-banner-code span{font-size:14px;font-weight:600;line-height:1;letter-spacing:.05em;color:#fff}.ays-poll-footer-banner-bottom-banner-close,.ays-poll-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-poll-footer-banner-bottom-banner-close:hover,.ays-poll-footer-banner-bottom-banner-copy:hover{color:#fff;background:0 0}.ays-poll-footer-banner-bottom-banner-wrapper .ays-poll-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-poll-footer-banner-bottom-banner-wrapper .ays-poll-footer-banner-bottom-banner-cta:hover{background:rgba(255,255,255,.95);color:#2f6bff;transform:translateY(-1px)}.ays-poll-footer-banner-bottom-banner-close{width:22px;height:22px;margin-left:2px}.ays-poll-footer-banner-bottom-banner-close svg{width:20px;height:20px}.ays-poll-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-poll-footer-banner-copy-notification.show{opacity:1}@media (max-width:768px){.ays-poll-footer-banner-bottom-banner-wrapper{display:none}}';
1929 + $content[] = '</style>';
1930 +
1931 + $content[] = '<script>';
1932 +
1933 + $content[] = "
1934 + /**
1935 + * Footer Banner JavaScript - ES5 Compatible
1936 + * With delayed popup and visit tracking
1937 + */
1938 +
1939 + (function() {
1940 + 'use strict';
1941 +
1942 + // Configuration
1943 + var STORAGE_KEY = 'ays_poll_footer_banner_data';
1944 + var POPUP_RULES = [
1945 + { visit: 1, delay: 10000 }, // 1st visit: 10 seconds
1946 + { visit: 2, delay: 10000 }, // 2nd visit: 10 seconds
1947 + { visit: 3, delay: 15000 }, // 3th visit: 15 seconds
1948 + { visit: 4, delay: 15000 }, // 4th visit: 15 seconds
1949 + { visit: 5, delay: 20000 }, // 5th visit: 20 seconds
1950 + { visit: 7, delay: 20000 }, // 7th visit: 20 seconds
1951 + { visit: 10, delay: 30000 } // 10th visit: 30 seconds
1952 + ];
1953 + var MAX_SHOWS_PER_DAY = 7;
1954 +
1955 + // Wait for DOM to be ready
1956 + if (document.readyState === 'loading') {
1957 + document.addEventListener('DOMContentLoaded', initBanner);
1958 + } else {
1959 + initBanner();
1960 + }
1961 +
1962 + function initBanner() {
1963 + var banner = document.querySelector('.ays-poll-footer-banner-bottom-banner-wrapper');
1964 + var closeButton = document.querySelector('.ays-poll-footer-banner-bottom-banner-close');
1965 + var ctaButton = document.querySelector('.ays-poll-footer-banner-bottom-banner-cta');
1966 +
1967 + if (!banner) {
1968 + return;
1969 + }
1970 +
1971 + // Hide banner initially
1972 + banner.style.display = 'none';
1973 +
1974 + // Get or initialize banner data
1975 + var bannerData = getBannerData();
1976 +
1977 + // Check if we need to reset daily data
1978 + if (shouldResetData(bannerData.lastResetDate)) {
1979 + bannerData = resetDailyData();
1980 + }
1981 +
1982 + // Increment visit count
1983 + bannerData.visitCount++;
1984 + saveBannerData(bannerData);
1985 +
1986 + // Check if banner should be shown
1987 + var shouldShow = shouldShowBanner(bannerData);
1988 +
1989 + if (shouldShow.show) {
1990 + // Show banner after delay
1991 + setTimeout(function() {
1992 + banner.style.display = 'block';
1993 +
1994 + // Increment show count
1995 + bannerData.showCount++;
1996 + saveBannerData(bannerData);
1997 + }, shouldShow.delay);
1998 + }
1999 +
2000 + // Close button handler
2001 + if (closeButton) {
2002 + closeButton.addEventListener('click', function() {
2003 + closeBanner(banner);
2004 + });
2005 + }
2006 +
2007 + // CTA button handler
2008 + if (ctaButton) {
2009 + ctaButton.addEventListener('click', function() {
2010 + window.open('https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=private-offer-20-off-". POLL_MAKER_AYS_VERSION ."', '_blank');
2011 + // Optionally close banner after click
2012 + closeBanner(banner);
2013 + });
2014 + }
2015 + }
2016 +
2017 + /**
2018 + * Get banner data from localStorage
2019 + */
2020 + function getBannerData() {
2021 + try {
2022 + var data = localStorage.getItem(STORAGE_KEY);
2023 + if (data) {
2024 + return JSON.parse(data);
2025 + }
2026 + } catch (e) {
2027 + // localStorage not available or parsing error
2028 + }
2029 +
2030 + // Return default data
2031 + return {
2032 + visitCount: 0,
2033 + showCount: 0,
2034 + lastResetDate: getTodayDate()
2035 + };
2036 + }
2037 +
2038 + /**
2039 + * Save banner data to localStorage
2040 + */
2041 + function saveBannerData(data) {
2042 + try {
2043 + localStorage.setItem(STORAGE_KEY, JSON.stringify(data));
2044 + } catch (e) {
2045 + // localStorage not available
2046 + }
2047 + }
2048 +
2049 + /**
2050 + * Check if data should be reset (new day)
2051 + */
2052 + function shouldResetData(lastResetDate) {
2053 + var today = getTodayDate();
2054 + return lastResetDate !== today;
2055 + }
2056 +
2057 + /**
2058 + * Reset daily data
2059 + */
2060 + function resetDailyData() {
2061 + var newData = {
2062 + visitCount: 0,
2063 + showCount: 0,
2064 + lastResetDate: getTodayDate()
2065 + };
2066 + saveBannerData(newData);
2067 + return newData;
2068 + }
2069 +
2070 + /**
2071 + * Get today's date as string (YYYY-MM-DD)
2072 + */
2073 + function getTodayDate() {
2074 + var date = new Date();
2075 + var year = date.getFullYear();
2076 + var month = String(date.getMonth() + 1).padStart(2, '0');
2077 + var day = String(date.getDate()).padStart(2, '0');
2078 + return year + '-' + month + '-' + day;
2079 + }
2080 +
2081 + /**
2082 + * Check if banner should be shown based on rules
2083 + */
2084 + function shouldShowBanner(bannerData) {
2085 + // Check if already shown max times today
2086 + if (bannerData.showCount >= MAX_SHOWS_PER_DAY) {
2087 + return { show: false, delay: 0 };
2088 + }
2089 +
2090 + // Check visit count against rules
2091 + for (var i = 0; i < POPUP_RULES.length; i++) {
2092 + var rule = POPUP_RULES[i];
2093 + if (bannerData.visitCount === rule.visit) {
2094 + return { show: true, delay: rule.delay };
2095 + }
2096 + }
2097 +
2098 + return { show: false, delay: 0 };
2099 + }
2100 +
2101 + /**
2102 + * Close banner with animation
2103 + */
2104 + function closeBanner(banner) {
2105 + if (!banner) {
2106 + return;
2107 + }
2108 +
2109 + // Add closing animation class
2110 + banner.classList.add('ays-pro-banner-closing');
2111 +
2112 + // Wait for animation to complete
2113 + setTimeout(function() {
2114 + banner.style.display = 'none';
2115 + }, 400);
2116 + }
2117 +
2118 + // Polyfill for String.padStart (for older browsers)
2119 + if (!String.prototype.padStart) {
2120 + String.prototype.padStart = function(targetLength, padString) {
2121 + targetLength = targetLength >> 0;
2122 + padString = String(typeof padString !== 'undefined' ? padString : ' ');
2123 + if (this.length >= targetLength) {
2124 + return String(this);
2125 + } else {
2126 + targetLength = targetLength - this.length;
2127 + if (targetLength > padString.length) {
2128 + padString += padString.repeat(targetLength / padString.length);
2129 + }
2130 + return padString.slice(0, targetLength) + String(this);
2131 + }
2132 + };
2133 + }
2134 + })();
2135 +
2136 + function aysPollFooterBannerCopyToClipboard() {
2137 + var textarea = document.createElement('textarea');
2138 + textarea.value = 'POLLPRO20';
2139 + textarea.style.position = 'fixed';
2140 + textarea.style.opacity = '0';
2141 + document.body.appendChild(textarea);
2142 +
2143 + textarea.select();
2144 + textarea.setSelectionRange(0, 99999);
2145 +
2146 + try {
2147 + document.execCommand('copy');
2148 + aysPollFooterBannerShowCopyNotification('". esc_html__('Coupon code copied', 'poll-maker') ."');
2149 + } catch (err) {
2150 + console.error('Failed to copy text: ', err);
2151 + }
2152 +
2153 + document.body.removeChild(textarea);
2154 + }
2155 +
2156 + function aysPollFooterBannerShowCopyNotification(message) {
2157 + var existingNotification = document.querySelector('.ays-poll-footer-banner-copy-notification');
2158 + if (existingNotification) {
2159 + document.body.removeChild(existingNotification);
2160 + }
2161 +
2162 + var notification = document.createElement('div');
2163 + notification.className = 'ays-poll-footer-banner-copy-notification';
2164 + notification.textContent = message;
2165 + document.body.appendChild(notification);
2166 +
2167 + setTimeout(function() {
2168 + notification.classList.add('show');
2169 + }, 10);
2170 +
2171 + setTimeout(function() {
2172 + notification.classList.remove('show');
2173 + setTimeout(function() {
2174 + if (notification.parentNode) {
2175 + document.body.removeChild(notification);
2176 + }
2177 + }, 300);
2178 + }, 2000);
2179 + }";
2180 +
2181 + $content[] = '</script>';
2182 +
2183 + $content = implode( '', $content );
2184 + echo ($content);
2185 + }
2186 + }
2187 +
2188 +
1473 2189 public function ays_poll_dismiss_button(){
1474 2190
1475 2191 $data = array(
1476 2192 'status' => false,
@@ -1489,635 +2205,1786 @@
1489 2205 $ob_get_clean = ob_get_clean();
1490 2206 echo json_encode($data);
1491 2207 wp_die();
1492 2208
1493 - }
2209 + }
1494 2210
1495 - // Poll plugin sale
1496 - // public function ays_poll_sale_message($flag){
1497 - // if($flag == 0){
1498 -
1499 - // <div id="ays-poll-dicount-month-main" class="notice notice-success is-dismissible ays_poll_dicount_info" >
1500 - // <div id="ays_poll_dicount_banner" class="ays_poll_dicount_month" style="display: flex;align-items: center;justify-content: space-between;">
1501 - // <div style="display: flex; align-items: center;">
1502 - // <div>
1503 - // <a href="https://ays-pro.com/wordpress/poll-maker" target="_blank" class="ays-poll-sale-banner-link"><img src="<?php echo POLL_MAKER_AYS_ADMIN_URL . '/images/sale.png'; " style="width: 60px;"></a>
1504 - // </div>
1505 - // <div style="font-size:14px; padding: 12px;">
1506 - // <strong>
1507 - // <?php echo __( "Limited Time <span style='color:red;'>30%</span> SALE on <a href='https://ays-pro.com/wordpress/poll-maker' target='_blank'>Poll Maker</a> premium plans!",POLL_MAKER_AYS_NAME);
1508 - // </strong>
1509 - // <br>
1510 - // <strong style="font-size: 12px;">
1511 - // <?php echo __( "Welcome to summer! Start it right with all the powerful tools you need for creating an advanced interactive website. Hurry! Ends on June 30. <a href='https://ays-pro.com/wordpress/poll-maker' target='_blank'>Check it out!</a>",POLL_MAKER_AYS_NAME);
1512 - // </strong>
1513 - // <form action="" method="POST">
1514 - // <button class="btn btn-link ays-button" name="ays_poll_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>
1515 - // </form>
1516 - // </div>
1517 - // </div>
1518 - // <a href="https://ays-pro.com/wordpress/poll-maker" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank" style="height: 32px; display: flex; align-items: center; font-weight: 500; " ><?php echo __('Buy Now !',POLL_MAKER_AYS_NAME); </a>
1519 -
1520 - // </div>
1521 -
1522 - // </div>
1523 - // <?php
1524 - // }
1525 - // }
2211 + // Christmas Banner 2025
2212 + public function ays_poll_christmas_banner_message_2025(){
2213 + $content = array();
1526 2214
1527 - // Mega bundle sale
1528 - public function ays_poll_sale_message_mega_bundle(){
1529 - ?>
1530 - <div class="notice notice-success is-dismissible ays_poll_dicount_info" >
1531 - <div id="ays_poll_dicount_banner" class="ays_poll_dicount_month" style="display: flex;align-items: center;justify-content: space-between;">
1532 - <div style="display: flex; align-items: center;">
1533 - <div>
1534 - <a href="https://ays-pro.com/mega-bundle" target="_blank" class="ays-poll-sale-banner-link"><img src="<?php echo POLL_MAKER_AYS_ADMIN_URL . '/images/mega_bundle_logo_box.png';?> " style="width: 60px;"></a>
1535 - </div>
1536 - <div style="font-size:14px; padding:12px; width: 100%;">
1537 - <strong>
1538 - <?php echo __( "Limited Time <span style='color:red;'>50%</span> SALE on 3 Powerful Plugins (Quiz, Survey, Poll)!", "poll-maker");?>
1539 - </strong>
1540 - <br>
1541 - <strong style="font-size: 12px;">
1542 - <?php echo __( "Mega bundle offer for you! It consists of 3 different powerful plugins, each one allowing you to make your WordPress experience the best that could be.", "poll-maker");?>
1543 - <br>
1544 - <?php echo __( "Hurry up! Ends on October 15. <a href='https://ays-pro.com/mega-bundle' target='_blank'>Check it out!</a>", "poll-maker");?>
1545 - </strong>
1546 - <form action="" method="POST">
1547 - <button class="btn btn-link ays-button" name="ays_poll_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0" value='mega_bundle'>Dismiss ad</button>
1548 - </form>
1549 - </div>
1550 - </div>
1551 - <a href="https://ays-pro.com/mega-bundle" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank" style="height: 32px; display: flex; align-items: center; font-weight: 500; " ><?php echo __('Buy Now !', "poll-maker");?> </a>
1552 - </div>
1553 - </div>
1554 - <?php
1555 - }
2215 + $svg_icon = '<svg width="21" height="22" viewBox="0 0 21 22" fill="none" xmlns="http://www.w3.org/2000/svg">
2216 + <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"/>
2217 + </svg>
2218 + ';
1556 2219
1557 - // Business bundle sale
1558 - public function ays_poll_sale_message_business_bundle(){
1559 - ?>
1560 - <div class="notice notice-success is-dismissible ays_poll_dicount_info" >
1561 - <div id="ays_poll_dicount_banner" class="ays_poll_dicount_month" style="display: flex;align-items: center;justify-content: space-between;">
1562 - <div style="display: flex; align-items: center;">
1563 - <div>
1564 - <a href="https://ays-pro.com/business-bundle" target="_blank" class="ays-poll-sale-banner-link"><img src="<?php echo POLL_MAKER_AYS_ADMIN_URL . '/images/business_bundle_logo.png';?> " style="width: 60px;"></a>
1565 - </div>
1566 - <div style="font-size:14px; padding:12px; width: 100%;">
1567 - <strong>
1568 - <?php echo __( "Limited Time <span style='color:red;'>50%</span> SALE on 13 Powerful Plugins!", "poll-maker");?>
1569 - </strong>
1570 - <br>
1571 - <strong style="font-size: 12px;">
1572 - <?php echo __( "Business bundle offer for you! It consists of 13 different powerful plugins, each one allowing you to make your WordPress experience the best that could be.", "poll-maker");?>
1573 - <br>
1574 - <?php echo __( "Hurry up! Ends on October 15. <a href='https://ays-pro.com/business-bundle' target='_blank'>Check it out!</a>", "poll-maker");?>
1575 - </strong>
1576 - <form action="" method="POST">
1577 - <button class="btn btn-link ays-button" name="ays_poll_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0" value='business_bundle'>Dismiss ad</button>
1578 - </form>
1579 - </div>
1580 - </div>
1581 - <a href="https://ays-pro.com/business-bundle" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank" style="height: 32px; display: flex; align-items: center; font-weight: 500; " ><?php echo __('Buy Now !', "poll-maker");?> </a>
1582 - </div>
1583 - </div>
1584 - <?php
1585 - }
2220 + $ays_poll_cta_button_link = esc_url('https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=christmas-sale-banner-' . POLL_MAKER_AYS_VERSION);
1586 2221
1587 - // New Mega bundle sale
1588 - public function ays_poll_sale_message_new_mega_bundle(){
1589 - $content = array();
1590 - $content[] = '<div id="ays-poll-dicount-month-main" class="notice notice-success is-dismissible ays_survey_dicount_info">';
1591 - $content[] = '<div id="ays-poll-dicount-month" class="ays_survey_dicount_month">';
1592 - $content[] = '<a href="https://bit.ly/3keKTm9" target="_blank" class="ays-poll-sale-banner-link"><img src="' . POLL_MAKER_AYS_ADMIN_URL . '/images/mega_bundle_logo_box.png"></a>';
2222 + $content[] = '<div id="ays-poll-christmas-banner-main" class="notice notice-success is-dismissible ays-poll-christmas-banner-info ays_poll_dicount_info">';
2223 + $content[] = '<div id="ays-poll-christmas-banner-month" class="ays-poll-christmas-banner-month">';
2224 +
2225 + // Background effects
2226 + $content[] = '<div class="ays-poll-christmas-banner-bg-effects">';
2227 + $content[] = '<div class="ays-poll-christmas-banner-bg-gradient-1"></div>';
2228 + $content[] = '<div class="ays-poll-christmas-banner-bg-gradient-2"></div>';
2229 +
2230 + // Snowflakes
2231 + $content[] = '<div class="ays-poll-christmas-banner-snowflake" style="left: 5%; animation-delay: 0s; animation-duration: 8s;">'. $svg_icon .'</div>';
2232 + $content[] = '<div class="ays-poll-christmas-banner-snowflake" style="left: 15%; animation-delay: 2s; animation-duration: 10s;">'. $svg_icon .'</div>';
2233 + $content[] = '<div class="ays-poll-christmas-banner-snowflake" style="left: 25%; animation-delay: 4s; animation-duration: 9s;">'. $svg_icon .'</div>';
2234 + $content[] = '<div class="ays-poll-christmas-banner-snowflake" style="left: 75%; animation-delay: 1s; animation-duration: 11s;">'. $svg_icon .'</div>';
2235 + $content[] = '<div class="ays-poll-christmas-banner-snowflake" style="left: 85%; animation-delay: 3s; animation-duration: 8s;">'. $svg_icon .'</div>';
2236 + $content[] = '<div class="ays-poll-christmas-banner-snowflake" style="left: 92%; animation-delay: 5s; animation-duration: 10s;">'. $svg_icon .'</div>';
2237 +
2238 + // Sparkles
2239 + $content[] = '<svg class="ays-poll-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">';
2240 + $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"/>';
2241 + $content[] = '</svg>';
2242 + $content[] = '<svg class="ays-poll-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">';
2243 + $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"/>';
2244 + $content[] = '</svg>';
2245 + $content[] = '<svg class="ays-poll-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">';
2246 + $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"/>';
2247 + $content[] = '</svg>';
2248 + $content[] = '</div>';
1593 2249
1594 - $content[] = '<div class="ays-poll-dicount-wrap-box">';
2250 + // Main content
2251 + $content[] = '<div class="ays-poll-christmas-banner-content">';
2252 + $content[] = '<div class="ays-poll-christmas-banner-left">';
2253 + // Gift icon with hat
2254 + $content[] = '<div class="ays-poll-christmas-banner-gift-wrapper">';
2255 + $content[] = '<svg class="ays-poll-christmas-banner-gift-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">';
2256 + $content[] = '<rect x="3" y="8" width="18" height="4" rx="1"></rect>';
2257 + $content[] = '<path d="M12 8v13"></path>';
2258 + $content[] = '<path d="M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7"></path>';
2259 + $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>';
2260 + $content[] = '</svg>';
2261 + $content[] = '<div class="ays-poll-christmas-banner-hat">';
2262 + $content[] = '<svg viewBox="0 0 24 24" fill="none" class="ays-poll-christmas-banner-hat-svg">';
2263 + $content[] = '<path d="M12 2L4 14h16L12 2z" fill="hsl(0 80% 45%)"></path>';
2264 + $content[] = '<path d="M4 14c0 2 3.5 3 8 3s8-1 8-3" fill="hsl(0 0% 100%)"></path>';
2265 + $content[] = '<circle cx="12" cy="3" r="2" fill="hsl(0 0% 100%)"></circle>';
2266 + $content[] = '</svg>';
2267 + $content[] = '</div>';
2268 + $content[] = '</div>';
1595 2269
1596 - $content[] = '<strong style="font-weight: bold;">';
1597 - $content[] = __( "Limited Time <span style='color:#E85011;'>55%</span> SALE on <br><a href='https://bit.ly/3keKTm9' class='ays-poll-sale-banner-link-for-text' target='_blank'><span style='color:#E85011;'>Mega Bundle</span></a> (Quiz + Survey + Poll)!", "poll-maker" );
1598 - $content[] = '</strong>';
2270 + $content[] = '<div class="ays-poll-christmas-banner-special-label">';
2271 + $content[] = '<div class="ays-poll-christmas-banner-special-label-name">';
2272 + $content[] = '<a href="'. $ays_poll_cta_button_link .'" class="ays-poll-christmas-banner-special-label-name-link" target="_blank">';
2273 + $content[] = __( 'Poll Maker', "poll-maker" );
2274 + $content[] = '</a>';
2275 + $content[] = '</div>';
1599 2276
1600 - $content[] = '<br>';
2277 + $content[] = '<div>✦ ' . __( 'CHRISTMAS SPECIAL', "poll-maker" ) . ' ✦</div>';
2278 + $content[] = '</div>';
2279 + $content[] = '</div>';
1601 2280
1602 - $content[] = '<strong>';
1603 - $content[] = __( "Hurry up! Ends on November 15. <a href='https://bit.ly/3keKTm9' target='_blank'>Check it out!</a>", "poll-maker" );
1604 - $content[] = '</strong>';
1605 -
1606 - $content[] = '<form action="" method="POST">';
1607 - $content[] = '<button class="btn btn-link ays-button" value="new_mega_bundle" name="ays_poll_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>';
1608 - $content[] = '</form>';
1609 -
1610 - $content[] = '</div>';
2281 + $content[] = '<div class="ays-poll-christmas-banner-center">';
2282 + $content[] = '<div class="ays-poll-christmas-banner-discount-text">25% OFF</div>';
2283 + $content[] = '<div class="ays-poll-christmas-banner-limited-offer">' . __( 'Limited time offer', "poll-maker" ) . '</div>';
2284 + $content[] = '</div>';
1611 2285
1612 - $content[] = '<div class="ays-poll-dicount-wrap-box">';
2286 + $content[] = '<div class="ays-poll-christmas-banner-right">';
2287 + $content[] = '<div class="ays-poll-christmas-banner-coupon-box" onclick="aysPollChristmasCopyToClipboard(\'XMAS25\')" title="' . __( 'Click to copy', "poll-maker" ) . '">';
2288 + $content[] = '<span class="ays-poll-christmas-banner-coupon-text">XMAS25</span>';
2289 + $content[] = '<svg class="ays-poll-christmas-banner-copy-icon" width="16" height="16" viewBox="0 0 16 16" fill="none">';
2290 + $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"/>';
2291 + $content[] = '</svg>';
2292 + $content[] = '</div>';
1613 2293
1614 - $content[] = '<div id="ays-poll-maker-countdown-main-container">';
1615 - $content[] = '<div class="ays-poll-maker-countdown-container">';
2294 + $content[] = '<a href="'. $ays_poll_cta_button_link .'" class="ays-poll-christmas-banner-buy-now-btn" target="_blank">';
2295 + $content[] = __( 'Buy Now', "poll-maker" );
2296 + $content[] = '</a>';
2297 + $content[] = '</div>';
2298 + $content[] = '</div>';
1616 2299
1617 - $content[] = '<div id="ays-poll-countdown">';
1618 - $content[] = '<ul>';
1619 - $content[] = '<li><span id="ays-poll-countdown-days"></span>days</li>';
1620 - $content[] = '<li><span id="ays-poll-countdown-hours"></span>Hours</li>';
1621 - $content[] = '<li><span id="ays-poll-countdown-minutes"></span>Minutes</li>';
1622 - $content[] = '<li><span id="ays-poll-countdown-seconds"></span>Seconds</li>';
1623 - $content[] = '</ul>';
1624 - $content[] = '</div>';
2300 + $content[] = '</div>';
1625 2301
1626 - $content[] = '<div id="ays-poll-countdown-content" class="emoji">';
1627 - $content[] = '<span>🚀</span>';
1628 - $content[] = '<span>⌛</span>';
1629 - $content[] = '<span>🔥</span>';
1630 - $content[] = '<span>💣</span>';
1631 - $content[] = '</div>';
2302 + if( current_user_can( 'manage_options' ) ){
2303 + $content[] = '<div id="ays-poll-dismiss-buttons-content">';
2304 + $content[] = '<form action="" method="POST" style="position: absolute; bottom: 0; right: 0; color: #fff;">';
2305 + $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn" style="color: darkgrey; font-size: 11px; padding: 0 .75rem;">'. __( "Dismiss ad", 'poll-maker' ) .'</button>';
2306 + $content[] = wp_nonce_field( POLL_MAKER_AYS_NAME . '-sale-banner' , POLL_MAKER_AYS_NAME . '-sale-banner' );
2307 + $content[] = '</form>';
2308 + $content[] = '</div>';
2309 + }
1632 2310
1633 - $content[] = '</div>';
1634 - $content[] = '</div>';
1635 -
1636 - $content[] = '</div>';
2311 + $content[] = '</div>';
1637 2312
1638 - $content[] = '<a href="https://bit.ly/3keKTm9" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank" style="height: 32px; display: flex; align-items: center; font-weight: 500; " >' . __( 'Buy Now !', "poll-maker" ) . '</a>';
1639 - $content[] = '</div>';
1640 - $content[] = '</div>';
2313 + $content[] = '<script>';
2314 + $content[] = "
2315 + function aysPollChristmasCopyToClipboard(text) {
2316 + var textarea = document.createElement('textarea');
2317 + textarea.value = text;
2318 + textarea.style.position = 'fixed';
2319 + textarea.style.opacity = '0';
2320 + document.body.appendChild(textarea);
2321 +
2322 + textarea.select();
2323 + textarea.setSelectionRange(0, 99999);
2324 +
2325 + try {
2326 + document.execCommand('copy');
2327 + aysPollChristmasShowCopyNotification('" . __( 'Coupon code copied!', "poll-maker" ) . "');
2328 + } catch (err) {
2329 + console.error('Failed to copy text: ', err);
2330 + }
2331 +
2332 + document.body.removeChild(textarea);
2333 + }
1641 2334
2335 + function aysPollChristmasShowCopyNotification(message) {
2336 + var existingNotification = document.querySelector('.ays-poll-christmas-banner-copy-notification');
2337 + if (existingNotification) {
2338 + document.body.removeChild(existingNotification);
2339 + }
2340 +
2341 + var notification = document.createElement('div');
2342 + notification.className = 'ays-poll-christmas-banner-copy-notification';
2343 + notification.textContent = message;
2344 + document.body.appendChild(notification);
2345 +
2346 + setTimeout(function() {
2347 + notification.classList.add('show');
2348 + }, 10);
2349 +
2350 + setTimeout(function() {
2351 + notification.classList.remove('show');
2352 + setTimeout(function() {
2353 + if (notification.parentNode) {
2354 + document.body.removeChild(notification);
2355 + }
2356 + }, 300);
2357 + }, 2000);
2358 + }";
2359 + $content[] = '</script>';
2360 +
2361 + $content[] = '<style>';
2362 + $content[] = '
2363 + /* Christmas banner start */
2364 +
2365 + div#ays-poll-christmas-banner-main .btn-link {
2366 + background-color: transparent;
2367 + display: inline-block;
2368 + font-weight: 400;
2369 + text-align: center;
2370 + white-space: nowrap;
2371 + vertical-align: middle;
2372 + -webkit-user-select: none;
2373 + -moz-user-select: none;
2374 + -ms-user-select: none;
2375 + user-select: none;
2376 + border: 1px solid transparent;
2377 + padding: .375rem .75rem;
2378 + font-size: 12px;
2379 + line-height: 1.5;
2380 + border-radius: .25rem;
2381 + color: rgba(255, 255, 255, .6);
2382 + }
2383 +
2384 + div#ays-poll-christmas-banner-main.ays-poll-christmas-banner-info {
2385 + background: linear-gradient(to right, hsl(0, 70%, 28%), hsl(0, 65%, 38%), hsl(0, 70%, 28%));
2386 + padding: unset;
2387 + border-left: 0;
2388 + position: relative;
2389 + }
2390 +
2391 + #ays-poll-christmas-banner-main .ays-poll-christmas-banner-month {
2392 + position: relative;
2393 + padding: 15px 40px;
2394 + overflow: hidden;
2395 + }
2396 +
2397 + /* Background effects */
2398 + .ays-poll-christmas-banner-bg-effects {
2399 + position: absolute;
2400 + top: 0;
2401 + left: 0;
2402 + right: 0;
2403 + bottom: 0;
2404 + pointer-events: none;
2405 + z-index: 1;
2406 + }
2407 +
2408 + .ays-poll-christmas-banner-bg-gradient-1 {
2409 + position: absolute;
2410 + top: 0;
2411 + left: 30%;
2412 + width: 40%;
2413 + height: 100%;
2414 + background: radial-gradient(circle, rgba(202, 43, 43, 0.5) 0%, transparent 60%);
2415 + opacity: 0.4;
2416 + }
2417 +
2418 + .ays-poll-christmas-banner-bg-gradient-2 {
2419 + position: absolute;
2420 + top: 0;
2421 + right: 15%;
2422 + width: 35%;
2423 + height: 100%;
2424 + background: radial-gradient(circle, rgba(246, 201, 85, 0.15) 0%, transparent 50%);
2425 + opacity: 0.3;
2426 + }
2427 +
2428 + .ays-poll-christmas-banner-snowflake {
2429 + position: absolute;
2430 + color: rgba(255, 255, 255, 0.2);
2431 + font-size: 20px;
2432 + animation: ays-poll-christmas-snowfall linear infinite;
2433 + top: -10px;
2434 + }
2435 +
2436 + @keyframes ays-poll-christmas-snowfall {
2437 + 0% {
2438 + transform: translateY(-10px) rotate(0deg);
2439 + opacity: 0;
2440 + }
2441 + 10% {
2442 + opacity: 0.8;
2443 + }
2444 + 90% {
2445 + opacity: 0.8;
2446 + }
2447 + 100% {
2448 + transform: translateY(100%) rotate(360deg);
2449 + opacity: 0;
2450 + }
2451 + }
2452 +
2453 + .ays-poll-christmas-banner-sparkle {
2454 + position: absolute;
2455 + color: hsl(43, 90%, 65%);
2456 + animation: ays-poll-christmas-twinkle 2s ease-in-out infinite;
2457 + }
2458 +
2459 + @keyframes ays-poll-christmas-twinkle {
2460 + 0%, 100% {
2461 + opacity: 0.3;
2462 + transform: scale(0.8);
2463 + }
2464 + 50% {
2465 + opacity: 1;
2466 + transform: scale(1.2);
2467 + }
2468 + }
2469 +
2470 + /* Main content */
2471 + .ays-poll-christmas-banner-content {
2472 + position: relative;
2473 + display: flex;
2474 + align-items: center;
2475 + justify-content: space-between;
2476 + z-index: 2;
2477 + }
2478 +
2479 + /* Left section */
2480 + .ays-poll-christmas-banner-left {
2481 + display: flex;
2482 + align-items: center;
2483 + gap: 50px;
2484 + }
2485 +
2486 + .ays-poll-christmas-banner-gift-wrapper {
2487 + position: relative;
2488 + animation: ays-poll-christmas-float 3s ease-in-out infinite;
2489 + }
2490 +
2491 + .ays-poll-christmas-banner-gift-icon {
2492 + width: 48px;
2493 + height: 48px;
2494 + color: rgba(255, 247, 237, 0.9);
2495 + }
2496 +
2497 + @keyframes ays-poll-christmas-float {
2498 + 0%, 100% {
2499 + transform: translateY(0);
2500 + }
2501 + 50% {
2502 + transform: translateY(-5px);
2503 + }
2504 + }
2505 +
2506 + .ays-poll-christmas-banner-hat {
2507 + position: absolute;
2508 + top: -12px;
2509 + right: -4px;
2510 + width: 24px;
2511 + height: 24px;
2512 + }
2513 +
2514 + .ays-poll-christmas-banner-hat-svg {
2515 + width: 100%;
2516 + height: 100%;
2517 + }
2518 +
2519 + .ays-poll-christmas-banner-special-label {
2520 + color: hsl(43, 90%, 65%);
2521 + font-size: 14px;
2522 + font-weight: 500;
2523 + text-transform: uppercase;
2524 + letter-spacing: 1px;
2525 + /* font-family: "Outfit", sans-serif; */
2526 + }
2527 +
2528 + .ays-poll-christmas-banner-special-label-name {
2529 + color: #fffaf0;
2530 + text-align: center;
2531 + }
2532 +
2533 + div#ays-poll-christmas-banner-main .ays-poll-christmas-banner-special-label-name-link {
2534 + color: #fffaf0;
2535 + box-shadow: unset;
2536 + }
2537 +
2538 + /* Center section */
2539 + .ays-poll-christmas-banner-center {
2540 + display: flex;
2541 + flex-direction: row;
2542 + text-align: center;
2543 + justify-content: center;
2544 + align-items: center;
2545 + gap: 30px;
2546 + }
2547 +
2548 + .ays-poll-christmas-banner-discount-text {
2549 + font-family: "Outfit", sans-serif;
2550 + font-weight: 800;
2551 + font-size: 30px;
2552 + color: hsl(40, 100%, 97%);
2553 + letter-spacing: -1px;
2554 + line-height: 1;
2555 + }
2556 +
2557 + .ays-poll-christmas-banner-limited-offer {
2558 + color: rgba(255, 247, 237, 0.7);
2559 + font-size: 13px;
2560 + font-weight: 500;
2561 + }
2562 +
2563 + /* Right section */
2564 + .ays-poll-christmas-banner-right {
2565 + display: flex;
2566 + align-items: center;
2567 + gap: 20px;
2568 + }
2569 +
2570 + .ays-poll-christmas-banner-coupon-box {
2571 + border: 2px dashed rgba(255, 255, 255, 0.4);
2572 + padding: 8px 16px;
2573 + border-radius: 6px;
2574 + background: rgba(255, 255, 255, 0.1);
2575 + cursor: pointer;
2576 + transition: all 0.3s;
2577 + display: flex;
2578 + align-items: center;
2579 + gap: 8px;
2580 + backdrop-filter: blur(10px);
2581 + }
2582 +
2583 + .ays-poll-christmas-banner-coupon-box:hover {
2584 + background: rgba(255, 255, 255, 0.2);
2585 + border-color: rgba(255, 255, 255, 0.6);
2586 + transform: translateY(-1px);
2587 + }
2588 +
2589 + .ays-poll-christmas-banner-coupon-text {
2590 + font-size: 16px;
2591 + font-weight: 700;
2592 + letter-spacing: 1px;
2593 + color: #fff;
2594 + font-family: monospace;
2595 + }
2596 +
2597 + .ays-poll-christmas-banner-copy-icon {
2598 + opacity: 0.8;
2599 + transition: opacity 0.3s;
2600 + }
2601 +
2602 + .ays-poll-christmas-banner-coupon-box:hover .ays-poll-christmas-banner-copy-icon {
2603 + opacity: 1;
2604 + }
2605 +
2606 + #ays-poll-christmas-banner-main .ays-poll-christmas-banner-buy-now-btn {
2607 + background-color: #fbe19f;
2608 + color: hsl(0, 72%, 35%);
2609 + padding: 10px 30px;
2610 + border-radius: 9999px;
2611 + font-size: 16px;
2612 + font-weight: 600;
2613 + font-family: "Outfit", sans-serif;
2614 + border: none;
2615 + cursor: pointer;
2616 + transition: all 0.3s;
2617 + text-decoration: none;
2618 + display: flex;
2619 + align-items: center;
2620 + gap: 6px;
2621 + box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 30px rgba(246, 201, 85, 0.2);
2622 + }
2623 +
2624 + #ays-poll-christmas-banner-main .ays-poll-christmas-banner-buy-now-btn:hover {
2625 + background-color: #f2d58c;
2626 + transform: scale(1.05);
2627 + box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2), 0 0 40px rgba(246, 201, 85, 0.3);
2628 + }
2629 +
2630 + .ays-poll-christmas-banner-btn-arrow {
2631 + display: inline-block;
2632 + transition: transform 0.3s;
2633 + }
2634 +
2635 + .ays-poll-christmas-banner-buy-now-btn:hover .ays-poll-christmas-banner-btn-arrow {
2636 + transform: translateX(4px);
2637 + }
2638 +
2639 + /* Notification */
2640 + .ays-poll-christmas-banner-copy-notification {
2641 + position: fixed;
2642 + top: 50%;
2643 + left: 50%;
2644 + transform: translate(-50%, -50%);
2645 + background: rgba(0, 0, 0, 0.8);
2646 + color: #fff;
2647 + padding: 12px 24px;
2648 + border-radius: 8px;
2649 + font-size: 14px;
2650 + z-index: 10000;
2651 + opacity: 0;
2652 + transition: opacity 0.3s;
2653 + }
2654 +
2655 + .ays-poll-christmas-banner-copy-notification.show {
2656 + opacity: 1;
2657 + }
2658 +
2659 + /* Dismiss button */
2660 + #ays-poll-christmas-banner-main #ays-poll-christmas-banner-dismiss-content {
2661 + display: flex;
2662 + justify-content: center;
2663 + }
2664 +
2665 + #ays-poll-christmas-banner-main #ays-poll-christmas-banner-dismiss-content .ays-button {
2666 + margin: 0 !important;
2667 + font-size: 13px;
2668 + color: rgba(150, 147, 147, 0.69);
2669 + }
2670 +
2671 + /* Responsive */
2672 + @media (max-width: 1024px) {
2673 + .ays-poll-christmas-banner-discount-text {
2674 + font-size: 40px;
2675 + }
2676 + .ays-poll-christmas-banner-content {
2677 + flex-wrap: wrap;
2678 + }
2679 + }
2680 +
2681 + @media (max-width: 768px) {
2682 + #ays-poll-christmas-banner-main {
2683 + display: none !important;
2684 + }
2685 + }
2686 + /* Christmas banner end */
2687 + ';
2688 + $content[] = '</style>';
2689 +
1642 2690 $content = implode( '', $content );
2691 +
1643 2692 echo $content;
2693 +
1644 2694 }
1645 2695
1646 - // Black friday bundle
1647 - public function ays_poll_sale_message_black_friday(){
2696 + // Black Friday
2697 + public function ays_poll_black_friday_message(){
2698 +
1648 2699 $content = array();
1649 2700
1650 - $content[] = '<div id="ays-poll-dicount-black-friday-month-main" class="notice notice-success is-dismissible ays_poll_dicount_info">';
1651 - $content[] = '<div id="ays-poll-dicount-black-friday-month" class="ays_poll_dicount_month">';
1652 - $content[] = '<div class="ays-poll-dicount-black-friday-box">';
1653 - $content[] = '<div class="ays-poll-dicount-black-friday-wrap-box ays-poll-dicount-black-friday-wrap-box-80" style="width: 70%;">';
1654 - $content[] = '<div class="ays-poll-dicount-black-friday-title-row">' . __( 'Limited Time', "poll-maker" ) .' '. '<a href="https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=black-friday-sale-banner" class="ays-poll-dicount-black-friday-button-sale" target="_blank">' . __( 'Sale', "poll-maker" ) . '</a>' . '</div>';
1655 - $content[] = '<div class="ays-poll-dicount-black-friday-title-row">' . __( 'Poll Maker', "poll-maker" ) . '</div>';
2701 + $ays_poll_cta_button_link = esc_url('https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=black-friday-sale-banner-' . POLL_MAKER_AYS_VERSION);
2702 +
2703 + $content[] = '<div id="ays-poll-dicount-black-friday-month-main" class="notice notice-success is-dismissible ays_poll_dicount_info">';
2704 + $content[] = '<div id="ays-poll-dicount-black-friday-month" class="ays_poll_dicount_month">';
2705 + $content[] = '<div class="ays-poll-dicount-black-friday-box">';
2706 + $content[] = '<div class="ays-poll-dicount-black-friday-wrap-box ays-poll-dicount-black-friday-wrap-box-80" style="width: 70%;">';
2707 + $content[] = '<div class="">';
2708 + $content[] = '<div class="ays-poll-dicount-black-friday-title-row" >' . __( 'Coupon Code', "poll-maker" ) .' ' . '</div>';
2709 + $content[] = '<div class="ays-poll-dicount-black-friday-title-row">';
2710 +
2711 + $content[] = '
2712 + <span class="ays-poll-dicount-black-friday-banner-2025-coupon-wrapper">
2713 + <span class="ays-poll-dicount-black-friday-banner-2025-coupon-box" onclick="aysPollHalloweenCopyToClipboard(\'FREE2PROBF\')" title="' . __( 'Click to copy', "poll-maker" ) . '">
2714 + <span class="ays-poll-dicount-black-friday-banner-2025-coupon-text">FREE2PROBF</span>
2715 + <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="ays-poll-dicount-black-friday-banner-2025-copy-icon">
2716 + <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"/>
2717 + </svg>
2718 + </span>
2719 + </span>';
2720 + $content[] = '</div> ';
1656 2721 $content[] = '</div>';
1657 2722
1658 - $content[] = '<div class="ays-poll-dicount-black-friday-wrap-box ays-poll-dicount-black-friday-wrap-text-box">';
1659 - $content[] = '<div class="ays-poll-dicount-black-friday-text-row">' . __( '20% off', "poll-maker" ) . '</div>';
1660 - $content[] = '</div>';
2723 + $content[] = '</div>';
1661 2724
1662 - $content[] = '<div class="ays-poll-dicount-black-friday-wrap-box" style="width: 25%;">';
1663 - $content[] = '<div id="ays-poll-countdown-main-container">';
1664 - $content[] = '<div class="ays-poll-countdown-container">';
1665 - $content[] = '<div id="ays-poll-countdown" style="display: block;">';
1666 - $content[] = '<ul>';
1667 - $content[] = '<li><span id="ays-poll-countdown-days">0</span>' . __( 'Days', "poll-maker" ) . '</li>';
1668 - $content[] = '<li><span id="ays-poll-countdown-hours">0</span>' . __( 'Hours', "poll-maker" ) . '</li>';
1669 - $content[] = '<li><span id="ays-poll-countdown-minutes">0</span>' . __( 'Minutes', "poll-maker" ) . '</li>';
1670 - $content[] = '<li><span id="ays-poll-countdown-seconds">0</span>' . __( 'Seconds', "poll-maker" ) . '</li>';
1671 - $content[] = '</ul>';
1672 - $content[] = '</div>';
1673 - $content[] = '<div id="ays-poll-countdown-content" class="emoji" style="display: none;">';
1674 - $content[] = '<span>🚀</span>';
1675 - $content[] = '<span>⌛</span>';
1676 - $content[] = '<span>🔥</span>';
1677 - $content[] = '<span>💣</span>';
1678 - $content[] = '</div>';
2725 + $content[] = '<div class="ays-poll-dicount-black-friday-wrap-box ays-poll-dicount-black-friday-wrap-text-box">';
2726 + $content[] = '<div class="ays-poll-dicount-black-friday-text-row">' . '30% off' . '</div>';
2727 + $content[] = '</div>';
2728 +
2729 + $content[] = '<div class="ays-poll-dicount-black-friday-wrap-box" style="width: 25%;">';
2730 + $content[] = '<div id="ays-poll-countdown-main-container">';
2731 + $content[] = '<div class="ays-poll-countdown-container">';
2732 + $content[] = '<div id="ays-poll-countdown" style="display: block;">';
2733 + $content[] = '<ul>';
2734 + $content[] = '<li><span id="ays-poll-countdown-days"></span>' . __( 'Days', "poll-maker" ) . '</li>';
2735 + $content[] = '<li><span id="ays-poll-countdown-hours"></span>' . __( 'Hours', "poll-maker" ) . '</li>';
2736 + $content[] = '<li><span id="ays-poll-countdown-minutes"></span>' . __( 'Minutes', "poll-maker" ) . '</li>';
2737 + $content[] = '<li><span id="ays-poll-countdown-seconds"></span>' . __( 'Seconds', "poll-maker" ) . '</li>';
2738 + $content[] = '</ul>';
1679 2739 $content[] = '</div>';
2740 + $content[] = '<div id="ays-poll-countdown-content" class="emoji" style="display: none;">';
2741 + $content[] = '<span></span>';
2742 + $content[] = '<span></span>';
2743 + $content[] = '<span></span>';
2744 + $content[] = '<span></span>';
2745 + $content[] = '</div>';
1680 2746 $content[] = '</div>';
1681 2747 $content[] = '</div>';
2748 + $content[] = '</div>';
1682 2749
1683 - $content[] = '<div class="ays-poll-dicount-black-friday-wrap-box" style="width: 25%;">';
1684 - $content[] = '<a href="https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=black-friday-sale-banner" class="ays-poll-dicount-black-friday-button-buy-now" target="_blank">' . __( 'Get Your Deal', "poll-maker" ) . '</a>';
1685 - $content[] = '</div>';
2750 + $content[] = '<div class="ays-poll-dicount-black-friday-wrap-box" style="width: 25%;">';
2751 + $content[] = '<a href="'. $ays_poll_cta_button_link .'" class="ays-poll-dicount-black-friday-button-buy-now" target="_blank">' . __( 'Get Your Deal', "poll-maker" ) . '</a>';
1686 2752 $content[] = '</div>';
1687 2753 $content[] = '</div>';
2754 + $content[] = '</div>';
1688 2755
1689 - $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-poll-dismiss-buttons-container-for-form-black-friday">';
1690 - $content[] = '<form action="" method="POST">';
1691 - $content[] = '<div id="ays-poll-dismiss-buttons-content">';
1692 - if( current_user_can( 'manage_options' ) ){
1693 - $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn_black_friday" style="" value="black_friday">' . __( 'Dismiss ad', "poll-maker" ) . '</button>';
1694 - $content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' );
1695 - }
1696 - $content[] = '</div>';
1697 - $content[] = '</form>';
1698 - $content[] = '</div>';
2756 + $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-poll-dismiss-buttons-container-for-form-black-friday">';
2757 + $content[] = '<form action="" method="POST">';
2758 + $content[] = '<div id="ays-poll-dismiss-buttons-content">';
2759 + if( current_user_can( 'manage_options' ) ){
2760 + $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>';
2761 + $content[] = wp_nonce_field( POLL_MAKER_AYS_NAME . '-sale-banner' , POLL_MAKER_AYS_NAME . '-sale-banner' );
2762 + }
2763 + $content[] = '</div>';
2764 + $content[] = '</form>';
1699 2765 $content[] = '</div>';
2766 + $content[] = '</div>';
1700 2767
2768 + $content[] = '<script>';
2769 + $content[] = "
2770 + function aysPollHalloweenCopyToClipboard(text) {
2771 + // Create a temporary textarea element
2772 + var textarea = document.createElement('textarea');
2773 + textarea.value = text;
2774 + textarea.style.position = 'fixed';
2775 + textarea.style.opacity = '0';
2776 + document.body.appendChild(textarea);
2777 +
2778 + // Select and copy the text
2779 + textarea.select();
2780 + textarea.setSelectionRange(0, 99999); // For mobile devices
2781 +
2782 + try {
2783 + document.execCommand('copy');
2784 + aysPollHalloweenShowCopyNotification('Coupon code copied!');
2785 + } catch (err) {
2786 + console.error('Failed to copy text: ', err);
2787 + }
2788 +
2789 + // Remove the temporary textarea
2790 + document.body.removeChild(textarea);
2791 + }
2792 +
2793 + function aysPollHalloweenShowCopyNotification(message) {
2794 + // Check if notification already exists
2795 + var existingNotification = document.querySelector('.ays-poll-discount-black-friday-banner-2025-copy-notification');
2796 + if (existingNotification) {
2797 + document.body.removeChild(existingNotification);
2798 + }
2799 +
2800 + // Create notification element
2801 + var notification = document.createElement('div');
2802 + notification.className = 'ays-poll-discount-black-friday-banner-2025-copy-notification';
2803 + notification.textContent = message;
2804 + document.body.appendChild(notification);
2805 +
2806 + // Show notification with animation
2807 + setTimeout(function() {
2808 + notification.classList.add('show');
2809 + }, 10);
2810 +
2811 + // Hide and remove notification after 2 seconds
2812 + setTimeout(function() {
2813 + notification.classList.remove('show');
2814 + setTimeout(function() {
2815 + if (notification.parentNode) {
2816 + document.body.removeChild(notification);
2817 + }
2818 + }, 300);
2819 + }, 2000);
2820 + }";
2821 + $content[] = '</script>';
2822 +
2823 + $content[] = '<style>';
2824 + $content[] = '
2825 + /* Black friday banner start */
2826 + div#ays-poll-dicount-black-friday-month-main *{color:#fff}div#ays-poll-dicount-black-friday-month-main div#ays-poll-dicount-black-friday-month a.ays-poll-sale-banner-link:focus{outline:0;box-shadow:0}div#ays-poll-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-poll-dicount-black-friday-month-main.ays_poll_dicount_info{background-image:linear-gradient(45deg,#1e101d,#c60af4);padding:unset;border-left:0}#ays-poll-dicount-black-friday-month-main .ays_poll_dicount_month{position:relative;background-image:url("'. esc_attr(POLL_MAKER_AYS_ADMIN_URL) .'/images/black-friday-plugins-background-image.webp");background-position:center right;background-repeat:no-repeat;background-size:100% 100%}#ays-poll-dicount-black-friday-month-main .ays_poll_dicount_month img{width:80px}#ays-poll-dicount-black-friday-month-main .ays-poll-sale-banner-link{display:flex;justify-content:center;align-items:center;width:200px}#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-button-sale{font-style:normal;font-weight:600;font-size:24px;text-align:center;color:#b2ff00;text-transform:uppercase}#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-wrap-box{font-size:14px;padding:12px;text-align:center;width:50%;white-space:nowrap}#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-wrap-box strong{font-size:17px;font-weight:700;letter-spacing:.8px}#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-wrap-color{color:#971821}#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-wrap-text-decoration{text-decoration:underline}#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-wrap-box.ays-buy-now-button-box{display:flex;justify-content:flex-end;align-items:center;width:30%}#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-wrap-box .ays-button,#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-wrap-box .ays-buy-now-button{align-items:center;font-weight:500}#ays-poll-dicount-black-friday-month-main .ays-poll-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-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-wrap-box .ays-buy-now-button:hover{background:#7d161d;border-color:#971821}#ays-poll-dicount-black-friday-month-main #ays-poll-dismiss-buttons-content{display:flex;justify-content:center}#ays-poll-dicount-black-friday-month-main #ays-poll-dismiss-buttons-content .ays-button{margin:0!important;font-size:13px;color:#969393b0}#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-wrap-opacity-box{width:19%}#ays-poll-dicount-black-friday-month-main .ays-buy-now-opacity-button{padding:40px 15px;display:flex;justify-content:center;align-items:center;opacity:0}#ays-poll-countdown-main-container .ays-poll-countdown-container{margin:0 auto;text-align:center}#ays-poll-countdown-main-container #ays-poll-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-poll-countdown-main-container li,#ays-poll-countdown-main-container ul{margin:0;font-weight:600}#ays-poll-countdown-main-container li{display:inline-block;font-size:10px;list-style-type:none;padding:10px;text-transform:uppercase}#ays-poll-countdown-main-container li span{display:block;font-size:22px;min-height:33px}#ays-poll-countdown-main-container .emoji{display:none;padding:1rem}#ays-poll-countdown-main-container .emoji span{font-size:25px;padding:0 .5rem}#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-box{display:flex;justify-content:space-between;align-items:center;width:95%;margin:auto}#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-title-row{text-align:center;padding-right:50px;font-style:normal;font-weight:900;font-size:19px;color:#fff;}#ays-poll-dicount-black-friday-month-main .ays-poll-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-poll-dicount-black-friday-month-main .ays-poll-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-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-wrap-text-box{position:absolute;width:25%;top:10px;bottom:0;right:0;left:0;margin:0 auto}#ays-poll-countdown ul{padding:0}#ays-poll-dicount-black-friday-month-main .ays-poll-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-poll-dicount-black-friday-month-main .ays-poll-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-poll-dicount-black-friday-month-main .ays-poll-discount-black-friday-banner-2025-coupon-text{font-size:14px;font-weight:700;letter-spacing:1px;color:#fff;font-family:monospace}#ays-poll-dicount-black-friday-month-main .ays-poll-discount-black-friday-banner-2025-copy-icon{opacity:.8;transition:opacity .3s}#ays-poll-dicount-black-friday-month-main .ays-poll-discount-black-friday-banner-banner-2025-coupon-box:hover .ays-poll-discount-black-friday-banner-2025-copy-icon,.ays-poll-discount-black-friday-banner-2025-copy-notification.show{opacity:1}.ays-poll-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-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-title-row{font-size:15px}div#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-text-row{font-size:27px}div#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-box{width:100%}div#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-button-buy-now{font-size:13px}div#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-wrap-box-80{width:80%!important}}@media all and (max-width:1200px){div#ays-poll-dicount-black-friday-month-main .ays_poll_dicount_month{background:unset}div#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-text-row{font-size:30px}div#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-box{width:100%}div#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-button-buy-now{font-size:15px}div#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-wrap-box-80{width:80%!important}}@media all and (max-width:1200px) and (min-width:1150px){div#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-title-row{font-size:15px}div#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-button-buy-now{font-size:10px}}@media all and (max-width:1150px){div#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-wrap-box-80{width:80%!important}div#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-box{flex-direction:column}div#ays-poll-dicount-black-friday-month-main{padding-right:0}div#ays-poll-dicount-black-friday-month-main .ays_poll_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-poll-dicount-black-friday-month-main div.ays-poll-dicount-black-friday-wrap-box{width:100%!important;text-align:center}#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-title-row,div#ays-poll-dicount-black-friday-month-main #ays-poll-countdown-main-container ul{padding:0;font-size:13px}#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-button-sale,div#ays-poll-countdown-main-container li{font-size:15px}div#ays-poll-countdown-main-container li span{font-size:25px}div#ays-poll-dicount-black-friday-month-main div.ays-poll-dicount-black-friday-wrap-text-box{position:unset}#ays-poll-countdown-main-container #ays-poll-countdown-headline{font-size:15px;font-weight:600}#ays-poll-countdown-main-container ul{font-weight:500}#ays-poll-countdown-main-container li span{font-size:20px}#ays-poll-dicount-black-friday-month-main .ays-button{margin:0 auto!important}div#ays-poll-dicount-black-friday-month-main.ays_poll_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-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-wrap-box.ays-buy-now-button-box{justify-content:center}div#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-wrap-box .ays-buy-now-button{font-size:14px;padding:5px 10px}div#ays-poll-dicount-black-friday-month-main .ays-poll-dicount-black-friday-button-buy-now{padding:10px 18px;font-size:15px}}@media all and (max-width:768px){#ays-poll-dicount-black-friday-month-main{display:none!important}}
2827 + ';
2828 + $content[] = '</style>';
2829 +
1701 2830 $content = implode( '', $content );
1702 2831
1703 2832 echo $content;
1704 2833 }
1705 2834
1706 - // Winter bundle
1707 - public function ays_poll_sale_message_winter_bundle(){
1708 - $content = array();
1709 - $content[] = '<div id="ays-poll-winter-dicount-main">';
1710 - $content[] = '<div id="ays-poll-dicount-month-main" class="notice notice-success is-dismissible ays_poll_dicount_info">';
1711 - $content[] = '<div id="ays-poll-dicount-month" class="ays_poll_dicount_month">';
1712 - $content[] = '<a href="https://ays-pro.com/mega-bundle" target="_blank" class="ays-poll-sale-banner-link"><img src="' . POLL_MAKER_AYS_ADMIN_URL . '/images/3.png"></a>';
2835 + // New Mega Bundle 2026
2836 + public function ays_poll_new_mega_bundle_message_2026(){
2837 +
2838 + $content = array();
1713 2839
1714 - $content[] = '<div class="ays-poll-dicount-wrap-box">';
2840 + $date = time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
2841 + $now_date = date('M d, Y H:i:s', $date);
1715 2842
1716 - $content[] = '<strong>';
1717 - $content[] = __( "The BIGGEST <span class='ays-poll-dicount-wrap-color' style='color:#000;'>50%</span> SALE on <br><span><a href='https://ays-pro.com/mega-bundle' target='_blank' class='ays-poll-dicount-wrap-color ays-poll-dicount-wrap-text-decoration' style='display:block;color:#000'>Christmas Bundle</a></span> (Quiz+Survey+Poll)!", "poll-maker" );
1718 - $content[] = '</strong>';
2843 + $poll_banner_date = strtotime( $this->ays_poll_update_banner_time() );
1719 2844
1720 - $content[] = '<br>';
2845 + $diff = $poll_banner_date - $date;
1721 2846
1722 - $content[] = '<strong>';
1723 - $content[] = __( "Hurry up! Ending on. <a href='https://ays-pro.com/mega-bundle' target='_blank' style='color:#000;'>Check it out!</a>", "poll-maker" );
1724 - $content[] = '</strong>';
1725 -
1726 - $content[] = '</div>';
2847 + $style_attr = '';
2848 + if( $diff < 0 ){
2849 + $style_attr = 'style="display:none;"';
2850 + }
1727 2851
1728 - $content[] = '<div class="ays-poll-dicount-wrap-box">';
2852 + $poll_cta_button_link = esc_url( 'https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=poll-free&utm_campaign=mega-bundle-sale-banner-' . POLL_MAKER_AYS_VERSION );
1729 2853
1730 - $content[] = '<div id="ays-poll-maker-countdown-main-container">';
1731 - $content[] = '<div class="ays-poll-maker-countdown-container">';
2854 + $content[] = '<div id="ays-poll-new-mega-bundle-dicount-month-main" class="ays-poll-admin-notice notice notice-success is-dismissible ays_poll_dicount_info">';
2855 + $content[] = '<div id="ays-poll-dicount-month" class="ays_poll_dicount_month">';
1732 2856
1733 - $content[] = '<div id="ays-poll-countdown">';
1734 - $content[] = '<ul>';
1735 - $content[] = '<li><span id="ays-poll-countdown-days"></span>days</li>';
1736 - $content[] = '<li><span id="ays-poll-countdown-hours"></span>Hours</li>';
1737 - $content[] = '<li><span id="ays-poll-countdown-minutes"></span>Minutes</li>';
1738 - $content[] = '<li><span id="ays-poll-countdown-seconds"></span>Seconds</li>';
1739 - $content[] = '</ul>';
1740 - $content[] = '</div>';
2857 + $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-text-box">';
2858 + $content[] = '<div>';
2859 + $content[] = '<div class="ays-poll-dicount-logo-box">';
2860 + $content[] = '<a href="' . $poll_cta_button_link . '" target="_blank" class="ays-poll-sale-banner-link"><img src="' . POLL_MAKER_AYS_ADMIN_URL . '/images/mega_bundle_logo_box.png"></a>';
1741 2861
1742 - $content[] = '<div id="ays-poll-countdown-content" class="emoji">';
1743 - $content[] = '<span>🚀</span>';
1744 - $content[] = '<span>⌛</span>';
1745 - $content[] = '<span>🔥</span>';
1746 - $content[] = '<span>💣</span>';
1747 - $content[] = '</div>';
2862 + $content[] = '<div>';
2863 + $content[] = '<span class="ays-poll-new-mega-bundle-title">';
2864 + $content[] = sprintf(
2865 + /* translators: 1: opening link wrapper with <a> tag, 2: closing </a> tag */
2866 + __( '%1$s Mega Bundle %2$s (Quiz + Survey + Poll)', 'poll-maker' ),
2867 + '<span style="display:inline-block; margin-right:5px;"><a href="' . esc_url( $poll_cta_button_link ) . '" target="_blank" rel="noopener noreferrer" style="color:#ffffff !important; text-decoration: underline;">',
2868 + '</a></span>'
2869 + );
2870 + $content[] = '</span>';
2871 + $content[] = '</br>';
2872 + $content[] = '<span class="ays-poll-new-mega-bundle-desc">';
2873 + $content[] = __( "30 Day Money Back Guarantee", 'poll-maker' );
2874 + $content[] = '</span>';
2875 + $content[] = '</div>';
1748 2876
1749 - $content[] = '</div>';
2877 + $content[] = '<div class="ays-poll-new-mega-bundle-title-icon-row" style="display: inline-block;">';
2878 + $content[] = '<img src="' . POLL_MAKER_AYS_ADMIN_URL . '/images/ays-poll-banner-50.svg" class="ays-poll-new-mega-bundle-mobile-image-display-none" style="width: 70px;">';
2879 + $content[] = '</div>';
1750 2880
1751 - $content[] = '<form action="" method="POST">';
1752 - $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn_winter" style="height: 32px;color:#000"" value="winter_bundle">Dismiss ad</button>';
1753 - $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn_winter_for_two_months" style="height: 32px; padding-left: 0;color:#000"" value="winter_bundle">Dismiss ad for 2 months</button>';
1754 - $content[] = '</form>';
2881 + $content[] = '</div>';
1755 2882
1756 - $content[] = '</div>';
1757 -
1758 - $content[] = '</div>';
2883 + $content[] = '<div class="ays-poll-new-mega-bundle-mobile-image-display-block display_none">';
2884 + $content[] = '<img src="' . POLL_MAKER_AYS_ADMIN_URL . '/images/ays-poll-banner-50.svg" style="width: 70px;">';
2885 + $content[] = '</div>';
2886 + $content[] = '</div>';
1759 2887
1760 - $content[] = '<a href="https://ays-pro.com/mega-bundle" class="button button-primary ays-button" id="ays-poll-button-top-buy-now" target="_blank">' . __( 'Buy Now !', "poll-maker" ) . '</a>';
1761 - $content[] = '</div>';
1762 - $content[] = '</div>';
1763 - $content[] = '</div>';
1764 - $content = implode( '', $content );
1765 - echo $content;
2888 + $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-poll-dismiss-buttons-container-for-form">';
2889 +
2890 + $content[] = '<form action="" method="POST">';
2891 + $content[] = '<div id="ays-poll-dismiss-buttons-content">';
2892 + if( current_user_can( 'manage_options' ) ){
2893 + $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">'. __( "Dismiss ad", 'poll-maker' ) .'</button>';
2894 + $content[] = wp_nonce_field( POLL_MAKER_AYS_NAME . '-sale-banner' , POLL_MAKER_AYS_NAME . '-sale-banner' );
2895 + }
2896 + $content[] = '</div>';
2897 + $content[] = '</form>';
2898 +
2899 + $content[] = '</div>';
2900 +
2901 + $content[] = '</div>';
2902 +
2903 + $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-countdown-box">';
2904 +
2905 + $content[] = '<div id="ays-poll-maker-countdown-main-container">';
2906 + $content[] = '<div class="ays-poll-maker-countdown-container">';
2907 +
2908 + $content[] = '<div ' . $style_attr . ' id="ays-poll-countdown">';
2909 +
2910 + $content[] = '<ul>';
2911 +
2912 + $content[] = '<li><span id="ays-poll-countdown-days"></span></li>';
2913 + $content[] = '<li><span id="ays-poll-countdown-hours"></span></li>';
2914 + $content[] = '<li><span id="ays-poll-countdown-minutes"></span></li>';
2915 + $content[] = '<li><span id="ays-poll-countdown-seconds"></span></li>';
2916 + $content[] = '</ul>';
2917 + $content[] = '</div>';
2918 +
2919 + $content[] = '<div id="ays-poll-countdown-content" class="emoji">';
2920 + $content[] = '</div>';
2921 +
2922 + $content[] = '</div>';
2923 + $content[] = '</div>';
2924 +
2925 + $content[] = '</div>';
2926 +
2927 + $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-button-box">';
2928 + $content[] = '<a href="'. $poll_cta_button_link .'" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now', 'poll-maker' ) . '</a>';
2929 + $content[] = '<span class="ays-poll-dicount-one-time-text">';
2930 + $content[] = __( "One-time payment", 'poll-maker' );
2931 + $content[] = '</span>';
2932 + $content[] = '</div>';
2933 + $content[] = '</div>';
2934 + $content[] = '</div>';
2935 +
2936 + // /* New Mega Bundle Banner Quiz | Start */
2937 + $content[] = '<style id="ays-poll-mega-bundle-styles-inline-css">';
2938 + $content[] = '
2939 + div#ays-poll-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-poll-new-mega-bundle-dicount-month-main.ays_poll_dicount_info button{display:flex;align-items:center}div#ays-poll-new-mega-bundle-dicount-month-main div#ays-poll-dicount-month a.ays-poll-sale-banner-link:focus{outline:0;box-shadow:0}div#ays-poll-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-poll-new-mega-bundle-dicount-month-main.ays_poll_dicount_info{background-image:url("'. POLL_MAKER_AYS_ADMIN_URL .'/images/ays-poll-banner-background-50.svg");background-position:center right;background-repeat:no-repeat;background-size:cover;background-color:#5551ff;padding:1px 38px 1px 12px}#ays-poll-new-mega-bundle-dicount-month-main .ays_poll_dicount_month{display:flex;align-items:center;justify-content:space-between;color:#fff}#ays-poll-new-mega-bundle-dicount-month-main .ays_poll_dicount_month img{width:60px}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-sale-banner-link{display:flex;justify-content:center;align-items:center;width:60px}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box{font-size:14px;padding:12px;text-align:center}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box{text-align:left;width:auto;display:flex;justify-content:space-around;align-items:flex-start}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-countdown-box{width:30%;display:flex;justify-content:center;align-items:center}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-button-box{width:20%;display:flex;justify-content:center;align-items:center;flex-direction:column}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box .ays-poll-dicount-logo-box{display:flex;justify-content:flex-start;align-items:center;gap:20px}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box .ays-poll-new-mega-bundle-title{color:#fdfdfd;font-size:19px;font-style:normal;font-weight:600;line-height:normal}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box .ays-poll-new-mega-bundle-title-icon-row{display:inline-block}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box .ays-poll-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-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box strong{font-size:17px;font-weight:700;letter-spacing:.8px}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-color{color:#971821}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-text-decoration{text-decoration:underline}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-buy-now-button-box{display:flex;justify-content:flex-end;align-items:center;width:30%}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box .ays-button,#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box .ays-buy-now-button{align-items:center;font-weight:500}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-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-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box .ays-buy-now-button:hover{background:#7d161d;border-color:#971821}#ays-poll-new-mega-bundle-dicount-month-main #ays-poll-dismiss-buttons-content{display:flex;justify-content:center}#ays-poll-new-mega-bundle-dicount-month-main #ays-poll-dismiss-buttons-content .ays-button{margin:0!important;font-size:13px;color:#fff}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-opacity-box{width:19%}#ays-poll-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-poll-maker-countdown-main-container .ays-poll-maker-countdown-container{margin:0 auto;text-align:center}#ays-poll-maker-countdown-main-container #ays-poll-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-poll-maker-countdown-main-container li,#ays-poll-maker-countdown-main-container ul{margin:0}#ays-poll-maker-countdown-main-container li{display:inline-block;font-size:14px;list-style-type:none;padding:14px;text-transform:lowercase}#ays-poll-maker-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-poll-maker-countdown-main-container .emoji{display:none;padding:1rem}#ays-poll-maker-countdown-main-container .emoji span{font-size:30px;padding:0 .5rem}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box li{position:relative}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box li span:after{content:":";color:#fff;position:absolute;top:0;right:-5px;font-size:40px}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box li span#ays-poll-countdown-seconds:after{content:unset}#ays-poll-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-poll-new-mega-bundle-dicount-month-main button.notice-dismiss:before{color:#fff;content:"\f00d";font-family:fontawesome;font-size:22px}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-new-mega-bundle-guaranteeicon{width:30px;margin-right:5px}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-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-poll-new-mega-bundle-dicount-month-main.ays_poll_dicount_info.notice{display:none!important;background-position:bottom right;background-repeat:no-repeat;background-size:cover;border-radius:32px}div#ays-poll-new-mega-bundle-dicount-month-main{padding-right:0}div#ays-poll-new-mega-bundle-dicount-month-main .ays_poll_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-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box{width:100%!important;text-align:center}#ays-poll-maker-countdown-main-container #ays-poll-countdown-headline{font-size:15px;font-weight:600}#ays-poll-maker-countdown-main-container ul{font-weight:500}div#ays-poll-maker-countdown-main-container li{padding:10px}div#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-new-mega-bundle-mobile-image-display-none{display:none!important}div#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-new-mega-bundle-mobile-image-display-block{display:block!important;margin-top:5px}div#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box{width:100%!important;text-align:center;flex-direction:column;margin-top:20px;justify-content:center;align-items:center}div#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box li span:after{top:unset}div#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-countdown-box{width:100%;display:flex;justify-content:center;align-items:center}#ays-poll-new-mega-bundle-dicount-month-main .ays-button{margin:0 auto!important}#ays-poll-new-mega-bundle-dicount-month-main #ays-poll-dismiss-buttons-content .ays-button{padding-left:unset!important}div#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-buy-now-button-box{justify-content:center}div#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box .ays-buy-now-button{font-size:14px;padding:5px 10px}div#ays-poll-new-mega-bundle-dicount-month-main .ays-buy-now-opacity-button{display:none}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dismiss-buttons-container-for-form{position:static!important}.comparison .product img{width:70px}.ays-poll-features-wrap .comparison a.price-buy{padding:8px 5px;font-size:11px}}@media screen and (max-width:1350px) and (min-width:768px){div#ays-poll-new-mega-bundle-dicount-month-main.ays_poll_dicount_info.notice{background-position:bottom right;background-repeat:no-repeat;background-size:cover}div#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box strong{font-size:15px}#ays-poll-maker-countdown-main-container li{font-size:11px}div#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-opacity-box{display:none}}@media screen and (max-width:1680px) and (min-width:1551px){div#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box{width:29%}div#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-countdown-box{width:30%}}@media screen and (max-width:1410px){#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-coupon-row{width:150px}}@media screen and (max-width:1550px) and (min-width:1400px){div#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-countdown-box{width:35%}}@media screen and (max-width:1400px) and (min-width:1250px){div#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-countdown-box{width:35%}div#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box{width:40%}}@media screen and (max-width:1274px){#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box .ays-poll-new-mega-bundle-title{font-size:15px}}@media screen and (max-width:1200px){#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-button-box{margin-bottom:16px}#ays-poll-maker-countdown-main-container ul{padding-left:0}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-coupon-row{width:120px;font-size:18px}#ays-poll-new-mega-bundle-dicount-month-main #ays-button-top-buy-now{padding:12px 20px}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box{font-size:12px}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box .ays-poll-new-mega-bundle-desc{font-size:13px}}@media screen and (max-width:1076px) and (min-width:769px){#ays-poll-maker-countdown-main-container li{padding:10px}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-coupon-row{width:100px;font-size:16px}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-button-box{margin-bottom:16px}#ays-poll-new-mega-bundle-dicount-month-main #ays-button-top-buy-now{padding:12px 15px}#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box{font-size:11px;padding:12px 0}}@media screen and (max-width:1250px) and (min-width:769px){div#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-countdown-box{width:45%}div#ays-poll-new-mega-bundle-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box{width:35%}}';
2940 + $content[] = '</style>';
2941 + // /* New Mega Bundle Banner Quiz | End */
2942 +
2943 + $content = implode( '', $content );
2944 + echo ($content);
1766 2945 }
1767 2946
1768 - public function ays_poll_sale_message_poll_pro(){
1769 - $content = array();
2947 + // Halloween Bundle 2025
2948 + public function ays_poll_new_halloween_bundle_message_2025(){
2949 +
2950 + $content = array();
1770 2951
1771 - $content[] = '<div id="ays-poll-dicount-month-main" class="notice notice-success is-dismissible ays_poll_dicount_info">';
1772 - $content[] = '<div id="ays-poll-dicount-month" class="ays_poll_dicount_month">';
2952 + $date = time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
2953 + $now_date = date('M d, Y H:i:s', $date);
1773 2954
1774 - $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-text-box">';
1775 - $content[] = '<div>';
1776 - $content[] = '<span class="ays-poll-new-poll-pro-title">';
1777 - $content[] = sprintf('<span>%s <a href="https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=sale-banner%s" target="_blank" style="color:#ffffff; text-decoration: underline;">Poll Maker</a></span>', __("Limited time 50% SALE on", "poll-maker"), $this->version);
1778 - $content[] = '</span>';
1779 - $content[] = '</br>';
1780 - $content[] = '<div class="ays-poll-new-poll-pro-mobile-image-display-block display_none">';
1781 - $content[] = '<span class="ays-poll-sale-baner-mega-bundle-sale-text">50%</span>';
1782 - $content[] = '<img src="' . POLL_MAKER_AYS_ADMIN_URL . '/images/line.webp" style="width: 70px;">';
1783 - $content[] = '</div>';
1784 - $content[] = '<span class="ays-poll-new-poll-pro-desc">';
1785 - $content[] = '<img class="ays-poll-new-poll-pro-guaranteeicon" src="' . POLL_MAKER_AYS_ADMIN_URL . '/images/poll-maker-guaranteeicon.svg" style="width:30px;margin-right:5px">';
1786 - $content[] = __( "30 Days Money Back Guarantee", "poll-maker" );
1787 - $content[] = '</span>';
1788 - $content[] = '</div>';
1789 - $content[] = '<div style="display:flex;flex-wrap:wrap;width:min-content;">';
1790 - $content[] = '<span class="ays-poll-sale-baner-mega-bundle-sale-text">50%</span>';
1791 - $content[] = '<img src="' . POLL_MAKER_AYS_ADMIN_URL . '/images/line.webp" class="ays-poll-new-mega-bundle-mobile-image-display-none" style="width: 70px;">';
1792 - $content[] = '</div>';
1793 - $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-poll-dismiss-buttons-container-for-form">';
2955 + $start_date = strtotime('2025-09-08');
2956 + $end_date = strtotime('2025-10-31');
2957 + $diff_end = $end_date - $date;
1794 2958
1795 - $content[] = '<form action="" method="POST">';
1796 - $content[] = '<div id="ays-poll-dismiss-buttons-content">';
1797 - if( current_user_can( 'manage_options' ) ){
1798 - $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>';
1799 - $content[] = wp_nonce_field( POLL_MAKER_AYS_NAME . '-sale-banner' , POLL_MAKER_AYS_NAME . '-sale-banner' );
1800 - }
1801 - $content[] = '</div>';
1802 - $content[] = '</form>';
1803 -
1804 - $content[] = '</div>';
1805 -
1806 - $content[] = '</div>';
2959 + $style_attr = '';
2960 + if( $diff_end < 0 ){
2961 + $style_attr = 'style="display:none;"';
2962 + }
1807 2963
1808 - $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-countdown-box">';
2964 + $ays_poll_cta_button_link = esc_url('https://ays-pro.com/halloween-bundle?utm_source=dashboard&utm_medium=poll-free&utm_campaign=poll-halloween-banner-' . POLL_MAKER_AYS_VERSION);
1809 2965
1810 - $content[] = '<div id="ays-poll-maker-countdown-main-container">';
1811 - $content[] = '<div class="ays-poll-maker-countdown-container">';
2966 + $content[] = '
2967 + <div id="ays-poll-halloween-banner-2025-main" class="ays-poll-halloween-banner-2025-main notice notice-success is-dismissible">
2968 + <div class="ays-poll-halloween-banner-2025-content">
2969 + <div class="ays-poll-halloween-banner-2025-left">
2970 + <div class="ays-poll-halloween-banner-2025-text">
2971 + <h2 class="ays-poll-halloween-banner-2025-title">Boo! Grab Your <a href="'. $ays_poll_cta_button_link .'" class="" target="_blank">Halloween Deal</a> <br/> Before It Vanishes!</h2>
2972 + <p class="ays-poll-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>
2973 + </div>
2974 + </div>
1812 2975
1813 - $content[] = '<div id="ays-poll-countdown">';
2976 + <div class="ays-poll-halloween-banner-2025-center">';
1814 2977
1815 - $content[] = '<div>';
1816 - $content[] = __( "Offer ends in:", "poll-maker" );
1817 - $content[] = '</div>';
2978 + $content[] = '<div id="ays-poll-halloween-banner-2025-countdown" class="ays-poll-halloween-banner-2025-countdown" ' . $style_attr . '>';
2979 + $content[] = '<div class="ays-poll-halloween-banner-2025-countdown-timer">';
2980 + $content[] = '<div class="ays-poll-halloween-banner-2025-countdown-item">';
2981 + $content[] = '<div class="ays-poll-halloween-banner-2025-countdown-value" id="ays-poll-halloween-banner-2025-days">00</div>';
2982 + $content[] = '<div class="ays-poll-halloween-banner-2025-countdown-label">' . __('days', 'poll-maker') . '</div>';
2983 + $content[] = '</div>';
2984 + $content[] = '<div class="ays-poll-halloween-banner-2025-countdown-separator">:</div>';
2985 + $content[] = '<div class="ays-poll-halloween-banner-2025-countdown-item">';
2986 + $content[] = '<div class="ays-poll-halloween-banner-2025-countdown-value" id="ays-poll-halloween-banner-2025-hours">00</div>';
2987 + $content[] = '<div class="ays-poll-halloween-banner-2025-countdown-label">' . __('hours', 'poll-maker') . '</div>';
2988 + $content[] = '</div>';
2989 + $content[] = '<div class="ays-poll-halloween-banner-2025-countdown-separator">:</div>';
2990 + $content[] = '<div class="ays-poll-halloween-banner-2025-countdown-item">';
2991 + $content[] = '<div class="ays-poll-halloween-banner-2025-countdown-value" id="ays-poll-halloween-banner-2025-minutes">00</div>';
2992 + $content[] = '<div class="ays-poll-halloween-banner-2025-countdown-label">' . __('minutes', 'poll-maker') . '</div>';
2993 + $content[] = '</div>';
2994 + $content[] = '<div class="ays-poll-halloween-banner-2025-countdown-separator">:</div>';
2995 + $content[] = '<div class="ays-poll-halloween-banner-2025-countdown-item">';
2996 + $content[] = '<div class="ays-poll-halloween-banner-2025-countdown-value" id="ays-poll-halloween-banner-2025-seconds">00</div>';
2997 + $content[] = '<div class="ays-poll-halloween-banner-2025-countdown-label">' . __('seconds', 'poll-maker') . '</div>';
2998 + $content[] = '</div>';
2999 + $content[] = '</div>';
3000 + $content[] = '</div>';
1818 3001
1819 - $content[] = '<ul>';
1820 - $content[] = '<li><span id="ays-poll-countdown-days"></span>days</li>';
1821 - $content[] = '<li><span id="ays-poll-countdown-hours"></span>Hours</li>';
1822 - $content[] = '<li><span id="ays-poll-countdown-minutes"></span>Minutes</li>';
1823 - $content[] = '<li><span id="ays-poll-countdown-seconds"></span>Seconds</li>';
1824 - $content[] = '</ul>';
3002 + $content[] = '</div>
3003 +
3004 + <div class="ays-poll-halloween-banner-2025-right">
3005 + <div class="ays-poll-halloween-banner-2025-pumpkin">
3006 + <svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg">
3007 + <g clip-path="url(#clip0_177_40)">
3008 + <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"/>
3009 + <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"/>
3010 + <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"/>
3011 + </g>
3012 + <defs>
3013 + <clipPath id="clip0_177_40">
3014 + <rect width="36" height="36" fill="white"/>
3015 + </clipPath>
3016 + </defs>
3017 + </svg>
3018 + </div>
1825 3019
1826 - $content[] = '</div>';
1827 3020
1828 - $content[] = '<div id="ays-poll-countdown-content" class="emoji">';
1829 - $content[] = '<span>🚀</span>';
1830 - $content[] = '<span>⌛</span>';
1831 - $content[] = '<span>🔥</span>';
1832 - $content[] = '<span>💣</span>';
1833 - $content[] = '</div>';
1834 3021
1835 - $content[] = '</div>';
1836 - $content[] = '</div>';
3022 + <div class="ays-poll-halloween-banner-2025-discount-section">
3023 + <div class="ays-poll-halloween-banner-2025-discount">50% OFF</div>
3024 + <div class="ays-poll-halloween-banner-2025-coupon-wrapper">
3025 + <div class="ays-poll-halloween-banner-2025-coupon-box" onclick="aysPollHalloweenCopyToClipboard(\'HALLOWEEN25\')" title="' . __( 'Click to copy', "poll-maker" ) . '">
3026 + <span class="ays-poll-halloween-banner-2025-coupon-text">HALLOWEEN25</span>
3027 + <svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="ays-poll-halloween-banner-2025-copy-icon">
3028 + <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"/>
3029 + </svg>
3030 + </div>
3031 + </div>
3032 + <a href="'. $ays_poll_cta_button_link .'" class="ays-poll-halloween-banner-2025-upgrade" target="_blank">Buy Now</a>
3033 + </div>';
1837 3034
1838 - $content[] = '</div>';
3035 + if( current_user_can( 'manage_options' ) ){
3036 + $content[] = '<div id="ays-poll-dismiss-buttons-content">';
3037 + $content[] = '<form action="" method="POST" style="position: absolute; bottom: -5px; right: 0; color: #fff;">';
3038 + $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn" style="color: darkgrey; font-size: 11px;">'. __( "Dismiss ad", 'poll-maker' ) .'</button>';
3039 + $content[] = wp_nonce_field( POLL_MAKER_AYS_NAME . '-sale-banner' , POLL_MAKER_AYS_NAME . '-sale-banner' );
3040 + $content[] = '</form>';
3041 + $content[] = '</div>';
3042 + }
1839 3043
1840 - $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-button-box">';
1841 - $content[] = sprintf('<a href="https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=sale-banner%s" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">%s</a>', $this->version, __('Buy Now', "poll-maker"));
1842 - $content[] = '<span class="ays-poll-dicount-one-time-text">';
1843 - $content[] = __( "One-time payment", "poll-maker" );
1844 - $content[] = '</span>';
1845 - $content[] = '</div>';
1846 - $content[] = '</div>';
1847 - $content[] = '</div>';
1848 - $content = implode( '', $content );
1849 - echo $content;
1850 - }
3044 + $content[] = '
3045 + </div>
3046 + </div>
3047 + </div>';
1851 3048
1852 - // New Poll Pro 2024
1853 - public function ays_poll_sale_message_poll_pro_2024() {
1854 - $content = array();
1855 - $content[] = '<div id="ays-poll-new-mega-bundle-dicount-month-main-2024" class="notice notice-success is-dismissible ays_poll_dicount_info">';
1856 - $content[] = '<div id="ays-poll-dicount-month" class="ays_poll_dicount_month">';
3049 + $content[] = '<style id="ays-poll-progress-banner-styles-inline-css">';
3050 + $content[] = '
3051 + .ays-poll-halloween-banner-2025-main {
3052 + background: linear-gradient(135deg, #1A0F2E 100%, #2D1B4E 0%);
3053 + background-image: url("' . esc_attr( POLL_MAKER_AYS_ADMIN_URL ) . '/images/halloween-banner-background-image-remove.png"), linear-gradient(135deg, #2D1B4E 0%, #1A0F2E 100%);
3054 + background-position: left center, center;
3055 + background-repeat: no-repeat, no-repeat;
3056 + background-size: auto 100%, cover;
3057 + padding: 20px 30px 20px 130px;
3058 + border-radius: 12px;
3059 + color: white;
3060 + margin: 20px 0;
3061 + border: 0;
3062 + box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4);
3063 + overflow: hidden;
3064 + }
1857 3065
1858 - $content[] = '<div class="ays-poll-discount-box-sale-image"></div>';
1859 - $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-text-box">';
3066 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-content {
3067 + display: flex;
3068 + align-items: center;
3069 + justify-content: space-between;
3070 + gap: 30px;
3071 + }
1860 3072
1861 - $content[] = '<div class="ays-poll-dicount-wrap-text-box-texts">';
1862 - $content[] = '<div>
1863 - <a href="https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=top-banner-50" target="_blank" style="color:#30499B;">
1864 - <span class="ays-poll-new-mega-bundle-limited-text">Limited</span> Offer for Poll Maker </a> <br>
1865 - </div>';
1866 - $content[] = '</div>';
3073 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-left {
3074 + display: flex;
3075 + align-items: center;
3076 + gap: 20px;
3077 + }
1867 3078
1868 - $content[] = '<div style="font-size: 17px;">';
1869 - $content[] = '<img style="width: 24px;height: 24px;" src="' . esc_attr(POLL_MAKER_AYS_ADMIN_URL) . '/images/icons/guarantee-new.png">';
1870 - $content[] = '<span style="padding-left: 4px; font-size: 14px; font-weight: 600;"> 30 Day Money Back Guarantee</span>';
1871 -
1872 - $content[] = '</div>';
3079 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-center {
3080 + display: flex;
3081 + align-items: center;
3082 + justify-content: center;
3083 + flex: 1;
3084 + max-width: 350px;
3085 + }
1873 3086
1874 -
3087 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-right {
3088 + display: flex;
3089 + align-items: center;
3090 + gap: 15px;
3091 + flex-shrink: 0;
3092 + }
1875 3093
1876 - $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-poll-dismiss-buttons-container-for-form">';
3094 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-icon {
3095 + flex-shrink: 0;
3096 + }
1877 3097
1878 - $content[] = '<form action="" method="POST">';
1879 - $content[] = '<div id="ays-poll-dismiss-buttons-content">';
1880 - if( current_user_can( 'manage_options' ) ){
1881 - $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0; color: #30499B;
1882 - ">Dismiss ad</button>';
1883 - $content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' );
1884 - }
1885 - $content[] = '</div>';
1886 - $content[] = '</form>';
1887 -
1888 - $content[] = '</div>';
3098 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-pumpkin svg {
3099 + display: inline !important;
3100 + border: none !important;
3101 + box-shadow: none !important;
3102 + height: 1em !important;
3103 + width: 1em !important;
3104 + margin: 0 0.07em !important;
3105 + vertical-align: -0.1em !important;
3106 + background: none !important;
3107 + padding: 0 !important;
3108 + }
1889 3109
1890 - $content[] = '</div>';
3110 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-orb {
3111 + width: 80px;
3112 + height: 80px;
3113 + background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%);
3114 + border-radius: 50%;
3115 + display: flex;
3116 + align-items: center;
3117 + justify-content: center;
3118 + box-shadow: 0 0 30px rgba(139, 92, 246, 0.6);
3119 + border: 3px solid rgba(168, 85, 247, 0.4);
3120 + }
1891 3121
1892 - $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-countdown-box">';
3122 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-question {
3123 + font-size: 48px;
3124 + font-weight: 700;
3125 + color: #E9D5FF;
3126 + }
1893 3127
1894 - $content[] = '<div id="ays-poll-maker-countdown-main-container">';
1895 - $content[] = '<div class="ays-poll-maker-countdown-container">';
3128 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-bat {
3129 + font-size: 20px;
3130 + opacity: 0.8;
3131 + }
1896 3132
1897 - $content[] = '<div id="ays-poll-countdown">';
3133 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-bat-1 {
3134 + margin-left: -100px;
3135 + margin-top: -40px;
3136 + }
1898 3137
1899 - $content[] = '<div style="font-weight: 500;">';
1900 - $content[] = __( "Offer ends in:", "poll-maker" );
1901 - $content[] = '</div>';
3138 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-bat-2 {
3139 + margin-left: -110px;
3140 + margin-top: 35px;
3141 + }
1902 3142
1903 - $content[] = '<ul>';
1904 - $content[] = '<li><span id="ays-poll-countdown-days"></span>days</li>';
1905 - $content[] = '<li><span id="ays-poll-countdown-hours"></span>Hours</li>';
1906 - $content[] = '<li><span id="ays-poll-countdown-minutes"></span>Minutes</li>';
1907 - $content[] = '<li><span id="ays-poll-countdown-seconds"></span>Seconds</li>';
1908 - $content[] = '</ul>';
1909 - $content[] = '</div>';
3143 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-sparkle {
3144 + font-size: 12px;
3145 + opacity: 0.7;
3146 + }
1910 3147
1911 - $content[] = '<div id="ays-poll-countdown-content" class="emoji">';
1912 - $content[] = '<span>🚀</span>';
1913 - $content[] = '<span>⌛</span>';
1914 - $content[] = '<span>🔥</span>';
1915 - $content[] = '<span>💣</span>';
1916 - $content[] = '</div>';
3148 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-sparkle-1 {
3149 + margin-left: -95px;
3150 + margin-top: -60px;
3151 + }
1917 3152
1918 - $content[] = '</div>';
1919 - $content[] = '</div>';
1920 -
1921 - $content[] = '</div>';
3153 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-sparkle-2 {
3154 + margin-left: -70px;
3155 + margin-top: -15px;
3156 + }
1922 3157
1923 - $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-button-box">';
1924 - $content[] = '<a href="https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=top-banner-50" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now !', "poll-maker" ) . '</a>';
1925 - $content[] = '<span >' . __( 'One-time payment', "poll-maker" ) . '</span>';
1926 - $content[] = '</div>';
1927 - $content[] = '</div>';
1928 - $content[] = '</div>';
3158 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-sparkle-3 {
3159 + margin-left: -120px;
3160 + margin-top: 10px;
3161 + }
1929 3162
1930 - $content = implode( '', $content );
1931 - echo html_entity_decode(esc_html( $content ));
1932 - }
3163 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-text {
3164 + flex: 1;
3165 + }
1933 3166
1934 - // Black Friday 2024
1935 - public function ays_poll_black_friday_message_2024(){
1936 - $content = array();
3167 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-title {
3168 + font-size: 24px;
3169 + font-weight: 700;
3170 + margin: 0 0 8px 0;
3171 + line-height: 1.2;
3172 + color: #fff;
3173 + text-transform: uppercase;
3174 + letter-spacing: 1px;
3175 + }
1937 3176
1938 - $content[] = '<div id="ays-poll-black-friday-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_poll_dicount_info">';
1939 - $content[] = '<div id="ays-poll-dicount-month" class="ays_poll_dicount_month">';
3177 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-title a {
3178 + color: #FB923C;
3179 + text-decoration: underline;
3180 + }
1940 3181
1941 - $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-countdown-box">';
3182 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-subtitle {
3183 + font-size: 16px;
3184 + margin: 0;
3185 + opacity: 0.9;
3186 + font-weight: 400;
3187 + color: #E9D5FF;
3188 + }
1942 3189
1943 - $content[] = '<div id="ays-poll-maker-countdown-main-container">';
1944 - $content[] = '<div class="ays-poll-maker-countdown-container">';
3190 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-description {
3191 + font-size: 14px;
3192 + margin: 0;
3193 + opacity: 0.85;
3194 + line-height: 1.5;
3195 + color: #D8B4FE;
3196 + }
1945 3197
1946 - $content[] = '<div id="ays-poll-countdown">';
3198 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-pumpkin {
3199 + font-size: 64px;
3200 + filter: drop-shadow(0 0 20px rgba(251, 146, 60, 0.8));
3201 + flex-shrink: 0;
3202 + }
1947 3203
1948 - $content[] = '<div>';
1949 - $content[] = __( "Offer ends in:", "poll-maker" );
1950 - $content[] = '</div>';
3204 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-discount-section {
3205 + display: flex;
3206 + flex-direction: column;
3207 + align-items: center;
3208 + gap: 10px;
3209 + }
1951 3210
1952 - $content[] = '<ul>';
1953 - $content[] = '<li><span id="ays-poll-countdown-days"></span>'. __( "Days", "poll-maker" ) .'</li>';
1954 - $content[] = '<li><span id="ays-poll-countdown-hours"></span>'. __( "Hours", "poll-maker" ) .'</li>';
1955 - $content[] = '<li><span id="ays-poll-countdown-minutes"></span>'. __( "Minutes", "poll-maker" ) .'</li>';
1956 - $content[] = '<li><span id="ays-poll-countdown-seconds"></span>'. __( "Seconds", "poll-maker" ) .'</li>';
1957 - $content[] = '</ul>';
1958 - $content[] = '</div>';
3211 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-discount {
3212 + font-size: 36px;
3213 + font-weight: 700;
3214 + color: #FB923C;
3215 + text-shadow: 0 0 20px rgba(251, 146, 60, 0.6);
3216 + margin: 0;
3217 + line-height: 1;
3218 + }
1959 3219
1960 - $content[] = '<div id="ays-poll-countdown-content" class="emoji">';
1961 - $content[] = '<span>🚀</span>';
1962 - $content[] = '<span>⌛</span>';
1963 - $content[] = '<span>🔥</span>';
1964 - $content[] = '<span>💣</span>';
1965 - $content[] = '</div>';
3220 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-coupon-wrapper {
3221 + display:none;
3222 + margin-bottom: 5px;
3223 + }
1966 3224
1967 - $content[] = '</div>';
1968 - $content[] = '</div>';
1969 -
1970 - $content[] = '</div>';
3225 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-coupon-box {
3226 + border: 2px dashed rgba(255, 255, 255, 0.4);
3227 + padding: 6px 12px;
3228 + border-radius: 6px;
3229 + background: rgba(255, 255, 255, 0.1);
3230 + cursor: pointer;
3231 + transition: all 0.3s ease;
3232 + display: flex;
3233 + align-items: center;
3234 + gap: 6px;
3235 + backdrop-filter: blur(10px);
3236 + }
1971 3237
1972 - $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-text-box">';
1973 - $content[] = '<div>';
3238 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-coupon-box:hover {
3239 + background: rgba(255, 255, 255, 0.2);
3240 + border-color: rgba(255, 255, 255, 0.6);
3241 + transform: translateY(-1px);
3242 + }
1974 3243
1975 - $content[] = '<span class="ays-poll-black-friday-bundle-title">';
1976 - $content[] = __( "<span><a href='https://ays-pro.com/marketing-bundle?utm_source=dashboard&utm_medium=poll-free&utm_campaign=black-friday-marketing-bundle-sale-banner' class='ays-poll-black-friday-bundle-title-link' target='_blank'>Black Friday Sale</a></span>", "poll-maker" );
1977 - $content[] = '</span>';
3244 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-coupon-text {
3245 + font-size: 14px;
3246 + font-weight: 700;
3247 + letter-spacing: 1px;
3248 + color: #fff;
3249 + font-family: monospace;
3250 + }
1978 3251
1979 - $content[] = '</br>';
3252 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-copy-icon {
3253 + opacity: 0.8;
3254 + transition: opacity 0.3s ease;
3255 + }
1980 3256
1981 - $content[] = '<span class="ays-poll-black-friday-bundle-desc">';
1982 - $content[] = '<a class="ays-poll-black-friday-bundle-desc" href="https://ays-pro.com/marketing-bundle?utm_source=dashboard&utm_medium=poll-free&utm_campaign=black-friday-marketing-bundle-sale-banner" class="ays-poll-black-friday-bundle-title-link" target="_blank">';
1983 - $content[] = __( "50% OFF", "poll-maker" );
1984 - $content[] = '</a>';
1985 - $content[] = '</span>';
1986 - $content[] = '</div>';
3257 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-coupon-box:hover .ays-poll-halloween-banner-2025-copy-icon {
3258 + opacity: 1;
3259 + }
1987 3260
1988 - $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-poll-dismiss-buttons-container-for-form">';
3261 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-upgrade {
3262 + background: linear-gradient(135deg, #FB923C 0%, #F97316 100%);
3263 + color: white;
3264 + border: none;
3265 + padding: 12px 28px;
3266 + border-radius: 8px;
3267 + font-size: 16px;
3268 + font-weight: 600;
3269 + cursor: pointer;
3270 + transition: all 0.3s ease;
3271 + box-shadow: 0 4px 16px rgba(251, 146, 60, 0.5);
3272 + text-decoration: none;
3273 + display: inline-flex;
3274 + align-items: center;
3275 + text-align: center;
3276 + }
1989 3277
1990 - $content[] = '<form action="" method="POST">';
1991 - $content[] = '<div id="ays-poll-dismiss-buttons-content">';
1992 - if( current_user_can( 'manage_options' ) ){
1993 - $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">'. __( "Dismiss ad", "poll-maker" ) .'</button>';
1994 - $content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' );
1995 - }
1996 - $content[] = '</div>';
1997 - $content[] = '</form>';
1998 -
1999 - $content[] = '</div>';
3278 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-upgrade:hover {
3279 + transform: translateY(-2px);
3280 + box-shadow: 0 6px 20px rgba(251, 146, 60, 0.7);
3281 + text-decoration: none;
3282 + color: white;
3283 + }
2000 3284
2001 - $content[] = '</div>';
3285 + .ays-poll-halloween-banner-2025-main .notice-dismiss:before {
3286 + color: #fff;
3287 + }
2002 3288
2003 - $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-text-box">';
2004 - $content[] = '<span class="ays-poll-black-friday-bundle-title">';
2005 - $content[] = '<a class="ays-poll-black-friday-bundle-title-link" href="https://ays-pro.com/marketing-bundle?utm_source=dashboard&utm_medium=poll-free&utm_campaign=black-friday-marketing-bundle-sale-banner" target="_blank">';
2006 - $content[] = __( 'Marketing Bundle', "ays-popup-box" );
2007 - $content[] = '</a>';
2008 - $content[] = '</span>';
2009 - $content[] = '</div>';
3289 + .ays-poll-halloween-banner-2025-copy-notification {
3290 + position: fixed;
3291 + top: 50%;
3292 + left: 50%;
3293 + transform: translate(-50%, -50%);
3294 + background: rgba(0, 0, 0, 0.8);
3295 + color: white;
3296 + padding: 12px 24px;
3297 + border-radius: 8px;
3298 + font-size: 14px;
3299 + z-index: 10000;
3300 + opacity: 0;
3301 + transition: opacity 0.3s ease;
3302 + }
2010 3303
2011 - $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-button-box">';
2012 - $content[] = '<a href="https://ays-pro.com/marketing-bundle?utm_source=dashboard&utm_medium=poll-free&utm_campaign=black-friday-marketing-bundle-sale-banner" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Get Your Deal', "poll-maker" ) . '</a>';
2013 - $content[] = '<span class="ays-poll-dicount-one-time-text">';
2014 - $content[] = __( "One-time payment", "poll-maker" );
2015 - $content[] = '</span>';
2016 - $content[] = '</div>';
2017 - $content[] = '</div>';
2018 - $content[] = '</div>';
3304 + .ays-poll-halloween-banner-2025-copy-notification.show {
3305 + opacity: 1;
3306 + }
2019 3307
2020 - $content = implode( '', $content );
2021 - echo $content;
2022 - }
3308 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-countdown-timer {
3309 + display: flex;
3310 + align-items: center;
3311 + justify-content: center;
3312 + gap: 8px;
3313 + }
2023 3314
2024 - // Christmas Top Banner 2024
2025 - public function ays_poll_christmas_top_message_2024(){
2026 -
2027 - $content = array();
3315 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-countdown-item {
3316 + background: rgba(255, 255, 255, 0.15);
3317 + border-radius: 8px;
3318 + padding: 8px 12px;
3319 + min-width: 60px;
3320 + backdrop-filter: blur(10px);
3321 + }
2028 3322
2029 - $content[] = '<div id="ays-poll-christmas-top-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_poll_dicount_info">';
2030 - $content[] = '<div id="ays-poll-dicount-month" class="ays_poll_dicount_month">';
3323 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-countdown-value {
3324 + font-size: 24px;
3325 + font-weight: 700;
3326 + line-height: 1;
3327 + margin-bottom: 4px;
3328 + color: #fff;
3329 + text-align: center;
3330 + }
2031 3331
2032 - $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-countdown-box">';
3332 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-countdown-label {
3333 + font-size: 11px;
3334 + opacity: 0.8;
3335 + text-transform: lowercase;
3336 + text-align: center;
3337 + }
2033 3338
2034 - $content[] = '<div id="ays-poll-maker-countdown-main-container">';
2035 - $content[] = '<div class="ays-poll-maker-countdown-container">';
3339 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-countdown-separator {
3340 + font-size: 24px;
3341 + font-weight: 700;
3342 + opacity: 0.6;
3343 + margin: 0 4px;
3344 + }
2036 3345
2037 - $content[] = '<div id="ays-poll-countdown">';
3346 + @media (min-width: 1200px) {
3347 + .ays-poll-halloween-banner-2025-main .wp-core-ui .notice.is-dismissible {
3348 + padding-right: 60px;
3349 + }
3350 + }
2038 3351
2039 - $content[] = '<div>';
2040 - $content[] = __( "Offer ends in:", "poll-maker" );
2041 - $content[] = '</div>';
3352 + @media (max-width: 1200px) {
2042 3353
2043 - $content[] = '<ul>';
2044 - $content[] = '<li><span id="ays-poll-countdown-days"></span>'. __( "Days", "poll-maker" ) .'</li>';
2045 - $content[] = '<li><span id="ays-poll-countdown-hours"></span>'. __( "Hours", "poll-maker" ) .'</li>';
2046 - $content[] = '<li><span id="ays-poll-countdown-minutes"></span>'. __( "Minutes", "poll-maker" ) .'</li>';
2047 - $content[] = '<li><span id="ays-poll-countdown-seconds"></span>'. __( "Seconds", "poll-maker" ) .'</li>';
2048 - $content[] = '</ul>';
2049 - $content[] = '</div>';
3354 + div.ays-poll-halloween-banner-2025-main {
3355 + padding: 20px 30px;
3356 + }
2050 3357
2051 - $content[] = '<div id="ays-poll-countdown-content" class="emoji">';
2052 - $content[] = '<span>🚀</span>';
2053 - $content[] = '<span>⌛</span>';
2054 - $content[] = '<span>🔥</span>';
2055 - $content[] = '<span>💣</span>';
2056 - $content[] = '</div>';
3358 + div.ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-pumpkin {
3359 + display: none;
3360 + }
2057 3361
2058 - $content[] = '</div>';
2059 - $content[] = '</div>';
2060 -
2061 - $content[] = '</div>';
3362 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-subtitle,
3363 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-title {
3364 + text-align: center;
3365 + }
2062 3366
2063 - $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-text-box">';
2064 - $content[] = '<div>';
3367 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-content {
3368 + flex-wrap: wrap;
3369 + gap: 20px;
3370 + }
2065 3371
2066 - $content[] = '<span class="ays-poll-christmas-top-bundle-title">';
2067 - $content[] = sprintf('<span><a href="https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=christmas-sale-banner%s" class="ays-poll-christmas-top-bundle-title-link" target="_blank">%s</a></span>', $this->version, __('Christmas Sale', "poll-maker"));
2068 - $content[] = '</span>';
3372 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-left {
3373 + width: 100%;
3374 + }
2069 3375
2070 - $content[] = '</br>';
3376 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-center {
3377 + width: 100%;
3378 + max-width: 100%;
3379 + text-align: center;
3380 + }
2071 3381
2072 - $content[] = '<span class="ays-poll-christmas-top-bundle-desc">';
2073 - $content[] = sprintf('<a class="ays-poll-christmas-top-bundle-desc" href="https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=christmas-sale-banner%s" class="ays-poll-christmas-top-bundle-title-link" target="_blank">', $this->version);
2074 - $content[] = __( "20% Extra OFF", "poll-maker" );
2075 - $content[] = '</a>';
2076 - $content[] = '</span>';
2077 - $content[] = '</div>';
3382 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-right {
3383 + width: 100%;
3384 + justify-content: center;
3385 + }
3386 + }
2078 3387
2079 - $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-poll-dismiss-buttons-container-for-form">';
3388 + @media (max-width: 786px) {
3389 + #ays-poll-halloween-banner-2025-main {
3390 + display: none !important;
3391 + }
3392 + }
2080 3393
2081 - $content[] = '<form action="" method="POST">';
2082 - $content[] = '<div id="ays-poll-dismiss-buttons-content">';
2083 - if( current_user_can( 'manage_options' ) ){
2084 - $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">'. __( "Dismiss ad", "poll-maker" ) .'</button>';
2085 - $content[] = wp_nonce_field( "poll-maker" . '-sale-banner' , "poll-maker" . '-sale-banner' );
2086 - }
2087 - $content[] = '</div>';
2088 - $content[] = '</form>';
2089 -
2090 - $content[] = '</div>';
3394 + @media (max-width: 768px) {
3395 + .ays-poll-halloween-banner-2025-main {
3396 + padding: 15px 20px;
3397 + margin: 15px 0;
3398 + }
2091 3399
2092 - $content[] = '</div>';
3400 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-title {
3401 + font-size: 20px;
3402 + }
2093 3403
2094 - $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-christmas-top-bundle-coupon-text-box">';
2095 - $content[] = '<div class="ays-poll-christmas-top-bundle-coupon-row">';
2096 - $content[] = 'xmas20off';
2097 - $content[] = '</div>';
3404 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-subtitle {
3405 + font-size: 14px;
3406 + }
2098 3407
2099 - $content[] = '<div class="ays-poll-christmas-top-bundle-text-row">';
2100 - $content[] = __( '20% Extra Discount Coupon', "poll-maker" );
3408 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-description {
3409 + font-size: 13px;
3410 + }
3411 +
3412 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-pumpkin {
3413 + font-size: 48px;
3414 + }
3415 +
3416 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-discount {
3417 + font-size: 28px;
3418 + }
3419 +
3420 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-upgrade {
3421 + padding: 10px 20px;
3422 + font-size: 14px;
3423 + }
3424 + }
3425 +
3426 + @media (max-width: 480px) {
3427 + .ays-poll-halloween-banner-2025-main {
3428 + padding: 12px 15px;
3429 + }
3430 +
3431 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-orb {
3432 + width: 60px;
3433 + height: 60px;
3434 + }
3435 +
3436 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-question {
3437 + font-size: 36px;
3438 + }
3439 +
3440 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-title {
3441 + font-size: 18px;
3442 + }
3443 +
3444 + .ays-poll-halloween-banner-2025-main .ays-poll-halloween-banner-2025-coupon-text {
3445 + font-size: 12px;
3446 + }
3447 + }
3448 + ';
3449 +
3450 + $content[] = '</style>';
3451 +
3452 + $content[] = '<script>';
3453 + $content[] = "
3454 + function aysPollHalloweenCopyToClipboard(text) {
3455 + // Create a temporary textarea element
3456 + var textarea = document.createElement('textarea');
3457 + textarea.value = text;
3458 + textarea.style.position = 'fixed';
3459 + textarea.style.opacity = '0';
3460 + document.body.appendChild(textarea);
3461 +
3462 + // Select and copy the text
3463 + textarea.select();
3464 + textarea.setSelectionRange(0, 99999); // For mobile devices
3465 +
3466 + try {
3467 + document.execCommand('copy');
3468 + aysPollHalloweenShowCopyNotification('Coupon code copied!');
3469 + } catch (err) {
3470 + console.error('Failed to copy text: ', err);
3471 + }
3472 +
3473 + // Remove the temporary textarea
3474 + document.body.removeChild(textarea);
3475 + }
3476 +
3477 + function aysPollHalloweenShowCopyNotification(message) {
3478 + // Check if notification already exists
3479 + var existingNotification = document.querySelector('.ays-poll-halloween-banner-2025-copy-notification');
3480 + if (existingNotification) {
3481 + document.body.removeChild(existingNotification);
3482 + }
3483 +
3484 + // Create notification element
3485 + var notification = document.createElement('div');
3486 + notification.className = 'ays-poll-halloween-banner-2025-copy-notification';
3487 + notification.textContent = message;
3488 + document.body.appendChild(notification);
3489 +
3490 + // Show notification with animation
3491 + setTimeout(function() {
3492 + notification.classList.add('show');
3493 + }, 10);
3494 +
3495 + // Hide and remove notification after 2 seconds
3496 + setTimeout(function() {
3497 + notification.classList.remove('show');
3498 + setTimeout(function() {
3499 + if (notification.parentNode) {
3500 + document.body.removeChild(notification);
3501 + }
3502 + }, 300);
3503 + }, 2000);
3504 + }
3505 +
3506 + (function() {
3507 + var endDate = new Date('". date('Y-m-d H:i:s', $end_date) ."').getTime();
3508 +
3509 + function updateCountdown() {
3510 + var now = new Date().getTime();
3511 + var distance = endDate - now;
3512 +
3513 + if (distance < 0) {
3514 + clearInterval(updateCountdown);
3515 + document.getElementById('ays-poll-halloween-banner-2025-progress-banner-countdown').style.display = 'none';
3516 + return;
3517 + }
3518 +
3519 + var days = Math.floor(distance / (1000 * 60 * 60 * 24));
3520 + var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60));
3521 + var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60));
3522 + var seconds = Math.floor((distance % (1000 * 60)) / 1000);
3523 +
3524 + function padZero(num) {
3525 + return num < 10 ? '0' + num : num;
3526 + }
3527 +
3528 + document.getElementById('ays-poll-halloween-banner-2025-days').textContent = padZero(days);
3529 + document.getElementById('ays-poll-halloween-banner-2025-hours').textContent = padZero(hours);
3530 + document.getElementById('ays-poll-halloween-banner-2025-minutes').textContent = padZero(minutes);
3531 + document.getElementById('ays-poll-halloween-banner-2025-seconds').textContent = padZero(seconds);
3532 + }
3533 +
3534 + updateCountdown();
3535 + setInterval(updateCountdown, 1000);
3536 + })()";
3537 + $content[] = '</script>';
3538 +
3539 + $content = implode( '', $content );
3540 + echo ($content);
3541 + }
3542 +
3543 + // Fox LMS Pro Banner
3544 + public function ays_poll_discounted_licenses_banner_message(){
3545 +
3546 + $content = array();
3547 +
3548 + $date = time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
3549 + $now_date = date('M d, Y H:i:s', $date);
3550 +
3551 + $start_date = strtotime('2025-09-21');
3552 + $end_date = strtotime('2025-10-21');
3553 + $diff_end = $end_date - $date;
3554 +
3555 + $style_attr = '';
3556 + if( $diff_end < 0 ){
3557 + $style_attr = 'style="display:none;"';
3558 + }
3559 +
3560 + $total_licenses = 50;
3561 + $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);
3562 + $days_passed = floor(($date - $start_date) / (24 * 60 * 60));
3563 + $used_licenses = 0;
3564 +
3565 + for ($i = 0; $i < min($days_passed, count($progression_pattern)); $i++) {
3566 + $used_licenses += $progression_pattern[$i];
3567 + }
3568 + $used_licenses = min($used_licenses, $total_licenses);
3569 + $remaining_licenses = $total_licenses - $used_licenses;
3570 + $progress_percentage = ($used_licenses / $total_licenses) * 100;
3571 +
3572 + $ays_poll_cta_button_link = esc_url('https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=poll-maker-license-banner-' . POLL_MAKER_AYS_VERSION);
3573 +
3574 + $content[] = '<div id="ays-poll-progress-banner-main" class="ays-poll-progress-banner-main ays-poll-admin-notice notice notice-success is-dismissible" ' . $style_attr . '>';
3575 + $content[] = '<div class="ays-poll-progress-banner-content">';
3576 + $content[] = '<div class="ays-poll-progress-banner-left">';
3577 + $content[] = '<div class="ays-poll-progress-banner-icon">';
3578 + $content[] = '<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg">
3579 + <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"/>
3580 + <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"/>
3581 + <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"/>
3582 + <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"/>
3583 + <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"/>
3584 + <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"/>
3585 + </svg>';
3586 + $content[] = '</div>';
3587 + $content[] = '<div class="ays-poll-progress-banner-text">';
3588 + $content[] = '<h2 class="ays-poll-progress-banner-title">' . sprintf( __('Get the Pro Version of %s Poll Maker%s – 20%% OFF', 'poll-maker'), '<a href="'. $ays_poll_cta_button_link .'" target="_blank">', '</a>' ) . '</h2>';
3589 + $content[] = '<p class="ays-poll-progress-banner-subtitle">' . __('Unlock advanced features + 30 day Money Back Guarantee', 'poll-maker') . '</p>';
3590 + $content[] = '</div>';
3591 + $content[] = '</div>';
3592 +
3593 + $content[] = '<div class="ays-poll-progress-banner-center">';
3594 + $content[] = '<div class="ays-poll-progress-banner-coupon">';
3595 + $content[] = '<div class="ays-poll-progress-banner-coupon-box" onclick="pollCopyToClipboard(\'FREE2PRO20\')" title="' . __('Click to copy', 'poll-maker') . '">';
3596 + $content[] = '<span class="ays-poll-progress-banner-coupon-text">FREE2PRO20</span>';
3597 + $content[] = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="ays-poll-progress-banner-copy-icon">';
3598 + $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"/>';
3599 + $content[] = '</svg>';
2101 3600 $content[] = '</div>';
2102 3601 $content[] = '</div>';
2103 -
2104 - $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-button-box">';
2105 - $content[] = sprintf('<a href="https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=christmas-sale-banner%s" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">%s</a>', $this->version, __('Get Your Deal', "poll-maker"));
2106 - $content[] = '<span class="ays-poll-dicount-one-time-text">';
2107 - $content[] = __( "One-time payment", "poll-maker" );
2108 - $content[] = '</span>';
3602 +
3603 + $content[] = '<div class="ays-poll-progress-banner-progress">';
3604 + $content[] = '<p class="ays-poll-progress-banner-progress-text">' . __('Only', 'poll-maker') . ' <span id="remaining-licenses">' . $remaining_licenses . '</span> ' . __('of 50 discounted licenses left', 'poll-maker') . '</p>';
3605 + $content[] = '<div class="ays-poll-progress-banner-progress-bar">';
3606 + $content[] = '<div class="ays-poll-progress-banner-progress-fill" id="progress-fill" style="width: ' . $progress_percentage . '%;"></div>';
3607 + $content[] = '</div>';
2109 3608 $content[] = '</div>';
2110 3609 $content[] = '</div>';
3610 +
3611 + $content[] = '<div class="ays-poll-progress-banner-right">';
3612 + $content[] = '<a href="'. $ays_poll_cta_button_link .'" class="ays-poll-progress-banner-upgrade" target="_blank">';
3613 + $content[] = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">';
3614 + $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"/>';
3615 + $content[] = '</svg>';
3616 + $content[] = ' ' . __('Upgrade Now', 'poll-maker');
3617 + $content[] = '</a>';
3618 + $content[] = '</div>';
2111 3619 $content[] = '</div>';
3620 +
3621 + if( current_user_can( 'manage_options' ) ){
3622 + $content[] = '<div id="ays-poll-dismiss-buttons-content">';
3623 + $content[] = '<form action="" method="POST" style="position: absolute; bottom: 0; right: 0; color: #fff;">';
3624 + $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn" style="color: darkgrey; font-size: 11px;">'. __( "Dismiss ad", 'poll-maker' ) .'</button>';
3625 + $content[] = wp_nonce_field( POLL_MAKER_AYS_NAME . '-sale-banner' , POLL_MAKER_AYS_NAME . '-sale-banner' );
3626 + $content[] = '</form>';
3627 + $content[] = '</div>';
3628 + }
3629 + $content[] = '</div>';
2112 3630
2113 - $content = implode( '', $content );
2114 - echo $content;
3631 + // Fox LMS Pro Banner Styles
3632 + $content[] = '<style id="ays-poll-progress-banner-styles-inline-css">';
3633 + $content[] = '
3634 + .ays-poll-progress-banner-main {
3635 + background: linear-gradient(135deg, #6344ED 0%, #8C2ABE 100%);
3636 + padding: 20px 30px;
3637 + border-radius: 16px;
3638 + color: white;
3639 + position: relative;
3640 + margin: 20px 0;
3641 + box-shadow: 0 8px 32px rgba(99, 68, 237, 0.3);
3642 + border: 0;
3643 + }
3644 +
3645 + .ays-poll-progress-banner-main .ays-poll-progress-banner-content {
3646 + display: flex;
3647 + align-items: center;
3648 + justify-content: space-between;
3649 + gap: 30px;
3650 + }
3651 +
3652 + .ays-poll-progress-banner-main .ays-poll-progress-banner-left {
3653 + display: flex;
3654 + align-items: center;
3655 + gap: 20px;
3656 + flex: 1;
3657 + }
3658 +
3659 + .ays-poll-progress-banner-main .ays-poll-progress-banner-center {
3660 + display: flex;
3661 + align-items: center;
3662 + gap: 15px;
3663 + flex: 1;
3664 + }
3665 +
3666 + .ays-poll-progress-banner-main .ays-poll-progress-banner-right {
3667 + display: flex;
3668 + align-items: center;
3669 + gap: 20px;
3670 + flex-shrink: 0;
3671 + }
3672 +
3673 + .ays-poll-progress-banner-main .ays-poll-progress-banner-icon {
3674 + font-size: 32px;
3675 + filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2));
3676 + }
3677 +
3678 + .ays-poll-progress-banner-main .ays-poll-progress-banner-title {
3679 + font-size: 21px;
3680 + font-weight: 700;
3681 + margin: 0 0 8px 0;
3682 + line-height: 1.2;
3683 + color: #fff;
3684 + }
3685 +
3686 + .ays-poll-progress-banner-main .ays-poll-progress-banner-title a {
3687 + text-decoration: underline;
3688 + color: #fff;
3689 + }
3690 +
3691 + .ays-poll-progress-banner-main .ays-poll-progress-banner-subtitle {
3692 + font-size: 16px;
3693 + margin: 0;
3694 + opacity: 0.9;
3695 + font-weight: 400;
3696 + }
3697 +
3698 + .ays-poll-progress-banner-main .ays-poll-progress-banner-coupon {
3699 + margin-bottom: 5px;
3700 + }
3701 +
3702 + .ays-poll-progress-banner-main .ays-poll-progress-banner-coupon-box {
3703 + border: 2px dotted rgba(255, 255, 255, 0.6);
3704 + padding: 8px 16px;
3705 + border-radius: 8px;
3706 + background: rgba(255, 255, 255, 0.1);
3707 + cursor: pointer;
3708 + transition: all 0.3s ease;
3709 + display: flex;
3710 + align-items: center;
3711 + gap: 8px;
3712 + backdrop-filter: blur(10px);
3713 + }
3714 +
3715 + .ays-poll-progress-banner-main .ays-poll-progress-banner-coupon-box:hover {
3716 + background: rgba(255, 255, 255, 0.2);
3717 + border-color: rgba(255, 255, 255, 0.8);
3718 + transform: translateY(-1px);
3719 + }
3720 +
3721 + .ays-poll-progress-banner-main .ays-poll-progress-banner-coupon-text {
3722 + font-size: 16px;
3723 + font-weight: 700;
3724 + letter-spacing: 1px;
3725 + color: #fff;
3726 + font-family: monospace;
3727 + }
3728 +
3729 + .ays-poll-progress-banner-main .ays-poll-progress-banner-copy-icon {
3730 + opacity: 0.8;
3731 + transition: opacity 0.3s ease;
3732 + }
3733 +
3734 + .ays-poll-progress-banner-main .ays-poll-progress-banner-coupon-box:hover .ays-poll-progress-banner-copy-icon {
3735 + opacity: 1;
3736 + }
3737 +
3738 + .ays-poll-progress-banner-main .ays-poll-progress-banner-progress {
3739 + text-align: center;
3740 + width: 100%;
3741 + }
3742 +
3743 + .ays-poll-progress-banner-main .ays-poll-progress-banner-progress-text {
3744 + font-size: 14px;
3745 + margin: 0 0 10px 0;
3746 + opacity: 0.9;
3747 + }
3748 +
3749 + .ays-poll-progress-banner-main .ays-poll-progress-banner-progress-bar {
3750 + width: 300px;
3751 + height: 10px;
3752 + background: rgba(255, 255, 255, 0.2);
3753 + border-radius: 4px;
3754 + overflow: hidden;
3755 + margin: 0 auto;
3756 + }
3757 +
3758 + .ays-poll-progress-banner-main .ays-poll-progress-banner-progress-fill {
3759 + height: 100%;
3760 + background: linear-gradient(90deg, #4ADE80 0%, #22C55E 100%);
3761 + border-radius: 4px;
3762 + transition: width 0.8s ease;
3763 + width: 70%;
3764 + }
3765 +
3766 + .ays-poll-progress-banner-main .ays-poll-progress-banner-upgrade {
3767 + background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%);
3768 + color: white;
3769 + border: none;
3770 + padding: 12px 24px;
3771 + border-radius: 8px;
3772 + font-size: 16px;
3773 + font-weight: 600;
3774 + cursor: pointer;
3775 + transition: all 0.3s ease;
3776 + box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4);
3777 + text-decoration: none;
3778 + display: inline-flex;
3779 + align-items: center;
3780 + gap: 8px;
3781 + }
3782 +
3783 + .ays-poll-progress-banner-main .ays-poll-progress-banner-upgrade:hover {
3784 + transform: translateY(-2px);
3785 + box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6);
3786 + text-decoration: none;
3787 + color: white;
3788 + }
3789 +
3790 + .ays-poll-progress-banner-main .notice-dismiss:before {
3791 + color: #fff;
3792 + }
3793 +
3794 + /* Copy notification */
3795 + .ays-poll-copy-notification {
3796 + position: fixed;
3797 + top: 50%;
3798 + left: 50%;
3799 + transform: translate(-50%, -50%);
3800 + background: rgba(0, 0, 0, 0.8);
3801 + color: white;
3802 + padding: 12px 24px;
3803 + border-radius: 8px;
3804 + font-size: 14px;
3805 + z-index: 10000;
3806 + opacity: 0;
3807 + transition: opacity 0.3s ease;
3808 + }
3809 +
3810 + .ays-poll-copy-notification.show {
3811 + opacity: 1;
3812 + }
3813 +
3814 + @media (max-width: 1400px) {
3815 + .ays-poll-progress-banner-main .ays-poll-progress-banner-center {
3816 + flex-direction: column;
3817 + }
3818 + }
3819 +
3820 + @media (max-width: 1200px) {
3821 + .ays-poll-progress-banner-main .ays-poll-progress-banner-content {
3822 + flex-direction: column;
3823 + gap: 20px;
3824 + }
3825 +
3826 + .ays-poll-progress-banner-main .ays-poll-progress-banner-left {
3827 + width: 100%;
3828 + justify-content: center;
3829 + text-align: center;
3830 + flex-direction: column;
3831 + }
3832 +
3833 + .ays-poll-progress-banner-main .ays-poll-progress-banner-center {
3834 + width: 100%;
3835 + }
3836 +
3837 + .ays-poll-progress-banner-main .ays-poll-progress-banner-right {
3838 + width: 100%;
3839 + justify-content: center;
3840 + }
3841 + }
3842 +
3843 + @media (max-width: 768px) {
3844 + #ays-poll-progress-banner-main {
3845 + display: none !important;
3846 + }
3847 +
3848 + .ays-poll-progress-banner-main {
3849 + padding: 15px 20px;
3850 + margin: 15px 0;
3851 + }
3852 +
3853 + .ays-poll-progress-banner-main .ays-poll-progress-banner-title {
3854 + font-size: 18px;
3855 + }
3856 +
3857 + .ays-poll-progress-banner-main .ays-poll-progress-banner-subtitle {
3858 + font-size: 14px;
3859 + }
3860 +
3861 + .ays-poll-progress-banner-main .ays-poll-progress-banner-progress-bar {
3862 + width: 100%;
3863 + max-width: 280px;
3864 + }
3865 +
3866 + .ays-poll-progress-banner-main .ays-poll-progress-banner-upgrade {
3867 + padding: 10px 20px;
3868 + font-size: 14px;
3869 + }
3870 + }
3871 +
3872 + @media (max-width: 480px) {
3873 + .ays-poll-progress-banner-main {
3874 + padding: 12px 15px;
3875 + }
3876 +
3877 + .ays-poll-progress-banner-main .ays-poll-progress-banner-coupon-text {
3878 + font-size: 14px;
3879 + }
3880 +
3881 + .ays-poll-progress-banner-main .ays-poll-progress-banner-progress-bar {
3882 + max-width: 250px;
3883 + }
3884 + }
3885 + ';
3886 +
3887 + $content[] = '</style>';
3888 +
3889 + $content = implode( '', $content );
3890 + echo ($content);
2115 3891
2116 3892 }
2117 3893
3894 + public function ays_poll_sale_message_poll_pro(){
3895 + $content = array();
2118 3896
3897 + $poll_cta_button_link = esc_url( 'https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=poll-free&utm_campaign=mega-bundle-sale-banner-' . POLL_MAKER_AYS_VERSION );
2119 3898
3899 + $content[] = '<div id="ays-poll-dicount-month-main" class="ays-poll-admin-notice notice notice-success is-dismissible ays_poll_dicount_info">';
3900 + $content[] = '<div id="ays-poll-dicount-month" class="ays_poll_dicount_month">';
3901 +
3902 + $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-text-box">';
3903 + $content[] = '<div>';
3904 + $content[] = '<span class="ays-poll-new-poll-pro-title">';
3905 +
3906 + $content[] = __( "<span><a href='". $poll_cta_button_link ."' target='_blank' style='color:#ffffff; text-decoration: underline;'>Mega Bundle</a> (Quiz + Survey + Poll)</span>", 'poll-maker' );
3907 +
3908 + $content[] = '</span>';
3909 + $content[] = '</br>';
3910 + $content[] = '<div class="ays-poll-new-poll-pro-mobile-image-display-block display_none">';
3911 + $content[] = '<span class="ays-poll-sale-baner-mega-bundle-sale-text">50%</span>';
3912 + $content[] = '<img src="' . esc_url(POLL_MAKER_AYS_ADMIN_URL) . '/images/line.webp" style="width: 70px;">';
3913 + $content[] = '</div>';
3914 + $content[] = '<span class="ays-poll-new-poll-pro-desc">';
3915 + $content[] = '<img class="ays-poll-new-poll-pro-guaranteeicon" src="' . esc_url(POLL_MAKER_AYS_ADMIN_URL) . '/images/poll-maker-guaranteeicon.svg" style="width:30px;margin-right:5px">';
3916 + $content[] =esc_html__( "30 Days Money Back Guarantee", "poll-maker" );
3917 + $content[] = '</span>';
3918 + $content[] = '</div>';
3919 + $content[] = '<div style="display:flex;flex-wrap:wrap;width:min-content;">';
3920 + $content[] = '<span class="ays-poll-sale-baner-mega-bundle-sale-text">50%</span>';
3921 + $content[] = '<img src="' . esc_url(POLL_MAKER_AYS_ADMIN_URL) . '/images/line.webp" class="ays-poll-new-mega-bundle-mobile-image-display-none" style="width: 70px;">';
3922 + $content[] = '</div>';
3923 + $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-poll-dismiss-buttons-container-for-form">';
3924 +
3925 + $content[] = '<form action="" method="POST">';
3926 + $content[] = '<div id="ays-poll-dismiss-buttons-content">';
3927 + if( current_user_can( 'manage_options' ) ){
3928 + $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>';
3929 + $content[] = wp_nonce_field( POLL_MAKER_AYS_NAME . '-sale-banner' , POLL_MAKER_AYS_NAME . '-sale-banner' );
3930 + }
3931 + $content[] = '</div>';
3932 + $content[] = '</form>';
3933 +
3934 + $content[] = '</div>';
3935 +
3936 + $content[] = '</div>';
3937 +
3938 + $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-countdown-box">';
3939 +
3940 + $content[] = '<div id="ays-poll-maker-countdown-main-container">';
3941 + $content[] = '<div class="ays-poll-maker-countdown-container">';
3942 +
3943 + $content[] = '<div id="ays-poll-countdown">';
3944 +
3945 + $content[] = '<ul>';
3946 + $content[] = '<li><span id="ays-poll-countdown-days"></span>days</li>';
3947 + $content[] = '<li><span id="ays-poll-countdown-hours"></span>Hours</li>';
3948 + $content[] = '<li><span id="ays-poll-countdown-minutes"></span>Minutes</li>';
3949 + $content[] = '<li><span id="ays-poll-countdown-seconds"></span>Seconds</li>';
3950 + $content[] = '</ul>';
3951 +
3952 + $content[] = '</div>';
3953 +
3954 + $content[] = '<div id="ays-poll-countdown-content" class="emoji">';
3955 + $content[] = '<span>🚀</span>';
3956 + $content[] = '<span>⌛</span>';
3957 + $content[] = '<span>🔥</span>';
3958 + $content[] = '<span>💣</span>';
3959 + $content[] = '</div>';
3960 +
3961 + $content[] = '</div>';
3962 + $content[] = '</div>';
3963 +
3964 + $content[] = '</div>';
3965 +
3966 + $content[] = '<div class="ays-poll-dicount-wrap-box ays-poll-dicount-wrap-button-box">';
3967 +
3968 + $content[] = '<a href="'. $poll_cta_button_link .'" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now', 'poll-maker' ) . '</a>';
3969 +
3970 + $content[] = '<span class="ays-poll-dicount-one-time-text">';
3971 + $content[] =esc_html__( "One-time payment", "poll-maker" );
3972 + $content[] = '</span>';
3973 + $content[] = '</div>';
3974 + $content[] = '</div>';
3975 + $content[] = '</div>';
3976 + $background_image = POLL_MAKER_AYS_ADMIN_URL . '/images/ays-poll-banner-background-50.svg';
3977 + $close_banner_image = POLL_MAKER_AYS_ADMIN_URL . '/images/icons/ays-poll-close-banner-white.svg';
3978 +
3979 + $content[] = '<style id="ays_poll_sale_message_poll_pro-inline-css">';
3980 + $content[] = 'div#ays-poll-dicount-month-main{border:0;background:#fff;border-radius:20px;box-shadow:unset;position:relative;z-index:1;min-height:80px}.ays-poll-dicount-sale-name-discount-box,div#ays-poll-dicount-month-main.ays_poll_dicount_info button{display:flex;align-items:center}div#ays-poll-dicount-month-main div#ays-poll-dicount-month a.ays-poll-sale-banner-link:focus{outline:0;box-shadow:0}div#ays-poll-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-poll-dicount-month-main.ays_poll_dicount_info{background-image:url("'. $background_image . '");background-position:center right;background-repeat:no-repeat;background-color:#5551ff; background-size:cover}#ays-poll-dicount-month-main .ays_poll_dicount_month{display:flex;align-items:center;justify-content:space-between;color:#fff}#ays-poll-dicount-month-main .ays_poll_dicount_month img{width:80px}#ays-poll-dicount-month-main .ays-poll-sale-banner-link{display:flex;justify-content:center;align-items:center;width:200px}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box{font-size:14px;text-align:center;padding:12px}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box{text-align:left;width:25%;display:flex;justify-content:space-around;align-items:flex-start}.ays-poll-dicount-sale-name-discount-box div{margin-left:10px}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-countdown-box{width:40%;display:flex;justify-content:center;align-items:center}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-button-box{width:20%;display:flex;justify-content:center;align-items:center;flex-direction:column}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box .ays-poll-new-poll-pro-title{color:#fdfdfd;font-size:16.8px;font-style:normal;font-weight:600;line-height:normal}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box .ays-poll-sale-baner-mega-bundle-sale-text{font-size:23px;font-weight:700;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}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box .ays-poll-new-poll-pro-desc{display:inline-block;color:#fff;font-size:15px;font-style:normal;font-weight:400;line-height:normal;margin-top:10px}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box strong{font-size:17px;font-weight:700;letter-spacing:.8px}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-color{color:#971821}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-text-decoration{text-decoration:underline}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-buy-now-button-box{display:flex;justify-content:flex-end;align-items:center;width:30%}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box .ays-button,#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box .ays-buy-now-button{align-items:center;font-weight:500}#ays-poll-dicount-month-main .ays-poll-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-poll-dicount-month-main .ays-poll-dicount-wrap-box .ays-buy-now-button:hover{background:#7d161d;border-color:#971821}#ays-poll-dicount-month-main #ays-poll-dismiss-buttons-content{display:flex;justify-content:center}#ays-poll-dicount-month-main #ays-poll-dismiss-buttons-content .ays-button{margin:0!important;font-size:13px;color:#fff}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-opacity-box{width:19%}#ays-poll-dicount-month-main .ays-buy-now-opacity-button{padding:40px 15px;display:flex;justify-content:center;align-items:center;opacity:0}#ays-poll-maker-countdown-main-container .ays-poll-maker-countdown-container{margin:0 auto;text-align:center}#ays-poll-maker-countdown-main-container #ays-poll-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-poll-maker-countdown-main-container li,#ays-poll-maker-countdown-main-container ul{margin:0}#ays-poll-maker-countdown-main-container li{display:inline-block;font-size:14px;list-style-type:none;padding:14px;text-transform:lowercase}#ays-poll-maker-countdown-main-container li span{display:flex;justify-content:center;align-items:center;font-size:40px;min-height:62px;min-width:62px;border-radius:4.273px;border:.534px solid #f4f4f4;background:#9896ed}#ays-poll-maker-countdown-main-container .emoji{display:none;padding:1rem}#ays-poll-maker-countdown-main-container .emoji span{font-size:30px;padding:0 .5rem}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box li{position:relative}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box li span:after{content:":";color:#fff;position:absolute;top:10px;right:-5px;font-size:40px}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box li span#ays-poll-countdown-seconds:after{content:unset}#ays-poll-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:12.818px;font-style:normal;font-weight:800;line-height:normal;margin:0!important}div#ays-poll-dicount-month-main button.notice-dismiss:before{color:#fff;content:"";background-image:url("'.$close_banner_image.'");font-size:22px;font-weight:700;font-family:sans-serif}#ays-poll-dicount-month-main .ays-poll-new-mega-bundle-guaranteeicon{width:30px;margin-right:5px}#ays-poll-dicount-month-main .ays-poll-dicount-one-time-text{color:#fff;font-size:12px;font-style:normal;font-weight:600;line-height:normal}@media all and (max-width:1024px){#ays-poll-dicount-month-main{display:none!important}}@media all and (max-width:768px){div#ays-poll-dicount-month-main{padding-right:0}div#ays-poll-dicount-month-main .ays_poll_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-poll-dicount-month-main .ays-poll-dicount-wrap-box{width:100%!important;text-align:center}#ays-poll-maker-countdown-main-container #ays-poll-countdown-headline{font-size:15px;font-weight:600}#ays-poll-maker-countdown-main-container ul{font-weight:500}div#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box{width:100%!important;text-align:center;flex-direction:column;margin-top:20px;justify-content:center;align-items:center}.ays-poll-dicount-sale-name-discount-box{display:block}.ays-poll-dicount-sale-name-discount-box div{margin-left:0}div#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box li span:after{top:unset}div#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-countdown-box{width:100%}#ays-poll-dicount-month-main .ays-button{margin:0 auto!important}div#ays-poll-dicount-month-main.ays_poll_dicount_info.notice{background-position:bottom right;background-repeat:no-repeat;background-size:cover}#ays-poll-dicount-month-main #ays-poll-dismiss-buttons-content .ays-button{padding-left:unset!important}div#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-buy-now-button-box{justify-content:center}div#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box .ays-buy-now-button{font-size:14px;padding:5px 10px}div#ays-poll-dicount-month-main .ays-buy-now-opacity-button{display:none}#ays-poll-dicount-month-main .ays-poll-dismiss-buttons-container-for-form{position:static!important}.comparison .product img{width:70px}.ays-poll-features-wrap .comparison a.price-buy{padding:8px 5px;font-size:11px}}@media screen and (max-width:1305px) and (min-width:768px){div#ays-poll-dicount-month-main.ays_poll_dicount_info.notice{background-position:bottom right;background-repeat:no-repeat;background-size:cover}div#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box strong{font-size:15px}#ays-poll-maker-countdown-main-container li{font-size:11px}div#ays-poll-dicount-month-main .ays-poll-dicount-wrap-opacity-box{display:none}}@media screen and (max-width:1680px) and (min-width:1551px){div#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box{width:29%}div#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-countdown-box{width:30%}}@media screen and (max-width:1550px) and (min-width:1400px){div#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box{width:31%}div#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-countdown-box{width:35%}}@media screen and (max-width:1274px){div#ays-poll-maker-countdown-main-container li span{font-size:25px;min-height:40px;min-width:40px}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box .ays-poll-new-poll-pro-title{font-size:15px}}@media screen and (max-width:1200px){#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-button-box{margin-bottom:16px}#ays-poll-maker-countdown-main-container ul{padding-left:0}#ays-poll-dicount-month-main .ays-poll-coupon-row{width:120px;font-size:18px}#ays-poll-dicount-month-main #ays-button-top-buy-now{padding:12px 20px}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box{font-size:12px}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box .ays-poll-new-mega-bundle-desc{font-size:13px}}@media screen and (max-width:1076px) and (min-width:769px){#ays-poll-maker-countdown-main-container li{padding:10px}#ays-poll-dicount-month-main .ays-poll-coupon-row{width:100px;font-size:16px}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-button-box{margin-bottom:16px}#ays-poll-dicount-month-main #ays-button-top-buy-now{padding:12px 15px}#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box{font-size:11px;padding:12px 0}}@media screen and (max-width:1250px) and (min-width:769px){div#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-countdown-box{width:45%}div#ays-poll-dicount-month-main .ays-poll-dicount-wrap-box.ays-poll-dicount-wrap-text-box{width:35%}div#ays-poll-maker-countdown-main-container li span{font-size:30px;min-height:50px;min-width:50px}}';
3981 + $content[] = '</style>';
3982 +
3983 + $content = implode( '', $content );
3984 + echo ( $content );
3985 + }
3986 +
2120 3987 public function add_tabs() {
2121 3988 $screen = get_current_screen();
2122 3989
2123 3990 if ( ! $screen) {
@@ -2123,59 +3990,59 @@
2123 3990 if ( ! $screen) {
2124 3991 return;
2125 3992 }
2126 3993
2127 - $title = __( 'General Information:', "poll-maker");
3994 + $title = esc_html__( 'General Information:', "poll-maker");
2128 3995 $content_text = '<div>
2129 - <span>The WordPress Poll Maker plugin is here to help you quickly create advanced-level online polls and make your WordPress website more interactive. Use it to conduct elections, surveys and etc. Easily generate poll types like;</span>
3996 + <span>'. esc_html__( "The WordPress Poll Maker plugin is here to help you quickly create advanced-level online polls and make your WordPress website more interactive. Use it to conduct elections, surveys and etc. Easily generate poll types like;", "poll-maker") .'</span>
2130 3997 </div>
2131 3998 <br>
2132 3999 <div>
2133 - <span><strong>Choosing</strong> – create many options and let your users choose, or add their custom answers.</span>
4000 + <span><strong>'. esc_html__( "Choosing", "poll-maker") .'</strong> – '. esc_html__( "create many options and let your users choose, or add their custom answers.", "poll-maker") .'</span>
2134 4001 </div>
2135 4002 <div>
2136 - <span><strong>Rating</strong> – with this poll type, the visitors will be able to weigh via a 1-5 star rating system or emojis via the graphical interface.</span>
4003 + <span><strong>'. esc_html__( "Rating", "poll-maker") .'</strong> – '. esc_html__( "with this poll type, the visitors will be able to weigh via a 1-5 star rating system or emojis via the graphical interface.", "poll-maker") .'</span>
2137 4004 </div>
2138 4005 <div>
2139 - <span><strong>Voting</strong> – make the participants evaluate your product by using like/dislike buttons or smiley/frown emojis.</span>
4006 + <span><strong>'. esc_html__( "Voting", "poll-maker") .'</strong> – '. esc_html__( "make the participants evaluate your product by using like/dislike buttons or smiley/frown emojis.", "poll-maker") .'</span>
2140 4007 </div>
2141 4008 <div>
2142 - <span><strong>Versus</strong> – Select two statements or images that are opposed to each other, and make your users choose the perfect one.</span>
4009 + <span><strong>'. esc_html__( "Versus", "poll-maker") .'</strong> – '. esc_html__( "Select two statements or images that are opposed to each other, and make your users choose the perfect one.", "poll-maker") .'</span>
2143 4010 </div>
2144 4011 <div>
2145 - <span><strong>Range</strong> – the users will be able to choose the answer across the 0-100 scale.</span>
4012 + <span><strong>'. esc_html__( "Range", "poll-maker") .'</strong> – '. esc_html__( "the users will be able to choose the answer across the 0-100 scale.", "poll-maker") .'</span>
2146 4013 </div>
2147 4014 <div>
2148 - <span><strong>Text</strong> – with this poll type the visitors should write down their own answers on the text boundaries.</span>
4015 + <span><strong>'. esc_html__( "Text", "poll-maker") .'</strong> – '. esc_html__( "with this poll type the visitors should write down their own answers on the text boundaries.", "poll-maker") .'</span>
2149 4016 </div>
2150 4017 <div>
2151 - <span><strong>Dropdown</strong> – the users will choose the multiple-choice answers from a list of answers appeared in a dropdown form.</span>
4018 + <span><strong>'. esc_html__( "Dropdown", "poll-maker") .'</strong> – '. esc_html__( "the users will choose the multiple-choice answers from a list of answers appeared in a dropdown form.", "poll-maker") .'</span>
2152 4019 </div>
2153 4020 <br>
2154 4021 <div>
2155 - <span>Increase engagement of your website with the integrated, formatting, image, audio, video poll question types feature.</span>
4022 + <span>'. esc_html__( "Increase engagement of your website with the integrated, formatting, image, audio, video poll question types feature.", "poll-maker") .'</span>
2156 4023 </div>';
2157 4024
2158 - $sidebar_content = '<p><strong>' . __( 'For more information:', "poll-maker") . '</strong></p>' .
4025 + $sidebar_content = '<p><strong>'. esc_html__( 'For more information:', "poll-maker") .'</strong></p>' .
2159 4026 '<p>
2160 - <a href="https://www.youtube.com/watch?v=RDKZXFmG6Pc" target="_blank">' . __( 'YouTube video tutorials' , "poll-maker" ) . '</a>
4027 + <a href="https://www.youtube.com/watch?v=RDKZXFmG6Pc" target="_blank">' .esc_html__( 'YouTube video tutorials' , "poll-maker" ) . '</a>
2161 4028 </p>' .
2162 4029 '<p>
2163 - <a href="https://ays-pro.com/wordpress-poll-maker-user-manual" target="_blank">' . __( 'Documentation', "poll-maker" ) . '</a>
4030 + <a href="https://ays-pro.com/wordpress-poll-maker-user-manual" target="_blank">' .esc_html__( 'Documentation', "poll-maker" ) . '</a>
2164 4031 </p>' .
2165 4032 '<p>
2166 - <a href="https://ays-pro.com/wordpress/poll-maker" target="_blank">' . __( 'Poll Maker plugin pro version', "poll-maker" ) . '</a>
4033 + <a href="https://ays-pro.com/wordpress/poll-maker" target="_blank">' .esc_html__( 'Poll Maker plugin pro version', "poll-maker" ) . '</a>
2167 4034 </p>' .
2168 4035 '<p>
2169 - <a href="https://poll-plugin.com/wordpress-poll-plugin-pro-demo/" target="_blank">' . __( 'Poll Maker plugin demo', "poll-maker" ) . '</a>
4036 + <a href="https://poll-plugin.com/wordpress-poll-plugin-pro-demo/" target="_blank">' .esc_html__( 'Poll Maker plugin demo', "poll-maker" ) . '</a>
2170 4037 </p>';
2171 4038
2172 4039
2173 - $content = '<h2>' . __( 'Poll Maker Information', "poll-maker") . '</h2>';
4040 + $content = '<h2>' .esc_html__( 'Poll Maker Information', "poll-maker") . '</h2>';
2174 4041 $content .= '<div>' . $content_text . '</div>';
2175 4042
2176 4043 $help_tab_content = array(
2177 - 'id' => 'survey_maker_help_tab',
4044 + 'id' => 'poll_maker_help_tab',
2178 4045 'title' => $title,
2179 4046 'content' => $content
2180 4047 );
2181 4048
@@ -2181,307 +4048,598 @@
2181 4048
2182 4049 $screen->add_help_tab($help_tab_content);
2183 4050
2184 4051 $screen->set_help_sidebar($sidebar_content);
2185 - }
2186 -
2187 - public static function ays_poll_sale_message_small_spring(){
2188 - $content = array();
4052 + }
2189 4053
2190 - $content[] = '<div id="ays-poll-dicount-month-main" class="notice notice-success is-dismissible ays_poll_dicount_info">';
2191 - $content[] = '<div id="ays-poll-dicount-month" class="ays_poll_dicount_month">';
2192 - $content[] = '<a href="https://ays-pro.com/mega-bundle" target="_blank" class="ays-poll-sale-banner-link"><img src="' . POLL_MAKER_AYS_ADMIN_URL . '/images/mega_bundle_logo_box.png"></a>';
4054 + /**
4055 + * Recursive sanitation for an array
4056 + *
4057 + * @param $array
4058 + *
4059 + * @return mixed
4060 + */
4061 + public static function recursive_sanitize_text_field($array) {
4062 + foreach ( $array as $key => &$value ) {
4063 + if ( is_array( $value ) ) {
4064 + $value = self::recursive_sanitize_text_field($value);
4065 + } else {
4066 + $value = sanitize_text_field( $value );
4067 + }
4068 + }
4069 + return $array;
4070 + }
2193 4071
2194 - $content[] = '<div class="ays-poll-dicount-wrap-box">';
2195 - $content[] = '<p>';
2196 - $content[] = '<strong>';
2197 - $content[] = __( "Spring is here! <span class='ays-poll-dicount-wrap-color'>50%</span> SALE on <span><a href='https://ays-pro.com/mega-bundle' target='_blank' class='ays-poll-dicount-wrap-color ays-poll-dicount-wrap-text-decoration'>Mega Bundle</a></span><span style='display: block;'>Quiz + Survey + Poll</span>", "poll-maker" );
2198 - $content[] = '</strong>';
2199 - $content[] = '</p>';
2200 - $content[] = '</div>';
4072 + public static function get_max_id( $table ) {
4073 + global $wpdb;
4074 + $db_table = $wpdb->prefix . 'ayspoll_'.$table;;
2201 4075
2202 - $content[] = '<div class="ays-poll-dicount-wrap-box">';
4076 + $sql = "SELECT MAX(id) FROM {$db_table}";
2203 4077
2204 - $content[] = '<div id="ays-poll-countdown-main-container">';
4078 + $result = intval( $wpdb->get_var( $sql ) );
2205 4079
2206 - $content[] = '<form action="" method="POST" class="ays-poll-btn-form">';
2207 - $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn_small_spring" style="height: 32px; margin-left: 0;padding-left: 0" value="small_spring">Dismiss ad</button>';
2208 - $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn_spring_small_for_two_months" style="height: 32px; padding-left: 0" value="small_spring">Dismiss ad for 2 months</button>';
2209 - $content[] = '</form>';
4080 + return $result;
4081 + }
2210 4082
2211 - $content[] = '</div>';
2212 -
2213 - $content[] = '</div>';
4083 + public function ays_poll_generate_message_vars_html( $poll_message_vars ) {
4084 + $content = array();
2214 4085
2215 - $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 !', "poll-maker" ) . '</a>';
2216 - $content[] = '</div>';
2217 - $content[] = '</div>';
4086 + $content[] = '<div class="ays-poll-message-vars-box">';
4087 + $content[] = '<div class="ays-poll-message-vars-icon">';
4088 + $content[] = '<span class="ays-poll-message-vars-braces" aria-hidden="true">{ }</span>';
4089 + $content[] = '<span>'. esc_html__( "Message Variables" , 'poll-maker') .'</span>';
4090 + $content[] = '<span class="ays-poll-message-vars-chevron" aria-hidden="true"></span>';
4091 + $content[] = '</div>';
4092 + $content[] = '<div class="ays-poll-message-vars-data">';
4093 + foreach($poll_message_vars as $var => $var_name){
4094 + $content[] = '<label class="ays-poll-message-vars-each-data-label">';
4095 + $content[] = '<div class="ays-poll-message-vars-each-data">';
4096 + $content[] = '<input type="hidden" class="ays-poll-message-vars-each-var" value="'. esc_attr( $var ) .'">';
4097 + $content[] = '<span>'. esc_html( $var_name ) .'</span>';
4098 + $content[] = '</div>';
4099 + $content[] = '</label>';
4100 + }
4101 + $content[] = '</div>';
4102 + $content[] = '</div>';
2218 4103
2219 - $content = implode( '', $content );
2220 - echo $content;
4104 + $content = implode( '', $content );
4105 +
4106 + return $content;
2221 4107 }
2222 4108
2223 - public function ays_poll_sale_message_poll_countdown(){
2224 - $content = array();
4109 + /**
4110 + * Determine if the plugin/addon installations are allowed.
4111 + *
4112 + * @since 1.3.9
4113 + *
4114 + * @param string $type Should be `plugin` or `addon`.
4115 + *
4116 + * @return bool
4117 + */
4118 + public static function ays_poll_can_install( $type ) {
2225 4119
2226 - $content[] = '<div id="ays-poll-dicount-month-main" class="notice notice-success is-dismissible ays_poll_dicount_info">';
2227 - $content[] = '<div id="ays-poll-dicount-month" class="ays_poll_dicount_month">';
2228 - $content[] = '<a href="https://ays-pro.com/great-bundle" target="_blank" class="ays-poll-sale-banner-link" style="display:none;"><img src="' . POLL_MAKER_AYS_ADMIN_URL . '/images/mega_bundle_logo_box.png"></a>';
4120 + return self::ays_poll_can_do( 'install', $type );
4121 + }
2229 4122
2230 - $content[] = '<a href="https://ays-pro.com/wordpress/poll-maker" class="ays-poll-sale-banner-link" target="_blank"><img src="' . POLL_MAKER_AYS_ADMIN_URL . '/images/icons/icon-128x128.png"></a>';
4123 + /**
4124 + * Determine if the plugin/addon activations are allowed.
4125 + *
4126 + * @since 1.3.9
4127 + *
4128 + * @param string $type Should be `plugin` or `addon`.
4129 + *
4130 + * @return bool
4131 + */
4132 + public static function ays_poll_can_activate( $type ) {
2231 4133
2232 - $content[] = '<div class="ays-poll-dicount-wrap-box">';
4134 + return self::ays_poll_can_do( 'activate', $type );
4135 + }
2233 4136
2234 - $content[] = '<strong style="font-weight: bold;">';
2235 - $content[] = __( "Limited Time <span class='ays-poll-dicount-wrap-color'>20%</span> SALE on <br><span><a href='https://ays-pro.com/wordpress/poll-maker/' target='_blank' class='ays-poll-dicount-wrap-color ays-poll-dicount-wrap-text-decoration' style='display:block;'>Poll Maker Premium Versions</a></span>", "poll-maker" );
2236 - $content[] = '</strong>';
4137 + /**
4138 + * Determine if the plugin/addon installations/activations are allowed.
4139 + *
4140 + * @since 1.3.9
4141 + *
4142 + * @param string $what Should be 'activate' or 'install'.
4143 + * @param string $type Should be `plugin` or `addon`.
4144 + *
4145 + * @return bool
4146 + */
4147 + public static function ays_poll_can_do( $what, $type ) {
2237 4148
2238 - $content[] = '<strong>';
2239 - $content[] = __( "Hurry up! <a href='https://ays-pro.com/wordpress/poll-maker' target='_blank'>Check it out!</a>", "poll-maker" );
2240 - $content[] = '</strong>';
2241 -
2242 - $content[] = '</div>';
4149 + if ( ! in_array( $what, array( 'install', 'activate' ), true ) ) {
4150 + return false;
4151 + }
2243 4152
2244 - $content[] = '<div class="ays-poll-dicount-wrap-box">';
4153 + if ( ! in_array( $type, array( 'plugin', 'addon' ), true ) ) {
4154 + return false;
4155 + }
2245 4156
2246 - $content[] = '<div id="ays-poll-maker-countdown-main-container">';
2247 - $content[] = '<div class="ays-poll-maker-countdown-container">';
4157 + $capability = $what . '_plugins';
2248 4158
2249 - $content[] = '<div id="ays-poll-countdown">';
2250 - $content[] = '<ul>';
2251 - $content[] = '<li><span id="ays-poll-countdown-days"></span>days</li>';
2252 - $content[] = '<li><span id="ays-poll-countdown-hours"></span>Hours</li>';
2253 - $content[] = '<li><span id="ays-poll-countdown-minutes"></span>Minutes</li>';
2254 - $content[] = '<li><span id="ays-poll-countdown-seconds"></span>Seconds</li>';
2255 - $content[] = '</ul>';
2256 - $content[] = '</div>';
4159 + if ( ! current_user_can( $capability ) ) {
4160 + return false;
4161 + }
2257 4162
2258 - $content[] = '<div id="ays-poll-countdown-content" class="emoji">';
2259 - $content[] = '<span>🚀</span>';
2260 - $content[] = '<span>⌛</span>';
2261 - $content[] = '<span>🔥</span>';
2262 - $content[] = '<span>💣</span>';
2263 - $content[] = '</div>';
4163 + // Determine whether file modifications are allowed and it is activation permissions checking.
4164 + if ( $what === 'install' && ! wp_is_file_mod_allowed( 'ays_poll_can_install' ) ) {
4165 + return false;
4166 + }
2264 4167
2265 - $content[] = '</div>';
4168 + // All plugin checks are done.
4169 + if ( $type === 'plugin' ) {
4170 + return true;
4171 + }
4172 + return false;
4173 + }
2266 4174
2267 - $content[] = '</div>';
2268 -
2269 - $content[] = '</div>';
4175 + /**
4176 + * Activate plugin.
4177 + *
4178 + * @since 1.0.0
4179 + * @since 1.3.9 Updated the permissions checking.
4180 + */
4181 + public function ays_poll_activate_plugin() {
2270 4182
2271 - $content[] = '<div class="ays-poll-dicount-wrap-box ays-buy-now-button-box">';
2272 - $content[] = '<a href="https://ays-pro.com/wordpress/poll-maker" class="button button-primary ays-buy-now-button" id="ays-button-top-buy-now" target="_blank" style="" >' . __( 'Buy Now !', "poll-maker" ) . '</a>';
2273 - $content[] = '</div>';
4183 + // Run a security check.
4184 + check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
2274 4185
2275 - $content[] = '</div>';
4186 + // Check for permissions.
4187 + if ( ! current_user_can( 'activate_plugins' ) ) {
4188 + wp_send_json_error( esc_html__( 'Plugin activation is disabled for you on this site.', $this->plugin_name ) );
4189 + }
2276 4190
2277 - $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-poll-dismiss-buttons-container-for-form">';
2278 - $content[] = '<form action="" method="POST">';
2279 - $content[] = '<div id="ays-poll-dismiss-buttons-content">';
2280 - $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn_poll_countdown" style="height: 32px; margin-left: 0;padding-left: 0; color:#979797" value="poll_countdown">Dismiss ad</button>';
2281 - $content[] = '</div>';
2282 - $content[] = '</form>';
2283 - $content[] = '</div>';
4191 + $type = 'addon';
2284 4192
2285 - $content[] = '</div>';
4193 + if ( isset( $_POST['plugin'] ) ) {
2286 4194
2287 - $content = implode( '', $content );
2288 - echo $content;
4195 + if ( ! empty( $_POST['type'] ) ) {
4196 + $type = sanitize_key( $_POST['type'] );
4197 + }
4198 +
4199 + $plugin = sanitize_text_field( wp_unslash( $_POST['plugin'] ) );
4200 + $activate = activate_plugins( $plugin );
4201 +
4202 + if ( ! is_wp_error( $activate ) ) {
4203 + if ( $type === 'plugin' ) {
4204 + wp_send_json_success( esc_html__( 'Plugin activated.', $this->plugin_name ) );
4205 + } else {
4206 + ( esc_html__( 'Addon activated.', $this->plugin_name ) );
4207 + }
4208 + }
4209 + }
4210 +
4211 + if ( $type === 'plugin' ) {
4212 + wp_send_json_error( esc_html__( 'Could not activate the plugin. Please activate it on the Plugins page.', $this->plugin_name ) );
4213 + }
4214 +
4215 + wp_send_json_error( esc_html__( 'Could not activate the addon. Please activate it on the Plugins page.', $this->plugin_name ) );
2289 4216 }
2290 4217
2291 - public static function ays_poll_halloween_bundle(){
2292 - $content = array();
4218 + /**
4219 + * Install addon.
4220 + *
4221 + * @since 1.0.0
4222 + * @since 1.3.9 Updated the permissions checking.
4223 + */
4224 + public function ays_poll_install_plugin() {
2293 4225
2294 - $content[] = '<div id="ays-poll-dicount-month-main-helloween" class="notice notice-success is-dismissible ays_poll_dicount_info">';
2295 - $content[] = '<div id="ays-poll-dicount-month-helloween" class="ays_poll_dicount_month_helloween">';
2296 - $content[] = '<div class="ays-poll-dicount-wrap-box-helloween-limited">';
4226 + // Run a security check.
4227 + check_ajax_referer( $this->plugin_name . '-install-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) );
2297 4228
2298 - $content[] = '<p>';
2299 - $content[] = __( "Limited Time
2300 - <span class='ays-poll-dicount-wrap-color-helloween' style='color:#b2ff00;'>20%</span>
2301 - <span>
2302 - SALE on
2303 - </span>
2304 - <br>
2305 - <span style='' class='ays-poll-helloween-bundle'>
2306 - <a href='https://ays-pro.com/wordpress/poll-maker?utm_source=poll-maker-free&utm_medium=dashboard&utm_campaign=halloween-sale-banner' target='_blank' class='ays-poll-dicount-wrap-color-helloween ays-poll-dicount-wrap-text-decoration-helloween' style='display:block; color:#b2ff00;margin-right:6px;'>
2307 - Poll Maker
2308 - </a>
2309 - </span>", "poll-maker" );
2310 - $content[] = '</p>';
2311 - $content[] = '<p>';
2312 - $content[] = __( "Hurry up!
2313 - <a href='https://ays-pro.com/wordpress/poll-maker?utm_source=easy-form-free&utm_medium=dashboard&utm_campaign=halloween-sale-banner' target='_blank' style='color:#ffc700;'>
2314 - Check it out!
2315 - </a>", "poll-maker" );
2316 - $content[] = '</p>';
2317 -
2318 - $content[] = '</div>';
2319 - $content[] = '<div class="ays-poll-helloween-bundle-buy-now-timer">';
2320 - $content[] = '<div class="ays-poll-dicount-wrap-box-helloween-timer">';
2321 - $content[] = '<div id="ays-poll-maker-countdown-main-container" class="ays-poll-countdown-main-container-helloween">';
2322 - $content[] = '<div class="ays-poll-countdown-container-helloween">';
2323 - $content[] = '<div id="ays-poll-countdown">';
2324 - $content[] = '<ul>';
2325 - $content[] = '<li><p><span id="ays-poll-countdown-days"></span><span>DAYS</span></p></li>';
2326 - $content[] = '<li><p><span id="ays-poll-countdown-hours"></span><span>HOURS</span></p></li>';
2327 - $content[] = '<li><p><span id="ays-poll-countdown-minutes"></span><span>MINS</span></p></li>';
2328 - $content[] = '<li><p><span id="ays-poll-countdown-seconds"></span><span>SECS</span></p></li>';
2329 - $content[] = '</ul>';
2330 - $content[] = '</div>';
4229 + $generic_error = esc_html__( 'There was an error while performing your request.', $this->plugin_name );
4230 + $type = ! empty( $_POST['type'] ) ? sanitize_key( $_POST['type'] ) : '';
2331 4231
2332 - $content[] = '<div id="ays-poll-countdown-content" class="emoji">';
2333 - $content[] = '<span>🚀</span>';
2334 - $content[] = '<span>⌛</span>';
2335 - $content[] = '<span>🔥</span>';
2336 - $content[] = '<span>💣</span>';
2337 - $content[] = '</div>';
4232 + // Check if new installations are allowed.
4233 + if ( ! self::ays_poll_can_install( $type ) ) {
4234 + wp_send_json_error( $generic_error );
4235 + }
2338 4236
2339 - $content[] = '</div>';
4237 + $error = $type === 'plugin'
4238 + ? esc_html__( 'Could not install the plugin. Please download and install it manually.', $this->plugin_name )
4239 + : "";
2340 4240
2341 - $content[] = '</div>';
2342 -
2343 - $content[] = '</div>';
2344 - $content[] = '<div class="ays-poll-dicount-wrap-box ays-buy-now-button-box-helloween">';
2345 - $content[] = '<a href="https://ays-pro.com/wordpress/poll-maker?utm_source=poll-maker-free&utm_medium=dashboard&utm_campaign=halloween-sale-banner" class="button button-primary ays-buy-now-button-helloween" id="ays-button-top-buy-now-helloween" target="_blank" style="" >' . __( 'Buy Now !', "poll-maker" ) . '</a>';
2346 - $content[] = '</div>';
2347 - $content[] = '</div>';
4241 + $plugin_url = ! empty( $_POST['plugin'] ) ? esc_url_raw( wp_unslash( $_POST['plugin'] ) ) : '';
2348 4242
2349 - $content[] = '</div>';
2350 - $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-poll-dismiss-buttons-container-for-form-helloween">';
2351 - $content[] = '<form action="" method="POST">';
2352 - $content[] = '<div id="ays-poll-dismiss-buttons-content-helloween">';
2353 - if( current_user_can( 'manage_options' ) ){
2354 - $content[] = '<button class="btn btn-link ays-button-helloween" name="ays_poll_sale_btn_halloween_bundle" style="">Dismiss ad</button>';
2355 - $content[] = wp_nonce_field( POLL_MAKER_AYS_NAME . '-sale-banner' , POLL_MAKER_AYS_NAME . '-sale-banner' );
2356 - }
2357 - $content[] = '</div>';
2358 - $content[] = '</form>';
2359 - $content[] = '</div>';
2360 - $content[] = '</div>';
4243 + if ( empty( $plugin_url ) ) {
4244 + wp_send_json_error( $error );
4245 + }
2361 4246
2362 - $content = implode( '', $content );
4247 + // Prepare variables.
4248 + $url = esc_url_raw(
4249 + add_query_arg(
4250 + [
4251 + 'page' => 'poll-maker-ays-featured-plugins',
4252 + ],
4253 + admin_url( 'admin.php' )
4254 + )
4255 + );
2363 4256
2364 - echo $content;
2365 - }
4257 + ob_start();
4258 + $creds = request_filesystem_credentials( $url, '', false, false, null );
2366 4259
2367 - // Christmas banner
2368 - public static function ays_poll_sale_message_christmas_message(){
2369 - $content = array();
4260 + // Hide the filesystem credentials form.
4261 + ob_end_clean();
2370 4262
2371 - $content[] = '<div id="ays-poll-dicount-christmas-month-main" class="notice notice-success is-dismissible ays_poll_dicount_info">';
2372 - $content[] = '<div id="ays-poll-dicount-christmas-month" class="ays_poll_dicount_month">';
2373 - $content[] = '<div class="ays-poll-dicount-christmas-box">';
2374 - $content[] = '<div class="ays-poll-dicount-christmas-wrap-box ays-poll-dicount-christmas-wrap-box-80">';
2375 - $content[] = '<div class="ays-poll-dicount-christmas-title-row">' . __( 'Limited Time', "poll-maker" ) .' '. '<a href="https://ays-pro.com/wordpress/poll-maker" class="ays-poll-dicount-christmas-button-sale" target="_blank">' . __( '20%', "poll-maker" ) . '</a>' . ' SALE</div>';
2376 - $content[] = '<div class="ays-poll-dicount-christmas-title-row">' . __( 'Poll Maker Plugin', "poll-maker" ) . '</div>';
2377 - $content[] = '</div>';
4263 + // Check for file system permissions.
4264 + if ( $creds === false ) {
4265 + wp_send_json_error( $error );
4266 + }
4267 +
4268 + if ( ! WP_Filesystem( $creds ) ) {
4269 + wp_send_json_error( $error );
4270 + }
2378 4271
2379 - $content[] = '<div class="ays-poll-dicount-christmas-wrap-box" style="width: 25%;">';
2380 - $content[] = '<div id="ays-poll-maker-countdown-main-container">';
2381 - $content[] = '<div class="ays-poll-countdown-container">';
2382 - $content[] = '<div id="ays-poll-countdown" style="display: block;">';
2383 - $content[] = '<ul>';
2384 - $content[] = '<li><span id="ays-poll-countdown-days"></span>' . __( 'Days', "poll-maker" ) . '</li>';
2385 - $content[] = '<li><span id="ays-poll-countdown-hours"></span>' . __( 'Hours', "poll-maker" ) . '</li>';
2386 - $content[] = '<li><span id="ays-poll-countdown-minutes"></span>' . __( 'Minutes', "poll-maker" ) . '</li>';
2387 - $content[] = '<li><span id="ays-poll-countdown-seconds"></span>' . __( 'Seconds', "poll-maker" ) . '</li>';
2388 - $content[] = '</ul>';
2389 - $content[] = '</div>';
2390 - $content[] = '<div id="ays-poll-countdown-content" class="emoji" style="display: none;">';
2391 - $content[] = '<span>🚀</span>';
2392 - $content[] = '<span>⌛</span>';
2393 - $content[] = '<span>🔥</span>';
2394 - $content[] = '<span>💣</span>';
2395 - $content[] = '</div>';
2396 - $content[] = '</div>';
2397 - $content[] = '</div>';
2398 - $content[] = '</div>';
4272 + /*
4273 + * We do not need any extra credentials if we have gotten this far, so let's install the plugin.
4274 + */
4275 + require_once POLL_MAKER_AYS_DIR . 'includes/admin/class-poll-maker-upgrader.php';
4276 + require_once POLL_MAKER_AYS_DIR . 'includes/admin/class-poll-maker-install-skin.php';
4277 + require_once POLL_MAKER_AYS_DIR . 'includes/admin/class-poll-maker-skin.php';
2399 4278
2400 - $content[] = '<div class="ays-poll-dicount-christmas-wrap-box" style="width: 25%;">';
2401 - $content[] = '<a href="https://ays-pro.com/wordpress/poll-maker" class="ays-poll-dicount-christmas-button-buy-now" target="_blank">' . __( 'BUY NOW!', "poll-maker" ) . '</a>';
2402 - $content[] = '</div>';
2403 - $content[] = '</div>';
2404 - $content[] = '</div>';
2405 4279
2406 - $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-poll-dismiss-buttons-container-for-form-christmas">';
2407 - $content[] = '<form action="" method="POST">';
2408 - $content[] = '<div id="ays-poll-dismiss-buttons-content-christmas">';
2409 - $content[] = '<button class="btn btn-link ays-button-christmas" name="ays_poll_sale_btn" style="">' . __( 'Dismiss ad', "poll-maker" ) . '</button>';
2410 - $content[] = '</div>';
2411 - $content[] = '</form>';
2412 - $content[] = '</div>';
2413 - $content[] = '</div>';
4280 + // Do not allow WordPress to search/download translations, as this will break JS output.
4281 + remove_action( 'upgrader_process_complete', array( 'Language_Pack_Upgrader', 'async_upgrade' ), 20 );
2414 4282
2415 - $content = implode( '', $content );
4283 + // Create the plugin upgrader with our custom skin.
4284 + $installer = new PollMaker\Helpers\PollMakerPluginSilentUpgrader( new Poll_Maker_Install_Skin() );
2416 4285
2417 - echo $content;
4286 + // Error check.
4287 + if ( ! method_exists( $installer, 'install' ) ) {
4288 + wp_send_json_error( $error );
4289 + }
4290 +
4291 + $installer->install( $plugin_url );
4292 +
4293 + // Flush the cache and return the newly installed plugin basename.
4294 + wp_cache_flush();
4295 +
4296 + $plugin_basename = $installer->plugin_info();
4297 +
4298 + if ( empty( $plugin_basename ) ) {
4299 + wp_send_json_error( $error );
4300 + }
4301 +
4302 + $result = array(
4303 + 'msg' => $generic_error,
4304 + 'is_activated' => false,
4305 + 'basename' => $plugin_basename,
4306 + );
4307 +
4308 + // Check for permissions.
4309 + if ( ! current_user_can( 'activate_plugins' ) ) {
4310 + $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed.', $this->plugin_name ) : "";
4311 +
4312 + wp_send_json_success( $result );
4313 + }
4314 +
4315 + // Activate the plugin silently.
4316 + $activated = activate_plugin( $plugin_basename );
4317 + remove_action( 'activated_plugin', array( 'gallery_p_gallery_activation_redirect_method', 'ays_sccp_activation_redirect_method' ), 100 );
4318 +
4319 + if ( ! is_wp_error( $activated ) ) {
4320 +
4321 + $result['is_activated'] = true;
4322 + $result['msg'] = $type === 'plugin' ? esc_html__( 'Plugin installed and activated.', $this->plugin_name ) : esc_html__( 'Addon installed and activated.', $this->plugin_name );
4323 +
4324 + wp_send_json_success( $result );
4325 + }
4326 +
4327 + // Fallback error just in case.
4328 + wp_send_json_error( $result );
2418 4329 }
2419 4330
2420 - /**
2421 - * Recursive sanitation for an array
2422 - *
2423 - * @param $array
4331 + /**
4332 + * List of AM plugins that we propose to install.
2424 4333 *
2425 - * @return mixed
4334 + * @since 1.3.9
4335 + *
4336 + * @return array
2426 4337 */
2427 - public static function recursive_sanitize_text_field($array) {
2428 - foreach ( $array as $key => &$value ) {
2429 - if ( is_array( $value ) ) {
2430 - $value = self::recursive_sanitize_text_field($value);
4338 + protected function poll_get_am_plugins() {
4339 + if ( !isset( $_SESSION ) ) {
4340 + session_start();
4341 + }
4342 +
4343 + $images_url = POLL_MAKER_AYS_ADMIN_URL . '/images/icons/';
4344 +
4345 + $plugin_slug = array(
4346 + 'fox-lms',
4347 + 'quiz-maker',
4348 + 'survey-maker',
4349 + 'ays-popup-box',
4350 + 'gallery-photo-gallery',
4351 + 'secure-copy-content-protection',
4352 + 'personal-dictionary',
4353 + 'chart-builder',
4354 + 'easy-form',
4355 + );
4356 +
4357 + $plugin_url_arr = array();
4358 + foreach ($plugin_slug as $key => $slug) {
4359 + if ( isset( $_SESSION['ays_poll_our_product_links'] ) && !empty( $_SESSION['ays_poll_our_product_links'] )
4360 + && isset( $_SESSION['ays_poll_our_product_links'][$slug] ) && !empty( $_SESSION['ays_poll_our_product_links'][$slug] ) ) {
4361 + $plugin_url = (isset( $_SESSION['ays_poll_our_product_links'][$slug] ) && $_SESSION['ays_poll_our_product_links'][$slug] != "") ? esc_url( $_SESSION['ays_poll_our_product_links'][$slug] ) : "";
2431 4362 } else {
2432 - $value = sanitize_text_field( $value );
4363 + $latest_version = $this->ays_poll_get_latest_plugin_version($slug);
4364 + $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.zip';
4365 + if ( $latest_version != '' ) {
4366 + $plugin_url = 'https://downloads.wordpress.org/plugin/'. $slug .'.'. $latest_version .'.zip';
4367 + $_SESSION['ays_poll_our_product_links'][$slug] = $plugin_url;
4368 + }
2433 4369 }
2434 - }
2435 - return $array;
4370 +
4371 + $plugin_url_arr[$slug] = $plugin_url;
4372 + }
4373 +
4374 + $plugins_array = array(
4375 + 'fox-lms/fox-lms.php' => array(
4376 + 'icon' => $images_url . 'icon-fox-lms-128x128.png',
4377 + 'name' => __( 'Fox LMS', 'poll-maker' ),
4378 + 'desc' => __( 'Build and manage online courses directly on your WordPress site.', 'poll-maker' ),
4379 + 'desc_hidden' => __( 'With the FoxLMS plugin, you can create, sell, and organize courses, lessons, and quizzes, transforming your website into a dynamic e-learning platform.', 'poll-maker' ),
4380 + 'wporg' => 'https://wordpress.org/plugins/fox-lms/',
4381 + 'buy_now' => 'https://foxlms.com/pricing/?utm_source=dashboard&utm_medium=poll-free&utm_campaign=fox-lms-our-products-page',
4382 + 'url' => $plugin_url_arr['fox-lms'],
4383 + ),
4384 + 'quiz-maker/quiz-maker.php' => array(
4385 + 'icon' => $images_url . 'icon-quiz-128x128.png',
4386 + 'name' => __( 'Quiz Maker', 'poll-maker' ),
4387 + 'desc' => __( 'With our Quiz Maker plugin it’s easy to make a quiz in a short time.', 'poll-maker' ),
4388 + 'desc_hidden' => __( 'You to add images to your quiz, order unlimited questions. Also you can style your quiz to satisfy your visitors.', 'poll-maker' ),
4389 + 'wporg' => 'https://wordpress.org/plugins/quiz-maker/',
4390 + 'buy_now' => 'https://ays-pro.com/wordpress/quiz-maker/',
4391 + 'url' => $plugin_url_arr['quiz-maker'],
4392 + ),
4393 + 'survey-maker/survey-maker.php' => array(
4394 + 'icon' => $images_url . 'icon-survey-128x128.png',
4395 + 'name' => __( 'Survey Maker', 'poll-maker' ),
4396 + 'desc' => __( 'Make amazing online surveys and get real-time feedback quickly and easily.', 'poll-maker' ),
4397 + 'desc_hidden' => __( 'Learn what your website visitors want, need, and expect with the help of Survey Maker. Build surveys without limiting your needs.', 'poll-maker' ),
4398 + 'wporg' => 'https://wordpress.org/plugins/survey-maker/',
4399 + 'buy_now' => 'https://ays-pro.com/wordpress/survey-maker',
4400 + 'url' => $plugin_url_arr['survey-maker'],
4401 + ),
4402 + 'ays-popup-box/ays-pb.php' => array(
4403 + 'icon' => $images_url . 'icon-popup-128x128.png',
4404 + 'name' => __( 'Popup Box', 'poll-maker' ),
4405 + 'desc' => __( 'Popup everything you want! Create informative and promotional popups all in one plugin.', 'poll-maker' ),
4406 + 'desc_hidden' => __( 'Attract your visitors and convert them into email subscribers and paying customers.', 'poll-maker' ),
4407 + 'wporg' => 'https://wordpress.org/plugins/ays-popup-box/',
4408 + 'buy_now' => 'https://ays-pro.com/wordpress/popup-box/',
4409 + 'url' => $plugin_url_arr['ays-popup-box'],
4410 + ),
4411 + 'gallery-photo-gallery/gallery-photo-gallery.php' => array(
4412 + 'icon' => $images_url . 'icon-gallery-128x128.png',
4413 + 'name' => __( 'Gallery Photo Gallery', 'poll-maker' ),
4414 + 'desc' => __( 'Create unlimited galleries and include unlimited images in those galleries.', 'poll-maker' ),
4415 + 'desc_hidden' => __( 'Represent images in an attractive way. Attract people with your own single and multiple free galleries from your photo library.', 'poll-maker' ),
4416 + 'wporg' => 'https://wordpress.org/plugins/gallery-photo-gallery/',
4417 + 'buy_now' => 'https://ays-pro.com/wordpress/photo-gallery/',
4418 + 'url' => $plugin_url_arr['gallery-photo-gallery'],
4419 + ),
4420 + 'secure-copy-content-protection/secure-copy-content-protection.php' => array(
4421 + 'icon' => $images_url . 'icon-sccp-128x128.png',
4422 + 'name' => __( 'Secure Copy Content Protection', 'poll-maker' ),
4423 + 'desc' => __( 'Disable the right click, copy paste, content selection and copy shortcut keys on your website.', 'poll-maker' ),
4424 + 'desc_hidden' => __( 'Protect web content from being plagiarized. Prevent plagiarism from your website with this easy to use plugin.', 'poll-maker' ),
4425 + 'wporg' => 'https://wordpress.org/plugins/secure-copy-content-protection/',
4426 + 'buy_now' => 'https://ays-pro.com/wordpress/secure-copy-content-protection/',
4427 + 'url' => $plugin_url_arr['secure-copy-content-protection'],
4428 + ),
4429 + 'personal-dictionary/personal-dictionary.php' => array(
4430 + 'icon' => $images_url . 'pd-logo-128x128.png',
4431 + 'name' => __( 'Personal Dictionary', 'poll-maker' ),
4432 + 'desc' => __( 'Allow your students to create personal dictionary, study and memorize the words.', 'poll-maker' ),
4433 + 'desc_hidden' => __( 'Allow your users to create their own digital dictionaries and learn new words and terms as fastest as possible.', 'poll-maker' ),
4434 + 'wporg' => 'https://wordpress.org/plugins/personal-dictionary/',
4435 + 'buy_now' => 'https://ays-pro.com/wordpress/personal-dictionary/',
4436 + 'url' => $plugin_url_arr['personal-dictionary'],
4437 + ),
4438 + 'chart-builder/chart-builder.php' => array(
4439 + 'icon' => $images_url . 'chartify-150x150.png',
4440 + 'name' => __( 'Chart Builder', 'poll-maker' ),
4441 + 'desc' => __( 'Chart Builder plugin allows you to create beautiful charts', 'poll-maker' ),
4442 + 'desc_hidden' => __( ' and graphs easily and quickly.', 'poll-maker' ),
4443 + 'wporg' => 'https://wordpress.org/plugins/chart-builder/',
4444 + 'buy_now' => 'https://ays-pro.com/wordpress/chart-builder/',
4445 + 'url' => $plugin_url_arr['chart-builder'],
4446 + ),
4447 + 'easy-form/easy-form.php' => array(
4448 + 'icon' => $images_url . 'easyform-150x150.png',
4449 + 'name' => __( 'Easy Form', 'poll-maker' ),
4450 + 'desc' => __( 'Choose the best WordPress form builder plugin. ', 'poll-maker' ),
4451 + 'desc_hidden' => __( 'Create contact forms, payment forms, surveys, and many more custom forms. Build forms easily with us.', 'poll-maker' ),
4452 + 'wporg' => 'https://wordpress.org/plugins/easy-form/',
4453 + 'buy_now' => 'https://ays-pro.com/wordpress/easy-form',
4454 + 'url' => $plugin_url_arr['easy-form'],
4455 + ),
4456 + );
4457 +
4458 + return $plugins_array;
2436 4459 }
2437 4460
2438 - public static function get_max_id( $table ) {
2439 - global $wpdb;
2440 - $db_table = $wpdb->prefix . 'ayspoll_'.$table;;
4461 + protected function ays_poll_get_latest_plugin_version( $slug ){
2441 4462
2442 - $sql = "SELECT MAX(id) FROM {$db_table}";
4463 + if ( is_null( $slug ) || empty($slug) ) {
4464 + return "";
4465 + }
2443 4466
2444 - $result = intval( $wpdb->get_var( $sql ) );
4467 + $version_latest = "";
2445 4468
2446 - return $result;
4469 + if ( ! function_exists( 'plugins_api' ) ) {
4470 + require_once( ABSPATH . 'wp-admin/includes/plugin-install.php' );
4471 + }
4472 +
4473 + // set the arguments to get latest info from repository via API ##
4474 + $args = array(
4475 + 'slug' => $slug,
4476 + 'fields' => array(
4477 + 'version' => true,
4478 + )
4479 + );
4480 +
4481 + /** Prepare our query */
4482 + $call_api = plugins_api( 'plugin_information', $args );
4483 +
4484 + /** Check for Errors & Display the results */
4485 + if ( is_wp_error( $call_api ) ) {
4486 + $api_error = $call_api->get_error_message();
4487 + } else {
4488 +
4489 + //echo $call_api; // everything ##
4490 + if ( ! empty( $call_api->version ) ) {
4491 + $version_latest = $call_api->version;
4492 + }
4493 + }
4494 +
4495 + return $version_latest;
2447 4496 }
2448 4497
2449 - public function ays_poll_generate_message_vars_html( $poll_message_vars ) {
2450 - $content = array();
2451 - $var_counter = 0;
4498 + /**
4499 + * Get AM plugin data to display in the Addons section of About tab.
4500 + *
4501 + * @since 6.4.0.4
4502 + *
4503 + * @param string $plugin Plugin slug.
4504 + * @param array $details Plugin details.
4505 + * @param array $all_plugins List of all plugins.
4506 + *
4507 + * @return array
4508 + */
4509 + protected function poll_get_plugin_data( $plugin, $details, $all_plugins ) {
2452 4510
2453 - $content[] = '<div class="ays-poll-message-vars-box">';
2454 - $content[] = '<div class="ays-poll-message-vars-icon">';
2455 - $content[] = '<div>';
2456 - $content[] = '<i class="ays_poll_fa ays_fa_link"></i>';
2457 - $content[] = '</div>';
2458 - $content[] = '<div>';
2459 - $content[] = '<span>'. __("Message Variables" , "poll-maker") .'</span>';
2460 - $content[] = '<a class="ays_help" data-toggle="tooltip" data-html="true" title="'. __("Insert your preferred message variable into the editor by clicking." , "poll-maker") .'">';
2461 - $content[] = '<i class="fas fa-info-circle"></i>';
2462 - $content[] = '</a>';
2463 - $content[] = '</div>';
2464 - $content[] = '</div>';
2465 - $content[] = '<div class="ays-poll-message-vars-data">';
2466 - foreach($poll_message_vars as $var => $var_name){
2467 - $var_counter++;
2468 - $content[] = '<label class="ays-poll-message-vars-each-data-label">';
2469 - $content[] = '<input type="radio" class="ays-poll-message-vars-each-data-checker" hidden id="ays_poll_message_var_count_'. $var_counter .'" name="ays_poll_message_var_count">';
2470 - $content[] = '<div class="ays-poll-message-vars-each-data">';
2471 - $content[] = '<input type="hidden" class="ays-poll-message-vars-each-var" value="'. $var .'">';
2472 - $content[] = '<span>'. $var_name .'</span>';
2473 - $content[] = '</div>';
2474 - $content[] = '</label>';
4511 + $have_pro = ( ! empty( $details['pro'] ) && ! empty( $details['pro']['plug'] ) );
4512 + $show_pro = false;
4513 +
4514 + $plugin_data = array();
4515 +
4516 + if ( $have_pro ) {
4517 + if ( array_key_exists( $plugin, $all_plugins ) ) {
4518 + if ( is_plugin_active( $plugin ) ) {
4519 + $show_pro = true;
2475 4520 }
2476 - $content[] = '</div>';
2477 - $content[] = '</div>';
4521 + }
4522 + if ( array_key_exists( $details['pro']['plug'], $all_plugins ) ) {
4523 + $show_pro = true;
4524 + }
4525 + if ( $show_pro ) {
4526 + $plugin = $details['pro']['plug'];
4527 + $details = $details['pro'];
4528 + }
4529 + }
2478 4530
2479 - $content = implode( '', $content );
4531 + if ( array_key_exists( $plugin, $all_plugins ) ) {
4532 + if ( is_plugin_active( $plugin ) ) {
4533 + // Status text/status.
4534 + $plugin_data['status_class'] = 'status-active';
4535 + $plugin_data['status_text'] = esc_html__( 'Active', 'poll-maker' );
4536 + // Button text/status.
4537 + $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-poll-card__btn-info disabled';
4538 + $plugin_data['action_text'] = esc_html__( 'Activated', 'poll-maker' );
4539 + $plugin_data['plugin_src'] = esc_attr( $plugin );
4540 + } else {
4541 + // Status text/status.
4542 + $plugin_data['status_class'] = 'status-installed';
4543 + $plugin_data['status_text'] = esc_html__( 'Inactive', 'poll-maker' );
4544 + // Button text/status.
4545 + $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-poll-card__btn-info';
4546 + $plugin_data['action_text'] = esc_html__( 'Activate', 'poll-maker' );
4547 + $plugin_data['plugin_src'] = esc_attr( $plugin );
4548 + }
4549 + } else {
4550 + // Doesn't exist, install.
4551 + // Status text/status.
4552 + $plugin_data['status_class'] = 'status-missing';
2480 4553
2481 - return $content;
4554 + if ( isset( $details['act'] ) && 'go-to-url' === $details['act'] ) {
4555 + $plugin_data['status_class'] = 'status-go-to-url';
4556 + }
4557 + $plugin_data['status_text'] = esc_html__( 'Not Installed', 'poll-maker' );
4558 + // Button text/status.
4559 + $plugin_data['action_class'] = $plugin_data['status_class'] . ' ays-poll-card__btn-info';
4560 + $plugin_data['action_text'] = esc_html__( 'Install Plugin', 'poll-maker' );
4561 + $plugin_data['plugin_src'] = esc_url( $details['url'] );
4562 + }
4563 +
4564 + $plugin_data['details'] = $details;
4565 +
4566 + return $plugin_data;
2482 4567 }
2483 4568
4569 + /**
4570 + * Display the Addons section of About tab.
4571 + *
4572 + * @since 1.3.9
4573 + */
4574 + public function poll_output_about_addons() {
4575 +
4576 + if ( ! function_exists( 'get_plugins' ) ) {
4577 + require_once ABSPATH . 'wp-admin/includes/plugin.php';
4578 + }
4579 +
4580 + $all_plugins = get_plugins();
4581 + $am_plugins = $this->poll_get_am_plugins();
4582 + $can_install_plugins = self::ays_poll_can_install( 'plugin' );
4583 + $can_activate_plugins = self::ays_poll_can_activate( 'plugin' );
4584 +
4585 + $content = '';
4586 + $content.= '<div class="ays-poll-cards-block">';
4587 + foreach ( $am_plugins as $plugin => $details ){
4588 +
4589 + $plugin_data = $this->poll_get_plugin_data( $plugin, $details, $all_plugins );
4590 + $plugin_ready_to_activate = $can_activate_plugins
4591 + && isset( $plugin_data['status_class'] )
4592 + && $plugin_data['status_class'] === 'status-installed';
4593 + $plugin_not_activated = ! isset( $plugin_data['status_class'] )
4594 + || $plugin_data['status_class'] !== 'status-active';
4595 +
4596 + $plugin_action_class = ( isset( $plugin_data['action_class'] ) && esc_attr( $plugin_data['action_class'] ) != "" ) ? esc_attr( $plugin_data['action_class'] ) : "";
4597 +
4598 + $plugin_action_class_disbaled = "";
4599 + if ( strpos($plugin_action_class, 'status-active') !== false ) {
4600 + $plugin_action_class_disbaled = "disbaled='true'";
4601 + }
4602 +
4603 + $content .= '
4604 + <div class="ays-poll-card">
4605 + <div class="ays-poll-card__content flexible">
4606 + <div class="ays-poll-card__content-img-box">
4607 + <img class="ays-poll-card__img" src="'. esc_url( $plugin_data['details']['icon'] ) .'" alt="'. esc_attr( $plugin_data['details']['name'] ) .'">
4608 + </div>
4609 + <div class="ays-poll-card__text-block">
4610 + <h5 class="ays-poll-card__title">'. esc_html( $plugin_data['details']['name'] ) .'</h5>
4611 + <p class="ays-poll-card__text">'. wp_kses_post( $plugin_data['details']['desc'] ) .'
4612 + <span class="ays-poll-card__text-hidden">
4613 + '. wp_kses_post( $plugin_data['details']['desc_hidden'] ) .'
4614 + </span>
4615 + </p>
4616 + </div>
4617 + </div>
4618 + <div class="ays-poll-card__footer">';
4619 + if ( $can_install_plugins || $plugin_ready_to_activate || ! $details['wporg'] ) {
4620 + $content .= '<button class="'. esc_attr( $plugin_data['action_class'] ) .'" data-plugin="'. esc_attr( $plugin_data['plugin_src'] ) .'" data-type="plugin" '. $plugin_action_class_disbaled .'>
4621 + '. wp_kses_post( $plugin_data['action_text'] ) .'
4622 + </button>';
4623 + }
4624 + elseif ( $plugin_not_activated ) {
4625 + $content .= '<a href="'. esc_url( $details['wporg'] ) .'" target="_blank" rel="noopener noreferrer">
4626 + '. esc_html_e( 'WordPress.org', $this->plugin_name ) .'
4627 + <span aria-hidden="true" class="dashicons dashicons-external"></span>
4628 + </a>';
4629 + }
4630 + $content .='
4631 + <a target="_blank" href="'. esc_url( $plugin_data['details']['buy_now'] ) .'" class="ays-poll-card__btn-primary">'. __('Buy Now', 'poll-maker') .'</a>
4632 + </div>
4633 + </div>';
4634 + }
4635 + $install_plugin_nonce = wp_create_nonce( $this->plugin_name . '-install-plugin-nonce' );
4636 + $content .= '<input type="hidden" id="ays_poll_ajax_install_plugin_nonce" name="ays_poll_ajax_install_plugin_nonce" value="'. $install_plugin_nonce .'">';
4637 + $content .= '</div>';
4638 +
4639 + echo $content;
4640 + }
4641 +
2484 4642 public function ays_poll_update_banner_time(){
2485 4643
2486 4644 $date = time() + ( 3 * 24 * 60 * 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS);
2487 4645 // $date = time() + ( 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS); // for testing | 1 min
@@ -2632,9 +4790,11 @@
2632 4790 "linkedin_link" => "",
2633 4791 "facebook_link" => "",
2634 4792 "twitter_link" => "",
2635 4793 "vkontakte_link" => "",
2636 - "youtube_link" => ""
4794 + "youtube_link" => "",
4795 + "tiktok_link" => "",
4796 + "instagram_link" => ""
2637 4797 ),
2638 4798 "load_effect" => "load_gif",
2639 4799 "load_gif" => "plg_pro1",
2640 4800 "custom_load" => false,
@@ -2681,23 +4841,23 @@
2681 4841 "ays_show_timer_type" => "countdown",
2682 4842 "show_login_form" => "off",
2683 4843 "poll_allow_answer" => 0,
2684 4844 "poll_allow_answer_require" => 1,
2685 - "versus_icon_type" => "default",
2686 - "versus_icon_position" => "center",
2687 - "versus_answers_label" => 0,
2688 - "result_in_rgba" => $res_rgba,
2689 - "enable_mailchimp" => "off",
2690 - "enable_background_gradient" => "off",
2691 - "background_gradient_color_1" => "#103251",
2692 - "background_gradient_color_2" => "#607593",
2693 - "poll_gradient_direction" => "vertical",
2694 - "redirect_after_submit" => 0,
2695 - "mailchimp_list" => "",
2696 - "poll_direction" => "ltr",
2697 - "poll_allow_multivote" => $allow_multivote,
2698 - "multivote_answer_min_count" => $multivote_min_count,
2699 - "poll_allow_multivote_count" => $multivote_max_count,
4845 + "versus_icon_type" => "default",
4846 + "versus_icon_position" => "center",
4847 + "versus_answers_label" => 0,
4848 + "result_in_rgba" => $res_rgba,
4849 + "enable_mailchimp" => "off",
4850 + "enable_background_gradient" => "off",
4851 + "background_gradient_color_1" => "#103251",
4852 + "background_gradient_color_2" => "#607593",
4853 + "poll_gradient_direction" => "vertical",
4854 + "redirect_after_submit" => 0,
4855 + "mailchimp_list" => "",
4856 + "poll_direction" => "ltr",
4857 + "poll_allow_multivote" => $allow_multivote,
4858 + "multivote_answer_min_count" => $multivote_min_count,
4859 + "poll_allow_multivote_count" => $multivote_max_count,
2700 4860 "monitor_list" => "",
2701 4861 "enable_monitor" => "off",
2702 4862 "slack_conversation" => "",
2703 4863 "enable_slack" => "off",
@@ -2756,9 +4916,8 @@
2756 4916 "poll_send_mail_type" => "custom",
2757 4917 "poll_sendgrid_email_from" => "",
2758 4918 "poll_sendgrid_email_name" => "",
2759 4919 "poll_sendgrid_template_id" => "",
2760 - "enable_limit_by_country" => "off",
2761 4920 "limit_country" => "AD",
2762 4921 "show_votes_before_voting" => "off",
2763 4922 "show_votes_before_voting_by" => "by_count",
2764 4923 "fake_votes" => "off",
@@ -2776,10 +4935,13 @@
2776 4935 "poll_question_image_height" => "",
2777 4936 "poll_mobile_max_width" => "",
2778 4937 "poll_title_font_size" => "18",
2779 4938 "poll_title_font_size_mobile" => "20",
4939 + "poll_title_font_weight" => "normal",
4940 + "poll_title_font_weight_mobile" => "normal",
2780 4941 "poll_title_alignment" => "center",
2781 4942 "poll_title_alignment_mobile" => "center",
4943 + "poll_title_text_transform" => "none",
2782 4944 "poll_enable_answer_image_after_voting" => "off",
2783 4945 "poll_text_type_length_enable" => "off",
2784 4946 "poll_text_type_limit_type" => "characters",
2785 4947 "poll_text_type_limit_length" => "",
@@ -2851,12 +5013,214 @@
2851 5013 "show_user_added" => 1,
2852 5014 ));
2853 5015 }
2854 5016
5017 + $post_type_args = array(
5018 + 'poll_id' => $poll_id,
5019 + 'author_id' => !empty($user->ID) ? $user->ID : get_current_user_id(),
5020 + 'poll_title' => $poll_title,
5021 + );
5022 +
5023 + $custom_post_id = Poll_Maker_Custom_Post_Type::ays_poll_add_custom_post($post_type_args);
5024 +
5025 + $preview_url = "#";
5026 + if(!empty($custom_post_id)){
5027 + $custom_post_url = array(
5028 + 'post_type' => 'ays-poll-maker',
5029 + 'p' => $custom_post_id,
5030 + 'preview' => 'true',
5031 + );
5032 + $custom_post_url_ready = http_build_query($custom_post_url);
5033 + $preview_url = get_home_url();
5034 + $preview_url .= '/?' . $custom_post_url_ready;
5035 + }
5036 +
2855 5037 echo json_encode(array(
2856 5038 'status' => true,
2857 - 'poll_id' => $poll_id
5039 + 'poll_id' => $poll_id,
5040 + 'preview_url' => $preview_url,
2858 5041 ));
2859 5042 wp_die();
2860 5043 }
5044 +
5045 + public function ays_poll_black_friady_popup_box(){
5046 +
5047 + if(!empty($_REQUEST['page']) && sanitize_text_field( $_REQUEST['page'] ) != $this->plugin_name . "-dashboard"){
5048 + if(false !== strpos( sanitize_text_field( $_REQUEST['page'] ), $this->plugin_name)){
5049 +
5050 + $flag = true;
5051 +
5052 + if( isset($_COOKIE['aysPollBlackFridayPopupCount']) && intval($_COOKIE['aysPollBlackFridayPopupCount']) >= 2 ){
5053 + $flag = false;
5054 + }
5055 +
5056 + $ays_poll_cta_button_link = esc_url('https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=poll-free&utm_campaign=mega-bundle-popup-black-friday-sale-' . POLL_MAKER_AYS_VERSION);
5057 +
5058 + if( $flag ){
5059 + ?>
5060 + <div class="ays-poll-black-friday-popup-overlay" style="opacity: 0; visibility: hidden; display: none;">
5061 + <div class="ays-poll-black-friday-popup-dialog">
5062 + <div class="ays-poll-black-friday-popup-content">
5063 + <div class="ays-poll-black-friday-popup-background-pattern">
5064 + <div class="ays-poll-black-friday-popup-pattern-row">
5065 + <div class="ays-poll-black-friday-popup-pattern-text">SALE SALE SALE</div>
5066 + <div class="ays-poll-black-friday-popup-pattern-text">SALE SALE SALE</div>
5067 + </div>
5068 + <div class="ays-poll-black-friday-popup-pattern-row">
5069 + <div class="ays-poll-black-friday-popup-pattern-text">SALE SALE SALE</div>
5070 + <div class="ays-poll-black-friday-popup-pattern-text">SALE SALE SALE</div>
5071 + </div>
5072 + <div class="ays-poll-black-friday-popup-pattern-row">
5073 + <div class="ays-poll-black-friday-popup-pattern-text">SALE SALE SALE</div>
5074 + <div class="ays-poll-black-friday-popup-pattern-text">SALE SALE SALE</div>
5075 + </div>
5076 + <div class="ays-poll-black-friday-popup-pattern-row">
5077 + <div class="ays-poll-black-friday-popup-pattern-text">SALE SALE SALE</div>
5078 + <div class="ays-poll-black-friday-popup-pattern-text">SALE SALE SALE</div>
5079 + </div>
5080 + </div>
5081 +
5082 + <button class="ays-poll-black-friday-popup-close" aria-label="Close">
5083 + <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">
5084 + <path d="M18 6 6 18"></path>
5085 + <path d="m6 6 12 12"></path>
5086 + </svg>
5087 + </button>
5088 +
5089 + <div class="ays-poll-black-friday-popup-badge">
5090 + <div class="ays-poll-black-friday-popup-badge-content">
5091 + <div class="ays-poll-black-friday-popup-badge-text-sm"><?php echo esc_html__( 'Up to', 'poll-maker' ); ?></div>
5092 + <div class="ays-poll-black-friday-popup-badge-text-lg">50%</div>
5093 + <div class="ays-poll-black-friday-popup-badge-text-md"><?php echo esc_html__( 'OFF', 'poll-maker' ); ?></div>
5094 + </div>
5095 + </div>
5096 +
5097 + <div class="ays-poll-black-friday-popup-main-content">
5098 + <div class="ays-poll-black-friday-popup-hashtag"><?php echo esc_html__( '#BLACKFRIDAY', 'poll-maker' ); ?></div>
5099 + <h1 class="ays-poll-black-friday-popup-title-mega"><?php echo esc_html__( 'MEGA', 'poll-maker' ); ?></h1>
5100 + <h1 class="ays-poll-black-friday-popup-title-bundle"><?php echo esc_html__( 'BUNDLE', 'poll-maker' ); ?></h1>
5101 + <div class="ays-poll-black-friday-popup-offer-label">
5102 + <h2 class="ays-poll-black-friday-popup-offer-text"><?php echo esc_html__( 'BLACK FRIDAY OFFER', 'poll-maker' ); ?></h2>
5103 + </div>
5104 + <p class="ays-poll-black-friday-popup-description"><?php echo esc_html__( 'Get our exclusive plugins in one bundle', 'poll-maker' ); ?></p>
5105 + <a href="<?php echo esc_url($ays_poll_cta_button_link); ?>" target="_blank" class="ays-poll-black-friday-popup-cta-btn"><?php echo esc_html__( 'Get Mega Bundle', 'poll-maker' ); ?></a>
5106 + </div>
5107 + </div>
5108 + </div>
5109 + </div>
5110 + <script type="text/javascript">
5111 + (function() {
5112 + var overlay = document.querySelector('.ays-poll-black-friday-popup-overlay');
5113 + var closeBtn = document.querySelector('.ays-poll-black-friday-popup-close');
5114 + var learnMoreBtn = document.querySelector('.ays-poll-black-friday-popup-learn-more');
5115 + var ctaBtn = document.querySelector('.ays-poll-black-friday-popup-cta-btn');
5116 +
5117 + // Cookie helper functions
5118 + function setCookie(name, value, days) {
5119 + var expires = "";
5120 + if (days) {
5121 + var date = new Date();
5122 + date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
5123 + expires = "; expires=" + date.toUTCString();
5124 + }
5125 + document.cookie = name + "=" + (value || "") + expires + "; path=/";
5126 + }
5127 +
5128 + function getCookie(name) {
5129 + var nameEQ = name + "=";
5130 + var ca = document.cookie.split(';');
5131 + for (var i = 0; i < ca.length; i++) {
5132 + var c = ca[i];
5133 + while (c.charAt(0) == ' ') c = c.substring(1, c.length);
5134 + if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length);
5135 + }
5136 + return null;
5137 + }
5138 +
5139 + // Get current show count from cookie
5140 + var showCount = parseInt(getCookie('aysPollBlackFridayPopupCount') || '0', 10);
5141 + var maxShows = 2;
5142 +
5143 + // Show popup function
5144 + function showPopup() {
5145 + if (overlay && showCount < maxShows) {
5146 + overlay.classList.add('ays-poll-black-friday-popup-active');
5147 + showCount++;
5148 + // Update cookie with new count (expires in 30 days)
5149 + setCookie('aysPollBlackFridayPopupCount', showCount.toString(), 30);
5150 + }
5151 + }
5152 +
5153 + // Close popup function
5154 + function closePopup(e) {
5155 + if (e) {
5156 + e.preventDefault();
5157 + e.stopPropagation();
5158 + }
5159 + if (overlay) {
5160 + overlay.classList.remove('ays-poll-black-friday-popup-active');
5161 + }
5162 + }
5163 +
5164 + // Determine timing based on show count
5165 + if (showCount === 0) {
5166 + // First time - show after 30 seconds
5167 + setTimeout(function() {
5168 + showPopup();
5169 + }, 30000);
5170 + } else if (showCount === 1) {
5171 + // Second time - show after 200 seconds
5172 + setTimeout(function() {
5173 + showPopup();
5174 + }, 200000);
5175 + }
5176 + // If showCount >= 2, don't show popup at all
5177 +
5178 + // Close button
5179 + if (closeBtn) {
5180 + closeBtn.addEventListener('click', function(e) {
5181 + closePopup(e);
5182 + });
5183 + }
5184 +
5185 + // Learn more button
5186 + if (learnMoreBtn) {
5187 + learnMoreBtn.addEventListener('click', function(e) {
5188 + closePopup(e);
5189 + });
5190 + }
5191 +
5192 + // CTA button (optional - if you want it to close popup too)
5193 + if (ctaBtn) {
5194 + ctaBtn.addEventListener('click', function(e) {
5195 + // You can add redirect logic here if needed
5196 + // window.location.href = 'your-url';
5197 + });
5198 + }
5199 +
5200 + // Close on overlay click
5201 + if (overlay) {
5202 + overlay.addEventListener('click', function(e) {
5203 + if (e.target === overlay) {
5204 + closePopup(e);
5205 + }
5206 + });
5207 + }
5208 +
5209 + // Close on Escape key
5210 + document.addEventListener('keydown', function(e) {
5211 + if (e.key === 'Escape' && overlay && overlay.classList.contains('ays-poll-black-friday-popup-active')) {
5212 + closePopup();
5213 + }
5214 + });
5215 + })();
5216 + </script>
5217 + <style>
5218 + .ays-poll-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-poll-black-friday-popup-overlay.ays-poll-black-friday-popup-active{display:flex!important;opacity:1!important;visibility:visible!important}.ays-poll-black-friday-popup-overlay .ays-poll-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-poll-black-friday-popup-overlay.ays-poll-black-friday-popup-active .ays-poll-black-friday-popup-dialog{transform:scale(1)}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-content{position:relative;width:470px;height:410px;background:linear-gradient(to right bottom,#c056f5,#f042f0,#7d7de8);overflow:hidden}.ays-poll-black-friday-popup-overlay .ays-poll-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-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-pattern-row{display:flex;gap:16px;margin-bottom:16px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-pattern-text{color:#fff;font-weight:900;font-size:96px;white-space:nowrap;line-height:1}.ays-poll-black-friday-popup-overlay .ays-poll-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-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-close:hover,.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-learn-more:hover{color:#fff}.ays-poll-black-friday-popup-overlay .ays-poll-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-poll-black-friday-popup-float}@keyframes ays-poll-black-friday-popup-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-10px)}}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-badge-content{text-align:center}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-badge-text-sm{color:#1a1a1a;font-weight:900;font-size:24px;line-height:1}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-badge-text-lg{color:#1a1a1a;font-weight:900;font-size:30px;line-height:1;margin-top:4px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-badge-text-md{color:#1a1a1a;font-weight:900;font-size:20px;line-height:1}.ays-poll-black-friday-popup-overlay .ays-poll-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-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-hashtag{color:rgba(255,255,255,.9);font-weight:700;font-size:14px;margin-bottom:16px;letter-spacing:.1em}.ays-poll-black-friday-popup-overlay .ays-poll-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-poll-black-friday-popup-overlay .ays-poll-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-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-offer-label{background-color:#000;padding:12px 32px;margin-bottom:24px;display:inline-block}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-offer-text{color:#fff;font-weight:700;font-size:20px;letter-spacing:.05em;margin:0}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-description{color:rgba(255,255,255,.95);font-size:18px;font-weight:500;margin:0 0 32px!important}.ays-poll-black-friday-popup-overlay .ays-poll-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-poll-black-friday-popup-overlay .ays-poll-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-poll-black-friday-popup-overlay .ays-poll-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-poll-black-friday-popup-overlay{display:none!important}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-content{width:90vw;max-width:400px;height:380px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-main-content{padding:0 32px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-badge{width:80px;height:80px;top:24px;right:24px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-badge-text-sm{font-size:20px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-badge-text-lg{font-size:26px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-badge-text-md,.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-offer-text{font-size:18px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-title-bundle,.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-title-mega{font-size:48px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-description{font-size:16px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-pattern-text{font-size:72px}}@media (max-width:480px){.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-content{width:95vw;max-width:340px;height:360px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-main-content{padding:0 24px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-badge{width:70px;height:70px;top:20px;right:20px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-badge-text-sm,.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-offer-text{font-size:16px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-badge-text-lg{font-size:22px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-badge-text-md{font-size:14px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-hashtag{font-size:12px;margin-bottom:12px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-title-bundle,.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-title-mega{font-size:40px;margin-bottom:8px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-offer-label{padding:10px 24px;margin-bottom:20px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-description{font-size:15px;margin-bottom:24px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-cta-btn{font-size:16px;height:44px;padding:0 32px}.ays-poll-black-friday-popup-overlay .ays-poll-black-friday-popup-pattern-text{font-size:60px}}
5219 + </style>
5220 + <?php
5221 + }
5222 + }
5223 + }
5224 + }
2861 5225
2862 5226 }