PluginProbe
Poll Maker by AYS – Versus Polls, Anonymous Polls, Image Polls / 6.5.1
Poll Maker by AYS – Versus Polls, Anonymous Polls, Image Polls v6.5.1
6.5.1 6.5.0 6.4.9 6.4.8 6.4.7 6.4.6 6.4.5 6.4.4 6.4.3 6.4.2 6.4.1 6.4.0 6.3.9 6.3.8 6.3.7 6.3.6 6.3.5 6.3.4 6.3.3 5.6.0 5.6.1 5.6.2 5.6.3 5.6.4 5.6.5 All 154 releases
← All changes | admin/class-poll-maker-ays-admin.php +122 -14 6.4.2 → 6.5.1 View file →
@@ -159,8 +159,9 @@
159 159 wp_enqueue_style('ays_poll_bootstrap', plugin_dir_url(__FILE__) . 'css/bootstrap.min.css', array(), $this->version, 'all');
160 160 wp_enqueue_style($this->plugin_name.'-jquery-datetimepicker', plugin_dir_url(__FILE__) . 'css/jquery-ui-timepicker-addon.css', array(), $this->version, 'all');
161 161 wp_enqueue_style('ays-poll-select2', plugin_dir_url(__FILE__) . 'css/select2.min.css', array(), $this->version, 'all');
162 162 wp_enqueue_style($this->plugin_name, plugin_dir_url(__FILE__) . 'css/poll-maker-ays-admin.css', array(), $this->version, 'all');
163 + wp_enqueue_style($this->plugin_name . '-banner-all', plugin_dir_url(__FILE__) . 'css/poll-maker-banner-all.css', array(), $this->version, 'all');
163 164 wp_enqueue_style($this->plugin_name.'popup-layer', plugin_dir_url(__FILE__) . 'css/poll-maker-ays-admin-popup-layer.css', array(), $this->version, 'all');
164 165 wp_enqueue_style( $this->plugin_name . '-dropdown', plugin_dir_url(__FILE__) . '/css/dropdown.min.css', array(), $this->version, 'all');
165 166 wp_enqueue_style( $this->plugin_name . '-transition', plugin_dir_url(__FILE__) . '/css/transition.min.css', array(), $this->version, 'all');
166 167
@@ -454,17 +455,30 @@
454 455 }
455 456
456 457 public function add_plugin_admin_menu() {
457 458
459 + $settings_actions = new Poll_Maker_Settings_Actions($this->plugin_name);
460 + $options_setting = $settings_actions->ays_get_setting('options');
461 + $options = ($options_setting === false) ? array() : json_decode(stripcslashes($options_setting), true);
462 + $options = is_array($options) ? $options : array();
463 + $disable_poll_menu_notification = isset($options['poll_disable_poll_menu_notification']) && esc_attr($options['poll_disable_poll_menu_notification']) === 'on';
464 +
465 + $menu_item = 'Poll Maker';
466 + if (!$disable_poll_menu_notification) {
467 + /*
468 + * Check unread results
469 + *
470 + */
471 + global $wpdb;
472 + $sql = "SELECT COUNT(unread) FROM {$wpdb->prefix}ayspoll_reports WHERE unread=1";
473 + $unread_results = $wpdb->get_var($sql);
474 +
475 + if ($unread_results > 0) {
476 + $menu_item .= '<span style="margin-right: 10px;" class="apm-badge badge badge-danger">' . $unread_results . '</span>';
477 + }
478 + }
479 +
458 480 /*
459 - * Check unread results
460 - *
461 - */
462 - global $wpdb;
463 - $sql = "SELECT COUNT(unread) FROM {$wpdb->prefix}ayspoll_reports WHERE unread=1";
464 - $unread_results = $wpdb->get_var($sql);
465 - $show = $unread_results > 0 ? '' : "apm-no-results";
466 - /*
467 481 * Add a settings page for this plugin to the Settings menu.
468 482 *
469 483 * NOTE: Alternative menu locations are available via WordPress administration menu functions.
470 484 *
@@ -471,10 +485,8 @@
471 485 * Administration Menus: http://codex.wordpress.org/Administration_Menus
472 486 *
473 487 */
474 488
475 - $menu_item = ($unread_results == 0) ? 'Poll Maker' : 'Poll Maker' . '<span style="margin-right: 10px;" class="apm-badge badge badge-danger '.$show.'">' . $unread_results . '</span>';
476 -
477 489 $this->capability = $this->poll_maker_capabilities();
478 490 $capability = $this->poll_maker_capabilities();
479 491 $hook_poll = add_menu_page(
480 492 'Poll Maker',
@@ -482,9 +494,9 @@
482 494 $capability,
483 495 $this->plugin_name,
484 496 array($this,'display_plugin_polls_page'),
485 497 esc_url(POLL_MAKER_AYS_ADMIN_URL) . '/images/icons/icon-poll-maker-128x128.svg',
486 - '6.33'
498 + '25.20'
487 499 );
488 500
489 501 add_action("load-$hook_poll", array($this, 'screen_option_polls'));
490 502 add_action("load-$hook_poll", array($this, 'add_tabs'));
@@ -1752,19 +1764,112 @@
1752 1764 $ays_poll_flag += intval(get_option('ays_poll_sale_btn_'.$sale));
1753 1765 $ays_poll_flag += $ays_poll_two_months_flag;
1754 1766 if($ays_poll_flag == 0){
1755 1767 $ays_poll_sale_message = 'ays_poll_sale_message_'.$sale;
1756 - if ( $this->get_max_id('polls') > 1 ){
1757 1768 // $this->ays_poll_new_halloween_bundle_message_2025();
1758 1769 // $this->ays_poll_black_friday_message();
1759 1770 // $this->ays_poll_christmas_banner_message_2025();
1760 - $this->ays_poll_footer_sale_banner_2026($ays_poll_flag);
1761 - }
1771 + // $this->ays_poll_footer_sale_banner_2026($ays_poll_flag);
1772 + $this->ays_poll_back_to_school_banner_2026($ays_poll_flag);
1762 1773 }
1763 1774 }
1764 1775 }
1765 1776 }
1766 1777 }
1778 +
1779 + // Back to School top banner
1780 + public function ays_poll_back_to_school_banner_2026($ishmar){
1781 + if($ishmar == 0 ){
1782 + $content = array();
1783 + $poll_cta_button_link = esc_url('https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=back-to-school-sale-banner-' . POLL_MAKER_AYS_VERSION);
1784 + $content[] = '<div id="ays-poll-back-to-school-banner-2026" class="ays-poll-back-to-school-banner-2026 ays-poll-admin-notice notice notice-success is-dismissible ays_poll_dicount_info">';
1785 + $content[] = '<svg class="ays-poll-bts-decoration ays-poll-bts-plane" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M22 2 11 13"></path><path d="M22 2 15 22l-4-9-9-4Z"></path></svg>';
1786 + $content[] = '<svg class="ays-poll-bts-decoration ays-poll-bts-ruler" viewBox="0 0 36 20" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" aria-hidden="true"><rect x="1" y="6" width="34" height="9" rx="2"></rect><path d="M8 6v3M14 6v4M20 6v3M26 6v4"></path></svg>';
1787 + $content[] = '<svg class="ays-poll-bts-decoration ays-poll-bts-star" viewBox="0 0 24 24" fill="currentColor" aria-hidden="true"><path d="m12 2 2.6 6.6L21.5 9l-5 4.6 1.4 7-5.9-3.5L6.1 20.6l1.4-7L2.5 9l6.9-.4Z"></path></svg>';
1788 + $content[] = '<svg class="ays-poll-bts-decoration ays-poll-bts-pencil" viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="1.6" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><path d="M12 20h9"></path><path d="M16.5 3.5a2.1 2.1 0 0 1 3 3L7 19l-4 1 1-4Z"></path></svg>';
1789 + $content[] = '<svg class="ays-poll-bts-decoration ays-poll-bts-wave" viewBox="0 0 96 12" fill="none" stroke="currentColor" stroke-width="1.4" stroke-linecap="round" aria-hidden="true"><path d="M2 8c8-8 16 8 24 0s16 8 24 0 16 8 24 0 16 8 20 2"></path></svg>';
1790 + $content[] = '<div class="ays-poll-bts-content">';
1791 + $content[] = '<div class="ays-poll-bts-offer">';
1792 + $content[] = '<img class="ays-poll-bts-handwritten" src="'. esc_url(POLL_MAKER_AYS_ADMIN_URL . '/images/ays-poll-back-to-school-handwritten.svg') .'" alt="Back to School Sale">';
1793 + $content[] = '<span class="ays-poll-bts-dot" aria-hidden="true"></span>';
1794 + $content[] = '<span class="ays-poll-bts-discount">'. esc_html__('20% OFF', 'poll-maker') .'</span>';
1795 + $content[] = '</div>';
1796 + $content[] = '<div class="ays-poll-bts-actions">';
1797 + $content[] = '<span class="ays-poll-bts-use-code">'. esc_html__('Use code', 'poll-maker') .'</span>';
1798 + $content[] = '<button type="button" class="ays-poll-bts-coupon" data-coupon="SCHOOL20" aria-label="'. esc_attr__('Copy coupon code SCHOOL20', 'poll-maker') .'"> <span>SCHOOL20</span><svg viewBox="0 0 24 24" fill="none" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" aria-hidden="true"><rect width="14" height="14" x="8" y="8" rx="2"></rect><path d="M4 16c-1.1 0-2-.9-2-2V4c0-1.1 0-2 2-2h10c1.1 0 2 .9 2 2"></path></svg></button>';
1799 + $content[] = '<a href="'. esc_url($poll_cta_button_link).'" class="ays-poll-bts-cta" target="_blank" rel="noopener noreferrer">'. esc_html__('Upgrade Now', 'poll-maker') .'</a>';
1800 + $content[] = '</div>';
1801 + $content[] = '</div>';
1802 + $content[] = '<div class="ays-poll-bts-dismiss"><form action="" method="POST"><div id="ays-poll-dismiss-buttons-content">';
1803 + if( current_user_can( 'manage_options' ) ){
1804 + $content[] = '<button class="btn btn-link ays-button" name="ays_poll_sale_btn">'. esc_html__('Dismiss ad', 'poll-maker') .'</button>';
1805 + $content[] = wp_nonce_field( POLL_MAKER_AYS_NAME . '-sale-banner', POLL_MAKER_AYS_NAME . '-sale-banner', true, false );
1806 + }
1807 + $content[] = '</div></form></div>';
1808 + $content[] = '</div>';
1809 + $content[] = '<style id="ays-poll-back-to-school-banner-2026-inline-css">';
1810 + $content[] = '#ays-quiz-back-to-school-banner-2026{box-sizing:border-box;position:relative;isolation:isolate;width:calc(100% - 20px);max-width:none;min-height:112px;margin:20px 20px 16px 0;padding:0 38px;overflow:hidden;border:1px solid #e8dcc9;border-left-width:1px;border-radius:12px;background-color:#fffdf8;background-image:radial-gradient(circle at 1px 1px,rgba(91,72,45,.09) 1px,transparent 1px),radial-gradient(120% 140% at 0 0,rgba(20,75,220,.07),transparent 55%),radial-gradient(120% 140% at 100% 100%,rgba(126,34,206,.09),transparent 55%);background-size:6px 6px,100% 100%,100% 100%;box-shadow:0 10px 30px -18px rgba(76,45,140,.55);font-family:-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Oxygen-Sans,Ubuntu,Cantarell,"Helvetica Neue",sans-serif}.ays-quiz-bts-content{position:relative;z-index:2;display:flex;min-height:110px;align-items:center;justify-content:space-between;gap:28px}.ays-quiz-bts-offer,.ays-quiz-bts-actions{display:flex;align-items:center}.ays-quiz-bts-offer{min-width:0;gap:9px}.ays-quiz-bts-handwritten{width:280px;max-width:23vw;height:auto;color:#0755df;overflow:visible;flex:0 1 auto}.ays-quiz-bts-dot{width:7px;height:7px;flex:0 0 auto;border-radius:50%;background:#ffc51b;align-self:flex-start;margin-top:27px}.ays-quiz-bts-discount{color:#8127df;font-size:38px;font-weight:800;line-height:1;letter-spacing:-1.2px;white-space:nowrap}.ays-quiz-bts-actions{flex:0 0 auto;gap:12px}.ays-quiz-bts-use-code{color:#5f5b69;font-size:11px;font-weight:600;line-height:1;text-transform:uppercase;letter-spacing:.14em;white-space:nowrap}.ays-quiz-bts-coupon{box-sizing:border-box;display:flex;min-height:50px;align-items:center;gap:12px;padding:8px 14px;border:2px dashed rgba(129,39,223,.5);border-radius:10px;background:#fff;color:#1147c8;cursor:pointer;box-shadow:none}.ays-quiz-bts-coupon:hover,.ays-quiz-bts-coupon:focus{border-color:#8127df;background:rgba(129,39,223,.05);color:#1147c8}.ays-quiz-bts-coupon span{font-size:19px;font-weight:700;letter-spacing:.04em}.ays-quiz-bts-coupon svg{width:16px;height:16px;color:#8127df}.ays-quiz-bts-cta{display:inline-flex;min-height:48px;align-items:center;justify-content:center;padding:0 27px;border-radius:9px;background:linear-gradient(90deg,#1249e7,#8127df);color:#fff!important;font-size:16px;font-weight:700;text-decoration:none!important;white-space:nowrap;box-shadow:0 8px 18px -8px rgba(91,37,194,.9);transition:transform .15s,box-shadow .15s}.ays-quiz-bts-cta:hover,.ays-quiz-bts-cta:focus{color:#fff;transform:translateY(-1px);box-shadow:0 10px 20px -8px rgba(91,37,194,.95)}.ays-quiz-bts-decoration{position:absolute;z-index:1;pointer-events:none}.ays-quiz-bts-plane{top:8px;left:12px;width:24px;color:rgba(129,39,223,.55)}.ays-quiz-bts-ruler{bottom:7px;left:24px;width:36px;color:rgba(20,73,230,.35)}.ays-quiz-bts-star{top:8px;right:14px;width:19px;color:#ffc51b}.ays-quiz-bts-pencil{right:31px;bottom:7px;width:21px;color:rgba(129,39,223,.5);transform:rotate(-12deg)}.ays-quiz-bts-wave{bottom:3px;left:50%;width:96px;color:rgba(20,73,230,.22);transform:translateX(-50%)}#ays-quiz-back-to-school-banner-2026 .notice-dismiss{top:1px;right:1px;color:#756b82}#ays-quiz-back-to-school-banner-2026 .notice-dismiss:before{font-size:18px}.ays-quiz-bts-dismiss{position:absolute;right:39px;bottom:0;z-index:3}.ays-quiz-bts-dismiss form{margin:0}.ays-quiz-bts-dismiss #ays-quiz-dismiss-buttons-content .ays-button{height:22px!important;min-height:0!important;margin:0!important;padding:0!important;border:0!important;background:transparent!important;color:#777!important;font-size:10px!important;line-height:22px!important;text-decoration:underline;box-shadow:none!important}.ays-quiz-bts-copy-notification{position:fixed;top:50%;left:50%;z-index:10000;transform:translate(-50%,-50%);padding:12px 24px;border-radius:8px;background:rgba(0,0,0,.82);color:#fff;font-size:14px;opacity:0;transition:opacity .25s}.ays-quiz-bts-copy-notification.ays-quiz-bts-show{opacity:1}@media screen and (max-width:1200px){.ays-quiz-bts-content{gap:18px}.ays-quiz-bts-handwritten{width:225px}.ays-quiz-bts-discount{font-size:31px}.ays-quiz-bts-actions{gap:8px}.ays-quiz-bts-coupon{min-height:44px;padding:7px 10px}.ays-quiz-bts-cta{min-height:44px;padding:0 18px;font-size:14px}}@media screen and (max-width:960px){#ays-quiz-back-to-school-banner-2026{padding:15px 38px 20px}.ays-quiz-bts-content{min-height:90px;flex-wrap:wrap;justify-content:center;gap:12px 24px}.ays-quiz-bts-handwritten{max-width:none}.ays-quiz-bts-actions{justify-content:center}.ays-quiz-bts-dismiss{right:38px}}@media screen and (max-width:600px){#ays-quiz-back-to-school-banner-2026{width:calc(100% - 20px);margin-right:10px;padding:18px 30px 23px 18px}.ays-quiz-bts-content{flex-direction:column}.ays-quiz-bts-offer{flex-wrap:wrap;justify-content:center}.ays-quiz-bts-handwritten{width:210px}.ays-quiz-bts-discount{font-size:28px}.ays-quiz-bts-actions{flex-wrap:wrap}.ays-quiz-bts-use-code{width:100%;text-align:center}.ays-quiz-bts-coupon{min-height:40px}.ays-quiz-bts-coupon span{font-size:16px}.ays-quiz-bts-cta{min-height:40px}.ays-quiz-bts-plane,.ays-quiz-bts-ruler,.ays-quiz-bts-pencil,.ays-quiz-bts-wave{display:none}.ays-quiz-bts-dismiss{right:30px}}';
1811 + $content[] = '</style>';
1812 + $content[] = '<script>
1813 + (function() {
1814 + "use strict";
1815 + function initBackToSchoolBanner() {
1816 + var banner = document.getElementById("ays-poll-back-to-school-banner-2026");
1817 + if (!banner) {
1818 + return;
1819 + }
1820 + var couponButton = banner.querySelector(".ays-poll-bts-coupon");
1821 + if (!couponButton) {
1822 + return;
1823 + }
1824 + couponButton.addEventListener("click", function() {
1825 + var couponCode = couponButton.getAttribute("data-coupon");
1826 + var textarea = document.createElement("textarea");
1827 + textarea.value = couponCode;
1828 + textarea.style.position = "fixed";
1829 + textarea.style.opacity = "0";
1830 + document.body.appendChild(textarea);
1831 + textarea.focus();
1832 + textarea.select();
1833 + try {
1834 + document.execCommand("copy");
1835 + showCopyNotification();
1836 + } catch (error) {
1837 + // Keep the banner usable when clipboard access is unavailable.
1838 + }
1839 + document.body.removeChild(textarea);
1840 + });
1841 + }
1842 + function showCopyNotification() {
1843 + var notification = document.createElement("div");
1844 + notification.className = "ays-poll-bts-copy-notification";
1845 + notification.textContent = "'. esc_js(__('Coupon code copied', 'poll-maker')) .'";
1846 + document.body.appendChild(notification);
1847 + setTimeout(function() {
1848 + notification.classList.add("ays-poll-bts-show");
1849 + }, 10);
1850 + setTimeout(function() {
1851 + notification.classList.remove("ays-poll-bts-show");
1852 + setTimeout(function() {
1853 + if (notification.parentNode) {
1854 + notification.parentNode.removeChild(notification);
1855 + }
1856 + }, 250);
1857 + }, 2000);
1858 + }
1859 + if (document.readyState === "loading") {
1860 + document.addEventListener("DOMContentLoaded", initBackToSchoolBanner);
1861 + } else {
1862 + initBackToSchoolBanner();
1863 + }
1864 + })();
1865 + </script>';
1866 +
1867 + echo implode('', $content); // phpcs:ignore WordPress.Security.EscapeOutput.OutputNotEscaped -- Static banner markup; dynamic values are escaped above.
1868 + }
1869 + }
1870 +
1871 +
1767 1872 // Poll Footer Blue Banner Sale 20%
1768 1873 public function ays_poll_footer_sale_banner_2026($ishmar){
1769 1874 if($ishmar == 0 ){
1770 1875 $content = array();
@@ -4830,10 +4935,13 @@
4830 4935 "poll_question_image_height" => "",
4831 4936 "poll_mobile_max_width" => "",
4832 4937 "poll_title_font_size" => "18",
4833 4938 "poll_title_font_size_mobile" => "20",
4939 + "poll_title_font_weight" => "normal",
4940 + "poll_title_font_weight_mobile" => "normal",
4834 4941 "poll_title_alignment" => "center",
4835 4942 "poll_title_alignment_mobile" => "center",
4943 + "poll_title_text_transform" => "none",
4836 4944 "poll_enable_answer_image_after_voting" => "off",
4837 4945 "poll_text_type_length_enable" => "off",
4838 4946 "poll_text_type_limit_type" => "characters",
4839 4947 "poll_text_type_limit_length" => "",