PluginProbe
E2Pdf – Export Pdf Tool for WordPress / 1.08.00
E2Pdf – Export Pdf Tool for WordPress v1.08.00
1.32.49 1.32.48 1.32.43 1.32.40 1.32.34 1.32.32 1.32.31 1.32.26 1.32.22 1.32.23 1.32.18 1.32.17 1.32.15 trunk 1.00.00 1.00.13 1.01.01 1.02.02 1.03.07 1.04.07 1.05.03 1.06.02 1.07.11 1.08.00 1.08.06 All 72 releases
e2pdf / classes / model / e2pdf-notification.php

e2pdf-notification.php in E2Pdf – Export Pdf Tool for WordPress 1.08.00, at classes/model/e2pdf-notification.php

75 lines 2.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * E2pdf Notification Helper
5 *
6 * @copyright Copyright 2017 https://e2pdf.com
7 * @license GPL v2
8 * @version 1
9 * @link https://e2pdf.com
10 * @since 0.00.01
11 */
12 if (!defined('ABSPATH')) {
13 die('Access denied.');
14 }
15
16 class Model_E2pdf_Notification extends Model_E2pdf_Model {
17
18 protected static $instance = NULL;
19
20 /**
21 * Add notification
22 *
23 * @param string $type - Notification type
24 * @param string $text - Notification text
25 */
26 public function add_notification($type, $text) {
27 $notifications = get_transient('e2pdf_notifications');
28 $notifications[] = array(
29 'type' => $type,
30 'text' => $text,
31 );
32 set_transient('e2pdf_notifications', $notifications);
33 }
34
35 /**
36 * Get notifications
37 *
38 * @return array - List of notifications
39 */
40 public function get_notifications() {
41 $notifications = get_transient('e2pdf_notifications');
42 if (!get_option('e2pdf_hide_warnings')) {
43
44 if (!is_array($notifications)) {
45 $notifications = array();
46 }
47
48 if ($this->helper->get('license')->get('status') == 'pre_expired') {
49 array_unshift($notifications, array(
50 'type' => 'notice',
51 'text' => sprintf(__("Your E2Pdf License Key will expire at <strong>%s</strong>. Please click <a target='_blank' href='%s'>here</a> to renew it.", 'e2pdf'), $this->helper->get('license')->get('expire'), 'https://e2pdf.com/checkout/license/renew/' . get_option('e2pdf_license'))
52 ));
53 }
54
55 if ($this->helper->get('license')->get('status') == 'expired') {
56 array_unshift($notifications, array(
57 'type' => 'error',
58 'text' => sprintf(__("Your E2Pdf License Key has expired. Please click <a target='_blank' href='%s'>here</a> to renew it.", 'e2pdf'), 'https://e2pdf.com/checkout/license/renew/' . get_option('e2pdf_license'))
59 ));
60 }
61
62 if ($this->helper->get('license')->get('type') == 'FREE') {
63 array_unshift($notifications, array(
64 'type' => 'notice',
65 'text' => sprintf(__("You are using FREE license type. Up to 1 page and up to 1 template allowed. Please check <a target='_blank' href='%s'>%s</a> for upgrade options.", 'e2pdf'), 'https://e2pdf.com/price', 'https://e2pdf.com')
66 ));
67 }
68 }
69
70 set_transient('e2pdf_notifications', array());
71 return $notifications;
72 }
73
74 }
75