| @@ -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' ); |
| @@ -386,11 +380,11 @@ | ||
| 386 | 380 | 'url' => ULTP_URL, |
| 387 | 381 | 'version' => ULTP_VER, |
| 388 | 382 | 'active' => $is_active, |
| 389 | 383 | 'expierd' => $is_expired, |
| 390 | - 'security' => wp_create_nonce( 'ultp-nonce' ), | |
| 384 | + 'security' => wp_create_nonce( 'ultp-admin-nonce' ), | |
| 391 | 385 | 'ajax' => admin_url( 'admin-ajax.php' ), |
| 392 | - 'settings' => ultimate_post()->get_setting(), | |
| 386 | + 'settings' => ultimate_post()->get_client_settings(), | |
| 393 | 387 | 'post_type' => $post_type, |
| 394 | 388 | 'saved_template_url' => admin_url( 'admin.php?page=ultp-settings#saved-templates' ), |
| 395 | 389 | 'woocommerce' => $is_woocommerce_active, |
| 396 | 390 | ) |
| @@ -398,9 +392,10 @@ | ||
| 398 | 392 | |
| 399 | 393 | if ( $post_type == 'ultp_custom_font' ) { |
| 400 | 394 | $font_settings = ultimate_post()->get_setting( 'ultp_custom_font' ); |
| 401 | 395 | if ( $font_settings == 'true' ) { |
| 402 | - 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() ) ); | |
| 403 | 398 | } |
| 404 | 399 | } |
| 405 | 400 | |
| 406 | 401 | /* === Installation Wizard === */ |
| @@ -433,14 +428,15 @@ | ||
| 433 | 428 | 'ultp_dashboard_pannel', |
| 434 | 429 | array_merge( |
| 435 | 430 | array( |
| 436 | 431 | 'ajax' => admin_url( 'admin-ajax.php' ), |
| 437 | - 'security' => wp_create_nonce( 'ultp-nonce' ), | |
| 432 | + 'security' => wp_create_nonce( 'ultp-admin-nonce' ), | |
| 438 | 433 | 'url' => ULTP_URL, |
| 439 | 434 | 'active' => $is_active, |
| 440 | 435 | 'expierd' => $is_expired, |
| 441 | 436 | 'license' => $license_key, |
| 442 | - '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(), | |
| 443 | 439 | 'addons_settings' => apply_filters( 'ultp_settings', array() ), |
| 444 | 440 | 'builder_url' => admin_url( 'admin.php?page=ultp-settings#builder' ), |
| 445 | 441 | 'version' => ULTP_VER, |
| 446 | 442 | 'setup_wizard_link' => admin_url( 'admin.php?page=ultp-setup-wizard' ), |
| @@ -518,15 +514,15 @@ | ||
| 518 | 514 | 'ultp_data', |
| 519 | 515 | array( |
| 520 | 516 | 'url' => ULTP_URL, |
| 521 | 517 | 'ajax' => admin_url( 'admin-ajax.php' ), |
| 522 | - 'security' => wp_create_nonce( 'ultp-nonce' ), | |
| 518 | + 'security' => wp_create_nonce( 'ultp-admin-nonce' ), | |
| 523 | 519 | 'hide_import_btn' => ultimate_post()->get_setting( 'hide_import_btn' ), |
| 524 | 520 | 'premium_link' => Xpo::generate_utm_link(), |
| 525 | 521 | 'license' => $is_active ? Xpo::get_lc_key() : '', |
| 526 | 522 | 'active' => $is_active, |
| 527 | 523 | 'archive' => ultimate_post()->is_archive_builder(), |
| 528 | - 'settings' => ultimate_post()->get_setting(), | |
| 524 | + 'settings' => ultimate_post()->get_client_settings(), | |
| 529 | 525 | 'post_type' => $post_type == 'premade' ? 'ultp_builder' : $post_type, // premade used for ultp.wpxpo.com |
| 530 | 526 | 'date_format' => get_option( 'date_format' ), |
| 531 | 527 | 'time_format' => get_option( 'time_format' ), |
| 532 | 528 | 'blog' => get_current_blog_id(), |