PluginProbe
Post Grid Gutenberg Blocks – PostX / 5.1.1
Post Grid Gutenberg Blocks – PostX v5.1.1
5.1.1 5.1.0 5.0.41 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 All 240 releases
← All changes | classes/Options.php +8 -104 5.0.38 → 5.1.1 View file →
@@ -70,70 +70,15 @@
70 70 * @param array $links Default plugin action links.
71 71 * @return array Modified plugin action links.
72 72 */
73 73 public function plugin_action_links_callback( $links ) {
74 - $offer_config = array(
75 - array(
76 - 'start' => '2026-07-06 00:00 Asia/Dhaka',
77 - 'end' => '2026-08-01 23:59 Asia/Dhaka',
78 - 'text' => __(
79 - 'Summer Sale - Up to 50% OFF',
80 - 'ultimate-post'
81 - ),
82 - 'utmKey' => 'summer_sale_meta',
83 - ),
84 - array(
85 - 'start' => '2026-08-02 00:00 Asia/Dhaka',
86 - 'end' => '2026-08-16 23:59 Asia/Dhaka',
87 - 'text' => __(
88 - 'Summer Sale - Up to 50% OFF',
89 - 'ultimate-post'
90 - ),
91 - 'utmKey' => 'summer_sale_meta',
92 - ),
93 - );
94 -
95 74 $setting_link = array(
96 75 'ultp_options' => '<a href="' . esc_url( admin_url( 'admin.php?page=ultp-settings#startersites' ) ) . '">' . esc_html__( 'Starter Sites', 'ultimate-post' ) . '</a>',
97 76 );
98 77
99 - $upgrade_link = array();
100 -
101 - // Free user or expired license user.
102 - if ( ! defined( 'ULTP_PRO_VER' ) || Xpo::is_lc_expired() ) {
103 -
104 - $license_key = Xpo::get_lc_key() ?? '';
105 -
106 - if ( Xpo::is_lc_expired() ) {
107 - $text = esc_html__( 'Renew License', 'ultimate-post' );
108 - $url = 'https://account.wpxpo.com/checkout/?edd_license_key=' . $license_key;
109 - } else {
110 -
111 - $text = esc_html__( 'Upgrade to Pro', 'ultimate-post' );
112 - $url = Xpo::generate_utm_link(array(
113 - 'utmKey' => 'sub_menu',
114 - ));
115 -
116 - foreach ( $offer_config as $offer ) {
117 - $current_time = gmdate( 'U' );
118 - $notice_start = gmdate( 'U', strtotime( $offer['start'] ) );
119 - $notice_end = gmdate( 'U', strtotime( $offer['end'] ) );
120 - if ( $current_time >= $notice_start && $current_time <= $notice_end ) {
121 - $url = Xpo::generate_utm_link(
122 - array(
123 - 'utmKey' => $offer['utmKey'],
124 - )
125 - );
126 - $text = $offer['text'];
127 - break;
128 - }
129 - }
130 - }
131 -
132 - $upgrade_link['ultp_pro'] = '<a style="color: #0062ff; font-weight: bold;" target="_blank" href="' . esc_url( $url ) . '">' . esc_html( $text ) . '</a>';
133 - }
134 -
135 - return array_merge( $setting_link, $links, $upgrade_link );
78 + // The "Upgrade to Pro" / "Renew License" link is added after this by
79 + // includes/notice/class-promo-links.php.
80 + return array_merge( $setting_link, $links );
136 81 }
137 82
138 83
139 84 /**
@@ -194,52 +139,10 @@
194 139 'ultp-setup-wizard',
195 140 array( __CLASS__, 'ultp_wizard_page' )
196 141 );
197 142
198 - $pro_link = '';
199 - $pro_link_text = '';
143 + // The "Upgrade to Pro" / "Renew License" item is added last by includes/notice/class-promo-links.php.
200 144
201 - // Check if current date is between November 5th and December 10th
202 - $current_date = current_time( 'Y-m-d' );
203 - $start_date = date( 'Y' ) . '-01-01'; // January 1st of current year
204 - $end_date = date( 'Y' ) . '-02-15'; // February 15th of current year
205 - $menu_pro_text_period = ( $current_date >= $start_date && $current_date <= $end_date );
206 -
207 - if ( ! Xpo::is_lc_active() ) {
208 - $pro_link = Xpo::generate_utm_link(
209 - array(
210 - 'utmKey' => 'sub_menu',
211 - )
212 - );
213 - $pro_link_text = $menu_pro_text_period ? __( 'New Year Offer!', 'ultimate-post' ) : __( 'Upgrade to Pro', 'ultimate-post' );
214 - } elseif ( Xpo::is_lc_expired() ) {
215 - $license_key = Xpo::get_lc_key();
216 - $pro_link = 'https://account.wpxpo.com/checkout/?edd_license_key=' . $license_key;
217 - $pro_link_text = __( 'Renew License', 'ultimate-post' );
218 - }
219 -
220 - if ( ! empty( $pro_link ) ) {
221 - ob_start();
222 - ?>
223 - <a href="<?php echo esc_url( $pro_link ); ?>" target="_blank" class="ultp-go-pro">
224 - <svg width="20" height="20" viewBox="0 0 20 20" fill="none" xmlns="http://www.w3.org/2000/svg">
225 - <path d="M2.86 6.553a.5.5 0 01.823-.482l3.02 2.745c.196.178.506.13.64-.098L9.64 4.779a.417.417 0 01.72 0l2.297 3.939a.417.417 0 00.64.098l3.02-2.745a.5.5 0 01.823.482l-1.99 8.63a.833.833 0 01-.813.646H5.663a.833.833 0 01-.812-.646L2.86 6.553z" stroke="currentColor" stroke-width="1.5"></path>
226 - </svg>
227 - <span><?php echo esc_html( $pro_link_text ); ?></span>
228 - </a>
229 - <?php
230 - $submenu_content = ob_get_clean();
231 -
232 - add_submenu_page(
233 - 'ultp-settings',
234 - '',
235 - $submenu_content,
236 - 'manage_options',
237 - 'ultp-pro',
238 - array( self::class, 'handle_external_redirects' )
239 - );
240 - }
241 -
242 145 add_theme_page(
243 146 __( 'Starter Sites', 'ultimate-post' ),
244 147 __( 'Starter Sites', 'ultimate-post' ),
245 148 $menupage_cap,
@@ -295,13 +198,14 @@
295 198 public function handle_external_redirects() {
296 199 if (empty($_GET['page'])) { // @codingStandardsIgnoreLine
297 200 return;
298 201 }
299 - $_page = sanitize_key( $_GET['page'] );
202 + $_page = sanitize_key( $_GET['page'] ); // phpcs:ignore WordPress.Security.NonceVerification.Recommended -- Read-only admin page slug.
300 203 if ('ultp-startersites' === $_page) { // @codingStandardsIgnoreLine
301 - exit( wp_safe_redirect( admin_url( 'admin.php?page=ultp-settings#startersites' ) ) );
204 + wp_safe_redirect( admin_url( 'admin.php?page=ultp-settings#startersites' ) );
205 + exit;
302 206 } else if ('go_postx_pro' === $_page) { // @codingStandardsIgnoreLine
303 - wp_redirect(
207 + wp_redirect( // phpcs:ignore WordPress.Security.SafeRedirect.wp_redirect_wp_redirect -- Intentional redirect to the fixed wpxpo.com pricing URL.
304 208 Xpo::generate_utm_link(
305 209 array(
306 210 'utmKey' => 'dashboard_go_pro',
307 211 )