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

207 lines 7.4 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_v1'])) {
35 return ;
36 }
37 if ($_GET['disable_postx_notice_v1'] == 'yes') {
38 set_transient( 'ultp_get_pro_notice_v6', '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_v6') != 'off') {
51 if (!ultimate_post()->is_lc_active()) {
52 if (!isset($_GET['disable_postx_notice_v1'])) {
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_v1', '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_v1', 'yes' ) )?>"><?php //_e('No Thanks!', 'ultimate-post'); ?></a>
66 </div> -->
67 <div class="wc-install-body">
68 <div><?php _e("Be a part of <strong>PostX's</strong> 🍉 <strong style='color:#1cb53e;'>Summer Sale</strong> Celebration by Getting Up to 🔥 <strong>30% DISCOUNT</strong> on PostX! ", 'ultimate-post'); ?></div>
69 <!-- <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> -->
70 <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>
71 <a class="button-secondary button-large" href="<?php echo esc_url( add_query_arg( 'disable_postx_notice_v1', 'yes' ) )?>"><?php _e('No Thanks / Close.', 'ultimate-post'); ?></a>
72 </div>
73 </div>
74 <?php
75 }
76 }
77 }
78 }
79
80 /**
81 * Admin Notice CSS File
82 *
83 * @since v.1.0.0
84 * @param NULL
85 * @return STRING
86 */
87 public function ultp_notice_css() {
88 ?>
89 <style type="text/css">
90 .wc-install {
91 display: flex;
92 align-items: center;
93 background: #fff;
94 margin-top: 40px;
95 width: calc(100% - 50px);
96 /* width: calc(100% - 40px); */
97 border: 1px solid #ccd0d4;
98 /* padding: 8px 8px 4px 8px; */
99 padding: 12px 15px;
100 border-radius: 4px;
101 border-left: 3px solid #2271b1;
102 }
103 .wc-install img {
104 margin-right: 0;
105 max-width: 100%;
106 }
107 .wc-install-body {
108 -ms-flex: 1;
109 flex: 1;
110 position: relative;
111 }
112 /* .wc-install-body > div {
113 max-width: 450px;
114 margin-bottom: 20px;
115 } */
116 .wc-install-body h3 {
117 margin-top: 0;
118 font-size: 24px;
119 margin-bottom: 15px;
120 }
121 .ultp-install-btn {
122 margin-top: 15px;
123 display: inline-block;
124 }
125 .wc-install .dashicons{
126 display: none;
127 animation: dashicons-spin 1s infinite;
128 animation-timing-function: linear;
129 }
130 .wc-install.loading .dashicons {
131 display: inline-block;
132 margin-top: 12px;
133 margin-right: 5px;
134 }
135 .ultp-pro-notice .wc-install-body h3 {
136 font-size: 20px;
137 margin-bottom: 5px;
138 }
139 .ultp-pro-notice .wc-install-body > div {
140 max-width: 100%;
141 margin-bottom: 10px;
142 }
143 .ultp-pro-notice .button-hero {
144 padding: 8px 14px !important;
145 min-height: inherit !important;
146 line-height: 1 !important;
147 /* background: #46b450; */
148 box-shadow: none;
149 border: none;
150 transition: 400ms;
151 }
152 .ultp-pro-notice .ultp-btn-notice-pro {
153 background: #2271b1;
154 color: #fff;
155 }
156 .ultp-pro-notice .ultp-btn-notice-pro:hover,
157 .ultp-pro-notice .ultp-btn-notice-pro:focus {
158 background: #185a8f;
159 }
160 .ultp-pro-notice .button-hero:hover,
161 .ultp-pro-notice .button-hero:focus {
162 /* background: #349a3d; */
163 border: none;
164 box-shadow: none;
165 }
166 @keyframes dashicons-spin {
167 0% {
168 transform: rotate( 0deg );
169 }
170 100% {
171 transform: rotate( 360deg );
172 }
173 }
174 .wc-dismiss-notice {
175 position: absolute;
176 text-decoration: none;
177 float: right;
178 right: 0px;
179 color: #787c82;
180 transition: 400ms;
181 top: 0px
182 }
183 .wc-dismiss-notice:hover {
184 color:red;
185 }
186 .wc-dismiss-notice .dashicons{
187 display: inline-block;
188 text-decoration: none;
189 animation: none;
190 font-size: 16px;
191 /* width: 25px;
192 height: 25px;
193 line-height: 25px;
194 border-radius: 100px;
195 background: #f81430; */
196 }
197 /* .wc-dismiss-notice:hover {
198 color: #fff;
199 } */
200 /* .wc-dismiss-notice:hover .dashicons{
201 background: #cc142a;
202 } */
203 </style>
204 <?php
205 }
206
207 }