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 -14 5.0.21 → 5.1.1 View file →
@@ -90,12 +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 94 new \ULTP\Includes\Deactive\Deactive();
96 95 new \ULTP\Includes\notice\Notice();
97 - new \ULTP\Includes\notice\WowShippingPromotion();
98 96 new \ULTP\Includes\Durbin\OurPlugins();
99 97 }
100 98
101 99 /**
@@ -158,9 +156,9 @@
158 156 $isEnable = apply_filters( 'ultp_view_cookies', true );
159 157 // add_filter( 'ultp_view_cookies', '__return_false' );
160 158 $cookies_disable = ultimate_post()->get_setting( 'disable_view_cookies' );
161 159 if ( $post_id && $isEnable && $cookies_disable != 'yes' ) {
162 - $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;
163 161 if ( ! $has_cookie ) {
164 162 $count = (int) get_post_meta( $post_id, '__post_views_count', true );
165 163 update_post_meta( $post_id, '__post_views_count', $count ? (int) $count + 1 : 1 );
166 164 setcookie( 'ultp_view_' . $post_id, 1, time() + 86400, COOKIEPATH ); // 1 days cookies
@@ -342,9 +340,9 @@
342 340 if ( wp_doing_ajax() ) {
343 341 return;
344 342 }
345 343 if ( $plugin == 'ultimate-post/ultimate-post.php' ) {
346 - 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.
347 345 return;
348 346 }
349 347 if ( ultimate_post()->get_setting( 'init_setup' ) != 'yes' ) {
350 348 ultimate_post()->set_setting( 'init_setup', 'yes' );
@@ -361,12 +359,15 @@
361 359 * @since v.1.0.0
362 360 * @return void No return value.
363 361 */
364 362 public function register_option_panel_scripts_callback() {
365 - $is_active = ultimate_post()->is_lc_active();
366 - $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();
367 367 $_page = isset($_GET['page']) ? sanitize_text_field($_GET['page']) : ''; // @codingStandardsIgnoreLine
368 - $post_type = get_post_type();
368 + $post_type = get_post_type();
369 + $is_woocommerce_active = class_exists( 'WooCommerce' ) ? true : false;
369 370
370 371 wp_enqueue_style( 'wp-color-picker' );
371 372 wp_enqueue_script( 'wp-color-picker' );
372 373
@@ -378,13 +379,15 @@
378 379 array(
379 380 'url' => ULTP_URL,
380 381 'version' => ULTP_VER,
381 382 'active' => $is_active,
382 - 'security' => wp_create_nonce( 'ultp-nonce' ),
383 + 'expierd' => $is_expired,
384 + 'security' => wp_create_nonce( 'ultp-admin-nonce' ),
383 385 'ajax' => admin_url( 'admin-ajax.php' ),
384 - 'settings' => ultimate_post()->get_setting(),
386 + 'settings' => ultimate_post()->get_client_settings(),
385 387 'post_type' => $post_type,
386 388 'saved_template_url' => admin_url( 'admin.php?page=ultp-settings#saved-templates' ),
389 + 'woocommerce' => $is_woocommerce_active,
387 390 )
388 391 );
389 392
390 393 if ( $post_type == 'ultp_custom_font' ) {
@@ -389,9 +392,10 @@
389 392
390 393 if ( $post_type == 'ultp_custom_font' ) {
391 394 $font_settings = ultimate_post()->get_setting( 'ultp_custom_font' );
392 395 if ( $font_settings == 'true' ) {
393 - 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() ) );
394 398 }
395 399 }
396 400
397 401 /* === Installation Wizard === */
@@ -424,13 +428,15 @@
424 428 'ultp_dashboard_pannel',
425 429 array_merge(
426 430 array(
427 431 'ajax' => admin_url( 'admin-ajax.php' ),
428 - 'security' => wp_create_nonce( 'ultp-nonce' ),
432 + 'security' => wp_create_nonce( 'ultp-admin-nonce' ),
429 433 'url' => ULTP_URL,
430 434 'active' => $is_active,
435 + 'expierd' => $is_expired,
431 436 'license' => $license_key,
432 - '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(),
433 439 'addons_settings' => apply_filters( 'ultp_settings', array() ),
434 440 'builder_url' => admin_url( 'admin.php?page=ultp-settings#builder' ),
435 441 'version' => ULTP_VER,
436 442 'setup_wizard_link' => admin_url( 'admin.php?page=ultp-setup-wizard' ),
@@ -458,8 +464,9 @@
458 464 * @return void No return value.
459 465 */
460 466 public function register_block_scripts_editor_area() {
461 467 ultimate_post()->register_scripts_common();
468 + $is_expired = Xpo::is_lc_expired();
462 469 global $pagenow;
463 470 $depends = 'wp-editor';
464 471 if ( $pagenow === 'widgets.php' ) {
465 472 $depends = 'wp-edit-widgets';
@@ -507,15 +514,15 @@
507 514 'ultp_data',
508 515 array(
509 516 'url' => ULTP_URL,
510 517 'ajax' => admin_url( 'admin-ajax.php' ),
511 - 'security' => wp_create_nonce( 'ultp-nonce' ),
518 + 'security' => wp_create_nonce( 'ultp-admin-nonce' ),
512 519 'hide_import_btn' => ultimate_post()->get_setting( 'hide_import_btn' ),
513 520 'premium_link' => Xpo::generate_utm_link(),
514 521 'license' => $is_active ? Xpo::get_lc_key() : '',
515 522 'active' => $is_active,
516 523 'archive' => ultimate_post()->is_archive_builder(),
517 - 'settings' => ultimate_post()->get_setting(),
524 + 'settings' => ultimate_post()->get_client_settings(),
518 525 'post_type' => $post_type == 'premade' ? 'ultp_builder' : $post_type, // premade used for ultp.wpxpo.com
519 526 'date_format' => get_option( 'date_format' ),
520 527 'time_format' => get_option( 'time_format' ),
521 528 'blog' => get_current_blog_id(),
@@ -524,8 +531,9 @@
524 531 'disable_image_size' => ultimate_post()->get_setting( 'disable_image_size' ),
525 532 'dark_logo' => get_option( 'ultp_site_dark_logo' ) ? get_option( 'ultp_site_dark_logo' ) : false,
526 533 'builder_url' => admin_url( 'admin.php?page=ultp-settings#builder' ),
527 534 'custom_fonts' => $custom_fonts,
535 + 'expierd' => $is_expired,
528 536 )
529 537 );
530 538 wp_set_script_translations( 'ultp-blocks-editor-script', 'ultimate-post', ULTP_PATH . 'languages/' );
531 539 }