| @@ -1,10 +1,11 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | // Exit if accessed directly. |
| 3 | 3 | defined( 'ABSPATH' ) || exit; |
| 4 | 4 | |
| 5 | -class Blockspare_Setup { | |
| 6 | 5 | |
| 6 | +class Blockspare_Setup | |
| 7 | +{ | |
| 7 | 8 | public $name; |
| 8 | 9 | public $type; |
| 9 | 10 | public $dismiss_url; |
| 10 | 11 | public $temporary_dismiss_url; |
| @@ -11,188 +12,132 @@ | ||
| 11 | 12 | public $pricing_url; |
| 12 | 13 | public $current_user_id; |
| 13 | 14 | |
| 14 | 15 | /** |
| 15 | - * Constructor. | |
| 16 | + * The constructor. | |
| 17 | + * | |
| 18 | + * @param string $name Notice Name. | |
| 19 | + * @param string $type Notice type. | |
| 20 | + * @param string $dismiss_url Notice permanent dismiss URL. | |
| 21 | + * @param string $temporary_dismiss_url Notice temporary dismiss URL. | |
| 22 | + * | |
| 23 | + * @since 1.4.7 | |
| 24 | + * | |
| 16 | 25 | */ |
| 17 | - public function __construct( $name, $type, $dismiss_url, $temporary_dismiss_url ) { | |
| 26 | + public function __construct($name, $type, $dismiss_url, $temporary_dismiss_url) | |
| 27 | + { | |
| 28 | + $this->name = $name; | |
| 29 | + $this->type = $type; | |
| 30 | + $this->dismiss_url = $dismiss_url; | |
| 31 | + $this->temporary_dismiss_url = $temporary_dismiss_url; | |
| 32 | + $this->pricing_url = 'https://www.blockspare.com/pricing/'; | |
| 33 | + $this->current_user_id = get_current_user_id(); | |
| 18 | 34 | |
| 19 | - $this->name = $name; | |
| 20 | - $this->type = $type; | |
| 21 | - $this->dismiss_url = $dismiss_url; | |
| 22 | - $this->temporary_dismiss_url = $temporary_dismiss_url; | |
| 23 | - $this->pricing_url = 'https://www.blockspare.com/'; | |
| 24 | - $this->current_user_id = get_current_user_id(); | |
| 35 | + // Notice markup. | |
| 36 | + add_action('admin_notices', array($this, 'notice')); | |
| 25 | 37 | |
| 26 | - add_action( 'admin_notices', array( $this, 'notice' ) ); | |
| 27 | - | |
| 28 | 38 | $this->dismiss_notice(); |
| 29 | 39 | $this->dismiss_notice_temporary(); |
| 30 | 40 | } |
| 31 | 41 | |
| 32 | - /** | |
| 33 | - * Display notice. | |
| 34 | - */ | |
| 35 | - public function notice() { | |
| 42 | + public function notice() | |
| 43 | + { | |
| 36 | 44 | |
| 37 | - if ( ! current_user_can( 'publish_posts' ) ) { | |
| 38 | - return; | |
| 39 | - } | |
| 40 | - | |
| 41 | 45 | $current_screen = get_current_screen(); |
| 42 | - | |
| 43 | - if ( ! $current_screen ) { | |
| 44 | - return; | |
| 45 | - } | |
| 46 | - | |
| 47 | - if ( | |
| 48 | - 'dashboard' !== $current_screen->id && | |
| 49 | - 'themes' !== $current_screen->id && | |
| 50 | - 'plugins' !== $current_screen->id | |
| 51 | - ) { | |
| 52 | - return; | |
| 53 | - } | |
| 54 | - | |
| 55 | - if ( ! $this->is_dismiss_notice() ) { | |
| 46 | + if ( $current_screen->id !=='dashboard' && $current_screen->id !== 'themes' && $current_screen->id !=='plugins' ) { | |
| 47 | + | |
| 48 | + return; | |
| 49 | + } | |
| 50 | + | |
| 51 | + if (!$this->is_dismiss_notice()) { | |
| 52 | + | |
| 56 | 53 | $this->notice_markup(); |
| 57 | 54 | } |
| 58 | 55 | } |
| 59 | 56 | |
| 60 | - /** | |
| 61 | - * Check if notice dismissed. | |
| 62 | - */ | |
| 63 | - private function is_dismiss_notice() { | |
| 64 | - return apply_filters( 'blockspare_' . $this->name . '_notice_dismiss', false ); | |
| 57 | + private function is_dismiss_notice() | |
| 58 | + { | |
| 59 | + return apply_filters('blockspare_' . $this->name . '_notice_dismiss', true); | |
| 65 | 60 | } |
| 66 | 61 | |
| 67 | - /** | |
| 68 | - * Notice markup. | |
| 69 | - */ | |
| 70 | - public function notice_markup() { | |
| 62 | + public function notice_markup() | |
| 63 | + { | |
| 71 | 64 | echo ''; |
| 72 | 65 | } |
| 73 | 66 | |
| 74 | 67 | /** |
| 75 | - * Permanently dismiss notice. | |
| 68 | + * Hide a notice if the GET variable is set. | |
| 76 | 69 | */ |
| 77 | - public function dismiss_notice() { | |
| 78 | - | |
| 79 | - if ( | |
| 80 | - isset( $_GET['blockspare_setup_notice_dismiss'] ) && | |
| 81 | - isset( $_GET['_blockspare_setup_notice_dismiss_nonce'] ) | |
| 82 | - ) { | |
| 83 | - | |
| 84 | - if ( | |
| 85 | - ! wp_verify_nonce( | |
| 86 | - wp_unslash( $_GET['_blockspare_setup_notice_dismiss_nonce'] ), | |
| 87 | - 'blockspare_setup_notice_dismiss_nonce' | |
| 88 | - ) | |
| 89 | - ) { | |
| 90 | - wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'blockspare' ) ); | |
| 70 | + public function dismiss_notice() | |
| 71 | + { | |
| 72 | + if (isset($_GET['blockspare_setup_notice_dismiss']) && isset($_GET['_blockspare_setup_notice_dismiss_nonce'])) { // WPCS: input var ok. | |
| 73 | + if (!wp_verify_nonce(wp_unslash($_GET['_blockspare_setup_notice_dismiss_nonce']), 'blockspare_setup_notice_dismiss_nonce')) { // phpcs:ignore WordPress.VIP.ValidatedSanitizedInput.InputNotSanitized | |
| 74 | + wp_die(__('Action failed. Please refresh the page and retry.', 'blockspare')); // WPCS: xss ok. | |
| 91 | 75 | } |
| 92 | 76 | |
| 93 | - if ( ! current_user_can( 'publish_posts' ) ) { | |
| 94 | - wp_die( esc_html__( 'Cheatin’ huh?', 'blockspare' ) ); | |
| 77 | + if (!current_user_can('publish_posts')) { | |
| 78 | + wp_die(__('Cheatin’ huh?', 'blockspare')); // WPCS: xss ok. | |
| 95 | 79 | } |
| 96 | 80 | |
| 97 | - $dismiss_notice = sanitize_text_field( wp_unslash( $_GET['blockspare_setup_notice_dismiss'] ) ); | |
| 81 | + $dismiss_notice = sanitize_text_field(wp_unslash($_GET['blockspare_setup_notice_dismiss'])); | |
| 98 | 82 | |
| 99 | - // FIX: Match current notice name dynamically instead of hardcoded 'setup' | |
| 100 | - if ( $this->name === $dismiss_notice ) { | |
| 101 | - update_user_meta( | |
| 102 | - $this->current_user_id, | |
| 103 | - 'blockspare_' . $dismiss_notice . '_notice_dismiss', | |
| 104 | - 'yes' | |
| 105 | - ); | |
| 106 | - | |
| 107 | - wp_safe_redirect( remove_query_arg( array( 'blockspare_setup_notice_dismiss', '_blockspare_setup_notice_dismiss_nonce' ) ) ); | |
| 108 | - exit; | |
| 83 | + // Hide. | |
| 84 | + if ($dismiss_notice === $_GET['blockspare_setup_notice_dismiss']) { | |
| 85 | + add_user_meta(get_current_user_id(), 'blockspare_' . $dismiss_notice . '_notice_dismiss', 'yes', true); | |
| 109 | 86 | } |
| 110 | 87 | } |
| 111 | 88 | } |
| 112 | 89 | |
| 113 | - /** | |
| 114 | - * Temporarily dismiss notice. | |
| 115 | - */ | |
| 116 | - public function dismiss_notice_temporary() { | |
| 117 | - | |
| 118 | - if ( | |
| 119 | - isset( $_GET['blockspare_setup_notice_dismiss_temporary'] ) && | |
| 120 | - isset( $_GET['_blockspare_setup_notice_dismiss_temporary_nonce'] ) | |
| 121 | - ) { | |
| 122 | - | |
| 123 | - if ( | |
| 124 | - ! wp_verify_nonce( | |
| 125 | - wp_unslash( $_GET['_blockspare_setup_notice_dismiss_temporary_nonce'] ), | |
| 126 | - 'blockspare_setup_notice_dismiss_temporary_nonce' | |
| 127 | - ) | |
| 128 | - ) { | |
| 129 | - wp_die( esc_html__( 'Action failed. Please refresh the page and retry.', 'blockspare' ) ); | |
| 90 | + public function dismiss_notice_temporary() | |
| 91 | + { | |
| 92 | + if (isset($_GET['blockspare_setup_notice_dismiss_temporary']) && isset($_GET['_blockspare_setup_notice_dismiss_temporary_nonce'])) { // WPCS: input var ok. | |
| 93 | + if (!wp_verify_nonce(wp_unslash($_GET['_blockspare_setup_notice_dismiss_temporary_nonce']), 'blockspare_setup_notice_dismiss_temporary_nonce')) { // phpcs:ignore WordPress.VIP.ValidatedSanitizedInput.InputNotSanitized | |
| 94 | + wp_die(__('Action failed. Please refresh the page and retry.', 'blockspare')); // WPCS: xss ok. | |
| 130 | 95 | } |
| 131 | 96 | |
| 132 | - if ( ! current_user_can( 'publish_posts' ) ) { | |
| 133 | - wp_die( esc_html__( 'Cheatin’ huh?', 'blockspare' ) ); | |
| 97 | + if (!current_user_can('publish_posts')) { | |
| 98 | + wp_die(__('Cheatin’ huh?', 'blockspare')); // WPCS: xss ok. | |
| 134 | 99 | } |
| 135 | 100 | |
| 136 | - $dismiss_notice = sanitize_text_field( wp_unslash( $_GET['blockspare_setup_notice_dismiss_temporary'] ) ); | |
| 101 | + $dismiss_notice = sanitize_text_field(wp_unslash($_GET['blockspare_setup_notice_dismiss_temporary'])); | |
| 137 | 102 | |
| 138 | - // FIX: Match current notice name dynamically instead of hardcoded 'setup' | |
| 139 | - if ( $this->name === $dismiss_notice ) { | |
| 140 | - update_user_meta( | |
| 141 | - $this->current_user_id, | |
| 142 | - 'blockspare_' . $dismiss_notice . '_notice_dismiss_temporary', | |
| 143 | - 'yes' | |
| 144 | - ); | |
| 145 | - | |
| 146 | - wp_safe_redirect( remove_query_arg( array( 'blockspare_setup_notice_dismiss_temporary', '_blockspare_setup_notice_dismiss_temporary_nonce' ) ) ); | |
| 147 | - exit; | |
| 103 | + // Hide. | |
| 104 | + if ($dismiss_notice === $_GET['blockspare_setup_notice_dismiss_temporary']) { | |
| 105 | + add_user_meta(get_current_user_id(), 'blockspare_' . $dismiss_notice . '_notice_dismiss_temporary', 'yes', true); | |
| 148 | 106 | } |
| 149 | 107 | } |
| 150 | 108 | } |
| 151 | 109 | } |
| 152 | 110 | |
| 111 | + | |
| 153 | 112 | class Blockspare_Setup_Notice extends Blockspare_Setup { |
| 154 | 113 | |
| 155 | - /** | |
| 156 | - * Constructor. | |
| 157 | - */ | |
| 158 | 114 | public function __construct() { |
| 115 | + if ( ! current_user_can( 'publish_posts' ) ) { | |
| 116 | + return; | |
| 117 | + } | |
| 159 | 118 | |
| 160 | 119 | $dismiss_url = wp_nonce_url( |
| 161 | - add_query_arg( | |
| 162 | - 'blockspare_setup_notice_dismiss', | |
| 163 | - 'setup', | |
| 164 | - admin_url() | |
| 165 | - ), | |
| 120 | + add_query_arg( 'blockspare_setup_notice_dismiss', 'setup', admin_url() ), | |
| 166 | 121 | 'blockspare_setup_notice_dismiss_nonce', |
| 167 | 122 | '_blockspare_setup_notice_dismiss_nonce' |
| 168 | 123 | ); |
| 169 | 124 | |
| 170 | 125 | $temporary_dismiss_url = wp_nonce_url( |
| 171 | - add_query_arg( | |
| 172 | - 'blockspare_setup_notice_dismiss_temporary', | |
| 173 | - 'setup', | |
| 174 | - admin_url() | |
| 175 | - ), | |
| 126 | + add_query_arg( 'blockspare_setup_notice_dismiss_temporary', 'setup', admin_url() ), | |
| 176 | 127 | 'blockspare_setup_notice_dismiss_temporary_nonce', |
| 177 | 128 | '_blockspare_setup_notice_dismiss_temporary_nonce' |
| 178 | 129 | ); |
| 179 | 130 | |
| 180 | - parent::__construct( | |
| 181 | - 'setup', | |
| 182 | - 'info', | |
| 183 | - $dismiss_url, | |
| 184 | - $temporary_dismiss_url | |
| 185 | - ); | |
| 131 | + parent::__construct( 'setup', 'info', $dismiss_url, $temporary_dismiss_url ); | |
| 186 | 132 | |
| 187 | 133 | $this->set_notice_time(); |
| 134 | + | |
| 188 | 135 | $this->set_temporary_dismiss_notice_time(); |
| 136 | + | |
| 189 | 137 | $this->set_dismiss_notice(); |
| 190 | 138 | } |
| 191 | 139 | |
| 192 | - /** | |
| 193 | - * Set initial notice time. | |
| 194 | - */ | |
| 195 | 140 | private function set_notice_time() { |
| 196 | 141 | if ( ! get_option( 'blockspare_setup_notice_start_time' ) ) { |
| 197 | 142 | update_option( 'blockspare_setup_notice_start_time', time() ); |
| 198 | 143 | } |
| @@ -197,37 +142,27 @@ | ||
| 197 | 142 | update_option( 'blockspare_setup_notice_start_time', time() ); |
| 198 | 143 | } |
| 199 | 144 | } |
| 200 | 145 | |
| 201 | - /** | |
| 202 | - * Set temporary dismiss time. | |
| 203 | - */ | |
| 204 | 146 | private function set_temporary_dismiss_notice_time() { |
| 205 | - if ( | |
| 206 | - isset( $_GET['blockspare_setup_notice_dismiss_temporary'] ) && | |
| 207 | - 'setup' === $_GET['blockspare_setup_notice_dismiss_temporary'] | |
| 208 | - ) { | |
| 209 | - update_user_meta( | |
| 210 | - $this->current_user_id, | |
| 211 | - 'blockspare_setup_notice_dismiss_temporary_start_time', | |
| 212 | - time() | |
| 213 | - ); | |
| 147 | + if ( isset( $_GET['blockspare_setup_notice_dismiss_temporary'] ) && 'setup' === $_GET['blockspare_setup_notice_dismiss_temporary'] ) { | |
| 148 | + update_user_meta( $this->current_user_id, 'blockspare_setup_notice_dismiss_temporary_start_time', time() ); | |
| 214 | 149 | } |
| 215 | 150 | } |
| 216 | 151 | |
| 217 | - /** | |
| 218 | - * Set dismiss conditions. | |
| 219 | - */ | |
| 220 | 152 | public function set_dismiss_notice() { |
| 221 | - $user_id = get_current_user_id(); | |
| 222 | 153 | |
| 223 | - $is_permanently_dismissed = ( 'yes' === get_user_meta( $user_id, 'blockspare_setup_notice_dismiss', true ) ); | |
| 224 | - | |
| 225 | - $temporary_dismiss_time = (int) get_user_meta( $user_id, 'blockspare_setup_notice_dismiss_temporary_start_time', true ); | |
| 226 | - $is_temporarily_dismissed = ( $temporary_dismiss_time > strtotime( '-2 days' ) ); | |
| 227 | - | |
| 228 | - // FIX: Clean, predictable condition parsing | |
| 229 | - if ( $is_permanently_dismissed || $is_temporarily_dismissed ) { | |
| 154 | + /** | |
| 155 | + * Do not show notice if: | |
| 156 | + * | |
| 157 | + * 1. It has not been 5 days since the plugin is activated. | |
| 158 | + * 2. If the user has ignored the message partially for 2 days. | |
| 159 | + * 3. Dismiss always if clicked on 'Dismiss' button. | |
| 160 | + */ | |
| 161 | + if ( get_option( 'blockspare_setup_notice_start_time' ) > strtotime( '-1 minute' ) | |
| 162 | + || get_user_meta( get_current_user_id(), 'blockspare_setup_notice_dismiss', true ) | |
| 163 | + || get_user_meta( get_current_user_id(), 'blockspare_setup_notice_dismiss_temporary_start_time', true ) > strtotime( '-2 days' ) | |
| 164 | + ) { | |
| 230 | 165 | add_filter( 'blockspare_setup_notice_dismiss', '__return_true' ); |
| 231 | 166 | } else { |
| 232 | 167 | add_filter( 'blockspare_setup_notice_dismiss', '__return_false' ); |
| 233 | 168 | } |
| @@ -232,104 +167,86 @@ | ||
| 232 | 167 | add_filter( 'blockspare_setup_notice_dismiss', '__return_false' ); |
| 233 | 168 | } |
| 234 | 169 | } |
| 235 | 170 | |
| 236 | - /** | |
| 237 | - * Notice markup. | |
| 238 | - */ | |
| 239 | 171 | public function notice_markup() { |
| 172 | + if ( is_admin() ) { | |
| 173 | + if( ! function_exists('get_plugin_data') ){ | |
| 174 | + require_once( ABSPATH . 'wp-admin/includes/plugin.php' ); | |
| 175 | + } | |
| 176 | + $plugin_data = get_plugin_data( BLOCKSPARE_BASE_FILE ); | |
| 177 | + | |
| 178 | + } | |
| 240 | 179 | |
| 241 | - if ( ! function_exists( 'get_plugin_data' ) ) { | |
| 242 | - require_once ABSPATH . 'wp-admin/includes/plugin.php'; | |
| 243 | - } | |
| 244 | - | |
| 245 | - $plugin_data = get_plugin_data( BLOCKSPARE_BASE_FILE ); | |
| 246 | - $version = isset( $plugin_data['Version'] ) ? $plugin_data['Version'] : ''; | |
| 247 | - | |
| 248 | 180 | ?> |
| 249 | - | |
| 250 | - <div class="notice notice-success blockspare-notice-setup" style="padding: 18px; position: relative;"> | |
| 251 | - | |
| 252 | - <div style="display:flex; justify-content:space-between; gap:20px; align-items:flex-start;"> | |
| 253 | - | |
| 254 | - <div style="flex:1;"> | |
| 255 | - | |
| 256 | - <h2 style="margin:0 0 8px; font-size:18px; line-height:1.4;"> | |
| 257 | - <?php esc_html_e( 'Welcome to BlockSpare 👋', 'blockspare' ); ?> | |
| 258 | - </h2> | |
| 259 | - | |
| 260 | - <p style="margin:0 0 12px; font-size:14px; color:#555;"> | |
| 261 | - <?php esc_html_e( 'Build professional news, magazine, blog, and business websites faster using ready-made Gutenberg blocks, starter templates, and content-focused layouts.', 'blockspare' ); ?> | |
| 262 | - </p> | |
| 263 | - | |
| 264 | - <div style="display:flex; gap:10px; flex-wrap:wrap; margin-top:10px;"> | |
| 265 | - | |
| 266 | - <a | |
| 267 | - class="button button-primary" | |
| 268 | - href="<?php echo esc_url( admin_url( 'post-new.php?post_type=page&blockspare_show_intro=true' ) ); ?>" | |
| 269 | - > | |
| 270 | - <?php esc_html_e( 'Get Started', 'blockspare' ); ?> | |
| 271 | - </a> | |
| 272 | - | |
| 273 | - <a | |
| 274 | - class="button" | |
| 275 | - href="<?php echo esc_url( admin_url( 'admin.php?page=blockspare' ) ); ?>" | |
| 276 | - > | |
| 277 | - <?php esc_html_e( 'Browse Templates', 'blockspare' ); ?> | |
| 278 | - </a> | |
| 279 | - | |
| 280 | - <a | |
| 281 | - class="button button-secondary" | |
| 282 | - href="<?php echo esc_url( 'https://blockspare.com/' ); ?>" | |
| 283 | - target="_blank" | |
| 284 | - > | |
| 285 | - <?php esc_html_e( 'Learn More', 'blockspare' ); ?> | |
| 286 | - </a> | |
| 287 | - | |
| 181 | + <div class="notice notice-success blockspare-notice-setup" > | |
| 182 | + <div class="bs-welcome-panel-content"> | |
| 183 | + <div class="bs-welcome-panel-header"> | |
| 184 | + <div class="blockspare-notice-info"> | |
| 185 | + <div class='bs-welcome-panel-header-logo'> | |
| 186 | + <svg fill="url(#blockspare-gradient)" width="24" height="24" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 40 40" class="blockspare-svg blockspare-svg-blockspare" aria-hidden="true" focusable="false"><g class="blockspare-logo"><g><path class="st0" d="M1.6,9.2v21.4l18.3-9.2L20.2,0L1.6,9.2z M16.9,19.8L4.9,26V10.9l12-6.1V19.8z"></path><polygon id="XMLID_3_" class="st1" points="19.9,21.4 16.9,23 26,27.7 13.8,33.8 4.9,29 1.6,30.7 13.9,36.9 32.4,27.7"></polygon></g><g><polygon id="XMLID_2_" class="st0" points="23,1.5 23,19.8 32.4,24.6 32.4,9.4 35.3,10.9 35.3,29 38.4,30.7 38.4,9.2 29.4,4.8 29.2,19.7 26,18.4 26,3.1"></polygon><polygon id="XMLID_1_" class="st1" points="17,38.4 19.9,40 38.4,30.7 35.3,29"></polygon></g></g></svg> | |
| 187 | + <div class="blockspare-version"><?php esc_html_e('Blockspare', 'blockspare'); ?> <span><?php echo $plugin_data['Version'];?></span></div> | |
| 188 | + </div> | |
| 189 | + <h2 class="blockspare-notice-title"><?php esc_html_e('Effortless Site Creation in Minutes','blockspare'); ?></h2> | |
| 190 | + <p class="blockspare-notice-description"><?php esc_html_e('Expert Templates from our Design Library - Import, Customize, Publish with Ease!', 'blockspare'); ?></p> | |
| 191 | + <div class='blockspare-notice-buttons'> | |
| 192 | + <a href="<?php echo admin_url('post-new.php?post_type=page&blockspare_show_intro=true')?>" target="_blank" class="blockspare-notice-button blockspare-notice-button-primary"><span class="dashicons dashicons-plus"></span> <?php esc_html_e('Get Started', 'blockspare'); ?></a> | |
| 193 | + <a href="<?php echo admin_url('admin.php?page=blockspare')?>" class="blockspare-notice-button blockspare-notice-button-secondary"><span class="dashicons dashicons-welcome-learn-more"></span> <?php esc_html_e('Starter Templates', 'blockspare'); ?></a> | |
| 194 | + </div> | |
| 288 | 195 | </div> |
| 289 | - | |
| 290 | - <?php if ( $version ) : ?> | |
| 291 | - <p style="margin-top:10px; font-size:12px; color:#888;"> | |
| 292 | - <?php echo esc_html( 'Version ' . $version ); ?> | |
| 293 | - </p> | |
| 294 | - <?php endif; ?> | |
| 295 | - | |
| 196 | + <div class="bs-welcome-panel-header-image"> | |
| 197 | + <img class='blockspare-notice-image' src='<?php echo BLOCKSPARE_PLUGIN_URL ."admin/assets/images/notice-background.webp";?>' height="200" width="200"/> | |
| 198 | + </div> | |
| 296 | 199 | </div> |
| 297 | - | |
| 298 | - <div style="min-width:120px; text-align:right;"> | |
| 299 | - | |
| 300 | - <div style="font-size:12px; color:#777; margin-bottom:8px;"> | |
| 301 | - <?php esc_html_e( 'Quick Setup', 'blockspare' ); ?> | |
| 302 | - </div> | |
| 303 | - | |
| 304 | - <div style="font-size:11px; color:#999;"> | |
| 305 | - <?php esc_html_e( 'Takes less than 2 minutes', 'blockspare' ); ?> | |
| 306 | - </div> | |
| 307 | - | |
| 200 | + <div class='bs-welcome-panel-column-container'> | |
| 201 | + <div class='bs-welcome-panel-column'> | |
| 202 | + <div class='bs-welcome-panel-column-icon'> | |
| 203 | + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 60 60"> | |
| 204 | + <path d="M5 60h34a3 3 0 0 0 3-3v-5.171A3.006 3.006 0 0 0 44 49V36.6a3.278 3.278 0 0 0 .3-.243 3.164 3.164 0 0 0 .9-2.578 2.208 2.208 0 0 0 .814-.51c4.454-4.453 10.208-12.031 13.242-16.151a3.838 3.838 0 0 0-5.367-5.367c-2.509 1.848-6.3 4.7-9.885 7.661V3a3 3 0 0 0-3-3H5a5.006 5.006 0 0 0-5 5v50a5.006 5.006 0 0 0 5 5Zm33.388-23.584a3.318 3.318 0 0 1-.956 2.485c-1.885 1.884-4.17 2.441-7.852 1.9a12.564 12.564 0 0 0 1.2-3.8 6.528 6.528 0 0 1 1.32-3.433 3.261 3.261 0 0 1 2.485-.956 3.9 3.9 0 0 1 2.607 1.143l.054.054a3.9 3.9 0 0 1 1.142 2.607Zm-2.233-6.525a1.2 1.2 0 0 1 0-1.68 1.188 1.188 0 0 1 1.67 0l5.057 5.057a1.181 1.181 0 0 1 0 1.67 1.227 1.227 0 0 1-1.679 0ZM55.07 13.359a1.838 1.838 0 0 1 2.571 2.571c-2.415 3.28-8.522 11.4-13.045 15.922a.215.215 0 0 1-.3 0l-5.147-5.147a.213.213 0 0 1 0-.3c4.522-4.524 12.641-10.631 15.921-13.046ZM42 3v18.09c-1.566 1.342-3.037 2.671-4.266 3.9a2.181 2.181 0 0 0-.541.921 3.14 3.14 0 0 0-2.948 4.729 5.273 5.273 0 0 0-3.56 1.514 8.152 8.152 0 0 0-1.865 4.46 10.088 10.088 0 0 1-1.072 3.359 1.8 1.8 0 0 0-.09 1.7 1.885 1.885 0 0 0 1.423 1.073 19.294 19.294 0 0 0 2.948.258 9.152 9.152 0 0 0 6.817-2.692 5.25 5.25 0 0 0 1.511-3.512 3.166 3.166 0 0 0 1.643.478V49a1 1 0 0 1-1 1H6V2h35a1 1 0 0 1 1 1ZM4 2.184V50.1a5 5 0 0 0-2 .923V5a3 3 0 0 1 2-2.816Zm-1.128 50.7A3.018 3.018 0 0 1 5 52h35v5a1 1 0 0 1-1 1H5a3 3 0 0 1-2.128-5.118Z" data-original="#000000"/> | |
| 205 | + <path d="M11 21h26a2 2 0 0 0 2-2V9a2 2 0 0 0-2-2H11a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2Zm0-12h26v10H11Zm18 47h5a1 1 0 0 0 0-2h-5a1 1 0 0 0 0 2ZM9 56h16a1 1 0 0 0 0-2H9a1 1 0 0 0 0 2Zm22-31H17a1 1 0 0 0 0 2h14a1 1 0 0 0 0-2Zm-3 5h-8a1 1 0 0 0 0 2h8a1 1 0 0 0 0-2Z" data-original="#000000"/> | |
| 206 | + </svg> | |
| 207 | + </div> | |
| 208 | + <div class='bs-welcome-panel-column-content'> | |
| 209 | + <h3><?php esc_html_e('Launch Your Site in a Few Clicks!','blockspare'); ?></h3> | |
| 210 | + | |
| 211 | + | |
| 212 | + <a href="<?php echo admin_url('post-new.php?post_type=page&blockspare_show_intro=true')?>" target="_blank" class="blockspare-notice-link"><?php esc_html_e('Try Now','blockspare'); ?></a> | |
| 213 | + </div> | |
| 214 | + </div> | |
| 215 | + | |
| 216 | + <div class='bs-welcome-panel-column'> | |
| 217 | + <div class='bs-welcome-panel-column-icon'> | |
| 218 | + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 64 64"> | |
| 219 | + <path d="M59.44 6.83a3.067 3.067 0 0 0-2.66-2.5c-2.61-.31-5.29-.26-7.95.1C39.54 5.65 30.95 11 25.48 18.71l-4.42-1.44c-1.69-.55-3.58.03-4.71 1.43l-4.69 5.83c-1.77 2.08-.99 5.56 1.55 6.6l6.49 2.84c-1.74 1.58-3.04 3.59-3.87 5.11-.39.72-.33 1.58.15 2.24.6.85 1.66.96 2.6.69-.66 1.55-1.26 3.13-1.79 4.77a2.072 2.072 0 0 0 2.74 2.57c1.61-.63 3.15-1.33 4.65-2.08-.4 1.36.48 2.92 1.98 2.9.38 0 .77-.11 1.11-.33 1.47-.92 3.39-2.35 4.85-4.18l3.24 6.31c1.19 2.47 4.71 3.04 6.68 1.14l5.53-5.04c1.33-1.21 1.78-3.14 1.13-4.79l-1.71-4.33c9.47-7.55 14.62-20.28 12.42-32.13zm-1.97.35c.65 3.68.59 7.48-.12 11.15-4.1-3.46-8.21-7.33-11.92-11.21 3.14-.81 6.4-1.14 9.64-.94.85.12 2.19-.12 2.41 1zM12.75 27.8c-.17-.71 0-1.44.46-2.02l4.69-5.83c.61-.76 1.62-1.07 2.53-.78l3.86 1.25a35.241 35.241 0 0 0-4.6 11.36L14 29.29c-.63-.28-1.09-.82-1.25-1.49zm25.86 14.04c-1.76.81-3.6 1.45-5.48 1.91l-11.59-10.9c.39-2.16 1.03-4.27 1.85-6.3l15.92 14.97c-.23.11-.46.21-.7.32zm-12.39 6.31-.12-.08c.14-1.14.64-3.99-1.34-3.33-1.94 1.01-3.88 1.94-5.96 2.75l-.1-.1c.68-2.11 1.49-4.12 2.38-6.11.54-2.02-2.27-1.35-3.41-1.13l-.09-.11c.78-1.43 2.01-3.34 3.62-4.74l9.52 8.95c-1.3 1.7-3.12 3.05-4.5 3.92zm20.02-1.56-5.53 5.04c-1.05 1.01-2.92.74-3.56-.58l-2.84-5.53c2.46-.69 4.86-1.62 7.11-2.83 1.36-.74 2.68-1.56 3.95-2.46L46.86 44c.35.88.1 1.92-.62 2.58zm2.79-12.22a32.682 32.682 0 0 1-7.85 6.17L24.25 24.63C28.01 16.8 35.14 10.5 43.29 7.78c4.16 4.43 8.86 8.84 13.53 12.72-1.38 5.12-4.06 9.91-7.8 13.88z" data-original="#000000"/> | |
| 220 | + <path d="M41.39 15.66c-9.85.6-9.4 14.92.46 14.91 9.85-.6 9.4-14.92-.46-14.91zm4.21 11.19c-5.06 5.12-12.76-2.11-7.95-7.48 5.05-5.12 12.75 2.1 7.95 7.48zM22.69 52.69l-5.16 5.49c-.89.95.56 2.32 1.46 1.37l5.16-5.49c.89-.95-.56-2.32-1.46-1.37zM11.65 43.9a.996.996 0 0 0-1.41.04l-5.9 6.27a.996.996 0 1 0 1.45 1.37l5.9-6.27c.38-.4.36-1.04-.04-1.41zm1.12 8.34-5.16 5.49c-.61.6-.11 1.71.73 1.69.27 0 .53-.11.73-.31l5.16-5.49c.89-.96-.55-2.32-1.46-1.37zm11.54-19.51 2.91 2.74c.95.89 2.32-.55 1.37-1.46l-2.91-2.74c-.95-.89-2.32.55-1.37 1.46zm6.55 6.17c.95.89 2.32-.55 1.37-1.46l-1.46-1.37c-.95-.89-2.32.55-1.37 1.46l1.46 1.37zm1.95 1.72a.7.7 0 0 0 .09.17l.12.15c.38.39 1.04.39 1.42 0 .09-.1.17-.2.21-.32.57-1.81-2.42-1.8-1.84 0z" data-original="#000000"/> | |
| 221 | + </svg> | |
| 222 | + </div> | |
| 223 | + <div class='bs-welcome-panel-column-content'> | |
| 224 | + <h3><?php esc_html_e('Elevate Your Site Instantly!','blockspare'); ?></h3> | |
| 225 | + | |
| 226 | + <a href="https://blockspare.com/" target="_blank" class="blockspare-notice-link"><?php esc_html_e('Explore More','blockspare'); ?></a> | |
| 227 | + </div> | |
| 228 | + </div> | |
| 229 | + | |
| 230 | + <div class='bs-welcome-panel-column'> | |
| 231 | + <div class='bs-welcome-panel-column-icon'> | |
| 232 | + <svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 512 512"> | |
| 233 | + <path d="M179.15 453.63H25.46C11.42 453.63 0 442.21 0 428.18v-324.9c0-14.04 11.42-25.46 25.46-25.46H159.7c3.31 0 6 2.69 6 6 0 3.32-2.69 6-6 6H25.46c-7.42 0-13.46 6.04-13.46 13.46v324.9c0 7.41 6.04 13.45 13.46 13.45h153.69c7.42 0 13.46-6.04 13.46-13.46 0-3.31 2.68-6 6-6 3.31 0 6 2.69 6 6 0 14.04-11.42 25.46-25.46 25.46z" data-original="#000000"/> | |
| 234 | + <path d="M332.85 434.17h-153.7c-14.03 0-25.45-11.41-25.45-25.45V83.82c0-14.03 11.42-25.45 25.45-25.45h153.7c14.03 0 25.45 11.42 25.45 25.45v324.9c0 14.04-11.42 25.45-25.45 25.45zm-153.7-363.8c-7.42 0-13.45 6.04-13.45 13.45v324.9c0 7.42 6.03 13.46 13.45 13.46h153.7c7.41 0 13.45-6.04 13.45-13.46V83.82c0-7.41-6.04-13.45-13.45-13.45z" data-original="#000000"/> | |
| 235 | + <path d="M486.54 453.63H332.85c-14.04 0-25.46-11.42-25.46-25.46 0-3.31 2.69-5.99 6-5.99 3.32 0 6 2.68 6 5.99 0 7.42 6.04 13.46 13.46 13.46h153.69c7.42 0 13.46-6.04 13.46-13.46V103.28c0-7.42-6.04-13.46-13.46-13.46H352.3c-3.31 0-6-2.68-6-6 0-3.31 2.69-6 6-6h134.24c14.04 0 25.46 11.42 25.46 25.46v324.9c0 14.03-11.42 25.45-25.46 25.45zM82.85 226.05c-16.99 0-30.81-13.82-30.81-30.81 0-3.31 2.69-6 6-6 3.32 0 6 2.69 6 6 0 10.37 8.44 18.81 18.81 18.81s18.81-8.44 18.81-18.81-8.44-18.8-18.81-18.8c-16.99 0-30.81-13.82-30.81-30.81 0-16.98 13.82-30.8 30.81-30.8s30.81 13.82 30.81 30.8c0 3.32-2.69 6-6 6-3.32 0-6-2.68-6-6 0-10.37-8.44-18.8-18.81-18.8s-18.81 8.43-18.81 18.8 8.44 18.81 18.81 18.81c16.99 0 30.81 13.82 30.81 30.8 0 16.99-13.82 30.81-30.81 30.81zm42.32 28.35H40.54c-3.32 0-6-2.69-6-6 0-3.32 2.68-6 6-6h84.63c3.31 0 6 2.68 6 6 0 3.31-2.69 6-6 6zm0 55.45H40.54c-3.32 0-6-2.69-6-6 0-3.32 2.68-6 6-6h84.63c3.31 0 6 2.68 6 6 0 3.31-2.69 6-6 6zm0 55.44H40.54c-3.32 0-6-2.68-6-6 0-3.31 2.68-6 6-6h84.63c3.31 0 6 2.69 6 6 0 3.32-2.69 6-6 6zm3.89 51.34H36.64c-3.31 0-6-2.69-6-6v-22.86c0-3.32 2.69-6 6-6h92.42c3.31 0 6 2.68 6 6v22.86c0 3.31-2.69 6-6 6zm-86.41-12h80.41v-10.86H42.65z" data-original="#000000"/><path d="M429.15 226.05c-16.99 0-30.81-13.82-30.81-30.81 0-3.31 2.69-6 6-6s6 2.69 6 6c0 10.37 8.44 18.81 18.81 18.81s18.8-8.44 18.8-18.81-8.43-18.8-18.8-18.8c-16.99 0-30.81-13.82-30.81-30.81 0-16.98 13.82-30.8 30.81-30.8 16.98 0 30.8 13.82 30.8 30.8 0 3.32-2.68 6-6 6-3.31 0-6-2.68-6-6 0-10.37-8.43-18.8-18.8-18.8s-18.81 8.43-18.81 18.8 8.44 18.81 18.81 18.81c16.98 0 30.8 13.82 30.8 30.8 0 16.99-13.82 30.81-30.8 30.81zm42.31 28.41h-84.63c-3.31 0-6-2.69-6-6s2.69-6 6-6h84.63c3.32 0 6 2.69 6 6s-2.68 6-6 6zm0 55.45h-84.63c-3.31 0-6-2.69-6-6 0-3.32 2.69-6 6-6h84.63c3.32 0 6 2.68 6 6 0 3.31-2.68 6-6 6zm0 55.44h-84.63c-3.31 0-6-2.68-6-6 0-3.31 2.69-6 6-6h84.63c3.32 0 6 2.69 6 6 0 3.32-2.68 6-6 6zm3.89 51.28h-92.41c-3.31 0-6-2.69-6-6v-22.86c0-3.32 2.69-6 6-6h92.41c3.32 0 6 2.68 6 6v22.86c0 3.31-2.68 6-6 6zm-86.41-12h80.41v-10.86h-80.41zM256 201.2c-16.99 0-30.81-13.81-30.81-30.8 0-3.31 2.69-6 6-6 3.32 0 6 2.69 6 6 0 10.37 8.44 18.8 18.81 18.8s18.81-8.43 18.81-18.8-8.44-18.81-18.81-18.81c-16.99 0-30.81-13.82-30.81-30.8 0-16.99 13.82-30.81 30.81-30.81s30.81 13.82 30.81 30.81c0 3.31-2.69 6-6 6-3.32 0-6-2.69-6-6 0-10.37-8.44-18.81-18.81-18.81s-18.81 8.44-18.81 18.81 8.44 18.8 18.81 18.8c16.99 0 30.81 13.82 30.81 30.81s-13.82 30.8-30.81 30.8zm42.31 33.8h-84.62c-3.32 0-6-2.68-6-6a5.99 5.99 0 0 1 6-5.99h84.62c3.32 0 6 2.68 6 5.99 0 3.32-2.68 6-6 6zm0 55.45h-84.62c-3.32 0-6-2.68-6-6 0-3.31 2.68-6 6-6h84.62c3.32 0 6 2.69 6 6 0 3.32-2.68 6-6 6zm0 55.45h-84.62c-3.32 0-6-2.69-6-6s2.68-6 6-6h84.62c3.32 0 6 2.69 6 6s-2.68 6-6 6zm3.89 56.66h-92.41c-3.31 0-6-2.69-6-6V373.7c0-3.31 2.69-6 6-6h92.41c3.32 0 6 2.69 6 6v22.86c0 3.32-2.68 6-6 6zm-86.41-12h80.41V379.7h-80.41z" data-original="#000000"/> | |
| 236 | + </svg> | |
| 237 | + </div> | |
| 238 | + <div class='bs-welcome-panel-column-content'> | |
| 239 | + <h3><?php esc_html_e('Effortless Website Crafting Continues!','blockspare'); ?></h3> | |
| 240 | + | |
| 241 | + <a href="<?php echo esc_url('https://www.blockspare.com/pricing/')?>" target="_blank" class="blockspare-notice-link"><?php esc_html_e('Upgrade Now','blockspare'); ?></a> | |
| 242 | + </div> | |
| 243 | + </div> | |
| 308 | 244 | </div> |
| 309 | - | |
| 310 | 245 | </div> |
| 311 | - | |
| 312 | - <a | |
| 313 | - class="notice-dismiss" | |
| 314 | - href="<?php echo esc_url( $this->dismiss_url ); ?>" | |
| 315 | - ></a> | |
| 316 | - | |
| 317 | - </div> | |
| 318 | - | |
| 246 | + <a class="blockspare-notice-dismiss notice-dismiss" href="<?php echo esc_url( $this->dismiss_url ); ?>"></a> | |
| 247 | + </div> <!-- /blockspare-notice --> | |
| 319 | 248 | <?php |
| 320 | 249 | } |
| 321 | 250 | } |
| 322 | 251 | |
| 323 | -/** | |
| 324 | - * Initialize notice after WordPress admin loads. | |
| 325 | - */ | |
| 326 | -function blockspare_setup_notice_init() { | |
| 327 | - | |
| 328 | - if ( ! is_admin() ) { | |
| 329 | - return; | |
| 330 | - } | |
| 331 | - | |
| 332 | - new Blockspare_Setup_Notice(); | |
| 333 | -} | |
| 334 | - | |
| 335 | -add_action( 'admin_init', 'blockspare_setup_notice_init' ); | |
| 252 | +new Blockspare_Setup_Notice(); | |