PluginProbe
Post Grid Gutenberg Blocks – PostX / 2.4.26
Post Grid Gutenberg Blocks – PostX v2.4.26
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.26, at classes/Notice.php

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