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 | public/class-survey-maker-public.php +95 -4 5.2.3.7 → 5.2.4.1 View file →
@@ -240,12 +240,14 @@
240 240 }
241 241 }
242 242 }
243 243
244 - $survey_current_page_link = isset( $data['ays_'.$valid_name_prefix.'_current_page_link'] ) && $data['ays_'.$valid_name_prefix.'_current_page_link'] != '' ? sanitize_url( $data['ays_'.$valid_name_prefix.'_current_page_link'] ) : "";
244 + $survey_current_page_link = isset( $data['ays-survey-current_page_link'] ) && $data['ays-survey-current_page_link'] != '' ? sanitize_url( $data['ays-survey-current_page_link'] ) : "";
245 245
246 - $survey_current_page_link_html = "<a href='". esc_sql( $survey_current_page_link ) ."' target='_blank' class='ays-survey-current-page-link-a-tag'>". __( "Survey link", "survey-maker" ) ."</a>";
246 + $survey_current_page_title = isset( $data['ays-survey-current_page_title'] ) && $data['ays-survey-current_page_title'] != '' ? sanitize_text_field( $data['ays-survey-current_page_title'] ) : "";
247 247
248 + $survey_current_page_link_html = "<a href='". esc_sql( $survey_current_page_link ) ."' target='_blank' class='ays-survey-current-page-link-a-tag'>". __( "Survey link", "survey-maker" ) ."</a>";
249 +
248 250 // Survey modified date
249 251 $survey_modified_date = (isset($survey->date_modified) && $survey->date_modified != '') ? esc_attr( $survey->date_modified ) : "";
250 252 if( $survey_modified_date != "" ){
251 253 $survey_modified_date = date_i18n( get_option( 'date_format' ), strtotime( $survey_modified_date ) );
@@ -455,12 +457,26 @@
455 457
456 458 $get_site_title = get_bloginfo('name');
457 459 $get_site_description = get_bloginfo('description');
458 460
461 + // Survey category title
462 + $survey_category_title = "";
463 +
464 + $survey_cats = $survey->category_ids;
465 + $survey_category_ids = isset( $survey_cats ) && $survey_cats != "" ? sanitize_text_field( $survey_cats ) : '';
466 +
467 + if ( $survey_category_ids != '' ) {
468 + $categories = self::get_survey_category_by_ids($survey_category_ids);
469 + $category_names = wp_list_pluck( $categories, 'title' );
470 +
471 + $survey_category_title = implode( ', ', $category_names );
472 + }
473 +
459 474 $detectedDevice = Survey_Maker_Data::ays_survey_detected_device_chart();
460 475
461 476 $message_data = array(
462 477 'survey_title' => stripslashes($survey->title),
478 + 'survey_category_title' => $survey_category_title,
463 479 'survey_id' => stripslashes($survey->id),
464 480 'post_id' => $survey_current_post_id,
465 481 'user_name' => $user_name,
466 482 'user_email' => $user_email,
@@ -490,8 +506,9 @@
490 506 'current_survey_author_display_name' => $current_survey_author_display_name,
491 507 'current_survey_author_website_url' => $current_survey_author_website_url,
492 508 'current_survey_author_registered' => $current_survey_author_registered,
493 509 'current_survey_page_link' => $survey_current_page_link_html,
510 + 'current_survey_page_title' => $survey_current_page_title,
494 511 'admin_email' => $super_admin_email,
495 512 'home_page_url' => $wp_home_page_url,
496 513 'post_author_email' => $survey_current_post_author_email,
497 514 'post_author_nickname' => $survey_current_post_author_nickname,
@@ -1279,8 +1296,11 @@
1279 1296 $ays_survey_protocol = ((!empty($_SERVER['HTTPS']) && $_SERVER['HTTPS'] != 'off') || $_SERVER['SERVER_PORT'] == 443) ? "https://" : "http://";
1280 1297 $current_survey_page_link = esc_url( $ays_survey_protocol . $_SERVER['HTTP_HOST'] . $_SERVER['REQUEST_URI'] );
1281 1298 $content[] = '<input type="hidden" name="'. $this->html_name_prefix .'current_page_link" value="'. $current_survey_page_link .'">';
1282 1299
1300 + $current_survey_page_title = get_the_title();
1301 + $content[] = '<input type="hidden" name="'. $this->html_name_prefix .'current_page_title" value="'. $current_survey_page_title .'">';
1302 +
1283 1303 if( !$limit && !$is_expired ){
1284 1304 $content[] = $this->create_sections( $sections );
1285 1305 }else{
1286 1306 if( $is_expired && !$limit ){
@@ -2998,8 +3018,9 @@
2998 3018
2999 3019 $content[] = '
3000 3020 #' . $this->html_class_prefix . 'container-' . $this->unique_id_in_class . ' {
3001 3021 width: ' . $width . ';
3022 + box-sizing: border-box;
3002 3023 }
3003 3024
3004 3025 #' . $this->html_class_prefix . 'container-' . $this->unique_id_in_class . ' .' . $this->html_class_prefix . 'section-header {
3005 3026 border-top-color: ' . $this->options[ $this->name_prefix . 'color' ] . ' !important;
@@ -3729,8 +3750,28 @@
3729 3750 }
3730 3751 return $output;
3731 3752 }
3732 3753
3754 + public static function get_survey_category_by_ids($ids){
3755 + global $wpdb;
3756 +
3757 + $ids = array_map('intval', explode(',', $ids));
3758 + $ids = array_filter($ids);
3759 +
3760 + if (empty($ids)) {
3761 + return [];
3762 + }
3763 +
3764 + $ids_sql = implode(',', $ids);
3765 +
3766 + $sql = "SELECT *
3767 + FROM {$wpdb->prefix}ayssurvey_survey_categories
3768 + WHERE id IN ($ids_sql)
3769 + ORDER BY FIELD(id, $ids_sql)";
3770 +
3771 + return $wpdb->get_results($sql, ARRAY_A);
3772 + }
3773 +
3733 3774 public function ays_survey_popup_set_cookie(){
3734 3775 if( isset( $_REQUEST['id'] ) && $_REQUEST['id'] != '' ){
3735 3776 $id = sanitize_text_field( $_REQUEST['id'] );
3736 3777 }else{
@@ -3827,9 +3868,9 @@
3827 3868 $question_border_radius = $this->options[ $this->name_prefix . 'question_border_radius_mobile' ];
3828 3869 $content .= '
3829 3870 @media screen and (max-width: 640px){
3830 3871 #' . $this->html_class_prefix . 'container-' . $this->unique_id_in_class . ' {
3831 - max-width: '. $mobile_max_width .';
3872 + max-width: min('. $mobile_max_width .', calc(100vw - 20px));
3832 3873 }
3833 3874
3834 3875 #' . $this->html_class_prefix . 'container-' . $this->unique_id_in_class . ' {
3835 3876 width: ' . $mobile_width . ';
@@ -4190,8 +4231,11 @@
4190 4231
4191 4232 // Popup selector
4192 4233 $popup_selector = (isset($options["popup_selector"]) && $options["popup_selector"] != "") ? stripslashes( esc_attr($options["popup_selector"])) : "";
4193 4234
4235 + // Popup animation
4236 + $popup_animation = (isset($options["popup_animation"]) && $options["popup_animation"] != "") ? esc_attr($options["popup_animation"]) : "none";
4237 +
4194 4238 // Close by pressing the ESC
4195 4239 $survey_popup_enable_close_by_esc = (isset($options["popup_enable_close_by_esc"]) && $options["popup_enable_close_by_esc"] != '') ? $options["popup_enable_close_by_esc"] : 'off';
4196 4240
4197 4241
@@ -4263,13 +4307,15 @@
4263 4307 $display_popup_on_load = '';
4264 4308 break;
4265 4309 }
4266 4310
4311 + $popup_animation_class = in_array($popup_animation, array('fade', 'slide-down', 'slide-up', 'zoom-in', 'bounce'), true) && $popup_trigger_type != 'on_click' ? 'ays-popup-animation-' . $popup_animation : '';
4312 +
4267 4313 if( ! isset( $_COOKIE[ 'ays_survey_popup_cookie_name_' . $popup['id'] ] ) && ! isset( $_COOKIE[ 'ays_survey_popup_hide_after_click_close_' . $popup['id'] ] ) ){
4268 4314 if ($show_popup) {
4269 4315 $shortcode2 = '[ays_survey id="'. $popup['survey_id'] .'"]';
4270 4316 // $popup_survey_view = "<div class='ays-survey-popup-survey-window ays-survey-popup-modal-".$popup['id']."' data-id='".$popup['id']."'>
4271 - $popup_survey_view = "<div class='ays-survey-popup-survey-window ays-survey-popup-modal-".$popup['id']." ".$display_popup_on_load."' data-id='".$popup['id']."' data-close-popup='".$survey_enable_popup_close_after_finish."'>
4317 + $popup_survey_view = "<div class='ays-survey-popup-survey-window ays-survey-popup-modal-".$popup['id']." ".$display_popup_on_load." ".$popup_animation_class."' data-id='".$popup['id']."' data-close-popup='".$survey_enable_popup_close_after_finish."'>
4272 4318 <div class='ays-survey-popup-btn-close'>
4273 4319 <img class='ays-survey-popup-btn-close-icon' src='". SURVEY_MAKER_PUBLIC_URL ."/images/cross.svg'>
4274 4320 </div>";
4275 4321 $popup_survey_view .= "<div class='ays-survey-popup-content'>";
@@ -4404,8 +4450,9 @@
4404 4450 $popup_survey_view .= '
4405 4451 <style>
4406 4452 .ays-survey-popup-modal-' . $popup['id'] . ' {
4407 4453 width: ' . $popup_width_css . ';
4454 + box-sizing: border-box;
4408 4455 height: ' . $popup_height_css . ';
4409 4456 background-color: ' . $popup_bg_color . ';
4410 4457 top: ' . $ays_survey_popup_conteiner_pos_top . ';
4411 4458 left: ' . $ays_survey_popup_conteiner_pos_left . ';
@@ -4430,8 +4477,9 @@
4430 4477
4431 4478 @media screen and (max-width: 640px){
4432 4479 div.ays-survey-popup-modal-' . $popup['id'] . ' {
4433 4480 width: ' . ($popup_survey_width_mobile > 0 ? $popup_survey_width_mobile . ($popup_survey_width_mobile_by == 'percentage' ? '%' : 'px') : '100%') . ';
4481 + max-width: calc(100vw - 20px);
4434 4482 height: ' . ($popup_survey_height_mobile > 0 ? $popup_survey_height_mobile . ($popup_survey_height_mobile_by == 'percentage' ? '%' : 'px') : '100%') . ';
4435 4483 background-color: ' . $popup_bg_color_mobile . ';
4436 4484 }
4437 4485 .ays-survey-popup-modal-' . $popup['id'] . ' .ays-survey-popup-title-content{
@@ -4448,8 +4496,50 @@
4448 4496
4449 4497 </style>
4450 4498 ';
4451 4499
4500 + $popup_survey_view .= '<style type="text/css">';
4501 + $popup_survey_view .= "
4502 + @keyframes ays-popup-fade-in {
4503 + from { opacity: 0; }
4504 + to { opacity: 1; }
4505 + }
4506 + @keyframes ays-popup-slide-down {
4507 + from { opacity: 0; transform: translateY(-50px); }
4508 + to { opacity: 1; transform: translateY(0); }
4509 + }
4510 + @keyframes ays-popup-slide-up {
4511 + from { opacity: 0; transform: translateY(50px); }
4512 + to { opacity: 1; transform: translateY(0); }
4513 + }
4514 + @keyframes ays-popup-zoom-in {
4515 + from { opacity: 0; transform: scale(0.8); }
4516 + to { opacity: 1; transform: scale(1); }
4517 + }
4518 + @keyframes ays-popup-bounce {
4519 + 0% { opacity: 0; transform: scale(0.3); }
4520 + 50% { opacity: 1; transform: scale(1.05); }
4521 + 70% { transform: scale(0.9); }
4522 + 100% { transform: scale(1); }
4523 + }
4524 + .ays-survey-popup-survey-window.ays-popup-animation-fade {
4525 + animation: ays-popup-fade-in 0.3s ease-in-out;
4526 + }
4527 + .ays-survey-popup-survey-window.ays-popup-animation-slide-down {
4528 + animation: ays-popup-slide-down 0.4s ease-out;
4529 + }
4530 + .ays-survey-popup-survey-window.ays-popup-animation-slide-up {
4531 + animation: ays-popup-slide-up 0.4s ease-out;
4532 + }
4533 + .ays-survey-popup-survey-window.ays-popup-animation-zoom-in {
4534 + animation: ays-popup-zoom-in 0.3s ease-out;
4535 + }
4536 + .ays-survey-popup-survey-window.ays-popup-animation-bounce {
4537 + animation: ays-popup-bounce 0.5s ease-out;
4538 + }
4539 + ";
4540 + $popup_survey_view .= '</style>';
4541 +
4452 4542 $popup_survey_view .= '<script type="text/javascript">';
4453 4543
4454 4544 $popup_survey_view .= "
4455 4545 if(typeof aysSurveyPopupsOptions === 'undefined'){
@@ -4463,8 +4553,9 @@
4463 4553 'popup_close_after_finish_delay' => $survey_popup_close_after_finish_delay,
4464 4554 'popup_selector' => $popup_selector,
4465 4555 'popupEnableCloseByEsc' => $survey_popup_enable_close_by_esc,
4466 4556 'closePopupOverlayOutsideClick' => $close_popup_overlay_outside_click,
4557 + 'popup_animation' => $popup_animation,
4467 4558
4468 4559 ) ) ) . "';";
4469 4560 $popup_survey_view .= '</script>';
4470 4561 $popup_survey_view .= '</div>';