Skip to content
This repository has been archived by the owner on Feb 23, 2024. It is now read-only.

WP_Scripts::print_inline_script() is deprecated since WP 6.3.0 #10004

Closed
5 tasks done
Screenfeed opened this issue Jun 27, 2023 · 1 comment · Fixed by #10165
Closed
5 tasks done

WP_Scripts::print_inline_script() is deprecated since WP 6.3.0 #10004

Screenfeed opened this issue Jun 27, 2023 · 1 comment · Fixed by #10165

Comments

@Screenfeed
Copy link

Screenfeed commented Jun 27, 2023

Prerequisites

  • I have carried out troubleshooting steps and I believe I have found a bug.
  • I have searched for similar bugs in both open and closed issues and cannot find a duplicate.

Describe the bug

Since WordPress/WordPress@53e7cc3, the method WP_Scripts::print_inline_script() is deprecated.

PHP Deprecated: Function WP_Scripts::print_inline_script is deprecated since version 6.3.0! Use WP_Scripts::get_inline_script_data() or WP_Scripts::get_inline_script_tag() instead. in /wp-includes/functions.php on line 5450

It seems to be used in Automattic\\WooCommerce\\Blocks\\BlockTypes\\MiniCart::append_script_and_deps_src().

Expected behavior

The log file not being spammed.

Actual behavior

The log file being spammed.

Steps to reproduce

  1. Update to the latest WP 6.3 alpha.
  2. Load any page.
  3. View debug.log file content.

WordPress Environment

### WordPress Environment ###

WordPress address (URL): localhost
Site address (URL): localhost
WC Version: 7.8.0
REST API Version: ✔ 7.8.0
WC Blocks Version: ✔ 10.2.3
Action Scheduler Version: ✔ 3.5.4
Log Directory Writable: ✔
WP Version: 6.3-alpha-56045
WP Multisite: –
WP Memory Limit: 256 Mo
WP Debug Mode: ✔
WP Cron: ✔
Language: fr_FR
External object cache: –

### Server Environment ###

Server Info: Apache/2.4.54 (Unix) mod_fastcgi/mod_fastcgi-SNAP-0910052141 PHP/7.4.33 OpenSSL/1.0.2u mod_wsgi/3.5 Python/2.7.18
PHP Version: 7.4.33
PHP Post Max Size: 8 Mo
PHP Time Limit: 30
PHP Max Input Vars: 1000
cURL Version: 7.68.0
OpenSSL/1.0.2u

SUHOSIN Installed: –
MySQL Version: 5.7.39
Max Upload Size: 8 Mo
Default Timezone is UTC: ✔
fsockopen/cURL: ✔
SoapClient: ✔
DOMDocument: ✔
GZip: ✔
Multibyte String: ✔
Remote Post: ✔
Remote Get: ✔

### Database ###

WC Database Version: 7.8.0
WC Database Prefix: wpll_
Taille totale de la base de données: 7.72MB
Taille de la base de données: 5.87MB
Taille de l’index: 1.85MB
wpll_woocommerce_sessions: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
wpll_woocommerce_api_keys: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_woocommerce_attribute_taxonomies: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
wpll_woocommerce_downloadable_product_permissions: Données : 0.02MB + Index : 0.06MB + Moteur InnoDB
wpll_woocommerce_order_items: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
wpll_woocommerce_order_itemmeta: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_woocommerce_tax_rates: Données : 0.02MB + Index : 0.06MB + Moteur InnoDB
wpll_woocommerce_tax_rate_locations: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_woocommerce_shipping_zones: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
wpll_woocommerce_shipping_zone_locations: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_woocommerce_shipping_zone_methods: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
wpll_woocommerce_payment_tokens: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
wpll_woocommerce_payment_tokenmeta: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_woocommerce_log: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
wpll_actionscheduler_actions: Données : 0.05MB + Index : 0.13MB + Moteur InnoDB
wpll_actionscheduler_claims: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
wpll_actionscheduler_groups: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
wpll_actionscheduler_logs: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_commentmeta: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_comments: Données : 0.02MB + Index : 0.09MB + Moteur InnoDB
wpll_links: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
wpll_options: Données : 4.44MB + Index : 0.06MB + Moteur InnoDB
wpll_postmeta: Données : 0.14MB + Index : 0.13MB + Moteur InnoDB
wpll_posts: Données : 0.17MB + Index : 0.06MB + Moteur InnoDB
wpll_termmeta: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_terms: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_term_relationships: Données : 0.05MB + Index : 0.02MB + Moteur InnoDB
wpll_term_taxonomy: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_usermeta: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_users: Données : 0.02MB + Index : 0.05MB + Moteur InnoDB
wpll_wc_admin_notes: Données : 0.08MB + Index : 0.00MB + Moteur InnoDB
wpll_wc_admin_note_actions: Données : 0.06MB + Index : 0.02MB + Moteur InnoDB
wpll_wc_category_lookup: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
wpll_wc_customer_lookup: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_wc_download_log: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_wc_mnm_child_items: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_wc_orders: Données : 0.02MB + Index : 0.11MB + Moteur InnoDB
wpll_wc_orders_meta: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_wc_order_addresses: Données : 0.02MB + Index : 0.06MB + Moteur InnoDB
wpll_wc_order_coupon_lookup: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_wc_order_operational_data: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_wc_order_product_lookup: Données : 0.02MB + Index : 0.06MB + Moteur InnoDB
wpll_wc_order_stats: Données : 0.02MB + Index : 0.05MB + Moteur InnoDB
wpll_wc_order_tax_lookup: Données : 0.02MB + Index : 0.03MB + Moteur InnoDB
wpll_wc_product_attributes_lookup: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
wpll_wc_product_download_directories: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
wpll_wc_product_meta_lookup: Données : 0.02MB + Index : 0.09MB + Moteur InnoDB
wpll_wc_rate_limits: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
wpll_wc_reserved_stock: Données : 0.02MB + Index : 0.00MB + Moteur InnoDB
wpll_wc_tax_rate_classes: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB
wpll_wc_webhooks: Données : 0.02MB + Index : 0.02MB + Moteur InnoDB

### Post Type Counts ###

attachment: 19
book: 4
et_body_layout: 1
et_template: 1
nav_menu_item: 7
page: 27
pll_temp_type: 1
polylang_mo: 3
post: 10
product: 6
product_variation: 18
revision: 67
shop_order: 10
shop_order_refund: 3
tribe_events: 5
wp_global_styles: 4
wp_navigation: 5
wp_template_part: 6

### Security ###

Secure connection (HTTPS): ✔
Hide errors from visitors: ✔

### Active Plugins (11) ###

Polylang Pro: par WP SYNTEX – 3.4.3
Query Monitor: par John Blackbourn – 3.12.3
Classic Editor: par Contributeurs et contributrices WordPress – 1.6.3
Classic Widgets: par Contributeurs et contributrices WordPress – 0.3
Disable Bloat for WordPress & WooCommerce: par Disable Bloat – 3.2.8
Désactiver les emojis (compatible RGPD): par Ryan Hellyer – 1.7.4
Polylang for WooCommerce: par WP SYNTEX – 1.8
SF Admin Bar Tools: par Grégory Viguier – 4.0
Symlinked Plugin Branch: par Joseph Fusco – 1.1.0
WooCommerce: par Automattic – 7.8.0
WordPress Beta Tester: par WordPress Upgrade/Install Team – 3.4.1

### Dropin Plugins (1) ###

db.php: Query Monitor Database Class (Drop-in)

### Settings ###

API Enabled: –
Force SSL: –
Currency: EUR (€)
Currency Position: right_space
Thousand Separator: 
Decimal Separator: ,
Number of Decimals: 2
Taxonomies: Product Types: external (external)
grouped (grouped)
mix and match (mix-and-match)
simple (simple)
variable (variable)

Taxonomies: Product Visibility: exclude-from-catalog (exclude-from-catalog)
exclude-from-search (exclude-from-search)
featured (featured)
outofstock (outofstock)
rated-1 (rated-1)
rated-2 (rated-2)
rated-3 (rated-3)
rated-4 (rated-4)
rated-5 (rated-5)

Connected to WooCommerce.com: –
Enforce Approved Product Download Directories: –
HPOS feature screen enabled: –
HPOS feature enabled: –
Order datastore: WC_Order_Data_Store_CPT
HPOS data sync enabled: ✔

### WC Pages ###

Base de la boutique: woocommerce/woocommerce#9 - /
Panier: woocommerce/woocommerce#10 - /panier/
Commander: woocommerce/woocommerce#11 - /commander/
Mon compte: woocommerce/woocommerce#12 - /mon-compte/
Conditions générales de vente et d’utilisation: ❌ Page non définie

### Theme ###

Name: Twenty Twenty-One
Version: 1.8
Author URL: https://fr.wordpress.org/
Child Theme: ❌ – Si vous modifiez WooCommerce sur un thème parent que vous n’avez pas construit personnellement
nous vous recommandons d’utiliser un thème enfant. Voir : Comment créer un thème enfant

WooCommerce Support: ✔

### Templates ###

Overrides: –

### WC Pages Translations ###

Base de la boutique: ✔
Panier: ✔
Commande: ❌ Traductions manquantes : Deutsch
English

Mon compte: ✔
Terms and conditions: ❌ Page non définie

### Admin ###

Enabled Features: activity-panels
analytics
product-block-editor
coupons
customer-effort-score-tracks
import-products-task
experimental-fashion-sample-products
shipping-smart-defaults
shipping-setting-tour
homescreen
marketing
mobile-app-banner
navigation
onboarding
onboarding-tasks
remote-inbox-notifications
remote-free-extensions
payment-gateway-suggestions
shipping-label-banner
subscriptions
store-alerts
transient-notices
woo-mobile-welcome
wc-pay-promotion
wc-pay-welcome-page

Disabled Features: core-profiler
minified-js
new-product-management-experience
product-variation-management
settings
async-product-editor-category-field

Daily Cron: ✔ Next scheduled: 2023-06-28 09:20:31 +02:00
Options: ✔
Notes: 113
Onboarding: completed

### Action Scheduler ###

Terminé: 49
Oldest: 2023-06-02 10:16:23 +0200
Newest: 2023-06-26 17:15:28 +0200

Échoué: 11
Oldest: 2022-03-21 13:38:48 +0100
Newest: 2023-05-23 16:38:55 +0200

En attente: 1
Oldest: 2023-06-27 17:06:59 +0200
Newest: 2023-06-27 17:06:59 +0200


### Status report information ###

Generated at: 2023-06-27 13:52:44 +02:00

Isolating the problem

  • I have deactivated other plugins and confirmed this bug occurs when only WooCommerce plugin is active.
  • This bug happens with a default WordPress theme active, or Storefront.
  • I can reproduce this bug consistently using the steps above.
@samueljseay samueljseay transferred this issue from woocommerce/woocommerce Jun 27, 2023
@webdados
Copy link

I can confirm this.

Here's the problem:
https://github.com/search?q=repo%3Awoocommerce%2Fwoocommerce-blocks%20path%3A%2F%5Esrc%5C%2F%2F%20print_inline_script&type=code

WordPress 6.3 is on beta 4 and due to be released on August 8, and this issue is still "awaiting triage".
Just install the latest WordPress nightly, enable WP_DEBUG and you got the notices on the frontend.

@danieldudzic danieldudzic self-assigned this Jul 11, 2023
danieldudzic added a commit that referenced this issue Jul 11, 2023
danieldudzic added a commit that referenced this issue Jul 14, 2023
* Mini Cart: Replace the deprecated print_inline_script() with supported get_inline_script_data(). Fixes #10004

* Mini Cart: Add version check for the new get_inline_script_data() function

* Update the variable names and fix a typo

* Mini Cart: Add regex to check for the WP version

* Abstract the WP version comparison regex to a separate Utils class
gigitux pushed a commit that referenced this issue Jul 31, 2023
* Mini Cart: Replace the deprecated print_inline_script() with supported get_inline_script_data(). Fixes #10004

* Mini Cart: Add version check for the new get_inline_script_data() function

* Update the variable names and fix a typo

* Mini Cart: Add regex to check for the WP version

* Abstract the WP version comparison regex to a separate Utils class
gigitux added a commit that referenced this issue Jul 31, 2023
* Fix: WooCommerce Blocks causing malfunction of the navigation block on WordPress 6.3 (#10388)

* Make sure the revert button is registered and enqueued for usage exclusively in the site editor.

* Register and enqueue the styles for the revert button.

* Rename the files.

* Revert "Rename the file renames."

This reverts commit c0330ce.

* Add plugin-proposal-optional-chaining to the WebPack plugins config.

* Rename the files.

* Remove unnecessary dependencies as those are already provided via : more specifically, get_script_data.

* Address CR.

* Cart and Checkout Page Migration: Inherit Page template and fix rendering (#10375)

* Change shortcode block render callback

* Inherit template from original "page" template

* Check if WordPress version is higher than 6.2.2 to make Products block compatible with Gutenberg 16+ (#10360)

* Check if WordPress version is higher than 6.2.2 to make Products block compatible with Gutenberg 16+

* Extract the logic of checking the post template support for grid view toi separate function

* Change the versions comparison and improve description of custom version compare function

* Render Checkout/Cart containing pages without template overriding (#10359)

* Render Checkout/Cart containing pages without template overriding

* Fix checkout typo

---------

Co-authored-by: Mike Jolley <mike.jolley@me.com>

* Add to cart form: Fix fatal error when missing `product` param in add_to_cart_redirect_filter (#10316)

* Transform product param optional in add_to_cart_redirect_filter method

* Remove unnecessary argument from add_to_cart_redirect_filter

* Remove mocked filter call

* Remove unnecessary argument from function docs

* Remove opinionated styles from Product Hero pattern (#10255)

* Mini Cart: Remove deprecated print_inline_script() (#10165)

* Mini Cart: Replace the deprecated print_inline_script() with supported get_inline_script_data(). Fixes #10004

* Mini Cart: Add version check for the new get_inline_script_data() function

* Update the variable names and fix a typo

* Mini Cart: Add regex to check for the WP version

* Abstract the WP version comparison regex to a separate Utils class

* Call wc_setup_product_data if the global product variable is not an instance of WC_Product. (#10128)

* Empty commit for release pull request

* add testing instructions

* Per block stylesheets (#9831)

* Clean up blank lines

* Update Webpack config

* Update PHP logic to load block styles

* Style fixes

* Style fixes (II)

* Style fixes (III)

* Style fixes (IV)

* Fix missing stylesheets in the Site Editor

* Fix wrong return values in some PHP method docs

* Fix missing ProductPrice stylesheet causing 404 in tests

* Fix missing ProductGallery stylesheet causing 404 in tests

* update testing instructions

* add zip link

* update version

* update zip link

* remove screenshot

* remove testing instructions

* Register Legacy block for all taxonomy-product_ template (#10382)

* WIP

* improve logic

* improve unit test

* $post validation on Cart and Checkout template (#10410)

Co-authored-by: Luigi Teschio <gigitux@gmail.com>

* Update zip

---------

Co-authored-by: Patricia Hillebrandt <patriciahillebrandt@gmail.com>
Co-authored-by: Mike Jolley <mike.jolley@me.com>
Co-authored-by: Karol Manijak <20098064+kmanijak@users.noreply.github.com>
Co-authored-by: Paulo Arromba <17236129+wavvves@users.noreply.github.com>
Co-authored-by: Alexandre Lara <allexandrelara@gmail.com>
Co-authored-by: Albert Juhé Lluveras <contact@albertjuhe.com>
Co-authored-by: Daniel Dudzic <daniel.dudzic@automattic.com>
Co-authored-by: github-actions <github-actions@github.com>
Co-authored-by: Luigi <gigitux@gmail.com>
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants