| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* The admin-specific functionality of the plugin. |
| 5 |
* |
| 6 |
* @link https://ays-pro.com/ |
| 7 |
* @since 1.0.0 |
| 8 |
* |
| 9 |
* @package Survey_Maker |
| 10 |
* @subpackage Survey_Maker/admin |
| 11 |
*/ |
| 12 |
|
| 13 |
/** |
| 14 |
* The admin-specific functionality of the plugin. |
| 15 |
* |
| 16 |
* Defines the plugin name, version, and two examples hooks for how to |
| 17 |
* enqueue the admin-specific stylesheet and JavaScript. |
| 18 |
* |
| 19 |
* @package Survey_Maker |
| 20 |
* @subpackage Survey_Maker/admin |
| 21 |
* @author Survey Maker team <info@ays-pro.com> |
| 22 |
*/ |
| 23 |
class Survey_Maker_Admin { |
| 24 |
|
| 25 |
/** |
| 26 |
* The ID of this plugin. |
| 27 |
* |
| 28 |
* @since 1.0.0 |
| 29 |
* @access private |
| 30 |
* @var string $plugin_name The ID of this plugin. |
| 31 |
*/ |
| 32 |
private $plugin_name; |
| 33 |
|
| 34 |
/** |
| 35 |
* The version of this plugin. |
| 36 |
* |
| 37 |
* @since 1.0.0 |
| 38 |
* @access private |
| 39 |
* @var string $version The current version of this plugin. |
| 40 |
*/ |
| 41 |
private $version; |
| 42 |
|
| 43 |
/** |
| 44 |
* The surveys list table object. |
| 45 |
* |
| 46 |
* @since 1.0.0 |
| 47 |
* @access private |
| 48 |
* @var object $surveys_obj The surveys list table object. |
| 49 |
*/ |
| 50 |
private $surveys_obj; |
| 51 |
|
| 52 |
/** |
| 53 |
* The surveys categories list table object. |
| 54 |
* |
| 55 |
* @since 1.0.0 |
| 56 |
* @access private |
| 57 |
* @var object $surveys_categories_obj The surveys categories list table object. |
| 58 |
*/ |
| 59 |
private $surveys_categories_obj; |
| 60 |
|
| 61 |
/** |
| 62 |
* The survey questions list table object. |
| 63 |
* |
| 64 |
* @since 1.0.0 |
| 65 |
* @access private |
| 66 |
* @var object $questions_obj The survey questions list table object. |
| 67 |
*/ |
| 68 |
private $questions_obj; |
| 69 |
|
| 70 |
/** |
| 71 |
* The survey questions categories list table object. |
| 72 |
* |
| 73 |
* @since 1.0.0 |
| 74 |
* @access private |
| 75 |
* @var object $question_categories_obj The survey questions categories list table object. |
| 76 |
*/ |
| 77 |
private $question_categories_obj; |
| 78 |
|
| 79 |
/** |
| 80 |
* The survey submissions list table object. |
| 81 |
* |
| 82 |
* @since 1.0.0 |
| 83 |
* @access private |
| 84 |
* @var object $results_obj The survey submissions list table object. |
| 85 |
*/ |
| 86 |
private $submissions_obj; |
| 87 |
|
| 88 |
/** |
| 89 |
* The survey questions categories list table object for each survey. |
| 90 |
* |
| 91 |
* @since 1.0.0 |
| 92 |
* @access private |
| 93 |
* @var object $each_result_obj The survey submissions list table object for each survey. |
| 94 |
*/ |
| 95 |
private $each_submission_obj; |
| 96 |
|
| 97 |
/** |
| 98 |
* The settings object of this plugin. |
| 99 |
* |
| 100 |
* @since 1.0.0 |
| 101 |
* @access private |
| 102 |
* @var object $settings_obj The settings object of this plugin. |
| 103 |
*/ |
| 104 |
private $settings_obj; |
| 105 |
|
| 106 |
/** |
| 107 |
* The capability of this plugin. |
| 108 |
* |
| 109 |
* @since 1.0.0 |
| 110 |
* @access private |
| 111 |
* @var string $capability The capability for users access to this plugin. |
| 112 |
*/ |
| 113 |
private $capability; |
| 114 |
|
| 115 |
private $popup_surveys_obj; |
| 116 |
private $requests_obj; |
| 117 |
|
| 118 |
/** |
| 119 |
* Initialize the class and set its properties. |
| 120 |
* |
| 121 |
* @since 1.0.0 |
| 122 |
* @param string $plugin_name The name of this plugin. |
| 123 |
* @param string $version The version of this plugin. |
| 124 |
*/ |
| 125 |
public function __construct( $plugin_name, $version ) { |
| 126 |
|
| 127 |
$this->plugin_name = $plugin_name; |
| 128 |
$this->version = $version; |
| 129 |
|
| 130 |
add_filter('set-screen-option', array(__CLASS__, 'set_screen'), 10, 3); |
| 131 |
// $per_page_array = array( |
| 132 |
// 'quizes_per_page', |
| 133 |
// 'questions_per_page', |
| 134 |
// 'quiz_categories_per_page', |
| 135 |
// 'question_categories_per_page', |
| 136 |
// 'attributes_per_page', |
| 137 |
// 'quiz_results_per_page', |
| 138 |
// 'quiz_each_results_per_page', |
| 139 |
// 'quiz_orders_per_page', |
| 140 |
// ); |
| 141 |
// foreach($per_page_array as $option_name){ |
| 142 |
// add_filter('set_screen_option_'.$option_name, array(__CLASS__, 'set_screen'), 10, 3); |
| 143 |
// } |
| 144 |
|
| 145 |
} |
| 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 |
|
| 182 |
/** |
| 183 |
* Register the stylesheets for the admin area. |
| 184 |
* |
| 185 |
* @since 1.0.0 |
| 186 |
*/ |
| 187 |
public function enqueue_styles( $hook_suffix ) { |
| 188 |
|
| 189 |
wp_enqueue_style( $this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'css/admin.css', array(), $this->version, 'all'); |
| 190 |
|
| 191 |
if (false !== strpos($hook_suffix, "plugins.php")){ |
| 192 |
wp_enqueue_style( $this->plugin_name . '-sweetalert-css', SURVEY_MAKER_PUBLIC_URL . '/css/survey-maker-sweetalert2.min.css', array(), $this->version, 'all'); |
| 193 |
} |
| 194 |
|
| 195 |
if (false === strpos($hook_suffix, $this->plugin_name)) |
| 196 |
return; |
| 197 |
|
| 198 |
// You need styling for the datepicker. For simplicity I've linked to the jQuery UI CSS on a CDN. |
| 199 |
// wp_register_style( 'jquery-ui', 'https://code.jquery.com/ui/1.12.1/themes/smoothness/jquery-ui.css' ); |
| 200 |
// wp_enqueue_style( 'jquery-ui' ); |
| 201 |
|
| 202 |
wp_enqueue_style('wp-color-picker'); |
| 203 |
wp_enqueue_style( $this->plugin_name . '-banner.css', plugin_dir_url(__FILE__) . 'css/banner.css', array(), $this->version, 'all'); |
| 204 |
// wp_enqueue_style( $this->plugin_name . '-banner-black-friday.css', plugin_dir_url(__FILE__) . 'css/survey-maker-banner-black-friday-2024.css', array(), $this->version, 'all'); |
| 205 |
// wp_enqueue_style( $this->plugin_name . '-banner-black-friday.css', plugin_dir_url(__FILE__) . 'css/survey-maker-banner.css', array(), $this->version, 'all'); |
| 206 |
// wp_enqueue_style( $this->plugin_name . '-mega-bundle-banner-2025.css', plugin_dir_url(__FILE__) . 'css/survey-maker-mega-bundle-banner-2025.css', array(), $this->version, 'all'); |
| 207 |
// wp_enqueue_style( $this->plugin_name . '-banner-christmas.css', plugin_dir_url(__FILE__) . 'css/survey-maker-banner-christmas-2024.css', array(), $this->version, 'all'); |
| 208 |
wp_enqueue_style( $this->plugin_name . '-animate.css', plugin_dir_url(__FILE__) . 'css/animate.css', array(), $this->version, 'all'); |
| 209 |
wp_enqueue_style( $this->plugin_name . '-animations.css', plugin_dir_url(__FILE__) . 'css/animations.css', array(), $this->version, 'all'); |
| 210 |
// wp_enqueue_style( $this->plugin_name . '-font-awesome', '//cdnjs.cloudflare.com/ajax/libs/font-awesome/4.7.0/css/font-awesome.min.css', array(), $this->version, 'all'); |
| 211 |
|
| 212 |
wp_enqueue_style($this->plugin_name . '-font-awesome', SURVEY_MAKER_PUBLIC_URL . '/css/survey-maker-font-awesome.min.css', array(), $this->version, 'all'); |
| 213 |
wp_enqueue_style( $this->plugin_name . '-font-awesome-icons', plugin_dir_url(__FILE__) . 'css/ays-font-awesome.css', array(), $this->version, 'all'); |
| 214 |
wp_enqueue_style( $this->plugin_name . '-select2', SURVEY_MAKER_PUBLIC_URL . '/css/survey-maker-select2.min.css', array(), $this->version, 'all'); |
| 215 |
wp_enqueue_style( $this->plugin_name . '-transition', SURVEY_MAKER_PUBLIC_URL . '/css/transition.min.css', array(), $this->version, 'all'); |
| 216 |
wp_enqueue_style( $this->plugin_name . '-dropdown', SURVEY_MAKER_PUBLIC_URL . '/css/dropdown.min.css', array(), $this->version, 'all'); |
| 217 |
wp_enqueue_style( $this->plugin_name . '-popup', plugin_dir_url(__FILE__) . 'css/popup.min.css', array(), $this->version, 'all'); |
| 218 |
wp_enqueue_style( $this->plugin_name . '-bootstrap', plugin_dir_url(__FILE__) . 'css/bootstrap.min.css', array(), $this->version, 'all'); |
| 219 |
wp_enqueue_style( $this->plugin_name . '-data-bootstrap', plugin_dir_url(__FILE__) . 'css/dataTables.bootstrap4.min.css', array(), $this->version, 'all'); |
| 220 |
wp_enqueue_style( $this->plugin_name . '-datetimepicker', plugin_dir_url(__FILE__) . 'css/jquery-ui-timepicker-addon.css', array(), $this->version, 'all'); |
| 221 |
|
| 222 |
wp_enqueue_style( $this->plugin_name . "-general", plugin_dir_url( __FILE__ ) . 'css/survey-maker-general.css', array(), time(), 'all' ); |
| 223 |
wp_enqueue_style( $this->plugin_name, plugin_dir_url( __FILE__ ) . 'css/survey-maker-admin.css', array(), time(), 'all' ); |
| 224 |
wp_enqueue_style( $this->plugin_name . "-admin-dashboard", plugin_dir_url( __FILE__ ) . 'css/survey-maker-admin-dashboard.css', array(), time(), 'all' ); |
| 225 |
wp_enqueue_style( $this->plugin_name . "-pro-features", plugin_dir_url( __FILE__ ) . 'css/survey-maker-pro-features.css', array(), time(), 'all' ); |
| 226 |
wp_enqueue_style( $this->plugin_name . "-loaders", plugin_dir_url(__FILE__) . 'css/loaders.css', array(), $this->version, 'all'); |
| 227 |
if( isset( $_GET['page'] ) && sanitize_key($_GET['page']) == $this->plugin_name . '-admin-dashboard' ){ |
| 228 |
wp_enqueue_style( $this->plugin_name . "-dashboard", plugin_dir_url( __FILE__ ) . 'css/survey-maker-dashboard.css', array(), $this->version, 'all' ); |
| 229 |
} |
| 230 |
|
| 231 |
} |
| 232 |
|
| 233 |
/** |
| 234 |
* Register the JavaScript for the admin area. |
| 235 |
* |
| 236 |
* @since 1.0.0 |
| 237 |
*/ |
| 238 |
public function enqueue_scripts( $hook_suffix ) { |
| 239 |
global $wp_version; |
| 240 |
|
| 241 |
$version1 = $wp_version; |
| 242 |
$operator = '>='; |
| 243 |
$version2 = '5.5'; |
| 244 |
$versionCompare = $this->aysSurveyMakerVersionCompare($version1, $operator, $version2); |
| 245 |
|
| 246 |
// $check_terms_agreement = get_option('survey_maker_agree_terms'); |
| 247 |
|
| 248 |
// if($check_terms_agreement === 'true' && strpos($hook_suffix, $this->plugin_name) !== false){ |
| 249 |
// wp_enqueue_script( $this->plugin_name.'-hotjar', plugin_dir_url(__FILE__) . 'js/extras/survey-maker-hotjar.js', array(), $this->version, false); |
| 250 |
// } |
| 251 |
|
| 252 |
if ($versionCompare) { |
| 253 |
wp_enqueue_script( $this->plugin_name.'-wp-load-scripts', plugin_dir_url(__FILE__) . 'js/survey-maker-wp-load-scripts.js', array(), $this->version, true); |
| 254 |
} |
| 255 |
|
| 256 |
if (false !== strpos($hook_suffix, "plugins.php")){ |
| 257 |
wp_enqueue_script( $this->plugin_name . '-sweetalert-js', SURVEY_MAKER_PUBLIC_URL . '/js/survey-maker-sweetalert2.all.min.js', array('jquery'), $this->version, true ); |
| 258 |
wp_enqueue_script( $this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'js/admin.js', array( 'jquery' ), $this->version, true ); |
| 259 |
wp_localize_script( $this->plugin_name . '-admin', 'SurveyMakerAdmin', array( |
| 260 |
'ajaxUrl' => admin_url( 'admin-ajax.php' ) |
| 261 |
) ); |
| 262 |
} |
| 263 |
|
| 264 |
if (false === strpos($hook_suffix, $this->plugin_name)) |
| 265 |
return; |
| 266 |
|
| 267 |
$survey_banner_date = self::ays_survey_update_banner_time(); |
| 268 |
wp_enqueue_script( 'jquery' ); |
| 269 |
wp_enqueue_script( 'jquery-effects-core' ); |
| 270 |
wp_enqueue_script( 'jquery-ui-sortable' ); |
| 271 |
wp_enqueue_script( 'jquery-ui-datepicker' ); |
| 272 |
wp_enqueue_media(); |
| 273 |
wp_enqueue_script( $this->plugin_name . '-color-picker-alpha', plugin_dir_url(__FILE__) . 'js/wp-color-picker-alpha.min.js', array( 'wp-color-picker' ), $this->version, true ); |
| 274 |
$color_picker_strings = array( |
| 275 |
'clear' => __( 'Clear', "survey-maker" ), |
| 276 |
'clearAriaLabel' => __( 'Clear color', "survey-maker" ), |
| 277 |
'defaultString' => __( 'Default', "survey-maker" ), |
| 278 |
'defaultAriaLabel' => __( 'Select default color', "survey-maker" ), |
| 279 |
'pick' => __( 'Select Color', "survey-maker" ), |
| 280 |
'defaultLabel' => __( 'Color value', "survey-maker" ), |
| 281 |
); |
| 282 |
wp_localize_script( $this->plugin_name . '-color-picker-alpha', 'wpColorPickerL10n', $color_picker_strings ); |
| 283 |
|
| 284 |
|
| 285 |
/* |
| 286 |
========================================== |
| 287 |
* Bootstrap |
| 288 |
* select2 |
| 289 |
* jQuery DataTables |
| 290 |
========================================== |
| 291 |
*/ |
| 292 |
wp_enqueue_script( $this->plugin_name . "-popper", plugin_dir_url(__FILE__) . 'js/popper.min.js', array( 'jquery' ), $this->version, true ); |
| 293 |
wp_enqueue_script( $this->plugin_name . "-bootstrap", plugin_dir_url(__FILE__) . 'js/bootstrap.min.js', array( 'jquery' ), $this->version, true ); |
| 294 |
wp_enqueue_script( $this->plugin_name . '-select2js', SURVEY_MAKER_PUBLIC_URL . '/js/survey-maker-select2.min.js', array('jquery'), $this->version, true); |
| 295 |
wp_enqueue_script( $this->plugin_name . '-sweetalert-js', SURVEY_MAKER_PUBLIC_URL . '/js/survey-maker-sweetalert2.all.min.js', array('jquery'), $this->version, true ); |
| 296 |
wp_enqueue_script( $this->plugin_name . '-datatable-min', SURVEY_MAKER_PUBLIC_URL . '/js/survey-maker-datatable.min.js', array('jquery'), $this->version, true); |
| 297 |
wp_enqueue_script( $this->plugin_name . '-transition-min', SURVEY_MAKER_PUBLIC_URL . '/js/transition.min.js', array('jquery'), $this->version, true); |
| 298 |
wp_enqueue_script( $this->plugin_name . '-dropdown-min', SURVEY_MAKER_PUBLIC_URL . '/js/dropdown.min.js', array('jquery'), $this->version, true); |
| 299 |
wp_enqueue_script( $this->plugin_name . "-db4.min.js", plugin_dir_url( __FILE__ ) . 'js/dataTables.bootstrap4.min.js', array( 'jquery' ), $this->version, true ); |
| 300 |
wp_enqueue_script( $this->plugin_name . "-datetimepicker", plugin_dir_url( __FILE__ ) . 'js/jquery-ui-timepicker-addon.js', array( 'jquery' ), $this->version, true ); |
| 301 |
wp_enqueue_script( $this->plugin_name . '-autosize', SURVEY_MAKER_PUBLIC_URL . '/js/survey-maker-autosize.js', array( 'jquery' ), $this->version, false ); |
| 302 |
|
| 303 |
/* |
| 304 |
================================================ |
| 305 |
Survey admin dashboard scripts (Google charts) |
| 306 |
================================================ |
| 307 |
*/ |
| 308 |
if ( strpos($hook_suffix, 'each-submission') !== false ) { |
| 309 |
wp_enqueue_script( $this->plugin_name . '-charts-google', plugin_dir_url(__FILE__) . 'js/google-chart.js', array('jquery'), $this->version, true); |
| 310 |
wp_enqueue_script( $this->plugin_name . '-charts', plugin_dir_url(__FILE__) . 'js/partials/survey-maker-admin-submissions-charts.js', array('jquery'), $this->version, true); |
| 311 |
} |
| 312 |
|
| 313 |
/* |
| 314 |
================================================ |
| 315 |
Quiz admin dashboard scripts (and for AJAX) |
| 316 |
================================================ |
| 317 |
*/ |
| 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); |
| 319 |
wp_enqueue_script( $this->plugin_name . "-functions", plugin_dir_url(__FILE__) . 'js/functions.js', array( 'jquery', 'wp-color-picker' ), $this->version, true ); |
| 320 |
wp_enqueue_script( $this->plugin_name . '-ajax', plugin_dir_url(__FILE__) . 'js/survey-maker-admin-ajax.js', array('jquery'), $this->version, true); |
| 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 ); |
| 323 |
wp_localize_script( $this->plugin_name, 'SurveyMakerAdmin', array( |
| 324 |
'surveyBannerDate' => $survey_banner_date, |
| 325 |
'ajaxUrl' => admin_url( 'admin-ajax.php' ), |
| 326 |
'nonce' => wp_create_nonce( 'ajax-nonce' ), |
| 327 |
'inputAnswerText' => __( 'Your answer', "survey-maker" ), |
| 328 |
// 'shortAnswerText' => __( 'Short answer text', "survey-maker" ), |
| 329 |
// 'numberAnswerText' => __( 'Number answer text', "survey-maker" ), |
| 330 |
'emailField' => __( 'Your email', "survey-maker" ), |
| 331 |
'nameField' => __( 'Your name', "survey-maker" ), |
| 332 |
'selectUserRoles' => __( 'Select user roles', "survey-maker" ), |
| 333 |
'phoneAnswerText' => __( 'Phone', "survey-maker" ), |
| 334 |
'addQuestion' => __( 'Add question', "survey-maker" ), |
| 335 |
'addSection' => __( 'Add section', "survey-maker" ), |
| 336 |
'duplicate' => __( 'Duplicate', "survey-maker" ), |
| 337 |
'delete' => __( 'Delete', "survey-maker" ), |
| 338 |
'addImage' => __( 'Add Image', "survey-maker" ), |
| 339 |
'editImage' => __( 'Edit Image', "survey-maker" ), |
| 340 |
'removeImage' => __( 'Remove Image', "survey-maker" ), |
| 341 |
'collapseSectionQuestions' => __( 'Collapse section questions', "survey-maker" ), |
| 342 |
'expandSectionQuestions' => __( 'Expand section questions', "survey-maker" ), |
| 343 |
'selectQuestionDefaultType' => __( 'Select question default type', "survey-maker" ), |
| 344 |
'chooseAnswer' => __( 'Choose answer', "survey-maker" ), |
| 345 |
'yes' => __( 'Yes', "survey-maker" ), |
| 346 |
'cancel' => __( 'Cancel', "survey-maker" ), |
| 347 |
'questionDeleteConfirmation' => __( 'Are you sure you want to delete this question?', "survey-maker" ), |
| 348 |
'sectionDeleteConfirmation' => __( 'Are you sure you want to delete this section?', "survey-maker" ), |
| 349 |
'loadResource' => __( "Can't load resource.", "survey-maker" ), |
| 350 |
'somethingWentWrong' => __( "Maybe something went wrong.", "survey-maker" ), |
| 351 |
'dataDeleted' => __( "Maybe the data has been deleted.", "survey-maker" ), |
| 352 |
'minimumCountOfQuestions' => __( 'Sorry minimum count of questions should be 1', "survey-maker" ), |
| 353 |
'enableMaxSelectionCount' => __( 'Enable selection count', "survey-maker" ), |
| 354 |
'enableSelectionCount' => __( 'Enable selection count', "survey-maker" ), |
| 355 |
'disableSelectionCount' => __( 'Disable selection count', "survey-maker" ), |
| 356 |
'enableMaxSelectionCount' => __( 'Enable selection count', "survey-maker" ), |
| 357 |
'disableMaxSelectionCount' => __( 'Disable max selection count', "survey-maker" ), |
| 358 |
'enableWordLimitation' => __( 'Enable word limitation', "survey-maker" ), |
| 359 |
'disableWordLimitation' => __( 'Disable word limitation', "survey-maker" ), |
| 360 |
'enableNumberLimitation' => __( 'Enable limitation', "survey-maker" ), |
| 361 |
'disableNumberLimitation' => __( 'Disable limitation', "survey-maker" ), |
| 362 |
'successfullySent' => __( 'Successfully sent', "survey-maker" ), |
| 363 |
'failed' => __( 'Failed', "survey-maker" ), |
| 364 |
'selectPage' => __( 'Select page', "survey-maker" ), |
| 365 |
'selectPostType' => __( 'Select post type', "survey-maker" ), |
| 366 |
'copied' => __( 'Copied!', "survey-maker"), |
| 367 |
'clickForCopy' => __( 'Click for copy', "survey-maker"), |
| 368 |
'moveToSection' => __( 'Move to section', "survey-maker"), |
| 369 |
'confirmMessageTemplate' => __( 'If you choose one of these templates, your questions will be deleted.', "survey-maker"), |
| 370 |
'okSurvey' => __( 'OK', "survey-maker"), |
| 371 |
'icons' => array( |
| 372 |
'radioButtonUnchecked' => SURVEY_MAKER_ADMIN_URL . '/images/icons/radio-button-unchecked.svg', |
| 373 |
'checkboxUnchecked' => SURVEY_MAKER_ADMIN_URL . '/images/icons/checkbox-unchecked.svg', |
| 374 |
'deleteTermsAndConds' => SURVEY_MAKER_ADMIN_URL. '/images/icons/trash.svg', |
| 375 |
), |
| 376 |
'nextSurveyPage' => __( 'Are you sure you want to go to the next survey page?', "survey-maker"), |
| 377 |
'prevSurveyPage' => __( 'Are you sure you want to go to the previous question page?', "survey-maker"), |
| 378 |
'addQuestionImageCaption' => __( 'Add a caption', "survey-maker"), |
| 379 |
'closeQuestionImageCaption' => __( 'Close caption', "survey-maker"), |
| 380 |
'deleteElementFromListTable' => __( 'Are you sure you want to delete?', "survey-maker"), |
| 381 |
'maxInputVarsWarningMessage' => __( 'Note: The survey has reached the limit of %t inputs out of a maximum of %f. To save changes, please contact your hosting provider to increase the max_input_vars limit.', "survey-maker"), |
| 382 |
'rating' => __( 'Rating', "survey-maker"), |
| 383 |
'stars_count' => __( 'Stars count', "survey-maker"), |
| 384 |
"preivewSurvey" => __( "Preview Survey", 'survey-maker' ), |
| 385 |
'activate' => __( 'Activate', "survey-maker" ), |
| 386 |
'activated' => __( 'Activated', "survey-maker" ), |
| 387 |
'successCopyCoupon' => __( "Coupon code copied!", 'survey-maker' ), |
| 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' ), |
| 399 |
) ); |
| 400 |
wp_localize_script($this->plugin_name . '-ajax', 'survey_maker_ajax', array( |
| 401 |
'ajax_url' => admin_url('admin-ajax.php'), |
| 402 |
"emptyEmailError" => __( 'Email field is empty', "survey-maker"), |
| 403 |
'selectUser' => __( 'Select user', 'survey-maker'), |
| 404 |
'searching' => __( "Searching...", 'survey-maker' ), |
| 405 |
'pleaseEnterMore' => __( "Please enter 1 or more characters", 'survey-maker' ), |
| 406 |
"invalidEmailError" => __( 'Invalid Email address', "survey-maker"), |
| 407 |
"emptyWebsiteError" => __( 'Website field is empty', "survey-maker"), |
| 408 |
"invalidWebsiteError" => __( 'Invalid website address', "survey-maker"), |
| 409 |
"thankYouMessage" => __( 'Your request was successfully submitted. We will get in touch with you until November 10. Thank you!', "survey-maker"), |
| 410 |
)); |
| 411 |
|
| 412 |
} |
| 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 |
|
| 428 |
/** |
| 429 |
* De-register JavaScript files for the admin area. |
| 430 |
* |
| 431 |
* @since 1.0.0 |
| 432 |
*/ |
| 433 |
public function disable_scripts($hook_suffix) { |
| 434 |
if (false !== strpos($hook_suffix, $this->plugin_name)) { |
| 435 |
if (is_plugin_active('ai-engine/ai-engine.php')) { |
| 436 |
wp_deregister_script('mwai'); |
| 437 |
wp_deregister_script('mwai-vendor'); |
| 438 |
wp_dequeue_script('mwai'); |
| 439 |
wp_dequeue_script('mwai-vendor'); |
| 440 |
} |
| 441 |
if (is_plugin_active('html5-video-player/html5-video-player.php')) { |
| 442 |
wp_dequeue_style('h5vp-admin'); |
| 443 |
wp_dequeue_style('fs_common'); |
| 444 |
} |
| 445 |
if (is_plugin_active('wp-social/wp-social.php')) { |
| 446 |
wp_dequeue_style('wp_social_select2_css'); |
| 447 |
wp_deregister_script('wp_social_select2_js'); |
| 448 |
wp_dequeue_script('wp_social_select2_js'); |
| 449 |
} |
| 450 |
if (is_plugin_active('real-media-library-lite/index.php')) { |
| 451 |
wp_dequeue_style('real-media-library-lite-rml'); |
| 452 |
} |
| 453 |
|
| 454 |
if (is_plugin_active('happyforms/happyforms.php')) { |
| 455 |
wp_dequeue_style('happyforms-admin'); |
| 456 |
} |
| 457 |
|
| 458 |
if (is_plugin_active('ultimate-viral-quiz/index.php')) { |
| 459 |
wp_dequeue_style('select2'); |
| 460 |
wp_dequeue_style('dataTables'); |
| 461 |
|
| 462 |
wp_dequeue_script('sweetalert'); |
| 463 |
wp_dequeue_script('select2'); |
| 464 |
wp_dequeue_script('dataTables'); |
| 465 |
} |
| 466 |
|
| 467 |
if (is_plugin_active('forms-by-made-it/madeit-form.php')) { |
| 468 |
wp_dequeue_style('madeit-form-admin-style'); |
| 469 |
} |
| 470 |
|
| 471 |
if (is_plugin_active('search-replace-for-block-editor/search-replace-for-block-editor.php')) { |
| 472 |
wp_deregister_script('search-replace-for-block-editor'); |
| 473 |
wp_dequeue_script('search-replace-for-block-editor'); |
| 474 |
} |
| 475 |
|
| 476 |
|
| 477 |
// Theme | Phlox 2.17.6 |
| 478 |
wp_dequeue_style('auxin-admin-style'); |
| 479 |
|
| 480 |
// Theme | Pixel Ebook Store |
| 481 |
wp_dequeue_style('pixel-ebook-store-free-demo-content-style'); |
| 482 |
|
| 483 |
// Theme | Interactive Education |
| 484 |
wp_dequeue_style('interactive-education-free-demo-content-style'); |
| 485 |
|
| 486 |
|
| 487 |
|
| 488 |
} |
| 489 |
} |
| 490 |
|
| 491 |
public function codemirror_enqueue_scripts($hook) { |
| 492 |
if(strpos($hook, $this->plugin_name) !== false){ |
| 493 |
if(function_exists('wp_enqueue_code_editor')){ |
| 494 |
$cm_settings['codeEditor'] = wp_enqueue_code_editor(array( |
| 495 |
'type' => 'text/css', |
| 496 |
'codemirror' => array( |
| 497 |
'inputStyle' => 'contenteditable', |
| 498 |
'theme' => 'cobalt', |
| 499 |
) |
| 500 |
)); |
| 501 |
|
| 502 |
wp_enqueue_script('wp-theme-plugin-editor'); |
| 503 |
wp_localize_script('wp-theme-plugin-editor', 'cm_settings', $cm_settings); |
| 504 |
|
| 505 |
wp_enqueue_style('wp-codemirror'); |
| 506 |
} |
| 507 |
} |
| 508 |
} |
| 509 |
|
| 510 |
public function aysSurveyMakerVersionCompare($version1, $operator, $version2) { |
| 511 |
|
| 512 |
$_fv = intval ( trim ( str_replace ( '.', '', $version1 ) ) ); |
| 513 |
$_sv = intval ( trim ( str_replace ( '.', '', $version2 ) ) ); |
| 514 |
|
| 515 |
if (strlen ( $_fv ) > strlen ( $_sv )) { |
| 516 |
$_sv = str_pad ( $_sv, strlen ( $_fv ), 0 ); |
| 517 |
} |
| 518 |
|
| 519 |
if (strlen ( $_fv ) < strlen ( $_sv )) { |
| 520 |
$_fv = str_pad ( $_fv, strlen ( $_sv ), 0 ); |
| 521 |
} |
| 522 |
|
| 523 |
return version_compare ( ( string ) $_fv, ( string ) $_sv, $operator ); |
| 524 |
} |
| 525 |
|
| 526 |
/** |
| 527 |
* Register the administration menu for this plugin into the WordPress Dashboard menu. |
| 528 |
* |
| 529 |
* @since 1.0.0 |
| 530 |
*/ |
| 531 |
public function add_plugin_admin_menu(){ |
| 532 |
|
| 533 |
/* |
| 534 |
* Add a settings page for this plugin to the Settings menu. |
| 535 |
* |
| 536 |
* NOTE: Alternative menu locations are available via WordPress administration menu functions. |
| 537 |
* |
| 538 |
* Administration Menus: http://codex.wordpress.org/Administration_Menus |
| 539 |
* |
| 540 |
*/ |
| 541 |
|
| 542 |
$setting_actions = new Survey_Maker_Settings_Actions($this->plugin_name); |
| 543 |
$options = ($setting_actions->ays_get_setting('options') === false) ? array() : json_decode( stripcslashes( $setting_actions->ays_get_setting('options') ), true); |
| 544 |
|
| 545 |
// Disable Survey Maker menu item notification |
| 546 |
$options['survey_disable_survey_menu_notification'] = isset($options['survey_disable_survey_menu_notification']) ? esc_attr( $options['survey_disable_survey_menu_notification'] ) : 'off'; |
| 547 |
$survey_disable_survey_menu_notification = (isset($options['survey_disable_survey_menu_notification']) && esc_attr( $options['survey_disable_survey_menu_notification'] ) == "on") ? true : false; |
| 548 |
|
| 549 |
if( $survey_disable_survey_menu_notification ){ |
| 550 |
$menu_item = 'Survey Maker'; |
| 551 |
} else { |
| 552 |
global $wpdb; |
| 553 |
// $sql = "SELECT COUNT(*) FROM " . esc_sql( $wpdb->prefix . SURVEY_MAKER_DB_PREFIX ) . "submissions WHERE `read` = 0 OR `read` = 2 "; |
| 554 |
$sql = $wpdb->prepare(" |
| 555 |
SELECT COUNT(*) |
| 556 |
FROM " . esc_sql($wpdb->prefix . SURVEY_MAKER_DB_PREFIX) . "submissions AS s |
| 557 |
INNER JOIN " . esc_sql($wpdb->prefix . SURVEY_MAKER_DB_PREFIX) . "surveys AS surv |
| 558 |
ON s.survey_id = surv.id |
| 559 |
WHERE (s.read = 0 OR s.read = 2) |
| 560 |
AND surv.status != %s |
| 561 |
", 'trashed'); |
| 562 |
$unread_results_count = intval( $wpdb->get_var( $sql ) ); |
| 563 |
$menu_item = ($unread_results_count == 0) ? 'Survey Maker' : 'Survey Maker' . '<span class="ays-survey-menu-badge ays-survey-results-bage">' . $unread_results_count . '</span>'; |
| 564 |
} |
| 565 |
|
| 566 |
$this->capability = $this->survey_maker_capabilities(); |
| 567 |
$capability = $this->capability; |
| 568 |
|
| 569 |
$hook_survey_maker =add_menu_page( |
| 570 |
'Survey Maker', |
| 571 |
$menu_item, |
| 572 |
$this->capability, |
| 573 |
$this->plugin_name, |
| 574 |
array($this, 'display_plugin_surveys_page'), |
| 575 |
SURVEY_MAKER_ADMIN_URL . '/images/icons/survey-make-menu-logo.svg', |
| 576 |
'25.20' |
| 577 |
); |
| 578 |
add_action( "load-$hook_survey_maker", array( $this, 'add_tabs' )); |
| 579 |
} |
| 580 |
|
| 581 |
public function add_plugin_surveys_submenu(){ |
| 582 |
$hook_survey_maker = add_submenu_page( |
| 583 |
$this->plugin_name, |
| 584 |
__('Surveys', "survey-maker"), |
| 585 |
__('Surveys', "survey-maker"), |
| 586 |
$this->capability, |
| 587 |
$this->plugin_name, |
| 588 |
array($this, 'display_plugin_surveys_page') |
| 589 |
); |
| 590 |
|
| 591 |
add_action("load-$hook_survey_maker", array($this, 'screen_option_surveys')); |
| 592 |
add_action("load-$hook_survey_maker", array($this, 'add_tabs')); |
| 593 |
} |
| 594 |
|
| 595 |
public function add_plugin_export_import_submenu(){ |
| 596 |
$hook_exp_imp = add_submenu_page( |
| 597 |
$this->plugin_name, |
| 598 |
__('Export / Import', "survey-maker"), |
| 599 |
__('Export / Import', "survey-maker"), |
| 600 |
$this->capability, |
| 601 |
$this->plugin_name . '-export-import', |
| 602 |
array($this, 'display_plugin_export_import_page') |
| 603 |
); |
| 604 |
|
| 605 |
// add_action("load-$hook_exp_imp", array($this, 'screen_option_questions')); |
| 606 |
add_action("load-$hook_exp_imp", array($this, 'add_tabs')); |
| 607 |
} |
| 608 |
|
| 609 |
public function add_plugin_survey_categories_submenu(){ |
| 610 |
$hook_survey_categories = add_submenu_page( |
| 611 |
$this->plugin_name, |
| 612 |
__('Survey Categories', "survey-maker"), |
| 613 |
__('Survey Categories', "survey-maker"), |
| 614 |
$this->capability, |
| 615 |
$this->plugin_name . '-survey-categories', |
| 616 |
array($this, 'display_plugin_survey_categories_page') |
| 617 |
); |
| 618 |
|
| 619 |
add_action("load-$hook_survey_categories", array($this, 'screen_option_survey_categories')); |
| 620 |
add_action("load-$hook_survey_categories", array($this, 'add_tabs')); |
| 621 |
} |
| 622 |
|
| 623 |
public function add_plugin_submissions_submenu(){ |
| 624 |
global $wpdb; |
| 625 |
|
| 626 |
$setting_actions = new Survey_Maker_Settings_Actions($this->plugin_name); |
| 627 |
$options = ($setting_actions->ays_get_setting('options') === false) ? array() : json_decode( stripcslashes( $setting_actions->ays_get_setting('options') ), true); |
| 628 |
|
| 629 |
// Disable Submissions menu item notification |
| 630 |
$options['survey_disable_submission_menu_notification'] = isset($options['survey_disable_submission_menu_notification']) ? esc_attr( $options['survey_disable_submission_menu_notification'] ) : 'off'; |
| 631 |
$survey_disable_submission_menu_notification = (isset($options['survey_disable_submission_menu_notification']) && esc_attr( $options['survey_disable_submission_menu_notification'] ) == "on") ? true : false; |
| 632 |
|
| 633 |
if( $survey_disable_submission_menu_notification ){ |
| 634 |
$results_text = __('Submissions', "survey-maker"); |
| 635 |
$menu_item = __('Submissions', "survey-maker"); |
| 636 |
} else { |
| 637 |
// $sql = "SELECT COUNT(*) FROM " . esc_sql( $wpdb->prefix . SURVEY_MAKER_DB_PREFIX ) . "submissions WHERE `read` = 0 OR `read` = 2 "; |
| 638 |
$sql = $wpdb->prepare(" |
| 639 |
SELECT COUNT(*) |
| 640 |
FROM " . esc_sql($wpdb->prefix . SURVEY_MAKER_DB_PREFIX) . "submissions AS subs |
| 641 |
INNER JOIN " . esc_sql($wpdb->prefix . SURVEY_MAKER_DB_PREFIX) . "surveys AS survs |
| 642 |
ON subs.survey_id = survs.id |
| 643 |
WHERE (subs.read = 0 OR subs.read = 2) |
| 644 |
AND survs.status != %s |
| 645 |
", 'trashed'); |
| 646 |
$unread_results_count = intval( $wpdb->get_var( $sql ) ); |
| 647 |
|
| 648 |
$results_text = __('Submissions', "survey-maker"); |
| 649 |
$menu_item = ( $unread_results_count == 0 ) ? $results_text : $results_text . '<span class="ays-survey-menu-badge ays-survey-results-bage">' . $unread_results_count . '</span>'; |
| 650 |
} |
| 651 |
|
| 652 |
|
| 653 |
$hook_submissions = add_submenu_page( |
| 654 |
$this->plugin_name, |
| 655 |
$results_text, |
| 656 |
$menu_item, |
| 657 |
$this->capability, |
| 658 |
$this->plugin_name . '-submissions', |
| 659 |
array($this, 'display_plugin_submissions_page') |
| 660 |
); |
| 661 |
|
| 662 |
add_action("load-$hook_submissions", array($this, 'screen_option_submissions')); |
| 663 |
add_action("load-$hook_submissions", array($this, 'add_tabs')); |
| 664 |
|
| 665 |
$hook_each_submission = add_submenu_page( |
| 666 |
'each_submission_slug', |
| 667 |
__('Each', "survey-maker"), |
| 668 |
null, |
| 669 |
$this->capability, |
| 670 |
$this->plugin_name . '-each-submission', |
| 671 |
array($this, 'display_plugin_each_submission_page') |
| 672 |
); |
| 673 |
|
| 674 |
add_action("load-$hook_each_submission", array($this, 'screen_option_each_survey_submission')); |
| 675 |
add_action("load-$hook_each_submission", array($this, 'add_tabs')); |
| 676 |
|
| 677 |
add_filter('parent_file', array($this,'survey_maker_select_submenu')); |
| 678 |
} |
| 679 |
|
| 680 |
public function add_plugin_dashboard_submenu(){ |
| 681 |
$hook_quizes = add_submenu_page( |
| 682 |
$this->plugin_name, |
| 683 |
__('How to use', "survey-maker"), |
| 684 |
__('How to use', "survey-maker"), |
| 685 |
$this->capability, |
| 686 |
$this->plugin_name . '-dashboard', |
| 687 |
array($this, 'display_plugin_setup_page') |
| 688 |
); |
| 689 |
add_action("load-$hook_quizes", array($this, 'add_tabs')); |
| 690 |
} |
| 691 |
|
| 692 |
public function add_plugin_general_settings_submenu(){ |
| 693 |
$hook_settings = add_submenu_page( $this->plugin_name, |
| 694 |
__('General Settings', "survey-maker"), |
| 695 |
__('General Settings', "survey-maker"), |
| 696 |
'manage_options', |
| 697 |
$this->plugin_name . '-settings', |
| 698 |
array($this, 'display_plugin_settings_page') |
| 699 |
); |
| 700 |
add_action("load-$hook_settings", array($this, 'screen_option_settings')); |
| 701 |
add_action("load-$hook_settings", array($this, 'add_tabs')); |
| 702 |
} |
| 703 |
|
| 704 |
public function add_plugin_featured_plugins_submenu(){ |
| 705 |
$hook_featured_plugins = add_submenu_page( $this->plugin_name, |
| 706 |
__('Our products', "survey-maker"), |
| 707 |
__('Our products', "survey-maker"), |
| 708 |
$this->capability, |
| 709 |
$this->plugin_name . '-our-products', |
| 710 |
array($this, 'display_plugin_featured_plugins_page') |
| 711 |
); |
| 712 |
add_action("load-$hook_featured_plugins", array($this, 'add_tabs')); |
| 713 |
} |
| 714 |
|
| 715 |
public function add_plugin_survey_features_plugins_submenu(){ |
| 716 |
$hook_pro_features = add_submenu_page( $this->plugin_name, |
| 717 |
__('PRO Features', "survey-maker"), |
| 718 |
__('PRO Features', "survey-maker"), |
| 719 |
$this->capability, |
| 720 |
$this->plugin_name . '-survey-features', |
| 721 |
array($this, 'display_plugin_features_page') |
| 722 |
); |
| 723 |
add_action("load-$hook_pro_features", array($this, 'add_tabs')); |
| 724 |
} |
| 725 |
|
| 726 |
public function add_plugin_subscribe_email(){ |
| 727 |
$hook_grab_your_gift = add_submenu_page( |
| 728 |
$this->plugin_name, |
| 729 |
__('Grab your GIFT', "survey-maker"), |
| 730 |
__('Grab your GIFT', "survey-maker"), |
| 731 |
'manage_options', |
| 732 |
$this->plugin_name . '-survey-subscribe-email', |
| 733 |
array($this, 'display_plugin_subscribe_email') |
| 734 |
); |
| 735 |
|
| 736 |
add_action("load-$hook_grab_your_gift", array( $this, 'add_tabs' )); |
| 737 |
} |
| 738 |
|
| 739 |
public function add_plugin_popup_surveys_submenu(){ |
| 740 |
$hook_popup_surveys = add_submenu_page( |
| 741 |
$this->plugin_name, |
| 742 |
__('Popup Survey', "survey-maker"), |
| 743 |
__('Popup Survey', "survey-maker"), |
| 744 |
$this->capability, |
| 745 |
$this->plugin_name . '-popup-surveys', |
| 746 |
array($this, 'display_plugin_popup_surveys_page') |
| 747 |
); |
| 748 |
|
| 749 |
add_action("load-$hook_popup_surveys", array($this, 'screen_option_popup_surveys')); |
| 750 |
add_action("load-$hook_popup_surveys", array($this, 'add_tabs')); |
| 751 |
} |
| 752 |
|
| 753 |
public function add_plugin_admin_dashboard_menu(){ |
| 754 |
|
| 755 |
if (!doing_action('admin_menu')) { |
| 756 |
return; |
| 757 |
} |
| 758 |
|
| 759 |
$menuHook = add_submenu_page( |
| 760 |
$this->plugin_name, |
| 761 |
__('Dashboard', 'survey-maker'), |
| 762 |
__('Dashboard', 'survey-maker'), |
| 763 |
'manage_options', |
| 764 |
$this->plugin_name . '-admin-dashboard', |
| 765 |
array($this, 'display_plugin_admin_dashboard_page'), |
| 766 |
40 |
| 767 |
); |
| 768 |
|
| 769 |
if (!$menuHook) { |
| 770 |
return; |
| 771 |
} |
| 772 |
|
| 773 |
add_action("load-$menuHook", array($this, 'add_tabs')); |
| 774 |
} |
| 775 |
|
| 776 |
public function add_plugin_survey_front_requests_submenu(){ |
| 777 |
$hook_requests = add_submenu_page( |
| 778 |
$this->plugin_name, |
| 779 |
__('Frontend Requests', "survey-maker"), |
| 780 |
__('Frontend Requests', "survey-maker"), |
| 781 |
$this->capability, |
| 782 |
$this->plugin_name . '-requests', |
| 783 |
array($this, 'display_plugin_requests_page') |
| 784 |
); |
| 785 |
$this->requests_obj = new Survey_Requests_List_Table($this->plugin_name); |
| 786 |
|
| 787 |
add_action("load-$hook_requests", array($this, 'add_tabs')); |
| 788 |
} |
| 789 |
|
| 790 |
public function survey_maker_select_submenu($file) { |
| 791 |
global $plugin_page; |
| 792 |
if ($this->plugin_name."-each-submission" == $plugin_page) { |
| 793 |
$plugin_page = $this->plugin_name."-submissions"; |
| 794 |
} |
| 795 |
return $file; |
| 796 |
} |
| 797 |
|
| 798 |
protected function survey_maker_capabilities(){ |
| 799 |
global $wpdb; |
| 800 |
return 'manage_options'; |
| 801 |
|
| 802 |
// $sql = "SELECT meta_value FROM {$wpdb->prefix}aysquiz_settings WHERE `meta_key` = 'user_roles'"; |
| 803 |
// $result = $wpdb->get_var($sql); |
| 804 |
|
| 805 |
// $capability = 'manage_options'; |
| 806 |
// if($result !== null){ |
| 807 |
// $ays_user_roles = json_decode($result, true); |
| 808 |
// if(is_user_logged_in()){ |
| 809 |
// $current_user = wp_get_current_user(); |
| 810 |
// $current_user_roles = $current_user->roles; |
| 811 |
// $ishmar = 0; |
| 812 |
// foreach($current_user_roles as $r){ |
| 813 |
// if(in_array($r, $ays_user_roles)){ |
| 814 |
// $ishmar++; |
| 815 |
// } |
| 816 |
// } |
| 817 |
// if($ishmar > 0){ |
| 818 |
// $capability = "read"; |
| 819 |
// } |
| 820 |
// } |
| 821 |
// } |
| 822 |
// return $capability; |
| 823 |
} |
| 824 |
|
| 825 |
|
| 826 |
/** |
| 827 |
* Add settings action link to the plugins page. |
| 828 |
* |
| 829 |
* @since 1.0.0 |
| 830 |
*/ |
| 831 |
public function add_action_links($links){ |
| 832 |
/* |
| 833 |
* Documentation : https://codex.wordpress.org/Plugin_API/Filter_Reference/plugin_action_links_(plugin_file_name) |
| 834 |
*/ |
| 835 |
|
| 836 |
$survey_ajax_deactivate_plugin_nonce = wp_create_nonce( 'survey-maker-ajax-deactivate-plugin-nonce' ); |
| 837 |
|
| 838 |
$settings_link = array( |
| 839 |
'<a href="' . admin_url('admin.php?page=' . $this->plugin_name) . '">' . __('Settings', "survey-maker") . '</a>', |
| 840 |
'<a href="https://ays-demo.com/wordpress-survey-plugin-free-demo/" target="_blank">' . __('Demo', "survey-maker") . '</a>', |
| 841 |
'<a href="https://ays-pro.com/wordpress/survey-maker?utm_source=survey-maker-free&utm_medium=dashboard&utm_campaign=buy-now-plugins" target="_blank" class="ays-survey-admin-upgrade-button">' . __('Upgrade', "survey-maker") . '</a> |
| 842 |
<input type="hidden" id="ays_survey_ajax_deactivate_plugin_nonce" name="ays_survey_ajax_deactivate_plugin_nonce" value="' . $survey_ajax_deactivate_plugin_nonce .'">', |
| 843 |
); |
| 844 |
return array_merge($settings_link, $links); |
| 845 |
|
| 846 |
} |
| 847 |
|
| 848 |
|
| 849 |
public function add_survey_row_meta( $links, $file ) { |
| 850 |
if ( SURVEY_MAKER_BASENAME == $file ) { |
| 851 |
$row_meta = array( |
| 852 |
'ays-survey-support' => '<a href="' . esc_url( 'https://wordpress.org/support/plugin/survey-maker/' ) . '" target="_blank">' . esc_html__( 'Free Support', "survey-maker" ) . '</a>', |
| 853 |
'ays-survey-documentation' => '<a href="' . esc_url( 'https://ays-pro.com/wordpress-survey-maker-user-manual' ) . '" target="_blank">' . esc_html__( 'Documentation', "survey-maker" ) . '</a>', |
| 854 |
'ays-survey-rate-us' => '<a href="' . esc_url( 'https://wordpress.org/support/plugin/survey-maker/reviews/?rate=5#new-post' ) . '" target="_blank">' . esc_html__( 'Rate us', "survey-maker" ) . '</a>', |
| 855 |
'ays-survey-rate-us' => '<a href="' . esc_url( 'https://www.youtube.com/channel/UC-1vioc90xaKjE7stq30wmA' ) . '" target="_blank">' . esc_html__( 'Video tutorial', "survey-maker" ) . '</a>', |
| 856 |
); |
| 857 |
|
| 858 |
return array_merge( $links, $row_meta ); |
| 859 |
} |
| 860 |
return $links; |
| 861 |
} |
| 862 |
|
| 863 |
/** |
| 864 |
* Render the settings page for this plugin. |
| 865 |
* |
| 866 |
* @since 1.0.0 |
| 867 |
*/ |
| 868 |
public function display_plugin_setup_page(){ |
| 869 |
include_once('partials/survey-maker-admin-display.php'); |
| 870 |
} |
| 871 |
|
| 872 |
public function display_plugin_surveys_page(){ |
| 873 |
$action = (isset($_GET['action'])) ? sanitize_text_field($_GET['action']) : ''; |
| 874 |
switch ($action) { |
| 875 |
case 'add': |
| 876 |
include_once('partials/surveys/actions/survey-maker-surveys-actions.php'); |
| 877 |
break; |
| 878 |
case 'edit': |
| 879 |
include_once('partials/surveys/actions/survey-maker-surveys-actions.php'); |
| 880 |
break; |
| 881 |
default: |
| 882 |
include_once('partials/surveys/survey-maker-surveys-display.php'); |
| 883 |
} |
| 884 |
} |
| 885 |
|
| 886 |
public function display_plugin_survey_categories_page(){ |
| 887 |
$action = (isset($_GET['action'])) ? sanitize_text_field($_GET['action']) : ''; |
| 888 |
|
| 889 |
switch ($action) { |
| 890 |
case 'add': |
| 891 |
include_once('partials/surveys/actions/survey-maker-survey-categories-actions.php'); |
| 892 |
break; |
| 893 |
case 'edit': |
| 894 |
include_once('partials/surveys/actions/survey-maker-survey-categories-actions.php'); |
| 895 |
break; |
| 896 |
default: |
| 897 |
include_once('partials/surveys/survey-maker-survey-categories-display.php'); |
| 898 |
} |
| 899 |
} |
| 900 |
|
| 901 |
|
| 902 |
public function display_plugin_popup_surveys_page(){ |
| 903 |
$action = (isset($_GET['action'])) ? sanitize_text_field($_GET['action']) : ''; |
| 904 |
|
| 905 |
switch ($action) { |
| 906 |
case 'add': |
| 907 |
include_once('partials/popup/actions/survey-maker-popup-surveys-actions.php'); |
| 908 |
break; |
| 909 |
case 'edit': |
| 910 |
include_once('partials/popup/actions/survey-maker-popup-surveys-actions.php'); |
| 911 |
break; |
| 912 |
default: |
| 913 |
include_once('partials/popup/survey-maker-popups-display.php'); |
| 914 |
} |
| 915 |
} |
| 916 |
|
| 917 |
public function display_plugin_requests_page(){ |
| 918 |
include_once('partials/requests/survey-maker-requests-display.php'); |
| 919 |
} |
| 920 |
|
| 921 |
public function display_plugin_submissions_page(){ |
| 922 |
|
| 923 |
include_once('partials/submissions/survey-maker-submissions-display.php'); |
| 924 |
} |
| 925 |
|
| 926 |
public function display_plugin_each_submission_page(){ |
| 927 |
include_once 'partials/submissions/survey-maker-each-submission-display.php'; |
| 928 |
} |
| 929 |
|
| 930 |
public function display_plugin_settings_page(){ |
| 931 |
include_once('partials/settings/survey-maker-settings.php'); |
| 932 |
} |
| 933 |
|
| 934 |
public function display_plugin_export_import_page(){ |
| 935 |
include_once('partials/export-import/survey-maker-export-import-display.php'); |
| 936 |
} |
| 937 |
|
| 938 |
public function display_plugin_subscribe_email(){ |
| 939 |
include_once('partials/subscribe/survey-maker-subscribe-email-display.php'); |
| 940 |
} |
| 941 |
|
| 942 |
public function display_plugin_featured_plugins_page(){ |
| 943 |
include_once('partials/features/survey-maker-plugin-featured-display.php'); |
| 944 |
} |
| 945 |
|
| 946 |
public function display_plugin_features_page(){ |
| 947 |
include_once('partials/features/survey-maker-features-display.php'); |
| 948 |
} |
| 949 |
|
| 950 |
public function display_plugin_popup_page(){ |
| 951 |
include_once('partials/popup/survey-maker-popups-display.php'); |
| 952 |
} |
| 953 |
|
| 954 |
public function display_plugin_admin_dashboard_page(){ |
| 955 |
include_once('partials/dashboard/survey-maker-dashboard-display.php'); |
| 956 |
} |
| 957 |
|
| 958 |
public static function set_screen($status, $option, $value){ |
| 959 |
return $value; |
| 960 |
} |
| 961 |
|
| 962 |
public function screen_option_surveys(){ |
| 963 |
$option = 'per_page'; |
| 964 |
$args = array( |
| 965 |
'label' => __('Surveys', "survey-maker"), |
| 966 |
'default' => 20, |
| 967 |
'option' => 'surveys_per_page' |
| 968 |
); |
| 969 |
|
| 970 |
if( ! ( isset( $_GET['action'] ) && ( $_GET['action'] == 'add' || $_GET['action'] == 'edit' ) ) ){ |
| 971 |
add_screen_option($option, $args); |
| 972 |
} |
| 973 |
|
| 974 |
$this->surveys_obj = new Surveys_List_Table($this->plugin_name); |
| 975 |
$this->settings_obj = new Survey_Maker_Settings_Actions($this->plugin_name); |
| 976 |
} |
| 977 |
|
| 978 |
public function screen_option_survey_categories(){ |
| 979 |
$option = 'per_page'; |
| 980 |
$args = array( |
| 981 |
'label' => __('Survey Categories', "survey-maker"), |
| 982 |
'default' => 20, |
| 983 |
'option' => 'survey_categories_per_page' |
| 984 |
); |
| 985 |
|
| 986 |
if( ! ( isset( $_GET['action'] ) && ( $_GET['action'] == 'add' || $_GET['action'] == 'edit' ) ) ){ |
| 987 |
add_screen_option($option, $args); |
| 988 |
} |
| 989 |
|
| 990 |
$this->surveys_categories_obj = new Survey_Categories_List_Table($this->plugin_name); |
| 991 |
$this->settings_obj = new Survey_Maker_Settings_Actions($this->plugin_name); |
| 992 |
} |
| 993 |
|
| 994 |
public function screen_option_popup_surveys(){ |
| 995 |
$option = 'per_page'; |
| 996 |
$args = array( |
| 997 |
'label' => __('Popup Survey', "survey-maker"), |
| 998 |
'default' => 20, |
| 999 |
'option' => 'popup_survey_per_page' |
| 1000 |
); |
| 1001 |
|
| 1002 |
if( ! ( isset( $_GET['action'] ) && ( $_GET['action'] == 'add' || $_GET['action'] == 'edit' ) ) ){ |
| 1003 |
add_screen_option( $option, $args ); |
| 1004 |
} |
| 1005 |
|
| 1006 |
$this->popup_surveys_obj = new Popup_Survey_List_Table( $this->plugin_name ); |
| 1007 |
$this->settings_obj = new Survey_Maker_Settings_Actions($this->plugin_name); |
| 1008 |
} |
| 1009 |
|
| 1010 |
public function screen_option_questions(){ |
| 1011 |
$option = 'per_page'; |
| 1012 |
$args = array( |
| 1013 |
'label' => __('Questions', "survey-maker"), |
| 1014 |
'default' => 20, |
| 1015 |
'option' => 'survey_questions_per_page' |
| 1016 |
); |
| 1017 |
|
| 1018 |
add_screen_option($option, $args); |
| 1019 |
$this->questions_obj = new Survey_Questions_List_Table($this->plugin_name); |
| 1020 |
$this->settings_obj = new Survey_Maker_Settings_Actions($this->plugin_name); |
| 1021 |
} |
| 1022 |
|
| 1023 |
public function screen_option_questions_categories(){ |
| 1024 |
$option = 'per_page'; |
| 1025 |
$args = array( |
| 1026 |
'label' => __('Question Categories', "survey-maker"), |
| 1027 |
'default' => 20, |
| 1028 |
'option' => 'survey_question_categories_per_page' |
| 1029 |
); |
| 1030 |
|
| 1031 |
add_screen_option($option, $args); |
| 1032 |
$this->question_categories_obj = new Survey_Question_Categories_List_Table($this->plugin_name); |
| 1033 |
} |
| 1034 |
|
| 1035 |
public function screen_option_submissions(){ |
| 1036 |
$option = 'per_page'; |
| 1037 |
$args = array( |
| 1038 |
'label' => __('Submissions', "survey-maker"), |
| 1039 |
'default' => 20, |
| 1040 |
'option' => 'survey_submissions_results_per_page' |
| 1041 |
); |
| 1042 |
|
| 1043 |
add_screen_option($option, $args); |
| 1044 |
$this->submissions_obj = new Submissions_List_Table( $this->plugin_name ); |
| 1045 |
} |
| 1046 |
|
| 1047 |
public function screen_option_each_survey_submission() { |
| 1048 |
$option = 'per_page'; |
| 1049 |
$args = array( |
| 1050 |
'label' => __('Results', "survey-maker"), |
| 1051 |
'default' => 50, |
| 1052 |
'option' => 'survey_each_submission_results_per_page', |
| 1053 |
); |
| 1054 |
|
| 1055 |
add_screen_option($option, $args); |
| 1056 |
$this->each_submission_obj = new Survey_Each_Submission_List_Table($this->plugin_name); |
| 1057 |
} |
| 1058 |
|
| 1059 |
public function screen_option_settings(){ |
| 1060 |
$this->settings_obj = new Survey_Maker_Settings_Actions($this->plugin_name); |
| 1061 |
} |
| 1062 |
|
| 1063 |
public function deactivate_plugin_option(){ |
| 1064 |
|
| 1065 |
// Run a security check. |
| 1066 |
check_ajax_referer( 'survey-maker-ajax-deactivate-plugin-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) ); |
| 1067 |
|
| 1068 |
// Check for permissions. |
| 1069 |
if ( ! current_user_can( 'manage_options' ) ) { |
| 1070 |
ob_end_clean(); |
| 1071 |
$ob_get_clean = ob_get_clean(); |
| 1072 |
echo json_encode(array( |
| 1073 |
'option' => '' |
| 1074 |
)); |
| 1075 |
wp_die(); |
| 1076 |
} |
| 1077 |
|
| 1078 |
if( is_user_logged_in() ) { |
| 1079 |
$request_value = sanitize_text_field($_REQUEST['upgrade_plugin']); |
| 1080 |
$upgrade_option = get_option( 'ays_survey_maker_upgrade_plugin', '' ); |
| 1081 |
if($upgrade_option === ''){ |
| 1082 |
add_option( 'ays_survey_maker_upgrade_plugin', $request_value ); |
| 1083 |
}else{ |
| 1084 |
update_option( 'ays_survey_maker_upgrade_plugin', $request_value ); |
| 1085 |
} |
| 1086 |
|
| 1087 |
ob_end_clean(); |
| 1088 |
$ob_get_clean = ob_get_clean(); |
| 1089 |
echo json_encode(array( |
| 1090 |
'option' => get_option( 'ays_survey_maker_upgrade_plugin', '' ) |
| 1091 |
)); |
| 1092 |
wp_die(); |
| 1093 |
} else { |
| 1094 |
ob_end_clean(); |
| 1095 |
$ob_get_clean = ob_get_clean(); |
| 1096 |
echo json_encode(array( |
| 1097 |
'option' => '' |
| 1098 |
)); |
| 1099 |
wp_die(); |
| 1100 |
} |
| 1101 |
} |
| 1102 |
|
| 1103 |
public function survey_maker_admin_footer($a){ |
| 1104 |
if(isset($_REQUEST['page'])){ |
| 1105 |
if(false !== strpos( sanitize_text_field( $_REQUEST['page'] ), $this->plugin_name)){ |
| 1106 |
?> |
| 1107 |
<div class="ays-survey-footer-support-box"> |
| 1108 |
<span class="ays-survey-footer-link-row"><a href="https://wordpress.org/support/plugin/survey-maker/" target="_blank"><?php echo esc_html__( "Support", "survey-maker"); ?></a></span> |
| 1109 |
<span class="ays-survey-footer-slash-row">/</span> |
| 1110 |
<span class="ays-survey-footer-link-row"><a href="https://ays-pro.com/wordpress-survey-maker-user-manual" target="_blank"><?php echo esc_html__( "Docs", "survey-maker"); ?></a></span> |
| 1111 |
<span class="ays-survey-footer-slash-row">/</span> |
| 1112 |
<span class="ays-survey-footer-link-row"><a href="https://ays-demo.com/survey-maker-plugin-survey/" target="_blank"><?php echo esc_html__( "Suggest a Feature", "survey-maker"); ?></a></span> |
| 1113 |
</div> |
| 1114 |
<p class="ays-survey-footer-review-box" style="font-size:13px;text-align:center;font-style:italic;"> |
| 1115 |
<span style="margin-left:0px;margin-right:10px;" class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span> |
| 1116 |
<span><?php echo esc_html__( "If you love our plugin, please do big favor and rate us on", "survey-maker"); ?> WordPress.org</span> |
| 1117 |
<a target="_blank" href='https://wordpress.org/support/plugin/survey-maker/reviews/?rate=5#new-post'></a> |
| 1118 |
<a target="_blank" class="ays-rated-link" href='https://wordpress.org/support/plugin/survey-maker/reviews'> |
| 1119 |
<span class="ays-dashicons ays-dashicons-star-empty"></span> |
| 1120 |
<span class="ays-dashicons ays-dashicons-star-empty"></span> |
| 1121 |
<span class="ays-dashicons ays-dashicons-star-empty"></span> |
| 1122 |
<span class="ays-dashicons ays-dashicons-star-empty"></span> |
| 1123 |
<span class="ays-dashicons ays-dashicons-star-empty"></span> |
| 1124 |
</a> |
| 1125 |
<span class="ays_heart_beat"><i class="ays_fa ays_fa_heart_o animated"></i></span> |
| 1126 |
</p> |
| 1127 |
<?php |
| 1128 |
} |
| 1129 |
} |
| 1130 |
} |
| 1131 |
|
| 1132 |
public static function ays_restriction_string($type, $x, $length){ |
| 1133 |
$output = ""; |
| 1134 |
switch($type){ |
| 1135 |
case "char": |
| 1136 |
if(strlen($x)<=$length){ |
| 1137 |
$output = $x; |
| 1138 |
} else { |
| 1139 |
$output = substr($x,0,$length) . '...'; |
| 1140 |
} |
| 1141 |
break; |
| 1142 |
case "word": |
| 1143 |
$res = explode(" ", $x); |
| 1144 |
if(count($res)<=$length){ |
| 1145 |
$output = implode(" ",$res); |
| 1146 |
} else { |
| 1147 |
$res = array_slice($res,0,$length); |
| 1148 |
$output = implode(" ",$res) . '...'; |
| 1149 |
} |
| 1150 |
break; |
| 1151 |
} |
| 1152 |
return $output; |
| 1153 |
} |
| 1154 |
|
| 1155 |
public static function validateDate($date, $format = 'Y-m-d H:i:s'){ |
| 1156 |
$d = DateTime::createFromFormat($format, $date); |
| 1157 |
return $d && $d->format($format) == $date; |
| 1158 |
} |
| 1159 |
|
| 1160 |
public static function get_max_id( $table ) { |
| 1161 |
global $wpdb; |
| 1162 |
$db_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . $table; |
| 1163 |
|
| 1164 |
$sql = "SELECT MAX(id) FROM {$db_table}"; |
| 1165 |
|
| 1166 |
$result = intval( $wpdb->get_var( $sql ) ); |
| 1167 |
|
| 1168 |
return $result; |
| 1169 |
} |
| 1170 |
|
| 1171 |
public function get_all_surveys(){ |
| 1172 |
global $wpdb; |
| 1173 |
$surveys_table = $wpdb->prefix . "ayssurvey_surveys"; |
| 1174 |
$surveys = $wpdb->get_results("SELECT * FROM {$surveys_table}"); |
| 1175 |
return $surveys; |
| 1176 |
} |
| 1177 |
|
| 1178 |
public static function string_starts_with_number($string){ |
| 1179 |
$match = preg_match('/^\d/', $string); |
| 1180 |
if($match === 1){ |
| 1181 |
return true; |
| 1182 |
}else{ |
| 1183 |
return false; |
| 1184 |
} |
| 1185 |
} |
| 1186 |
|
| 1187 |
public function get_question_answers( $question_id ) { |
| 1188 |
global $wpdb; |
| 1189 |
|
| 1190 |
$sql = "SELECT * FROM {$wpdb->prefix}ayssurvey_answers WHERE question_id=" . absint( $question_id ); |
| 1191 |
|
| 1192 |
$results = $wpdb->get_results( $sql, 'ARRAY_A' ); |
| 1193 |
foreach ($results as $key => &$result) { |
| 1194 |
unset($result['id']); |
| 1195 |
unset($result['question_id']); |
| 1196 |
} |
| 1197 |
|
| 1198 |
return $results; |
| 1199 |
} |
| 1200 |
|
| 1201 |
public function ays_survey_question_results( $survey_id, $submission_ids = null ){ |
| 1202 |
global $wpdb; |
| 1203 |
|
| 1204 |
if($survey_id === null){ |
| 1205 |
return array( |
| 1206 |
'total_count' => 0, |
| 1207 |
'questions' => array() |
| 1208 |
); |
| 1209 |
} |
| 1210 |
|
| 1211 |
$submitions_questiions_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions_questions"; |
| 1212 |
$answer_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "answers"; |
| 1213 |
$question_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "questions"; |
| 1214 |
$submitions_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions"; |
| 1215 |
$survey_section_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "sections"; |
| 1216 |
$surveys_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "surveys"; |
| 1217 |
|
| 1218 |
$survey_options_sql = "SELECT options FROM {$surveys_table} WHERE id =". absint( $survey_id ); |
| 1219 |
$survey_options = $wpdb->get_var( $survey_options_sql ); |
| 1220 |
|
| 1221 |
$survey_options = isset( $survey_options ) && $survey_options != '' ? json_decode( $survey_options, true ) : array(); |
| 1222 |
|
| 1223 |
// Allow HTML in answers |
| 1224 |
$survey_options[ 'survey_allow_html_in_answers' ] = isset($survey_options[ 'survey_allow_html_in_answers' ]) ? $survey_options[ 'survey_allow_html_in_answers' ] : 'off'; |
| 1225 |
$allow_html_in_answers = (isset($survey_options[ 'survey_allow_html_in_answers' ]) && $survey_options[ 'survey_allow_html_in_answers' ] == 'on') ? true : false; |
| 1226 |
|
| 1227 |
$question_ids = "SELECT question_ids FROM {$surveys_table} WHERE id =". absint( $survey_id ); |
| 1228 |
$question_ids_results = $wpdb->get_var( $question_ids ); |
| 1229 |
$ays_question_id = ($question_ids_results != '') ? $question_ids_results : null; |
| 1230 |
|
| 1231 |
if($ays_question_id == null){ |
| 1232 |
return array( |
| 1233 |
'total_count' => 0, |
| 1234 |
'questions' => array() |
| 1235 |
); |
| 1236 |
} |
| 1237 |
|
| 1238 |
$questions_ids_arr = explode(',',$ays_question_id); |
| 1239 |
$answer_id = "SELECT a.id, a.answer, COUNT(s_q.answer_id) AS answer_count |
| 1240 |
FROM {$answer_table} AS a |
| 1241 |
LEFT JOIN {$submitions_questiions_table} AS s_q |
| 1242 |
ON a.id = s_q.answer_id |
| 1243 |
WHERE s_q.survey_id=".absint( $survey_id ) ." |
| 1244 |
GROUP BY a.id"; |
| 1245 |
|
| 1246 |
$answer_id_result = $wpdb->get_results($answer_id,'ARRAY_A'); |
| 1247 |
|
| 1248 |
$for_checkbox = "SELECT a.id, a.answer, COUNT(s_q.answer_id) AS answer_count |
| 1249 |
FROM {$answer_table} AS a |
| 1250 |
LEFT JOIN {$submitions_questiions_table} AS s_q |
| 1251 |
ON a.id = s_q.answer_id OR FIND_IN_SET( a.id, s_q.user_answer ) |
| 1252 |
WHERE s_q.type = 'checkbox' |
| 1253 |
AND s_q.survey_id=".absint( $survey_id ) ." |
| 1254 |
GROUP BY a.id"; |
| 1255 |
|
| 1256 |
$for_checkbox_result = $wpdb->get_results($for_checkbox,'ARRAY_A'); |
| 1257 |
|
| 1258 |
$for_text_type = "SELECT a.id, a.answer, COUNT(s_q.id) AS answer_count |
| 1259 |
FROM {$answer_table} AS a |
| 1260 |
LEFT JOIN {$submitions_questiions_table} AS s_q |
| 1261 |
ON a.id = s_q.answer_id OR FIND_IN_SET( a.id, s_q.user_answer ) |
| 1262 |
WHERE s_q.type IN ('name', 'email', 'text', 'short_text', 'number') |
| 1263 |
AND s_q.survey_id=".absint( $survey_id ) ." |
| 1264 |
GROUP BY a.id"; |
| 1265 |
|
| 1266 |
$for_text_type_result = $wpdb->get_results($for_checkbox,'ARRAY_A'); |
| 1267 |
$answer_count = array(); |
| 1268 |
$question_type = ''; |
| 1269 |
foreach ($answer_id_result as $key => $answer_count_by_id) { |
| 1270 |
$ays_survey_answer_count = (isset($answer_count_by_id['answer_count']) && $answer_count_by_id['answer_count'] !="") ? absint(intval($answer_count_by_id['answer_count'])) : ''; |
| 1271 |
$answer_count[$answer_count_by_id['id']] = $ays_survey_answer_count; |
| 1272 |
} |
| 1273 |
|
| 1274 |
foreach ($for_checkbox_result as $key => $answer_count_by_id) { |
| 1275 |
$ays_survey_answer_count = (isset($answer_count_by_id['answer_count']) && $answer_count_by_id['answer_count'] !="") ? absint(intval($answer_count_by_id['answer_count'])) : ''; |
| 1276 |
$answer_count[$answer_count_by_id['id']] = $ays_survey_answer_count; |
| 1277 |
} |
| 1278 |
|
| 1279 |
foreach ($for_text_type_result as $key => $answer_count_by_id) { |
| 1280 |
$ays_survey_answer_count = (isset($answer_count_by_id['answer_count']) && $answer_count_by_id['answer_count'] !="") ? absint(intval($answer_count_by_id['answer_count'])) : ''; |
| 1281 |
$answer_count[$answer_count_by_id['id']] = $ays_survey_answer_count; |
| 1282 |
} |
| 1283 |
|
| 1284 |
$question_by_ids = Survey_Maker_Data::get_question_by_ids( $questions_ids_arr ); |
| 1285 |
|
| 1286 |
$select_answer_q_type = "SELECT type, user_answer, id, question_id |
| 1287 |
FROM {$submitions_questiions_table} |
| 1288 |
WHERE user_answer != '' |
| 1289 |
AND type != 'checkbox' |
| 1290 |
AND survey_id=". absint( $survey_id ); |
| 1291 |
|
| 1292 |
$submission_answer_other = "SELECT question_id, user_variant |
| 1293 |
FROM {$submitions_questiions_table} |
| 1294 |
WHERE user_variant != '' |
| 1295 |
AND survey_id=". absint( $survey_id ); |
| 1296 |
|
| 1297 |
if( $submission_ids !== null ){ |
| 1298 |
if( is_array( $submission_ids ) ){ |
| 1299 |
$select_answer_q_type .= " AND submission_id IN (" . esc_sql( implode( ',', $submission_ids ) ) . ") "; |
| 1300 |
$submission_answer_other .= " AND submission_id IN (" . esc_sql( implode( ',', $submission_ids ) ) . ") "; |
| 1301 |
} |
| 1302 |
} |
| 1303 |
|
| 1304 |
$result_answers_q_type = $wpdb->get_results($select_answer_q_type,'ARRAY_A'); |
| 1305 |
$result_answers_other = $wpdb->get_results($submission_answer_other,'ARRAY_A'); |
| 1306 |
$text_answer = array(); |
| 1307 |
foreach($result_answers_q_type as $key => $result_answer_q_type){ |
| 1308 |
$text_answer[$result_answer_q_type['type']][$result_answer_q_type['question_id']][] = $result_answer_q_type['user_answer']; |
| 1309 |
} |
| 1310 |
|
| 1311 |
$other_answers = array(); |
| 1312 |
foreach($result_answers_other as $key => $result_answer_other){ |
| 1313 |
$other_answers[$result_answer_other['question_id']][] = $result_answer_other['user_variant']; |
| 1314 |
} |
| 1315 |
|
| 1316 |
$text_types = array( |
| 1317 |
'text', |
| 1318 |
'short_text', |
| 1319 |
'number', |
| 1320 |
'date', |
| 1321 |
'time', |
| 1322 |
'date_time', |
| 1323 |
'star', |
| 1324 |
'phone', |
| 1325 |
'name', |
| 1326 |
'email', |
| 1327 |
); |
| 1328 |
|
| 1329 |
//Question types different charts |
| 1330 |
$ays_submissions_count = array(); |
| 1331 |
$question_results = array(); |
| 1332 |
|
| 1333 |
$total_count = 0; |
| 1334 |
foreach ($question_by_ids as $key => $question) { |
| 1335 |
$answers = $question->answers; |
| 1336 |
$question_id = $question->id; |
| 1337 |
$question_title = $question->question; |
| 1338 |
$question_type = $question->type; |
| 1339 |
//questions |
| 1340 |
$question_results[$question_id]['question_id'] = $question_id; |
| 1341 |
$question_results[$question_id]['question'] = $question_title; |
| 1342 |
$ays_answer = array(); |
| 1343 |
$question_answer_ids = array(); |
| 1344 |
// |
| 1345 |
|
| 1346 |
foreach ($answers as $key => $answer) { |
| 1347 |
$answer_id = $answer->id; |
| 1348 |
$answer_title = $answer->answer; |
| 1349 |
|
| 1350 |
$ays_answer[$answer_id] = isset( $answer_count[$answer_id] ) ? $answer_count[$answer_id] : 0; |
| 1351 |
$question_answer_ids[$answer_id] = $allow_html_in_answers ? sanitize_text_field( $answer_title ) : $answer_title; |
| 1352 |
} |
| 1353 |
|
| 1354 |
//sum of submissions count per questions |
| 1355 |
if($question_type == "checkbox"){ |
| 1356 |
$sub_checkbox_count = $this->ays_survey_get_submission_count($question->id, $question_type, $survey_id); |
| 1357 |
$sum_of_count = $sub_checkbox_count; |
| 1358 |
}else{ |
| 1359 |
$sum_of_count = array_sum( array_values( $ays_answer ) ); |
| 1360 |
} |
| 1361 |
$question_results[$question_id]['otherAnswers'] = isset( $other_answers[$question->id] ) ? $other_answers[$question->id] : array(); |
| 1362 |
|
| 1363 |
if( in_array( $question->type, $text_types ) ){ |
| 1364 |
$question_ls_options = json_decode($question->options, true); |
| 1365 |
if($question->type == 'star'){ |
| 1366 |
$scale_from = isset($question_ls_options['star_1']) && $question_ls_options['star_1'] != "" ? stripslashes($question_ls_options['star_1']) : ""; |
| 1367 |
$scale_to = isset($question_ls_options['star_2']) && $question_ls_options['star_2'] != "" ? stripslashes($question_ls_options['star_2']) : ""; |
| 1368 |
$scale_length = isset($question_ls_options['star_scale_length']) && $question_ls_options['star_scale_length'] != "" ? $question_ls_options['star_scale_length'] : ""; |
| 1369 |
$question_results[$question_id]['labels'] = array( |
| 1370 |
'from' => $scale_from, |
| 1371 |
'to' => $scale_to, |
| 1372 |
'length' => $scale_length |
| 1373 |
); |
| 1374 |
} |
| 1375 |
$question_results[$question_id]['answers'] = isset( $text_answer[$question->type] ) ? $text_answer[$question->type] : ''; |
| 1376 |
$question_results[$question_id]['answerTitles'] = isset( $text_answer[$question->type] ) ? $text_answer[$question->type] : ''; |
| 1377 |
$question_results[$question_id]['sum_of_answers_count'] = isset( $text_answer[$question->type][$question->id] ) ? count( $text_answer[$question->type][$question->id] ) : 0; |
| 1378 |
$question_results[$question_id]['sum_of_same_answers'] = isset( $text_answer[$question->type][$question->id] ) ? array_count_values( $text_answer[$question->type][$question->id] ) : 0; |
| 1379 |
}else{ |
| 1380 |
$question_results[$question_id]['answers'] = $ays_answer; |
| 1381 |
$question_results[$question_id]['answerTitles'] = $question_answer_ids; |
| 1382 |
$question_results[$question_id]['sum_of_answers_count'] = $sum_of_count; |
| 1383 |
if( $sum_of_count == 0 ){ |
| 1384 |
$question_results[$question_id]['answers'] = array(); |
| 1385 |
} |
| 1386 |
} |
| 1387 |
|
| 1388 |
// Answers for charts |
| 1389 |
if( !empty( $question_results[$question_id]['otherAnswers'] ) ){ |
| 1390 |
$question_results[$question_id]['answers'][0] = count( $question_results[$question_id]['otherAnswers'] ); |
| 1391 |
$question_results[$question_id]['answerTitles'][0] = __( '"Other" answer(s)', "survey-maker" ); |
| 1392 |
$question_results[$question_id]['same_other_count'] = array_count_values( $question_results[$question_id]['otherAnswers'] ); |
| 1393 |
|
| 1394 |
if($question_type == "radio" || $question_type == "yesorno"){ |
| 1395 |
$question_results[$question_id]['sum_of_answers_count'] += count( $question_results[$question_id]['otherAnswers'] ); |
| 1396 |
} |
| 1397 |
|
| 1398 |
} |
| 1399 |
// |
| 1400 |
|
| 1401 |
$total_count += intval( $question_results[$question_id]['sum_of_answers_count'] ); |
| 1402 |
|
| 1403 |
$question_results[$question_id]['question_type'] = $question->type; |
| 1404 |
} |
| 1405 |
|
| 1406 |
return array( |
| 1407 |
'total_count' => $total_count, |
| 1408 |
'questions' => $question_results |
| 1409 |
); |
| 1410 |
} |
| 1411 |
|
| 1412 |
public function ays_survey_get_last_submission_id( $survey_id ){ |
| 1413 |
global $wpdb; |
| 1414 |
|
| 1415 |
if($survey_id === null){ |
| 1416 |
return array(); |
| 1417 |
} |
| 1418 |
|
| 1419 |
$submitions_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions"; |
| 1420 |
|
| 1421 |
//submission of each result |
| 1422 |
$submission = "SELECT * FROM {$submitions_table} WHERE survey_id=". absint( $survey_id ) ." ORDER BY id DESC LIMIT 1 "; |
| 1423 |
$last_submission = $wpdb->get_row( $submission, 'ARRAY_A' ); |
| 1424 |
|
| 1425 |
if( $last_submission == null ){ |
| 1426 |
return array(); |
| 1427 |
} |
| 1428 |
return $last_submission; |
| 1429 |
} |
| 1430 |
|
| 1431 |
public function ays_survey_individual_results_for_one_submission( $submission, $survey ){ |
| 1432 |
global $wpdb; |
| 1433 |
$survey_id = isset( $survey['id'] ) ? absint( intval( $survey['id'] ) ) : null; |
| 1434 |
|
| 1435 |
if( is_null( $survey_id ) || empty( $submission )){ |
| 1436 |
return array( |
| 1437 |
'sections' => array() |
| 1438 |
); |
| 1439 |
} |
| 1440 |
|
| 1441 |
$submitions_questiions_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions_questions"; |
| 1442 |
$submitions_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions"; |
| 1443 |
|
| 1444 |
$ays_individual_questions_for_one_submission = array(); |
| 1445 |
$question_answer_id = array(); |
| 1446 |
$submission_id = isset( $submission['id'] ) && $submission['id'] != '' ? $submission['id'] : null; |
| 1447 |
|
| 1448 |
if( is_null( $submission_id ) ){ |
| 1449 |
return array( |
| 1450 |
'sections' => array() |
| 1451 |
); |
| 1452 |
} |
| 1453 |
|
| 1454 |
$checkbox_ids = ''; |
| 1455 |
|
| 1456 |
$individual_questions = "SELECT * FROM {$submitions_questiions_table} WHERE submission_id=" . absint( $submission_id ); |
| 1457 |
$individual_questions_results = $wpdb->get_results($individual_questions,'ARRAY_A'); |
| 1458 |
|
| 1459 |
// Get user info |
| 1460 |
$which_needed = "id,user_ip,user_id,user_name,user_email,submission_date,options"; |
| 1461 |
$individual_users = "SELECT ".$which_needed." FROM ".$submitions_table." WHERE id=" . absint( $submission_id ); |
| 1462 |
$individual_users_results = $wpdb->get_row($individual_users,'ARRAY_A'); |
| 1463 |
$user_id = isset($individual_users_results['user_id']) && $individual_users_results['user_id'] != "" ? $individual_users_results['user_id'] : 0; |
| 1464 |
$user_real_name = __("Guest" , "survey-maker"); |
| 1465 |
$user_real_email = ""; |
| 1466 |
if($user_id > 0){ |
| 1467 |
$user_data = get_userdata($user_id); |
| 1468 |
$user_real_name = $user_data ? $user_data->data->display_name : __('Deleted User' , "survey-maker"); |
| 1469 |
$user_real_email = $user_data ? $user_data->data->user_email : ''; |
| 1470 |
} |
| 1471 |
if(!isset($individual_users_results['user_name']) || (isset($individual_users_results['user_name']) && $individual_users_results['user_name'] == "")){ |
| 1472 |
$individual_users_results['user_name'] = $user_real_name; |
| 1473 |
} |
| 1474 |
|
| 1475 |
if(!isset($individual_users_results['user_email']) || (isset($individual_users_results['user_email']) && $individual_users_results['user_email'] == "")){ |
| 1476 |
$individual_users_results['user_email'] = $user_real_email; |
| 1477 |
} |
| 1478 |
$individual_users_results['user_name'] = stripslashes(nl2br( htmlentities($individual_users_results['user_name']))); |
| 1479 |
// Survey questions IDs |
| 1480 |
$question_ids = isset( $survey['question_ids'] ) && $survey['question_ids'] != '' ? $survey['question_ids'] : ''; |
| 1481 |
|
| 1482 |
// Section Ids |
| 1483 |
$sections_ids = (isset( $survey['section_ids' ] ) && $survey['section_ids'] != '') ? $survey['section_ids'] : ''; |
| 1484 |
|
| 1485 |
$sections = Survey_Maker_Data::get_suervey_sections_with_questions( $sections_ids, $question_ids ); |
| 1486 |
|
| 1487 |
$text_types = array( |
| 1488 |
'text', |
| 1489 |
'short_text', |
| 1490 |
'phone', |
| 1491 |
'date', |
| 1492 |
'time', |
| 1493 |
'date_time', |
| 1494 |
'star', |
| 1495 |
'number', |
| 1496 |
'name', |
| 1497 |
'email', |
| 1498 |
); |
| 1499 |
|
| 1500 |
foreach ($individual_questions_results as $key => $individual_questions_result) { |
| 1501 |
if($individual_questions_result['type'] == 'checkbox'){ |
| 1502 |
$checkbox_ids = $individual_questions_result['user_answer'] != '' ? explode(',', $individual_questions_result['user_answer']) : array(); |
| 1503 |
$question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = $checkbox_ids; |
| 1504 |
|
| 1505 |
$question_answer_id[ $individual_questions_result['question_id'] ]['otherAnswer'] = isset($individual_questions_result['user_variant']) && $individual_questions_result['user_variant'] != '' ? stripslashes(htmlentities($individual_questions_result['user_variant'])) : ''; |
| 1506 |
}elseif( in_array( $individual_questions_result['type'], $text_types ) ){ |
| 1507 |
|
| 1508 |
if( $individual_questions_result['type'] == 'date' ){ |
| 1509 |
$question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = stripslashes(htmlentities($individual_questions_result['user_answer'])); |
| 1510 |
|
| 1511 |
if( $individual_questions_result['user_answer'] != '' ){ |
| 1512 |
$question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = date( 'd . m . Y', strtotime(nl2br(htmlentities($individual_questions_result['user_answer']))) ); |
| 1513 |
}else{ |
| 1514 |
$question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = ''; |
| 1515 |
} |
| 1516 |
} |
| 1517 |
elseif( $individual_questions_result['type'] == 'time' ){ |
| 1518 |
if( $individual_questions_result['user_answer'] != '' ){ |
| 1519 |
$question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = implode(" : ", explode( ":", $individual_questions_result['user_answer'] )); |
| 1520 |
}else{ |
| 1521 |
$question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = ''; |
| 1522 |
} |
| 1523 |
} |
| 1524 |
elseif( $individual_questions_result['type'] == 'date_time' ){ |
| 1525 |
if( $individual_questions_result['user_answer'] != '' ){ |
| 1526 |
$user_date_time_answer = explode(" ", $individual_questions_result['user_answer'] ); |
| 1527 |
if((isset($user_date_time_answer[0]) && $user_date_time_answer[0] != '-') && (isset($user_date_time_answer[1]) && $user_date_time_answer[1] != '-')){ |
| 1528 |
$question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = date( 'd . m . Y', strtotime(nl2br(htmlentities($user_date_time_answer[0]))) ) . " " . implode(" : ", explode( ":", $user_date_time_answer[1] )); |
| 1529 |
} |
| 1530 |
}else{ |
| 1531 |
$question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = ''; |
| 1532 |
} |
| 1533 |
} |
| 1534 |
else{ |
| 1535 |
$question_answer_id[ $individual_questions_result['question_id'] ] = stripslashes(htmlentities($individual_questions_result['user_answer'])); |
| 1536 |
} |
| 1537 |
}elseif($individual_questions_result['type'] == 'radio'){ |
| 1538 |
|
| 1539 |
$other_answer = isset($individual_questions_result['user_variant']) && $individual_questions_result['user_variant'] != '' ? stripslashes(htmlentities($individual_questions_result['user_variant'])) : ''; |
| 1540 |
$question_answer_id[ $individual_questions_result['question_id'] ]['otherAnswer'] = $other_answer; |
| 1541 |
$question_answer_id[ $individual_questions_result['question_id'] ]['answer'] = $individual_questions_result['answer_id']; |
| 1542 |
}else{ |
| 1543 |
$question_answer_id[ $individual_questions_result['question_id'] ] = $individual_questions_result['answer_id']; |
| 1544 |
} |
| 1545 |
} |
| 1546 |
|
| 1547 |
$ays_individual_questions_for_one_submission['submission_id'] = $submission['id']; |
| 1548 |
$ays_individual_questions_for_one_submission['questions'] = $question_answer_id; |
| 1549 |
$ays_individual_questions_for_one_submission['sections'] = $sections; |
| 1550 |
$ays_individual_questions_for_one_submission['user_info'] = $individual_users_results; |
| 1551 |
return $ays_individual_questions_for_one_submission; |
| 1552 |
} |
| 1553 |
|
| 1554 |
public function get_submission_count_and_ids(){ |
| 1555 |
global $wpdb; |
| 1556 |
$survey_id = isset($_GET['survey']) ? intval($_GET['survey']) : null; |
| 1557 |
|
| 1558 |
if($survey_id === null){ |
| 1559 |
return false; |
| 1560 |
} |
| 1561 |
$submitions_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions"; |
| 1562 |
|
| 1563 |
//submission of each result |
| 1564 |
$submission_ids = "SELECT id, |
| 1565 |
(SELECT COUNT(id) FROM {$submitions_table} i |
| 1566 |
WHERE i.survey_id=j.survey_id) AS count_submission |
| 1567 |
FROM {$submitions_table} j |
| 1568 |
WHERE survey_id=". absint( $survey_id ) ." |
| 1569 |
ORDER BY id"; |
| 1570 |
$submission_ids_result = $wpdb->get_results($submission_ids,'ARRAY_A'); |
| 1571 |
$submission_count = ''; |
| 1572 |
$submissions_id_arr = array(); |
| 1573 |
foreach ($submission_ids_result as $key => $submission_id_result) { |
| 1574 |
$submission_id_count = $submission_id_result['count_submission']; |
| 1575 |
$submission_count = intval($submission_id_count); |
| 1576 |
$submissions_id_arr[] = $submission_id_result['id']; |
| 1577 |
} |
| 1578 |
$submissions_id_str = implode(',', $submissions_id_arr ); |
| 1579 |
|
| 1580 |
$submission_count_and_ids = array( |
| 1581 |
'submission_count' => $submission_count, |
| 1582 |
'submission_ids' => $submissions_id_str |
| 1583 |
); |
| 1584 |
|
| 1585 |
return $submission_count_and_ids; |
| 1586 |
} |
| 1587 |
|
| 1588 |
public function ays_survey_submission_report(){ |
| 1589 |
global $wpdb; |
| 1590 |
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'ays_survey_submission_report' && wp_verify_nonce( $_REQUEST['nonce'], 'ajax-nonce' )) { |
| 1591 |
|
| 1592 |
$survey_id = (isset($_REQUEST['surveyId']) && $_REQUEST['surveyId'] != "") ? intval(sanitize_text_field($_REQUEST['surveyId'])) : null; |
| 1593 |
if($survey_id === null){ |
| 1594 |
return false; |
| 1595 |
} |
| 1596 |
|
| 1597 |
$sql = "SELECT * FROM " . $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "surveys WHERE id =" . absint( $survey_id ); |
| 1598 |
$survey = $wpdb->get_row( $sql, 'ARRAY_A' ); |
| 1599 |
|
| 1600 |
$submission_id = (isset($_REQUEST['submissionId']) && $_REQUEST['submissionId'] != '') ? absint( sanitize_text_field( $_REQUEST['submissionId'] ) ) : null; |
| 1601 |
if($submission_id == null){ |
| 1602 |
return false; |
| 1603 |
} |
| 1604 |
$submission = array( |
| 1605 |
'id' => $submission_id |
| 1606 |
); |
| 1607 |
|
| 1608 |
$results = $this->ays_survey_individual_results_for_one_submission( $submission, $survey ); |
| 1609 |
$individual_user_name = isset($results['user_info']['user_name']) && isset($results['user_info']['user_name']) ? $results['user_info']['user_name'] : ""; |
| 1610 |
$individual_user_email = isset($results['user_info']['user_email']) && isset($results['user_info']['user_email']) ? wp_kses_post($results['user_info']['user_email']) : ""; |
| 1611 |
$individual_user_ip = isset($results['user_info']['user_ip']) && isset($results['user_info']['user_ip']) ? esc_attr($results['user_info']['user_ip']) : ""; |
| 1612 |
$individual_user_date = isset($results['user_info']['submission_date']) && isset($results['user_info']['submission_date']) ? esc_attr($results['user_info']['submission_date']) : ""; |
| 1613 |
$individual_user_sub_id = isset($results['user_info']['id']) && isset($results['user_info']['id']) ? esc_attr($results['user_info']['id']) : ""; |
| 1614 |
|
| 1615 |
$individual_user_extra_data = isset($results['user_info']['options']) && $results['user_info']['options'] != '' ? json_decode(($results['user_info']['options']) , 'true') : array(); |
| 1616 |
$individual_user_device_type = isset($individual_user_extra_data['device']) && $individual_user_extra_data['device'] != '' ? esc_attr(ucfirst($individual_user_extra_data['device'])) : ''; |
| 1617 |
|
| 1618 |
$survey_data_clipboard = array( |
| 1619 |
"user_name" => $individual_user_name, |
| 1620 |
"user_email" => $individual_user_email, |
| 1621 |
"user_ip" => $individual_user_ip, |
| 1622 |
"user_date" => $individual_user_date, |
| 1623 |
"user_sub_id" => $individual_user_sub_id, |
| 1624 |
"user_device_type" => $individual_user_device_type, |
| 1625 |
); |
| 1626 |
$results['user_info']['user_device_type'] = $individual_user_device_type; |
| 1627 |
ob_end_clean(); |
| 1628 |
$ob_get_clean = ob_get_clean(); |
| 1629 |
$response = array( |
| 1630 |
'status' => true, |
| 1631 |
'questions' => $results['questions'], |
| 1632 |
'user_info' => $results['user_info'], |
| 1633 |
'user_info_for_copy' => Survey_Maker_Data::ays_survey_copy_text_formater($survey_data_clipboard) |
| 1634 |
); |
| 1635 |
echo json_encode($response); |
| 1636 |
wp_die(); |
| 1637 |
} |
| 1638 |
ob_end_clean(); |
| 1639 |
$ob_get_clean = ob_get_clean(); |
| 1640 |
$response = array( |
| 1641 |
'status' => false |
| 1642 |
); |
| 1643 |
echo json_encode($response); |
| 1644 |
wp_die(); |
| 1645 |
} |
| 1646 |
|
| 1647 |
// Survey Maker Elementor widget init |
| 1648 |
public function survey_maker_el_widgets_registered() { |
| 1649 |
// We check if the Elementor plugin has been installed / activated. |
| 1650 |
if ( defined( 'ELEMENTOR_PATH' ) && class_exists( 'Elementor\Widget_Base' ) ) { |
| 1651 |
// get our own widgets up and running: |
| 1652 |
// copied from widgets-manager.php |
| 1653 |
if ( class_exists( 'Elementor\Plugin' ) ) { |
| 1654 |
if ( is_callable( 'Elementor\Plugin', 'instance' ) ) { |
| 1655 |
$elementor = Elementor\Plugin::instance(); |
| 1656 |
if ( isset( $elementor->widgets_manager ) ) { |
| 1657 |
if ( method_exists( $elementor->widgets_manager, 'register_widget_type' ) ) { |
| 1658 |
wp_enqueue_style($this->plugin_name . '-admin', plugin_dir_url(__FILE__) . 'css/admin.css', array(), $this->version, 'all'); |
| 1659 |
wp_enqueue_style( SURVEY_MAKER_NAME . "-dropdown", SURVEY_MAKER_PUBLIC_URL . '/css/dropdown.min.css', array(), SURVEY_MAKER_VERSION, 'all' ); |
| 1660 |
$widget_file = 'plugins/elementor/survey-maker-elementor.php'; |
| 1661 |
$template_file = locate_template( $widget_file ); |
| 1662 |
if ( !$template_file || !is_readable( $template_file ) ) { |
| 1663 |
$template_file = SURVEY_MAKER_DIR . 'pb_templates/survey-maker-elementor.php'; |
| 1664 |
} |
| 1665 |
if ( $template_file && is_readable( $template_file ) ) { |
| 1666 |
require_once $template_file; |
| 1667 |
Elementor\Plugin::instance()->widgets_manager->register_widget_type( new Elementor\Widget_Survey_Maker_Elementor() ); |
| 1668 |
} |
| 1669 |
} |
| 1670 |
} |
| 1671 |
} |
| 1672 |
} |
| 1673 |
} |
| 1674 |
} |
| 1675 |
|
| 1676 |
// Get Submissions count ( Checkbox ) |
| 1677 |
public function ays_survey_get_submission_count($id, $type, $survey_id){ |
| 1678 |
global $wpdb; |
| 1679 |
$submitions_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions"; |
| 1680 |
$submitions_q_table = $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions_questions"; |
| 1681 |
$results = array(); |
| 1682 |
if($type == 'checkbox'){ |
| 1683 |
$sql = "SELECT COUNT(submission_id) AS sub_count |
| 1684 |
FROM {$submitions_q_table} |
| 1685 |
WHERE question_id = ". absint( $id )." |
| 1686 |
AND user_answer != '' |
| 1687 |
AND type='". esc_sql( $type ) ."' |
| 1688 |
AND survey_id=". absint( $survey_id ); |
| 1689 |
$results = $wpdb->get_row($sql,'ARRAY_A'); |
| 1690 |
} |
| 1691 |
$submission_count = isset($results['sub_count']) && $results['sub_count'] != "" && $results['sub_count'] > 0 ? $results['sub_count'] : 0; |
| 1692 |
return $submission_count; |
| 1693 |
} |
| 1694 |
|
| 1695 |
public function ays_survey_sale_baner(){ |
| 1696 |
/* OLD INFO OPEN AFTER HALLOWEN START */ |
| 1697 |
// if(isset($_POST['ays_survey_sale_btn'])){ |
| 1698 |
// update_option('ays_survey_sale_btn', 1); |
| 1699 |
// update_option('ays_survey_maker_sale_date', current_time( 'mysql' )); |
| 1700 |
// } |
| 1701 |
|
| 1702 |
// if(isset($_POST['ays_survey_sale_btn_for_two_months'])){ |
| 1703 |
// update_option('ays_survey_sale_btn_for_two_months', 1); |
| 1704 |
// update_option('ays_survey_maker_sale_date', current_time( 'mysql' )); |
| 1705 |
// } |
| 1706 |
|
| 1707 |
// $ays_survey_maker_sale_date = get_option('ays_survey_maker_sale_date'); |
| 1708 |
// $ays_survey_maker_sale_two_months = get_option('ays_survey_sale_btn_for_two_months'); |
| 1709 |
|
| 1710 |
// $val = 60*60*24*5; |
| 1711 |
// if($ays_survey_maker_sale_two_months == 1){ |
| 1712 |
// $val = 60*60*24*61; |
| 1713 |
// } |
| 1714 |
|
| 1715 |
// $current_date = current_time( 'mysql' ); |
| 1716 |
// $date_diff = strtotime($current_date) - intval(strtotime($ays_survey_maker_sale_date)) ; |
| 1717 |
|
| 1718 |
// $days_diff = $date_diff / $val; |
| 1719 |
|
| 1720 |
// if(intval($days_diff) > 0 ){ |
| 1721 |
// update_option('ays_survey_sale_btn', 0); |
| 1722 |
// update_option('ays_survey_sale_btn_for_two_months', 0); |
| 1723 |
// } |
| 1724 |
|
| 1725 |
// $ays_survey_maker_flag = intval(get_option('ays_survey_sale_btn')); |
| 1726 |
// $ays_survey_maker_flag += intval(get_option('ays_survey_sale_btn_for_two_months')); |
| 1727 |
// if( $ays_survey_maker_flag == 0 ){ |
| 1728 |
// if (isset($_GET['page']) && strpos($_GET['page'], SURVEY_MAKER_NAME) !== false) { |
| 1729 |
// if( !(Survey_Maker_Admin::get_max_id('surveys') <= 1) ){ |
| 1730 |
// // $this->ays_survey_sale_message($ays_survey_maker_flag); |
| 1731 |
// // $this->ays_survey_spring_bundle_small_message($ays_survey_maker_flag); |
| 1732 |
// $this->ays_survey_maker_helloween_message($ays_survey_maker_flag); |
| 1733 |
// } |
| 1734 |
// } |
| 1735 |
// } |
| 1736 |
/* OLD INFO OPEN AFTER HALLOWEN END */ |
| 1737 |
|
| 1738 |
// ONLY FOR Black Friday |
| 1739 |
if(isset($_POST['ays_survey_sale_btn']) && |
| 1740 |
(isset( $_POST[$this->plugin_name . '-sale-banner'] ) && wp_verify_nonce( $_POST[$this->plugin_name . '-sale-banner'], $this->plugin_name . '-sale-banner' )) && |
| 1741 |
current_user_can( 'manage_options' )){ |
| 1742 |
|
| 1743 |
update_option('ays_survey_sale_btn', 1); |
| 1744 |
update_option('ays_survey_sale_date', current_time( 'mysql' )); |
| 1745 |
} |
| 1746 |
|
| 1747 |
$ays_survey_sale_date = get_option('ays_survey_sale_date'); |
| 1748 |
|
| 1749 |
$val = 60*60*24*5; |
| 1750 |
|
| 1751 |
$current_date = current_time( 'mysql' ); |
| 1752 |
$date_diff = strtotime($current_date) - intval(strtotime($ays_survey_sale_date)) ; |
| 1753 |
|
| 1754 |
$days_diff = $date_diff / $val; |
| 1755 |
|
| 1756 |
if(intval($days_diff) > 0 ){ |
| 1757 |
update_option('ays_survey_sale_btn', 0); |
| 1758 |
} |
| 1759 |
|
| 1760 |
|
| 1761 |
$ays_survey_maker_flag = intval(get_option('ays_survey_sale_btn')); |
| 1762 |
if( $ays_survey_maker_flag == 0 ){ |
| 1763 |
if (isset($_GET['page']) && strpos($_GET['page'], SURVEY_MAKER_NAME) !== false) { |
| 1764 |
// if(Survey_Maker_Admin::get_max_id('surveys') > 1){ |
| 1765 |
// $this->ays_survey_new_halloween_bundle_message_2025($ays_survey_maker_flag); |
| 1766 |
// $this->ays_survey_black_friday_message($ays_survey_maker_flag); |
| 1767 |
// $this->ays_survey_christmas_banner_message_2025($ays_survey_maker_flag); |
| 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 |
// } |
| 1772 |
} |
| 1773 |
} |
| 1774 |
|
| 1775 |
} |
| 1776 |
|
| 1777 |
// New Mega Bundle |
| 1778 |
public function ays_quiz_new_mega_bundle_message_2025($ishmar){ |
| 1779 |
if($ishmar == 0 ){ |
| 1780 |
$content = array(); |
| 1781 |
|
| 1782 |
$survey_cta_button_link = esc_url('https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=mega-bundle-2025-sale-banner-' . SURVEY_MAKER_VERSION); |
| 1783 |
|
| 1784 |
$content[] = '<div id="ays-survey-new-mega-bundle-2025-dicount-month-main" class="notice notice-success is-dismissible ays_survey_dicount_info">'; |
| 1785 |
$content[] = '<div id="ays-survey-dicount-month" class="ays_survey_dicount_month">'; |
| 1786 |
|
| 1787 |
$content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-text-box">'; |
| 1788 |
$content[] = '<div>'; |
| 1789 |
|
| 1790 |
$content[] = '<span class="ays-survey-new-mega-bundle-2025-title">'; |
| 1791 |
$content[] = __( "<span><a href='". $survey_cta_button_link ."' target='_blank' style='color:#ffffff; text-decoration: underline;'>Mega Bundle</a></span> (Quiz + Survey + Poll)", 'survey-maker' ); |
| 1792 |
$content[] = '</span>'; |
| 1793 |
|
| 1794 |
$content[] = '</br>'; |
| 1795 |
|
| 1796 |
$content[] = '<span class="ays-survey-new-mega-bundle-2025-desc">'; |
| 1797 |
$content[] = __( "30 Day Money Back Guarantee", 'survey-maker' ); |
| 1798 |
$content[] = '</span>'; |
| 1799 |
$content[] = '</div>'; |
| 1800 |
|
| 1801 |
$content[] = '<div>'; |
| 1802 |
$content[] = '<img class="ays-survey-new-mega-bundle-guaranteeicon" src="' . SURVEY_MAKER_ADMIN_URL . '/images/ays-survey-mega-bundle-2025-discount.svg" style="width: 80px;">'; |
| 1803 |
$content[] = '</div>'; |
| 1804 |
|
| 1805 |
$content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form">'; |
| 1806 |
|
| 1807 |
$content[] = '<form action="" method="POST">'; |
| 1808 |
$content[] = '<div id="ays-survey-dismiss-buttons-content">'; |
| 1809 |
if( current_user_can( 'manage_options' ) ){ |
| 1810 |
$content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">'. __( "Dismiss ad", 'survey-maker' ) .'</button>'; |
| 1811 |
$content[] = wp_nonce_field( SURVEY_MAKER_NAME . '-sale-banner' , SURVEY_MAKER_NAME . '-sale-banner' ); |
| 1812 |
} |
| 1813 |
$content[] = '</div>'; |
| 1814 |
$content[] = '</form>'; |
| 1815 |
|
| 1816 |
$content[] = '</div>'; |
| 1817 |
|
| 1818 |
$content[] = '</div>'; |
| 1819 |
|
| 1820 |
$content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-countdown-box">'; |
| 1821 |
|
| 1822 |
$content[] = '<div id="ays-survey-maker-countdown-main-container">'; |
| 1823 |
$content[] = '<div class="ays-survey-maker-countdown-container">'; |
| 1824 |
|
| 1825 |
$content[] = '<div id="ays-survey-countdown">'; |
| 1826 |
|
| 1827 |
$content[] = '<ul>'; |
| 1828 |
$content[] = '<li><span id="ays-survey-countdown-days"></span>'. __( "Days", 'survey-maker' ) .'</li>'; |
| 1829 |
$content[] = '<li><span id="ays-survey-countdown-hours"></span>'. __( "Hours", 'survey-maker' ) .'</li>'; |
| 1830 |
$content[] = '<li><span id="ays-survey-countdown-minutes"></span>'. __( "Minutes", 'survey-maker' ) .'</li>'; |
| 1831 |
$content[] = '<li><span id="ays-survey-countdown-seconds"></span>'. __( "Seconds", 'survey-maker' ) .'</li>'; |
| 1832 |
$content[] = '</ul>'; |
| 1833 |
$content[] = '</div>'; |
| 1834 |
|
| 1835 |
$content[] = '<div id="ays-survey-countdown-content" class="emoji">'; |
| 1836 |
$content[] = '<span></span>'; |
| 1837 |
$content[] = '<span></span>'; |
| 1838 |
$content[] = '<span></span>'; |
| 1839 |
$content[] = '<span></span>'; |
| 1840 |
$content[] = '</div>'; |
| 1841 |
|
| 1842 |
$content[] = '</div>'; |
| 1843 |
$content[] = '</div>'; |
| 1844 |
|
| 1845 |
$content[] = '</div>'; |
| 1846 |
|
| 1847 |
$content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-button-box">'; |
| 1848 |
$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>'; |
| 1849 |
$content[] = '<span class="ays-survey-dicount-one-time-text">'; |
| 1850 |
$content[] = __( "One-time payment", 'survey-maker' ); |
| 1851 |
$content[] = '</span>'; |
| 1852 |
$content[] = '</div>'; |
| 1853 |
$content[] = '</div>'; |
| 1854 |
$content[] = '</div>'; |
| 1855 |
|
| 1856 |
$content = implode( '', $content ); |
| 1857 |
echo wp_kses_post($content); |
| 1858 |
} |
| 1859 |
} |
| 1860 |
|
| 1861 |
// New Mega Bundle 2026 |
| 1862 |
public static function ays_survey_new_mega_bundle_message_2026($ishmar){ |
| 1863 |
if( $ishmar == 0 ){ |
| 1864 |
$content = array(); |
| 1865 |
|
| 1866 |
$date = time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS); |
| 1867 |
$now_date = date('M d, Y H:i:s', $date); |
| 1868 |
|
| 1869 |
$survey_banner_date = strtotime( self::ays_survey_update_banner_time() ); |
| 1870 |
|
| 1871 |
$diff = $survey_banner_date - $date; |
| 1872 |
|
| 1873 |
$style_attr = ''; |
| 1874 |
if( $diff < 0 ){ |
| 1875 |
$style_attr = 'style="display:none;"'; |
| 1876 |
} |
| 1877 |
|
| 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 ); |
| 1879 |
|
| 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">'; |
| 1881 |
$content[] = '<div id="ays-survey-dicount-month" class="ays_survey_dicount_month">'; |
| 1882 |
|
| 1883 |
$content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-text-box">'; |
| 1884 |
$content[] = '<div>'; |
| 1885 |
$content[] = '<div class="ays-survey-dicount-logo-box">'; |
| 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>'; |
| 1887 |
|
| 1888 |
$content[] = '<div>'; |
| 1889 |
$content[] = '<span class="ays-survey-new-mega-bundle-title">'; |
| 1890 |
$content[] = sprintf( |
| 1891 |
/* translators: 1: opening link wrapper with <a> tag, 2: closing </a> tag */ |
| 1892 |
__( 'Upgrade to %1$s Survey Maker PRO %2$s', 'survey-maker' ), |
| 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;">', |
| 1894 |
'</a></span>' |
| 1895 |
); |
| 1896 |
$content[] = '</span>'; |
| 1897 |
$content[] = '</br>'; |
| 1898 |
$content[] = '<span class="ays-survey-new-mega-bundle-desc">'; |
| 1899 |
$content[] = __( "30 Day Money Back Guarantee", 'survey-maker' ); |
| 1900 |
$content[] = '</span>'; |
| 1901 |
$content[] = '</div>'; |
| 1902 |
|
| 1903 |
$content[] = '<div class="ays-survey-new-mega-bundle-title-icon-row" style="display: inline-block;">'; |
| 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;">'; |
| 1905 |
$content[] = '</div>'; |
| 1906 |
|
| 1907 |
$content[] = '</div>'; |
| 1908 |
|
| 1909 |
$content[] = '</div>'; |
| 1910 |
|
| 1911 |
$content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form">'; |
| 1912 |
|
| 1913 |
$content[] = '<form action="" method="POST">'; |
| 1914 |
$content[] = '<div id="ays-survey-dismiss-buttons-content">'; |
| 1915 |
if( current_user_can( 'manage_options' ) ){ |
| 1916 |
$content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">'. __( "Dismiss ad", 'survey-maker' ) .'</button>'; |
| 1917 |
$content[] = wp_nonce_field( SURVEY_MAKER_NAME . '-sale-banner' , SURVEY_MAKER_NAME . '-sale-banner' ); |
| 1918 |
} |
| 1919 |
$content[] = '</div>'; |
| 1920 |
$content[] = '</form>'; |
| 1921 |
|
| 1922 |
$content[] = '</div>'; |
| 1923 |
|
| 1924 |
$content[] = '</div>'; |
| 1925 |
|
| 1926 |
$content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-countdown-box">'; |
| 1927 |
|
| 1928 |
$content[] = '<div id="ays-survey-countdown-main-container">'; |
| 1929 |
$content[] = '<div class="ays-survey-countdown-container">'; |
| 1930 |
|
| 1931 |
$content[] = '<div ' . $style_attr . ' id="ays-survey-countdown">'; |
| 1932 |
|
| 1933 |
$content[] = '<ul>'; |
| 1934 |
|
| 1935 |
$content[] = '<li><span id="ays-survey-countdown-days"></span></li>'; |
| 1936 |
$content[] = '<li><span id="ays-survey-countdown-hours"></span></li>'; |
| 1937 |
$content[] = '<li><span id="ays-survey-countdown-minutes"></span></li>'; |
| 1938 |
$content[] = '<li><span id="ays-survey-countdown-seconds"></span></li>'; |
| 1939 |
$content[] = '</ul>'; |
| 1940 |
$content[] = '</div>'; |
| 1941 |
|
| 1942 |
$content[] = '<div id="ays-survey-countdown-content" class="emoji">'; |
| 1943 |
$content[] = '</div>'; |
| 1944 |
|
| 1945 |
$content[] = '</div>'; |
| 1946 |
$content[] = '</div>'; |
| 1947 |
|
| 1948 |
$content[] = '</div>'; |
| 1949 |
|
| 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">'; |
| 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>'; |
| 1961 |
$content[] = '<span class="ays-survey-dicount-one-time-text">'; |
| 1962 |
$content[] = __( "One-time payment", 'survey-maker' ); |
| 1963 |
$content[] = '</span>'; |
| 1964 |
$content[] = '</div>'; |
| 1965 |
$content[] = '</div>'; |
| 1966 |
$content[] = '</div>'; |
| 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 |
|
| 2016 |
// /* New Mega Bundle Banner Survey | Start */ |
| 2017 |
$content[] = '<style id="ays-survey-mega-bundle-styles-inline-css">'; |
| 2018 |
$content[] = ' |
| 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 |
}'; |
| 2086 |
$content[] = '</style>'; |
| 2087 |
// /* New Mega Bundle Banner Survey | End */ |
| 2088 |
|
| 2089 |
$content = implode( '', $content ); |
| 2090 |
echo ($content); |
| 2091 |
} |
| 2092 |
} |
| 2093 |
|
| 2094 |
// Christmas Banner 2025 |
| 2095 |
public static function ays_survey_christmas_banner_message_2025($ishmar){ |
| 2096 |
if($ishmar == 0 ){ |
| 2097 |
$content = array(); |
| 2098 |
|
| 2099 |
$svg_icon = '<svg width="21" height="22" viewBox="0 0 21 22" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 2100 |
<path fill-rule="evenodd" clip-rule="evenodd" d="M10.0445 0C10.4587 0 10.7945 0.33579 10.7945 0.75V2.93934L12.5141 1.21967C12.807 0.92678 13.2819 0.92678 13.5748 1.21967C13.8677 1.51256 13.8677 1.98744 13.5748 2.28033L10.7945 5.06066V9.451L14.5965 7.25588L15.6142 3.45788C15.7214 3.05778 16.1326 2.82034 16.5327 2.92755C16.9328 3.03475 17.1703 3.44601 17.0631 3.84611L16.4336 6.19522L18.3296 5.10055C18.6884 4.89344 19.147 5.01635 19.3542 5.37507C19.5613 5.73379 19.4384 6.19248 19.0796 6.39959L17.1836 7.49426L19.5327 8.1237C19.9328 8.23091 20.1703 8.64216 20.0631 9.0423C19.9558 9.4424 19.5446 9.6798 19.1445 9.5726L15.3465 8.55492L11.5445 10.75L15.3467 12.9452L19.1447 11.9275C19.5448 11.8203 19.956 12.0578 20.0633 12.4579C20.1705 12.858 19.933 13.2692 19.5329 13.3764L17.1838 14.0059L19.0798 15.1005C19.4386 15.3077 19.5615 15.7663 19.3544 16.1251C19.1472 16.4838 18.6886 16.6067 18.3298 16.3996L16.4338 15.3049L17.0633 17.654C17.1705 18.0541 16.933 18.4654 16.5329 18.5726C16.1328 18.6798 15.7216 18.4424 15.6144 18.0423L14.5967 14.2443L10.7945 12.049V16.4393L13.5748 19.2197C13.8677 19.5126 13.8677 19.9874 13.5748 20.2803C13.2819 20.5732 12.807 20.5732 12.5141 20.2803L10.7945 18.5607V20.75C10.7945 21.1642 10.4587 21.5 10.0445 21.5C9.63033 21.5 9.29453 21.1642 9.29453 20.75V18.5607L7.57484 20.2803C7.28195 20.5732 6.80707 20.5732 6.51418 20.2803C6.22129 19.9874 6.22129 19.5126 6.51418 19.2197L9.29453 16.4393V12.049L5.4923 14.2443L4.47463 18.0423C4.36742 18.4424 3.95617 18.6798 3.55607 18.5726C3.15597 18.4654 2.91853 18.0541 3.02574 17.654L3.65518 15.3049L1.75916 16.3996C1.40044 16.6067 0.941743 16.4838 0.734643 16.1251C0.527533 15.7663 0.650443 15.3077 1.00916 15.1005L2.90518 14.0059L0.556073 13.3764C0.155973 13.2692 -0.081467 12.858 0.0257431 12.4579C0.132943 12.0578 0.544203 11.8203 0.944303 11.9275L4.7423 12.9452L8.54453 10.75L4.74249 8.55492L0.944493 9.5726C0.544393 9.6798 0.133143 9.4424 0.0259331 9.0423C-0.0812669 8.64216 0.156163 8.23091 0.556263 8.1237L2.90538 7.49426L1.00935 6.39959C0.650633 6.19248 0.527733 5.73379 0.734833 5.37507C0.941943 5.01635 1.40063 4.89344 1.75935 5.10055L3.65538 6.19522L3.02593 3.84611C2.91873 3.44601 3.15616 3.03475 3.55626 2.92755C3.95636 2.82034 4.36762 3.05778 4.47482 3.45788L5.49249 7.25588L9.29453 9.451V5.06066L6.51418 2.28033C6.22129 1.98744 6.22129 1.51256 6.51418 1.21967C6.80707 0.92678 7.28195 0.92678 7.57484 1.21967L9.29453 2.93934V0.75C9.29453 0.33579 9.63033 0 10.0445 0Z" fill="white" fill-opacity="0.2"/> |
| 2101 |
</svg> |
| 2102 |
'; |
| 2103 |
|
| 2104 |
$ays_survey_cta_button_link = esc_url('https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=christmas-sale-banner-' . SURVEY_MAKER_VERSION); |
| 2105 |
|
| 2106 |
$content[] = '<div id="ays-survey-christmas-banner-main" class="notice notice-success is-dismissible ays-survey-christmas-banner-info ays_survey_dicount_info">'; |
| 2107 |
$content[] = '<div id="ays-survey-christmas-banner-month" class="ays-survey-christmas-banner-month">'; |
| 2108 |
|
| 2109 |
// Background effects |
| 2110 |
$content[] = '<div class="ays-survey-christmas-banner-bg-effects">'; |
| 2111 |
$content[] = '<div class="ays-survey-christmas-banner-bg-gradient-1"></div>'; |
| 2112 |
$content[] = '<div class="ays-survey-christmas-banner-bg-gradient-2"></div>'; |
| 2113 |
|
| 2114 |
// Snowflakes |
| 2115 |
$content[] = '<div class="ays-survey-christmas-banner-snowflake" style="left: 5%; animation-delay: 0s; animation-duration: 8s;">'. $svg_icon .'</div>'; |
| 2116 |
$content[] = '<div class="ays-survey-christmas-banner-snowflake" style="left: 15%; animation-delay: 2s; animation-duration: 10s;">'. $svg_icon .'</div>'; |
| 2117 |
$content[] = '<div class="ays-survey-christmas-banner-snowflake" style="left: 25%; animation-delay: 4s; animation-duration: 9s;">'. $svg_icon .'</div>'; |
| 2118 |
$content[] = '<div class="ays-survey-christmas-banner-snowflake" style="left: 75%; animation-delay: 1s; animation-duration: 11s;">'. $svg_icon .'</div>'; |
| 2119 |
$content[] = '<div class="ays-survey-christmas-banner-snowflake" style="left: 85%; animation-delay: 3s; animation-duration: 8s;">'. $svg_icon .'</div>'; |
| 2120 |
$content[] = '<div class="ays-survey-christmas-banner-snowflake" style="left: 92%; animation-delay: 5s; animation-duration: 10s;">'. $svg_icon .'</div>'; |
| 2121 |
|
| 2122 |
// Sparkles |
| 2123 |
$content[] = '<svg class="ays-survey-christmas-banner-sparkle" style="top: 20%; left: 8%; animation-delay: 0s; width: 14px; height: 14px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'; |
| 2124 |
$content[] = '<path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/>'; |
| 2125 |
$content[] = '</svg>'; |
| 2126 |
$content[] = '<svg class="ays-survey-christmas-banner-sparkle" style="top: 60%; left: 3%; animation-delay: 0.5s; width: 10px; height: 10px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'; |
| 2127 |
$content[] = '<path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/>'; |
| 2128 |
$content[] = '</svg>'; |
| 2129 |
$content[] = '<svg class="ays-survey-christmas-banner-sparkle" style="top: 30%; right: 12%; animation-delay: 1s; width: 12px; height: 12px;" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2">'; |
| 2130 |
$content[] = '<path d="M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z"/>'; |
| 2131 |
$content[] = '</svg>'; |
| 2132 |
$content[] = '</div>'; |
| 2133 |
|
| 2134 |
// Main content |
| 2135 |
$content[] = '<div class="ays-survey-christmas-banner-content">'; |
| 2136 |
$content[] = '<div class="ays-survey-christmas-banner-left">'; |
| 2137 |
// Gift icon with hat |
| 2138 |
$content[] = '<div class="ays-survey-christmas-banner-gift-wrapper">'; |
| 2139 |
$content[] = '<svg class="ays-survey-christmas-banner-gift-icon" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.5">'; |
| 2140 |
$content[] = '<rect x="3" y="8" width="18" height="4" rx="1"></rect>'; |
| 2141 |
$content[] = '<path d="M12 8v13"></path>'; |
| 2142 |
$content[] = '<path d="M19 12v7a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2v-7"></path>'; |
| 2143 |
$content[] = '<path d="M7.5 8a2.5 2.5 0 0 1 0-5A4.8 8 0 0 1 12 8a4.8 8 0 0 1 4.5-5 2.5 2.5 0 0 1 0 5"></path>'; |
| 2144 |
$content[] = '</svg>'; |
| 2145 |
$content[] = '<div class="ays-survey-christmas-banner-hat">'; |
| 2146 |
$content[] = '<svg viewBox="0 0 24 24" fill="none" class="ays-survey-christmas-banner-hat-svg">'; |
| 2147 |
$content[] = '<path d="M12 2L4 14h16L12 2z" fill="hsl(0 80% 45%)"></path>'; |
| 2148 |
$content[] = '<path d="M4 14c0 2 3.5 3 8 3s8-1 8-3" fill="hsl(0 0% 100%)"></path>'; |
| 2149 |
$content[] = '<circle cx="12" cy="3" r="2" fill="hsl(0 0% 100%)"></circle>'; |
| 2150 |
$content[] = '</svg>'; |
| 2151 |
$content[] = '</div>'; |
| 2152 |
$content[] = '</div>'; |
| 2153 |
|
| 2154 |
$content[] = '<div class="ays-survey-christmas-banner-special-label">'; |
| 2155 |
$content[] = '<div class="ays-survey-christmas-banner-special-label-name">'; |
| 2156 |
$content[] = '<a href="'. $ays_survey_cta_button_link .'" class="ays-survey-christmas-banner-special-label-name-link" target="_blank">'; |
| 2157 |
$content[] = __( 'Survey Maker', "survey-maker" ); |
| 2158 |
$content[] = '</a>'; |
| 2159 |
$content[] = '</div>'; |
| 2160 |
|
| 2161 |
$content[] = '<div>✦ ' . __( 'CHRISTMAS SPECIAL', "survey-maker" ) . ' ✦</div>'; |
| 2162 |
$content[] = '</div>'; |
| 2163 |
$content[] = '</div>'; |
| 2164 |
|
| 2165 |
$content[] = '<div class="ays-survey-christmas-banner-center">'; |
| 2166 |
$content[] = '<div class="ays-survey-christmas-banner-discount-text">25% OFF</div>'; |
| 2167 |
$content[] = '<div class="ays-survey-christmas-banner-limited-offer">' . __( 'Limited time offer', "survey-maker" ) . '</div>'; |
| 2168 |
$content[] = '</div>'; |
| 2169 |
|
| 2170 |
$content[] = '<div class="ays-survey-christmas-banner-right">'; |
| 2171 |
$content[] = '<div class="ays-survey-christmas-banner-coupon-box" onclick="aysSurveyChristmasCopyToClipboard(\'XMAS25\')" title="' . __( 'Click to copy', "survey-maker" ) . '">'; |
| 2172 |
$content[] = '<span class="ays-survey-christmas-banner-coupon-text">XMAS25</span>'; |
| 2173 |
$content[] = '<svg class="ays-survey-christmas-banner-copy-icon" width="16" height="16" viewBox="0 0 16 16" fill="none">'; |
| 2174 |
$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"/>'; |
| 2175 |
$content[] = '</svg>'; |
| 2176 |
$content[] = '</div>'; |
| 2177 |
|
| 2178 |
$content[] = '<a href="'. $ays_survey_cta_button_link .'" class="ays-survey-christmas-banner-buy-now-btn" target="_blank">'; |
| 2179 |
$content[] = __( 'Buy Now', "survey-maker" ); |
| 2180 |
$content[] = '</a>'; |
| 2181 |
$content[] = '</div>'; |
| 2182 |
$content[] = '</div>'; |
| 2183 |
|
| 2184 |
$content[] = '</div>'; |
| 2185 |
|
| 2186 |
if( current_user_can( 'manage_options' ) ){ |
| 2187 |
$content[] = '<div id="ays-survey-dismiss-buttons-content">'; |
| 2188 |
$content[] = '<form action="" method="POST" style="position: absolute; bottom: 0; right: 0; color: #fff;">'; |
| 2189 |
$content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="color: darkgrey; font-size: 11px; padding: 0 .75rem;">'. __( "Dismiss ad", 'survey-maker' ) .'</button>'; |
| 2190 |
$content[] = wp_nonce_field( SURVEY_MAKER_NAME . '-sale-banner' , SURVEY_MAKER_NAME . '-sale-banner' ); |
| 2191 |
$content[] = '</form>'; |
| 2192 |
$content[] = '</div>'; |
| 2193 |
} |
| 2194 |
|
| 2195 |
$content[] = '</div>'; |
| 2196 |
|
| 2197 |
$content[] = '<script>'; |
| 2198 |
$content[] = " |
| 2199 |
function aysSurveyChristmasCopyToClipboard(text) { |
| 2200 |
var textarea = document.createElement('textarea'); |
| 2201 |
textarea.value = text; |
| 2202 |
textarea.style.position = 'fixed'; |
| 2203 |
textarea.style.opacity = '0'; |
| 2204 |
document.body.appendChild(textarea); |
| 2205 |
|
| 2206 |
textarea.select(); |
| 2207 |
textarea.setSelectionRange(0, 99999); |
| 2208 |
|
| 2209 |
try { |
| 2210 |
document.execCommand('copy'); |
| 2211 |
aysSurveyChristmasShowCopyNotification('" . __( 'Coupon code copied!', "survey-maker" ) . "'); |
| 2212 |
} catch (err) { |
| 2213 |
console.error('Failed to copy text: ', err); |
| 2214 |
} |
| 2215 |
|
| 2216 |
document.body.removeChild(textarea); |
| 2217 |
} |
| 2218 |
|
| 2219 |
function aysSurveyChristmasShowCopyNotification(message) { |
| 2220 |
var existingNotification = document.querySelector('.ays-survey-christmas-banner-copy-notification'); |
| 2221 |
if (existingNotification) { |
| 2222 |
document.body.removeChild(existingNotification); |
| 2223 |
} |
| 2224 |
|
| 2225 |
var notification = document.createElement('div'); |
| 2226 |
notification.className = 'ays-survey-christmas-banner-copy-notification'; |
| 2227 |
notification.textContent = message; |
| 2228 |
document.body.appendChild(notification); |
| 2229 |
|
| 2230 |
setTimeout(function() { |
| 2231 |
notification.classList.add('show'); |
| 2232 |
}, 10); |
| 2233 |
|
| 2234 |
setTimeout(function() { |
| 2235 |
notification.classList.remove('show'); |
| 2236 |
setTimeout(function() { |
| 2237 |
if (notification.parentNode) { |
| 2238 |
document.body.removeChild(notification); |
| 2239 |
} |
| 2240 |
}, 300); |
| 2241 |
}, 2000); |
| 2242 |
}"; |
| 2243 |
$content[] = '</script>'; |
| 2244 |
|
| 2245 |
$content[] = '<style>'; |
| 2246 |
$content[] = ' |
| 2247 |
/* Christmas banner start */ |
| 2248 |
|
| 2249 |
div#ays-survey-christmas-banner-main .btn-link { |
| 2250 |
background-color: transparent; |
| 2251 |
display: inline-block; |
| 2252 |
font-weight: 400; |
| 2253 |
text-align: center; |
| 2254 |
white-space: nowrap; |
| 2255 |
vertical-align: middle; |
| 2256 |
-webkit-user-select: none; |
| 2257 |
-moz-user-select: none; |
| 2258 |
-ms-user-select: none; |
| 2259 |
user-select: none; |
| 2260 |
border: 1px solid transparent; |
| 2261 |
padding: .375rem .75rem; |
| 2262 |
font-size: 12px; |
| 2263 |
line-height: 1.5; |
| 2264 |
border-radius: .25rem; |
| 2265 |
color: rgba(255, 255, 255, .6); |
| 2266 |
} |
| 2267 |
|
| 2268 |
div#ays-survey-christmas-banner-main.ays-survey-christmas-banner-info { |
| 2269 |
background: linear-gradient(to right, hsl(0, 70%, 28%), hsl(0, 65%, 38%), hsl(0, 70%, 28%)); |
| 2270 |
padding: unset; |
| 2271 |
border-left: 0; |
| 2272 |
position: relative; |
| 2273 |
} |
| 2274 |
|
| 2275 |
#ays-survey-christmas-banner-main .ays-survey-christmas-banner-month { |
| 2276 |
position: relative; |
| 2277 |
padding: 15px 40px; |
| 2278 |
overflow: hidden; |
| 2279 |
} |
| 2280 |
|
| 2281 |
/* Background effects */ |
| 2282 |
.ays-survey-christmas-banner-bg-effects { |
| 2283 |
position: absolute; |
| 2284 |
top: 0; |
| 2285 |
left: 0; |
| 2286 |
right: 0; |
| 2287 |
bottom: 0; |
| 2288 |
pointer-events: none; |
| 2289 |
z-index: 1; |
| 2290 |
} |
| 2291 |
|
| 2292 |
.ays-survey-christmas-banner-bg-gradient-1 { |
| 2293 |
position: absolute; |
| 2294 |
top: 0; |
| 2295 |
left: 30%; |
| 2296 |
width: 40%; |
| 2297 |
height: 100%; |
| 2298 |
background: radial-gradient(circle, rgba(202, 43, 43, 0.5) 0%, transparent 60%); |
| 2299 |
opacity: 0.4; |
| 2300 |
} |
| 2301 |
|
| 2302 |
.ays-survey-christmas-banner-bg-gradient-2 { |
| 2303 |
position: absolute; |
| 2304 |
top: 0; |
| 2305 |
right: 15%; |
| 2306 |
width: 35%; |
| 2307 |
height: 100%; |
| 2308 |
background: radial-gradient(circle, rgba(246, 201, 85, 0.15) 0%, transparent 50%); |
| 2309 |
opacity: 0.3; |
| 2310 |
} |
| 2311 |
|
| 2312 |
.ays-survey-christmas-banner-snowflake { |
| 2313 |
position: absolute; |
| 2314 |
color: rgba(255, 255, 255, 0.2); |
| 2315 |
font-size: 20px; |
| 2316 |
animation: ays-survey-christmas-snowfall linear infinite; |
| 2317 |
top: -10px; |
| 2318 |
} |
| 2319 |
|
| 2320 |
@keyframes ays-survey-christmas-snowfall { |
| 2321 |
0% { |
| 2322 |
transform: translateY(-10px) rotate(0deg); |
| 2323 |
opacity: 0; |
| 2324 |
} |
| 2325 |
10% { |
| 2326 |
opacity: 0.8; |
| 2327 |
} |
| 2328 |
90% { |
| 2329 |
opacity: 0.8; |
| 2330 |
} |
| 2331 |
100% { |
| 2332 |
transform: translateY(100%) rotate(360deg); |
| 2333 |
opacity: 0; |
| 2334 |
} |
| 2335 |
} |
| 2336 |
|
| 2337 |
.ays-survey-christmas-banner-sparkle { |
| 2338 |
position: absolute; |
| 2339 |
color: hsl(43, 90%, 65%); |
| 2340 |
animation: ays-survey-christmas-twinkle 2s ease-in-out infinite; |
| 2341 |
} |
| 2342 |
|
| 2343 |
@keyframes ays-survey-christmas-twinkle { |
| 2344 |
0%, 100% { |
| 2345 |
opacity: 0.3; |
| 2346 |
transform: scale(0.8); |
| 2347 |
} |
| 2348 |
50% { |
| 2349 |
opacity: 1; |
| 2350 |
transform: scale(1.2); |
| 2351 |
} |
| 2352 |
} |
| 2353 |
|
| 2354 |
/* Main content */ |
| 2355 |
.ays-survey-christmas-banner-content { |
| 2356 |
position: relative; |
| 2357 |
display: flex; |
| 2358 |
align-items: center; |
| 2359 |
justify-content: space-between; |
| 2360 |
z-index: 2; |
| 2361 |
} |
| 2362 |
|
| 2363 |
/* Left section */ |
| 2364 |
.ays-survey-christmas-banner-left { |
| 2365 |
display: flex; |
| 2366 |
align-items: center; |
| 2367 |
gap: 50px; |
| 2368 |
} |
| 2369 |
|
| 2370 |
.ays-survey-christmas-banner-gift-wrapper { |
| 2371 |
position: relative; |
| 2372 |
animation: ays-survey-christmas-float 3s ease-in-out infinite; |
| 2373 |
} |
| 2374 |
|
| 2375 |
.ays-survey-christmas-banner-gift-icon { |
| 2376 |
width: 48px; |
| 2377 |
height: 48px; |
| 2378 |
color: rgba(255, 247, 237, 0.9); |
| 2379 |
} |
| 2380 |
|
| 2381 |
@keyframes ays-survey-christmas-float { |
| 2382 |
0%, 100% { |
| 2383 |
transform: translateY(0); |
| 2384 |
} |
| 2385 |
50% { |
| 2386 |
transform: translateY(-5px); |
| 2387 |
} |
| 2388 |
} |
| 2389 |
|
| 2390 |
.ays-survey-christmas-banner-hat { |
| 2391 |
position: absolute; |
| 2392 |
top: -12px; |
| 2393 |
right: -4px; |
| 2394 |
width: 24px; |
| 2395 |
height: 24px; |
| 2396 |
} |
| 2397 |
|
| 2398 |
.ays-survey-christmas-banner-hat-svg { |
| 2399 |
width: 100%; |
| 2400 |
height: 100%; |
| 2401 |
} |
| 2402 |
|
| 2403 |
.ays-survey-christmas-banner-special-label { |
| 2404 |
color: hsl(43, 90%, 65%); |
| 2405 |
font-size: 14px; |
| 2406 |
font-weight: 500; |
| 2407 |
text-transform: uppercase; |
| 2408 |
letter-spacing: 1px; |
| 2409 |
/* font-family: "Outfit", sans-serif; */ |
| 2410 |
} |
| 2411 |
|
| 2412 |
.ays-survey-christmas-banner-special-label-name { |
| 2413 |
color: #fffaf0; |
| 2414 |
text-align: center; |
| 2415 |
} |
| 2416 |
|
| 2417 |
div#ays-survey-christmas-banner-main .ays-survey-christmas-banner-special-label-name-link { |
| 2418 |
color: #fffaf0; |
| 2419 |
box-shadow: unset; |
| 2420 |
} |
| 2421 |
|
| 2422 |
/* Center section */ |
| 2423 |
.ays-survey-christmas-banner-center { |
| 2424 |
display: flex; |
| 2425 |
flex-direction: row; |
| 2426 |
text-align: center; |
| 2427 |
justify-content: center; |
| 2428 |
align-items: center; |
| 2429 |
gap: 30px; |
| 2430 |
} |
| 2431 |
|
| 2432 |
.ays-survey-christmas-banner-discount-text { |
| 2433 |
font-family: "Outfit", sans-serif; |
| 2434 |
font-weight: 800; |
| 2435 |
font-size: 30px; |
| 2436 |
color: hsl(40, 100%, 97%); |
| 2437 |
letter-spacing: -1px; |
| 2438 |
line-height: 1; |
| 2439 |
} |
| 2440 |
|
| 2441 |
.ays-survey-christmas-banner-limited-offer { |
| 2442 |
color: rgba(255, 247, 237, 0.7); |
| 2443 |
font-size: 13px; |
| 2444 |
font-weight: 500; |
| 2445 |
} |
| 2446 |
|
| 2447 |
/* Right section */ |
| 2448 |
.ays-survey-christmas-banner-right { |
| 2449 |
display: flex; |
| 2450 |
align-items: center; |
| 2451 |
gap: 20px; |
| 2452 |
} |
| 2453 |
|
| 2454 |
.ays-survey-christmas-banner-coupon-box { |
| 2455 |
border: 2px dashed rgba(255, 255, 255, 0.4); |
| 2456 |
padding: 8px 16px; |
| 2457 |
border-radius: 6px; |
| 2458 |
background: rgba(255, 255, 255, 0.1); |
| 2459 |
cursor: pointer; |
| 2460 |
transition: all 0.3s; |
| 2461 |
display: flex; |
| 2462 |
align-items: center; |
| 2463 |
gap: 8px; |
| 2464 |
backdrop-filter: blur(10px); |
| 2465 |
} |
| 2466 |
|
| 2467 |
.ays-survey-christmas-banner-coupon-box:hover { |
| 2468 |
background: rgba(255, 255, 255, 0.2); |
| 2469 |
border-color: rgba(255, 255, 255, 0.6); |
| 2470 |
transform: translateY(-1px); |
| 2471 |
} |
| 2472 |
|
| 2473 |
.ays-survey-christmas-banner-coupon-text { |
| 2474 |
font-size: 16px; |
| 2475 |
font-weight: 700; |
| 2476 |
letter-spacing: 1px; |
| 2477 |
color: #fff; |
| 2478 |
font-family: monospace; |
| 2479 |
} |
| 2480 |
|
| 2481 |
.ays-survey-christmas-banner-copy-icon { |
| 2482 |
opacity: 0.8; |
| 2483 |
transition: opacity 0.3s; |
| 2484 |
} |
| 2485 |
|
| 2486 |
.ays-survey-christmas-banner-coupon-box:hover .ays-survey-christmas-banner-copy-icon { |
| 2487 |
opacity: 1; |
| 2488 |
} |
| 2489 |
|
| 2490 |
#ays-survey-christmas-banner-main .ays-survey-christmas-banner-buy-now-btn { |
| 2491 |
background-color: #fbe19f; |
| 2492 |
color: hsl(0, 72%, 35%); |
| 2493 |
padding: 10px 30px; |
| 2494 |
border-radius: 9999px; |
| 2495 |
font-size: 16px; |
| 2496 |
font-weight: 600; |
| 2497 |
font-family: "Outfit", sans-serif; |
| 2498 |
border: none; |
| 2499 |
cursor: pointer; |
| 2500 |
transition: all 0.3s; |
| 2501 |
text-decoration: none; |
| 2502 |
display: flex; |
| 2503 |
align-items: center; |
| 2504 |
gap: 6px; |
| 2505 |
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15), 0 0 30px rgba(246, 201, 85, 0.2); |
| 2506 |
} |
| 2507 |
|
| 2508 |
#ays-survey-christmas-banner-main .ays-survey-christmas-banner-buy-now-btn:hover { |
| 2509 |
background-color: #f2d58c; |
| 2510 |
transform: scale(1.05); |
| 2511 |
box-shadow: 0 8px 30px rgba(0, 0, 0, 0.2), 0 0 40px rgba(246, 201, 85, 0.3); |
| 2512 |
} |
| 2513 |
|
| 2514 |
.ays-survey-christmas-banner-btn-arrow { |
| 2515 |
display: inline-block; |
| 2516 |
transition: transform 0.3s; |
| 2517 |
} |
| 2518 |
|
| 2519 |
.ays-survey-christmas-banner-buy-now-btn:hover .ays-survey-christmas-banner-btn-arrow { |
| 2520 |
transform: translateX(4px); |
| 2521 |
} |
| 2522 |
|
| 2523 |
/* Notification */ |
| 2524 |
.ays-survey-christmas-banner-copy-notification { |
| 2525 |
position: fixed; |
| 2526 |
top: 50%; |
| 2527 |
left: 50%; |
| 2528 |
transform: translate(-50%, -50%); |
| 2529 |
background: rgba(0, 0, 0, 0.8); |
| 2530 |
color: #fff; |
| 2531 |
padding: 12px 24px; |
| 2532 |
border-radius: 8px; |
| 2533 |
font-size: 14px; |
| 2534 |
z-index: 10000; |
| 2535 |
opacity: 0; |
| 2536 |
transition: opacity 0.3s; |
| 2537 |
} |
| 2538 |
|
| 2539 |
.ays-survey-christmas-banner-copy-notification.show { |
| 2540 |
opacity: 1; |
| 2541 |
} |
| 2542 |
|
| 2543 |
/* Dismiss button */ |
| 2544 |
#ays-survey-christmas-banner-main #ays-survey-christmas-banner-dismiss-content { |
| 2545 |
display: flex; |
| 2546 |
justify-content: center; |
| 2547 |
} |
| 2548 |
|
| 2549 |
#ays-survey-christmas-banner-main #ays-survey-christmas-banner-dismiss-content .ays-button { |
| 2550 |
margin: 0 !important; |
| 2551 |
font-size: 13px; |
| 2552 |
color: rgba(150, 147, 147, 0.69); |
| 2553 |
} |
| 2554 |
|
| 2555 |
/* Responsive */ |
| 2556 |
@media (max-width: 1024px) { |
| 2557 |
.ays-survey-christmas-banner-discount-text { |
| 2558 |
font-size: 40px; |
| 2559 |
} |
| 2560 |
.ays-survey-christmas-banner-content { |
| 2561 |
flex-wrap: wrap; |
| 2562 |
} |
| 2563 |
} |
| 2564 |
|
| 2565 |
@media (max-width: 768px) { |
| 2566 |
#ays-survey-christmas-banner-main { |
| 2567 |
display: none !important; |
| 2568 |
} |
| 2569 |
} |
| 2570 |
/* Christmas banner end */ |
| 2571 |
'; |
| 2572 |
$content[] = '</style>'; |
| 2573 |
|
| 2574 |
$content = implode( '', $content ); |
| 2575 |
|
| 2576 |
echo $content; |
| 2577 |
} |
| 2578 |
} |
| 2579 |
|
| 2580 |
// Black Friday |
| 2581 |
public static function ays_survey_black_friday_message($ishmar){ |
| 2582 |
if($ishmar == 0 ){ |
| 2583 |
$content = array(); |
| 2584 |
|
| 2585 |
$ays_survey_cta_button_link = esc_url('https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=black-friday-sale-banner-' . SURVEY_MAKER_VERSION); |
| 2586 |
|
| 2587 |
$content[] = '<div id="ays-survey-dicount-black-friday-month-main" class="notice notice-success is-dismissible ays_survey_dicount_info">'; |
| 2588 |
$content[] = '<div id="ays-survey-dicount-black-friday-month" class="ays_survey_dicount_month">'; |
| 2589 |
$content[] = '<div class="ays-survey-dicount-black-friday-box">'; |
| 2590 |
$content[] = '<div class="ays-survey-dicount-black-friday-wrap-box ays-survey-dicount-black-friday-wrap-box-80" style="width: 70%;">'; |
| 2591 |
$content[] = '<div class="">'; |
| 2592 |
$content[] = '<div class="ays-survey-dicount-black-friday-title-row" >' . __( 'Coupon Code', "survey-maker" ) .' ' . '</div>'; |
| 2593 |
$content[] = '<div class="ays-survey-dicount-black-friday-title-row">'; |
| 2594 |
|
| 2595 |
$content[] = ' |
| 2596 |
<span class="ays-survey-dicount-black-friday-banner-2025-coupon-wrapper"> |
| 2597 |
<span class="ays-survey-dicount-black-friday-banner-2025-coupon-box" onclick="aysSurveyHalloweenCopyToClipboard(\'FREE2PROBF\')" title="Click to copy"> |
| 2598 |
<span class="ays-survey-dicount-black-friday-banner-2025-coupon-text">FREE2PROBF</span> |
| 2599 |
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="ays-survey-dicount-black-friday-banner-2025-copy-icon"> |
| 2600 |
<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"/> |
| 2601 |
</svg> |
| 2602 |
</span> |
| 2603 |
</span>'; |
| 2604 |
$content[] = '</div> '; |
| 2605 |
$content[] = '</div>'; |
| 2606 |
|
| 2607 |
$content[] = '</div>'; |
| 2608 |
|
| 2609 |
$content[] = '<div class="ays-survey-dicount-black-friday-wrap-box ays-survey-dicount-black-friday-wrap-text-box">'; |
| 2610 |
$content[] = '<div class="ays-survey-dicount-black-friday-text-row">' . '30% off' . '</div>'; |
| 2611 |
$content[] = '</div>'; |
| 2612 |
|
| 2613 |
$content[] = '<div class="ays-survey-dicount-black-friday-wrap-box" style="width: 25%;">'; |
| 2614 |
$content[] = '<div id="ays-survey-countdown-main-container">'; |
| 2615 |
$content[] = '<div class="ays-survey-countdown-container">'; |
| 2616 |
$content[] = '<div id="ays-survey-countdown" style="display: block;">'; |
| 2617 |
$content[] = '<ul>'; |
| 2618 |
$content[] = '<li><span id="ays-survey-countdown-days"></span>' . __( 'Days', "survey-maker" ) . '</li>'; |
| 2619 |
$content[] = '<li><span id="ays-survey-countdown-hours"></span>' . __( 'Hours', "survey-maker" ) . '</li>'; |
| 2620 |
$content[] = '<li><span id="ays-survey-countdown-minutes"></span>' . __( 'Minutes', "survey-maker" ) . '</li>'; |
| 2621 |
$content[] = '<li><span id="ays-survey-countdown-seconds"></span>' . __( 'Seconds', "survey-maker" ) . '</li>'; |
| 2622 |
$content[] = '</ul>'; |
| 2623 |
$content[] = '</div>'; |
| 2624 |
$content[] = '<div id="ays-survey-countdown-content" class="emoji" style="display: none;">'; |
| 2625 |
$content[] = '<span></span>'; |
| 2626 |
$content[] = '<span></span>'; |
| 2627 |
$content[] = '<span></span>'; |
| 2628 |
$content[] = '<span></span>'; |
| 2629 |
$content[] = '</div>'; |
| 2630 |
$content[] = '</div>'; |
| 2631 |
$content[] = '</div>'; |
| 2632 |
$content[] = '</div>'; |
| 2633 |
|
| 2634 |
$content[] = '<div class="ays-survey-dicount-black-friday-wrap-box" style="width: 25%;">'; |
| 2635 |
$content[] = '<a href="'. $ays_survey_cta_button_link .'" class="ays-survey-dicount-black-friday-button-buy-now" target="_blank">' . __( 'Get Your Deal', "survey-maker" ) . '</a>'; |
| 2636 |
$content[] = '</div>'; |
| 2637 |
$content[] = '</div>'; |
| 2638 |
$content[] = '</div>'; |
| 2639 |
|
| 2640 |
$content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form-black-friday">'; |
| 2641 |
$content[] = '<form action="" method="POST">'; |
| 2642 |
$content[] = '<div id="ays-survey-dismiss-buttons-content">'; |
| 2643 |
if( current_user_can( 'manage_options' ) ){ |
| 2644 |
$content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>'; |
| 2645 |
$content[] = wp_nonce_field( SURVEY_MAKER_NAME . '-sale-banner' , SURVEY_MAKER_NAME . '-sale-banner' ); |
| 2646 |
} |
| 2647 |
$content[] = '</div>'; |
| 2648 |
$content[] = '</form>'; |
| 2649 |
$content[] = '</div>'; |
| 2650 |
$content[] = '</div>'; |
| 2651 |
|
| 2652 |
$content[] = '<script>'; |
| 2653 |
$content[] = " |
| 2654 |
function aysSurveyHalloweenCopyToClipboard(text) { |
| 2655 |
// Create a temporary textarea element |
| 2656 |
var textarea = document.createElement('textarea'); |
| 2657 |
textarea.value = text; |
| 2658 |
textarea.style.position = 'fixed'; |
| 2659 |
textarea.style.opacity = '0'; |
| 2660 |
document.body.appendChild(textarea); |
| 2661 |
|
| 2662 |
// Select and copy the text |
| 2663 |
textarea.select(); |
| 2664 |
textarea.setSelectionRange(0, 99999); // For mobile devices |
| 2665 |
|
| 2666 |
try { |
| 2667 |
document.execCommand('copy'); |
| 2668 |
aysSurveyHalloweenShowCopyNotification('Coupon code copied!'); |
| 2669 |
} catch (err) { |
| 2670 |
console.error('Failed to copy text: ', err); |
| 2671 |
} |
| 2672 |
|
| 2673 |
// Remove the temporary textarea |
| 2674 |
document.body.removeChild(textarea); |
| 2675 |
} |
| 2676 |
|
| 2677 |
function aysSurveyHalloweenShowCopyNotification(message) { |
| 2678 |
// Check if notification already exists |
| 2679 |
var existingNotification = document.querySelector('.ays-survey-discount-black-friday-banner-2025-copy-notification'); |
| 2680 |
if (existingNotification) { |
| 2681 |
document.body.removeChild(existingNotification); |
| 2682 |
} |
| 2683 |
|
| 2684 |
// Create notification element |
| 2685 |
var notification = document.createElement('div'); |
| 2686 |
notification.className = 'ays-survey-discount-black-friday-banner-2025-copy-notification'; |
| 2687 |
notification.textContent = message; |
| 2688 |
document.body.appendChild(notification); |
| 2689 |
|
| 2690 |
// Show notification with animation |
| 2691 |
setTimeout(function() { |
| 2692 |
notification.classList.add('show'); |
| 2693 |
}, 10); |
| 2694 |
|
| 2695 |
// Hide and remove notification after 2 seconds |
| 2696 |
setTimeout(function() { |
| 2697 |
notification.classList.remove('show'); |
| 2698 |
setTimeout(function() { |
| 2699 |
if (notification.parentNode) { |
| 2700 |
document.body.removeChild(notification); |
| 2701 |
} |
| 2702 |
}, 300); |
| 2703 |
}, 2000); |
| 2704 |
}"; |
| 2705 |
$content[] = '</script>'; |
| 2706 |
|
| 2707 |
$content[] = '<style>'; |
| 2708 |
$content[] = ' |
| 2709 |
/* Black friday banner start */ |
| 2710 |
div#ays-survey-dicount-black-friday-month-main *{color:#fff}div#ays-survey-dicount-black-friday-month-main div#ays-survey-dicount-black-friday-month a.ays-survey-sale-banner-link:focus{outline:0;box-shadow:0}div#ays-survey-dicount-black-friday-month-main .btn-link{background-color:transparent;display:inline-block;font-weight:400;text-align:center;white-space:nowrap;vertical-align:middle;-webkit-user-select:none;-moz-user-select:none;-ms-user-select:none;user-select:none;border:1px solid transparent;padding:.375rem .75rem;font-size:12px;line-height:1.5;border-radius:.25rem;color:rgba(255,255,255,.6)}div#ays-survey-dicount-black-friday-month-main.ays_survey_dicount_info{background-image:linear-gradient(45deg,#1e101d,#c60af4);padding:unset;border-left:0}#ays-survey-dicount-black-friday-month-main .ays_survey_dicount_month{position:relative;background-image:url("'. esc_attr(SURVEY_MAKER_ADMIN_URL) .'/images/black-friday-plugins-background-image.webp");background-position:center right;background-repeat:no-repeat;background-size:100% 100%}#ays-survey-dicount-black-friday-month-main .ays_survey_dicount_month img{width:80px}#ays-survey-dicount-black-friday-month-main .ays-survey-sale-banner-link{display:flex;justify-content:center;align-items:center;width:200px}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-button-sale{font-style:normal;font-weight:600;font-size:24px;text-align:center;color:#b2ff00;text-transform:uppercase}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box{font-size:14px;padding:12px;text-align:center;width:50%;white-space:nowrap}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box strong{font-size:17px;font-weight:700;letter-spacing:.8px}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-color{color:#971821}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-text-decoration{text-decoration:underline}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box.ays-buy-now-button-box{display:flex;justify-content:flex-end;align-items:center;width:30%}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box .ays-button,#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box .ays-buy-now-button{align-items:center;font-weight:500}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box .ays-buy-now-button{background:#971821;border-color:#fff;display:flex;justify-content:center;align-items:center;padding:5px 15px;font-size:16px;border-radius:5px}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box .ays-buy-now-button:hover{background:#7d161d;border-color:#971821}#ays-survey-dicount-black-friday-month-main #ays-survey-dismiss-buttons-content{display:flex;justify-content:center}#ays-survey-dicount-black-friday-month-main #ays-survey-dismiss-buttons-content .ays-button{margin:0!important;font-size:13px;color:#969393b0}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-opacity-box{width:19%}#ays-survey-dicount-black-friday-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;font-weight:600}#ays-survey-countdown-main-container li{display:inline-block;font-size:10px;list-style-type:none;padding:10px;text-transform:uppercase}#ays-survey-countdown-main-container li span{display:block;font-size:22px;min-height:33px}#ays-survey-countdown-main-container .emoji{display:none;padding:1rem}#ays-survey-countdown-main-container .emoji span{font-size:25px;padding:0 .5rem}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-box{display:flex;justify-content:space-between;align-items:center;width:95%;margin:auto}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-title-row{text-align:center;padding-right:50px;font-style:normal;font-weight:900;font-size:19px;color:#fff;}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-button-buy-now{border:none;outline:0;padding:10px 20px;font-size:22px;text-transform:uppercase;font-weight:700;text-decoration:none;background:linear-gradient(180deg,#dd0bef 0,#82008d 100%);border-radius:16px}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-text-row{text-transform:uppercase;text-shadow:-1.5px 0 #dd0bef,0 1.5px #dd0bef,1.5px 0 #dd0bef,0 -1.5px #dd0bef;font-weight:900;font-style:normal;font-size:40px;line-height:40px;color:#fff}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-text-box{position:absolute;width:25%;top:10px;bottom:0;right:0;left:0;margin:0 auto}#ays-survey-countdown ul{padding:0}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-banner-2025-coupon-box{border:2px dashed rgba(255,255,255,.4);padding:0 12px;border-radius:6px;background:rgba(255,255,255,.1);cursor:pointer;transition:.3s;display:flex;align-items:center;justify-content:center;gap:6px;backdrop-filter:blur(10px);width:fit-content;margin:0 auto}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-banner-2025-coupon-box:hover{background:rgba(255,255,255,.2);border-color:rgba(255,255,255,.6);transform:translateY(-1px)}#ays-survey-dicount-black-friday-month-main .ays-survey-discount-black-friday-banner-2025-coupon-text{font-size:14px;font-weight:700;letter-spacing:1px;color:#fff;font-family:monospace}#ays-survey-dicount-black-friday-month-main .ays-survey-discount-black-friday-banner-2025-copy-icon{opacity:.8;transition:opacity .3s}#ays-survey-dicount-black-friday-month-main .ays-survey-discount-black-friday-banner-banner-2025-coupon-box:hover .ays-survey-discount-black-friday-banner-2025-copy-icon,.ays-survey-discount-black-friday-banner-2025-copy-notification.show{opacity:1}.ays-survey-discount-black-friday-banner-2025-copy-notification{position:fixed;top:50%;left:50%;transform:translate(-50%,-50%);background:rgba(0,0,0,.8);color:#fff;padding:12px 24px;border-radius:8px;font-size:14px;z-index:10000;opacity:0;transition:opacity .3s}@media screen and (max-width:1400px) and (min-width:1200px){div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-title-row{font-size:15px}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-text-row{font-size:27px}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-box{width:100%}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-button-buy-now{font-size:13px}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box-80{width:80%!important}}@media all and (max-width:1200px){div#ays-survey-dicount-black-friday-month-main .ays_survey_dicount_month{background:unset}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-text-row{font-size:30px}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-box{width:100%}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-button-buy-now{font-size:15px}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box-80{width:80%!important}}@media all and (max-width:1200px) and (min-width:1150px){div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-title-row{font-size:15px}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-button-buy-now{font-size:10px}}@media all and (max-width:1150px){div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box-80{width:80%!important}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-box{flex-direction:column}div#ays-survey-dicount-black-friday-month-main{padding-right:0}div#ays-survey-dicount-black-friday-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-dicount-black-friday-month-main div.ays-survey-dicount-black-friday-wrap-box{width:100%!important;text-align:center}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-title-row,div#ays-survey-dicount-black-friday-month-main #ays-survey-countdown-main-container ul{padding:0;font-size:13px}#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-button-sale,div#ays-survey-countdown-main-container li{font-size:15px}div#ays-survey-countdown-main-container li span{font-size:25px}div#ays-survey-dicount-black-friday-month-main div.ays-survey-dicount-black-friday-wrap-text-box{position:unset}#ays-survey-countdown-main-container #ays-survey-countdown-headline{font-size:15px;font-weight:600}#ays-survey-countdown-main-container ul{font-weight:500}#ays-survey-countdown-main-container li span{font-size:20px}#ays-survey-dicount-black-friday-month-main .ays-button{margin:0 auto!important}div#ays-survey-dicount-black-friday-month-main.ays_survey_dicount_info.notice{background-position:bottom right;background-repeat:no-repeat;background-size:contain;display:flex;justify-content:center;background-image:linear-gradient(45deg,#1e101d,#c60af4)}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box.ays-buy-now-button-box{justify-content:center}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-wrap-box .ays-buy-now-button{font-size:14px;padding:5px 10px}div#ays-survey-dicount-black-friday-month-main .ays-survey-dicount-black-friday-button-buy-now{padding:10px 18px;font-size:15px}}@media all and (max-width:768px){#ays-survey-dicount-black-friday-month-main{display:none!important}} |
| 2711 |
'; |
| 2712 |
$content[] = '</style>'; |
| 2713 |
|
| 2714 |
$content = implode( '', $content ); |
| 2715 |
|
| 2716 |
echo $content; |
| 2717 |
} |
| 2718 |
} |
| 2719 |
|
| 2720 |
// Halloween Bundle 2025 |
| 2721 |
public function ays_survey_new_halloween_bundle_message_2025($ishmar){ |
| 2722 |
if($ishmar == 0 ){ |
| 2723 |
$content = array(); |
| 2724 |
|
| 2725 |
$date = time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS); |
| 2726 |
$now_date = date('M d, Y H:i:s', $date); |
| 2727 |
|
| 2728 |
$start_date = strtotime('2025-09-08 00:00:01'); |
| 2729 |
$end_date = strtotime('2025-11-07 23:59:59'); |
| 2730 |
$diff_end = $end_date - $date; |
| 2731 |
|
| 2732 |
$style_attr = ''; |
| 2733 |
if( $diff_end < 0 ){ |
| 2734 |
$style_attr = 'style="display:none;"'; |
| 2735 |
} |
| 2736 |
|
| 2737 |
$ays_survey_cta_button_link = esc_url('https://ays-pro.com/halloween-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=survey-halloween-banner-' . SURVEY_MAKER_VERSION); |
| 2738 |
|
| 2739 |
$content[] = ' |
| 2740 |
<div id="ays-survey-halloween-banner-2025-main" class="ays-survey-halloween-banner-2025-main ays_survey_dicount_info notice notice-success is-dismissible"> |
| 2741 |
<div class="ays-survey-halloween-banner-2025-content"> |
| 2742 |
<div class="ays-survey-halloween-banner-2025-left"> |
| 2743 |
<div class="ays-survey-halloween-banner-2025-text"> |
| 2744 |
<h2 class="ays-survey-halloween-banner-2025-title">Boo! Grab Your <a href="'. $ays_survey_cta_button_link .'" class="" target="_blank">Halloween Deal</a> <br/> Before It Vanishes!</h2> |
| 2745 |
<p class="ays-survey-halloween-banner-2025-subtitle">Don’t get spooked by missing out!<br/> Get 50% off our exclusive Halloween Bundle (Survey + SCCP + Poll Maker + Popup Box) while the magic lasts!</p> |
| 2746 |
</div> |
| 2747 |
</div> |
| 2748 |
|
| 2749 |
<div class="ays-survey-halloween-banner-2025-center">'; |
| 2750 |
|
| 2751 |
$content[] = '<div id="ays-survey-halloween-banner-2025-countdown" class="ays-survey-halloween-banner-2025-countdown" ' . $style_attr . '>'; |
| 2752 |
$content[] = '<div class="ays-survey-halloween-banner-2025-countdown-timer">'; |
| 2753 |
$content[] = '<div class="ays-survey-halloween-banner-2025-countdown-item">'; |
| 2754 |
$content[] = '<div class="ays-survey-halloween-banner-2025-countdown-value" id="ays-survey-halloween-banner-2025-days">00</div>'; |
| 2755 |
$content[] = '<div class="ays-survey-halloween-banner-2025-countdown-label">' . __('days', 'survey-maker') . '</div>'; |
| 2756 |
$content[] = '</div>'; |
| 2757 |
$content[] = '<div class="ays-survey-halloween-banner-2025-countdown-separator">:</div>'; |
| 2758 |
$content[] = '<div class="ays-survey-halloween-banner-2025-countdown-item">'; |
| 2759 |
$content[] = '<div class="ays-survey-halloween-banner-2025-countdown-value" id="ays-survey-halloween-banner-2025-hours">00</div>'; |
| 2760 |
$content[] = '<div class="ays-survey-halloween-banner-2025-countdown-label">' . __('hours', 'survey-maker') . '</div>'; |
| 2761 |
$content[] = '</div>'; |
| 2762 |
$content[] = '<div class="ays-survey-halloween-banner-2025-countdown-separator">:</div>'; |
| 2763 |
$content[] = '<div class="ays-survey-halloween-banner-2025-countdown-item">'; |
| 2764 |
$content[] = '<div class="ays-survey-halloween-banner-2025-countdown-value" id="ays-survey-halloween-banner-2025-minutes">00</div>'; |
| 2765 |
$content[] = '<div class="ays-survey-halloween-banner-2025-countdown-label">' . __('minutes', 'survey-maker') . '</div>'; |
| 2766 |
$content[] = '</div>'; |
| 2767 |
$content[] = '<div class="ays-survey-halloween-banner-2025-countdown-separator">:</div>'; |
| 2768 |
$content[] = '<div class="ays-survey-halloween-banner-2025-countdown-item">'; |
| 2769 |
$content[] = '<div class="ays-survey-halloween-banner-2025-countdown-value" id="ays-survey-halloween-banner-2025-seconds">00</div>'; |
| 2770 |
$content[] = '<div class="ays-survey-halloween-banner-2025-countdown-label">' . __('seconds', 'survey-maker') . '</div>'; |
| 2771 |
$content[] = '</div>'; |
| 2772 |
$content[] = '</div>'; |
| 2773 |
$content[] = '</div>'; |
| 2774 |
|
| 2775 |
$content[] = '</div> |
| 2776 |
|
| 2777 |
<div class="ays-survey-halloween-banner-2025-right"> |
| 2778 |
<div class="ays-survey-halloween-banner-2025-pumpkin"> |
| 2779 |
<svg width="36" height="36" viewBox="0 0 36 36" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 2780 |
<g clip-path="url(#clip0_177_40)"> |
| 2781 |
<path d="M32.664 8.519C29.364 5.134 23.42 4.75 18 4.75C12.58 4.75 6.636 5.134 3.336 8.519C0.582 11.344 0 15.751 0 19.791C0 25.054 1.982 31.102 6.357 34.035C9.364 36.051 13.95 35.871 18 35.871C22.05 35.871 26.636 36.051 29.643 34.035C34.018 31.101 36 25.054 36 19.791C36 15.751 35.418 11.344 32.664 8.519Z" fill="#F4900C"/> |
| 2782 |
<path d="M20.783 5.44401C20.852 5.86401 20.561 6.20801 20.136 6.20801H15.685C15.259 6.20801 14.968 5.86401 15.038 5.44401L15.783 0.972008C15.853 0.551008 16.259 0.208008 16.685 0.208008H19.136C19.562 0.208008 19.968 0.552008 20.037 0.972008L20.783 5.44401Z" fill="#3F7123"/> |
| 2783 |
<path d="M20.6541 21.159L19.0561 18.563C18.7651 18.021 18.3831 17.75 17.9991 17.746C17.6161 17.75 17.2331 18.021 16.9421 18.563L15.3441 21.159C14.7571 22.252 16.2171 22.875 17.9981 22.875C19.7791 22.875 21.2411 22.251 20.6541 21.159ZM30.1621 24.351C30.1171 24.276 30.0361 24.23 29.9481 24.23H29.1071C29.0391 24.23 28.9731 24.258 28.9261 24.307L26.6951 26.641L23.9971 24.472C23.9461 24.431 23.8801 24.414 23.8121 24.419C23.7461 24.426 23.6851 24.46 23.6441 24.513L21.2361 27.575L18.1821 24.309C18.1691 24.295 18.1491 24.292 18.1341 24.281C18.1191 24.271 18.1091 24.254 18.0911 24.247C18.0851 24.245 18.0781 24.247 18.0721 24.245C18.0481 24.238 18.0251 24.24 18.0001 24.24C17.9751 24.24 17.9521 24.238 17.9281 24.246C17.9221 24.248 17.9151 24.245 17.9081 24.248C17.8901 24.255 17.8811 24.272 17.8651 24.282C17.8491 24.292 17.8301 24.295 17.8171 24.309L14.7641 27.575L12.3551 24.513C12.3141 24.46 12.2531 24.426 12.1871 24.419C12.1211 24.413 12.0541 24.431 12.0021 24.472L9.30411 26.641L7.07411 24.307C7.02711 24.258 6.96211 24.23 6.89311 24.23H6.05211C5.96511 24.23 5.88311 24.276 5.83811 24.351C5.79311 24.426 5.79011 24.519 5.83111 24.596L8.58511 29.815C8.61911 29.879 8.6781 29.925 8.7491 29.942C8.8201 29.959 8.8941 29.944 8.9521 29.902L10.9861 28.444L13.9901 32.077C14.0331 32.13 14.0961 32.162 14.1641 32.167L14.1831 32.168C14.2451 32.168 14.3041 32.146 14.3501 32.105L18.0001 28.836L21.6501 32.104C21.6961 32.145 21.7551 32.167 21.8171 32.167L21.8361 32.166C21.9041 32.161 21.9671 32.129 22.0101 32.076L25.0151 28.443L27.0491 29.901C27.1091 29.944 27.1821 29.961 27.2521 29.941C27.3221 29.924 27.3821 29.879 27.4151 29.815L30.1701 24.596C30.2101 24.519 30.2081 24.426 30.1621 24.351ZM27.9761 15.421C28.1051 17.548 27.1921 19.227 24.7711 19.374C22.3511 19.52 21.2421 17.963 21.1131 15.837C20.9841 13.711 22.3451 10.717 24.2401 10.603C26.1361 10.487 27.8481 13.294 27.9761 15.421ZM8.02411 15.421C7.89511 17.548 8.80811 19.227 11.2291 19.374C13.6491 19.52 14.7581 17.963 14.8871 15.837C15.0161 13.711 13.6551 10.717 11.7601 10.603C9.86511 10.489 8.15211 13.294 8.02411 15.421Z" fill="#642116"/> |
| 2784 |
</g> |
| 2785 |
<defs> |
| 2786 |
<clipPath id="clip0_177_40"> |
| 2787 |
<rect width="36" height="36" fill="white"/> |
| 2788 |
</clipPath> |
| 2789 |
</defs> |
| 2790 |
</svg> |
| 2791 |
</div> |
| 2792 |
|
| 2793 |
|
| 2794 |
|
| 2795 |
<div class="ays-survey-halloween-banner-2025-discount-section"> |
| 2796 |
<div class="ays-survey-halloween-banner-2025-discount">50% OFF</div> |
| 2797 |
<div class="ays-survey-halloween-banner-2025-coupon-wrapper"> |
| 2798 |
<div class="ays-survey-halloween-banner-2025-coupon-box" onclick="aysSurveyHalloweenCopyToClipboard(\'HALLOWEEN25\')" title="Click to copy"> |
| 2799 |
<span class="ays-survey-halloween-banner-2025-coupon-text">HALLOWEEN25</span> |
| 2800 |
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="ays-survey-halloween-banner-2025-copy-icon"> |
| 2801 |
<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"/> |
| 2802 |
</svg> |
| 2803 |
</div> |
| 2804 |
</div> |
| 2805 |
<a href="'. $ays_survey_cta_button_link .'" class="ays-survey-halloween-banner-2025-upgrade" target="_blank">Buy Now</a> |
| 2806 |
</div>'; |
| 2807 |
|
| 2808 |
if( current_user_can( 'manage_options' ) ){ |
| 2809 |
$content[] = '<div id="ays-survey-dismiss-buttons-content">'; |
| 2810 |
$content[] = '<form action="" method="POST" style="position: absolute; bottom: -5px; right: 0; color: #fff;">'; |
| 2811 |
$content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="color: darkgrey; font-size: 11px;">'. __( "Dismiss ad", 'survey-maker' ) .'</button>'; |
| 2812 |
$content[] = wp_nonce_field( SURVEY_MAKER_NAME . '-sale-banner' , SURVEY_MAKER_NAME . '-sale-banner' ); |
| 2813 |
$content[] = '</form>'; |
| 2814 |
$content[] = '</div>'; |
| 2815 |
} |
| 2816 |
|
| 2817 |
$content[] = ' |
| 2818 |
</div> |
| 2819 |
</div> |
| 2820 |
</div>'; |
| 2821 |
|
| 2822 |
$content[] = '<style id="ays-survey-progress-banner-styles-inline-css">'; |
| 2823 |
$content[] = ' |
| 2824 |
.ays-survey-halloween-banner-2025-main { |
| 2825 |
background: linear-gradient(135deg, #1A0F2E 100%, #2D1B4E 0%); |
| 2826 |
background-image: url("' . esc_attr( SURVEY_MAKER_ADMIN_URL ) . '/images/halloween-banner-background-image-remove.png"), linear-gradient(135deg, #2D1B4E 0%, #1A0F2E 100%); |
| 2827 |
background-position: left center, center; |
| 2828 |
background-repeat: no-repeat, no-repeat; |
| 2829 |
background-size: auto 100%, cover; |
| 2830 |
padding: 20px 30px 20px 130px; |
| 2831 |
border-radius: 12px; |
| 2832 |
color: white; |
| 2833 |
margin: 20px 0; |
| 2834 |
border: 0; |
| 2835 |
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.4); |
| 2836 |
overflow: hidden; |
| 2837 |
} |
| 2838 |
|
| 2839 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-content { |
| 2840 |
display: flex; |
| 2841 |
align-items: center; |
| 2842 |
justify-content: space-between; |
| 2843 |
gap: 30px; |
| 2844 |
} |
| 2845 |
|
| 2846 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-left { |
| 2847 |
display: flex; |
| 2848 |
align-items: center; |
| 2849 |
gap: 20px; |
| 2850 |
} |
| 2851 |
|
| 2852 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-center { |
| 2853 |
display: flex; |
| 2854 |
align-items: center; |
| 2855 |
justify-content: center; |
| 2856 |
flex: 1; |
| 2857 |
max-width: 350px; |
| 2858 |
} |
| 2859 |
|
| 2860 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-right { |
| 2861 |
display: flex; |
| 2862 |
align-items: center; |
| 2863 |
gap: 15px; |
| 2864 |
flex-shrink: 0; |
| 2865 |
} |
| 2866 |
|
| 2867 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-icon { |
| 2868 |
flex-shrink: 0; |
| 2869 |
} |
| 2870 |
|
| 2871 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-pumpkin svg { |
| 2872 |
display: inline !important; |
| 2873 |
border: none !important; |
| 2874 |
box-shadow: none !important; |
| 2875 |
height: 1em !important; |
| 2876 |
width: 1em !important; |
| 2877 |
margin: 0 0.07em !important; |
| 2878 |
vertical-align: -0.1em !important; |
| 2879 |
background: none !important; |
| 2880 |
padding: 0 !important; |
| 2881 |
} |
| 2882 |
|
| 2883 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-orb { |
| 2884 |
width: 80px; |
| 2885 |
height: 80px; |
| 2886 |
background: linear-gradient(135deg, #8B5CF6 0%, #6D28D9 100%); |
| 2887 |
border-radius: 50%; |
| 2888 |
display: flex; |
| 2889 |
align-items: center; |
| 2890 |
justify-content: center; |
| 2891 |
box-shadow: 0 0 30px rgba(139, 92, 246, 0.6); |
| 2892 |
border: 3px solid rgba(168, 85, 247, 0.4); |
| 2893 |
} |
| 2894 |
|
| 2895 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-question { |
| 2896 |
font-size: 48px; |
| 2897 |
font-weight: 700; |
| 2898 |
color: #E9D5FF; |
| 2899 |
} |
| 2900 |
|
| 2901 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-bat { |
| 2902 |
font-size: 20px; |
| 2903 |
opacity: 0.8; |
| 2904 |
} |
| 2905 |
|
| 2906 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-bat-1 { |
| 2907 |
margin-left: -100px; |
| 2908 |
margin-top: -40px; |
| 2909 |
} |
| 2910 |
|
| 2911 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-bat-2 { |
| 2912 |
margin-left: -110px; |
| 2913 |
margin-top: 35px; |
| 2914 |
} |
| 2915 |
|
| 2916 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-sparkle { |
| 2917 |
font-size: 12px; |
| 2918 |
opacity: 0.7; |
| 2919 |
} |
| 2920 |
|
| 2921 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-sparkle-1 { |
| 2922 |
margin-left: -95px; |
| 2923 |
margin-top: -60px; |
| 2924 |
} |
| 2925 |
|
| 2926 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-sparkle-2 { |
| 2927 |
margin-left: -70px; |
| 2928 |
margin-top: -15px; |
| 2929 |
} |
| 2930 |
|
| 2931 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-sparkle-3 { |
| 2932 |
margin-left: -120px; |
| 2933 |
margin-top: 10px; |
| 2934 |
} |
| 2935 |
|
| 2936 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-text { |
| 2937 |
flex: 1; |
| 2938 |
} |
| 2939 |
|
| 2940 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-title { |
| 2941 |
font-size: 24px; |
| 2942 |
font-weight: 700; |
| 2943 |
margin: 0 0 8px 0; |
| 2944 |
line-height: 1.2; |
| 2945 |
color: #fff; |
| 2946 |
text-transform: uppercase; |
| 2947 |
letter-spacing: 1px; |
| 2948 |
} |
| 2949 |
|
| 2950 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-title a { |
| 2951 |
color: #FB923C; |
| 2952 |
text-decoration: underline; |
| 2953 |
} |
| 2954 |
|
| 2955 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-subtitle { |
| 2956 |
font-size: 16px; |
| 2957 |
margin: 0; |
| 2958 |
opacity: 0.9; |
| 2959 |
font-weight: 400; |
| 2960 |
color: #E9D5FF; |
| 2961 |
} |
| 2962 |
|
| 2963 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-description { |
| 2964 |
font-size: 14px; |
| 2965 |
margin: 0; |
| 2966 |
opacity: 0.85; |
| 2967 |
line-height: 1.5; |
| 2968 |
color: #D8B4FE; |
| 2969 |
} |
| 2970 |
|
| 2971 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-pumpkin { |
| 2972 |
font-size: 64px; |
| 2973 |
filter: drop-shadow(0 0 20px rgba(251, 146, 60, 0.8)); |
| 2974 |
flex-shrink: 0; |
| 2975 |
} |
| 2976 |
|
| 2977 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-discount-section { |
| 2978 |
display: flex; |
| 2979 |
flex-direction: column; |
| 2980 |
align-items: center; |
| 2981 |
gap: 10px; |
| 2982 |
} |
| 2983 |
|
| 2984 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-discount { |
| 2985 |
font-size: 36px; |
| 2986 |
font-weight: 700; |
| 2987 |
color: #FB923C; |
| 2988 |
text-shadow: 0 0 20px rgba(251, 146, 60, 0.6); |
| 2989 |
margin: 0; |
| 2990 |
line-height: 1; |
| 2991 |
} |
| 2992 |
|
| 2993 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-coupon-wrapper { |
| 2994 |
display:none; |
| 2995 |
margin-bottom: 5px; |
| 2996 |
} |
| 2997 |
|
| 2998 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-coupon-box { |
| 2999 |
border: 2px dashed rgba(255, 255, 255, 0.4); |
| 3000 |
padding: 6px 12px; |
| 3001 |
border-radius: 6px; |
| 3002 |
background: rgba(255, 255, 255, 0.1); |
| 3003 |
cursor: pointer; |
| 3004 |
transition: all 0.3s ease; |
| 3005 |
display: flex; |
| 3006 |
align-items: center; |
| 3007 |
gap: 6px; |
| 3008 |
backdrop-filter: blur(10px); |
| 3009 |
} |
| 3010 |
|
| 3011 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-coupon-box:hover { |
| 3012 |
background: rgba(255, 255, 255, 0.2); |
| 3013 |
border-color: rgba(255, 255, 255, 0.6); |
| 3014 |
transform: translateY(-1px); |
| 3015 |
} |
| 3016 |
|
| 3017 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-coupon-text { |
| 3018 |
font-size: 14px; |
| 3019 |
font-weight: 700; |
| 3020 |
letter-spacing: 1px; |
| 3021 |
color: #fff; |
| 3022 |
font-family: monospace; |
| 3023 |
} |
| 3024 |
|
| 3025 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-copy-icon { |
| 3026 |
opacity: 0.8; |
| 3027 |
transition: opacity 0.3s ease; |
| 3028 |
} |
| 3029 |
|
| 3030 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-coupon-box:hover .ays-survey-halloween-banner-2025-copy-icon { |
| 3031 |
opacity: 1; |
| 3032 |
} |
| 3033 |
|
| 3034 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-upgrade { |
| 3035 |
background: linear-gradient(135deg, #FB923C 0%, #F97316 100%); |
| 3036 |
color: white; |
| 3037 |
border: none; |
| 3038 |
padding: 12px 28px; |
| 3039 |
border-radius: 8px; |
| 3040 |
font-size: 16px; |
| 3041 |
font-weight: 600; |
| 3042 |
cursor: pointer; |
| 3043 |
transition: all 0.3s ease; |
| 3044 |
box-shadow: 0 4px 16px rgba(251, 146, 60, 0.5); |
| 3045 |
text-decoration: none; |
| 3046 |
display: inline-flex; |
| 3047 |
align-items: center; |
| 3048 |
text-align: center; |
| 3049 |
} |
| 3050 |
|
| 3051 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-upgrade:hover { |
| 3052 |
transform: translateY(-2px); |
| 3053 |
box-shadow: 0 6px 20px rgba(251, 146, 60, 0.7); |
| 3054 |
text-decoration: none; |
| 3055 |
color: white; |
| 3056 |
} |
| 3057 |
|
| 3058 |
.ays-survey-halloween-banner-2025-main .notice-dismiss:before { |
| 3059 |
color: #fff; |
| 3060 |
} |
| 3061 |
|
| 3062 |
.ays-survey-halloween-banner-2025-copy-notification { |
| 3063 |
position: fixed; |
| 3064 |
top: 50%; |
| 3065 |
left: 50%; |
| 3066 |
transform: translate(-50%, -50%); |
| 3067 |
background: rgba(0, 0, 0, 0.8); |
| 3068 |
color: white; |
| 3069 |
padding: 12px 24px; |
| 3070 |
border-radius: 8px; |
| 3071 |
font-size: 14px; |
| 3072 |
z-index: 10000; |
| 3073 |
opacity: 0; |
| 3074 |
transition: opacity 0.3s ease; |
| 3075 |
} |
| 3076 |
|
| 3077 |
.ays-survey-halloween-banner-2025-copy-notification.show { |
| 3078 |
opacity: 1; |
| 3079 |
} |
| 3080 |
|
| 3081 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-countdown-timer { |
| 3082 |
display: flex; |
| 3083 |
align-items: center; |
| 3084 |
justify-content: center; |
| 3085 |
gap: 8px; |
| 3086 |
} |
| 3087 |
|
| 3088 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-countdown-item { |
| 3089 |
background: rgba(255, 255, 255, 0.15); |
| 3090 |
border-radius: 8px; |
| 3091 |
padding: 8px 12px; |
| 3092 |
min-width: 60px; |
| 3093 |
backdrop-filter: blur(10px); |
| 3094 |
} |
| 3095 |
|
| 3096 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-countdown-value { |
| 3097 |
font-size: 24px; |
| 3098 |
font-weight: 700; |
| 3099 |
line-height: 1; |
| 3100 |
margin-bottom: 4px; |
| 3101 |
color: #fff; |
| 3102 |
text-align: center; |
| 3103 |
} |
| 3104 |
|
| 3105 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-countdown-label { |
| 3106 |
font-size: 11px; |
| 3107 |
opacity: 0.8; |
| 3108 |
text-transform: lowercase; |
| 3109 |
text-align: center; |
| 3110 |
} |
| 3111 |
|
| 3112 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-countdown-separator { |
| 3113 |
font-size: 24px; |
| 3114 |
font-weight: 700; |
| 3115 |
opacity: 0.6; |
| 3116 |
margin: 0 4px; |
| 3117 |
} |
| 3118 |
|
| 3119 |
@media (min-width: 1200px) { |
| 3120 |
.ays-survey-halloween-banner-2025-main .wp-core-ui .notice.is-dismissible { |
| 3121 |
padding-right: 60px; |
| 3122 |
} |
| 3123 |
} |
| 3124 |
|
| 3125 |
@media (max-width: 1200px) { |
| 3126 |
|
| 3127 |
div.ays-survey-halloween-banner-2025-main { |
| 3128 |
padding: 20px 30px; |
| 3129 |
} |
| 3130 |
|
| 3131 |
div.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-pumpkin { |
| 3132 |
display: none; |
| 3133 |
} |
| 3134 |
|
| 3135 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-subtitle, |
| 3136 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-title { |
| 3137 |
text-align: center; |
| 3138 |
} |
| 3139 |
|
| 3140 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-content { |
| 3141 |
flex-wrap: wrap; |
| 3142 |
gap: 20px; |
| 3143 |
} |
| 3144 |
|
| 3145 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-left { |
| 3146 |
width: 100%; |
| 3147 |
} |
| 3148 |
|
| 3149 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-center { |
| 3150 |
width: 100%; |
| 3151 |
max-width: 100%; |
| 3152 |
text-align: center; |
| 3153 |
} |
| 3154 |
|
| 3155 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-right { |
| 3156 |
width: 100%; |
| 3157 |
justify-content: center; |
| 3158 |
} |
| 3159 |
} |
| 3160 |
|
| 3161 |
@media (max-width: 786px) { |
| 3162 |
#ays-survey-halloween-banner-2025-main { |
| 3163 |
display: none !important; |
| 3164 |
} |
| 3165 |
} |
| 3166 |
|
| 3167 |
@media (max-width: 768px) { |
| 3168 |
.ays-survey-halloween-banner-2025-main { |
| 3169 |
padding: 15px 20px; |
| 3170 |
margin: 15px 0; |
| 3171 |
} |
| 3172 |
|
| 3173 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-title { |
| 3174 |
font-size: 20px; |
| 3175 |
} |
| 3176 |
|
| 3177 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-subtitle { |
| 3178 |
font-size: 14px; |
| 3179 |
} |
| 3180 |
|
| 3181 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-description { |
| 3182 |
font-size: 13px; |
| 3183 |
} |
| 3184 |
|
| 3185 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-pumpkin { |
| 3186 |
font-size: 48px; |
| 3187 |
} |
| 3188 |
|
| 3189 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-discount { |
| 3190 |
font-size: 28px; |
| 3191 |
} |
| 3192 |
|
| 3193 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-upgrade { |
| 3194 |
padding: 10px 20px; |
| 3195 |
font-size: 14px; |
| 3196 |
} |
| 3197 |
} |
| 3198 |
|
| 3199 |
@media (max-width: 480px) { |
| 3200 |
.ays-survey-halloween-banner-2025-main { |
| 3201 |
padding: 12px 15px; |
| 3202 |
} |
| 3203 |
|
| 3204 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-orb { |
| 3205 |
width: 60px; |
| 3206 |
height: 60px; |
| 3207 |
} |
| 3208 |
|
| 3209 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-question { |
| 3210 |
font-size: 36px; |
| 3211 |
} |
| 3212 |
|
| 3213 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-title { |
| 3214 |
font-size: 18px; |
| 3215 |
} |
| 3216 |
|
| 3217 |
.ays-survey-halloween-banner-2025-main .ays-survey-halloween-banner-2025-coupon-text { |
| 3218 |
font-size: 12px; |
| 3219 |
} |
| 3220 |
} |
| 3221 |
'; |
| 3222 |
|
| 3223 |
$content[] = '</style>'; |
| 3224 |
|
| 3225 |
$content[] = '<script>'; |
| 3226 |
$content[] = " |
| 3227 |
function aysSurveyHalloweenCopyToClipboard(text) { |
| 3228 |
// Create a temporary textarea element |
| 3229 |
var textarea = document.createElement('textarea'); |
| 3230 |
textarea.value = text; |
| 3231 |
textarea.style.position = 'fixed'; |
| 3232 |
textarea.style.opacity = '0'; |
| 3233 |
document.body.appendChild(textarea); |
| 3234 |
|
| 3235 |
// Select and copy the text |
| 3236 |
textarea.select(); |
| 3237 |
textarea.setSelectionRange(0, 99999); // For mobile devices |
| 3238 |
|
| 3239 |
try { |
| 3240 |
document.execCommand('copy'); |
| 3241 |
aysSurveyHalloweenShowCopyNotification('Coupon code copied!'); |
| 3242 |
} catch (err) { |
| 3243 |
console.error('Failed to copy text: ', err); |
| 3244 |
} |
| 3245 |
|
| 3246 |
// Remove the temporary textarea |
| 3247 |
document.body.removeChild(textarea); |
| 3248 |
} |
| 3249 |
|
| 3250 |
function aysSurveyHalloweenShowCopyNotification(message) { |
| 3251 |
// Check if notification already exists |
| 3252 |
var existingNotification = document.querySelector('.ays-survey-halloween-banner-2025-copy-notification'); |
| 3253 |
if (existingNotification) { |
| 3254 |
document.body.removeChild(existingNotification); |
| 3255 |
} |
| 3256 |
|
| 3257 |
// Create notification element |
| 3258 |
var notification = document.createElement('div'); |
| 3259 |
notification.className = 'ays-survey-halloween-banner-2025-copy-notification'; |
| 3260 |
notification.textContent = message; |
| 3261 |
document.body.appendChild(notification); |
| 3262 |
|
| 3263 |
// Show notification with animation |
| 3264 |
setTimeout(function() { |
| 3265 |
notification.classList.add('show'); |
| 3266 |
}, 10); |
| 3267 |
|
| 3268 |
// Hide and remove notification after 2 seconds |
| 3269 |
setTimeout(function() { |
| 3270 |
notification.classList.remove('show'); |
| 3271 |
setTimeout(function() { |
| 3272 |
if (notification.parentNode) { |
| 3273 |
document.body.removeChild(notification); |
| 3274 |
} |
| 3275 |
}, 300); |
| 3276 |
}, 2000); |
| 3277 |
} |
| 3278 |
|
| 3279 |
(function() { |
| 3280 |
var endDate = new Date('". date('Y-m-d H:i:s', $end_date) ."').getTime(); |
| 3281 |
|
| 3282 |
function updateCountdown() { |
| 3283 |
var now = new Date().getTime(); |
| 3284 |
var distance = endDate - now; |
| 3285 |
|
| 3286 |
if (distance < 0) { |
| 3287 |
clearInterval(updateCountdown); |
| 3288 |
document.getElementById('ays-survey-halloween-banner-2025-progress-banner-countdown').style.display = 'none'; |
| 3289 |
return; |
| 3290 |
} |
| 3291 |
|
| 3292 |
var days = Math.floor(distance / (1000 * 60 * 60 * 24)); |
| 3293 |
var hours = Math.floor((distance % (1000 * 60 * 60 * 24)) / (1000 * 60 * 60)); |
| 3294 |
var minutes = Math.floor((distance % (1000 * 60 * 60)) / (1000 * 60)); |
| 3295 |
var seconds = Math.floor((distance % (1000 * 60)) / 1000); |
| 3296 |
|
| 3297 |
function padZero(num) { |
| 3298 |
return num < 10 ? '0' + num : num; |
| 3299 |
} |
| 3300 |
|
| 3301 |
document.getElementById('ays-survey-halloween-banner-2025-days').textContent = padZero(days); |
| 3302 |
document.getElementById('ays-survey-halloween-banner-2025-hours').textContent = padZero(hours); |
| 3303 |
document.getElementById('ays-survey-halloween-banner-2025-minutes').textContent = padZero(minutes); |
| 3304 |
document.getElementById('ays-survey-halloween-banner-2025-seconds').textContent = padZero(seconds); |
| 3305 |
} |
| 3306 |
|
| 3307 |
updateCountdown(); |
| 3308 |
setInterval(updateCountdown, 1000); |
| 3309 |
})()"; |
| 3310 |
$content[] = '</script>'; |
| 3311 |
|
| 3312 |
$content = implode( '', $content ); |
| 3313 |
echo ($content); |
| 3314 |
} |
| 3315 |
} |
| 3316 |
|
| 3317 |
// Fox LMS Pro Banner |
| 3318 |
public function ays_survey_discounted_licenses_banner_message($ishmar){ |
| 3319 |
if($ishmar == 0 ){ |
| 3320 |
$content = array(); |
| 3321 |
|
| 3322 |
$date = time() + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS); |
| 3323 |
$now_date = date('M d, Y H:i:s', $date); |
| 3324 |
|
| 3325 |
$start_date = strtotime('2025-09-21'); |
| 3326 |
$end_date = strtotime('2025-10-21'); |
| 3327 |
$diff_end = $end_date - $date; |
| 3328 |
|
| 3329 |
$style_attr = ''; |
| 3330 |
if( $diff_end < 0 ){ |
| 3331 |
$style_attr = 'style="display:none;"'; |
| 3332 |
} |
| 3333 |
|
| 3334 |
$total_licenses = 50; |
| 3335 |
$progression_pattern = array(3, 2, 1, 4, 2, 3, 1, 2, 4, 3, 2, 1, 3, 2, 4, 1, 3, 2, 2, 3, 1, 2); |
| 3336 |
$days_passed = floor(($date - $start_date) / (24 * 60 * 60)); |
| 3337 |
$used_licenses = 0; |
| 3338 |
|
| 3339 |
for ($i = 0; $i < min($days_passed, count($progression_pattern)); $i++) { |
| 3340 |
$used_licenses += $progression_pattern[$i]; |
| 3341 |
} |
| 3342 |
$used_licenses = min($used_licenses, $total_licenses); |
| 3343 |
$remaining_licenses = $total_licenses - $used_licenses; |
| 3344 |
$progress_percentage = ($used_licenses / $total_licenses) * 100; |
| 3345 |
|
| 3346 |
$ays_survey_cta_button_link = esc_url('https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=survey-maker-license-banner-' . SURVEY_MAKER_VERSION); |
| 3347 |
|
| 3348 |
$content[] = '<div id="ays-survey-progress-banner-main" class="ays-survey-progress-banner-main ays_survey_dicount_info ays-survey-admin-notice notice notice-success is-dismissible" ' . $style_attr . '>'; |
| 3349 |
$content[] = '<div class="ays-survey-progress-banner-content">'; |
| 3350 |
$content[] = '<div class="ays-survey-progress-banner-left">'; |
| 3351 |
$content[] = '<div class="ays-survey-progress-banner-icon">'; |
| 3352 |
$content[] = '<svg width="48" height="48" viewBox="0 0 48 48" fill="none" xmlns="http://www.w3.org/2000/svg"> |
| 3353 |
<path d="M1.33325 22.6668L11.9999 13.3335L33.3333 14.6668L34.6666 36.0002L25.3333 46.6668C25.3333 46.6668 25.3346 38.6682 17.3333 30.6668C9.33192 22.6655 1.33325 22.6668 1.33325 22.6668Z" fill="#A0041E"/> |
| 3354 |
<path d="M1.29739 46.6665C1.29739 46.6665 1.24939 36.0278 5.27739 31.9998C9.30539 27.9718 20.0001 28.2492 20.0001 28.2492C20.0001 28.2492 19.9987 38.6665 15.9987 42.6665C11.9987 46.6665 1.29739 46.6665 1.29739 46.6665Z" fill="#FFAC33"/> |
| 3355 |
<path d="M11.9986 41.3332C14.9441 41.3332 17.3319 38.9454 17.3319 35.9998C17.3319 33.0543 14.9441 30.6665 11.9986 30.6665C9.0531 30.6665 6.66528 33.0543 6.66528 35.9998C6.66528 38.9454 9.0531 41.3332 11.9986 41.3332Z" fill="#FFCC4D"/> |
| 3356 |
<path d="M47.9986 0C47.9986 0 34.6653 0 18.6653 13.3333C10.6653 20 10.6653 32 13.3319 34.6667C15.9986 37.3333 27.9986 37.3333 34.6653 29.3333C47.9986 13.3333 47.9986 0 47.9986 0Z" fill="#55ACEE"/> |
| 3357 |
<path d="M35.9987 6.6665C33.8347 6.6665 31.9814 7.96117 31.144 9.81317C31.8134 9.5105 32.5507 9.33317 33.332 9.33317C36.2774 9.33317 38.6654 11.7212 38.6654 14.6665C38.6654 15.4478 38.488 16.1852 38.1867 16.8532C40.0387 16.0172 41.332 14.1638 41.332 11.9998C41.332 9.0545 38.944 6.6665 35.9987 6.6665Z" fill="black"/> |
| 3358 |
<path d="M10.6667 37.3332C10.6667 37.3332 10.6667 31.9998 12.0001 30.6665C13.3334 29.3332 29.3347 16.0012 30.6667 17.3332C31.9987 18.6652 18.6654 34.6665 17.3321 35.9998C15.9987 37.3332 10.6667 37.3332 10.6667 37.3332Z" fill="#A0041E"/> |
| 3359 |
</svg>'; |
| 3360 |
$content[] = '</div>'; |
| 3361 |
$content[] = '<div class="ays-survey-progress-banner-text">'; |
| 3362 |
$content[] = '<h2 class="ays-survey-progress-banner-title">' . sprintf( __('Get the Pro Version of %s Survey Maker%s – 20%% OFF', 'survey-maker'), '<a href="'. $ays_survey_cta_button_link .'" target="_blank">', '</a>' ) . '</h2>'; |
| 3363 |
$content[] = '<p class="ays-survey-progress-banner-subtitle">' . __('Unlock advanced features + 30 day Money Back Guarantee', 'survey-maker') . '</p>'; |
| 3364 |
$content[] = '</div>'; |
| 3365 |
$content[] = '</div>'; |
| 3366 |
|
| 3367 |
$content[] = '<div class="ays-survey-progress-banner-center">'; |
| 3368 |
$content[] = '<div class="ays-survey-progress-banner-coupon">'; |
| 3369 |
$content[] = '<div class="ays-survey-progress-banner-coupon-box" onclick="surveyCopyToClipboard(\'FREE2PRO20\')" title="' . __('Click to copy', 'survey-maker') . '">'; |
| 3370 |
$content[] = '<span class="ays-survey-progress-banner-coupon-text">FREE2PRO20</span>'; |
| 3371 |
$content[] = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg" class="ays-survey-progress-banner-copy-icon">'; |
| 3372 |
$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"/>'; |
| 3373 |
$content[] = '</svg>'; |
| 3374 |
$content[] = '</div>'; |
| 3375 |
$content[] = '</div>'; |
| 3376 |
|
| 3377 |
$content[] = '<div class="ays-survey-progress-banner-progress">'; |
| 3378 |
$content[] = '<p class="ays-survey-progress-banner-progress-text">' . __('Only', 'survey-maker') . ' <span id="remaining-licenses">' . $remaining_licenses . '</span> ' . __('of 50 discounted licenses left', 'survey-maker') . '</p>'; |
| 3379 |
$content[] = '<div class="ays-survey-progress-banner-progress-bar">'; |
| 3380 |
$content[] = '<div class="ays-survey-progress-banner-progress-fill" id="progress-fill" style="width: ' . $progress_percentage . '%;"></div>'; |
| 3381 |
$content[] = '</div>'; |
| 3382 |
$content[] = '</div>'; |
| 3383 |
$content[] = '</div>'; |
| 3384 |
|
| 3385 |
$content[] = '<div class="ays-survey-progress-banner-right">'; |
| 3386 |
$content[] = '<a href="'. $ays_survey_cta_button_link .'" class="ays-survey-progress-banner-upgrade" target="_blank">'; |
| 3387 |
$content[] = '<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">'; |
| 3388 |
$content[] = '<path d="M14.6392 6.956C14.5743 6.78222 14.4081 6.66667 14.2223 6.66667H8.85565L11.9512 0.648C12.0485 0.458667 11.9983 0.227111 11.8308 0.0955556C11.7499 0.0315556 11.6525 0 11.5556 0C11.4521 0 11.3485 0.0364444 11.2654 0.108L8.00009 2.928L1.48765 8.55244C1.3472 8.67378 1.29653 8.86978 1.36142 9.04356C1.42631 9.21733 1.59209 9.33333 1.77787 9.33333H7.14454L4.04898 15.352C3.95165 15.5413 4.00187 15.7729 4.16942 15.9044C4.25031 15.9684 4.34765 16 4.44453 16C4.54809 16 4.65165 15.9636 4.73476 15.892L8.00009 13.072L14.5125 7.44756C14.6534 7.32622 14.7036 7.13022 14.6392 6.956Z" fill="white"/>'; |
| 3389 |
$content[] = '</svg>'; |
| 3390 |
$content[] = ' ' . __('Upgrade Now', 'survey-maker'); |
| 3391 |
$content[] = '</a>'; |
| 3392 |
$content[] = '</div>'; |
| 3393 |
$content[] = '</div>'; |
| 3394 |
|
| 3395 |
if( current_user_can( 'manage_options' ) ){ |
| 3396 |
$content[] = '<div id="ays-survey-dismiss-buttons-content">'; |
| 3397 |
$content[] = '<form action="" method="POST" style="position: absolute; bottom: 0; right: 0; color: #fff;">'; |
| 3398 |
$content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="color: darkgrey; font-size: 11px;">'. __( "Dismiss ad", 'survey-maker' ) .'</button>'; |
| 3399 |
$content[] = wp_nonce_field( SURVEY_MAKER_NAME . '-sale-banner' , SURVEY_MAKER_NAME . '-sale-banner' ); |
| 3400 |
$content[] = '</form>'; |
| 3401 |
$content[] = '</div>'; |
| 3402 |
} |
| 3403 |
$content[] = '</div>'; |
| 3404 |
|
| 3405 |
// Fox LMS Pro Banner Styles |
| 3406 |
$content[] = '<style id="ays-survey-progress-banner-styles-inline-css">'; |
| 3407 |
$content[] = ' |
| 3408 |
.ays-survey-progress-banner-main { |
| 3409 |
background: linear-gradient(135deg, #6344ED 0%, #8C2ABE 100%); |
| 3410 |
padding: 20px 30px; |
| 3411 |
border-radius: 16px; |
| 3412 |
color: white; |
| 3413 |
position: relative; |
| 3414 |
margin: 20px 0; |
| 3415 |
box-shadow: 0 8px 32px rgba(99, 68, 237, 0.3); |
| 3416 |
border: 0; |
| 3417 |
} |
| 3418 |
|
| 3419 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-content { |
| 3420 |
display: flex; |
| 3421 |
align-items: center; |
| 3422 |
justify-content: space-between; |
| 3423 |
gap: 30px; |
| 3424 |
} |
| 3425 |
|
| 3426 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-left { |
| 3427 |
display: flex; |
| 3428 |
align-items: center; |
| 3429 |
gap: 20px; |
| 3430 |
flex: 1; |
| 3431 |
} |
| 3432 |
|
| 3433 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-center { |
| 3434 |
display: flex; |
| 3435 |
align-items: center; |
| 3436 |
gap: 15px; |
| 3437 |
flex: 1; |
| 3438 |
} |
| 3439 |
|
| 3440 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-right { |
| 3441 |
display: flex; |
| 3442 |
align-items: center; |
| 3443 |
gap: 20px; |
| 3444 |
flex-shrink: 0; |
| 3445 |
} |
| 3446 |
|
| 3447 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-icon { |
| 3448 |
font-size: 32px; |
| 3449 |
filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.2)); |
| 3450 |
} |
| 3451 |
|
| 3452 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-title { |
| 3453 |
font-size: 21px; |
| 3454 |
font-weight: 700; |
| 3455 |
margin: 0 0 8px 0; |
| 3456 |
line-height: 1.2; |
| 3457 |
color: #fff; |
| 3458 |
} |
| 3459 |
|
| 3460 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-title a { |
| 3461 |
text-decoration: underline; |
| 3462 |
color: #fff; |
| 3463 |
} |
| 3464 |
|
| 3465 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-subtitle { |
| 3466 |
font-size: 16px; |
| 3467 |
margin: 0; |
| 3468 |
opacity: 0.9; |
| 3469 |
font-weight: 400; |
| 3470 |
} |
| 3471 |
|
| 3472 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-coupon { |
| 3473 |
margin-bottom: 5px; |
| 3474 |
} |
| 3475 |
|
| 3476 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-coupon-box { |
| 3477 |
border: 2px dotted rgba(255, 255, 255, 0.6); |
| 3478 |
padding: 8px 16px; |
| 3479 |
border-radius: 8px; |
| 3480 |
background: rgba(255, 255, 255, 0.1); |
| 3481 |
cursor: pointer; |
| 3482 |
transition: all 0.3s ease; |
| 3483 |
display: flex; |
| 3484 |
align-items: center; |
| 3485 |
gap: 8px; |
| 3486 |
backdrop-filter: blur(10px); |
| 3487 |
} |
| 3488 |
|
| 3489 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-coupon-box:hover { |
| 3490 |
background: rgba(255, 255, 255, 0.2); |
| 3491 |
border-color: rgba(255, 255, 255, 0.8); |
| 3492 |
transform: translateY(-1px); |
| 3493 |
} |
| 3494 |
|
| 3495 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-coupon-text { |
| 3496 |
font-size: 16px; |
| 3497 |
font-weight: 700; |
| 3498 |
letter-spacing: 1px; |
| 3499 |
color: #fff; |
| 3500 |
font-family: monospace; |
| 3501 |
} |
| 3502 |
|
| 3503 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-copy-icon { |
| 3504 |
opacity: 0.8; |
| 3505 |
transition: opacity 0.3s ease; |
| 3506 |
} |
| 3507 |
|
| 3508 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-coupon-box:hover .ays-survey-progress-banner-copy-icon { |
| 3509 |
opacity: 1; |
| 3510 |
} |
| 3511 |
|
| 3512 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-progress { |
| 3513 |
text-align: center; |
| 3514 |
width: 100%; |
| 3515 |
} |
| 3516 |
|
| 3517 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-progress-text { |
| 3518 |
font-size: 14px; |
| 3519 |
margin: 0 0 10px 0; |
| 3520 |
opacity: 0.9; |
| 3521 |
} |
| 3522 |
|
| 3523 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-progress-bar { |
| 3524 |
width: 300px; |
| 3525 |
height: 10px; |
| 3526 |
background: rgba(255, 255, 255, 0.2); |
| 3527 |
border-radius: 4px; |
| 3528 |
overflow: hidden; |
| 3529 |
margin: 0 auto; |
| 3530 |
} |
| 3531 |
|
| 3532 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-progress-fill { |
| 3533 |
height: 100%; |
| 3534 |
background: linear-gradient(90deg, #4ADE80 0%, #22C55E 100%); |
| 3535 |
border-radius: 4px; |
| 3536 |
transition: width 0.8s ease; |
| 3537 |
width: 70%; |
| 3538 |
} |
| 3539 |
|
| 3540 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-upgrade { |
| 3541 |
background: linear-gradient(135deg, #F59E0B 0%, #F97316 100%); |
| 3542 |
color: white; |
| 3543 |
border: none; |
| 3544 |
padding: 12px 24px; |
| 3545 |
border-radius: 8px; |
| 3546 |
font-size: 16px; |
| 3547 |
font-weight: 600; |
| 3548 |
cursor: pointer; |
| 3549 |
transition: all 0.3s ease; |
| 3550 |
box-shadow: 0 4px 16px rgba(245, 158, 11, 0.4); |
| 3551 |
text-decoration: none; |
| 3552 |
display: inline-flex; |
| 3553 |
align-items: center; |
| 3554 |
gap: 8px; |
| 3555 |
} |
| 3556 |
|
| 3557 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-upgrade:hover { |
| 3558 |
transform: translateY(-2px); |
| 3559 |
box-shadow: 0 6px 20px rgba(245, 158, 11, 0.6); |
| 3560 |
text-decoration: none; |
| 3561 |
color: white; |
| 3562 |
} |
| 3563 |
|
| 3564 |
.ays-survey-progress-banner-main .notice-dismiss:before { |
| 3565 |
color: #fff; |
| 3566 |
} |
| 3567 |
|
| 3568 |
/* Copy notification */ |
| 3569 |
.ays-survey-copy-notification { |
| 3570 |
position: fixed; |
| 3571 |
top: 50%; |
| 3572 |
left: 50%; |
| 3573 |
transform: translate(-50%, -50%); |
| 3574 |
background: rgba(0, 0, 0, 0.8); |
| 3575 |
color: white; |
| 3576 |
padding: 12px 24px; |
| 3577 |
border-radius: 8px; |
| 3578 |
font-size: 14px; |
| 3579 |
z-index: 10000; |
| 3580 |
opacity: 0; |
| 3581 |
transition: opacity 0.3s ease; |
| 3582 |
} |
| 3583 |
|
| 3584 |
.ays-survey-copy-notification.show { |
| 3585 |
opacity: 1; |
| 3586 |
} |
| 3587 |
|
| 3588 |
@media (max-width: 1400px) { |
| 3589 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-center { |
| 3590 |
flex-direction: column; |
| 3591 |
} |
| 3592 |
} |
| 3593 |
|
| 3594 |
@media (max-width: 1200px) { |
| 3595 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-content { |
| 3596 |
flex-direction: column; |
| 3597 |
gap: 20px; |
| 3598 |
} |
| 3599 |
|
| 3600 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-left { |
| 3601 |
width: 100%; |
| 3602 |
justify-content: center; |
| 3603 |
text-align: center; |
| 3604 |
flex-direction: column; |
| 3605 |
} |
| 3606 |
|
| 3607 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-center { |
| 3608 |
width: 100%; |
| 3609 |
} |
| 3610 |
|
| 3611 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-right { |
| 3612 |
width: 100%; |
| 3613 |
justify-content: center; |
| 3614 |
} |
| 3615 |
} |
| 3616 |
|
| 3617 |
@media (max-width: 768px) { |
| 3618 |
#ays-survey-progress-banner-main { |
| 3619 |
display: none !important; |
| 3620 |
} |
| 3621 |
|
| 3622 |
.ays-survey-progress-banner-main { |
| 3623 |
padding: 15px 20px; |
| 3624 |
margin: 15px 0; |
| 3625 |
} |
| 3626 |
|
| 3627 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-title { |
| 3628 |
font-size: 18px; |
| 3629 |
} |
| 3630 |
|
| 3631 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-subtitle { |
| 3632 |
font-size: 14px; |
| 3633 |
} |
| 3634 |
|
| 3635 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-progress-bar { |
| 3636 |
width: 100%; |
| 3637 |
max-width: 280px; |
| 3638 |
} |
| 3639 |
|
| 3640 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-upgrade { |
| 3641 |
padding: 10px 20px; |
| 3642 |
font-size: 14px; |
| 3643 |
} |
| 3644 |
} |
| 3645 |
|
| 3646 |
@media (max-width: 480px) { |
| 3647 |
.ays-survey-progress-banner-main { |
| 3648 |
padding: 12px 15px; |
| 3649 |
} |
| 3650 |
|
| 3651 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-coupon-text { |
| 3652 |
font-size: 14px; |
| 3653 |
} |
| 3654 |
|
| 3655 |
.ays-survey-progress-banner-main .ays-survey-progress-banner-progress-bar { |
| 3656 |
max-width: 250px; |
| 3657 |
} |
| 3658 |
} |
| 3659 |
'; |
| 3660 |
|
| 3661 |
$content[] = '</style>'; |
| 3662 |
|
| 3663 |
$content = implode( '', $content ); |
| 3664 |
echo ($content); |
| 3665 |
} |
| 3666 |
} |
| 3667 |
|
| 3668 |
public function ays_survey_new_mega_bundle_message($ishmar){ |
| 3669 |
if($ishmar == 0 ){ |
| 3670 |
$content = array(); |
| 3671 |
$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">'; |
| 3672 |
$content[] = '<div id="ays-survey-dicount-month" class="ays_survey_dicount_month">'; |
| 3673 |
|
| 3674 |
$content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-text-box">'; |
| 3675 |
|
| 3676 |
$content[] = '<div class="ays-survey-dicount-wrap-text-box-texts">'; |
| 3677 |
$content[] = '<div> |
| 3678 |
<a href="https://ays-pro.com/mega-bundle?utm_source=survey-maker-free&utm_medium=dashboard&utm_campaign=survey-mega-bundle-'.SURVEY_MAKER_VERSION.'" target="_blank" style="color:#ffffff; text-decoration: underline;">Mega Bundle </a> (Quiz + Survey + Poll) |
| 3679 |
</div> |
| 3680 |
<div style="position: relative;"> |
| 3681 |
<span class="ays-survey-sale-baner-mega-bundle-sale-text">50%</span> |
| 3682 |
<img style="position: absolute;top: 30px;left: 0;" src="' . esc_attr(SURVEY_MAKER_ADMIN_URL) . '/images/icons/line.webp"> |
| 3683 |
</div>'; |
| 3684 |
$content[] = '</div>'; |
| 3685 |
|
| 3686 |
$content[] = '<div style="font-size: 17px; display: flex; align-items: center; margin-top: 10px;">'; |
| 3687 |
$content[] = '<img style="width: 30px;height: 25px;" src="' . esc_attr(SURVEY_MAKER_ADMIN_URL) . '/images/icons/guaranteeicon.webp">'; |
| 3688 |
$content[] = '<span style="padding-left: 8px"> 30 Day Money Back Guarantee</span>'; |
| 3689 |
|
| 3690 |
$content[] = '</div>'; |
| 3691 |
|
| 3692 |
|
| 3693 |
|
| 3694 |
$content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form">'; |
| 3695 |
|
| 3696 |
$content[] = '<form action="" method="POST">'; |
| 3697 |
$content[] = '<div id="ays-survey-dismiss-buttons-content">'; |
| 3698 |
if( current_user_can( 'manage_options' ) ){ |
| 3699 |
$content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>'; |
| 3700 |
$content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' ); |
| 3701 |
} |
| 3702 |
$content[] = '</div>'; |
| 3703 |
$content[] = '</form>'; |
| 3704 |
|
| 3705 |
$content[] = '</div>'; |
| 3706 |
|
| 3707 |
$content[] = '</div>'; |
| 3708 |
|
| 3709 |
$content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-countdown-box">'; |
| 3710 |
|
| 3711 |
$content[] = '<div id="ays-survey-maker-countdown-main-container">'; |
| 3712 |
$content[] = '<div class="ays-survey-maker-countdown-container">'; |
| 3713 |
|
| 3714 |
$content[] = '<div id="ays-survey-countdown">'; |
| 3715 |
|
| 3716 |
// $content[] = '<div>'; |
| 3717 |
// $content[] = __( "Offer ends in:", "survey-maker" ); |
| 3718 |
// $content[] = '</div>'; |
| 3719 |
|
| 3720 |
$content[] = '<ul>'; |
| 3721 |
$content[] = '<li><span id="ays-survey-countdown-days"></span>days</li>'; |
| 3722 |
$content[] = '<li><span id="ays-survey-countdown-hours"></span>Hours</li>'; |
| 3723 |
$content[] = '<li><span id="ays-survey-countdown-minutes"></span>Minutes</li>'; |
| 3724 |
$content[] = '<li><span id="ays-survey-countdown-seconds"></span>Seconds</li>'; |
| 3725 |
$content[] = '</ul>'; |
| 3726 |
$content[] = '</div>'; |
| 3727 |
|
| 3728 |
$content[] = '<div id="ays-survey-countdown-content" class="emoji">'; |
| 3729 |
$content[] = '<span>🚀</span>'; |
| 3730 |
$content[] = '<span>⌛</span>'; |
| 3731 |
$content[] = '<span>🔥</span>'; |
| 3732 |
$content[] = '<span>💣</span>'; |
| 3733 |
$content[] = '</div>'; |
| 3734 |
|
| 3735 |
$content[] = '</div>'; |
| 3736 |
$content[] = '</div>'; |
| 3737 |
|
| 3738 |
$content[] = '</div>'; |
| 3739 |
|
| 3740 |
$content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-button-box">'; |
| 3741 |
$content[] = '<a href="https://ays-pro.com/mega-bundle?utm_source=survey-maker-free&utm_medium=dashboard&utm_campaign=survey-mega-bundle-'.SURVEY_MAKER_VERSION.'" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now !', "survey-maker" ) . '</a>'; |
| 3742 |
$content[] = '<span >One-time payment</span>'; |
| 3743 |
$content[] = '</div>'; |
| 3744 |
$content[] = '</div>'; |
| 3745 |
$content[] = '</div>'; |
| 3746 |
|
| 3747 |
$new_mega_bundle_logo_background = SURVEY_MAKER_ADMIN_URL . '/images/new-mega-bundle-logo-background.svg'; |
| 3748 |
|
| 3749 |
$content[] = '<style id="ays-survey-new-mega-bundle-styles-inline-css">'; |
| 3750 |
$content[] = '#ays-survey-maker-countdown-main-container li span,#ays-survey-new-mega-bundle-dicount-month-main #ays-button-top-buy-now,#ays-survey-new-mega-bundle-dicount-month-main #ays-survey-dismiss-buttons-content,#ays-survey-new-mega-bundle-dicount-month-main .ays-buy-now-opacity-button,#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-buy-now-button-box,#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-button-box,#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box,#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-sale-banner-link,#ays-survey-new-mega-bundle-dicount-month-main .ays_survey_dicount_month,div#ays-survey-new-mega-bundle-dicount-month-main.ays_survey_dicount_info button{display:flex;display:flex;display:flex;display:flex}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{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("'.$new_mega_bundle_logo_background.'");background-position:center;background-repeat:no-repeat;background-size:cover;background-color:#5551ff}#ays-survey-new-mega-bundle-dicount-month-main .ays_survey_dicount_month{align-items:center;justify-content:space-between;color:#fff}#ays-survey-new-mega-bundle-dicount-month-main .ays_survey_dicount_month img{width:80px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-sale-banner-link{justify-content:center;align-items:center;width:200px}#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:400px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-countdown-box{width:40%;justify-content:flex-start;align-items:center}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-button-box{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-wrap-button-box span{font-size:10px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-survey-dicount-wrap-text-box-texts{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{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{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;justify-content:center;align-items:center;opacity:0}#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:10px;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{align-items:center;border-radius:6.409px;background:#f66123;padding:12px 32px;color:#fff;font-size:12.818px;font-style:normal;font-weight:800;line-height:normal}#ays-survey-maker-countdown-main-container li,#ays-survey-maker-countdown-main-container ul,#ays-survey-new-mega-bundle-dicount-month-main .button.ays-button{margin:0}div#ays-survey-new-mega-bundle-dicount-month-main button.notice-dismiss:before{color:#fff}@media all and (max-width:1024px){#ays-survey-new-mega-bundle-dicount-month-main{display:none!important}}@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:center;background-repeat:no-repeat;background-size:cover}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,div#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-text-box{width:100%;text-align:center}#ays-survey-maker-countdown-main-container #ays-survey-countdown-headline{font-size:15px;font-weight:600}#ays-survey-maker-countdown-main-container ul{font-weight:500}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}.comparison a.price-buy{padding:5px 10px;font-size:11px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-survey-dicount-wrap-text-box-texts{height:64px}#ays-survey-maker-countdown-main-container .ays-survey-maker-countdown-container #ays-survey-countdown>ul{display:flex;justify-content:center;align-items:center}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box li span:after{top:unset}#ays-survey-maker-countdown-main-container li{font-size:12px;padding:12px}#ays-survey-maker-countdown-main-container li span{font-size:26px;min-height:50px;min-width:50px}#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box.ays-survey-dicount-wrap-button-box{width:100%}}@media screen and (max-width:1305px) 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 .ays-survey-dicount-wrap-text-box-texts{font-size:15px}#ays-survey-maker-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:436px){#ays-survey-new-mega-bundle-dicount-month-main .ays-survey-dicount-wrap-box .ays-survey-dicount-wrap-text-box-texts{height:110px;margin-bottom:25px}}#ays-survey-maker-countdown-main-container .ays-survey-maker-countdown-container{color:#fff;margin:0 auto;text-align:center}#ays-survey-maker-countdown-main-container li span{justify-content:center;align-items:center;background:#9896ed;justify-content:center;align-items:center;font-size:23px;height:56px;width:53px;border-radius:8px;border:.534px solid #f4f4f4;color:#fff}#ays-survey-maker-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-maker-countdown-main-container li{display:inline-block;font-size:14px;list-style-type:none;padding:14px;text-transform:capitalize;text-align:center;margin:auto}#ays-survey-maker-countdown-main-container .emoji{display:none;padding:1rem}#ays-survey-maker-countdown-main-container .emoji span{font-size:30px;padding:0 .5rem} .ays-survey-dicount-wrap-text-box-texts{font-size:17px;letter-spacing:.8px;font-weight:700;display:flex;align-items:center;justify-content:center;flex-wrap:wrap}.ays-survey-sale-baner-mega-bundle-sale-text{font-size:23px;padding-left:5px;text-shadow:2px 1.3px 0 #f66123;-webkit-text-stroke-width:1px;-webkit-text-stroke-color:#4944FF;-moz-text-stroke-width:1px;-moz-text-stroke-color:#4944FF}'; |
| 3751 |
$content[] = '</style>'; |
| 3752 |
|
| 3753 |
|
| 3754 |
$content = implode( '', $content ); |
| 3755 |
echo html_entity_decode(esc_html( $content )); |
| 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 |
} |
| 4165 |
} |
| 4166 |
|
| 4167 |
|
| 4168 |
// public function ays_survey_new_mega_bundle_message_2024($ishmar){ |
| 4169 |
// if($ishmar == 0 ){ |
| 4170 |
// $content = array(); |
| 4171 |
// $content[] = '<div id="ays-survey-new-mega-bundle-dicount-month-main-2024" class="notice notice-success is-dismissible ays_survey_dicount_info">'; |
| 4172 |
// $content[] = '<div id="ays-survey-dicount-month" class="ays_survey_dicount_month">'; |
| 4173 |
|
| 4174 |
// $content[] = '<div class="ays-survey-discount-box-sale-image"></div>'; |
| 4175 |
// $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-text-box">'; |
| 4176 |
|
| 4177 |
// $content[] = '<div class="ays-survey-dicount-wrap-text-box-texts">'; |
| 4178 |
// $content[] = '<div> |
| 4179 |
// <a href="https://ays-pro.com/mega-bundle?utm_source=survey-maker-free&utm_medium=dashboard&utm_campaign=survey-mega-bundle" target="_blank" style="color:#30499B;"> |
| 4180 |
// <span class="ays-survey-new-mega-bundle-limited-text">Limited</span> Offer for Mega bundle </a> <br> |
| 4181 |
|
| 4182 |
// <span style="font-size: 19px ;">(Quiz + Survey + Poll)</span> |
| 4183 |
// </div>'; |
| 4184 |
// $content[] = '</div>'; |
| 4185 |
|
| 4186 |
// $content[] = '<div style="font-size: 17px;">'; |
| 4187 |
// $content[] = '<img style="width: 24px;height: 24px;" src="' . esc_attr(SURVEY_MAKER_ADMIN_URL) . '/images/icons/guarantee-new.png">'; |
| 4188 |
// $content[] = '<span style="padding-left: 4px; font-size: 14px; font-weight: 600;"> 30 Day Money Back Guarantee</span>'; |
| 4189 |
|
| 4190 |
// $content[] = '</div>'; |
| 4191 |
|
| 4192 |
|
| 4193 |
|
| 4194 |
// $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form">'; |
| 4195 |
|
| 4196 |
// $content[] = '<form action="" method="POST">'; |
| 4197 |
// $content[] = '<div id="ays-survey-dismiss-buttons-content">'; |
| 4198 |
// if( current_user_can( 'manage_options' ) ){ |
| 4199 |
// $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0; color: #30499B; |
| 4200 |
// ">Dismiss ad</button>'; |
| 4201 |
// $content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' ); |
| 4202 |
// } |
| 4203 |
// $content[] = '</div>'; |
| 4204 |
// $content[] = '</form>'; |
| 4205 |
|
| 4206 |
// $content[] = '</div>'; |
| 4207 |
|
| 4208 |
// $content[] = '</div>'; |
| 4209 |
|
| 4210 |
// $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-countdown-box">'; |
| 4211 |
|
| 4212 |
// $content[] = '<div id="ays-survey-maker-countdown-main-container">'; |
| 4213 |
// $content[] = '<div class="ays-survey-maker-countdown-container">'; |
| 4214 |
|
| 4215 |
// $content[] = '<div id="ays-survey-countdown">'; |
| 4216 |
|
| 4217 |
// $content[] = '<div style="font-weight: 500;">'; |
| 4218 |
// $content[] = __( "Offer ends in:", "survey-maker" ); |
| 4219 |
// $content[] = '</div>'; |
| 4220 |
|
| 4221 |
// $content[] = '<ul>'; |
| 4222 |
// $content[] = '<li><span id="ays-survey-countdown-days"></span>days</li>'; |
| 4223 |
// $content[] = '<li><span id="ays-survey-countdown-hours"></span>Hours</li>'; |
| 4224 |
// $content[] = '<li><span id="ays-survey-countdown-minutes"></span>Minutes</li>'; |
| 4225 |
// $content[] = '<li><span id="ays-survey-countdown-seconds"></span>Seconds</li>'; |
| 4226 |
// $content[] = '</ul>'; |
| 4227 |
// $content[] = '</div>'; |
| 4228 |
|
| 4229 |
// $content[] = '<div id="ays-survey-countdown-content" class="emoji">'; |
| 4230 |
// $content[] = '<span>🚀</span>'; |
| 4231 |
// $content[] = '<span>⌛</span>'; |
| 4232 |
// $content[] = '<span>🔥</span>'; |
| 4233 |
// $content[] = '<span>💣</span>'; |
| 4234 |
// $content[] = '</div>'; |
| 4235 |
|
| 4236 |
// $content[] = '</div>'; |
| 4237 |
// $content[] = '</div>'; |
| 4238 |
|
| 4239 |
// $content[] = '</div>'; |
| 4240 |
|
| 4241 |
// $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-button-box">'; |
| 4242 |
// $content[] = '<a href="https://ays-pro.com/mega-bundle?utm_source=survey-maker-free&utm_medium=dashboard&utm_campaign=survey-mega-bundle" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now !', "survey-maker" ) . '</a>'; |
| 4243 |
// $content[] = '<span >One-time payment</span>'; |
| 4244 |
// $content[] = '</div>'; |
| 4245 |
// $content[] = '</div>'; |
| 4246 |
// $content[] = '</div>'; |
| 4247 |
|
| 4248 |
// $content = implode( '', $content ); |
| 4249 |
// echo html_entity_decode(esc_html( $content )); |
| 4250 |
// } |
| 4251 |
// } |
| 4252 |
|
| 4253 |
// // Black Friday 2024 |
| 4254 |
// public function ays_survey_black_friday_message_2024($ishmar){ |
| 4255 |
// if($ishmar == 0 ){ |
| 4256 |
// $content = array(); |
| 4257 |
|
| 4258 |
// $content[] = '<div id="ays-survey-black-friday-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_survey_dicount_info">'; |
| 4259 |
// $content[] = '<div id="ays-survey-dicount-month" class="ays_survey_dicount_month">'; |
| 4260 |
|
| 4261 |
// $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-countdown-box">'; |
| 4262 |
|
| 4263 |
// $content[] = '<div id="ays-survey-maker-countdown-main-container">'; |
| 4264 |
// $content[] = '<div class="ays-survey-maker-countdown-container">'; |
| 4265 |
|
| 4266 |
// $content[] = '<div id="ays-survey-countdown">'; |
| 4267 |
|
| 4268 |
// $content[] = '<div>'; |
| 4269 |
// $content[] = __( "Offer ends in:", "survey-maker" ); |
| 4270 |
// $content[] = '</div>'; |
| 4271 |
|
| 4272 |
// $content[] = '<ul>'; |
| 4273 |
// $content[] = '<li><span id="ays-survey-countdown-days"></span>'. __( "Days", "survey-maker" ) .'</li>'; |
| 4274 |
// $content[] = '<li><span id="ays-survey-countdown-hours"></span>'. __( "Hours", "survey-maker" ) .'</li>'; |
| 4275 |
// $content[] = '<li><span id="ays-survey-countdown-minutes"></span>'. __( "Minutes", "survey-maker" ) .'</li>'; |
| 4276 |
// $content[] = '<li><span id="ays-survey-countdown-seconds"></span>'. __( "Seconds", "survey-maker" ) .'</li>'; |
| 4277 |
// $content[] = '</ul>'; |
| 4278 |
// $content[] = '</div>'; |
| 4279 |
|
| 4280 |
// $content[] = '<div id="ays-survey-countdown-content" class="emoji">'; |
| 4281 |
// $content[] = '<span>🚀</span>'; |
| 4282 |
// $content[] = '<span>⌛</span>'; |
| 4283 |
// $content[] = '<span>🔥</span>'; |
| 4284 |
// $content[] = '<span>💣</span>'; |
| 4285 |
// $content[] = '</div>'; |
| 4286 |
|
| 4287 |
// $content[] = '</div>'; |
| 4288 |
// $content[] = '</div>'; |
| 4289 |
|
| 4290 |
// $content[] = '</div>'; |
| 4291 |
|
| 4292 |
// $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-text-box">'; |
| 4293 |
// $content[] = '<div>'; |
| 4294 |
|
| 4295 |
// $content[] = '<span class="ays-survey-black-friday-bundle-title">'; |
| 4296 |
// $content[] = __( "<span><a href='https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=black-friday-mega-bundle-sale-banner' class='ays-survey-black-friday-bundle-title-link' target='_blank'>Black Friday Sale</a></span>", "survey-maker" ); |
| 4297 |
// $content[] = '</span>'; |
| 4298 |
|
| 4299 |
// $content[] = '</br>'; |
| 4300 |
|
| 4301 |
// $content[] = '<span class="ays-survey-black-friday-bundle-desc">'; |
| 4302 |
// $content[] = '<a class="ays-survey-black-friday-bundle-desc" href="https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=black-friday-mega-bundle-sale-banner" class="ays-survey-black-friday-bundle-title-link" target="_blank">'; |
| 4303 |
// $content[] = __( "50% OFF", "survey-maker" ); |
| 4304 |
// $content[] = '</a>'; |
| 4305 |
// $content[] = '</span>'; |
| 4306 |
// $content[] = '</div>'; |
| 4307 |
|
| 4308 |
// $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form">'; |
| 4309 |
|
| 4310 |
// $content[] = '<form action="" method="POST">'; |
| 4311 |
// $content[] = '<div id="ays-survey-dismiss-buttons-content">'; |
| 4312 |
// if( current_user_can( 'manage_options' ) ){ |
| 4313 |
// $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_bf_btn" style="height: 32px; margin-left: 0;padding-left: 0">'. __( "Dismiss ad", "survey-maker" ) .'</button>'; |
| 4314 |
// $content[] = wp_nonce_field( 'survey-maker-sale-bf-banner' , 'survey-maker-sale-bf-banner' ); |
| 4315 |
// } |
| 4316 |
// $content[] = '</div>'; |
| 4317 |
// $content[] = '</form>'; |
| 4318 |
|
| 4319 |
// $content[] = '</div>'; |
| 4320 |
|
| 4321 |
// $content[] = '</div>'; |
| 4322 |
|
| 4323 |
// $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-black-friday-bundle-coupon-text-box">'; |
| 4324 |
// // $content[] = '<div class="ays-survey-black-friday-bundle-coupon-row">'; |
| 4325 |
// // $content[] = 'bfdeal20off'; |
| 4326 |
// // $content[] = '</div>'; |
| 4327 |
|
| 4328 |
// $content[] = '<div class="ays-survey-black-friday-bundle-data-title">'; |
| 4329 |
// $content[] = '<a href="https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=black-friday-mega-bundle-sale-banner" class="ays-survey-black-friday-bundle-data-title-text" target="_blank">'; |
| 4330 |
// $content[] = __( 'MEGA BUNDLE', "survey-maker" ); |
| 4331 |
// $content[] = '</a>'; |
| 4332 |
// $content[] = '</div>'; |
| 4333 |
// $content[] = '</div>'; |
| 4334 |
|
| 4335 |
// $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-button-box">'; |
| 4336 |
// $content[] = '<a href="https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=black-friday-mega-bundle-sale-banner" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Get Your Deal', "survey-maker" ) . '</a>'; |
| 4337 |
// $content[] = '<span class="ays-survey-dicount-one-time-text">'; |
| 4338 |
// $content[] = __( "One-time payment", "survey-maker" ); |
| 4339 |
// $content[] = '</span>'; |
| 4340 |
// $content[] = '</div>'; |
| 4341 |
// $content[] = '</div>'; |
| 4342 |
// $content[] = '</div>'; |
| 4343 |
|
| 4344 |
// $content = implode( '', $content ); |
| 4345 |
// echo $content; |
| 4346 |
// } |
| 4347 |
// } |
| 4348 |
|
| 4349 |
// Christmas Top Banner 2024 |
| 4350 |
// public function ays_survey_christmas_top_message_2024($ishmar){ |
| 4351 |
// if($ishmar == 0 ){ |
| 4352 |
// $content = array(); |
| 4353 |
|
| 4354 |
// $content[] = '<div id="ays-survey-christmas-top-bundle-dicount-month-main" class="notice notice-success is-dismissible ays_survey_dicount_info">'; |
| 4355 |
// $content[] = '<div id="ays-survey-dicount-month" class="ays_survey_dicount_month">'; |
| 4356 |
|
| 4357 |
// $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-countdown-box">'; |
| 4358 |
|
| 4359 |
// $content[] = '<div id="ays-survey-maker-countdown-main-container">'; |
| 4360 |
// $content[] = '<div class="ays-survey-maker-countdown-container">'; |
| 4361 |
|
| 4362 |
// $content[] = '<div id="ays-survey-countdown">'; |
| 4363 |
|
| 4364 |
// $content[] = '<div>'; |
| 4365 |
// $content[] = __( "Offer ends in:", "survey-maker" ); |
| 4366 |
// $content[] = '</div>'; |
| 4367 |
|
| 4368 |
// $content[] = '<ul>'; |
| 4369 |
// $content[] = '<li><span id="ays-survey-countdown-days"></span>'. __( "Days", "survey-maker" ) .'</li>'; |
| 4370 |
// $content[] = '<li><span id="ays-survey-countdown-hours"></span>'. __( "Hours", "survey-maker" ) .'</li>'; |
| 4371 |
// $content[] = '<li><span id="ays-survey-countdown-minutes"></span>'. __( "Minutes", "survey-maker" ) .'</li>'; |
| 4372 |
// $content[] = '<li><span id="ays-survey-countdown-seconds"></span>'. __( "Seconds", "survey-maker" ) .'</li>'; |
| 4373 |
// $content[] = '</ul>'; |
| 4374 |
// $content[] = '</div>'; |
| 4375 |
|
| 4376 |
// $content[] = '<div id="ays-survey-countdown-content" class="emoji">'; |
| 4377 |
// $content[] = '<span>🚀</span>'; |
| 4378 |
// $content[] = '<span>⌛</span>'; |
| 4379 |
// $content[] = '<span>🔥</span>'; |
| 4380 |
// $content[] = '<span>💣</span>'; |
| 4381 |
// $content[] = '</div>'; |
| 4382 |
|
| 4383 |
// $content[] = '</div>'; |
| 4384 |
// $content[] = '</div>'; |
| 4385 |
|
| 4386 |
// $content[] = '</div>'; |
| 4387 |
|
| 4388 |
// $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-text-box">'; |
| 4389 |
// $content[] = '<div>'; |
| 4390 |
|
| 4391 |
// $content[] = '<span class="ays-survey-christmas-top-bundle-title">'; |
| 4392 |
// $content[] = '<span>'; |
| 4393 |
// $content[] = sprintf('<a class="ays-survey-christmas-top-bundle-desc" href="https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=christmas-sale-banner%s" class="ays-survey-christmas-top-bundle-title-link" target="_blank">', SURVEY_MAKER_VERSION); |
| 4394 |
|
| 4395 |
// $content[] = __( "Christmas Sale", "survey-maker" ); |
| 4396 |
// $content[] = '</a>'; |
| 4397 |
// $content[] = '</span>'; |
| 4398 |
// $content[] = '</br>'; |
| 4399 |
|
| 4400 |
// $content[] = '<span class="ays-survey-christmas-top-bundle-desc">'; |
| 4401 |
// $content[] = sprintf('<a class="ays-survey-christmas-top-bundle-desc" href="https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=christmas-sale-banner%s" class="ays-survey-christmas-top-bundle-title-link" target="_blank">', SURVEY_MAKER_VERSION); |
| 4402 |
// $content[] = __( "20% Extra OFF", "survey-maker" ); |
| 4403 |
// $content[] = '</a>'; |
| 4404 |
// $content[] = '</span>'; |
| 4405 |
// $content[] = '</div>'; |
| 4406 |
|
| 4407 |
// $content[] = '<div style="position: absolute;right: 10px;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form">'; |
| 4408 |
|
| 4409 |
// $content[] = '<form action="" method="POST">'; |
| 4410 |
// $content[] = '<div id="ays-survey-dismiss-buttons-content">'; |
| 4411 |
// if( current_user_can( 'manage_options' ) ){ |
| 4412 |
// $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">'. __( "Dismiss ad", "survey-maker" ) .'</button>'; |
| 4413 |
// $content[] = wp_nonce_field( "survey-maker" . '-sale-banner' , "survey-maker" . '-sale-banner' ); |
| 4414 |
// } |
| 4415 |
// $content[] = '</div>'; |
| 4416 |
// $content[] = '</form>'; |
| 4417 |
|
| 4418 |
// $content[] = '</div>'; |
| 4419 |
|
| 4420 |
// $content[] = '</div>'; |
| 4421 |
|
| 4422 |
// $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-christmas-top-bundle-coupon-text-box">'; |
| 4423 |
// $content[] = '<div class="ays-survey-christmas-top-bundle-coupon-row">'; |
| 4424 |
// $content[] = 'xmas20off'; |
| 4425 |
// $content[] = '</div>'; |
| 4426 |
|
| 4427 |
// $content[] = '<div class="ays-survey-christmas-top-bundle-text-row">'; |
| 4428 |
// $content[] = __( '20% Extra Discount Coupon', "survey-maker" ); |
| 4429 |
// $content[] = '</div>'; |
| 4430 |
// $content[] = '</div>'; |
| 4431 |
|
| 4432 |
// $content[] = '<div class="ays-survey-dicount-wrap-box ays-survey-dicount-wrap-button-box">'; |
| 4433 |
// $content[] = sprintf('<a href="https://ays-pro.com/wordpress/survey-maker?utm_source=dashboard&utm_medium=survey-free&utm_campaign=christmas-sale-banner%s" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">', SURVEY_MAKER_VERSION); |
| 4434 |
// $content[] = __( 'Get Your Deal', "survey-maker" ); |
| 4435 |
// $content[] = '</a>'; |
| 4436 |
// $content[] = '<span class="ays-survey-dicount-one-time-text">'; |
| 4437 |
// $content[] = __( "One-time payment", "survey-maker" ); |
| 4438 |
// $content[] = '</span>'; |
| 4439 |
// $content[] = '</div>'; |
| 4440 |
// $content[] = '</div>'; |
| 4441 |
// $content[] = '</div>'; |
| 4442 |
|
| 4443 |
// $content = implode( '', $content ); |
| 4444 |
// echo $content; |
| 4445 |
// } |
| 4446 |
// } |
| 4447 |
|
| 4448 |
|
| 4449 |
|
| 4450 |
// Black Friday |
| 4451 |
// public function ays_survey_black_friday_message($ishmar){ |
| 4452 |
// if($ishmar == 0 ){ |
| 4453 |
// $content = array(); |
| 4454 |
|
| 4455 |
// $content[] = '<div id="ays-survey-dicount-black-friday-month-main" class="notice notice-success is-dismissible ays_chart_dicount_info">'; |
| 4456 |
// $content[] = '<div id="ays-survey-dicount-black-friday-month" class="ays_chart_dicount_month">'; |
| 4457 |
// $content[] = '<div class="ays-survey-dicount-black-friday-box">'; |
| 4458 |
// $content[] = '<div class="ays-survey-dicount-black-friday-wrap-box ays-survey-dicount-black-friday-wrap-box-80" style="width: 70%;">'; |
| 4459 |
// $content[] = '<div class="ays-survey-dicount-black-friday-title-row">' . __( 'Limited Time', "survey-maker" ) .' '. '<a href="https://ays-pro.com/mega-bundle?utm_medium=survey-free&utm_campaign=black-friday-sale-banner&utm_source=dashboard" class="ays-survey-dicount-black-friday-button-sale" target="_blank">' . __( 'Sale', "chart-builder" ) . '</a>' . '</div>'; |
| 4460 |
// $content[] = '<div class="ays-survey-dicount-black-friday-title-row">' . __( 'Mega bundle', "survey-maker" ) . ' (Quiz+Survey+Poll)!</div> '; |
| 4461 |
// $content[] = '</div>'; |
| 4462 |
|
| 4463 |
// $content[] = '<div class="ays-survey-dicount-black-friday-wrap-box ays-survey-dicount-black-friday-wrap-text-box">'; |
| 4464 |
// $content[] = '<div class="ays-survey-dicount-black-friday-text-row">' . __( '50% off', "survey-maker" ) . '</div>'; |
| 4465 |
// $content[] = '</div>'; |
| 4466 |
|
| 4467 |
// $content[] = '<div class="ays-survey-dicount-black-friday-wrap-box" style="width: 25%;">'; |
| 4468 |
// $content[] = '<div id="ays-survey-countdown-main-container">'; |
| 4469 |
// $content[] = '<div class="ays-survey-countdown-container">'; |
| 4470 |
// $content[] = '<div id="ays-survey-countdown" style="display: block;">'; |
| 4471 |
// $content[] = '<ul>'; |
| 4472 |
// $content[] = '<li><span id="ays-survey-countdown-days">0</span>' . __( 'Days', "survey-maker" ) . '</li>'; |
| 4473 |
// $content[] = '<li><span id="ays-survey-countdown-hours">0</span>' . __( 'Hours', "survey-maker" ) . '</li>'; |
| 4474 |
// $content[] = '<li><span id="ays-survey-countdown-minutes">0</span>' . __( 'Minutes', "survey-maker" ) . '</li>'; |
| 4475 |
// $content[] = '<li><span id="ays-survey-countdown-seconds">0</span>' . __( 'Seconds', "survey-maker" ) . '</li>'; |
| 4476 |
// $content[] = '</ul>'; |
| 4477 |
// $content[] = '</div>'; |
| 4478 |
// $content[] = '<div id="ays-survey-countdown-content" class="emoji" style="display: none;">'; |
| 4479 |
// $content[] = '<span>🚀</span>'; |
| 4480 |
// $content[] = '<span>⌛</span>'; |
| 4481 |
// $content[] = '<span>🔥</span>'; |
| 4482 |
// $content[] = '<span>💣</span>'; |
| 4483 |
// $content[] = '</div>'; |
| 4484 |
// $content[] = '</div>'; |
| 4485 |
// $content[] = '</div>'; |
| 4486 |
// $content[] = '</div>'; |
| 4487 |
|
| 4488 |
// $content[] = '<div class="ays-survey-dicount-black-friday-wrap-box" style="width: 25%;">'; |
| 4489 |
// $content[] = '<a href="https://ays-pro.com/mega-bundle?utm_medium=survey-free&utm_campaign=black-friday-sale-banner&utm_source=dashboard" class="ays-survey-dicount-black-friday-button-buy-now" target="_blank">' . __( 'Get Your Deal', "survey-maker" ) . '</a>'; |
| 4490 |
// $content[] = '</div>'; |
| 4491 |
// $content[] = '</div>'; |
| 4492 |
// $content[] = '</div>'; |
| 4493 |
|
| 4494 |
// $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form-black-friday">'; |
| 4495 |
// $content[] = '<form action="" method="POST">'; |
| 4496 |
// $content[] = '<div id="ays-survey-dismiss-buttons-content">'; |
| 4497 |
// if( current_user_can( 'manage_options' ) ){ |
| 4498 |
// $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>'; |
| 4499 |
// $content[] = wp_nonce_field( $this->plugin_name . '-sale-banner' , $this->plugin_name . '-sale-banner' ); |
| 4500 |
// } |
| 4501 |
// $content[] = '</div>'; |
| 4502 |
// $content[] = '</form>'; |
| 4503 |
// $content[] = '</div>'; |
| 4504 |
// $content[] = '</div>'; |
| 4505 |
|
| 4506 |
// $content = implode( '', $content ); |
| 4507 |
|
| 4508 |
// echo $content; |
| 4509 |
// } |
| 4510 |
// } |
| 4511 |
|
| 4512 |
// Christmas banner |
| 4513 |
// public static function ays_survey_christmas_message($ishmar){ |
| 4514 |
// if($ishmar == 0 ){ |
| 4515 |
// $content = array(); |
| 4516 |
|
| 4517 |
// $content[] = '<div id="ays-survey-dicount-christmas-month-main" class="notice notice-success is-dismissible ays_survey_dicount_info">'; |
| 4518 |
// $content[] = '<div id="ays-survey-dicount-christmas-month" class="ays_survey_dicount_month">'; |
| 4519 |
// $content[] = '<div class="ays-survey-dicount-christmas-box">'; |
| 4520 |
// $content[] = '<div class="ays-survey-dicount-christmas-wrap-box ays-survey-dicount-christmas-wrap-box-80">'; |
| 4521 |
// $content[] = '<div class="ays-survey-dicount-christmas-title-row">' . __( 'Limited Time', "survey-maker" ) .' '. '<a href="https://ays-pro.com/wordpress/survey-maker" class="ays-survey-dicount-christmas-button-sale" target="_blank">20%</a>' . ' SALE</div>'; |
| 4522 |
// $content[] = '<div class="ays-survey-dicount-christmas-title-row">' . __( 'Survey Maker Plugin', "survey-maker" ) . '</div>'; |
| 4523 |
// $content[] = '</div>'; |
| 4524 |
|
| 4525 |
// $content[] = '<div class="ays-survey-dicount-christmas-wrap-box" style="width: 25%;">'; |
| 4526 |
// $content[] = '<div id="ays-survey-maker-countdown-main-container">'; |
| 4527 |
// $content[] = '<div class="ays-survey-countdown-container">'; |
| 4528 |
// $content[] = '<div id="ays-survey-countdown" style="display: block;">'; |
| 4529 |
// $content[] = '<ul>'; |
| 4530 |
// $content[] = '<li><span id="ays-survey-countdown-days"></span>' . __( 'Days', "survey-maker" ) . '</li>'; |
| 4531 |
// $content[] = '<li><span id="ays-survey-countdown-hours"></span>' . __( 'Hours', "survey-maker" ) . '</li>'; |
| 4532 |
// $content[] = '<li><span id="ays-survey-countdown-minutes"></span>' . __( 'Minutes', "survey-maker" ) . '</li>'; |
| 4533 |
// $content[] = '<li><span id="ays-survey-countdown-seconds"></span>' . __( 'Seconds', "survey-maker" ) . '</li>'; |
| 4534 |
// $content[] = '</ul>'; |
| 4535 |
// $content[] = '</div>'; |
| 4536 |
// $content[] = '<div id="ays-survey-countdown-content" class="emoji" style="display: none;">'; |
| 4537 |
// $content[] = '<span>🚀</span>'; |
| 4538 |
// $content[] = '<span>⌛</span>'; |
| 4539 |
// $content[] = '<span>🔥</span>'; |
| 4540 |
// $content[] = '<span>💣</span>'; |
| 4541 |
// $content[] = '</div>'; |
| 4542 |
// $content[] = '</div>'; |
| 4543 |
// $content[] = '</div>'; |
| 4544 |
// $content[] = '</div>'; |
| 4545 |
|
| 4546 |
// $content[] = '<div class="ays-survey-dicount-christmas-wrap-box" style="width: 25%;">'; |
| 4547 |
// $content[] = '<a href="https://ays-pro.com/wordpress/survey-maker" class="ays-survey-dicount-christmas-button-buy-now" target="_blank">' . __( 'BUY NOW', "survey-maker" ) . '!</a>'; |
| 4548 |
// $content[] = '</div>'; |
| 4549 |
// $content[] = '</div>'; |
| 4550 |
// $content[] = '</div>'; |
| 4551 |
|
| 4552 |
// $content[] = '<div style="position: absolute;right: 0;bottom: 1px;" class="ays-survey-dismiss-buttons-container-for-form-christmas">'; |
| 4553 |
// $content[] = '<form action="" method="POST">'; |
| 4554 |
// $content[] = '<div id="ays-survey-dismiss-buttons-content-christmas">'; |
| 4555 |
// $content[] = '<button class="btn btn-link ays-button-christmas" name="ays_survey_sale_btn" style="">' . __( 'Dismiss ad', "survey-maker" ) . '</button>'; |
| 4556 |
// $content[] = '</div>'; |
| 4557 |
// $content[] = '</form>'; |
| 4558 |
// $content[] = '</div>'; |
| 4559 |
// $content[] = '</div>'; |
| 4560 |
|
| 4561 |
// $content = implode( '', $content ); |
| 4562 |
|
| 4563 |
// echo $content; |
| 4564 |
// } |
| 4565 |
// } |
| 4566 |
|
| 4567 |
public function ays_survey_add_survey_template() { |
| 4568 |
global $wpdb; |
| 4569 |
|
| 4570 |
$template_file_name = (isset($_REQUEST['template_file_name']) && $_REQUEST['template_file_name'] != "") ? sanitize_text_field($_REQUEST['template_file_name'] ) : null; |
| 4571 |
|
| 4572 |
switch($template_file_name){ |
| 4573 |
case 'customer-feedback-form': |
| 4574 |
$json = file_get_contents(SURVEY_MAKER_ADMIN_PATH . "/partials/surveys/templates/customer-feedback-form.json"); |
| 4575 |
break; |
| 4576 |
case 'employee-satisfaction-survey': |
| 4577 |
$json = file_get_contents(SURVEY_MAKER_ADMIN_PATH . "/partials/surveys/templates/employee-satisfaction-survey.json"); |
| 4578 |
break; |
| 4579 |
case 'event-evaluation-survey': |
| 4580 |
$json = file_get_contents(SURVEY_MAKER_ADMIN_PATH . "/partials/surveys/templates/event-evaluation-survey.json"); |
| 4581 |
break; |
| 4582 |
case 'product-research-survey': |
| 4583 |
$json = file_get_contents(SURVEY_MAKER_ADMIN_PATH . "/partials/surveys/templates/product-research-survey.json"); |
| 4584 |
break; |
| 4585 |
case 'restaurant-evaluation-survey': |
| 4586 |
$json = file_get_contents(SURVEY_MAKER_ADMIN_PATH . "/partials/surveys/templates/restaurant-evaluation-survey.json"); |
| 4587 |
break; |
| 4588 |
case 'market-research-survey': |
| 4589 |
$json = file_get_contents(SURVEY_MAKER_ADMIN_PATH . "/partials/surveys/templates/market-research-survey.json"); |
| 4590 |
break; |
| 4591 |
case 'brand-awareness-survey': |
| 4592 |
$json = file_get_contents(SURVEY_MAKER_ADMIN_PATH . "/partials/surveys/templates/brand-awareness-survey.json"); |
| 4593 |
break; |
| 4594 |
case 'user-persona-survey': |
| 4595 |
$json = file_get_contents(SURVEY_MAKER_ADMIN_PATH . "/partials/surveys/templates/user-persona-survey.json"); |
| 4596 |
break; |
| 4597 |
} |
| 4598 |
|
| 4599 |
$response = array(); |
| 4600 |
$json = json_decode($json, true); |
| 4601 |
$json_key = isset($json['ays_survey_key']) ? $json['ays_survey_key'] : false; |
| 4602 |
|
| 4603 |
if($json_key) { |
| 4604 |
$response = array( |
| 4605 |
'status' => true, |
| 4606 |
'data' => $json |
| 4607 |
); |
| 4608 |
|
| 4609 |
echo json_encode( $response ); |
| 4610 |
wp_die(); |
| 4611 |
}else{ |
| 4612 |
$response = array( |
| 4613 |
'status' => false |
| 4614 |
); |
| 4615 |
|
| 4616 |
echo json_encode( $response ); |
| 4617 |
wp_die(); |
| 4618 |
} |
| 4619 |
} |
| 4620 |
|
| 4621 |
// public static function ays_survey_spring_bundle_small_message($ishmar){ |
| 4622 |
// if($ishmar == 0 ){ |
| 4623 |
// $content = array(); |
| 4624 |
|
| 4625 |
// $content[] = '<div id="ays-survey-dicount-month-main" class="notice notice-success is-dismissible ays_survey_dicount_info">'; |
| 4626 |
// $content[] = '<div id="ays-survey-dicount-month" class="ays_survey_dicount_month">'; |
| 4627 |
// $content[] = '<a href="https://ays-pro.com/mega-bundle" target="_blank" class="ays-survey-sale-banner-link"><img src="' . SURVEY_MAKER_ADMIN_URL . '/images/mega_bundle_logo_box.png"></a>'; |
| 4628 |
|
| 4629 |
// $content[] = '<div class="ays-survey-dicount-wrap-box">'; |
| 4630 |
// $content[] = '<p>'; |
| 4631 |
// $content[] = '<strong>'; |
| 4632 |
// $content[] = __( "Spring is here! <span class='ays-survey-dicount-wrap-color'>50%</span> SALE on <span><a href='https://ays-pro.com/mega-bundle' target='_blank' class='ays-survey-dicount-wrap-color ays-survey-dicount-wrap-text-decoration'>Mega Bundle</a></span><span style='display: block;'>Quiz + Survey + Poll</span>", SURVEY_MAKER_ADMIN_URL ); |
| 4633 |
// $content[] = '</strong>'; |
| 4634 |
// $content[] = '</p>'; |
| 4635 |
// $content[] = '</div>'; |
| 4636 |
|
| 4637 |
// $content[] = '<div class="ays-survey-dicount-wrap-box">'; |
| 4638 |
|
| 4639 |
// $content[] = '<div id="ays-survey-countdown-main-container">'; |
| 4640 |
|
| 4641 |
// $content[] = '<form action="" method="POST" class="ays-survey-btn-form">'; |
| 4642 |
// $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn_small_spring" style="height: 32px; margin-left: 0;padding-left: 0">Dismiss ad</button>'; |
| 4643 |
// $content[] = '<button class="btn btn-link ays-button" name="ays_survey_sale_btn_spring_small_for_two_months" style="height: 32px; padding-left: 0">Dismiss ad for 2 months</button>'; |
| 4644 |
// $content[] = '</form>'; |
| 4645 |
|
| 4646 |
// $content[] = '</div>'; |
| 4647 |
|
| 4648 |
// $content[] = '</div>'; |
| 4649 |
|
| 4650 |
// $content[] = '<a href="https://ays-pro.com/mega-bundle" class="button button-primary ays-button" id="ays-button-top-buy-now" target="_blank">' . __( 'Buy Now !', SURVEY_MAKER_ADMIN_URL ) . '</a>'; |
| 4651 |
// $content[] = '</div>'; |
| 4652 |
// $content[] = '</div>'; |
| 4653 |
|
| 4654 |
// $content = implode( '', $content ); |
| 4655 |
// echo $content; |
| 4656 |
// } |
| 4657 |
// } |
| 4658 |
|
| 4659 |
public function ays_survey_maker_live_preview_content(){ |
| 4660 |
|
| 4661 |
$content = isset($_REQUEST['content']) && $_REQUEST['content'] != '' ? wp_kses_post( $_REQUEST['content'] ) : null; |
| 4662 |
if($content === null){ |
| 4663 |
ob_end_clean(); |
| 4664 |
$ob_get_clean = ob_get_clean(); |
| 4665 |
echo json_encode(array( |
| 4666 |
'status' => false, |
| 4667 |
)); |
| 4668 |
} |
| 4669 |
// $content = Survey_Maker_Data::ays_autoembed( $content ); |
| 4670 |
$content = stripslashes( wpautop( $content ) ); |
| 4671 |
ob_end_clean(); |
| 4672 |
$ob_get_clean = ob_get_clean(); |
| 4673 |
echo json_encode(array( |
| 4674 |
'status' => true, |
| 4675 |
'content' => $content, |
| 4676 |
)); |
| 4677 |
wp_die(); |
| 4678 |
} |
| 4679 |
|
| 4680 |
public function add_tabs() { |
| 4681 |
$screen = get_current_screen(); |
| 4682 |
|
| 4683 |
if ( ! $screen) { |
| 4684 |
return; |
| 4685 |
} |
| 4686 |
|
| 4687 |
$title = __( 'General Information:', "survey-maker"); |
| 4688 |
$content_text = 'Get real-time feedback with the Survey Maker plugin. You are free to generate unlimited online surveys with unlimited questions and sections. Easily create your customer satisfaction surveys, employee engagement forms, market researches, event planning questionnaires with this plugin. |
| 4689 |
<br><br>Increase users’ track to your WordPress website with the Survey Maker features. Build smarter surveys with LogicJump, advance your questionnaires with Conditional Results, earn money with Paid Surveys, generate leads super easily, get valuable feedback.'; |
| 4690 |
|
| 4691 |
$sidebar_content = '<p><strong>' . __( 'For more information:', "survey-maker") . '</strong></p>' . |
| 4692 |
'<p> |
| 4693 |
<a href="https://www.youtube.com/watch?v=Q1qi649acb0" target="_blank">' . __( 'YouTube video tutorials' , "survey-maker" ) . '</a> |
| 4694 |
</p>' . |
| 4695 |
'<p> |
| 4696 |
<a href="https://ays-pro.com/wordpress-survey-maker-user-manual" target="_blank">' . __( 'Documentation', "survey-maker" ) . '</a> |
| 4697 |
</p>' . |
| 4698 |
'<p> |
| 4699 |
<a href="https://ays-pro.com/wordpress/survey-maker" target="_blank">' . __( 'Survey Maker plugin pro version', "survey-maker" ) . '</a> |
| 4700 |
</p>' . |
| 4701 |
'<p> |
| 4702 |
<a href="https://ays-demo.com/wordpress-survey-plugin-pro-demo/" target="_blank">' . __( 'Survey Maker plugin demo', "survey-maker" ) . '</a> |
| 4703 |
</p>'; |
| 4704 |
|
| 4705 |
|
| 4706 |
$content = '<h2>' . __( 'Survey Maker Information', "survey-maker") . '</h2>' |
| 4707 |
.'<p>' .sprintf(__( '%s', "survey-maker" ), $content_text).'</p>'; |
| 4708 |
|
| 4709 |
$help_tab_content = array( |
| 4710 |
'id' => 'survey_maker_help_tab', |
| 4711 |
'title' => $title, |
| 4712 |
'content' => $content |
| 4713 |
); |
| 4714 |
|
| 4715 |
$screen->add_help_tab($help_tab_content); |
| 4716 |
|
| 4717 |
$screen->set_help_sidebar($sidebar_content); |
| 4718 |
} |
| 4719 |
|
| 4720 |
public function get_next_or_prev_survey_by_id( $id, $type = "next" ) { |
| 4721 |
global $wpdb; |
| 4722 |
|
| 4723 |
$surveys_table = esc_sql( $wpdb->prefix . "ayssurvey_surveys" ); |
| 4724 |
|
| 4725 |
$where = array(); |
| 4726 |
$where_condition = ""; |
| 4727 |
|
| 4728 |
$id = (isset( $id ) && $id != "" && absint($id) != 0) ? absint( sanitize_text_field( $id ) ) : null; |
| 4729 |
$type = (isset( $type ) && $type != "") ? sanitize_text_field( $type ) : "next"; |
| 4730 |
|
| 4731 |
if ( is_null( $id ) || $id == 0 ) { |
| 4732 |
return null; |
| 4733 |
} |
| 4734 |
|
| 4735 |
switch ( $type ) { |
| 4736 |
case 'prev': |
| 4737 |
$where[] = ' `id` < ' . $id . ' ORDER BY `id` DESC '; |
| 4738 |
break; |
| 4739 |
case 'next': |
| 4740 |
default: |
| 4741 |
$where[] = ' `id` > ' . $id; |
| 4742 |
break; |
| 4743 |
} |
| 4744 |
|
| 4745 |
if( ! empty($where) ){ |
| 4746 |
$where_condition = " WHERE " . implode( " AND ", $where ); |
| 4747 |
} |
| 4748 |
|
| 4749 |
$sql = "SELECT `id` FROM {$surveys_table} ". $where_condition ." LIMIT 1;"; |
| 4750 |
$results = $wpdb->get_row( $sql, 'ARRAY_A' ); |
| 4751 |
|
| 4752 |
return $results; |
| 4753 |
|
| 4754 |
} |
| 4755 |
|
| 4756 |
public static function ays_survey_update_banner_time(){ |
| 4757 |
|
| 4758 |
$date = time() + ( 3 * 24 * 60 * 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS); |
| 4759 |
// $date = time() + ( 60 ) + (int) ( get_option( 'gmt_offset' ) * HOUR_IN_SECONDS); // for testing | 1 min |
| 4760 |
$next_3_days = date('M d, Y H:i:s', $date); |
| 4761 |
|
| 4762 |
$ays_survey_banner_time = get_option('ays_survey_banner_time'); |
| 4763 |
|
| 4764 |
if ( !$ays_survey_banner_time || is_null( $ays_survey_banner_time ) ) { |
| 4765 |
update_option('ays_survey_banner_time', $next_3_days ); |
| 4766 |
} |
| 4767 |
|
| 4768 |
$get_ays_survey_banner_time = get_option('ays_survey_banner_time'); |
| 4769 |
|
| 4770 |
$val = 60*60*24*0.5; // half day |
| 4771 |
// $val = 60; // for testing | 1 min |
| 4772 |
|
| 4773 |
$current_date = current_time( 'mysql' ); |
| 4774 |
$date_diff = strtotime($current_date) - intval(strtotime($get_ays_survey_banner_time)); |
| 4775 |
|
| 4776 |
$days_diff = $date_diff / $val; |
| 4777 |
if(intval($days_diff) > 0 ){ |
| 4778 |
update_option('ays_survey_banner_time', $next_3_days); |
| 4779 |
} |
| 4780 |
|
| 4781 |
return $get_ays_survey_banner_time; |
| 4782 |
} |
| 4783 |
|
| 4784 |
//---------------- Survey submisson open results in popup ---------------- |
| 4785 |
|
| 4786 |
|
| 4787 |
public function ays_survey_show_results(){ |
| 4788 |
|
| 4789 |
// Run a security check. |
| 4790 |
check_ajax_referer( 'survey-maker-ajax-results-nonce', sanitize_key( $_REQUEST['_ajax_nonce'] ) ); |
| 4791 |
|
| 4792 |
global $wpdb; |
| 4793 |
if( !is_user_logged_in() ) { |
| 4794 |
echo json_encode( array( |
| 4795 |
'status' => false, |
| 4796 |
'rows' => "" |
| 4797 |
) ); |
| 4798 |
|
| 4799 |
}; |
| 4800 |
|
| 4801 |
// Check for permissions. |
| 4802 |
if ( ! current_user_can( 'manage_options' ) ) { |
| 4803 |
ob_end_clean(); |
| 4804 |
$ob_get_clean = ob_get_clean(); |
| 4805 |
echo json_encode(array( |
| 4806 |
'status' => false, |
| 4807 |
"rows" => "" |
| 4808 |
)); |
| 4809 |
wp_die(); |
| 4810 |
} |
| 4811 |
|
| 4812 |
if (isset($_REQUEST['action']) && $_REQUEST['action'] == 'ays_survey_show_results' && isset($_REQUEST['survey_id']) && !empty($_REQUEST['survey_id'])) { |
| 4813 |
|
| 4814 |
ob_start(); |
| 4815 |
|
| 4816 |
$survey_id = absint(intval($_REQUEST['survey_id'])); |
| 4817 |
|
| 4818 |
|
| 4819 |
$this->settings_obj = new Survey_Maker_Settings_Actions($this->plugin_name); |
| 4820 |
|
| 4821 |
$filters = array(); |
| 4822 |
|
| 4823 |
$submission_count_and_ids = Survey_Maker_Data::get_submission_count_and_ids( $survey_id, $filters ); |
| 4824 |
$submission_ids_arr = ( isset( $submission_count_and_ids['submission_ids_arr'] ) && ! empty( $submission_count_and_ids['submission_ids_arr'] ) ) ? Survey_Maker_Data::recursive_sanitize_text_field( $submission_count_and_ids['submission_ids_arr'] ) : array(); |
| 4825 |
$filters['filter_submission_ids'] = $submission_ids_arr; |
| 4826 |
|
| 4827 |
|
| 4828 |
$sql = "SELECT * FROM " . $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "surveys WHERE id =" . absint( $survey_id ); |
| 4829 |
$survey_name = $wpdb->get_row( $sql, 'ARRAY_A' ); |
| 4830 |
|
| 4831 |
$survey_options = isset( $survey_name['options'] ) && $survey_name['options'] != '' ? json_decode( $survey_name['options'], true ) : array(); |
| 4832 |
|
| 4833 |
$survey_for_charts = isset( $survey_options['survey_color'] ) && $survey_options['survey_color'] != '' ? esc_attr($survey_options['survey_color']) : "rgb(255, 87, 34)"; |
| 4834 |
$survey_for_charts_text_color = isset( $survey_options['survey_text_color'] ) && $survey_options['survey_text_color'] != '' ? esc_attr($survey_options['survey_text_color']) : "rgb(255, 87, 34)"; |
| 4835 |
if(isset( $survey_options['survey_color'] ) && $survey_options['survey_color'] == 'rgba(0,0,0,0)'){ |
| 4836 |
$survey_for_charts = "rgba(0,0,0,1)"; |
| 4837 |
} |
| 4838 |
if($survey_for_charts_text_color == 'rgba(0,0,0,0)'){ |
| 4839 |
$survey_for_charts_text_color = "rgba(0,0,0,1)"; |
| 4840 |
} |
| 4841 |
// Allow HTML in answers |
| 4842 |
$survey_options[ 'survey_allow_html_in_answers' ] = isset($survey_options[ 'survey_allow_html_in_answers' ]) ? $survey_options[ 'survey_allow_html_in_answers' ] : 'off'; |
| 4843 |
$allow_html_in_answers = (isset($survey_options[ 'survey_allow_html_in_answers' ]) && $survey_options[ 'survey_allow_html_in_answers' ] == 'on') ? true : false; |
| 4844 |
|
| 4845 |
// Allow HTML in description |
| 4846 |
$survey_options[ 'survey_allow_html_in_section_description' ] = isset($survey_options[ 'survey_allow_html_in_section_description' ]) ? $survey_options[ 'survey_allow_html_in_section_description' ] : 'off'; |
| 4847 |
$survey_allow_html_in_section_description = (isset($survey_options[ 'survey_allow_html_in_section_description' ]) && $survey_options[ 'survey_allow_html_in_section_description' ] == 'on') ? true : false; |
| 4848 |
|
| 4849 |
$user_id = get_current_user_id(); |
| 4850 |
|
| 4851 |
$author_id = isset( $survey_name['author_id'] ) && $survey_name['author_id'] != "" ? intval( $survey_name['author_id'] ) : 0; |
| 4852 |
$survey_title = isset( $survey_name['title'] ) && $survey_name['title'] != "" ? esc_html__( $survey_name['title'], "survey-maker" ) : ""; |
| 4853 |
|
| 4854 |
$owner = false; |
| 4855 |
if( $user_id == $author_id ){ |
| 4856 |
$owner = true; |
| 4857 |
} |
| 4858 |
|
| 4859 |
if( !$owner ){ |
| 4860 |
$url = esc_url_raw( remove_query_arg( array( 'page', 'survey' ) ) ) . "?page=survey-maker-submissions"; |
| 4861 |
wp_redirect( $url ); |
| 4862 |
} |
| 4863 |
|
| 4864 |
$gen_options = ($this->settings_obj->ays_get_setting('options') === false) ? array() : json_decode($this->settings_obj->ays_get_setting('options'), true); |
| 4865 |
|
| 4866 |
$submission_id = (isset($_REQUEST['submission_id']) && $_REQUEST['submission_id'] != '') ? absint( sanitize_text_field( $_REQUEST['submission_id'] ) ) : null; |
| 4867 |
if($submission_id == null){ |
| 4868 |
|
| 4869 |
return array( |
| 4870 |
'status' => false, |
| 4871 |
'rows' => "" |
| 4872 |
); |
| 4873 |
} |
| 4874 |
$submission = array( |
| 4875 |
'id' => $submission_id |
| 4876 |
); |
| 4877 |
|
| 4878 |
|
| 4879 |
$ays_survey_individual_questions = $this->ays_survey_individual_results_for_one_submission( $submission, $survey_name ); |
| 4880 |
|
| 4881 |
// Show question title as HTML |
| 4882 |
$survey_options[ 'survey_show_questions_as_html' ] = isset($survey_options[ 'survey_show_questions_as_html' ]) ? $survey_options[ 'survey_show_questions_as_html' ] : 'on'; |
| 4883 |
$survey_show_questions_as_html = $survey_options[ 'survey_show_questions_as_html' ] == 'on' ? true : false; |
| 4884 |
|
| 4885 |
// Get user info |
| 4886 |
$individual_user_name = ""; |
| 4887 |
$individual_user_email = ""; |
| 4888 |
$individual_user_ip = ""; |
| 4889 |
$individual_user_date = ""; |
| 4890 |
$individual_user_sub_id = ""; |
| 4891 |
$individual_user_password = ""; |
| 4892 |
$dashboard_admin_note = ""; |
| 4893 |
$individual_user_device_type = ""; |
| 4894 |
if( isset($ays_survey_individual_questions['user_info']) && is_array( $ays_survey_individual_questions['user_info']) ){ |
| 4895 |
$individual_user_name = isset($ays_survey_individual_questions['user_info']['user_name']) && isset($ays_survey_individual_questions['user_info']['user_name']) ? stripslashes( $ays_survey_individual_questions['user_info']['user_name'] ) : ""; |
| 4896 |
$individual_user_email = isset($ays_survey_individual_questions['user_info']['user_email']) && isset($ays_survey_individual_questions['user_info']['user_email']) ? stripslashes( esc_attr( $ays_survey_individual_questions['user_info']['user_email'] ) ) : ""; |
| 4897 |
$individual_user_ip = isset($ays_survey_individual_questions['user_info']['user_ip']) && isset($ays_survey_individual_questions['user_info']['user_ip']) ? stripslashes( esc_attr( $ays_survey_individual_questions['user_info']['user_ip'] ) ) : ""; |
| 4898 |
$individual_user_date = isset($ays_survey_individual_questions['user_info']['submission_date']) && isset($ays_survey_individual_questions['user_info']['submission_date']) ? stripslashes( esc_attr( $ays_survey_individual_questions['user_info']['submission_date'] ) ) : ""; |
| 4899 |
$individual_user_sub_id = isset($ays_survey_individual_questions['user_info']['id']) && isset($ays_survey_individual_questions['user_info']['id']) ? stripslashes( esc_attr( $ays_survey_individual_questions['user_info']['id'] ) ) : ""; |
| 4900 |
$individual_user_password = isset($ays_survey_individual_questions['user_info']['password']) && isset($ays_survey_individual_questions['user_info']['password']) ? stripslashes( esc_attr( $ays_survey_individual_questions['user_info']['password'] ) ) : ""; |
| 4901 |
$individual_user_extra_data = isset($ays_survey_individual_questions['user_info']['options']) && $ays_survey_individual_questions['user_info']['options'] != '' ? json_decode(($ays_survey_individual_questions['user_info']['options']) , 'true') : array(); |
| 4902 |
$individual_user_device_type = isset($individual_user_extra_data['device']) && $individual_user_extra_data['device'] != '' ? esc_attr($individual_user_extra_data['device']) : ''; |
| 4903 |
$dashboard_admin_note = isset($ays_survey_individual_questions['user_info']['admin_note']) && isset($ays_survey_individual_questions['user_info']['admin_note']) ? stripslashes( esc_attr( $ays_survey_individual_questions['user_info']['admin_note'] ) ) : ""; |
| 4904 |
} |
| 4905 |
|
| 4906 |
$text_types = array( |
| 4907 |
'text', |
| 4908 |
'short_text', |
| 4909 |
'number', |
| 4910 |
'phone', |
| 4911 |
'name', |
| 4912 |
'hidden', |
| 4913 |
'email', |
| 4914 |
'date', |
| 4915 |
'time', |
| 4916 |
'date_time', |
| 4917 |
); |
| 4918 |
|
| 4919 |
$submissions_count = 0; |
| 4920 |
if(intval($submission_count_and_ids['submission_count']) > 0){ |
| 4921 |
$submissions_count = $submission_count_and_ids['submission_count']; |
| 4922 |
} |
| 4923 |
|
| 4924 |
$export_disabled = 'disabled'; |
| 4925 |
if( $submissions_count > 0 ){ |
| 4926 |
$export_disabled = ''; |
| 4927 |
} |
| 4928 |
|
| 4929 |
$survey_data_clipboard = array( |
| 4930 |
"user_name" => $individual_user_name, |
| 4931 |
"user_email" => $individual_user_email, |
| 4932 |
"user_ip" => $individual_user_ip, |
| 4933 |
"user_date" => $individual_user_date, |
| 4934 |
"user_sub_id" => $individual_user_sub_id, |
| 4935 |
"user_device_type" => $individual_user_device_type, |
| 4936 |
); |
| 4937 |
|
| 4938 |
if($individual_user_password){ |
| 4939 |
$survey_data_clipboard['user_password'] = $individual_user_password; |
| 4940 |
} |
| 4941 |
|
| 4942 |
$survey_data_formated_for_clipboard = Survey_Maker_Data::ays_survey_copy_text_formater($survey_data_clipboard); |
| 4943 |
|
| 4944 |
|
| 4945 |
Survey_Maker_Data::get_template_part( 'partials/submissions/partials/survey-maker-each-submission-individual', '', get_defined_vars() ); |
| 4946 |
|
| 4947 |
$wpdb->get_var("UPDATE " . $wpdb->prefix . SURVEY_MAKER_DB_PREFIX . "submissions SET `read`= 1 WHERE `id`= $submission_id"); |
| 4948 |
|
| 4949 |
$html = ob_get_clean(); |
| 4950 |
|
| 4951 |
echo json_encode( array( |
| 4952 |
'status' => true, |
| 4953 |
'rows' => $html |
| 4954 |
) ); |
| 4955 |
wp_die(); |
| 4956 |
} |
| 4957 |
|
| 4958 |
echo json_encode( array( |
| 4959 |
'status' => false, |
| 4960 |
'rows' => "" |
| 4961 |
) ); |
| 4962 |
|
| 4963 |
} |
| 4964 |
|
| 4965 |
public function ays_survey_author_user_search() { |
| 4966 |
$content_text = array( |
| 4967 |
'results' => array() |
| 4968 |
); |
| 4969 |
|
| 4970 |
if( current_user_can( 'manage_options' ) ){ |
| 4971 |
$search = isset($_REQUEST['search']) && $_REQUEST['search'] != '' ? sanitize_text_field( $_REQUEST['search'] ) : null; |
| 4972 |
$checked = isset($_REQUEST['val']) && $_REQUEST['val'] !='' ? sanitize_text_field( $_REQUEST['val'] ) : null; |
| 4973 |
|
| 4974 |
$args = 'search='; |
| 4975 |
if($search !== null){ |
| 4976 |
$args .= '*'; |
| 4977 |
$args .= $search; |
| 4978 |
$args .= '*'; |
| 4979 |
} |
| 4980 |
|
| 4981 |
$users = get_users($args); |
| 4982 |
|
| 4983 |
foreach ($users as $key => $value) { |
| 4984 |
if ($checked !== null) { |
| 4985 |
if ( !is_array( $checked ) ) { |
| 4986 |
$checked2 = $checked; |
| 4987 |
$checked = array(); |
| 4988 |
$checked[] = absint($checked2); |
| 4989 |
} |
| 4990 |
if (in_array($value->ID, $checked)) { |
| 4991 |
continue; |
| 4992 |
}else{ |
| 4993 |
$content_text['results'][] = array( |
| 4994 |
'id' => $value->ID, |
| 4995 |
'text' => $value->data->display_name, |
| 4996 |
); |
| 4997 |
} |
| 4998 |
}else{ |
| 4999 |
$content_text['results'][] = array( |
| 5000 |
'id' => $value->ID, |
| 5001 |
'text' => $value->data->display_name, |
| 5002 |
); |
| 5003 |
} |
| 5004 |
} |
| 5005 |
} |
| 5006 |
|
| 5007 |
ob_end_clean(); |
| 5008 |
echo json_encode($content_text); |
| 5009 |
wp_die(); |
| 5010 |
} |
| 5011 |
|
| 5012 |
// public function ays_survey_subscribe_email(){ |
| 5013 |
// $subscribe_email = isset($_REQUEST['email']) && $_REQUEST['email'] != "" ? sanitize_email($_REQUEST['email']) : ""; |
| 5014 |
// $subscribe_website = isset($_REQUEST['website']) && $_REQUEST['website'] != "" ? sanitize_url($_REQUEST['website']) : ""; |
| 5015 |
// // $url = "http://localhost/survey-grab-gift/"; |
| 5016 |
// $url = "https://ays-pro.com/add-on-email/survey-grab-gift/"; |
| 5017 |
// if($subscribe_email != "" && $subscribe_website != ''){ |
| 5018 |
// $current_date = date("Y-m-d"); |
| 5019 |
// $current_user_ip = Survey_Maker_Data::get_user_ip(); |
| 5020 |
// $send_request = wp_remote_post($url, array( |
| 5021 |
// 'headers' => array("Content-Type: application/json; charset=UTF-8"), |
| 5022 |
// 'body' => json_encode( array( |
| 5023 |
// "email" => $subscribe_email, |
| 5024 |
// "website" => $subscribe_website, |
| 5025 |
// "user_ip" => $current_user_ip, |
| 5026 |
// "subscirbe_date" => $current_date |
| 5027 |
// ) ), |
| 5028 |
// ) ); |
| 5029 |
// $response = wp_remote_retrieve_body($send_request); |
| 5030 |
// $response = json_decode($response, true); |
| 5031 |
// if(isset($response) && is_array($response)){ |
| 5032 |
// $response_code = isset($response['code']) && $response['code'] != "" ? $response['code'] : ""; |
| 5033 |
// $response_message = isset($response['msg']) && $response['msg'] != "" ? $response['msg'] : ""; |
| 5034 |
// $response_status = $response_code > 0 ? true : false; |
| 5035 |
// echo json_encode(array( |
| 5036 |
// "status" => $response_code, |
| 5037 |
// "message" => $response_message |
| 5038 |
// )); |
| 5039 |
// wp_die(); |
| 5040 |
// } |
| 5041 |
// else{ |
| 5042 |
// echo json_encode(array( |
| 5043 |
// "status" => false, |
| 5044 |
// "message" => "Something went wrong. Please try again" |
| 5045 |
// )); |
| 5046 |
// wp_die(); |
| 5047 |
// } |
| 5048 |
// } |
| 5049 |
// } |
| 5050 |
|
| 5051 |
/** |
| 5052 |
* Check if plugin can be installed |
| 5053 |
*/ |
| 5054 |
public function ays_survey_can_install($plugin_slug) { |
| 5055 |
if (!function_exists('get_plugins')) { |
| 5056 |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 5057 |
} |
| 5058 |
|
| 5059 |
$plugins = get_plugins(); |
| 5060 |
foreach ($plugins as $plugin_file => $plugin_data) { |
| 5061 |
if (strpos($plugin_file, $plugin_slug) !== false) { |
| 5062 |
return false; // Plugin already exists |
| 5063 |
} |
| 5064 |
} |
| 5065 |
return true; // Plugin can be installed |
| 5066 |
} |
| 5067 |
|
| 5068 |
/** |
| 5069 |
* Check if plugin can be activated |
| 5070 |
*/ |
| 5071 |
public function ays_survey_can_activate($plugin_slug) { |
| 5072 |
if (!function_exists('get_plugins')) { |
| 5073 |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 5074 |
} |
| 5075 |
|
| 5076 |
$plugins = get_plugins(); |
| 5077 |
foreach ($plugins as $plugin_file => $plugin_data) { |
| 5078 |
if (strpos($plugin_file, $plugin_slug) !== false) { |
| 5079 |
return !is_plugin_active($plugin_file); // Can activate if not already active |
| 5080 |
} |
| 5081 |
} |
| 5082 |
return false; // Plugin doesn't exist |
| 5083 |
} |
| 5084 |
|
| 5085 |
/** |
| 5086 |
* Install plugin via AJAX |
| 5087 |
*/ |
| 5088 |
public function ays_survey_install_plugin() { |
| 5089 |
if (!current_user_can('install_plugins')) { |
| 5090 |
wp_die(json_encode(array('success' => false, 'message' => 'Insufficient permissions'))); |
| 5091 |
} |
| 5092 |
|
| 5093 |
if (!wp_verify_nonce($_POST['nonce'], 'ajax-nonce')) { |
| 5094 |
wp_die(json_encode(array('success' => false, 'message' => 'Security check failed'))); |
| 5095 |
} |
| 5096 |
|
| 5097 |
$plugin_slug = sanitize_text_field($_POST['plugin_slug']); |
| 5098 |
|
| 5099 |
if (!function_exists('plugins_api')) { |
| 5100 |
require_once ABSPATH . 'wp-admin/includes/plugin-install.php'; |
| 5101 |
} |
| 5102 |
if (!class_exists('WP_Upgrader')) { |
| 5103 |
require_once ABSPATH . 'wp-admin/includes/class-wp-upgrader.php'; |
| 5104 |
} |
| 5105 |
|
| 5106 |
$api = plugins_api('plugin_information', array('slug' => $plugin_slug)); |
| 5107 |
|
| 5108 |
if (is_wp_error($api)) { |
| 5109 |
wp_die(json_encode(array('success' => false, 'message' => esc_html__('Plugin not found')))); |
| 5110 |
} |
| 5111 |
|
| 5112 |
$upgrader = new Plugin_Upgrader(new WP_Ajax_Upgrader_Skin()); |
| 5113 |
$result = $upgrader->install($api->download_link); |
| 5114 |
|
| 5115 |
if ($result) { |
| 5116 |
// Load plugin.php for get_plugins() and activate_plugin() if not loaded yet |
| 5117 |
if ( ! function_exists( 'get_plugins' ) ) { |
| 5118 |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 5119 |
} |
| 5120 |
|
| 5121 |
// Clear plugins cache to ensure the newly installed plugin is visible |
| 5122 |
if ( function_exists( 'wp_clean_plugins_cache' ) ) { |
| 5123 |
wp_clean_plugins_cache(); |
| 5124 |
} |
| 5125 |
|
| 5126 |
$plugins = get_plugins(); |
| 5127 |
$plugin_file = ''; |
| 5128 |
|
| 5129 |
foreach ( $plugins as $file => $plugin_data ) { |
| 5130 |
if ( strpos( $file, $plugin_slug ) !== false ) { |
| 5131 |
$plugin_file = $file; |
| 5132 |
break; |
| 5133 |
} |
| 5134 |
} |
| 5135 |
|
| 5136 |
if ( empty( $plugin_file ) ) { |
| 5137 |
wp_die( json_encode( array( 'success' => false, 'message' => esc_html__('Plugin main file not found')) ) ); |
| 5138 |
} |
| 5139 |
|
| 5140 |
// Ensure activate_plugin() is available |
| 5141 |
if ( ! function_exists( 'activate_plugin' ) ) { |
| 5142 |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 5143 |
} |
| 5144 |
|
| 5145 |
$activate = activate_plugin( $plugin_file ); |
| 5146 |
|
| 5147 |
if ( is_wp_error( $activate ) ) { |
| 5148 |
wp_die( json_encode( array( 'success' => false, 'message' => $activate->get_error_message() ) ) ); |
| 5149 |
} |
| 5150 |
|
| 5151 |
wp_die( json_encode( array( 'success' => true, 'message' => esc_html__('Plugin installed and activated successfully')) ) ); |
| 5152 |
|
| 5153 |
} else { |
| 5154 |
wp_die(json_encode(array('success' => false, 'message' => esc_html__('Installation failed')))); |
| 5155 |
} |
| 5156 |
} |
| 5157 |
|
| 5158 |
/** |
| 5159 |
* Activate plugin via AJAX |
| 5160 |
*/ |
| 5161 |
public function ays_survey_activate_plugin() { |
| 5162 |
if (!current_user_can('activate_plugins')) { |
| 5163 |
wp_die(json_encode(array('success' => false, 'message' => esc_html__('Insufficient permissions')))); |
| 5164 |
} |
| 5165 |
|
| 5166 |
if (!wp_verify_nonce($_POST['nonce'], 'ajax-nonce')) { |
| 5167 |
wp_die(json_encode(array('success' => false, 'message' => esc_html__('Security check failed')))); |
| 5168 |
} |
| 5169 |
|
| 5170 |
$plugin_slug = sanitize_text_field($_POST['plugin_slug']); |
| 5171 |
|
| 5172 |
if (!function_exists('get_plugins')) { |
| 5173 |
require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
| 5174 |
} |
| 5175 |
|
| 5176 |
$plugins = get_plugins(); |
| 5177 |
$plugin_file = ''; |
| 5178 |
|
| 5179 |
foreach ($plugins as $file => $plugin_data) { |
| 5180 |
if (strpos($file, $plugin_slug) !== false) { |
| 5181 |
$plugin_file = $file; |
| 5182 |
break; |
| 5183 |
} |
| 5184 |
} |
| 5185 |
|
| 5186 |
if (empty($plugin_file)) { |
| 5187 |
wp_die(json_encode(array('success' => false, 'message' => esc_html__('Plugin not found')))); |
| 5188 |
} |
| 5189 |
|
| 5190 |
$result = activate_plugin($plugin_file); |
| 5191 |
|
| 5192 |
if (is_wp_error($result)) { |
| 5193 |
wp_die(json_encode(array('success' => false, 'message' => $result->get_error_message()))); |
| 5194 |
} else { |
| 5195 |
wp_die(json_encode(array('success' => true, 'message' => esc_html__('Plugin activated successfully')))); |
| 5196 |
} |
| 5197 |
} |
| 5198 |
|
| 5199 |
/** |
| 5200 |
* Get AYS plugins data |
| 5201 |
*/ |
| 5202 |
public function get_am_plugins() { |
| 5203 |
return array( |
| 5204 |
'quiz-maker' => array( |
| 5205 |
'name' => 'Quiz Maker', |
| 5206 |
'slug' => 'quiz-maker', |
| 5207 |
'description' => 'Create engaging quizzes with multiple question types' |
| 5208 |
), |
| 5209 |
'poll-maker' => array( |
| 5210 |
'name' => 'Poll Maker', |
| 5211 |
'slug' => 'poll-maker', |
| 5212 |
'description' => 'Build interactive polls for your audience' |
| 5213 |
), |
| 5214 |
'popup-box' => array( |
| 5215 |
'name' => 'Popup Box', |
| 5216 |
'slug' => 'ays-popup-box', |
| 5217 |
'description' => 'Create beautiful popups and modals' |
| 5218 |
), |
| 5219 |
'gallery-photo-gallery' => array( |
| 5220 |
'name' => 'Gallery Photo Gallery', |
| 5221 |
'slug' => 'gallery-photo-gallery', |
| 5222 |
'description' => 'Showcase your photos in stunning galleries' |
| 5223 |
), |
| 5224 |
'secure-copy-content-protection' => array( |
| 5225 |
'name' => 'Secure Copy Content Protection', |
| 5226 |
'slug' => 'secure-copy-content-protection', |
| 5227 |
'description' => 'Protect your content from copying' |
| 5228 |
), |
| 5229 |
'ays-chatgpt-assistant' => array( |
| 5230 |
'name' => 'ChatGPT Assistant', |
| 5231 |
'slug' => 'ays-chatgpt-assistant', |
| 5232 |
'description' => 'AI-powered chat assistant for your website' |
| 5233 |
), |
| 5234 |
'personal-dictionary' => array( |
| 5235 |
'name' => 'Personal Dictionary', |
| 5236 |
'slug' => 'personal-dictionary', |
| 5237 |
'description' => 'Create and manage custom dictionaries' |
| 5238 |
), |
| 5239 |
'chartify' => array( |
| 5240 |
'name' => 'Chartify', |
| 5241 |
'slug' => 'chart-builder', |
| 5242 |
'description' => 'Build beautiful charts and graphs' |
| 5243 |
) |
| 5244 |
); |
| 5245 |
} |
| 5246 |
|
| 5247 |
public function ays_survey_disable_all_notice_from_plugin() { |
| 5248 |
if (!function_exists('get_current_screen')) { |
| 5249 |
return; |
| 5250 |
} |
| 5251 |
|
| 5252 |
$screen = get_current_screen(); |
| 5253 |
|
| 5254 |
if (empty($screen) || strpos($screen->id, $this->plugin_name) === false) { |
| 5255 |
return; |
| 5256 |
} |
| 5257 |
|
| 5258 |
global $wp_filter; |
| 5259 |
|
| 5260 |
// Keep plugin-specific notices |
| 5261 |
$our_plugin_notices = array(); |
| 5262 |
|
| 5263 |
$exclude_functions = [ |
| 5264 |
'survey_maker_general_admin_notice', |
| 5265 |
]; |
| 5266 |
|
| 5267 |
if (!empty($wp_filter['admin_notices'])) { |
| 5268 |
foreach ($wp_filter['admin_notices']->callbacks as $priority => $callbacks) { |
| 5269 |
foreach ($callbacks as $key => $callback) { |
| 5270 |
// For class-based methods |
| 5271 |
if ( |
| 5272 |
is_array($callback['function']) && |
| 5273 |
is_object($callback['function'][0]) && |
| 5274 |
get_class($callback['function'][0]) === __CLASS__ |
| 5275 |
) { |
| 5276 |
$our_plugin_notices[$priority][$key] = $callback; |
| 5277 |
} |
| 5278 |
// For standalone functions |
| 5279 |
elseif ( |
| 5280 |
is_string($callback['function']) && |
| 5281 |
in_array($callback['function'], $exclude_functions) |
| 5282 |
) { |
| 5283 |
$our_plugin_notices[$priority][$key] = $callback; |
| 5284 |
} |
| 5285 |
} |
| 5286 |
} |
| 5287 |
} |
| 5288 |
|
| 5289 |
// Remove all notices |
| 5290 |
remove_all_actions('admin_notices'); |
| 5291 |
remove_all_actions('all_admin_notices'); |
| 5292 |
|
| 5293 |
// Re-add only your plugin's notices |
| 5294 |
foreach ($our_plugin_notices as $priority => $callbacks) { |
| 5295 |
foreach ($callbacks as $callback) { |
| 5296 |
add_action('admin_notices', $callback['function'], $priority); |
| 5297 |
} |
| 5298 |
} |
| 5299 |
} |
| 5300 |
|
| 5301 |
public function ays_survey_black_friady_popup_box(){ |
| 5302 |
if(!empty($_REQUEST['page']) && sanitize_text_field( $_REQUEST['page'] ) != $this->plugin_name . "-admin-dashboard"){ |
| 5303 |
if(false !== strpos( sanitize_text_field( $_REQUEST['page'] ), $this->plugin_name)){ |
| 5304 |
|
| 5305 |
$flag = true; |
| 5306 |
|
| 5307 |
if( isset($_COOKIE['aysSurveyBlackFridayPopupCount']) && intval($_COOKIE['aysSurveyBlackFridayPopupCount']) >= 2 ){ |
| 5308 |
$flag = false; |
| 5309 |
} |
| 5310 |
|
| 5311 |
$ays_survey_cta_button_link = esc_url('https://ays-pro.com/mega-bundle?utm_source=dashboard&utm_medium=survey-free&utm_campaign=mega-bundle-popup-black-friday-sale-' . SURVEY_MAKER_VERSION); |
| 5312 |
|
| 5313 |
if( $flag ){ |
| 5314 |
?> |
| 5315 |
<div class="ays-survey-black-friday-popup-overlay" style="opacity: 0; visibility: hidden; display: none;"> |
| 5316 |
<div class="ays-survey-black-friday-popup-dialog"> |
| 5317 |
<div class="ays-survey-black-friday-popup-content"> |
| 5318 |
<div class="ays-survey-black-friday-popup-background-pattern"> |
| 5319 |
<div class="ays-survey-black-friday-popup-pattern-row"> |
| 5320 |
<div class="ays-survey-black-friday-popup-pattern-text">SALE SALE SALE</div> |
| 5321 |
<div class="ays-survey-black-friday-popup-pattern-text">SALE SALE SALE</div> |
| 5322 |
</div> |
| 5323 |
<div class="ays-survey-black-friday-popup-pattern-row"> |
| 5324 |
<div class="ays-survey-black-friday-popup-pattern-text">SALE SALE SALE</div> |
| 5325 |
<div class="ays-survey-black-friday-popup-pattern-text">SALE SALE SALE</div> |
| 5326 |
</div> |
| 5327 |
<div class="ays-survey-black-friday-popup-pattern-row"> |
| 5328 |
<div class="ays-survey-black-friday-popup-pattern-text">SALE SALE SALE</div> |
| 5329 |
<div class="ays-survey-black-friday-popup-pattern-text">SALE SALE SALE</div> |
| 5330 |
</div> |
| 5331 |
<div class="ays-survey-black-friday-popup-pattern-row"> |
| 5332 |
<div class="ays-survey-black-friday-popup-pattern-text">SALE SALE SALE</div> |
| 5333 |
<div class="ays-survey-black-friday-popup-pattern-text">SALE SALE SALE</div> |
| 5334 |
</div> |
| 5335 |
</div> |
| 5336 |
|
| 5337 |
<button class="ays-survey-black-friday-popup-close" aria-label="Close"> |
| 5338 |
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"> |
| 5339 |
<path d="M18 6 6 18"></path> |
| 5340 |
<path d="m6 6 12 12"></path> |
| 5341 |
</svg> |
| 5342 |
</button> |
| 5343 |
|
| 5344 |
<div class="ays-survey-black-friday-popup-badge"> |
| 5345 |
<div class="ays-survey-black-friday-popup-badge-content"> |
| 5346 |
<div class="ays-survey-black-friday-popup-badge-text-sm"><?php echo esc_html__( 'Up to', 'survey-maker' ); ?></div> |
| 5347 |
<div class="ays-survey-black-friday-popup-badge-text-lg">50%</div> |
| 5348 |
<div class="ays-survey-black-friday-popup-badge-text-md"><?php echo esc_html__( 'OFF', 'survey-maker' ); ?></div> |
| 5349 |
</div> |
| 5350 |
</div> |
| 5351 |
|
| 5352 |
<div class="ays-survey-black-friday-popup-main-content"> |
| 5353 |
<div class="ays-survey-black-friday-popup-hashtag"><?php echo esc_html__( '#BLACKFRIDAY', 'survey-maker' ); ?></div> |
| 5354 |
<h1 class="ays-survey-black-friday-popup-title-mega"><?php echo esc_html__( 'MEGA', 'survey-maker' ); ?></h1> |
| 5355 |
<h1 class="ays-survey-black-friday-popup-title-bundle"><?php echo esc_html__( 'BUNDLE', 'survey-maker' ); ?></h1> |
| 5356 |
<div class="ays-survey-black-friday-popup-offer-label"> |
| 5357 |
<h2 class="ays-survey-black-friday-popup-offer-text"><?php echo esc_html__( 'BLACK FRIDAY OFFER', 'survey-maker' ); ?></h2> |
| 5358 |
</div> |
| 5359 |
<p class="ays-survey-black-friday-popup-description"><?php echo esc_html__( 'Get our exclusive plugins in one bundle', 'survey-maker' ); ?></p> |
| 5360 |
<a href="<?php echo esc_url($ays_survey_cta_button_link); ?>" target="_blank" class="ays-survey-black-friday-popup-cta-btn"><?php echo esc_html__( 'Get Mega Bundle', 'survey-maker' ); ?></a> |
| 5361 |
</div> |
| 5362 |
</div> |
| 5363 |
</div> |
| 5364 |
</div> |
| 5365 |
<script type="text/javascript"> |
| 5366 |
(function() { |
| 5367 |
var overlay = document.querySelector('.ays-survey-black-friday-popup-overlay'); |
| 5368 |
var closeBtn = document.querySelector('.ays-survey-black-friday-popup-close'); |
| 5369 |
var learnMoreBtn = document.querySelector('.ays-survey-black-friday-popup-learn-more'); |
| 5370 |
var ctaBtn = document.querySelector('.ays-survey-black-friday-popup-cta-btn'); |
| 5371 |
|
| 5372 |
// Cookie helper functions |
| 5373 |
function setCookie(name, value, days) { |
| 5374 |
var expires = ""; |
| 5375 |
if (days) { |
| 5376 |
var date = new Date(); |
| 5377 |
date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000)); |
| 5378 |
expires = "; expires=" + date.toUTCString(); |
| 5379 |
} |
| 5380 |
document.cookie = name + "=" + (value || "") + expires + "; path=/"; |
| 5381 |
} |
| 5382 |
|
| 5383 |
function getCookie(name) { |
| 5384 |
var nameEQ = name + "="; |
| 5385 |
var ca = document.cookie.split(';'); |
| 5386 |
for (var i = 0; i < ca.length; i++) { |
| 5387 |
var c = ca[i]; |
| 5388 |
while (c.charAt(0) == ' ') c = c.substring(1, c.length); |
| 5389 |
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length, c.length); |
| 5390 |
} |
| 5391 |
return null; |
| 5392 |
} |
| 5393 |
|
| 5394 |
// Get current show count from cookie |
| 5395 |
var showCount = parseInt(getCookie('aysSurveyBlackFridayPopupCount') || '0', 10); |
| 5396 |
var maxShows = 2; |
| 5397 |
|
| 5398 |
// Show popup function |
| 5399 |
function showPopup() { |
| 5400 |
if (overlay && showCount < maxShows) { |
| 5401 |
overlay.classList.add('ays-survey-black-friday-popup-active'); |
| 5402 |
showCount++; |
| 5403 |
// Update cookie with new count (expires in 30 days) |
| 5404 |
setCookie('aysSurveyBlackFridayPopupCount', showCount.toString(), 30); |
| 5405 |
} |
| 5406 |
} |
| 5407 |
|
| 5408 |
// Close popup function |
| 5409 |
function closePopup(e) { |
| 5410 |
if (e) { |
| 5411 |
e.preventDefault(); |
| 5412 |
e.stopPropagation(); |
| 5413 |
} |
| 5414 |
if (overlay) { |
| 5415 |
overlay.classList.remove('ays-survey-black-friday-popup-active'); |
| 5416 |
} |
| 5417 |
} |
| 5418 |
|
| 5419 |
// Determine timing based on show count |
| 5420 |
if (showCount === 0) { |
| 5421 |
// First time - show after 30 seconds |
| 5422 |
setTimeout(function() { |
| 5423 |
showPopup(); |
| 5424 |
}, 30000); |
| 5425 |
} else if (showCount === 1) { |
| 5426 |
// Second time - show after 200 seconds |
| 5427 |
setTimeout(function() { |
| 5428 |
showPopup(); |
| 5429 |
}, 200000); |
| 5430 |
} |
| 5431 |
// If showCount >= 2, don't show popup at all |
| 5432 |
|
| 5433 |
// Close button |
| 5434 |
if (closeBtn) { |
| 5435 |
closeBtn.addEventListener('click', function(e) { |
| 5436 |
closePopup(e); |
| 5437 |
}); |
| 5438 |
} |
| 5439 |
|
| 5440 |
// Learn more button |
| 5441 |
if (learnMoreBtn) { |
| 5442 |
learnMoreBtn.addEventListener('click', function(e) { |
| 5443 |
closePopup(e); |
| 5444 |
}); |
| 5445 |
} |
| 5446 |
|
| 5447 |
// CTA button (optional - if you want it to close popup too) |
| 5448 |
if (ctaBtn) { |
| 5449 |
ctaBtn.addEventListener('click', function(e) { |
| 5450 |
// You can add redirect logic here if needed |
| 5451 |
// window.location.href = 'your-url'; |
| 5452 |
}); |
| 5453 |
} |
| 5454 |
|
| 5455 |
// Close on overlay click |
| 5456 |
if (overlay) { |
| 5457 |
overlay.addEventListener('click', function(e) { |
| 5458 |
if (e.target === overlay) { |
| 5459 |
closePopup(e); |
| 5460 |
} |
| 5461 |
}); |
| 5462 |
} |
| 5463 |
|
| 5464 |
// Close on Escape key |
| 5465 |
document.addEventListener('keydown', function(e) { |
| 5466 |
if (e.key === 'Escape' && overlay && overlay.classList.contains('ays-survey-black-friday-popup-active')) { |
| 5467 |
closePopup(); |
| 5468 |
} |
| 5469 |
}); |
| 5470 |
})(); |
| 5471 |
</script> |
| 5472 |
<style> |
| 5473 |
.ays-survey-black-friday-popup-overlay{position:fixed;top:0;left:0;right:0;bottom:0;z-index:9999;background-color:rgba(0,0,0,.8);display:flex;align-items:center;justify-content:center;opacity:0;visibility:hidden;transition:opacity .2s,visibility .2s}.ays-survey-black-friday-popup-overlay.ays-survey-black-friday-popup-active{display:flex!important;opacity:1!important;visibility:visible!important}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-dialog{position:relative;max-width:470px;width:100%;border-radius:8px;overflow:hidden;background:0 0;box-shadow:0 25px 50px -12px rgba(0,0,0,.25);transform:scale(.95);transition:transform .2s}.ays-survey-black-friday-popup-overlay.ays-survey-black-friday-popup-active .ays-survey-black-friday-popup-dialog{transform:scale(1)}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-content{position:relative;width:470px;height:410px;background:linear-gradient(to right bottom,#c056f5,#f042f0,#7d7de8);overflow:hidden}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-background-pattern{position:absolute;top:0;left:0;right:0;bottom:0;opacity:.07;pointer-events:none;transform:rotate(-12deg) translateY(32px);overflow:hidden}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-pattern-row{display:flex;gap:16px;margin-bottom:16px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-pattern-text{color:#fff;font-weight:900;font-size:96px;white-space:nowrap;line-height:1}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-close{position:absolute;top:16px;right:16px;z-index:9999;background:0 0;border:none;color:rgba(255,255,255,.8);cursor:pointer;padding:4px;transition:color .2s;line-height:0}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-close:hover,.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-learn-more:hover{color:#fff}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge{position:absolute;top:32px;right:32px;width:96px;height:96px;background-color:#d4fc79;border-radius:50%;display:flex;align-items:center;justify-content:center;box-shadow:0 25px 50px -12px rgba(0,0,0,.25);animation:3s ease-in-out infinite ays-survey-black-friday-popup-float}@keyframes ays-survey-black-friday-popup-float{0%,100%{transform:translateY(0)}50%{transform:translateY(-10px)}}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-content{text-align:center}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-sm{color:#1a1a1a;font-weight:900;font-size:24px;line-height:1}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-lg{color:#1a1a1a;font-weight:900;font-size:30px;line-height:1;margin-top:4px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-md{color:#1a1a1a;font-weight:900;font-size:20px;line-height:1}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-main-content{position:relative;z-index:10;height:100%;display:flex;flex-direction:column;align-items:center;justify-content:center;padding:0 48px;text-align:center}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-hashtag{color:rgba(255,255,255,.9);font-weight:700;font-size:14px;margin-bottom:16px;letter-spacing:.1em}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-title-mega{color:#fff;font-weight:900;font-size:60px;line-height:1;margin:0 0 12px;text-shadow:0 4px 6px rgba(0,0,0,.1)}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-title-bundle{color:#fff;font-weight:900;font-size:60px;line-height:1;margin:0 0 24px;text-shadow:0 4px 6px rgba(0,0,0,.1)}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-offer-label{background-color:#000;padding:12px 32px;margin-bottom:24px;display:inline-block}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-offer-text{color:#fff;font-weight:700;font-size:20px;letter-spacing:.05em;margin:0}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-description{color:rgba(255,255,255,.95);font-size:18px;font-weight:500;margin:0 0 32px!important}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-cta-btn{display:inline-flex;align-items:center;justify-content:center;height:48px;background-color:#fff;color:#a855f7;font-size:18px;font-weight:700;border:none;border-radius:24px;padding:0 40px;cursor:pointer;box-shadow:0 20px 25px -5px rgba(0,0,0,.1);transition:.2s;text-decoration:none}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-cta-btn:hover{background-color:rgba(255,255,255,.9);box-shadow:0 25px 50px -12px rgba(0,0,0,.25);transform:scale(1.05)}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-learn-more{background:0 0;border:none;color:rgba(255,255,255,.9);font-size:14px;text-decoration:underline;text-underline-offset:4px;cursor:pointer;padding:8px;margin-top:16px;transition:color .2s}@media (max-width:768px){.ays-survey-black-friday-popup-overlay{display:none!important}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-content{width:90vw;max-width:400px;height:380px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-main-content{padding:0 32px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge{width:80px;height:80px;top:24px;right:24px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-sm{font-size:20px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-lg{font-size:26px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-md,.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-offer-text{font-size:18px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-title-bundle,.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-title-mega{font-size:48px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-description{font-size:16px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-pattern-text{font-size:72px}}@media (max-width:480px){.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-content{width:95vw;max-width:340px;height:360px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-main-content{padding:0 24px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge{width:70px;height:70px;top:20px;right:20px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-sm,.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-offer-text{font-size:16px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-lg{font-size:22px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-badge-text-md{font-size:14px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-hashtag{font-size:12px;margin-bottom:12px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-title-bundle,.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-title-mega{font-size:40px;margin-bottom:8px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-offer-label{padding:10px 24px;margin-bottom:20px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-description{font-size:15px;margin-bottom:24px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-cta-btn{font-size:16px;height:44px;padding:0 32px}.ays-survey-black-friday-popup-overlay .ays-survey-black-friday-popup-pattern-text{font-size:60px}} |
| 5474 |
</style> |
| 5475 |
<?php |
| 5476 |
} |
| 5477 |
} |
| 5478 |
} |
| 5479 |
} |
| 5480 |
} |
| 5481 |
|