PluginProbe
Order Tracking – WordPress Status Tracking Plugin / 3.2.3
Order Tracking – WordPress Status Tracking Plugin v3.2.3
3.5.4 3.5.3 3.5.2 3.5.1 3.5.0 3.1.2 3.1.3 3.1.4 3.1.5 3.1.6 3.1.7 3.2.0 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.3.0 3.3.1 3.3.10 3.3.11 3.3.12 3.3.13 3.3.14 3.3.15 All 235 releases
order-tracking / order-tracking.php

order-tracking.php in Order Tracking – WordPress Status Tracking Plugin 3.2.3, at order-tracking.php

528 lines 18.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /*
3 Plugin Name: Order Tracking - WordPress Status Tracking Plugin
4 Plugin URI: https://www.etoilewebdesign.com/order-tracking/
5 Description: Order tracking, status and project management plugin that lets you create tickets and tracking numbers and send email updates. Works standalone and with WooCommerce.
6 Author: Etoile Web Design
7 Author URI: https://www.etoilewebdesign.com/
8 Terms and Conditions: https://www.etoilewebdesign.com/plugin-terms-and-conditions/
9 Text Domain: order-tracking
10 Version: 3.2.3
11 WC requires at least: 3.0
12 WC tested up to: 7.2
13 */
14
15
16 if ( ! defined( 'ABSPATH' ) )
17 exit;
18
19 if ( ! class_exists( 'ewdotpInit' ) ) {
20 class ewdotpInit {
21
22 // Any data that needs to be passed from PHP to our JS files
23 public $front_end_php_js_data = array();
24
25 /**
26 * Initialize the plugin and register hooks
27 */
28 public function __construct() {
29
30 self::constants();
31 self::includes();
32 self::instantiate();
33 self::wp_hooks();
34 }
35
36 /**
37 * Define plugin constants.
38 *
39 * @since 3.0.0
40 * @access protected
41 * @return void
42 */
43 protected function constants() {
44
45 define( 'EWD_OTP_PLUGIN_DIR', untrailingslashit( plugin_dir_path( __FILE__ ) ) );
46 define( 'EWD_OTP_PLUGIN_URL', untrailingslashit( plugin_dir_url( __FILE__ ) ) );
47 define( 'EWD_OTP_PLUGIN_FNAME', plugin_basename( __FILE__ ) );
48 define( 'EWD_OTP_TEMPLATE_DIR', 'ewd-otp-templates' );
49 define( 'EWD_OTP_VERSION', '3.2.3' );
50 }
51
52 /**
53 * Include necessary classes.
54 *
55 * @since 3.0.0
56 * @access protected
57 * @return void
58 */
59 protected function includes() {
60
61 require_once( EWD_OTP_PLUGIN_DIR . '/includes/AboutUs.class.php' );
62 require_once( EWD_OTP_PLUGIN_DIR . '/includes/AdminOrders.class.php' );
63 require_once( EWD_OTP_PLUGIN_DIR . '/includes/AdminCustomFields.class.php' );
64 require_once( EWD_OTP_PLUGIN_DIR . '/includes/AdminCustomers.class.php' );
65 require_once( EWD_OTP_PLUGIN_DIR . '/includes/AdminSalesReps.class.php' );
66 require_once( EWD_OTP_PLUGIN_DIR . '/includes/Ajax.class.php' );
67 require_once( EWD_OTP_PLUGIN_DIR . '/includes/Blocks.class.php' );
68 require_once( EWD_OTP_PLUGIN_DIR . '/includes/Customer.class.php' );
69 require_once( EWD_OTP_PLUGIN_DIR . '/includes/CustomerManager.class.php' );
70 require_once( EWD_OTP_PLUGIN_DIR . '/includes/Dashboard.class.php' );
71 require_once( EWD_OTP_PLUGIN_DIR . '/includes/DeactivationSurvey.class.php' );
72 require_once( EWD_OTP_PLUGIN_DIR . '/includes/Export.class.php' );
73 require_once( EWD_OTP_PLUGIN_DIR . '/includes/Helper.class.php' );
74 require_once( EWD_OTP_PLUGIN_DIR . '/includes/Import.class.php' );
75 require_once( EWD_OTP_PLUGIN_DIR . '/includes/InstallationWalkthrough.class.php' );
76 require_once( EWD_OTP_PLUGIN_DIR . '/includes/Notifications.class.php' );
77 require_once( EWD_OTP_PLUGIN_DIR . '/includes/Order.class.php' );
78 require_once( EWD_OTP_PLUGIN_DIR . '/includes/OrderManager.class.php' );
79 require_once( EWD_OTP_PLUGIN_DIR . '/includes/Permissions.class.php' );
80 require_once( EWD_OTP_PLUGIN_DIR . '/includes/ReviewAsk.class.php' );
81 require_once( EWD_OTP_PLUGIN_DIR . '/includes/SalesRep.class.php' );
82 require_once( EWD_OTP_PLUGIN_DIR . '/includes/SalesRepManager.class.php' );
83 require_once( EWD_OTP_PLUGIN_DIR . '/includes/Settings.class.php' );
84 require_once( EWD_OTP_PLUGIN_DIR . '/includes/template-functions.php' );
85 require_once( EWD_OTP_PLUGIN_DIR . '/includes/UltimateWPMail.class.php' );
86 require_once( EWD_OTP_PLUGIN_DIR . '/includes/WooCommerce.class.php' );
87 require_once( EWD_OTP_PLUGIN_DIR . '/includes/Zendesk.class.php' );
88 }
89
90 /**
91 * Spin up instances of our plugin classes.
92 *
93 * @since 3.0.0
94 * @access protected
95 * @return void
96 */
97 protected function instantiate() {
98
99 new ewdotpDashboard();
100 new ewdotpDeactivationSurvey();
101 new ewdotpInstallationWalkthrough();
102 new ewdotpReviewAsk();
103
104 $this->admin_customers = new ewdotpAdminCustomers();
105 $this->admin_custom_fields = new ewdotpAdminCustomFields();
106 $this->admin_orders = new ewdotpAdminOrders();
107 $this->admin_sales_reps = new ewdotpAdminSalesReps();
108 $this->customer_manager = new ewdotpCustomerManager();
109 $this->exports = new ewdotpExport();
110 $this->order_manager = new ewdotpOrderManager();
111 $this->permissions = new ewdotpPermissions();
112 $this->sales_rep_manager = new ewdotpSalesRepManager();
113 $this->settings = new ewdotpSettings();
114
115 if ( $this->settings->get_setting( 'woocommerce-integration' ) ) {
116
117 $this->woocommerce = new ewdotpWooCommerce();
118 }
119
120 if ( $this->settings->get_setting( 'zendesk-integration' ) ) {
121
122 $this->zendesk = new ewdotpZendesk();
123 }
124
125 new ewdotpAJAX();
126 new ewdotpBlocks();
127 new ewdotpImport();
128 new ewdotpNotifications();
129 new ewdotpUltimateWPMail();
130
131 new ewdotpAboutUs();
132 }
133
134 /**
135 * Run walk-through, load assets, add links to plugin listing, etc.
136 *
137 * @since 3.0.0
138 * @access protected
139 * @return void
140 */
141 protected function wp_hooks() {
142
143 register_activation_hook( __FILE__, array( $this, 'run_walkthrough' ) );
144 register_activation_hook( __FILE__, array( $this, 'convert_options' ) );
145 register_activation_hook( __FILE__, array( $this, 'create_default_statuses_and_emails' ) );
146 register_activation_hook( __FILE__, array( $this, 'create_tables' ) );
147
148 register_deactivation_hook( __FILE__, array( $this, 'revert_wc_statuses' ) );
149
150 add_action( 'init', array( $this, 'load_view_files' ) );
151
152 add_action( 'plugins_loaded', array( $this, 'load_textdomain' ) );
153
154 add_action( 'admin_notices', array( $this, 'display_header_area' ) );
155 add_action( 'admin_notices', array( $this, 'maybe_display_helper_notice' ) );
156
157 add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_assets' ), 10, 1 );
158 add_action( 'admin_enqueue_scripts', array( $this, 'register_assets' ) );
159 add_action( 'wp_enqueue_scripts', array( $this, 'register_assets' ) );
160 add_action( 'wp_head', 'ewd_add_frontend_ajax_url' );
161 add_action( 'wp_footer', array( $this, 'assets_footer' ), 2 );
162
163 add_filter( 'plugin_action_links', array( $this, 'plugin_action_links' ), 10, 2);
164
165 add_action( 'wp_ajax_ewd_otp_hide_helper_notice', array( $this, 'hide_helper_notice' ) );
166
167 add_action( 'upgrader_process_complete', array( $this, 'update_tables_post_plugin_update' ), 10, 2 );
168 }
169
170 /**
171 * Run the options conversion function on update if necessary
172 *
173 * @since 3.0.0
174 * @access protected
175 * @return void
176 */
177 public function convert_options() {
178
179 require_once( EWD_OTP_PLUGIN_DIR . '/includes/BackwardsCompatibility.class.php' );
180 new ewdotpBackwardsCompatibility();
181 }
182
183 /**
184 * Run the default status and emails creation function if necessary
185 *
186 * @since 3.0.0
187 * @access protected
188 * @return void
189 */
190 public function create_default_statuses_and_emails() {
191
192 $this->settings->create_default_statuses_and_emails();
193 }
194
195 /**
196 * Creates the tables where orders and their meta information are stored
197 *
198 * @since 3.0.0
199 * @access protected
200 * @return void
201 */
202 public function create_tables() {
203
204 $this->customer_manager->create_tables();
205 $this->order_manager->create_tables();
206 $this->sales_rep_manager->create_tables();
207 }
208
209 /**
210 * Update the tables used by the plugin is updated, in case of any structure changes
211 *
212 * @since 3.2.1
213 * @access protected
214 * @return void
215 */
216 public function update_tables_post_plugin_update( $upgrader, $options ) {
217
218 if ( empty( $options['action'] ) or $options['action'] != 'update' ) { return; }
219
220 if ( empty( $options['type'] ) or $options['type'] != 'plugin' ) { return; }
221
222 foreach ( $options['plugins'] as $plugin ) {
223
224 if ( $plugin == EWD_OTP_PLUGIN_FNAME ) {
225
226 set_transient( 'ewd-otp-update-tables', true, 30 );
227
228 wp_remote_get( site_url() );
229 }
230 }
231 }
232
233 /**
234 * Load files needed for views
235 * @since 3.0.0
236 * @note Can be filtered to add new classes as needed
237 */
238 public function load_view_files() {
239
240 $files = array(
241 EWD_OTP_PLUGIN_DIR . '/views/Base.class.php' // This will load all default classes
242 );
243
244 $files = apply_filters( 'ewd_otp_load_view_files', $files );
245
246 foreach( $files as $file ) {
247 require_once( $file );
248 }
249
250 }
251
252 /**
253 * Load the plugin textdomain for localisation
254 * @since 3.0.0
255 */
256 public function load_textdomain() {
257
258 load_plugin_textdomain( 'order-tracking', false, plugin_basename( dirname( __FILE__ ) ) . '/languages/' );
259 }
260
261 /**
262 * Set a transient so that the walk-through gets run
263 * @since 3.0.0
264 */
265 public function run_walkthrough() {
266
267 set_transient( 'ewd-otp-getting-started', true, 30 );
268 }
269
270 /**
271 * Returns WooCommerce orders to their default statuses, if required
272 * @since 3.0.0
273 */
274 public function revert_wc_statuses() {
275
276 require_once( EWD_OTP_PLUGIN_DIR . '/includes/WooCommerce.class.php' );
277 require_once( EWD_OTP_PLUGIN_DIR . '/includes/Settings.class.php' );
278
279 $settings = new ewdotpSettings();
280
281 if ( empty( $settings->get_setting( 'woocommerce-integration' ) ) ) { return; }
282
283 if ( ! empty( $settings->get_setting( 'disable-woocommerce-revert-statuses' ) ) ) { return; }
284
285 $woocommerce = new ewdotpWooCommerce();
286
287 $woocommerce->revert_statuses();
288 }
289
290 /**
291 * Enqueue the admin-only CSS and Javascript
292 * @since 3.0.0
293 */
294 public function enqueue_admin_assets( $hook ) {
295 global $post;
296
297 wp_enqueue_script( 'ewd-otp-helper-notice', EWD_OTP_PLUGIN_URL . '/assets/js/ewd-otp-helper-install-notice.js', array( 'jquery' ), EWD_OTP_VERSION, true );
298 wp_localize_script(
299 'ewd-otp-helper-notice',
300 'ewd_otp_helper_notice',
301 array( 'nonce' => wp_create_nonce( 'ewd-otp-helper-notice' ) )
302 );
303
304 wp_enqueue_style( 'ewd-otp-helper-notice', EWD_OTP_PLUGIN_URL . '/assets/css/ewd-otp-helper-install-notice.css', array(), EWD_OTP_VERSION );
305
306 $screen = get_current_screen();
307
308 $candidates = array(
309
310 'tracking_page_ewd-otp-dashboard',
311 'toplevel_page_ewd-otp-orders',
312 'tracking_page_ewd-otp-add-edit-order',
313 'tracking_page_ewd-otp-customers',
314 'tracking_page_ewd-otp-add-edit-customer',
315 'tracking_page_ewd-otp-sales-reps',
316 'tracking_page_ewd-otp-add-edit-sales-rep',
317 'toplevel_page_ewd-otp-sales-rep-orders',
318 'tracking_page_ewd-otp-import',
319 'tracking_page_ewd-otp-export',
320 'tracking_page_ewd-otp-custom-fields',
321 'tracking_page_ewd-otp-settings',
322 'tracking_page_ewd-otp-about-us',
323 );
324
325 // Return if not one of the OTP post types, we're not on a post-type page, or we're not on the settings or widget pages
326 if ( ! in_array( $hook, $candidates )
327 and ( empty( $screen->post_type ) or ! in_array ( $screen->post_type, $candidates ) )
328 and ! in_array( $screen->id, $candidates )
329 ) {
330 return;
331 }
332
333 wp_enqueue_style( 'ewd-otp-admin-css', EWD_OTP_PLUGIN_URL . '/assets/css/ewd-otp-admin.css', array(), EWD_OTP_VERSION );
334 wp_enqueue_script( 'ewd-otp-admin-js', EWD_OTP_PLUGIN_URL . '/assets/js/ewd-otp-admin.js', array( 'jquery' ), EWD_OTP_VERSION, true );
335
336 $args = array(
337 'nonce' => wp_create_nonce( 'ewd-otp-admin-js' )
338 );
339
340 wp_localize_script( 'ewd-otp-admin-js', 'ewd_otp_php_admin_data', $args );
341
342 if ( $screen->id == 'toplevel_page_ewd-otp-orders' ) {
343
344 wp_enqueue_style( 'sap-spectrium-css', EWD_OTP_PLUGIN_URL . '/lib/simple-admin-pages/css/spectrum.css', array(), EWD_OTP_VERSION );
345 wp_enqueue_style( 'sap-admin-settings-css', EWD_OTP_PLUGIN_URL . '/lib/simple-admin-pages/css/admin-settings.css', array(), EWD_OTP_VERSION );
346 wp_enqueue_script( 'sap-spectrum-js', EWD_OTP_PLUGIN_URL . '/lib/simple-admin-pages/js/spectrum.js', array( 'jquery' ), EWD_OTP_VERSION, true );
347 wp_enqueue_script( 'sap-admin-settings-js', EWD_OTP_PLUGIN_URL . '/lib/simple-admin-pages/js/admin-settings.js', array( 'jquery' ), EWD_OTP_VERSION, true );
348 }
349 }
350
351 /**
352 * Register the front-end CSS and Javascript for the FAQs
353 * @since 3.0.0
354 */
355 function register_assets() {
356 global $ewd_otp_controller;
357
358 wp_register_style( 'ewd-otp-css', EWD_OTP_PLUGIN_URL . '/assets/css/ewd-otp.css', EWD_OTP_VERSION );
359
360 wp_register_script( 'ewd-otp-js', EWD_OTP_PLUGIN_URL . '/assets/js/ewd-otp.js', array( 'jquery' ), EWD_OTP_VERSION, true );
361 }
362
363 /**
364 * Print out any PHP data needed for our JS to work correctly
365 * @since 3.1.0
366 */
367 public function assets_footer() {
368
369 if ( empty( $this->front_end_php_js_data ) ) { return; }
370
371 $print_variables = array();
372
373 foreach ( (array) $this->front_end_php_js_data as $variable => $values ) {
374
375 if ( empty( $values ) ) { continue; }
376
377 $print_variables[ $variable ] = ewdotpHelper::escape_js_recursive( $values );
378 }
379
380 foreach ( $print_variables as $variable => $values ) {
381
382 echo "<script type='text/javascript'>\n";
383 echo "/* <![CDATA[ */\n";
384 echo 'var ' . esc_attr( $variable ) . ' = ' . wp_json_encode( $values ) . "\n";
385 echo "/* ]]> */\n";
386 echo "</script>\n";
387 }
388 }
389
390 /**
391 * Adds a variable to be passed to our front-end JS
392 * @since 3.1.0
393 */
394 public function add_front_end_php_data( $handle, $variable, $data ) {
395
396 $this->front_end_php_js_data[ $variable ] = $data;
397 }
398
399 /**
400 * Returns the corresponding front-end JS variable if it exists, otherwise an empty array
401 * @since 3.1.0
402 */
403 public function get_front_end_php_data( $handle, $variable ) {
404
405 return ! empty( $this->front_end_php_js_data[ $variable ] ) ? $this->front_end_php_js_data[ $variable ] : array();
406 }
407
408 /**
409 * Add links to the plugin listing on the installed plugins page
410 * @since 3.0.0
411 */
412 public function plugin_action_links( $links, $plugin ) {
413 global $ewd_otp_controller;
414
415 if ( $plugin == EWD_OTP_PLUGIN_FNAME ) {
416
417 if ( ! $ewd_otp_controller->permissions->check_permission( 'premium' ) ) {
418
419 array_unshift( $links, '<a class="ewd-otp-plugin-page-upgrade-link" href="https://www.etoilewebdesign.com/license-payment/?Selected=OTP&Quantity=1&utm_source=wp_admin_plugins_page" title="' . __( 'Try Premium', 'order-tracking' ) . '" target="_blank">' . __( 'Try Premium', 'order-tracking' ) . '</a>' );
420 }
421
422 $links['settings'] = '<a href="admin.php?page=ewd-otp-settings" title="' . __( 'Head to the settings page for Order Tracking', 'order-tracking' ) . '">' . __( 'Settings', 'order-tracking' ) . '</a>';
423 }
424
425 return $links;
426
427 }
428
429
430
431 /**
432 * Adds in a menu bar for the plugin
433 * @since 3.0.0
434 */
435 public function display_header_area() {
436 global $ewd_otp_controller;
437
438 $screen = get_current_screen();
439
440 if ( empty( $screen->parent_file ) or $screen->parent_file != 'ewd-otp-orders' ) { return; }
441
442 if ( ! current_user_can( $ewd_otp_controller->settings->get_setting( 'access-role' ) ) ) { return; }
443
444 if ( ! $ewd_otp_controller->permissions->check_permission( 'styling' ) or get_option( 'EWD_OTP_Trial_Happening' ) == 'Yes' ) {
445 ?>
446 <div class="ewd-otp-dashboard-new-upgrade-banner">
447 <div class="ewd-otp-dashboard-banner-icon"></div>
448 <div class="ewd-otp-dashboard-banner-buttons">
449 <a class="ewd-otp-dashboard-new-upgrade-button" href="https://www.etoilewebdesign.com/license-payment/?Selected=OTP&Quantity=1&utm_source=otp_admin&utm_content=banner" target="_blank">UPGRADE NOW</a>
450 </div>
451 <div class="ewd-otp-dashboard-banner-text">
452 <div class="ewd-otp-dashboard-banner-title">
453 GET FULL ACCESS WITH OUR PREMIUM VERSION
454 </div>
455 <div class="ewd-otp-dashboard-banner-brief">
456 Includes locations, custom fields, a customer order form, WooCommerce integration, advanced styling options and more!
457 </div>
458 </div>
459 </div>
460 <?php
461 }
462
463 ?>
464 <div class="ewd-otp-admin-header-menu">
465 <h2 class="nav-tab-wrapper">
466 <a id="ewd-otp-dash-mobile-menu-open" href="#" class="menu-tab nav-tab"><?php _e("MENU", 'order-tracking'); ?><span id="ewd-otp-dash-mobile-menu-down-caret">&nbsp;&nbsp;&#9660;</span><span id="ewd-otp-dash-mobile-menu-up-caret">&nbsp;&nbsp;&#9650;</span></a>
467 <a id="dashboard-menu" href='admin.php?page=ewd-otp-dashboard' class="menu-tab nav-tab <?php if ( $screen->id == 'tracking_page_ewd-otp-dashboard' ) {echo 'nav-tab-active';}?>"><?php _e("Dashboard", 'order-tracking'); ?></a>
468 <a id="orders-menu" href='admin.php?page=ewd-otp-orders' class="menu-tab nav-tab <?php if ( $screen->id == 'toplevel_page_ewd-otp-orders' ) {echo 'nav-tab-active';}?>"><?php _e("Orders", 'order-tracking'); ?></a>
469 <a id="customers-menu" href='admin.php?page=ewd-otp-customers' class="menu-tab nav-tab <?php if ( $screen->id == 'toplevel_page_ewd-otp-customers' ) {echo 'nav-tab-active';}?>"><?php _e("Customers", 'order-tracking'); ?></a>
470 <a id="sales-reps-menu" href='admin.php?page=ewd-otp-sales-reps' class="menu-tab nav-tab <?php if ( $screen->id == 'toplevel_page_ewd-otp-sales-reps' ) {echo 'nav-tab-active';}?>"><?php _e("Sales Reps", 'order-tracking'); ?></a>
471 <a id="export-menu" href='admin.php?page=ewd-otp-export' class="menu-tab nav-tab <?php if ( $screen->id == 'ewd-otp-export' ) {echo 'nav-tab-active';}?>"><?php _e("Export", 'order-tracking'); ?></a>
472 <a id="import-menu" href='admin.php?page=ewd-otp-import' class="menu-tab nav-tab <?php if ( $screen->id == 'ewd-otp-import' ) {echo 'nav-tab-active';}?>"><?php _e("Import", 'order-tracking'); ?></a>
473 <a id="custom-fields-menu" href='admin.php?page=ewd-otp-custom-fields' class="menu-tab nav-tab <?php if ( $screen->id == 'ewd-otp-custom-fields' ) {echo 'nav-tab-active';}?>"><?php _e("Custom Fields", 'order-tracking'); ?></a>
474 <a id="options-menu" href='admin.php?page=ewd-otp-settings' class="menu-tab nav-tab <?php if ( $screen->id == 'ewd_otp_page_ewd-otp-settings' ) {echo 'nav-tab-active';}?>"><?php _e("Settings", 'order-tracking'); ?></a>
475 </h2>
476 </div>
477 <?php
478 }
479
480 public function maybe_display_helper_notice() {
481 global $ewd_otp_controller;
482
483 if ( empty( $ewd_otp_controller->permissions->check_permission( 'premium' ) ) ) { return; }
484
485 if ( is_plugin_active( 'ewd-premium-helper/ewd-premium-helper.php' ) ) { return; }
486
487 if ( get_transient( 'ewd-helper-notice-dismissed' ) ) { return; }
488
489 ?>
490
491 <div class='notice notice-error is-dismissible ewd-otp-helper-install-notice'>
492
493 <div class='ewd-otp-helper-install-notice-img'>
494 <img src='<?php echo EWD_OTP_PLUGIN_URL . '/lib/simple-admin-pages/img/options-asset-exclamation.png' ; ?>' />
495 </div>
496
497 <div class='ewd-otp-helper-install-notice-txt'>
498 <?php _e( 'You\'re using the Order Tracking premium version, but the premium helper plugin is not active.', 'order-tracking' ); ?>
499 <br />
500 <?php echo sprintf( __( 'Please re-activate the helper plugin, or <a target=\'_blank\' href=\'%s\'>download and install it</a> if the plugin is no longer installed to ensure continued access to the premium features of the plugin.', 'order-tracking' ), 'https://www.etoilewebdesign.com/2021/12/11/requiring-premium-helper-plugin/' ); ?>
501 </div>
502
503 <div class='ewd-otp-clear'></div>
504
505 </div>
506
507 <?php
508 }
509
510 public function hide_helper_notice() {
511
512 // Authenticate request
513 if ( ! check_ajax_referer( 'ewd-otp-helper-notice', 'nonce' ) or ! current_user_can( 'manage_options' ) ) {
514 ewdotpHelper::admin_nopriv_ajax();
515 }
516
517 set_transient( 'ewd-helper-notice-dismissed', true, 3600*24*7 );
518
519 die();
520 }
521
522 }
523 } // endif;
524
525 global $ewd_otp_controller;
526 $ewd_otp_controller = new ewdotpInit();
527
528 do_action( 'ewd_otp_initialized' );