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/Initialization.php +22 -18 5.0.24 → 5.1.1 View file →
@@ -90,16 +90,10 @@
90 90 require_once ULTP_PATH . 'includes/durbin/class-xpo.php';
91 91 require_once ULTP_PATH . 'includes/deactive/class-deactive.php';
92 92 require_once ULTP_PATH . 'includes/notice/class-notice.php';
93 93 require_once ULTP_PATH . 'includes/durbin/class-our-plugins.php';
94 - require_once ULTP_PATH . 'includes/notice/class-wow-shipping-promotion.php';
95 - require_once ULTP_PATH . 'includes/notice/class-wow-revenue-promotion.php';
96 - require_once ULTP_PATH . 'includes/notice/class-wow-addons-promotion.php';
97 94 new \ULTP\Includes\Deactive\Deactive();
98 95 new \ULTP\Includes\notice\Notice();
99 - new \ULTP\Includes\notice\WowShippingPromotion();
100 - new \ULTP\Includes\notice\WowRevenuePromotion();
101 - new \ULTP\Includes\notice\WowAddonsPromotion();
102 96 new \ULTP\Includes\Durbin\OurPlugins();
103 97 }
104 98
105 99 /**
@@ -162,9 +156,9 @@
162 156 $isEnable = apply_filters( 'ultp_view_cookies', true );
163 157 // add_filter( 'ultp_view_cookies', '__return_false' );
164 158 $cookies_disable = ultimate_post()->get_setting( 'disable_view_cookies' );
165 159 if ( $post_id && $isEnable && $cookies_disable != 'yes' ) {
166 - $has_cookie = isset( $_COOKIE[ 'ultp_view_' . $post_id ] ) ? sanitize_text_field( $_COOKIE[ 'ultp_view_' . $post_id ] ) : false;
160 + $has_cookie = isset( $_COOKIE[ 'ultp_view_' . $post_id ] ) ? sanitize_text_field( wp_unslash( $_COOKIE[ 'ultp_view_' . $post_id ] ) ) : false;
167 161 if ( ! $has_cookie ) {
168 162 $count = (int) get_post_meta( $post_id, '__post_views_count', true );
169 163 update_post_meta( $post_id, '__post_views_count', $count ? (int) $count + 1 : 1 );
170 164 setcookie( 'ultp_view_' . $post_id, 1, time() + 86400, COOKIEPATH ); // 1 days cookies
@@ -346,9 +340,9 @@
346 340 if ( wp_doing_ajax() ) {
347 341 return;
348 342 }
349 343 if ( $plugin == 'ultimate-post/ultimate-post.php' ) {
350 - if ( wp_doing_ajax() || is_network_admin() || isset( $_GET['activate-multi'] ) || isset( $_POST['action'] ) && 'activate-selected' == $_POST['action'] ) {
344 + if ( wp_doing_ajax() || is_network_admin() || isset( $_GET['activate-multi'] ) || isset( $_POST['action'] ) && 'activate-selected' == $_POST['action'] ) { // phpcs:ignore WordPress.Security.NonceVerification.Recommended,WordPress.Security.NonceVerification.Missing -- Read-only check for bulk/multi activation.
351 345 return;
352 346 }
353 347 if ( ultimate_post()->get_setting( 'init_setup' ) != 'yes' ) {
354 348 ultimate_post()->set_setting( 'init_setup', 'yes' );
@@ -365,12 +359,15 @@
365 359 * @since v.1.0.0
366 360 * @return void No return value.
367 361 */
368 362 public function register_option_panel_scripts_callback() {
369 - $is_active = ultimate_post()->is_lc_active();
370 - $license_key = Xpo::get_lc_key();
363 + $is_active = ultimate_post()->is_lc_active();
364 + $is_expired = Xpo::is_lc_expired();
365 +
366 + $license_key = Xpo::get_lc_key();
371 367 $_page = isset($_GET['page']) ? sanitize_text_field($_GET['page']) : ''; // @codingStandardsIgnoreLine
372 - $post_type = get_post_type();
368 + $post_type = get_post_type();
369 + $is_woocommerce_active = class_exists( 'WooCommerce' ) ? true : false;
373 370
374 371 wp_enqueue_style( 'wp-color-picker' );
375 372 wp_enqueue_script( 'wp-color-picker' );
376 373
@@ -382,13 +379,15 @@
382 379 array(
383 380 'url' => ULTP_URL,
384 381 'version' => ULTP_VER,
385 382 'active' => $is_active,
386 - 'security' => wp_create_nonce( 'ultp-nonce' ),
383 + 'expierd' => $is_expired,
384 + 'security' => wp_create_nonce( 'ultp-admin-nonce' ),
387 385 'ajax' => admin_url( 'admin-ajax.php' ),
388 - 'settings' => ultimate_post()->get_setting(),
386 + 'settings' => ultimate_post()->get_client_settings(),
389 387 'post_type' => $post_type,
390 388 'saved_template_url' => admin_url( 'admin.php?page=ultp-settings#saved-templates' ),
389 + 'woocommerce' => $is_woocommerce_active,
391 390 )
392 391 );
393 392
394 393 if ( $post_type == 'ultp_custom_font' ) {
@@ -393,9 +392,10 @@
393 392
394 393 if ( $post_type == 'ultp_custom_font' ) {
395 394 $font_settings = ultimate_post()->get_setting( 'ultp_custom_font' );
396 395 if ( $font_settings == 'true' ) {
397 - wp_enqueue_media();
396 + // Pass the font post so uploads send its ID; Custom_Font allows SVG only for that post.
397 + wp_enqueue_media( array( 'post' => get_the_ID() ) );
398 398 }
399 399 }
400 400
401 401 /* === Installation Wizard === */
@@ -428,13 +428,15 @@
428 428 'ultp_dashboard_pannel',
429 429 array_merge(
430 430 array(
431 431 'ajax' => admin_url( 'admin-ajax.php' ),
432 - 'security' => wp_create_nonce( 'ultp-nonce' ),
432 + 'security' => wp_create_nonce( 'ultp-admin-nonce' ),
433 433 'url' => ULTP_URL,
434 434 'active' => $is_active,
435 + 'expierd' => $is_expired,
435 436 'license' => $license_key,
436 - 'settings' => ultimate_post()->get_setting(),
437 + // The settings form needs the saved OpenAI key; the menu capability is filterable, so check.
438 + 'settings' => current_user_can( 'manage_options' ) ? ultimate_post()->get_setting() : ultimate_post()->get_client_settings(),
437 439 'addons_settings' => apply_filters( 'ultp_settings', array() ),
438 440 'builder_url' => admin_url( 'admin.php?page=ultp-settings#builder' ),
439 441 'version' => ULTP_VER,
440 442 'setup_wizard_link' => admin_url( 'admin.php?page=ultp-setup-wizard' ),
@@ -462,8 +464,9 @@
462 464 * @return void No return value.
463 465 */
464 466 public function register_block_scripts_editor_area() {
465 467 ultimate_post()->register_scripts_common();
468 + $is_expired = Xpo::is_lc_expired();
466 469 global $pagenow;
467 470 $depends = 'wp-editor';
468 471 if ( $pagenow === 'widgets.php' ) {
469 472 $depends = 'wp-edit-widgets';
@@ -511,15 +514,15 @@
511 514 'ultp_data',
512 515 array(
513 516 'url' => ULTP_URL,
514 517 'ajax' => admin_url( 'admin-ajax.php' ),
515 - 'security' => wp_create_nonce( 'ultp-nonce' ),
518 + 'security' => wp_create_nonce( 'ultp-admin-nonce' ),
516 519 'hide_import_btn' => ultimate_post()->get_setting( 'hide_import_btn' ),
517 520 'premium_link' => Xpo::generate_utm_link(),
518 521 'license' => $is_active ? Xpo::get_lc_key() : '',
519 522 'active' => $is_active,
520 523 'archive' => ultimate_post()->is_archive_builder(),
521 - 'settings' => ultimate_post()->get_setting(),
524 + 'settings' => ultimate_post()->get_client_settings(),
522 525 'post_type' => $post_type == 'premade' ? 'ultp_builder' : $post_type, // premade used for ultp.wpxpo.com
523 526 'date_format' => get_option( 'date_format' ),
524 527 'time_format' => get_option( 'time_format' ),
525 528 'blog' => get_current_blog_id(),
@@ -528,8 +531,9 @@
528 531 'disable_image_size' => ultimate_post()->get_setting( 'disable_image_size' ),
529 532 'dark_logo' => get_option( 'ultp_site_dark_logo' ) ? get_option( 'ultp_site_dark_logo' ) : false,
530 533 'builder_url' => admin_url( 'admin.php?page=ultp-settings#builder' ),
531 534 'custom_fonts' => $custom_fonts,
535 + 'expierd' => $is_expired,
532 536 )
533 537 );
534 538 wp_set_script_translations( 'ultp-blocks-editor-script', 'ultimate-post', ULTP_PATH . 'languages/' );
535 539 }