PluginProbe
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar / 1.0.0
NotificationX – FOMO, Live Sales Notification, WooCommerce Sales Popup, GDPR, Social Proof, Announcement Banner & Floating Notification Bar v1.0.0
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.0, at admin/class-nx-admin.php

499 lines 19.9 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 $type = ( $settings->display_type != 'conversions' ) ? $settings->display_type : $settings->conversion_from;
93
94 $active[ $type ][] = $post->ID;
95 }
96 }
97
98 return $active;
99 }
100 /**
101 * Register the stylesheets for the admin area.
102 *
103 * @since 1.0.0
104 */
105 public function enqueue_styles( $hook ) {
106 global $post_type;
107 $page_status = false;
108 wp_enqueue_style(
109 $this->plugin_name . '-admin-global',
110 NOTIFICATIONX_ADMIN_URL . 'assets/css/nx-admin-global.min.css',
111 array(), $this->version, 'all'
112 );
113 if( $hook == 'notificationx_page_nx-builder' || $hook == 'notificationx_page_nx-settings' ) {
114 $page_status = true;
115 }
116
117 if( $post_type != $this->type && ! $page_status ) {
118 return;
119 }
120
121 wp_enqueue_style( 'wp-color-picker' );
122 wp_enqueue_style(
123 $this->plugin_name . '-select2',
124 NOTIFICATIONX_ADMIN_URL . 'assets/css/select2.min.css',
125 array(), $this->version, 'all'
126 );
127 wp_enqueue_style(
128 $this->plugin_name,
129 NOTIFICATIONX_ADMIN_URL . 'assets/css/nx-admin.min.css',
130 array(), $this->version, 'all'
131 );
132 }
133 /**
134 * Register the JavaScript for the admin area.
135 *
136 * @since 1.0.0
137 */
138 public function enqueue_scripts( $hook ) {
139 global $post_type;
140 $page_status = false;
141
142 if( $hook == 'notificationx_page_nx-builder' || $hook == 'notificationx_page_nx-settings' ) {
143 $page_status = true;
144 }
145
146 if( $post_type != $this->type && ! $page_status ) {
147 return;
148 }
149
150 wp_enqueue_script( 'wp-color-picker' );
151 wp_enqueue_media();
152 wp_enqueue_script(
153 $this->plugin_name . '-sweetalert',
154 NOTIFICATIONX_ADMIN_URL . 'assets/js/sweetalert.min.js',
155 array( 'jquery' ), $this->version, true
156 );
157 wp_enqueue_script(
158 $this->plugin_name . '-select2',
159 NOTIFICATIONX_ADMIN_URL . 'assets/js/select2.min.js',
160 array( 'jquery' ), $this->version, true
161 );
162 wp_enqueue_script(
163 $this->plugin_name,
164 NOTIFICATIONX_ADMIN_URL . 'assets/js/nx-admin.min.js',
165 array( 'jquery' ), $this->version, true
166 );
167 }
168
169 public function custom_columns( $columns ) {
170 $title_column = $columns['title'];
171 $date_column = $columns['date'];
172
173 unset( $columns['title'] );
174 unset( $columns['date'] );
175
176 $columns['notification_status'] = __('Enable / Disable', 'notificationx');
177 $columns['title'] = $title_column;
178
179 $columns['notification_type'] = __('Type', 'notificationx');
180
181 $columns['date'] = $date_column;
182
183 return apply_filters('nx_post_columns', $columns );
184 }
185
186 public function manage_custom_columns( $column, $post_id ){
187 switch ( $column ) {
188 case 'notification_type':
189 $type = get_post_meta( $post_id, '_nx_meta_display_type', true );
190 if ( $type ) {
191 $type = NotificationX_Helper::notification_types( $type );
192 if( $type !== 'Conversions' ) {
193 echo $type;
194 } else {
195 $from = get_post_meta( $post_id, '_nx_meta_conversion_from', true );
196 echo $type . ' - ' . NotificationX_Helper::conversion_from( $from );
197 }
198 }
199 break;
200 case 'notification_status':
201 $status = get_post_meta( $post_id, '_nx_meta_active_check', true );
202 self::notification_toggle( $status, $post_id );
203 break;
204 }
205
206 do_action( 'nx_post_columns_content', $column, $post_id );
207 }
208
209 public static function notification_toggle( $status = '1', $post_id ){
210 $text = __('Active', 'notificationx');
211 $img_active = NOTIFICATIONX_ADMIN_URL . 'assets/img/active1.png';
212 $img_inactive = NOTIFICATIONX_ADMIN_URL . 'assets/img/active0.png';
213 $active = 'true';
214 $img = $img_active;
215
216 if ( ! $status ) {
217 $text = __('Inactive', 'notificationx');
218 $img = $img_inactive;
219 $active = 'false';
220 }
221 ?>
222 <img
223 src="<?php echo $img; ?>"
224 style="cursor: pointer; height: 16px; vertical-align: middle;"
225 alt="<?php echo $text; ?>" title="<?php echo $text; ?>"
226 data-nonce="<?php echo wp_create_nonce('notificationx_status_nonce'); ?>"
227 data-post="<?php echo $post_id; ?>" />
228 <?php
229 }
230
231 public function notification_status(){
232 $error = false;
233
234 if ( ! isset( $_POST['nonce'] ) || ! wp_verify_nonce( $_POST['nonce'], 'notificationx_status_nonce' ) ) {
235 $error = true;
236 }
237
238 if ( ! isset( $_POST['post_id'] ) || empty( $_POST['post_id'] ) || ! absint( $_POST['post_id'] ) ) {
239 $error = true;
240 }
241
242 if ( $error ) {
243 echo __('There is an error updating status.', 'notificationx');
244 die();
245 }
246
247 $post_id = absint( $_POST['post_id'] );
248 $status = $_POST['status'] == 'active' ? '1' : '0';
249
250 update_post_meta( $post_id, '_nx_meta_active_check', $status );
251
252 echo 'success';
253 die();
254 }
255 /**
256 * Register the NotificationX custom post type.
257 *
258 * @since 1.0.0
259 */
260 public function register(){
261
262 $labels = array(
263 'name' => 'NotificationX',
264 'singular_name' => 'NotificationX',
265 'add_new' => esc_html__( 'Add New', 'notificationx' ) ,
266 'add_new_item' => esc_html__( 'Add New', 'notificationx' ),
267 'edit_item' => esc_html__( 'Edit', 'notificationx' ),
268 'new_item' => esc_html__( 'New', 'notificationx' ),
269 'view_item' => esc_html__( 'View', 'notificationx' ),
270 'search_items' => esc_html__( 'Search', 'notificationx' ),
271 'not_found' => esc_html__( 'No notification x is found', 'notificationx' ),
272 'not_found_in_trash' => esc_html__( 'No notification x is found in Trash', 'notificationx' ),
273 'menu_name' => 'NotificationX',
274 );
275
276 $args = array(
277 'labels' => $labels,
278 'hierarchical' => false,
279 'description' => '',
280 'taxonomies' => array( '' ),
281 'public' => false,
282 'show_ui' => true,
283 'show_in_menu' => 'notificationx',
284 'show_in_admin_bar' => true,
285 'show_in_rest' => false,
286 'menu_position' => 80,
287 'menu_icon' => NOTIFICATIONX_ADMIN_URL . 'assets/img/nx-menu-icon.png',
288 'show_in_nav_menus' => false,
289 'publicly_queryable' => false,
290 'exclude_from_search' => true,
291 'has_archive' => false,
292 'query_var' => true,
293 'can_export' => true,
294 'rewrite' => '',
295 'capability_type' => 'post',
296 'supports' => array( 'title' ),
297 );
298
299 register_post_type( $this->type, $args );
300 add_image_size( "_nx_notification_thumb", 100, 100, true );
301 }
302
303 /**
304 * Admin Menu Page
305 *
306 * @return void
307 */
308 public function menu_page(){
309
310 $settings_class = new NotificationX_Settings();
311
312 $settings = apply_filters( 'notificationx_admin_menu', array(
313 'nx-settings' => array(
314 'title' => __('Settings', 'notificationx'),
315 'capability' => 'delete_users',
316 'callback' => array( $settings_class, 'settings_page' )
317 ),
318 'nx-builder' => array(
319 'title' => __('Quick Builder', 'notificationx'),
320 'capability' => 'delete_users',
321 'callback' => array( $this, 'quick_builder' )
322 ),
323 ) );
324
325 $this->builder_args = NotificationX_MetaBox::get_builder_args();
326 $this->metabox_id = $this->builder_args['id'];
327 $flag = true;
328 /**
329 * Add Submit
330 */
331 if( isset( $_POST[ 'nx_builder_add_submit' ] ) ) :
332 if ( ! isset( $_POST[$this->metabox_id . '_nonce'] ) || ! wp_verify_nonce( $_POST[$this->metabox_id . '_nonce'], $this->metabox_id ) ) {
333 $flag = false;
334 }
335
336 if( $flag ) {
337
338 if( $_POST['nx_meta_display_type'] == 'press_bar' ) {
339 $title = __('NotificationX - Notification Bar', 'notificationx');
340 } elseif( $_POST['nx_meta_display_type'] == 'comments' ) {
341 $title = __('NotificationX - WP Comments', 'notificationx');
342 } elseif( $_POST['nx_meta_display_type'] == 'conversions' ) {
343 $conversions = NotificationX_Helper::conversion_from();
344 $title = 'NotificationX - ' . $conversions[$_POST['nx_meta_conversion_from']];
345 }
346 $_POST['post_type'] = 'notificationx';
347 $postdata = array(
348 'post_type' => 'notificationx',
349 'post_title' => $title . ' - ' . date( get_option( 'date_format' ), current_time( 'timestamp' ) ),
350 'post_status' => 'publish',
351 'post_author' => get_current_user_id()
352 );
353
354 $p_id = wp_insert_post($postdata);
355 if( $p_id || ! is_wp_error( $p_id ) ) {
356 do_action( 'nx_before_builder_submit', $_POST );
357 // saving builder meta data with post
358 NotificationX_MetaBox::save_data( $this->builder_data( $_POST ), $p_id );
359 /**
360 * Safely Redirect to NotificationX Page
361 */
362 wp_safe_redirect( add_query_arg( array(
363 'post_type' => 'notificationx',
364 ), admin_url( 'edit.php' ) ) );
365 }
366 }
367 endif;
368 add_menu_page( 'NotificationX', 'NotificationX', 'delete_users', 'notificationx', '', NOTIFICATIONX_ADMIN_URL . 'assets/img/nx-menu-icon.png', 80 );
369 foreach( $settings as $slug => $setting ) {
370 $cap = isset( $setting['capability'] ) ? $setting['capability'] : 'delete_users';
371 $hook = add_submenu_page( 'notificationx', $setting['title'], $setting['title'], $cap, $slug, $setting['callback'] );
372 }
373 }
374
375 public function quick_builder(){
376 $builder_args = $this->builder_args;
377 $tabs = $this->builder_args['tabs'];
378 $prefix = self::$prefix;
379 $metabox_id = $this->metabox_id;
380 /**
381 * This lines of code is for editing a notification in simple|quick builder
382 *
383 * @var [type]
384 */
385 $idd = null;
386 if( isset( $_GET['post_id'] ) && ! empty( $_GET['post_id'] )) {
387 $idd = intval( $_GET['post_id'] );
388 }
389 include_once NOTIFICATIONX_ADMIN_DIR_PATH . 'partials/nx-quick-builder-display.php';
390 }
391 /**
392 * Generate the builder data acording to default meta data
393 *
394 * @param array $data
395 * @return array
396 */
397 protected function builder_data( $data ) {
398 $post_data = [];
399 $prefix = self::$prefix;
400 $meta_fields = NotificationX_MetaBox::get_metabox_fields( $prefix );
401 foreach( $meta_fields as $meta_key => $meta_field ) {
402 if( in_array( $meta_key, array_keys($data) ) ) {
403 $post_data[ $meta_key ] = $data[ $meta_key ];
404 } else {
405 $post_data[ $meta_key ] = '';
406
407 if( isset( $meta_field['defaults'] ) ) {
408 $post_data[ $meta_key ] = $meta_field['defaults'];
409 }
410 if( isset( $meta_field['default'] ) ) {
411 $post_data[ $meta_key ] = $meta_field['default'];
412 }
413 }
414 }
415
416 return array_merge( $post_data, $data );
417 }
418
419 public static function get_form_action( $query_var = '', $builder_form = false ) {
420 $page = '/admin.php?page=nx-settings';
421 if( $builder_form ) {
422 $page = '/admin.php?page=nx-builder';
423 }
424
425 if ( is_network_admin() ) {
426 return network_admin_url( $page . $query_var );
427 } else {
428 return admin_url( $page . $query_var );
429 }
430 }
431
432 public function notification_preview(){
433 global $pagenow, $post_type, $post;
434 if ( ! in_array( $pagenow, array( 'post.php', 'post-new.php' ) ) ) {
435 return false;
436 }
437 if ( $this->type != $post_type ) {
438 return false;
439 }
440 $display_type = get_post_meta( $post->ID, '_nx_meta_display_type', true );
441
442 include NOTIFICATIONX_ADMIN_DIR_PATH . 'partials/nx-admin-preview.php';
443 }
444
445 public function preview_html( $settings, $type = 'conversion' ){
446 $data = array(
447 'comment' => array(
448 'link' => '#',
449 'post_title' => 'Hello world!',
450 'post_link' => '#',
451 'timestamp' => '1550986787',
452 'user_id' => get_current_user_id(),
453 'name' => 'John D',
454 ),
455 'conversion' => array(
456 'link' => '#',
457 'title' => 'Hello world!',
458 'timestamp' => '1550986787',
459 'user_id' => get_current_user_id(),
460 'name' => 'John D',
461 )
462 );
463
464 $unique_id = uniqid( 'notificationx-' );
465 $output = '<div id="'. esc_attr( $unique_id ) .'" class="nx-notification '. NotificationX_Extension::get_classes( $settings ) .'">';
466 $output .= '<div '. NotificationX_Public::generate_preview_css( $settings ) .' class="notificationx-inner '. NotificationX_Extension::get_classes( $settings, 'inner' ) .'">';
467 $output .= '<div class="notificationx-image nx-preview-image">';
468 $output .= '<img class="'. NotificationX_Extension::get_classes( $settings, 'img' ) .'" src="'. NOTIFICATIONX_ADMIN_URL . 'assets/img/placeholder-300x300.png" alt="">';
469 $output .= '</div>';
470 $output .= '<div class="notificationx-content">';
471 if( $type === 'conversion' ) :
472 $output .= NotificationX_Template::get_template_ready( $settings->woo_template, NotificationX_Extension::newData( $data[ 'conversion' ] ), $settings );
473 endif;
474 if( $type === 'comment' ) :
475 $output .= NotificationX_Template::get_template_ready( $settings->comments_template, NotificationX_Extension::newData( $data[ 'comment' ] ), $settings );
476 endif;
477 if( $settings->close_button ) :
478 $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>';
479 endif;
480 if( is_null( NotificationX_Extension::$powered_by ) ) :
481 $output .= '<small class="nx-branding">';
482 $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>';
483 $output .= ' by <a href="'. NOTIFICATIONX_PLUGIN_URL .'?utm_source='. urlencode( home_url() ) .'&utm_medium=notificationx_referrer" target="_blank" class="nx-powered-by">NotificationX</a>';
484 $output .= '</small>';
485 endif;
486 $output .= '</div>';
487 $output .= '</div>';
488 $output .= '</div>';
489
490 return $output;
491 }
492
493 public static function get_post_meta( $post_id, $key, $single = true ) {
494 return get_post_meta( $post_id, '_nx_meta_' . $key, $single );
495 }
496 public static function update_post_meta( $post_id, $key, $value ) {
497 update_post_meta( $post_id, '_nx_meta_' . $key, $value );
498 }
499 }