PluginProbe
Poll Maker by AYS – Versus Polls, Anonymous Polls, Image Polls / 5.6.0
Poll Maker by AYS – Versus Polls, Anonymous Polls, Image Polls v5.6.0
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 5.6.6 All 153 releases
poll-maker / poll-maker-ays.php

poll-maker-ays.php in Poll Maker by AYS – Versus Polls, Anonymous Polls, Image Polls 5.6.0, at poll-maker-ays.php

200 lines 8.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 ob_start();
3 /**
4 * The plugin bootstrap file
5 *
6 * This file is read by WordPress to generate the plugin information in the plugin
7 * admin area. This file also includes all of the dependencies used by the plugin,
8 * registers the activation and deactivation functions, and defines a function
9 * that starts the plugin.
10 *
11 * @link https://ays-pro.com/
12 * @since 1.0.0
13 * @package Poll_Maker_Ays
14 *
15 * @wordpress-plugin
16 * Plugin Name: Poll Maker
17 * Plugin URI: https://ays-pro.com/wordpress/poll-maker/
18 * Description: Create amazing online polls and conduct interactive elections super easily and quickly.
19 * Version: 5.6.0
20 * Author: Poll Maker Team
21 * Author URI: https://ays-pro.com/
22 * License: GPL-2.0+
23 * License URI: http://www.gnu.org/licenses/gpl-2.0.txt
24 * Text Domain: poll-maker
25 * Domain Path: /languages
26 */
27
28 // If this file is called directly, abort.
29 if (!defined('WPINC')) {
30 die;
31 }
32
33 /**
34 * Currently plugin version.
35 * Start at version 1.0.0 and use SemVer - https://semver.org
36 * Rename this for your plugin and update it as you release new versions.
37 */
38 define('POLL_MAKER_AYS_VERSION', '5.6.0');
39 define('POLL_MAKER_AYS_NAME', 'poll-maker-ays');
40
41 if (!defined('POLL_MAKER_AYS_DIR')) {
42 define('POLL_MAKER_AYS_DIR', plugin_dir_path(__FILE__));
43 }
44
45 if (!defined('POLL_MAKER_AYS_BASE_URL')) {
46 define('POLL_MAKER_AYS_BASE_URL', plugin_dir_url(__FILE__));
47 }
48 if (!defined('POLL_MAKER_AYS_ADMIN_URL')) {
49 define('POLL_MAKER_AYS_ADMIN_URL', plugin_dir_url(__FILE__) . 'admin');
50 }
51
52 if (!defined('POLL_MAKER_AYS_PUBLIC_URL')) {
53 define('POLL_MAKER_AYS_PUBLIC_URL', plugin_dir_url(__FILE__) . 'public');
54 }
55
56 if( ! defined( 'POLL_MAKER_AYS_BASENAME' ) ) {
57 define( 'POLL_MAKER_AYS_BASENAME', plugin_basename( __FILE__ ) );
58 }
59
60 /**
61 * The code that runs during plugin activation.
62 * This action is documented in includes/class-poll-maker-ays-activator.php
63 */
64 function activate_poll_maker_ays() {
65 require_once plugin_dir_path(__FILE__) . 'includes/class-poll-maker-ays-activator.php';
66 Poll_Maker_Ays_Activator::ays_poll_update_db_check();
67 }
68
69 /**
70 * The code that runs during plugin deactivation.
71 * This action is documented in includes/class-poll-maker-ays-deactivator.php
72 */
73 function deactivate_poll_maker_ays() {
74 require_once plugin_dir_path(__FILE__) . 'includes/class-poll-maker-ays-deactivator.php';
75 Poll_Maker_Ays_Deactivator::deactivate();
76 }
77
78 register_activation_hook(__FILE__, 'activate_poll_maker_ays');
79 register_deactivation_hook(__FILE__, 'deactivate_poll_maker_ays');
80
81 add_action('plugins_loaded', 'activate_poll_maker_ays');
82 /**
83 * The core plugin class that is used to define internationalization,
84 * admin-specific hooks, and public-facing site hooks.
85 */
86 require plugin_dir_path(__FILE__) . 'includes/class-poll-maker-ays.php';
87
88 /**
89 * The Gutenberg block registration.
90 */
91 require plugin_dir_path(__FILE__) . 'poll/poll-maker-block.php';
92
93
94 if (!function_exists('array_column')) {
95 function array_column( array $array, $columnKey, $indexKey = null ) {
96 $result = array();
97 foreach ( $array as $subArray ) {
98 if (!is_array($subArray)) {
99 continue;
100 } elseif (is_null($indexKey) && array_key_exists($columnKey, $subArray)) {
101 $result[] = $subArray[$columnKey];
102 } elseif (array_key_exists($indexKey, $subArray)) {
103 if (is_null($columnKey)) {
104 $result[$subArray[$indexKey]] = $subArray;
105 } elseif (array_key_exists($columnKey, $subArray)) {
106 $result[$subArray[$indexKey]] = $subArray[$columnKey];
107 }
108 }
109 }
110
111 return $result;
112 }
113 }
114
115 /**
116 * Begins execution of the plugin.
117 *
118 * Since everything within the plugin is registered via hooks,
119 * then kicking off the plugin from this point in the file does
120 * not affect the page life cycle.
121 *
122 * @since 1.0.0
123 */
124 function run_poll_maker_ays() {
125 add_action('admin_notices', 'poll_maker_admin_notice');
126 $plugin = new Poll_Maker_Ays();
127 $plugin->run();
128
129 }
130
131 function poll_maker_activation_redirect_method( $plugin ) {
132 if( $plugin == plugin_basename( __FILE__ ) ) {
133 exit( wp_redirect( admin_url( 'admin.php?page=' . POLL_MAKER_AYS_NAME ) ) );
134 }
135 }
136
137 function poll_maker_admin_notice() {
138 if (isset($_GET['page']) && strpos($_GET['page'], POLL_MAKER_AYS_NAME) !== false) {
139 ?>
140
141 <div class="ays-notice-banner">
142 <div class="navigation-bar">
143 <div id="navigation-container">
144 <div class="ays-poll-logo-container-upgrade">
145 <div class="logo-container">
146 <a href="https://ays-pro.com/wordpress/poll-maker" target="_blank" style="box-shadow: none;">
147 <img class="poll-logo" src="<?php echo esc_attr(POLL_MAKER_AYS_ADMIN_URL) . '/images/icons/icon-poll-128x128.png'; ?>" alt="<?php echo __( "Poll Maker", "poll-maker" ); ?>" title="<?php echo __( "Poll Maker", "poll-maker" ); ?>"/>
148 </a>
149 </div>
150 <div class="ays-poll-upgrade-container">
151 <a href="https://ays-pro.com/wordpress/poll-maker?utm_source=dashboard&utm_medium=poll-free&utm_campaign=poll-top-banner-upgrade-button" target="_blank" class="poll-maker-upgrade-to-pro">
152 <img src="<?php echo POLL_MAKER_AYS_ADMIN_URL . '/images/icons/lightning-white.svg' ?>" class="poll-maker-upgrade-white-icon">
153 <span><?php echo __( "Upgrade", "poll-maker" ); ?></span>
154 </a>
155 <span class="ays-poll-logo-container-one-time-text"><?php echo __( "One-time payment", "poll-maker" ); ?></span>
156 </div>
157 </div>
158 <ul id="menu">
159 <li class="modile-ddmenu-lg"><a class="ays-btn" href="https://poll-plugin.com/wordpress-poll-plugin-free-demo/" target="_blank">Demo</a></li>
160 <li class="modile-ddmenu-lg"><a class="ays-btn" href="https://wordpress.org/support/plugin/poll-maker/" target="_blank">Free Support</a></li>
161 <li class="modile-ddmenu-xs make_a_suggestion"><a class="ays-btn" href="https://ays-demo.com/poll-maker-plugin-survey/" target="_blank">Make a Suggestion</a></li>
162 <li class="modile-ddmenu-lg"><a class="ays-btn" href="https://wordpress.org/support/plugin/poll-maker/" target="_blank">Contact us</a></li>
163 <li class="modile-ddmenu-md">
164 <a class="toggle_ddmenu" href="javascript:void(0);"><i class="ays_poll_fa ays_fa_ellipsis_h"></i></a>
165 <ul class="ddmenu" data-expanded="false">
166 <li><a class="ays-btn" href="https://poll-plugin.com/wordpress-poll-plugin-free-demo/" target="_blank">Demo</a></li>
167 <li><a class="ays-btn" href="https://wordpress.org/support/plugin/poll-maker/" target="_blank">Free Support</a></li>
168 <li><a class="ays-btn" href="https://wordpress.org/support/plugin/poll-maker/" target="_blank">Contact us</a></li>
169 </ul>
170 </li>
171 <li class="modile-ddmenu-sm">
172 <a class="toggle_ddmenu" href="javascript:void(0);"><i class="ays_poll_fa ays_fa_ellipsis_h"></i></a>
173 <ul class="ddmenu" data-expanded="false">
174 <li><a class="ays-btn" href="https://poll-plugin.com/wordpress-poll-plugin-free-demo/" target="_blank">Demo</a></li>
175 <li><a class="ays-btn" href="https://wordpress.org/support/plugin/poll-maker/" target="_blank">Free Support</a></li>
176 <li class="make_a_suggestion"><a class="ays-btn" href="https://ays-demo.com/poll-maker-plugin-survey/" target="_blank">Make a Suggestion</a></li>
177 <li><a class="ays-btn" href="https://wordpress.org/support/plugin/poll-maker/" target="_blank">Contact us</a></li>
178 </ul>
179 </li>
180 </ul>
181 </div>
182 </div>
183 </div>
184
185 <!-- Ask a question box start -->
186 <div class="ays_ask_question_content">
187 <div class="ays_ask_question_content_inner">
188 <a href="https://wordpress.org/support/plugin/poll-maker" class="ays_poll_question_link" target="_blank">
189 <span class="ays-ask-question-content-inner-question-mark-text">?</span>
190 <span class="ays-ask-question-content-inner-hidden-text">Ask a question</span>
191 </a>
192 </div>
193 </div>
194 <!-- Ask a question box end -->
195
196 <?php
197 }
198 }
199
200 run_poll_maker_ays();