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 +135 -5 5.2.2.5 → 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"),
@@ -535,9 +572,9 @@
535 572 $this->capability,
536 573 $this->plugin_name,
537 574 array($this, 'display_plugin_surveys_page'),
538 575 SURVEY_MAKER_ADMIN_URL . '/images/icons/survey-make-menu-logo.svg',
539 - '6.21'
576 + '25.20'
540 577 );
541 578 add_action( "load-$hook_survey_maker", array( $this, 'add_tabs' ));
542 579 }
543 580
@@ -1723,15 +1760,16 @@
1723 1760
1724 1761 $ays_survey_maker_flag = intval(get_option('ays_survey_sale_btn'));
1725 1762 if( $ays_survey_maker_flag == 0 ){
1726 1763 if (isset($_GET['page']) && strpos($_GET['page'], SURVEY_MAKER_NAME) !== false) {
1727 - if(Survey_Maker_Admin::get_max_id('surveys') > 1){
1764 + // if(Survey_Maker_Admin::get_max_id('surveys') > 1){
1728 1765 // $this->ays_survey_new_halloween_bundle_message_2025($ays_survey_maker_flag);
1729 1766 // $this->ays_survey_black_friday_message($ays_survey_maker_flag);
1730 1767 // $this->ays_survey_christmas_banner_message_2025($ays_survey_maker_flag);
1731 - // $this->ays_survey_new_mega_bundle_message_2026($ays_survey_maker_flag);
1732 - $this->ays_survey_footer_sale_banner_2026($ays_survey_maker_flag);
1733 - }
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 + // }
1734 1772 }
1735 1773 }
1736 1774
1737 1775 }
@@ -3716,8 +3754,100 @@
3716 3754 $content = implode( '', $content );
3717 3755 echo html_entity_decode(esc_html( $content ));
3718 3756 }
3719 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 +
3720 3850
3721 3851 // Survey Footer Blue Banner Sale 20%
3722 3852 public function ays_survey_footer_sale_banner_2026($ishmar){
3723 3853 if($ishmar == 0 ){