PluginProbe
Post Grid Gutenberg Blocks – PostX / 2.4.24
Post Grid Gutenberg Blocks – PostX v2.4.24
5.0.39 5.0.38 5.0.37 5.0.36 5.0.35 5.0.34 5.0.33 5.0.32 5.0.31 5.0.30 5.0.29 5.0.28 5.0.27 5.0.26 5.0.25 5.0.23 5.0.24 5.0.22 5.0.21 5.0.20 5.0.19 5.0.18 5.0.17 2.1.1 2.1.2 All 237 releases
ultimate-post / classes / Notice.php

Notice.php in Post Grid Gutenberg Blocks – PostX 2.4.24, at classes/Notice.php

210 lines 7.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Notice Action.
4 *
5 * @package ULTP\Notice
6 * @since v.1.0.0
7 */
8 namespace ULTP;
9
10 defined('ABSPATH') || exit;
11
12 /**
13 * Notice class.
14 */
15 class Notice {
16
17 /**
18 * Setup class.
19 *
20 * @since v.1.0.0
21 */
22 public function __construct(){
23 add_action('admin_notices', array($this, 'ultp_installation_notice_callback'));
24 add_action('admin_init', array($this, 'set_dismiss_notice_callback'));
25 }
26
27
28 /**
29 * Promotional Dismiss Notice Option Data
30 *
31 * @since v.2.0.1
32 * @param NULL
33 * @return NULL
34 */
35 public function set_dismiss_notice_callback() {
36 if (!isset($_GET['disable_postx_notice'])) {
37 return ;
38 }
39 if ($_GET['disable_postx_notice'] == 'yes') {
40 set_transient( 'ultp_get_pro_notice_v3', 'off', 2592000 ); // 30 days notice
41 }
42 }
43
44
45 /**
46 * Dismiss Notice HTML Data
47 *
48 * @since v.1.0.0
49 * @param NULL
50 * @return STRING
51 */
52 public function ultp_installation_notice_callback() {
53 if (get_transient('ultp_get_pro_notice_v3') != 'off') {
54 if (!ultimate_post()->is_lc_active()) {
55 if (!isset($_GET['disable_postx_notice'])) {
56 $this->ultp_notice_css();
57 ?>
58 <div class="wc-install ultp-pro-notice">
59 <!-- <div class="wc-install-body ultp-image-banner">
60 <a class="wc-dismiss-notice" href="<?php //echo esc_url( add_query_arg( 'disable_postx_notice', 'yes' ) ); ?>"><span class="dashicons dashicons-dismiss"></span></a>
61 <a class="ultp-btn-image" target="_blank" href="<?php //echo ultimate_post()->get_premium_link(); ?>">
62 <img loading="lazy" src="<?php //echo ULTP_URL.'assets/img/banner.jpg'; ?>" alt="up to 40% Off" />
63 </a>
64 </div> -->
65 <!-- <div class="wc-install-body">
66 <div><?php _e('<strong>PostX - ⚡Flash Sale⚡</strong> is LIVE! Spend <strong style="color:#1cb53e;">25% LESS</strong> on Premium Features for a <strong>⏳LIMITED Time!</strong>', 'ultimate-post'); ?></div>
67 <a class="button button-primary button-hero ultp-btn-notice-pro" target="_blank" href="<?php echo ultimate_post()->get_premium_link(); ?>"><span class="dashicons dashicons-image-rotate"></span><?php _e('Get Now', 'ultimate-post'); ?></a>
68 <a class="button-secondary button-large" href="<?php echo esc_url( add_query_arg( 'disable_postx_notice', 'yes' ) )?>"><?php _e('No Thanks!', 'ultimate-post'); ?></a>
69 </div> -->
70 <div class="wc-install-body">
71 <div><?php _e('Thanks for using the free version of <strong>PostX Gutenberg Blocks</strong>. We have a special <strong style="color:green">20% discount</strong> for a limited time. Use this coupon:', 'ultimate-post'); ?><strong><code>POSTXAD20</code></strong></div>
72 <a class="button button-primary button-hero ultp-btn-notice-pro" target="_blank" href="<?php echo ultimate_post()->get_premium_link(); ?>"><span class="dashicons dashicons-image-rotate"></span><?php _e('Upgrading to Pro', 'ultimate-post'); ?></a>
73 <a class="button-secondary button-large" href="<?php echo esc_url( add_query_arg( 'disable_postx_notice', 'yes' ) )?>"><?php _e('No Thanks / Close.', 'ultimate-post'); ?></a>
74 </div>
75 </div>
76 <?php
77 }
78 }
79 }
80 }
81
82
83 /**
84 * Admin Notice CSS File
85 *
86 * @since v.1.0.0
87 * @param NULL
88 * @return STRING
89 */
90 public function ultp_notice_css() {
91 ?>
92 <style type="text/css">
93 .wc-install {
94 display: flex;
95 align-items: center;
96 background: #fff;
97 margin-top: 40px;
98 width: calc(100% - 50px);
99 /* width: calc(100% - 40px); */
100 border: 1px solid #ccd0d4;
101 /* padding: 8px 8px 4px 8px; */
102 padding: 12px 15px;
103 border-radius: 4px;
104 border-left: 3px solid #2271b1;
105 }
106 .wc-install img {
107 margin-right: 0;
108 max-width: 100%;
109 }
110 .wc-install-body {
111 -ms-flex: 1;
112 flex: 1;
113 position: relative;
114 }
115 /* .wc-install-body > div {
116 max-width: 450px;
117 margin-bottom: 20px;
118 } */
119 .wc-install-body h3 {
120 margin-top: 0;
121 font-size: 24px;
122 margin-bottom: 15px;
123 }
124 .ultp-install-btn {
125 margin-top: 15px;
126 display: inline-block;
127 }
128 .wc-install .dashicons{
129 display: none;
130 animation: dashicons-spin 1s infinite;
131 animation-timing-function: linear;
132 }
133 .wc-install.loading .dashicons {
134 display: inline-block;
135 margin-top: 12px;
136 margin-right: 5px;
137 }
138 .ultp-pro-notice .wc-install-body h3 {
139 font-size: 20px;
140 margin-bottom: 5px;
141 }
142 .ultp-pro-notice .wc-install-body > div {
143 max-width: 100%;
144 margin-bottom: 10px;
145 }
146 .ultp-pro-notice .button-hero {
147 padding: 8px 14px !important;
148 min-height: inherit !important;
149 line-height: 1 !important;
150 /* background: #46b450; */
151 box-shadow: none;
152 border: none;
153 transition: 400ms;
154 }
155 .ultp-pro-notice .ultp-btn-notice-pro {
156 background: #2271b1;
157 color: #fff;
158 }
159 .ultp-pro-notice .ultp-btn-notice-pro:hover,
160 .ultp-pro-notice .ultp-btn-notice-pro:focus {
161 background: #185a8f;
162 }
163 .ultp-pro-notice .button-hero:hover,
164 .ultp-pro-notice .button-hero:focus {
165 /* background: #349a3d; */
166 border: none;
167 box-shadow: none;
168 }
169 @keyframes dashicons-spin {
170 0% {
171 transform: rotate( 0deg );
172 }
173 100% {
174 transform: rotate( 360deg );
175 }
176 }
177 .wc-dismiss-notice {
178 position: absolute;
179 text-decoration: none;
180 float: right;
181 right: 0px;
182 color: #787c82;
183 transition: 400ms;
184 top: 0px
185 }
186 .wc-dismiss-notice:hover {
187 color:red;
188 }
189 .wc-dismiss-notice .dashicons{
190 display: inline-block;
191 text-decoration: none;
192 animation: none;
193 font-size: 16px;
194 /* width: 25px;
195 height: 25px;
196 line-height: 25px;
197 border-radius: 100px;
198 background: #f81430; */
199 }
200 /* .wc-dismiss-notice:hover {
201 color: #fff;
202 } */
203 /* .wc-dismiss-notice:hover .dashicons{
204 background: #cc142a;
205 } */
206 </style>
207 <?php
208 }
209
210 }