PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / 1.0.3
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar v1.0.3
3.3.1 3.3.0 3.2.14 3.2.13 3.2.12 3.2.11 3.2.10 3.2.9 3.2.8 3.2.7 trunk 0.2.5.5 0.2.5.6 0.2.5.7 1.0.0 1.0.1 1.0.2 1.0.3 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.2.0 1.2.1 All 156 releases
notificationx / admin / class-nx-admin.php

class-nx-admin.php in NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar 1.0.3, at admin/class-nx-admin.php

581 lines 22.5 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * The admin-specific functionality of the plugin.
4 *
5 * @link https://wpdeveloper.net
6 * @since 1.0.0
7 *
8 * @package NotificationX
9 * @subpackage NotificationX/admin
10 * @author WPDeveloper <support@wpdeveloper.net>
11 */
12
13 class NotificationX_Admin {
14
15 /**
16 * The ID of this plugin.
17 *
18 * @since 1.0.0
19 * @access private
20 * @var string $plugin_name The ID of this plugin.
21 */
22 private $plugin_name;
23 /**
24 * All builder args
25 *
26 * @var array
27 */
28 private $builder_args;
29 /**
30 * Builder Metabox ID
31 *
32 * @var string
33 */
34 private $metabox_id;
35
36 /**
37 * The version of this plugin.
38 *
39 * @since 1.0.0
40 * @access private
41 * @var string $version The current version of this plugin.
42 */
43 private $version;
44
45 /**
46 * The type.
47 *
48 * @since 1.0.0
49 * @access public
50 * @var string the post type of notificationx.
51 */
52 public $type = 'notificationx';
53
54 public $metabox;
55
56 public static $prefix = 'nx_meta_';
57
58 public static $settings;
59
60 /**
61 * Initialize the class and set its properties.
62 *
63 * @since 1.0.0
64 * @param string $plugin_name The name of this plugin.
65 * @param string $version The version of this plugin.
66 */
67 public function __construct( $plugin_name, $version ) {
68
69 $this->plugin_name = $plugin_name;
70 $this->version = $version;
71 self::$settings = NotificationX_DB::get_settings();
72 }
73 /**
74 * Get all active items.
75 *
76 * @return void
77 */
78 public static function get_active_items() {
79 // WP Query arguments.
80 $args = array(
81 'post_type' => 'notificationx',
82 'posts_per_page' => '-1',
83 'post_status' => 'publish',
84 );
85 $active = [];
86 // Get the notification posts.
87 $posts = get_posts( $args );
88
89 if ( count( $posts ) ) {
90 foreach ( $posts as $post ) {
91 $settings = NotificationX_MetaBox::get_metabox_settings( $post->ID );
92
93 switch( $settings->display_type ) {
94 case 'press_bar' :
95 $type = $settings->display_type;
96 break;
97 case 'comments' :
98 $type = $settings->comments_source;
99 break;
100 case 'conversions' :
101 $type = $settings->conversion_from;
102 break;
103 case 'reviews' :
104 $type = $settings->reviews_source;
105 break;
106 case 'download_stats' :
107 $type = $settings->stats_source;
108 break;
109 }
110
111
112 $active[ $type ][] = $post->ID;
113 }
114 }
115
116 return $active;
117 }
118 /**
119 * Register the stylesheets for the admin area.
120 *
121 * @since 1.0.0
122 */
123 public function enqueue_styles( $hook ) {
124 global $post_type;
125 $page_status = false;
126 wp_enqueue_style(
127 $this->plugin_name . '-admin-global',
128 NOTIFICATIONX_ADMIN_URL . 'assets/css/nx-admin-global.min.css',
129 array(), $this->version, 'all'
130 );
131 if( $hook == 'notificationx_page_nx-builder' || $hook == 'notificationx_page_nx-settings' ) {
132 $page_status = true;
133 }
134
135 if( $post_type != $this->type && ! $page_status ) {
136 return;
137 }
138
139 wp_enqueue_style( 'wp-color-picker' );
140 wp_enqueue_style(
141 $this->plugin_name . '-select2',
142 NOTIFICATIONX_ADMIN_URL . 'assets/css/select2.min.css',
143 array(), $this->version, 'all'
144 );
145 wp_enqueue_style(
146 $this->plugin_name,
147 NOTIFICATIONX_ADMIN_URL . 'assets/css/nx-admin.min.css',
148 array(), $this->version, 'all'
149 );
150 }
151 /**
152 * Register the JavaScript for the admin area.
153 *
154 * @since 1.0.0
155 */
156 public function enqueue_scripts( $hook ) {
157 global $post_type;
158 $page_status = false;
159
160 if( $hook == 'notificationx_page_nx-builder' || $hook == 'notificationx_page_nx-settings' ) {
161 $page_status = true;
162 }
163
164 if( $post_type != $this->type && ! $page_status ) {
165 return;
166 }
167
168 wp_enqueue_script( 'wp-color-picker' );
169 wp_enqueue_script( 'jquery-ui-datepicker' );
170 wp_enqueue_media();
171 wp_enqueue_script(
172 $this->plugin_name . '-sweetalert',
173 NOTIFICATIONX_ADMIN_URL . 'assets/js/sweetalert.min.js',
174 array( 'jquery' ), $this->version, true
175 );
176 wp_enqueue_script(
177 $this->plugin_name . '-select2',
178 NOTIFICATIONX_ADMIN_URL . 'assets/js/select2.min.js',
179 array( 'jquery' ), $this->version, true
180 );
181 wp_enqueue_script(
182 $this->plugin_name,
183 NOTIFICATIONX_ADMIN_URL . 'assets/js/nx-admin.min.js',
184 array( 'jquery' ), $this->version, true
185 );
186
187 wp_localize_script( $this->plugin_name, 'notificationx', self::toggleFields() );
188 }
189
190 public function toggleFields( $builder = false ){
191 $args = NotificationX_MetaBox::get_args();
192 if( $builder ) {
193 $args = NotificationX_MetaBox::get_builder_args();
194 }
195
196 $toggleFields = $hideFields = $conditions = array();
197
198 $tabs = $args[ 'tabs' ];
199 if( ! empty( $tabs ) ) {
200 foreach( $tabs as $tab_id => $tab ) {
201 $sections = isset( $tab['sections'] ) ? $tab[ 'sections' ] : [];
202 if( ! empty( $sections ) ) {
203 foreach( $sections as $section_id => $section ) {
204 $fields = isset( $section['fields'] ) ? $section[ 'fields' ] : [];
205 if( ! empty( $fields ) ) {
206 foreach( $fields as $field_key => $field ) {
207 if( isset( $field['fields'] ) ) {
208 foreach( $field['fields'] as $inner_field_key => $inner_field ) {
209 if( isset( $inner_field['hide'] ) && ! empty( $inner_field['hide'] ) && is_array( $inner_field['hide'] ) ) {
210 foreach( $inner_field['hide'] as $key => $hide ) {
211 $hideFields[ $inner_field_key ][ $key ] = $hide;
212 }
213 }
214 if( isset( $inner_field['dependency'] ) && ! empty( $inner_field['dependency'] ) && is_array( $inner_field['dependency'] ) ) {
215 foreach( $inner_field['dependency'] as $key => $dependency ) {
216 $conditions[ $inner_field_key ][ $key ] = $dependency;
217 }
218 }
219 }
220 }
221
222 if( isset( $field['hide'] ) && ! empty( $field['hide'] ) && is_array( $field['hide'] ) ) {
223 foreach( $field['hide'] as $key => $hide ) {
224 $hideFields[ $field_key ][ $key ] = $hide;
225 }
226 }
227 if( isset( $field['dependency'] ) && ! empty( $field['dependency'] ) && is_array( $field['dependency'] ) ) {
228 foreach( $field['dependency'] as $key => $dependency ) {
229 $conditions[ $field_key ][ $key ] = $dependency;
230 }
231 }
232 }
233 }
234 }
235 }
236 }
237 }
238
239 return array(
240 'toggleFields' => $conditions,
241 'hideFields' => $hideFields,
242 'template' => apply_filters( 'nx_template_name', array() ),
243 'template_settings' => apply_filters( 'nx_template_settings_by_theme', array() ),
244 );
245 }
246
247 public function custom_columns( $columns ) {
248 $title_column = $columns['title'];
249 $date_column = $columns['date'];
250
251 unset( $columns['title'] );
252 unset( $columns['date'] );
253
254 $columns['notification_status'] = __('Enable / Disable', 'notificationx');
255 $columns['title'] = $title_column;
256
257 $columns['notification_type'] = __('Type', 'notificationx');
258
259 $columns['date'] = $date_column;
260
261 return apply_filters('nx_post_columns', $columns );
262 }
263
264 public function manage_custom_columns( $column, $post_id ){
265 switch ( $column ) {
266 case 'notification_type':
267 $type = get_post_meta( $post_id, '_nx_meta_display_type', true );
268 if ( $type ) {
269 $type = NotificationX_Helper::notification_types( $type );
270 if( $type !== 'Conversions' ) {
271 echo $type;
272 } else {
273 $from = get_post_meta( $post_id, '_nx_meta_conversion_from', true );
274 echo $type . ' - ' . NotificationX_Helper::conversion_from( $from );
275 }
276 }
277 break;
278 case 'notification_status':
279 $status = get_post_meta( $post_id, '_nx_meta_active_check', true );
280 self::notification_toggle( $status, $post_id );
281 break;
282 }
283
284 do_action( 'nx_post_columns_content', $column, $post_id );
285 }
286
287 public static function notification_toggle( $status = '1', $post_id ){
288 $text = __('Active', 'notificationx');
289 $img_active = NOTIFICATIONX_ADMIN_URL . 'assets/img/active1.png';
290 $img_inactive = NOTIFICATIONX_ADMIN_URL . 'assets/img/active0.png';
291 $active = 'true';
292 $img = $img_active;
293
294 if ( ! $status ) {
295 $text = __('Inactive', 'notificationx');
296 $img = $img_inactive;
297 $active = 'false';
298 }
299 ?>
300 <img
301 src="<?php echo $img; ?>"
302 style="cursor: pointer; height: 16px; vertical-align: middle;"
303 alt="<?php echo $text; ?>" title="<?php echo $text; ?>"
304 data-nonce="<?php echo wp_create_nonce('notificationx_status_nonce'); ?>"
305 data-post="<?php echo $post_id; ?>" />
306 <?php
307 }
308
309 public function notification_status(){
310 $error = false;
311
312 if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'notificationx_status_nonce' ) ) {
313 $error = true;
314 }
315
316 if ( ! isset( $_POST['post_id'] ) || empty( $_POST['post_id'] ) || ! absint( $_POST['post_id'] ) ) {
317 $error = true;
318 }
319
320 if ( $error ) {
321 echo __('There is an error updating status.', 'notificationx');
322 die();
323 }
324
325 $post_id = absint( $_POST['post_id'] );
326 $status = $_POST['status'] == 'active' ? '1' : '0';
327
328 update_post_meta( $post_id, '_nx_meta_active_check', $status );
329
330 echo 'success';
331 die();
332 }
333 /**
334 * Register the NotificationX custom post type.
335 *
336 * @since 1.0.0
337 */
338 public function register(){
339
340 $labels = array(
341 'name' => 'NotificationX',
342 'singular_name' => 'NotificationX',
343 'add_new' => esc_html__( 'Add New', 'notificationx' ) ,
344 'add_new_item' => esc_html__( 'Add New', 'notificationx' ),
345 'edit_item' => esc_html__( 'Edit', 'notificationx' ),
346 'new_item' => esc_html__( 'New', 'notificationx' ),
347 'view_item' => esc_html__( 'View', 'notificationx' ),
348 'search_items' => esc_html__( 'Search', 'notificationx' ),
349 'not_found' => esc_html__( 'No notification x is found', 'notificationx' ),
350 'not_found_in_trash' => esc_html__( 'No notification x is found in Trash', 'notificationx' ),
351 'menu_name' => 'NotificationX',
352 );
353
354 $args = array(
355 'labels' => $labels,
356 'hierarchical' => false,
357 'description' => '',
358 'taxonomies' => array( '' ),
359 'public' => false,
360 'show_ui' => true,
361 'show_in_menu' => 'notificationx',
362 'show_in_admin_bar' => true,
363 'show_in_rest' => false,
364 'menu_position' => 80,
365 'menu_icon' => NOTIFICATIONX_ADMIN_URL . 'assets/img/nx-menu-icon.png',
366 'show_in_nav_menus' => false,
367 'publicly_queryable' => false,
368 'exclude_from_search' => true,
369 'has_archive' => false,
370 'query_var' => true,
371 'can_export' => true,
372 'rewrite' => '',
373 'capability_type' => 'post',
374 'supports' => array( 'title' ),
375 );
376
377 register_post_type( $this->type, $args );
378 add_image_size( "_nx_notification_thumb", 100, 100, true );
379 }
380
381 /**
382 * Admin Menu Page
383 *
384 * @return void
385 */
386 public function menu_page(){
387
388 if( ! current_user_can( 'manage_options' ) ) {
389 return;
390 }
391
392 $settings_class = new NotificationX_Settings();
393
394 $settings = apply_filters( 'notificationx_admin_menu', array(
395 'nx-settings' => array(
396 'title' => __('Settings', 'notificationx'),
397 'capability' => 'delete_users',
398 'callback' => array( $settings_class, 'settings_page' )
399 ),
400 'nx-builder' => array(
401 'title' => __('Quick Builder', 'notificationx'),
402 'capability' => 'delete_users',
403 'callback' => array( $this, 'quick_builder' )
404 ),
405 ) );
406
407 $this->builder_args = NotificationX_MetaBox::get_builder_args();
408 $this->metabox_id = $this->builder_args['id'];
409 $flag = true;
410 /**
411 * Add Submit
412 */
413 if( isset( $_POST[ 'nx_builder_add_submit' ] ) ) :
414 if ( ! isset( $_POST[$this->metabox_id . '_nonce'] ) || ! wp_verify_nonce( $_POST[$this->metabox_id . '_nonce'], $this->metabox_id ) ) {
415 $flag = false;
416 }
417
418 if( $flag ) {
419
420 if( $_POST['nx_meta_display_type'] == 'press_bar' ) {
421 $title = __('NotificationX - Notification Bar', 'notificationx');
422 } elseif( $_POST['nx_meta_display_type'] == 'comments' ) {
423 $title = __('NotificationX - WP Comments', 'notificationx');
424 } elseif( $_POST['nx_meta_display_type'] == 'conversions' ) {
425 $conversions = NotificationX_Helper::conversion_from();
426 $title = 'NotificationX - ' . $conversions[$_POST['nx_meta_conversion_from']];
427 }
428 $_POST['post_type'] = 'notificationx';
429 $postdata = array(
430 'post_type' => 'notificationx',
431 'post_title' => $title . ' - ' . date( get_option( 'date_format' ), current_time( 'timestamp' ) ),
432 'post_status' => 'publish',
433 'post_author' => get_current_user_id(),
434 );
435
436 $p_id = wp_insert_post($postdata);
437 if( $p_id || ! is_wp_error( $p_id ) ) {
438 do_action( 'nx_before_builder_submit', $_POST );
439 // saving builder meta data with post
440 NotificationX_MetaBox::save_data( $this->builder_data( $_POST ), $p_id );
441 /**
442 * Safely Redirect to NotificationX Page
443 */
444 wp_safe_redirect( add_query_arg( array(
445 'post_type' => 'notificationx',
446 ), admin_url( 'edit.php' ) ) );
447 }
448 }
449 endif;
450 add_menu_page( 'NotificationX', 'NotificationX', 'delete_users', 'notificationx', '', NOTIFICATIONX_ADMIN_URL . 'assets/img/nx-menu-icon.png', 80 );
451 foreach( $settings as $slug => $setting ) {
452 $cap = isset( $setting['capability'] ) ? $setting['capability'] : 'delete_users';
453 $hook = add_submenu_page( 'notificationx', $setting['title'], $setting['title'], $cap, $slug, $setting['callback'] );
454 }
455 }
456
457 public function quick_builder(){
458 $builder_args = $this->builder_args;
459 $tabs = $this->builder_args['tabs'];
460 $prefix = self::$prefix;
461 $metabox_id = $this->metabox_id;
462 /**
463 * This lines of code is for editing a notification in simple|quick builder
464 *
465 * @var [type]
466 */
467 $idd = null;
468 if( isset( $_GET['post_id'] ) && ! empty( $_GET['post_id'] )) {
469 $idd = intval( $_GET['post_id'] );
470 }
471 include_once NOTIFICATIONX_ADMIN_DIR_PATH . 'partials/nx-quick-builder-display.php';
472 }
473 /**
474 * Generate the builder data acording to default meta data
475 *
476 * @param array $data
477 * @return array
478 */
479 protected function builder_data( $data ) {
480 $post_data = [];
481 $prefix = self::$prefix;
482 $meta_fields = NotificationX_MetaBox::get_metabox_fields( $prefix );
483 foreach( $meta_fields as $meta_key => $meta_field ) {
484 if( in_array( $meta_key, array_keys($data) ) ) {
485 $post_data[ $meta_key ] = $data[ $meta_key ];
486 } else {
487 $post_data[ $meta_key ] = '';
488
489 if( isset( $meta_field['defaults'] ) ) {
490 $post_data[ $meta_key ] = $meta_field['defaults'];
491 }
492 if( isset( $meta_field['default'] ) ) {
493 $post_data[ $meta_key ] = $meta_field['default'];
494 }
495 }
496 }
497
498 return array_merge( $post_data, $data );
499 }
500
501 public static function get_form_action( $query_var = '', $builder_form = false ) {
502 $page = '/admin.php?page=nx-settings';
503 if( $builder_form ) {
504 $page = '/admin.php?page=nx-builder';
505 }
506
507 if ( is_network_admin() ) {
508 return network_admin_url( $page . $query_var );
509 } else {
510 return admin_url( $page . $query_var );
511 }
512 }
513
514 public function notification_preview(){
515 global $pagenow, $post_type, $post;
516 if ( ! in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) {
517 return false;
518 }
519 if ( $this->type != $post_type ) {
520 return false;
521 }
522 $display_type = get_post_meta( $post->ID, '_nx_meta_display_type', true );
523
524 include NOTIFICATIONX_ADMIN_DIR_PATH . 'partials/nx-admin-preview.php';
525 }
526
527 public function preview_html( $settings, $type = 'conversion' ){
528 $data = array(
529 'comment' => array(
530 'link' => '#',
531 'post_title' => 'Hello world!',
532 'post_link' => '#',
533 'timestamp' => '1550986787',
534 'user_id' => get_current_user_id(),
535 'name' => 'John D',
536 ),
537 'conversion' => array(
538 'link' => '#',
539 'title' => 'Hello world!',
540 'timestamp' => '1550986787',
541 'user_id' => get_current_user_id(),
542 'name' => 'John D',
543 )
544 );
545
546 $unique_id = uniqid( 'notificationx-' );
547 $output = '<div id="'. esc_attr( $unique_id ) .'" class="nx-notification '. implode( ' ', NotificationX_Extension::get_classes( $settings ) ) .'">';
548 $output .= '<div '. NotificationX_Public::generate_preview_css( $settings ) .' class="notificationx-inner '. implode( ' ', NotificationX_Extension::get_classes( $settings, 'inner' ) ) .'">';
549 $output .= '<div class="notificationx-image nx-preview-image">';
550 $output .= '<img class="'. implode( ' ', NotificationX_Extension::get_classes( $settings, 'img' ) ) .'" src="'. NOTIFICATIONX_ADMIN_URL . 'assets/img/placeholder-300x300.png" alt="">';
551 $output .= '</div>';
552 $output .= '<div class="notificationx-content">';
553 if( $type === 'conversion' ) :
554 $output .= NotificationX_Template::get_template_ready( $settings->woo_template, NotificationX_Extension::newData( $data[ 'conversion' ] ), $settings );
555 endif;
556 if( $type === 'comment' ) :
557 $output .= NotificationX_Template::get_template_ready( $settings->comments_template, NotificationX_Extension::newData( $data[ 'comment' ] ), $settings );
558 endif;
559 if( $settings->close_button ) :
560 $output .= '<span class="notificationx-close nx-preview-close"><svg width="8px" height="8px" viewBox="0 0 48 48" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><g id="Page-1" stroke="none" stroke-width="1" fill-rule="evenodd"><g id="close" fill-rule="nonzero"><path d="M28.228,23.986 L47.092,5.122 C48.264,3.951 48.264,2.051 47.092,0.88 C45.92,-0.292 44.022,-0.292 42.85,0.88 L23.986,19.744 L5.121,0.88 C3.949,-0.292 2.051,-0.292 0.879,0.88 C-0.293,2.051 -0.293,3.951 0.879,5.122 L19.744,23.986 L0.879,42.85 C-0.293,44.021 -0.293,45.921 0.879,47.092 C1.465,47.677 2.233,47.97 3,47.97 C3.767,47.97 4.535,47.677 5.121,47.091 L23.986,28.227 L42.85,47.091 C43.436,47.677 44.204,47.97 44.971,47.97 C45.738,47.97 46.506,47.677 47.092,47.091 C48.264,45.92 48.264,44.02 47.092,42.849 L28.228,23.986 Z" id="Shape"></path></g></g></svg></span>';
561 endif;
562 if( is_null( NotificationX_Extension::$powered_by ) ) :
563 $output .= '<small class="nx-branding">';
564 $output .= '<svg width="12px" height="16px" viewBox="0 0 387 392" version="1.1" xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink"><desc>Created with Sketch.</desc><defs></defs><g id="Page-1" stroke="none" stroke-width="1" fill="none" fill-rule="evenodd"><g id="NotificationX_final" transform="translate(-1564.000000, -253.000000)"><g id="Group" transform="translate(1564.000000, 253.000000)"><path d="M135.45,358.68 C173.45,358.68 211.27,358.68 249.07,358.68 C247.02,371.83 221.24,388.59 199.26,390.98 C173.92,393.73 143.23,378.38 135.45,358.68 Z" id="Shape" fill="#5614D5" fill-rule="nonzero"></path><path d="M372.31,305.79 C369.97,305.59 367.6,305.71 365.24,305.71 C359.63,305.7 354.02,305.71 347.08,305.71 C347.08,301.43 347.08,298.42 347.08,295.41 C347.07,248.75 347.25,202.09 346.91,155.43 C346.83,144.89 345.88,134.19 343.79,123.87 C326.39,37.9 239.94,-16.19 154.81,5.22 C86.84,22.31 37.91,84.26 38.19,154.7 C38.36,197.12 38.21,239.54 38.2,281.96 C38.2,285.8 38.18,297.79 38.16,305.7 C32.98,305.66 18.07,305.57 12.86,305.88 C5.13,306.33 -0.06,312.31 0.04,319.97 C0.14,327.43 5.08,332.74 12.67,333.42 C14.78,333.61 16.91,333.57 19.03,333.57 C134.74,333.61 250.46,333.64 366.17,333.66 C368.29,333.66 370.42,333.69 372.53,333.48 C380.01,332.73 385.14,327.23 385.28,319.95 C385.41,312.58 379.86,306.44 372.31,305.79 Z" id="Shape" fill="#5614D5" fill-rule="nonzero"></path><circle id="Oval" fill="#836EFF" fill-rule="nonzero" cx="281.55" cy="255.92" r="15.49"></circle><path d="M295.67,140.1 L295.91,139.94 C295.7,138.63 295.52,137.29 295.27,136.02 C285.87,89.57 245.83,55.34 198.79,52.53 C198.73,52.53 198.67,52.52 198.61,52.52 C196.59,52.4 194.57,52.32 192.53,52.32 C192.48,52.32 192.44,52.32 192.39,52.32 C192.34,52.32 192.3,52.32 192.25,52.32 C190.21,52.32 188.18,52.4 186.17,52.52 C186.11,52.52 186.05,52.53 185.99,52.53 C138.95,55.34 98.91,89.57 89.51,136.02 C89.25,137.29 89.07,138.63 88.87,139.94 L89.11,140.1 C88.2,145.6 87.72,151.22 87.74,156.9 C87.76,161.42 87.77,256.77 87.78,269.74 L119.91,304.42 C119.91,280.14 119.9,170.57 119.85,156.78 C119.72,124.18 142.81,94.69 174.76,86.66 C177.41,85.99 180.09,85.5 182.78,85.13 C183.23,85.07 183.67,85 184.13,84.95 C185.15,84.83 186.17,84.74 187.18,84.66 C188.64,84.56 190.1,84.48 191.58,84.47 C191.85,84.47 192.12,84.45 192.39,84.44 C192.66,84.44 192.93,84.46 193.2,84.47 C194.68,84.48 196.14,84.56 197.6,84.66 C198.62,84.74 199.64,84.83 200.65,84.95 C201.1,85 201.55,85.07 202,85.13 C204.69,85.5 207.37,85.99 210.02,86.66 C241.96,94.69 265.06,124.19 264.93,156.78 C264.91,161.95 264.9,207.07 264.89,228.18 L297.03,206.73 C297.03,194.5 297.04,158.28 297.04,156.91 C297.06,151.21 296.59,145.6 295.67,140.1 Z" id="Shape" fill="#836EFF" fill-rule="nonzero"></path><path d="M31.94,305.72 C25.58,305.85 19.2,305.51 12.86,305.88 C5.13,306.33 -0.06,312.31 0.04,319.97 C0.14,327.43 5.08,332.74 12.67,333.42 C14.78,333.61 16.91,333.57 19.03,333.57 C134.74,333.61 250.45,333.63 366.17,333.66 C368.29,333.66 370.42,333.69 372.53,333.48 C380.01,332.73 385.14,327.23 385.28,319.95 C385.42,312.58 379.87,306.45 372.32,305.79 C369.98,305.59 367.61,305.71 365.25,305.71 C359.64,305.7 354.03,305.71 347.09,305.71 C347.09,301.43 347.09,298.42 347.09,295.41 C347.08,254.74 347.2,214.07 347.01,173.41 L131.62,317.03 L53.58,232.81 L87.05,202.02 L138.72,257.62 L343.2,121.26 C324.59,36.81 239.08,-15.98 154.82,5.21 C86.85,22.3 37.92,84.25 38.2,154.69 C38.37,197.11 38.22,239.53 38.21,281.95 C38.21,287.84 38.3,293.74 38.16,299.62" id="Shape"></path><path d="M346.91,155.42 C346.95,161.41 346.97,167.41 347,173.4 L386.14,147.41 L360.9,109.57 L343.2,121.26 C343.39,122.13 343.62,122.98 343.8,123.85 C345.88,134.18 346.84,144.89 346.91,155.42 Z" id="Shape" fill="#00F9AC" fill-rule="nonzero"></path><path d="M87.05,202.03 L53.58,232.82 L131.62,317.04 L347,173.41 C346.97,167.42 346.96,161.42 346.91,155.43 C346.83,144.89 345.88,134.19 343.79,123.87 C343.61,122.99 343.39,122.14 343.19,121.28 L138.72,257.63 L87.05,202.03 Z" id="Shape"></path><path d="M87.05,202.03 L53.58,232.82 L131.62,317.04 L347,173.41 C346.97,167.42 346.96,161.42 346.91,155.43 C346.83,144.89 345.88,134.19 343.79,123.87 C343.61,122.99 343.39,122.14 343.19,121.28 L138.72,257.63 L87.05,202.03 Z" id="Shape" fill="#21D8A3" fill-rule="nonzero" opacity="0.9"></path></g></g></g></svg>';
565 $output .= ' by <a href="'. NOTIFICATIONX_PLUGIN_URL .'?utm_source='. urlencode( home_url() ) .'&utm_medium=notificationx_referrer" target="_blank" class="nx-powered-by">NotificationX</a>';
566 $output .= '</small>';
567 endif;
568 $output .= '</div>';
569 $output .= '</div>';
570 $output .= '</div>';
571
572 return $output;
573 }
574
575 public static function get_post_meta( $post_id, $key, $single = true ) {
576 return get_post_meta( $post_id, '_nx_meta_' . $key, $single );
577 }
578 public static function update_post_meta( $post_id, $key, $value ) {
579 update_post_meta( $post_id, '_nx_meta_' . $key, $value );
580 }
581 }