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 +506 -91 6.3.6 → 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
@@ -251,20 +252,20 @@
251 252 wp_localize_script('ays-poll-admin-js', 'poll', array(
252 253 'ajax' => admin_url('admin-ajax.php'),
253 254 'pleaseEnterMore' =>esc_html__('Please select more', "poll-maker"),
254 255 'urlImg' => (esc_url(POLL_MAKER_AYS_ADMIN_URL) . '/images/'),
255 - "emptyEmailError" => esc_html__( 'Email field is empty', 'poll-maker'),
256 - "invalidEmailError" => esc_html__( 'Invalid Email address', 'poll-maker'),
257 - 'selectUser' => esc_html__( 'Select user', 'poll-maker'),
258 - 'pleaseEnterMore' => esc_html__( "Please enter 1 or more characters", 'poll-maker' ),
259 - 'searching' => esc_html__( "Searching...", 'poll-maker' ),
260 - 'activated' => esc_html__( "Activated", 'poll-maker' ),
261 - 'errorMsg' => esc_html__( "Error", 'poll-maker' ),
262 - 'loadResource' => esc_html__( "Can't load resource.", 'poll-maker' ),
263 - 'somethingWentWrong' => esc_html__( "Maybe something went wrong.", 'poll-maker' ),
264 - 'greateJob' => esc_html__( 'Great job', 'poll-maker'),
265 - 'formMoreDetailed' => esc_html__( 'For more detailed configuration visit', 'poll-maker'),
266 - 'greate' => esc_html__( 'Great!', 'poll-maker'),
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'),
267 268
268 269 ));
269 270
270 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);
@@ -421,12 +422,12 @@
421 422 public function codemirror_enqueue_scripts($hook) {
422 423 if(strpos($hook, $this->plugin_name) !== false){
423 424 if(function_exists('wp_enqueue_code_editor')){
424 425 $cm_settings['codeEditor'] = wp_enqueue_code_editor(array(
425 - 'type' => 'text/css',
426 - 'codemirror' => array(
427 - 'inputStyle' => 'contenteditable',
428 - 'theme' => 'cobalt',
426 + 'type' => 'text/css',
427 + 'codemirror' => array(
428 + 'inputStyle' => 'contenteditable',
429 + 'theme' => 'cobalt',
429 430 )
430 431 ));
431 432
432 433 wp_enqueue_script('wp-theme-plugin-editor');
@@ -454,17 +455,30 @@
454 455 }
455 456
456 457 public function add_plugin_admin_menu() {
457 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 +
458 480 /*
459 - * Check unread results
460 - *
461 - */
462 - global $wpdb;
463 - $sql = "SELECT COUNT(unread) FROM {$wpdb->prefix}ayspoll_reports WHERE unread=1";
464 - $unread_results = $wpdb->get_var($sql);
465 - $show = $unread_results > 0 ? '' : "apm-no-results";
466 - /*
467 481 * Add a settings page for this plugin to the Settings menu.
468 482 *
469 483 * NOTE: Alternative menu locations are available via WordPress administration menu functions.
470 484 *
@@ -471,10 +485,8 @@
471 485 * Administration Menus: http://codex.wordpress.org/Administration_Menus
472 486 *
473 487 */
474 488
475 - $menu_item = ($unread_results == 0) ? 'Poll Maker' : 'Poll Maker' . '<span style="margin-right: 10px;" class="apm-badge badge badge-danger '.$show.'">' . $unread_results . '</span>';
476 -
477 489 $this->capability = $this->poll_maker_capabilities();
478 490 $capability = $this->poll_maker_capabilities();
479 491 $hook_poll = add_menu_page(
480 492 'Poll Maker',
@@ -482,9 +494,9 @@
482 494 $capability,
483 495 $this->plugin_name,
484 496 array($this,'display_plugin_polls_page'),
485 497 esc_url(POLL_MAKER_AYS_ADMIN_URL) . '/images/icons/icon-poll-maker-128x128.svg',
486 - '6.33'
498 + '25.20'
487 499 );
488 500
489 501 add_action("load-$hook_poll", array($this, 'screen_option_polls'));
490 502 add_action("load-$hook_poll", array($this, 'add_tabs'));
@@ -771,8 +783,26 @@
771 783 }
772 784
773 785 public static function set_screen( $status, $option, $value ) {
774 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;
775 805 }
776 806
777 807 public function screen_option_polls() {
778 808 $option = 'per_page';
@@ -781,9 +811,14 @@
781 811 'default' => 20,
782 812 'option' => 'polls_per_page',
783 813 );
784 814
785 - 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 +
786 821 $this->polls_obj = new Polls_List_Table($this->plugin_name);
787 822 $this->settings_obj = new Poll_Maker_Settings_Actions($this->plugin_name);
788 823
789 824 }
@@ -795,9 +830,14 @@
795 830 'default' => 5,
796 831 'option' => 'poll_cats_per_page',
797 832 );
798 833
799 - 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 +
800 840 $this->cats_obj = new Pma_Categories_List_Table($this->plugin_name);
801 841 $this->settings_obj = new Poll_Maker_Settings_Actions($this->plugin_name);
802 842 }
803 843
@@ -807,9 +847,9 @@
807 847 'label' =>esc_html__('Results', "poll-maker"),
808 848 'default' => 50,
809 849 'option' => 'poll_results_per_page',
810 850 );
811 -
851 +
812 852 add_screen_option($option, $args);
813 853 $this->results_obj = new Pma_Results_List_Table($this->plugin_name);
814 854 // $this->answer_results_obj = new Poll_Answer_Results($this->plugin_name);
815 855 }
@@ -1199,8 +1239,9 @@
1199 1239 return $all;
1200 1240 }
1201 1241
1202 1242 public function screen_option_settings() {
1243 + add_filter('screen_options_show_screen', array($this, 'poll_hide_screen_options'), 10, 2);
1203 1244 $this->polls_obj = new Polls_List_Table($this->plugin_name);
1204 1245 $this->settings_obj = new Poll_Maker_Settings_Actions($this->plugin_name);
1205 1246 }
1206 1247
@@ -1214,18 +1255,18 @@
1214 1255
1215 1256 $curl = curl_init();
1216 1257
1217 1258 curl_setopt_array($curl, array(
1218 - CURLOPT_URL => "https://" . $api_postfix . ".api.mailchimp.com/3.0/lists",
1219 - CURLOPT_RETURNTRANSFER => true,
1220 - CURLOPT_ENCODING => "",
1221 - CURLOPT_MAXREDIRS => 10,
1222 - CURLOPT_TIMEOUT => 30,
1223 - CURLOPT_SSL_VERIFYPEER => false,
1224 - CURLOPT_HTTP_VERSION => CURL_HTTP_VERSION_1_1,
1225 - CURLOPT_CUSTOMREQUEST => "GET",
1226 - CURLOPT_USERPWD => "$username:$api_key",
1227 - 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,
1228 1269 // CURLOPT_POSTFIELDS => "undefined=",
1229 1270 CURLOPT_HTTPHEADER => array(
1230 1271 "Content-Type: application/json",
1231 1272 "cache-control: no-cache"
@@ -1435,11 +1476,8 @@
1435 1476 public function ays_poll_add_checklist_guide(){
1436 1477
1437 1478 if(!empty($_REQUEST['page']) && sanitize_text_field( $_REQUEST['page'] ) != $this->plugin_name . "-getting-started"){
1438 1479 if(false !== strpos( sanitize_text_field( $_REQUEST['page'] ), $this->plugin_name)){
1439 - if(isset($_GET['action']) && in_array($_GET['action'], ['add', 'edit'])) {
1440 - return;
1441 - }
1442 1480 $current_user_id = get_current_user_id();
1443 1481 $completed_steps = get_user_meta($current_user_id, 'ays_poll_checklist_completed_steps', true);
1444 1482
1445 1483 // Make sure we always get an array
@@ -1495,9 +1533,9 @@
1495 1533 </li>
1496 1534 <?php endforeach; ?>
1497 1535 </ol>
1498 1536 <style>
1499 - #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:99999;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}}
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}}
1500 1538 </style>
1501 1539 </div>
1502 1540 <?php
1503 1541 }
@@ -1726,14 +1764,13 @@
1726 1764 $ays_poll_flag += intval(get_option('ays_poll_sale_btn_'.$sale));
1727 1765 $ays_poll_flag += $ays_poll_two_months_flag;
1728 1766 if($ays_poll_flag == 0){
1729 1767 $ays_poll_sale_message = 'ays_poll_sale_message_'.$sale;
1730 - if ( $this->get_max_id('polls') > 1 ){
1731 1768 // $this->ays_poll_new_halloween_bundle_message_2025();
1732 1769 // $this->ays_poll_black_friday_message();
1733 1770 // $this->ays_poll_christmas_banner_message_2025();
1734 - $this->ays_poll_new_mega_bundle_message_2026();
1735 - }
1771 + // $this->ays_poll_footer_sale_banner_2026($ays_poll_flag);
1772 + $this->ays_poll_back_to_school_banner_2026($ays_poll_flag);
1736 1773 }
1737 1774 }
1738 1775 }
1739 1776 }
@@ -1738,8 +1775,418 @@
1738 1775 }
1739 1776 }
1740 1777 }
1741 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 +
1742 2189 public function ays_poll_dismiss_button(){
1743 2190
1744 2191 $data = array(
1745 2192 'status' => false,
@@ -3634,57 +4081,21 @@
3634 4081 }
3635 4082
3636 4083 public function ays_poll_generate_message_vars_html( $poll_message_vars ) {
3637 4084 $content = array();
3638 - $var_counter = 0;
3639 4085
3640 - $allowed_tags = array(
3641 - 'div' => array(
3642 - 'class' => true
3643 - ),
3644 - 'span' => array(),
3645 - 'a' => array(
3646 - 'class' => true,
3647 - 'data-toggle' => true,
3648 - 'data-html' => true,
3649 - 'title' => true
3650 - ),
3651 - 'i' => array(
3652 - 'class' => true
3653 - ),
3654 - 'label' => array(
3655 - 'class' => true
3656 - ),
3657 - 'input' => array(
3658 - 'type' => true,
3659 - 'class' => true,
3660 - 'hidden' => true,
3661 - 'id' => true,
3662 - 'name' => true,
3663 - 'value' => true
3664 - )
3665 - );
3666 -
3667 4086 $content[] = '<div class="ays-poll-message-vars-box">';
3668 4087 $content[] = '<div class="ays-poll-message-vars-icon">';
3669 - $content[] = '<div>';
3670 - $content[] = '<i class="ays_poll_fa ays_fa_link"></i>';
3671 - $content[] = '</div>';
3672 - $content[] = '<div>';
3673 - $content[] = '<span>'.esc_html__("Message Variables" , "poll-maker") .'</span>';
3674 - $content[] = '<a class="ays_help" data-toggle="tooltip" data-html="true" title="'.esc_html__("Insert your preferred message variable into the editor by clicking." , "poll-maker") .'">';
3675 - $content[] = '<i class="fas fa-info-circle"></i>';
3676 - $content[] = '</a>';
3677 - $content[] = '</div>';
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>';
3678 4091 $content[] = '</div>';
3679 4092 $content[] = '<div class="ays-poll-message-vars-data">';
3680 4093 foreach($poll_message_vars as $var => $var_name){
3681 - $var_counter++;
3682 - $content[] = '<label class="ays-poll-message-vars-each-data-label">';
3683 - $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">';
4094 + $content[] = '<label class="ays-poll-message-vars-each-data-label">';
3684 4095 $content[] = '<div class="ays-poll-message-vars-each-data">';
3685 - $content[] = '<input type="hidden" class="ays-poll-message-vars-each-var" value="'. $var .'">';
3686 - $content[] = '<span>'. $var_name .'</span>';
4096 + $content[] = '<input type="hidden" class="ays-poll-message-vars-each-var" value="'. esc_attr( $var ) .'">';
4097 + $content[] = '<span>'. esc_html( $var_name ) .'</span>';
3687 4098 $content[] = '</div>';
3688 4099 $content[] = '</label>';
3689 4100 }
3690 4101 $content[] = '</div>';
@@ -3691,9 +4102,9 @@
3691 4102 $content[] = '</div>';
3692 4103
3693 4104 $content = implode( '', $content );
3694 4105
3695 - return wp_kses( $content, $allowed_tags );
4106 + return $content;
3696 4107 }
3697 4108
3698 4109 /**
3699 4110 * Determine if the plugin/addon installations are allowed.
@@ -4380,9 +4791,10 @@
4380 4791 "facebook_link" => "",
4381 4792 "twitter_link" => "",
4382 4793 "vkontakte_link" => "",
4383 4794 "youtube_link" => "",
4384 - "tiktok_link" => ""
4795 + "tiktok_link" => "",
4796 + "instagram_link" => ""
4385 4797 ),
4386 4798 "load_effect" => "load_gif",
4387 4799 "load_gif" => "plg_pro1",
4388 4800 "custom_load" => false,
@@ -4523,10 +4935,13 @@
4523 4935 "poll_question_image_height" => "",
4524 4936 "poll_mobile_max_width" => "",
4525 4937 "poll_title_font_size" => "18",
4526 4938 "poll_title_font_size_mobile" => "20",
4939 + "poll_title_font_weight" => "normal",
4940 + "poll_title_font_weight_mobile" => "normal",
4527 4941 "poll_title_alignment" => "center",
4528 4942 "poll_title_alignment_mobile" => "center",
4943 + "poll_title_text_transform" => "none",
4529 4944 "poll_enable_answer_image_after_voting" => "off",
4530 4945 "poll_text_type_length_enable" => "off",
4531 4946 "poll_text_type_limit_type" => "characters",
4532 4947 "poll_text_type_limit_length" => "",