PluginProbe
Survey Maker by AYS / 5.2.4.1
Survey Maker by AYS v5.2.4.1
5.2.4.1 5.2.4.0 5.2.3.9 5.2.3.8 5.2.3.7 5.2.3.6 5.2.3.5 5.2.3.4 5.2.3.3 5.2.3.2 5.2.3.1 5.2.3.0 5.2.2.9 5.2.2.8 5.2.2.7 5.2.2.6 5.2.2.5 5.2.2.4 5.2.2.3 5.2.2.2 5.2.2.1 5.2.2.0 5.2.1.9 5.2.1.8 5.2.0.8 All 154 releases
← All changes | admin/class-survey-maker-admin.php +603 -9 5.2.0.8 → 5.2.4.1 View file →
@@ -143,8 +143,43 @@
143 143 // }
144 144
145 145 }
146 146
147 + /**
148 + * Register the styles for the admin menu area.
149 + *
150 + * @since 1.0.0
151 + */
152 + public function admin_menu_styles(){
153 + $survey_menu_badge_background = self::get_menu_badge_background( $this->plugin_name );
154 +
155 + $custom_additional_css = "";
156 + if( $survey_menu_badge_background == '#3858e9' ){
157 + $custom_additional_css = "
158 + #adminmenu li.toplevel_page_survey-maker a.toplevel_page_survey-maker.wp-has-current-submenu.wp-menu-open .wp-menu-name .ays-survey-menu-badge,
159 + #adminmenu li.toplevel_page_survey-maker a.toplevel_page_survey-maker:hover .wp-menu-name .ays-survey-menu-badge {
160 + color: #fff;
161 + background: rgb(12.15, 12.15, 12.15);
162 + }";
163 + }
164 +
165 + echo "<style>
166 + #adminmenu .ays-survey-menu-badge {
167 + background: ". esc_attr( $survey_menu_badge_background ) .";
168 + }
169 +
170 + ". $custom_additional_css ."
171 + </style>";
172 + }
173 +
174 + public static function get_menu_badge_background( $plugin_name = 'survey-maker' ){
175 + $setting_actions = new Survey_Maker_Settings_Actions( $plugin_name );
176 + $options = ($setting_actions->ays_get_setting('options') === false) ? array() : json_decode( stripcslashes( $setting_actions->ays_get_setting('options') ), true);
177 + $survey_menu_badge_style = ( isset( $options['survey_menu_badge_style'] ) && sanitize_key( $options['survey_menu_badge_style'] ) === 'wp_default' ) ? 'wp_default' : 'classic';
178 +
179 + return ( $survey_menu_badge_style === 'wp_default' ) ? '#3858e9' : '#ca4a1f';
180 + }
181 +
147 182 /**
148 183 * Register the stylesheets for the admin area.
149 184 *
150 185 * @since 1.0.0
@@ -283,8 +318,9 @@
283 318 wp_enqueue_script( $this->plugin_name . "-survey-styles", plugin_dir_url(__FILE__) . 'js/partials/survey-maker-admin-survey-styles.js', array('jquery', 'wp-color-picker'), $this->version, true);
284 319 wp_enqueue_script( $this->plugin_name . "-functions", plugin_dir_url(__FILE__) . 'js/functions.js', array( 'jquery', 'wp-color-picker' ), $this->version, true );
285 320 wp_enqueue_script( $this->plugin_name . '-ajax', plugin_dir_url(__FILE__) . 'js/survey-maker-admin-ajax.js', array('jquery'), $this->version, true);
286 321 wp_enqueue_script( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'js/survey-maker-admin.js', array( 'jquery' ), $this->version, true );
322 + wp_enqueue_script( $this->plugin_name."-terms-and-conditions", plugin_dir_url( __FILE__ ) . 'js/survey-maker-admin-terms-and-conditions.js', array( 'jquery' ), $this->version, true );
287 323 wp_localize_script( $this->plugin_name, 'SurveyMakerAdmin', array(
288 324 'surveyBannerDate' => $survey_banner_date,
289 325 'ajaxUrl' => admin_url( 'admin-ajax.php' ),
290 326 'nonce' => wp_create_nonce( 'ajax-nonce' ),
@@ -334,8 +370,9 @@
334 370 'okSurvey' => __( 'OK', "survey-maker"),
335 371 'icons' => array(
336 372 'radioButtonUnchecked' => SURVEY_MAKER_ADMIN_URL . '/images/icons/radio-button-unchecked.svg',
337 373 'checkboxUnchecked' => SURVEY_MAKER_ADMIN_URL . '/images/icons/checkbox-unchecked.svg',
374 + 'deleteTermsAndConds' => SURVEY_MAKER_ADMIN_URL. '/images/icons/trash.svg',
338 375 ),
339 376 'nextSurveyPage' => __( 'Are you sure you want to go to the next survey page?', "survey-maker"),
340 377 'prevSurveyPage' => __( 'Are you sure you want to go to the previous question page?', "survey-maker"),
341 378 'addQuestionImageCaption' => __( 'Add a caption', "survey-maker"),
@@ -348,8 +385,18 @@
348 385 'activate' => __( 'Activate', "survey-maker" ),
349 386 'activated' => __( 'Activated', "survey-maker" ),
350 387 'successCopyCoupon' => __( "Coupon code copied!", 'survey-maker' ),
351 388 'failedCopyCoupon' => __( "Failed to copy coupon code", 'survey-maker' ),
389 +
390 + 'generalTabDoc' => esc_html__( "How to configure questions", 'survey-maker' ),
391 + 'stylesTabDoc' => esc_html__( "How to customize styles", 'survey-maker' ),
392 + 'settingsTabDoc' => esc_html__( "How to configure survey settings", 'survey-maker' ),
393 + 'resultsSettingsTabDoc' => esc_html__( "How to customize survey results", 'survey-maker' ),
394 + 'limitationUsersTabDoc' => esc_html__( "How to set up user limitations", 'survey-maker' ),
395 + 'userDataTabDoc' => esc_html__( "How to set up the start page", 'survey-maker' ),
396 + 'emailTabDoc' => esc_html__( "How to configure survey emails", 'survey-maker' ),
397 + 'integrationTabDoc' => esc_html__( "How to set up integrations", 'survey-maker' ),
398 + 'conditionsTabDoc' => esc_html__( "How to use conditional results", 'survey-maker' ),
352 399 ) );
353 400 wp_localize_script($this->plugin_name . '-ajax', 'survey_maker_ajax', array(
354 401 'ajax_url' => admin_url('admin-ajax.php'),
355 402 "emptyEmailError" => __( 'Email field is empty', "survey-maker"),
@@ -363,8 +410,22 @@
363 410 ));
364 411
365 412 }
366 413
414 + public function ays_survey_add_body_class( $classes ) {
415 + global $pagenow;
416 +
417 + if ( $pagenow === 'admin.php' ) {
418 + $page = isset( $_GET['page'] ) ? sanitize_key( $_GET['page'] ) : '';
419 +
420 + if ( strpos( $page, $this->plugin_name ) === 0 ) {
421 + $classes .= ' ays-survey-plugin-admin';
422 + }
423 + }
424 +
425 + return $classes;
426 + }
427 +
367 428 /**
368 429 * De-register JavaScript files for the admin area.
369 430 *
370 431 * @since 1.0.0
@@ -511,9 +572,9 @@
511 572 $this->capability,
512 573 $this->plugin_name,
513 574 array($this, 'display_plugin_surveys_page'),
514 575 SURVEY_MAKER_ADMIN_URL . '/images/icons/survey-make-menu-logo.svg',
515 - '6.21'
576 + '25.20'
516 577 );
517 578 add_action( "load-$hook_survey_maker", array( $this, 'add_tabs' ));
518 579 }
519 580
@@ -1699,14 +1760,16 @@
1699 1760
1700 1761 $ays_survey_maker_flag = intval(get_option('ays_survey_sale_btn'));
1701 1762 if( $ays_survey_maker_flag == 0 ){
1702 1763 if (isset($_GET['page']) && strpos($_GET['page'], SURVEY_MAKER_NAME) !== false) {
1703 - if(Survey_Maker_Admin::get_max_id('surveys') > 1){
1764 + // if(Survey_Maker_Admin::get_max_id('surveys') > 1){
1704 1765 // $this->ays_survey_new_halloween_bundle_message_2025($ays_survey_maker_flag);
1705 1766 // $this->ays_survey_black_friday_message($ays_survey_maker_flag);
1706 1767 // $this->ays_survey_christmas_banner_message_2025($ays_survey_maker_flag);
1707 - $this->ays_survey_new_mega_bundle_message_2026($ays_survey_maker_flag);
1708 - }
1768 + $this->ays_survey_back_to_school_banner_2026($ays_survey_maker_flag);
1769 + // $this->ays_survey_footer_sale_banner_2026($ays_survey_maker_flag);
1770 +
1771 + // }
1709 1772 }
1710 1773 }
1711 1774
1712 1775 }
@@ -1811,9 +1874,9 @@
1811 1874 if( $diff < 0 ){
1812 1875 $style_attr = 'style="display:none;"';
1813 1876 }
1814 1877
1815 - $survey_cta_button_link = esc_url( 'https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=mega-bundle-sale-banner-' . SURVEY_MAKER_VERSION );
1878 + $survey_cta_button_link = esc_url( 'https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=top-20-sale-banner-' . SURVEY_MAKER_VERSION );
1816 1879
1817 1880 $content[] = '<div id="ays-survey-new-mega-bundle-dicount-month-main" class="ays-survey-admin-notice notice notice-success is-dismissible ays_survey_dicount_info">';
1818 1881 $content[] = '<div id="ays-survey-dicount-month" class="ays_survey_dicount_month">';
1819 1882
@@ -1819,15 +1882,15 @@
1819 1882
1820 1883 $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-text-box">';
1821 1884 $content[] = '<div>';
1822 1885 $content[] = '<div class="ays-survey-dicount-logo-box">';
1823 - $content[] = '<a href="' . $survey_cta_button_link . '" target="_blank" class="ays-survey-sale-banner-link"><img src="' . SURVEY_MAKER_ADMIN_URL . '/images/mega_bundle_logo_box.png"></a>';
1886 + $content[] = '<a href="' . $survey_cta_button_link . '" target="_blank" class="ays-survey-sale-banner-link"><img src="' . SURVEY_MAKER_ADMIN_URL . '/images/ays-survey-banner-announcement-icon.svg"></a>';
1824 1887
1825 1888 $content[] = '<div>';
1826 1889 $content[] = '<span class="ays-survey-new-mega-bundle-title">';
1827 1890 $content[] = sprintf(
1828 1891 /* translators: 1: opening link wrapper with <a> tag, 2: closing </a> tag */
1829 - __( '%1$s Mega Bundle %2$s ( Quiz + Survey + Poll )', 'survey-maker' ),
1892 + __( 'Upgrade to %1$s Survey Maker PRO %2$s', 'survey-maker' ),
1830 1893 '<span style="display:inline-block; margin-right:5px;"><a href="' . esc_url( $survey_cta_button_link ) . '" target="_blank" rel="noopener noreferrer" style="color:#ffffff !important; text-decoration: underline;">',
1831 1894 '</a></span>'
1832 1895 );
1833 1896 $content[] = '</span>';
@@ -1837,9 +1900,9 @@
1837 1900 $content[] = '</span>';
1838 1901 $content[] = '</div>';
1839 1902
1840 1903 $content[] = '<div class="ays-survey-new-mega-bundle-title-icon-row" style="display: inline-block;">';
1841 - $content[] = '<img src="' . SURVEY_MAKER_ADMIN_URL . '/images/ays-survey-banner-sale-50.svg" class="ays-survey-new-mega-bundle-mobile-image-display-none" style="width: 70px;">';
1904 + $content[] = '<img src="' . SURVEY_MAKER_ADMIN_URL . '/images/ays-survey-banner-sale-20.svg" class="ays-survey-new-mega-bundle-mobile-image-display-none" style="width: 70px;">';
1842 1905 $content[] = '</div>';
1843 1906
1844 1907 $content[] = '</div>';
1845 1908
@@ -1884,8 +1947,17 @@
1884 1947
1885 1948 $content[] = '</div>';
1886 1949
1887 1950 $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-button-box">';
1951 + $content[] = '<div class="ays-survey-dicount-banner-coupon-box" onclick="aysSurveyBundleCopyToClipboard(\'SURVEYPRO20\')" title="' . __( 'Click to copy coupon code', "survey-maker" ) . '">';
1952 + $content[] = '<span class="ays-survey-dicount-banner-coupon-text">SURVEYPRO20</span>';
1953 + $content[] = '<svg class="ays-survey-dicount-banner-copy-icon" width="16" height="16" viewBox="0 0 16 16" fill="none">';
1954 + $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"/>';
1955 + $content[] = '</svg>';
1956 + $content[] = '</div>';
1957 + $content[] = '</div>';
1958 +
1959 + $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-button-box">';
1888 1960 $content[] = '<a href="'. $survey_cta_button_link .'" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now', 'survey-maker' ) . '</a>';
1889 1961 $content[] = '<span class="ays-survey-dicount-one-time-text">';
1890 1962 $content[] = __( "One-time payment", 'survey-maker' );
1891 1963 $content[] = '</span>';
@@ -1892,12 +1964,126 @@
1892 1964 $content[] = '</div>';
1893 1965 $content[] = '</div>';
1894 1966 $content[] = '</div>';
1895 1967
1968 + $content[] = '<script>';
1969 + $content[] = "
1970 + function aysSurveyBundleCopyToClipboard(text) {
1971 + var textarea = document.createElement('textarea');
1972 + textarea.value = text;
1973 + textarea.style.position = 'fixed';
1974 + textarea.style.opacity = '0';
1975 + document.body.appendChild(textarea);
1976 +
1977 + textarea.select();
1978 + textarea.setSelectionRange(0, 99999);
1979 +
1980 + try {
1981 + document.execCommand('copy');
1982 + aysSurveyBundleShowCopyNotification('" . __( 'Coupon code copied!', "survey-maker" ) . "');
1983 + } catch (err) {
1984 + console.error('Failed to copy text: ', err);
1985 + }
1986 +
1987 + document.body.removeChild(textarea);
1988 + }
1989 +
1990 + function aysSurveyBundleShowCopyNotification(message) {
1991 + var existingNotification = document.querySelector('.ays-survey-dicount-banner-copy-notification');
1992 + if (existingNotification) {
1993 + document.body.removeChild(existingNotification);
1994 + }
1995 +
1996 + var notification = document.createElement('div');
1997 + notification.className = 'ays-survey-dicount-banner-copy-notification';
1998 + notification.textContent = message;
1999 + document.body.appendChild(notification);
2000 +
2001 + setTimeout(function() {
2002 + notification.classList.add('show');
2003 + }, 10);
2004 +
2005 + setTimeout(function() {
2006 + notification.classList.remove('show');
2007 + setTimeout(function() {
2008 + if (notification.parentNode) {
2009 + document.body.removeChild(notification);
2010 + }
2011 + }, 300);
2012 + }, 2000);
2013 + }";
2014 + $content[] = '</script>';
2015 +
1896 2016 // /* New Mega Bundle Banner Survey | Start */
1897 2017 $content[] = '<style id="ays-survey-mega-bundle-styles-inline-css">';
1898 2018 $content[] = '
1899 - div#ays-survey-new-mega-bundle-dicount-month-main{border:0;background:#fff;border-radius:20px;box-shadow:unset;position:relative;z-index:1;min-height:80px}div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info button{display:flex;align-items:center}div#ays-survey-new-mega-bundle-dicount-month-main div#ays-survey-dicount-month a.ays-survey-sale-banner-link:focus{outline:0;box-shadow:0}div#ays-survey-new-mega-bundle-dicount-month-main .btn-link{color:#007bff;background-color:transparent;display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem}div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info{background-image:url("'. SURVEY_MAKER_ADMIN_URL .'/images/new-mega-bundle-logo-background.svg");background-position:center right;background-repeat:no-repeat;background-size:cover;background-color:#5551ff;padding:1px 38px 1px 12px}#ays-survey-new-mega-bundle-dicount-month-main .ays_survey_dicount_month{display:flex;align-items:center;justify-content:space-between;color:#fff}#ays-survey-new-mega-bundle-dicount-month-main .ays_survey_dicount_month img{width:60px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-sale-banner-link{display:flex;justify-content:center;align-items:center;width:60px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box{font-size:14px;padding:12px;text-align:center}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{text-align:left;width:auto;display:flex;justify-content:space-around;align-items:flex-start}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:30%;display:flex;justify-content:center;align-items:center}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-button-box{width:20%;display:flex;justify-content:center;align-items:center;flex-direction:column}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-survey-dicount-logo-box{display:flex;justify-content:flex-start;align-items:center;gap:20px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box .ays-survey-new-mega-bundle-title{color:#fdfdfd;font-size:19px;font-style:normal;font-weight:600;line-height:normal}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box .ays-survey-new-mega-bundle-title-icon-row{display:inline-block}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box .ays-survey-new-mega-bundle-desc{display:inline-block;color:#fff;font-size:15px;font-style:normal;font-weight:400;line-height:normal;margin-top:10px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box strong{font-size:17px;font-weight:700;letter-spacing:.8px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-color{color:#971821}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-text-decoration{text-decoration:underline}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-buy-now-button-box{display:flex;justify-content:flex-end;align-items:center;width:30%}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-button,#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-buy-now-button{align-items:center;font-weight:500}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-buy-now-button{background:#971821;border-color:#fff;display:flex;justify-content:center;align-items:center;padding:5px 15px;font-size:16px;border-radius:5px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-buy-now-button:hover{background:#7d161d;border-color:#971821}#ays-survey-new-mega-bundle-dicount-month-main #ays-survey-dismiss-buttons-content{display:flex;justify-content:center}#ays-survey-new-mega-bundle-dicount-month-main #ays-survey-dismiss-buttons-content .ays-button{margin:0!important;font-size:13px;color:#fff}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-opacity-box{width:19%}#ays-survey-new-mega-bundle-dicount-month-main .ays-buy-now-opacity-button{padding:40px 15px;display:flex;justify-content:center;align-items:center;opacity:0}#ays-survey-countdown-main-container .ays-survey-countdown-container{margin:0 auto;text-align:center}#ays-survey-countdown-main-container #ays-survey-countdown-headline{letter-spacing:.125rem;text-transform:uppercase;font-size:18px;font-weight:400;margin:0;padding:9px 0 4px;line-height:1.3}#ays-survey-countdown-main-container li,#ays-survey-countdown-main-container ul{margin:0}#ays-survey-countdown-main-container li{display:inline-block;font-size:14px;list-style-type:none;padding:14px;text-transform:lowercase}#ays-survey-countdown-main-container li span{display:flex;justify-content:center;align-items:center;font-size:22px;min-height:40px;min-width:40px;border-radius:4.273px;border:.534px solid #f4f4f4;background:#9896ed;color:#fff}#ays-survey-countdown-main-container .emoji{display:none;padding:1rem}#ays-survey-countdown-main-container .emoji span{font-size:30px;padding:0 .5rem}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li{position:relative}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li span:after{content:":";color:#fff;position:absolute;top:0;right:-5px;font-size:40px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li span#ays-survey-countdown-seconds:after{content:unset}#ays-survey-new-mega-bundle-dicount-month-main #ays-button-top-buy-now{display:flex;align-items:center;border-radius:6.409px;background:#f66123;padding:12px 32px;color:#fff;font-size:15px;font-style:normal;line-height:normal;margin:0!important}div#ays-survey-new-mega-bundle-dicount-month-main button.notice-dismiss:before{color:#fff;content:"\f00d";font-family:fontawesome;font-size:22px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-new-mega-bundle-guaranteeicon{width:30px;margin-right:5px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-one-time-text{color:#fff;font-size:12px;font-style:normal;font-weight:600;line-height:normal}@media all and (max-width:768px){div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info.notice{display:none!important;background-position:bottom right;background-repeat:no-repeat;background-size:cover;border-radius:32px}div#ays-survey-new-mega-bundle-dicount-month-main{padding-right:0}div#ays-survey-new-mega-bundle-dicount-month-main .ays_survey_dicount_month{display:flex;align-items:center;justify-content:space-between;align-content:center;flex-wrap:wrap;flex-direction:column;padding:10px 0}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box{width:100%!important;text-align:center}#ays-survey-countdown-main-container #ays-survey-countdown-headline{font-size:15px;font-weight:600}#ays-survey-countdown-main-container ul{font-weight:500}div#ays-survey-countdown-main-container li{padding:10px}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-new-mega-bundle-mobile-image-display-none{display:none!important}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-new-mega-bundle-mobile-image-display-block{display:block!important;margin-top:5px}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{width:100%!important;text-align:center;flex-direction:column;margin-top:20px;justify-content:center;align-items:center}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li span:after{top:unset}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:100%;display:flex;justify-content:center;align-items:center}#ays-survey-new-mega-bundle-dicount-month-main .ays-button{margin:0 auto!important}#ays-survey-new-mega-bundle-dicount-month-main #ays-survey-dismiss-buttons-content .ays-button{padding-left:unset!important}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-buy-now-button-box{justify-content:center}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-buy-now-button{font-size:14px;padding:5px 10px}div#ays-survey-new-mega-bundle-dicount-month-main .ays-buy-now-opacity-button{display:none}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dismiss-buttons-container-for-form{position:static!important}.comparison .product img{width:70px}.ays-survey-features-wrap .comparison a.price-buy{padding:8px 5px;font-size:11px}}@media screen and (max-width:1350px) and (min-width:768px){div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info.notice{background-position:bottom right;background-repeat:no-repeat;background-size:cover}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box strong{font-size:15px}#ays-survey-countdown-main-container li{font-size:11px}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-opacity-box{display:none}}@media screen and (max-width:1680px) and (min-width:1551px){div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{width:29%}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:30%}}@media screen and (max-width:1410px){#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-coupon-row{width:150px}}@media screen and (max-width:1550px) and (min-width:1400px){div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:35%}}@media screen and (max-width:1400px) and (min-width:1250px){div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:35%}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{width:40%}}@media screen and (max-width:1274px){#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box .ays-survey-new-mega-bundle-title{font-size:15px}}@media screen and (max-width:1200px){#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-button-box{margin-bottom:16px}#ays-survey-countdown-main-container ul{padding-left:0}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-coupon-row{width:120px;font-size:18px}#ays-survey-new-mega-bundle-dicount-month-main #ays-button-top-buy-now{padding:12px 20px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box{font-size:12px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box .ays-survey-new-mega-bundle-desc{font-size:13px}}@media screen and (max-width:1076px) and (min-width:769px){#ays-survey-countdown-main-container li{padding:10px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-coupon-row{width:100px;font-size:16px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-button-box{margin-bottom:16px}#ays-survey-new-mega-bundle-dicount-month-main #ays-button-top-buy-now{padding:12px 15px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box{font-size:11px;padding:12px 0}}@media screen and (max-width:1250px) and (min-width:769px){div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:45%}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{width:35%}}';
2019 + div#ays-survey-new-mega-bundle-dicount-month-main{border:0;background:#fff;border-radius:20px;box-shadow:unset;position:relative;z-index:1;min-height:80px}div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info button{display:flex;align-items:center}div#ays-survey-new-mega-bundle-dicount-month-main div#ays-survey-dicount-month a.ays-survey-sale-banner-link:focus{outline:0;box-shadow:0}div#ays-survey-new-mega-bundle-dicount-month-main .btn-link{color:#007bff;background-color:transparent;display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:1rem;line-height:1.5;border-radius:.25rem}div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info{background-image:url("'. SURVEY_MAKER_ADMIN_URL .'/images/new-mega-bundle-logo-background-20.svg");background-position:center right;background-repeat:no-repeat;background-size:cover;background-color:#5551ff;padding:1px 38px 1px 12px}#ays-survey-new-mega-bundle-dicount-month-main .ays_survey_dicount_month{display:flex;align-items:center;justify-content:space-between;color:#fff}#ays-survey-new-mega-bundle-dicount-month-main .ays_survey_dicount_month img{width:60px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-sale-banner-link{display:flex;justify-content:center;align-items:center;width:60px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box{font-size:14px;padding:12px;text-align:center}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{text-align:left;width:auto;display:flex;justify-content:space-around;align-items:flex-start}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:30%;display:flex;justify-content:center;align-items:center}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-button-box{width:20%;display:flex;justify-content:center;align-items:center;flex-direction:column}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-survey-dicount-logo-box{display:flex;justify-content:flex-start;align-items:center;gap:20px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box .ays-survey-new-mega-bundle-title{color:#fdfdfd;font-size:19px;font-style:normal;font-weight:600;line-height:normal}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box .ays-survey-new-mega-bundle-title-icon-row{display:inline-block}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box .ays-survey-new-mega-bundle-desc{display:inline-block;color:#fff;font-size:15px;font-style:normal;font-weight:400;line-height:normal;margin-top:10px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box strong{font-size:17px;font-weight:700;letter-spacing:.8px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-color{color:#971821}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-text-decoration{text-decoration:underline}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-buy-now-button-box{display:flex;justify-content:flex-end;align-items:center;width:30%}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-button,#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-buy-now-button{align-items:center;font-weight:500}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-buy-now-button{background:#971821;border-color:#fff;display:flex;justify-content:center;align-items:center;padding:5px 15px;font-size:16px;border-radius:5px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-buy-now-button:hover{background:#7d161d;border-color:#971821}#ays-survey-new-mega-bundle-dicount-month-main #ays-survey-dismiss-buttons-content{display:flex;justify-content:center}#ays-survey-new-mega-bundle-dicount-month-main #ays-survey-dismiss-buttons-content .ays-button{margin:0!important;font-size:13px;color:#fff}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-opacity-box{width:19%}#ays-survey-new-mega-bundle-dicount-month-main .ays-buy-now-opacity-button{padding:40px 15px;display:flex;justify-content:center;align-items:center;opacity:0}#ays-survey-countdown-main-container .ays-survey-countdown-container{margin:0 auto;text-align:center}#ays-survey-countdown-main-container #ays-survey-countdown-headline{letter-spacing:.125rem;text-transform:uppercase;font-size:18px;font-weight:400;margin:0;padding:9px 0 4px;line-height:1.3}#ays-survey-countdown-main-container li,#ays-survey-countdown-main-container ul{margin:0}#ays-survey-countdown-main-container li{display:inline-block;font-size:14px;list-style-type:none;padding:14px;text-transform:lowercase}#ays-survey-countdown-main-container li span{display:flex;justify-content:center;align-items:center;font-size:22px;min-height:40px;min-width:40px;border-radius:4.273px;border:.534px solid #f4f4f4;background:#9896ed;color:#fff}#ays-survey-countdown-main-container .emoji{display:none;padding:1rem}#ays-survey-countdown-main-container .emoji span{font-size:30px;padding:0 .5rem}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li{position:relative}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li span:after{content:":";color:#fff;position:absolute;top:0;right:-5px;font-size:40px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li span#ays-survey-countdown-seconds:after{content:unset}#ays-survey-new-mega-bundle-dicount-month-main #ays-button-top-buy-now{display:flex;align-items:center;border-radius:6.409px;background:#f66123;padding:12px 32px;color:#fff;font-size:15px;font-style:normal;line-height:normal;margin:0!important}div#ays-survey-new-mega-bundle-dicount-month-main button.notice-dismiss:before{color:#fff;content:"\f00d";font-family:fontawesome;font-size:22px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-new-mega-bundle-guaranteeicon{width:30px;margin-right:5px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-one-time-text{color:#fff;font-size:12px;font-style:normal;font-weight:600;line-height:normal}@media all and (max-width:768px){div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info.notice{display:none!important;background-position:bottom right;background-repeat:no-repeat;background-size:cover;border-radius:32px}div#ays-survey-new-mega-bundle-dicount-month-main{padding-right:0}div#ays-survey-new-mega-bundle-dicount-month-main .ays_survey_dicount_month{display:flex;align-items:center;justify-content:space-between;align-content:center;flex-wrap:wrap;flex-direction:column;padding:10px 0}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box{width:100%!important;text-align:center}#ays-survey-countdown-main-container #ays-survey-countdown-headline{font-size:15px;font-weight:600}#ays-survey-countdown-main-container ul{font-weight:500}div#ays-survey-countdown-main-container li{padding:10px}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-new-mega-bundle-mobile-image-display-none{display:none!important}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-new-mega-bundle-mobile-image-display-block{display:block!important;margin-top:5px}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{width:100%!important;text-align:center;flex-direction:column;margin-top:20px;justify-content:center;align-items:center}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li span:after{top:unset}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:100%;display:flex;justify-content:center;align-items:center}#ays-survey-new-mega-bundle-dicount-month-main .ays-button{margin:0 auto!important}#ays-survey-new-mega-bundle-dicount-month-main #ays-survey-dismiss-buttons-content .ays-button{padding-left:unset!important}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-buy-now-button-box{justify-content:center}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-buy-now-button{font-size:14px;padding:5px 10px}div#ays-survey-new-mega-bundle-dicount-month-main .ays-buy-now-opacity-button{display:none}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dismiss-buttons-container-for-form{position:static!important}.comparison .product img{width:70px}.ays-survey-features-wrap .comparison a.price-buy{padding:8px 5px;font-size:11px}}@media screen and (max-width:1350px) and (min-width:768px){div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info.notice{background-position:bottom right;background-repeat:no-repeat;background-size:cover}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box strong{font-size:15px}#ays-survey-countdown-main-container li{font-size:11px}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-opacity-box{display:none}}@media screen and (max-width:1680px) and (min-width:1551px){div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{width:29%}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:30%}}@media screen and (max-width:1410px){#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-coupon-row{width:150px}}@media screen and (max-width:1550px) and (min-width:1400px){div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:35%}}@media screen and (max-width:1400px) and (min-width:1250px){div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:35%}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{width:40%}}@media screen and (max-width:1274px){#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box .ays-survey-new-mega-bundle-title{font-size:15px}}@media screen and (max-width:1200px){#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-button-box{margin-bottom:16px}#ays-survey-countdown-main-container ul{padding-left:0}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-coupon-row{width:120px;font-size:18px}#ays-survey-new-mega-bundle-dicount-month-main #ays-button-top-buy-now{padding:12px 20px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box{font-size:12px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box .ays-survey-new-mega-bundle-desc{font-size:13px}}@media screen and (max-width:1076px) and (min-width:769px){#ays-survey-countdown-main-container li{padding:10px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-coupon-row{width:100px;font-size:16px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-button-box{margin-bottom:16px}#ays-survey-new-mega-bundle-dicount-month-main #ays-button-top-buy-now{padding:12px 15px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box{font-size:11px;padding:12px 0}}@media screen and (max-width:1250px) and (min-width:769px){div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:45%}div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{width:35%}}';
2020 +
2021 + $content[] = '
2022 + .ays-survey-dicount-banner-coupon-box {
2023 + border: 2px dashed rgba(255, 255, 255, 0.4);
2024 + padding: 8px 16px;
2025 + border-radius: 6px;
2026 + background: rgba(255, 255, 255, 0.1);
2027 + cursor: pointer;
2028 + transition: all 0.3s;
2029 + display: flex;
2030 + align-items: center;
2031 + gap: 8px;
2032 + backdrop-filter: blur(10px);
2033 + }
2034 +
2035 + .ays-survey-dicount-banner-coupon-box:hover {
2036 + background: rgba(255, 255, 255, 0.2);
2037 + border-color: rgba(255, 255, 255, 0.6);
2038 + transform: translateY(-1px);
2039 + }
2040 +
2041 + .ays-survey-dicount-banner-coupon-text {
2042 + font-size: 16px;
2043 + font-weight: 700;
2044 + letter-spacing: 1px;
2045 + color: #fff;
2046 + font-family: monospace;
2047 + }
2048 +
2049 + .ays-survey-dicount-banner-copy-icon {
2050 + opacity: 0.8;
2051 + transition: opacity 0.3s;
2052 + }
2053 +
2054 + .ays-survey-dicount-banner-coupon-box:hover .ays-survey-dicount-banner-copy-icon {
2055 + opacity: 1;
2056 + }
2057 +
2058 + .ays-survey-dicount-banner-btn-arrow {
2059 + display: inline-block;
2060 + transition: transform 0.3s;
2061 + }
2062 +
2063 + .ays-survey-dicount-banner-buy-now-btn:hover .ays-survey-dicount-banner-btn-arrow {
2064 + transform: translateX(4px);
2065 + }
2066 +
2067 + /* Notification */
2068 + .ays-survey-dicount-banner-copy-notification {
2069 + position: fixed;
2070 + top: 50%;
2071 + left: 50%;
2072 + transform: translate(-50%, -50%);
2073 + background: rgba(0, 0, 0, 0.8);
2074 + color: #fff;
2075 + padding: 12px 24px;
2076 + border-radius: 8px;
2077 + font-size: 14px;
2078 + z-index: 10000;
2079 + opacity: 0;
2080 + transition: opacity 0.3s;
2081 + }
2082 +
2083 + .ays-survey-dicount-banner-copy-notification.show {
2084 + opacity: 1;
2085 + }';
1900 2086 $content[] = '</style>';
1901 2087 // /* New Mega Bundle Banner Survey | End */
1902 2088
1903 2089 $content = implode( '', $content );
@@ -3567,8 +3753,416 @@
3567 3753
3568 3754 $content = implode( '', $content );
3569 3755 echo html_entity_decode(esc_html( $content ));
3570 3756 }
3757 + }
3758 +
3759 + // Back to School top banner
3760 + public function ays_survey_back_to_school_banner_2026($ishmar){
3761 + if($ishmar == 0 ){
3762 + $content = array();
3763 + $quiz_cta_button_link = esc_url('https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=back-to-school-sale-banner-' . SURVEY_MAKER_VERSION);
3764 + $content[] = '<div id="ays-survey-back-to-school-banner-2026" class="ays-survey-back-to-school-banner-2026 ays-survey-admin-notice notice notice-success is-dismissible ays_survey_dicount_info">';
3765 + $content[] = '<svg class="ays-survey-bts-decoration ays-survey-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>';
3766 + $content[] = '<svg class="ays-survey-bts-decoration ays-survey-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>';
3767 + $content[] = '<svg class="ays-survey-bts-decoration ays-survey-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>';
3768 + $content[] = '<svg class="ays-survey-bts-decoration ays-survey-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>';
3769 + $content[] = '<svg class="ays-survey-bts-decoration ays-survey-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>';
3770 + $content[] = '<div class="ays-survey-bts-content">';
3771 + $content[] = '<div class="ays-survey-bts-offer">';
3772 + $content[] = '<img class="ays-survey-bts-handwritten" src="'. esc_url(SURVEY_MAKER_ADMIN_URL . '/images/ays-survey-back-to-school-handwritten.svg') .'" alt="Back to School Sale">';
3773 + $content[] = '<span class="ays-survey-bts-dot" aria-hidden="true"></span>';
3774 + $content[] = '<span class="ays-survey-bts-discount">'. esc_html__('20% OFF', 'survey-maker') .'</span>';
3775 + $content[] = '</div>';
3776 + $content[] = '<div class="ays-survey-bts-actions">';
3777 + $content[] = '<span class="ays-survey-bts-use-code">'. esc_html__('Use code', 'survey-maker') .'</span>';
3778 + $content[] = '<button type="button" class="ays-survey-bts-coupon" data-coupon="SCHOOL20" aria-label="'. esc_attr__('Copy coupon code SCHOOL20', 'survey-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.9-2 2-2h10c1.1 0 2 .9 2 2"></path></svg></button>';
3779 + $content[] = '<a href="'. esc_url($quiz_cta_button_link) .'" class="ays-survey-bts-cta" target="_blank" rel="noopener noreferrer">'. esc_html__('Upgrade Now', 'survey-maker') .'</a>';
3780 + $content[] = '</div>';
3781 + $content[] = '</div>';
3782 + $content[] = '<div class="ays-survey-bts-dismiss"><form action="" method="POST"><div id="ays-survey-dismiss-buttons-content">';
3783 + if( current_user_can( 'manage_options' ) ){
3784 + $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn">'. esc_html__('Dismiss ad', 'survey-maker') .'</button>';
3785 + $content[] = wp_nonce_field( SURVEY_MAKER_NAME . '-sale-banner', SURVEY_MAKER_NAME . '-sale-banner', true, false );
3786 + }
3787 + $content[] = '</div></form></div>';
3788 + $content[] = '</div>';
3789 + $content[] = '<style id="ays-survey-back-to-school-banner-2026-inline-css">';
3790 + $content[] = '#ays-survey-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-survey-bts-content{position:relative;z-index:2;display:flex;min-height:110px;align-items:center;justify-content:space-between;gap:28px}.ays-survey-bts-offer,.ays-survey-bts-actions{display:flex;align-items:center}.ays-survey-bts-offer{min-width:0;gap:9px}.ays-survey-bts-handwritten{width:280px;max-width:23vw;height:auto;color:#0755df;overflow:visible;flex:0 1 auto}.ays-survey-bts-dot{width:7px;height:7px;flex:0 0 auto;border-radius:50%;background:#ffc51b;align-self:flex-start;margin-top:27px}.ays-survey-bts-discount{color:#8127df;font-size:38px;font-weight:800;line-height:1;letter-spacing:-1.2px;white-space:nowrap}.ays-survey-bts-actions{flex:0 0 auto;gap:12px}.ays-survey-bts-use-code{color:#5f5b69;font-size:11px;font-weight:600;line-height:1;text-transform:uppercase;letter-spacing:.14em;white-space:nowrap}.ays-survey-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-survey-bts-coupon:hover,.ays-survey-bts-coupon:focus{border-color:#8127df;background:rgba(129,39,223,.05);color:#1147c8}.ays-survey-bts-coupon span{font-size:19px;font-weight:700;letter-spacing:.04em}.ays-survey-bts-coupon svg{width:16px;height:16px;color:#8127df}.ays-survey-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-survey-bts-cta:hover,.ays-survey-bts-cta:focus{color:#fff;transform:translateY(-1px);box-shadow:0 10px 20px -8px rgba(91,37,194,.95)}.ays-survey-bts-decoration{position:absolute;z-index:1;pointer-events:none}.ays-survey-bts-plane{top:8px;left:12px;width:24px;color:rgba(129,39,223,.55)}.ays-survey-bts-ruler{bottom:7px;left:24px;width:36px;color:rgba(20,73,230,.35)}.ays-survey-bts-star{top:8px;right:14px;width:19px;color:#ffc51b}.ays-survey-bts-pencil{right:31px;bottom:7px;width:21px;color:rgba(129,39,223,.5);transform:rotate(-12deg)}.ays-survey-bts-wave{bottom:3px;left:50%;width:96px;color:rgba(20,73,230,.22);transform:translateX(-50%)}#ays-survey-back-to-school-banner-2026 .notice-dismiss{top:1px;right:1px;color:#756b82}#ays-survey-back-to-school-banner-2026 .notice-dismiss:before{font-size:18px}.ays-survey-bts-dismiss{position:absolute;right:39px;bottom:0;z-index:3}.ays-survey-bts-dismiss form{margin:0}.ays-survey-bts-dismiss #ays-survey-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-survey-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-survey-bts-copy-notification.ays-survey-bts-show{opacity:1}@media screen and (max-width:1200px){.ays-survey-bts-content{gap:18px}.ays-survey-bts-handwritten{width:225px}.ays-survey-bts-discount{font-size:31px}.ays-survey-bts-actions{gap:8px}.ays-survey-bts-coupon{min-height:44px;padding:7px 10px}.ays-survey-bts-cta{min-height:44px;padding:0 18px;font-size:14px}}@media screen and (max-width:960px){#ays-survey-back-to-school-banner-2026{padding:15px 38px 20px}.ays-survey-bts-content{min-height:90px;flex-wrap:wrap;justify-content:center;gap:12px 24px}.ays-survey-bts-handwritten{max-width:none}.ays-survey-bts-actions{justify-content:center}.ays-survey-bts-dismiss{right:38px}}@media screen and (max-width:600px){#ays-survey-back-to-school-banner-2026{width:calc(100% - 20px);margin-right:10px;padding:18px 30px 23px 18px}.ays-survey-bts-content{flex-direction:column}.ays-survey-bts-offer{flex-wrap:wrap;justify-content:center}.ays-survey-bts-handwritten{width:210px}.ays-survey-bts-discount{font-size:28px}.ays-survey-bts-actions{flex-wrap:wrap}.ays-survey-bts-use-code{width:100%;text-align:center}.ays-survey-bts-coupon{min-height:40px}.ays-survey-bts-coupon span{font-size:16px}.ays-survey-bts-cta{min-height:40px}.ays-survey-bts-plane,.ays-survey-bts-ruler,.ays-survey-bts-pencil,.ays-survey-bts-wave{display:none}.ays-survey-bts-dismiss{right:30px}}';
3791 + $content[] = '</style>';
3792 + $content[] = '<script>
3793 + (function() {
3794 + "use strict";
3795 + function initBackToSchoolBanner() {
3796 + var banner = document.getElementById("ays-survey-back-to-school-banner-2026");
3797 + if (!banner) {
3798 + return;
3799 + }
3800 + var couponButton = banner.querySelector(".ays-survey-bts-coupon");
3801 + if (!couponButton) {
3802 + return;
3803 + }
3804 + couponButton.addEventListener("click", function() {
3805 + var couponCode = couponButton.getAttribute("data-coupon");
3806 + var textarea = document.createElement("textarea");
3807 + textarea.value = couponCode;
3808 + textarea.style.position = "fixed";
3809 + textarea.style.opacity = "0";
3810 + document.body.appendChild(textarea);
3811 + textarea.focus();
3812 + textarea.select();
3813 + try {
3814 + document.execCommand("copy");
3815 + showCopyNotification();
3816 + } catch (error) {
3817 + // Keep the banner usable when clipboard access is unavailable.
3818 + }
3819 + document.body.removeChild(textarea);
3820 + });
3821 + }
3822 + function showCopyNotification() {
3823 + var notification = document.createElement("div");
3824 + notification.className = "ays-survey-bts-copy-notification";
3825 + notification.textContent = "'. esc_js(__('Coupon code copied', 'survey-maker')) .'";
3826 + document.body.appendChild(notification);
3827 + setTimeout(function() {
3828 + notification.classList.add("ays-survey-bts-show");
3829 + }, 10);
3830 + setTimeout(function() {
3831 + notification.classList.remove("ays-survey-bts-show");
3832 + setTimeout(function() {
3833 + if (notification.parentNode) {
3834 + notification.parentNode.removeChild(notification);
3835 + }
3836 + }, 250);
3837 + }, 2000);
3838 + }
3839 + if (document.readyState === "loading") {
3840 + document.addEventListener("DOMContentLoaded", initBackToSchoolBanner);
3841 + } else {
3842 + initBackToSchoolBanner();
3843 + }
3844 + })();
3845 + </script>';
3846 + echo implode('', $content); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Static banner markup; dynamic values are escaped above.
3847 + }
3848 + }
3849 +
3850 +
3851 + // Survey Footer Blue Banner Sale 20%
3852 + public function ays_survey_footer_sale_banner_2026($ishmar){
3853 + if($ishmar == 0 ){
3854 + $content = array();
3855 +
3856 + $survey_cta_button_link = esc_url('https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=private-offer-20-off-' . SURVEY_MAKER_VERSION);
3857 +
3858 + $content[] = '
3859 + <div class="ays-survey-footer-banner-bottom-banner-wrapper" style="display: none;">
3860 + <div class="ays-survey-footer-banner-bottom-banner-container">
3861 + <div class="ays-survey-footer-banner-bottom-banner-content">
3862 + <div class="ays-survey-footer-banner-bottom-banner-inner">
3863 + <div class="ays-survey-footer-banner-bottom-banner-left">
3864 + <div class="ays-survey-footer-banner-bottom-banner-icon">
3865 + <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">
3866 + <path d="M12 7v14"></path>
3867 + <path d="M20 11v8a2 2 0 0 1-2 2H6a2 2 0 0 1-2-2v-8"></path>
3868 + <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>
3869 + <rect x="3" y="7" width="18" height="4" rx="1"></rect>
3870 + </svg>
3871 + </div>
3872 + <span class="ays-survey-footer-banner-bottom-banner-title">'. esc_html__('Survey Maker by AYS', 'survey-maker') .'</span>
3873 + </div>
3874 + <span class="ays-survey-footer-banner-bottom-banner-separator"></span>
3875 + <span class="ays-survey-footer-banner-bottom-banner-discount">'. esc_html__('20% Off', 'survey-maker') .'</span>
3876 + <div class="ays-survey-footer-banner-bottom-banner-code" onclick="aysSurveyFooterBannerCopyToClipboard()" title="'. esc_html__('Copy Coupon Code', 'survey-maker') .'">
3877 + <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">
3878 + <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>
3879 + <path d="M13 5v2"></path>
3880 + <path d="M13 17v2"></path>
3881 + <path d="M13 11v2"></path>
3882 + </svg>
3883 + <span>SURVEYPRO20</span>
3884 + <button type="button" class="ays-survey-footer-banner-bottom-banner-copy" aria-label="'. esc_html__('Copy Coupon Code', 'survey-maker') .'">
3885 + <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">
3886 + <rect width="14" height="14" x="8" y="8" rx="2" ry="2"></rect>
3887 + <path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2"></path>
3888 + </svg>
3889 + </button>
3890 + </div>
3891 + <button type="button" class="ays-survey-footer-banner-bottom-banner-cta">
3892 + '. esc_html__('Get Deal', 'survey-maker') .'
3893 + </button>
3894 + <button type="button" class="ays-survey-footer-banner-bottom-banner-close" aria-label="'. esc_html__('Close popup', 'survey-maker') .'">
3895 + <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">
3896 + <path d="M18 6 6 18"></path>
3897 + <path d="m6 6 12 12"></path>
3898 + </svg>
3899 + </button>
3900 + </div>
3901 + </div>
3902 + </div>
3903 + </div>';
3904 +
3905 + $content[] = '<style id="ays-survey-progress-banner-styles-inline-css">';
3906 +
3907 + $content[] = '@keyframes ays-pro-slide-up{0%{opacity:0;transform:translateY(24px)}100%{opacity:1;transform:translateY(0)}}@keyframes ays-pro-slide-down{0%{opacity:1;transform:translateY(0)}100%{opacity:0;transform:translateY(24px)}}.ays-survey-footer-banner-bottom-banner-wrapper{position:fixed;bottom:0;left:0;right:0;z-index:9999;padding:0 16px 28px;text-align:center;animation:.45s cubic-bezier(.16,1,.3,1) forwards ays-pro-slide-up}.ays-survey-footer-banner-bottom-banner-wrapper.ays-pro-banner-closing{animation:.32s cubic-bezier(.16,1,.3,1) forwards ays-pro-slide-down}.ays-survey-footer-banner-bottom-banner-container{display:inline-block;max-width:100%;border-radius:16px;background:linear-gradient(90deg,#2f6bff 0,#3e7bff 100%);box-shadow:0 20px 40px -15px rgba(47,107,255,.55),0 8px 20px -10px rgba(47,107,255,.35);overflow:hidden}.ays-survey-footer-banner-bottom-banner-code,.ays-survey-footer-banner-bottom-banner-content,.ays-survey-footer-banner-bottom-banner-inner,.ays-survey-footer-banner-bottom-banner-left{display:flex;align-items:center}.ays-survey-footer-banner-bottom-banner-inner{gap:16px;padding:8px 14px 8px 10px;color:#fff;font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Arial,sans-serif}.ays-survey-footer-banner-bottom-banner-left{gap:14px}.ays-survey-footer-banner-bottom-banner-icon{display:flex;align-items:center;justify-content:center;flex:0 0 auto;width:48px;height:48px;border-radius:50%;background:rgba(255,255,255,.15);color:#fff}.ays-survey-footer-banner-bottom-banner-icon svg{width:24px;height:24px}.ays-survey-footer-banner-bottom-banner-discount,.ays-survey-footer-banner-bottom-banner-title{font-size:17px;font-weight:600;line-height:1.25;letter-spacing:0;white-space:nowrap;color:#fff}.ays-survey-footer-banner-bottom-banner-separator{display:block;width:1px;height:24px;background:rgba(255,255,255,.4)}.ays-survey-footer-banner-bottom-banner-code{gap:6px;border:1px dashed rgba(255,255,255,.7);border-radius:999px;padding:6px 9px;color:#fff;cursor:pointer;transition:background-color .15s,border-color .15s}.ays-survey-footer-banner-bottom-banner-code:hover{background:rgba(255,255,255,.1);border-color:#fff}.ays-survey-footer-banner-bottom-banner-code button svg,.ays-survey-footer-banner-bottom-banner-code>svg{width:16px;height:16px}.ays-survey-footer-banner-bottom-banner-code span{font-size:14px;font-weight:600;line-height:1;letter-spacing:.05em;color:#fff}.ays-survey-footer-banner-bottom-banner-close,.ays-survey-footer-banner-bottom-banner-copy{display:flex;align-items:center;justify-content:center;margin:0;padding:0;background:0 0;border:0;color:rgba(255,255,255,.9);cursor:pointer;box-shadow:none;transition:color .15s,background-color .15s}.ays-survey-footer-banner-bottom-banner-close:hover,.ays-survey-footer-banner-bottom-banner-copy:hover{color:#fff;background:0 0}.ays-survey-footer-banner-bottom-banner-wrapper .ays-survey-footer-banner-bottom-banner-cta{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:8px 20px;border:0;border-radius:999px;background:#fff;color:#2f6bff;font-size:15px;font-weight:600;line-height:1;white-space:nowrap;cursor:pointer;box-shadow:0 1px 2px rgba(0,0,0,.08);transition:background-color .15s,transform .15s}.ays-survey-footer-banner-bottom-banner-wrapper .ays-survey-footer-banner-bottom-banner-cta:hover{background:rgba(255,255,255,.95);color:#2f6bff;transform:translateY(-1px)}.ays-survey-footer-banner-bottom-banner-close{width:22px;height:22px;margin-left:2px}.ays-survey-footer-banner-bottom-banner-close svg{width:20px;height:20px}.ays-survey-footer-banner-copy-notification{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:rgba(0,0,0,.8);color:#fff;padding:12px 24px;border-radius:8px;font-size:14px;z-index:10000;opacity:0;transition:opacity .3s}.ays-survey-footer-banner-copy-notification.show{opacity:1}@media (max-width:768px){.ays-survey-footer-banner-bottom-banner-wrapper{display:none}}';
3908 + $content[] = '</style>';
3909 +
3910 + $content[] = '<script>';
3911 +
3912 + $content[] = "
3913 + /**
3914 + * Footer Banner JavaScript - ES5 Compatible
3915 + * With delayed popup and visit tracking
3916 + */
3917 +
3918 + (function() {
3919 + 'use strict';
3920 +
3921 + // Configuration
3922 + var STORAGE_KEY = 'ays_survey_footer_banner_data';
3923 + var POPUP_RULES = [
3924 + { visit: 1, delay: 10000 }, // 1st visit: 10 seconds
3925 + { visit: 2, delay: 10000 }, // 2nd visit: 10 seconds
3926 + { visit: 3, delay: 15000 }, // 3th visit: 15 seconds
3927 + { visit: 4, delay: 15000 }, // 4th visit: 15 seconds
3928 + { visit: 5, delay: 20000 }, // 5th visit: 20 seconds
3929 + { visit: 7, delay: 20000 }, // 7th visit: 20 seconds
3930 + { visit: 10, delay: 30000 } // 10th visit: 30 seconds
3931 + ];
3932 + var MAX_SHOWS_PER_DAY = 7;
3933 +
3934 + // Wait for DOM to be ready
3935 + if (document.readyState === 'loading') {
3936 + document.addEventListener('DOMContentLoaded', initBanner);
3937 + } else {
3938 + initBanner();
3939 + }
3940 +
3941 + function initBanner() {
3942 + var banner = document.querySelector('.ays-survey-footer-banner-bottom-banner-wrapper');
3943 + var closeButton = document.querySelector('.ays-survey-footer-banner-bottom-banner-close');
3944 + var ctaButton = document.querySelector('.ays-survey-footer-banner-bottom-banner-cta');
3945 +
3946 + if (!banner) {
3947 + return;
3948 + }
3949 +
3950 + // Hide banner initially
3951 + banner.style.display = 'none';
3952 +
3953 + // Get or initialize banner data
3954 + var bannerData = getBannerData();
3955 +
3956 + // Check if we need to reset daily data
3957 + if (shouldResetData(bannerData.lastResetDate)) {
3958 + bannerData = resetDailyData();
3959 + }
3960 +
3961 + // Increment visit count
3962 + bannerData.visitCount++;
3963 + saveBannerData(bannerData);
3964 +
3965 + // Check if banner should be shown
3966 + var shouldShow = shouldShowBanner(bannerData);
3967 +
3968 + if (shouldShow.show) {
3969 + // Show banner after delay
3970 + setTimeout(function() {
3971 + banner.style.display = 'block';
3972 +
3973 + // Increment show count
3974 + bannerData.showCount++;
3975 + saveBannerData(bannerData);
3976 + }, shouldShow.delay);
3977 + }
3978 +
3979 + // Close button handler
3980 + if (closeButton) {
3981 + closeButton.addEventListener('click', function() {
3982 + closeBanner(banner);
3983 + });
3984 + }
3985 +
3986 + // CTA button handler
3987 + if (ctaButton) {
3988 + ctaButton.addEventListener('click', function() {
3989 + window.open('https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=private-offer-20-off-". SURVEY_MAKER_VERSION ."#ays-pro-sm-plans-box-sg', '_blank');
3990 + // Optionally close banner after click
3991 + closeBanner(banner);
3992 + });
3993 + }
3994 + }
3995 +
3996 + /**
3997 + * Get banner data from localStorage
3998 + */
3999 + function getBannerData() {
4000 + try {
4001 + var data = localStorage.getItem(STORAGE_KEY);
4002 + if (data) {
4003 + return JSON.parse(data);
4004 + }
4005 + } catch (e) {
4006 + // localStorage not available or parsing error
4007 + }
4008 +
4009 + // Return default data
4010 + return {
4011 + visitCount: 0,
4012 + showCount: 0,
4013 + lastResetDate: getTodayDate()
4014 + };
4015 + }
4016 +
4017 + /**
4018 + * Save banner data to localStorage
4019 + */
4020 + function saveBannerData(data) {
4021 + try {
4022 + localStorage.setItem(STORAGE_KEY, JSON.stringify(data));
4023 + } catch (e) {
4024 + // localStorage not available
4025 + }
4026 + }
4027 +
4028 + /**
4029 + * Check if data should be reset (new day)
4030 + */
4031 + function shouldResetData(lastResetDate) {
4032 + var today = getTodayDate();
4033 + return lastResetDate !== today;
4034 + }
4035 +
4036 + /**
4037 + * Reset daily data
4038 + */
4039 + function resetDailyData() {
4040 + var newData = {
4041 + visitCount: 0,
4042 + showCount: 0,
4043 + lastResetDate: getTodayDate()
4044 + };
4045 + saveBannerData(newData);
4046 + return newData;
4047 + }
4048 +
4049 + /**
4050 + * Get today's date as string (YYYY-MM-DD)
4051 + */
4052 + function getTodayDate() {
4053 + var date = new Date();
4054 + var year = date.getFullYear();
4055 + var month = String(date.getMonth() + 1).padStart(2, '0');
4056 + var day = String(date.getDate()).padStart(2, '0');
4057 + return year + '-' + month + '-' + day;
4058 + }
4059 +
4060 + /**
4061 + * Check if banner should be shown based on rules
4062 + */
4063 + function shouldShowBanner(bannerData) {
4064 + // Check if already shown max times today
4065 + if (bannerData.showCount >= MAX_SHOWS_PER_DAY) {
4066 + return { show: false, delay: 0 };
4067 + }
4068 +
4069 + // Check visit count against rules
4070 + for (var i = 0; i < POPUP_RULES.length; i++) {
4071 + var rule = POPUP_RULES[i];
4072 + if (bannerData.visitCount === rule.visit) {
4073 + return { show: true, delay: rule.delay };
4074 + }
4075 + }
4076 +
4077 + return { show: false, delay: 0 };
4078 + }
4079 +
4080 + /**
4081 + * Close banner with animation
4082 + */
4083 + function closeBanner(banner) {
4084 + if (!banner) {
4085 + return;
4086 + }
4087 +
4088 + // Add closing animation class
4089 + banner.classList.add('ays-pro-banner-closing');
4090 +
4091 + // Wait for animation to complete
4092 + setTimeout(function() {
4093 + banner.style.display = 'none';
4094 + }, 400);
4095 + }
4096 +
4097 + // Polyfill for String.padStart (for older browsers)
4098 + if (!String.prototype.padStart) {
4099 + String.prototype.padStart = function(targetLength, padString) {
4100 + targetLength = targetLength >> 0;
4101 + padString = String(typeof padString !== 'undefined' ? padString : ' ');
4102 + if (this.length >= targetLength) {
4103 + return String(this);
4104 + } else {
4105 + targetLength = targetLength - this.length;
4106 + if (targetLength > padString.length) {
4107 + padString += padString.repeat(targetLength / padString.length);
4108 + }
4109 + return padString.slice(0, targetLength) + String(this);
4110 + }
4111 + };
4112 + }
4113 + })();
4114 +
4115 + function aysSurveyFooterBannerCopyToClipboard() {
4116 + var textarea = document.createElement('textarea');
4117 + textarea.value = 'SURVEYPRO20';
4118 + textarea.style.position = 'fixed';
4119 + textarea.style.opacity = '0';
4120 + document.body.appendChild(textarea);
4121 +
4122 + textarea.select();
4123 + textarea.setSelectionRange(0, 99999);
4124 +
4125 + try {
4126 + document.execCommand('copy');
4127 + aysSurveyFooterBannerShowCopyNotification('". esc_html__('Coupon code copied', 'survey-maker') ."');
4128 + } catch (err) {
4129 + console.error('Failed to copy text: ', err);
4130 + }
4131 +
4132 + document.body.removeChild(textarea);
4133 + }
4134 +
4135 + function aysSurveyFooterBannerShowCopyNotification(message) {
4136 + var existingNotification = document.querySelector('.ays-survey-footer-banner-copy-notification');
4137 + if (existingNotification) {
4138 + document.body.removeChild(existingNotification);
4139 + }
4140 +
4141 + var notification = document.createElement('div');
4142 + notification.className = 'ays-survey-footer-banner-copy-notification';
4143 + notification.textContent = message;
4144 + document.body.appendChild(notification);
4145 +
4146 + setTimeout(function() {
4147 + notification.classList.add('show');
4148 + }, 10);
4149 +
4150 + setTimeout(function() {
4151 + notification.classList.remove('show');
4152 + setTimeout(function() {
4153 + if (notification.parentNode) {
4154 + document.body.removeChild(notification);
4155 + }
4156 + }, 300);
4157 + }, 2000);
4158 + }";
4159 +
4160 + $content[] = '</script>';
4161 +
4162 + $content = implode( '', $content );
4163 + echo ($content);
4164 + }
3571 4165 }
3572 4166
3573 4167
3574 4168 // public function ays_survey_new_mega_bundle_message_2024($ishmar){