| 1 |
<?php |
| 2 |
|
| 3 |
/** |
| 4 |
* The file that defines the core plugin class |
| 5 |
* |
| 6 |
* A class definition that includes attributes and functions used across both the |
| 7 |
* public-facing side of the site and the admin area. |
| 8 |
* |
| 9 |
* @link https://ays-pro.com/ |
| 10 |
* @since 1.0.0 |
| 11 |
* |
| 12 |
* @package Survey_Maker |
| 13 |
* @subpackage Survey_Maker/includes |
| 14 |
*/ |
| 15 |
|
| 16 |
/** |
| 17 |
* The core plugin class. |
| 18 |
* |
| 19 |
* This is used to define internationalization, admin-specific hooks, and |
| 20 |
* public-facing site hooks. |
| 21 |
* |
| 22 |
* Also maintains the unique identifier of this plugin as well as the current |
| 23 |
* version of the plugin. |
| 24 |
* |
| 25 |
* @since 1.0.0 |
| 26 |
* @package Survey_Maker |
| 27 |
* @subpackage Survey_Maker/includes |
| 28 |
* @author Survey Maker team <[email protected]> |
| 29 |
*/ |
| 30 |
class Survey_Maker { |
| 31 |
|
| 32 |
/** |
| 33 |
* The loader that's responsible for maintaining and registering all hooks that power |
| 34 |
* the plugin. |
| 35 |
* |
| 36 |
* @since 1.0.0 |
| 37 |
* @access protected |
| 38 |
* @var Survey_Maker_Loader $loader Maintains and registers all hooks for the plugin. |
| 39 |
*/ |
| 40 |
protected $loader; |
| 41 |
|
| 42 |
/** |
| 43 |
* The unique identifier of this plugin. |
| 44 |
* |
| 45 |
* @since 1.0.0 |
| 46 |
* @access protected |
| 47 |
* @var string $plugin_name The string used to uniquely identify this plugin. |
| 48 |
*/ |
| 49 |
protected $plugin_name; |
| 50 |
|
| 51 |
/** |
| 52 |
* The current version of the plugin. |
| 53 |
* |
| 54 |
* @since 1.0.0 |
| 55 |
* @access protected |
| 56 |
* @var string $version The current version of the plugin. |
| 57 |
*/ |
| 58 |
protected $version; |
| 59 |
|
| 60 |
/** |
| 61 |
* Define the core functionality of the plugin. |
| 62 |
* |
| 63 |
* Set the plugin name and the plugin version that can be used throughout the plugin. |
| 64 |
* Load the dependencies, define the locale, and set the hooks for the admin area and |
| 65 |
* the public-facing side of the site. |
| 66 |
* |
| 67 |
* @since 1.0.0 |
| 68 |
*/ |
| 69 |
public function __construct() { |
| 70 |
if ( defined( 'SURVEY_MAKER_VERSION' ) ) { |
| 71 |
$this->version = SURVEY_MAKER_VERSION; |
| 72 |
} else { |
| 73 |
$this->version = '1.0.0'; |
| 74 |
} |
| 75 |
$this->plugin_name = 'survey-maker'; |
| 76 |
|
| 77 |
$this->load_dependencies(); |
| 78 |
$this->set_locale(); |
| 79 |
$this->define_admin_hooks(); |
| 80 |
$this->define_public_hooks(); |
| 81 |
$this->define_integrations_hooks(); |
| 82 |
$this->define_custom_post_type_hooks(); |
| 83 |
|
| 84 |
} |
| 85 |
|
| 86 |
/** |
| 87 |
* Load the required dependencies for this plugin. |
| 88 |
* |
| 89 |
* Include the following files that make up the plugin: |
| 90 |
* |
| 91 |
* - Survey_Maker_Loader. Orchestrates the hooks of the plugin. |
| 92 |
* - Survey_Maker_i18n. Defines internationalization functionality. |
| 93 |
* - Survey_Maker_Admin. Defines all hooks for the admin area. |
| 94 |
* - Survey_Maker_Public. Defines all hooks for the public side of the site. |
| 95 |
* |
| 96 |
* Create an instance of the loader which will be used to register the hooks |
| 97 |
* with WordPress. |
| 98 |
* |
| 99 |
* @since 1.0.0 |
| 100 |
* @access private |
| 101 |
*/ |
| 102 |
private function load_dependencies() { |
| 103 |
|
| 104 |
if ( ! class_exists( 'WP_List_Table' ) ) { |
| 105 |
require_once( ABSPATH . 'wp-admin/includes/class-wp-list-table.php' ); |
| 106 |
} |
| 107 |
|
| 108 |
/** |
| 109 |
* The class responsible for orchestrating the actions and filters of the |
| 110 |
* core plugin. |
| 111 |
*/ |
| 112 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-survey-maker-loader.php'; |
| 113 |
|
| 114 |
/** |
| 115 |
* The class responsible for defining internationalization functionality |
| 116 |
* of the plugin. |
| 117 |
*/ |
| 118 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-survey-maker-i18n.php'; |
| 119 |
|
| 120 |
/** |
| 121 |
* The class responsible for defining all actions that occur in the admin area. |
| 122 |
*/ |
| 123 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/class-survey-maker-admin.php'; |
| 124 |
|
| 125 |
// /** |
| 126 |
// * The class responsible for showing Poll Maker Welcome page. |
| 127 |
// */ |
| 128 |
// require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-survey-maker-ays-welcome.php'; |
| 129 |
/** |
| 130 |
* The class responsible for showing Quiz Maker Feedback popup. |
| 131 |
*/ |
| 132 |
require_once plugin_dir_path(dirname(__FILE__)) . 'includes/class-survey-maker-feedback.php'; |
| 133 |
|
| 134 |
/** |
| 135 |
* The class responsible for defining all actions that occur in the public-facing |
| 136 |
* side of the site. |
| 137 |
*/ |
| 138 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/class-survey-maker-public.php'; |
| 139 |
|
| 140 |
/** |
| 141 |
* The class responsible for extra shortcodes on the front page |
| 142 |
* side of the site. |
| 143 |
*/ |
| 144 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/partials/class-survey-maker-extra-shortcode.php'; |
| 145 |
|
| 146 |
/* |
| 147 |
* The class is responsible for showing surveys in wordpress default WP_LIST_TABLE style |
| 148 |
*/ |
| 149 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/lists/class-survey-maker-surveys-list-table.php'; |
| 150 |
|
| 151 |
/* |
| 152 |
* The class is responsible for showing popup surveys in wordpress default WP_LIST_TABLE style |
| 153 |
*/ |
| 154 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/lists/class-survey-maker-popup-survey-list-table.php'; |
| 155 |
|
| 156 |
/* |
| 157 |
* The class is responsible for showing survey categories in wordpress default WP_LIST_TABLE style |
| 158 |
*/ |
| 159 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/lists/class-survey-maker-survey-categories-list-table.php'; |
| 160 |
|
| 161 |
/* |
| 162 |
* The class is responsible for showing survey submissions in wordpress default WP_LIST_TABLE style |
| 163 |
*/ |
| 164 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/lists/class-survey-maker-submissions-list-table.php'; |
| 165 |
|
| 166 |
/* |
| 167 |
* The class is responsible for showing each survey submissions in wordpress default WP_LIST_TABLE style |
| 168 |
*/ |
| 169 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/lists/class-survey-maker-each-submission-list-table.php'; |
| 170 |
|
| 171 |
/* |
| 172 |
* The class is responsible for showing front requests in wordpress default WP_LIST_TABLE style |
| 173 |
*/ |
| 174 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/lists/class-survey-maker-front-requests-list-table.php'; |
| 175 |
|
| 176 |
/* |
| 177 |
* The class is responsible for showing survey submissions in wordpress default WP_LIST_TABLE style |
| 178 |
*/ |
| 179 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'admin/partials/settings/survey-maker-settings-actions.php'; |
| 180 |
|
| 181 |
/** |
| 182 |
* The class responsible for defining all functions for getting all survey data |
| 183 |
*/ |
| 184 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-survey-maker-data.php'; |
| 185 |
|
| 186 |
/** |
| 187 |
* The class responsible for defining all functions for getting all custom post type functions |
| 188 |
*/ |
| 189 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-survey-maker-custom-post-type.php'; |
| 190 |
|
| 191 |
/** |
| 192 |
* The class responsible for defining all functions for getting all survey integrations |
| 193 |
*/ |
| 194 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'includes/class-survey-maker-integrations.php'; |
| 195 |
|
| 196 |
|
| 197 |
/** |
| 198 |
* The class responsible for defining all functions for generating General Settings shorcodes content |
| 199 |
*/ |
| 200 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/partials/class-survey-maker-submissions-summary-shortcode.php'; |
| 201 |
|
| 202 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/partials/class-survey-maker-most-popular-shortcode.php'; |
| 203 |
|
| 204 |
require_once plugin_dir_path( dirname( __FILE__ ) ) . 'public/partials/class-survey-maker-survey-links-by-category.php'; |
| 205 |
|
| 206 |
|
| 207 |
$this->loader = new Survey_Maker_Loader(); |
| 208 |
|
| 209 |
} |
| 210 |
|
| 211 |
/** |
| 212 |
* Define the locale for this plugin for internationalization. |
| 213 |
* |
| 214 |
* Uses the Survey_Maker_i18n class in order to set the domain and to register the hook |
| 215 |
* with WordPress. |
| 216 |
* |
| 217 |
* @since 1.0.0 |
| 218 |
* @access private |
| 219 |
*/ |
| 220 |
private function set_locale() { |
| 221 |
|
| 222 |
$plugin_i18n = new Survey_Maker_i18n(); |
| 223 |
|
| 224 |
$this->loader->add_action( 'plugins_loaded', $plugin_i18n, 'load_plugin_textdomain' ); |
| 225 |
|
| 226 |
} |
| 227 |
|
| 228 |
/** |
| 229 |
* Register all of the hooks related to the admin area functionality |
| 230 |
* of the plugin. |
| 231 |
* |
| 232 |
* @since 1.0.0 |
| 233 |
* @access private |
| 234 |
*/ |
| 235 |
private function define_admin_hooks() { |
| 236 |
|
| 237 |
$plugin_admin = new Survey_Maker_Admin( $this->get_plugin_name(), $this->get_version() ); |
| 238 |
|
| 239 |
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_styles' ); |
| 240 |
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'enqueue_scripts' ); |
| 241 |
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'disable_scripts', 100 ); |
| 242 |
$this->loader->add_filter( 'admin_body_class', $plugin_admin, 'ays_survey_add_body_class' ); |
| 243 |
$this->loader->add_action( 'admin_head', $plugin_admin, 'admin_menu_styles' ); |
| 244 |
|
| 245 |
// Add menu item |
| 246 |
$this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_admin_menu' ); |
| 247 |
$this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_admin_dashboard_menu', 10 ); |
| 248 |
$this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_surveys_submenu', 90 ); |
| 249 |
$this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_survey_categories_submenu', 95 ); |
| 250 |
// $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_survey_front_requests_submenu', 100 ); |
| 251 |
// $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_questions_categories_submenu', 100 ); |
| 252 |
$this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_submissions_submenu', 105 ); |
| 253 |
$this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_export_import_submenu', 110 ); |
| 254 |
$this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_general_settings_submenu', 115 ); |
| 255 |
$this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_dashboard_submenu', 125 ); |
| 256 |
$this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_featured_plugins_submenu', 135 ); |
| 257 |
// $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_survey_features_plugins_submenu', 140 ); |
| 258 |
// $this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_subscribe_email', 140 ); |
| 259 |
$this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_survey_features_plugins_submenu', 145 ); |
| 260 |
|
| 261 |
// Pro |
| 262 |
$this->loader->add_action( 'admin_menu', $plugin_admin, 'add_plugin_popup_surveys_submenu', 100 ); |
| 263 |
|
| 264 |
$this->loader->add_action( 'wp_ajax_ays_survey_submission_report', $plugin_admin, 'ays_survey_submission_report' ); |
| 265 |
$this->loader->add_action( 'wp_ajax_nopriv_ays_survey_submission_report', $plugin_admin, 'ays_survey_submission_report' ); |
| 266 |
|
| 267 |
// Deactivate plugin AJAx action |
| 268 |
$this->loader->add_action( 'wp_ajax_deactivate_plugin_option_sm', $plugin_admin, 'deactivate_plugin_option' ); |
| 269 |
$this->loader->add_action( 'wp_ajax_nopriv_deactivate_plugin_option_sm', $plugin_admin, 'deactivate_plugin_option' ); |
| 270 |
|
| 271 |
// Live preview |
| 272 |
$this->loader->add_action( 'wp_ajax_ays_survey_maker_live_preview_content', $plugin_admin, 'ays_survey_maker_live_preview_content' ); |
| 273 |
$this->loader->add_action( 'wp_ajax_nopriv_ays_survey_maker_live_preview_content', $plugin_admin, 'ays_survey_maker_live_preview_content' ); |
| 274 |
|
| 275 |
// Live preview |
| 276 |
$this->loader->add_action( 'wp_ajax_ays_survey_show_results', $plugin_admin, 'ays_survey_show_results' ); |
| 277 |
$this->loader->add_action( 'wp_ajax_nopriv_ays_survey_show_results', $plugin_admin, 'ays_survey_show_results' ); |
| 278 |
|
| 279 |
// Live preview |
| 280 |
$this->loader->add_action( 'wp_ajax_ays_survey_add_survey_template', $plugin_admin, 'ays_survey_add_survey_template' ); |
| 281 |
$this->loader->add_action( 'wp_ajax_nopriv_ays_survey_add_survey_template', $plugin_admin, 'ays_survey_add_survey_template' ); |
| 282 |
|
| 283 |
$this->loader->add_action( 'wp_ajax_ays_survey_author_user_search', $plugin_admin, 'ays_survey_author_user_search' ); |
| 284 |
$this->loader->add_action( 'wp_ajax_nopriv_ays_survey_author_user_search', $plugin_admin, 'ays_survey_author_user_search' ); |
| 285 |
|
| 286 |
// Install and activate plugin AJAX actions |
| 287 |
$this->loader->add_action('wp_ajax_ays_survey_install_plugin', $plugin_admin, 'ays_survey_install_plugin'); |
| 288 |
$this->loader->add_action('wp_ajax_ays_survey_activate_plugin', $plugin_admin, 'ays_survey_activate_plugin'); |
| 289 |
|
| 290 |
// Grab your gift |
| 291 |
// $this->loader->add_action( 'wp_ajax_ays_survey_subscribe_email', $plugin_admin, 'ays_survey_subscribe_email' ); |
| 292 |
// $this->loader->add_action( 'wp_ajax_nopriv_ays_survey_subscribe_email', $plugin_admin, 'ays_survey_subscribe_email' ); |
| 293 |
|
| 294 |
// Add Settings link to the plugin |
| 295 |
$plugin_basename = plugin_basename( plugin_dir_path( __DIR__ ) . $this->plugin_name . '.php' ); |
| 296 |
$this->loader->add_filter( 'plugin_action_links_' . $plugin_basename, $plugin_admin, 'add_action_links' ); |
| 297 |
|
| 298 |
// CodeMirror Editor |
| 299 |
$this->loader->add_action( 'admin_enqueue_scripts', $plugin_admin, 'codemirror_enqueue_scripts'); |
| 300 |
|
| 301 |
$this->loader->add_action( 'in_admin_footer', $plugin_admin, 'survey_maker_admin_footer', 1 ); |
| 302 |
// $this->loader->add_action( 'in_admin_footer', $plugin_admin, 'ays_survey_black_friady_popup_box', 10 ); |
| 303 |
|
| 304 |
$this->loader->add_action( 'elementor/widgets/widgets_registered', $plugin_admin, 'survey_maker_el_widgets_registered' ); |
| 305 |
|
| 306 |
// $this->loader->add_action( 'elementor/editor/before_enqueue_scripts', $plugin_admin, 'sm_enqueue_elementor_styles' ); |
| 307 |
|
| 308 |
// Add aditional links to the plugin |
| 309 |
$this->loader->add_filter( 'plugin_row_meta', $plugin_admin, 'add_survey_row_meta' , 10 , 2 ); |
| 310 |
|
| 311 |
// Sale Banner |
| 312 |
// $this->loader->add_action( 'admin_notices', $plugin_admin, 'ays_survey_sale_baner', 15 ); |
| 313 |
$this->loader->add_action( 'ays_survey_sale_banner', $plugin_admin, 'ays_survey_sale_baner', 15 ); |
| 314 |
|
| 315 |
// Disable all notices from other plugins |
| 316 |
$this->loader->add_action('current_screen', $plugin_admin, 'ays_survey_disable_all_notice_from_plugin', 200, 1); |
| 317 |
|
| 318 |
} |
| 319 |
|
| 320 |
/** |
| 321 |
* Register all of the hooks related to the public-facing functionality |
| 322 |
* of the plugin. |
| 323 |
* |
| 324 |
* @since 1.0.0 |
| 325 |
* @access private |
| 326 |
*/ |
| 327 |
private function define_public_hooks() { |
| 328 |
|
| 329 |
$plugin_public = new Survey_Maker_Public( $this->get_plugin_name(), $this->get_version() ); |
| 330 |
|
| 331 |
// $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles' ); |
| 332 |
// $this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_scripts' ); |
| 333 |
$plugin_public_submissions_summary = new Survey_Maker_Submissions_Summary( $this->get_plugin_name(), $this->get_version() ); |
| 334 |
$plugin_public_extra_shortcodes = new Ays_Survey_Maker_Extra_Shortcodes_Public( $this->get_plugin_name(), $this->get_version() ); |
| 335 |
$plugin_public_most_popular_shortcodes = new Ays_Survey_Maker_Most_Popular_Shortcodes_Public( $this->get_plugin_name(), $this->get_version() ); |
| 336 |
$plugin_public_survey_links_by_category_shortcodes = new Ays_Survey_Maker_Links_By_Category_Shortcodes_Public( $this->get_plugin_name(), $this->get_version() ); |
| 337 |
$this->loader->add_action( 'wp_enqueue_scripts', $plugin_public, 'enqueue_styles_early' ); |
| 338 |
|
| 339 |
$this->loader->add_action( 'wp_footer', $plugin_public, 'ays_shortcodes_show_all'); |
| 340 |
|
| 341 |
// Public AJAX action |
| 342 |
$this->loader->add_action( 'wp_ajax_ays_survey_ajax', $plugin_public, 'ays_survey_ajax' ); |
| 343 |
$this->loader->add_action( 'wp_ajax_nopriv_ays_survey_ajax', $plugin_public, 'ays_survey_ajax' ); |
| 344 |
|
| 345 |
} |
| 346 |
|
| 347 |
/** |
| 348 |
* Register all of the hooks related to the integrations functionality |
| 349 |
* of the plugin. |
| 350 |
* |
| 351 |
* @since 1.0.0 |
| 352 |
* @access private |
| 353 |
*/ |
| 354 |
private function define_integrations_hooks() { |
| 355 |
|
| 356 |
$plugin_integrations = new Survey_Maker_Integrations( $this->get_plugin_name(), $this->get_version() ); |
| 357 |
|
| 358 |
// Survey Maker Integrations / survey page |
| 359 |
$this->loader->add_action( 'ays_sm_survey_page_integrations', $plugin_integrations, 'ays_survey_page_integrations_content' ); |
| 360 |
|
| 361 |
// Survey Maker Integrations / settings page |
| 362 |
$this->loader->add_action( 'ays_sm_settings_page_integrations', $plugin_integrations, 'ays_settings_page_integrations_content' ); |
| 363 |
|
| 364 |
// ===== MailChimp integration ==== |
| 365 |
// MailChimp integration / survey page |
| 366 |
$this->loader->add_filter( 'ays_sm_survey_page_integrations_contents', $plugin_integrations, 'ays_survey_page_mailchimp_content', 1, 2 ); |
| 367 |
|
| 368 |
// MailChimp integration / settings page |
| 369 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_mailchimp_content', 1, 2 ); |
| 370 |
|
| 371 |
// ===== Campaign Monitor integration ===== |
| 372 |
// Campaign Monitor integration / survey page |
| 373 |
$this->loader->add_filter( 'ays_sm_survey_page_integrations_contents', $plugin_integrations, 'ays_survey_page_camp_monitor_content', 1, 2 ); |
| 374 |
|
| 375 |
// Campaign Monitor integration / settings page |
| 376 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_campaign_monitor_content', 1, 2 ); |
| 377 |
|
| 378 |
// ===== Zapier integration ===== |
| 379 |
// Zapier integration / survey page |
| 380 |
$this->loader->add_filter( 'ays_sm_survey_page_integrations_contents', $plugin_integrations, 'ays_survey_page_zapier_content', 1, 2 ); |
| 381 |
|
| 382 |
// Zapier integration / settings page |
| 383 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_zapier_content', 1, 2 ); |
| 384 |
|
| 385 |
// ===== Active Campaign integration ===== |
| 386 |
// Active Campaign integration / survey page |
| 387 |
$this->loader->add_filter( 'ays_sm_survey_page_integrations_contents', $plugin_integrations, 'ays_survey_page_active_camp_content', 1, 2 ); |
| 388 |
|
| 389 |
// Active Campaign integration / settings page |
| 390 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_active_camp_content', 1, 2 ); |
| 391 |
|
| 392 |
// ===== Slack integration ===== |
| 393 |
// Slack integration / survey page |
| 394 |
$this->loader->add_filter( 'ays_sm_survey_page_integrations_contents', $plugin_integrations, 'ays_survey_page_slack_content', 1, 2 ); |
| 395 |
|
| 396 |
// Slack integration / settings page |
| 397 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_slack_content', 1, 2 ); |
| 398 |
|
| 399 |
// ===== Google integration ===== |
| 400 |
// Google integration / survey page |
| 401 |
$this->loader->add_filter( 'ays_sm_survey_page_integrations_contents', $plugin_integrations, 'ays_survey_page_google_sheet_content', 1, 2 ); |
| 402 |
|
| 403 |
// Google integration / settings page |
| 404 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_google_content', 1, 2 ); |
| 405 |
|
| 406 |
// ===== GamiPress integration ===== |
| 407 |
// GamiPress integration / settings page |
| 408 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_gamipress_content', 80, 2 ); |
| 409 |
// ===== GamiPress integration ===== |
| 410 |
|
| 411 |
// ===== SendGrid integration ===== |
| 412 |
// SendGrid integration / settings page |
| 413 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_sendgrid_content', 70, 2 ); |
| 414 |
// ===== SendGrid integration ===== |
| 415 |
|
| 416 |
// ===== Madmimi integration ===== |
| 417 |
// Madmimi integration / settings page |
| 418 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_mad_mimi_content', 90, 2 ); |
| 419 |
// Madmimi integration / survey page |
| 420 |
$this->loader->add_filter( 'ays_sm_survey_page_integrations_contents', $plugin_integrations, 'ays_survey_page_mad_mimi_content', 1, 2 ); |
| 421 |
// ===== Madmimi integration ===== |
| 422 |
|
| 423 |
// ===== GetResponse integration ===== |
| 424 |
// GetResponse integration / settings page |
| 425 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_get_response_content', 100, 2 ); |
| 426 |
// GetResponse integration / survey page |
| 427 |
$this->loader->add_filter( 'ays_sm_survey_page_integrations_contents', $plugin_integrations, 'ays_survey_page_get_response_content', 1, 2 ); |
| 428 |
// ===== GetResponse integration ===== |
| 429 |
|
| 430 |
// ===== ConvertKit integration ===== |
| 431 |
// ConvertKit integration / settings page |
| 432 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_convert_kit_content', 110, 2 ); |
| 433 |
// ConvertKit integration / survey page |
| 434 |
$this->loader->add_filter( 'ays_sm_survey_page_integrations_contents', $plugin_integrations, 'ays_survey_page_convert_kit_content', 1, 2 ); |
| 435 |
// ===== ConvertKit integration ===== |
| 436 |
|
| 437 |
// ===== Brevo integration ===== |
| 438 |
// Brevo integration / settings page |
| 439 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_sendinblue_content', 115, 2 ); |
| 440 |
// Brevo integration / survey page |
| 441 |
$this->loader->add_filter( 'ays_sm_survey_page_integrations_contents', $plugin_integrations, 'ays_survey_page_sendinblue_content', 1, 2 ); |
| 442 |
// ===== Brevo integration ===== |
| 443 |
|
| 444 |
// // ===== PayPal integration ==== |
| 445 |
// PayPal integration / settings page |
| 446 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_PayPal_content', 125, 2 ); |
| 447 |
|
| 448 |
// PayPal integration / survey page |
| 449 |
$this->loader->add_filter( 'ays_sm_survey_page_integrations_contents', $plugin_integrations, 'ays_survey_page_PayPal_content', 125, 2 ); |
| 450 |
// // ===== PayPal integration ==== |
| 451 |
|
| 452 |
// // ===== Stripe integration ==== |
| 453 |
// Stripe integration / settings page |
| 454 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_Stripe_content', 130, 2 ); |
| 455 |
|
| 456 |
// Stripe integration / survey page |
| 457 |
$this->loader->add_filter( 'ays_sm_survey_page_integrations_contents', $plugin_integrations, 'ays_survey_page_Stripe_content', 130, 2 ); |
| 458 |
// // ===== Stripe integration ==== |
| 459 |
|
| 460 |
// // ===== reCAPTCHA integration ==== |
| 461 |
// reCAPTCHA integration / settings page |
| 462 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_recaptcha_content', 135, 2 ); |
| 463 |
|
| 464 |
// reCAPTCHA integration / survey page |
| 465 |
$this->loader->add_filter( 'ays_sm_survey_page_integrations_contents', $plugin_integrations, 'ays_survey_page_recaptcha_content', 135, 2 ); |
| 466 |
// // ===== reCAPTCHA integration ==== |
| 467 |
|
| 468 |
// // ===== Aweber integration ==== |
| 469 |
// Aweber integration / settings page |
| 470 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_aweber_settings_page_content', 140, 2 ); |
| 471 |
|
| 472 |
// Aweber integration / survey page |
| 473 |
$this->loader->add_filter( 'ays_sm_survey_page_integrations_contents', $plugin_integrations, 'ays_survey_page_aweber_content', 140, 2 ); |
| 474 |
// // ===== Aweber integration ==== |
| 475 |
|
| 476 |
// // ===== MailPoet integration ==== |
| 477 |
// MailPoet integration / settings page |
| 478 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_mailpoet_content', 145, 2 ); |
| 479 |
|
| 480 |
// MailPoet integration / survey page |
| 481 |
$this->loader->add_filter( 'ays_sm_survey_page_integrations_contents', $plugin_integrations, 'ays_survey_page_mailpoet_content', 145, 2 ); |
| 482 |
// // ===== MailPoet integration ==== |
| 483 |
|
| 484 |
// // ===== MyCred integration ==== |
| 485 |
// MyCred integration / settings page |
| 486 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_mycred_settings_page_content', 150, 2 ); |
| 487 |
// // ===== MyCred integration ==== |
| 488 |
|
| 489 |
// // ===== Klaviyo integration ==== |
| 490 |
// Klaviyo integration / settings page |
| 491 |
$this->loader->add_filter( 'ays_sm_settings_page_integrations_contents', $plugin_integrations, 'ays_settings_page_klaviyo_content', 155, 2 ); |
| 492 |
|
| 493 |
// Klaviyo integration / survey page |
| 494 |
$this->loader->add_filter( 'ays_sm_survey_page_integrations_contents', $plugin_integrations, 'ays_survey_page_klaviyo_content', 155, 2 ); |
| 495 |
// // ===== Klaviyo integration ==== |
| 496 |
|
| 497 |
|
| 498 |
} |
| 499 |
|
| 500 |
private function define_custom_post_type_hooks(){ |
| 501 |
$plugin_custom_post_type = new Survey_Maker_Custom_Post_Type( $this->get_plugin_name(), $this->get_version() ); |
| 502 |
} |
| 503 |
|
| 504 |
/** |
| 505 |
* Run the loader to execute all of the hooks with WordPress. |
| 506 |
* |
| 507 |
* @since 1.0.0 |
| 508 |
*/ |
| 509 |
public function run() { |
| 510 |
$this->loader->run(); |
| 511 |
} |
| 512 |
|
| 513 |
/** |
| 514 |
* The name of the plugin used to uniquely identify it within the context of |
| 515 |
* WordPress and to define internationalization functionality. |
| 516 |
* |
| 517 |
* @since 1.0.0 |
| 518 |
* @return string The name of the plugin. |
| 519 |
*/ |
| 520 |
public function get_plugin_name() { |
| 521 |
return $this->plugin_name; |
| 522 |
} |
| 523 |
|
| 524 |
/** |
| 525 |
* The reference to the class that orchestrates the hooks with the plugin. |
| 526 |
* |
| 527 |
* @since 1.0.0 |
| 528 |
* @return Survey_Maker_Loader Orchestrates the hooks of the plugin. |
| 529 |
*/ |
| 530 |
public function get_loader() { |
| 531 |
return $this->loader; |
| 532 |
} |
| 533 |
|
| 534 |
/** |
| 535 |
* Retrieve the version number of the plugin. |
| 536 |
* |
| 537 |
* @since 1.0.0 |
| 538 |
* @return string The version number of the plugin. |
| 539 |
*/ |
| 540 |
public function get_version() { |
| 541 |
return $this->version; |
| 542 |
} |
| 543 |
|
| 544 |
} |
| 545 |
|