• Resolved alprio

    (@alprio)


    Hello ,
    After the latest update , when I run wp all import from cli I get this error .
    Automattic\WooCommerce\Admin\Features\Navigation\Screen::register_post_type is deprecated since 9.3 with no alternative. Navigation classes will be removed in WooCommerce 9.4

    do you know why is this happening and how to fix it?
    Asked there first but they advised me to open a ticket here.
    https://ibb.co/zV98qhx

    Thank you.

Viewing 9 replies - 1 through 9 (of 9 total)
  • Yes my log file is filled with those as well

    [14-Sep-2024 12:15:03 UTC] Automattic\WooCommerce\Admin\Features\Navigation\Screen::register_post_type is deprecated since 9.3 with no alternative. Navigation classes will be removed in WooCommerce 9.4 [14-Sep-2024 12:15:06 UTC] Automattic\WooCommerce\Admin\Features\Navigation\Menu::add_plugin_item is deprecated since 9.3 with no alternative. Navigation classes will be removed in WooCommerce 9.4 [14-Sep-2024 12:15:06 UTC] Automattic\WooCommerce\Admin\Features\Navigation\Screen::register_post_type is deprecated since 9.3 with no alternative. Navigation classes will be removed in WooCommerce 9.4

    Me three, but what made me look in the error logs was that our Woocommerce Orders page link has changed to this:
    /wp-admin/edit.php?post_type=shop_order
    – very strange – anyone else getting this?

    [16-Sep-2024 12:06:41 UTC] Automattic\WooCommerce\Admin\Features\Navigation\Menu::add_plugin_item is deprecated since 9.3 with no alternative. Navigation classes will be removed in WooCommerce 9.4
    [16-Sep-2024 12:06:41 UTC] Automattic\WooCommerce\Admin\Features\Navigation\Menu::add_plugin_category is deprecated since 9.3 with no alternative. Navigation classes will be removed in WooCommerce 9.4
    • This reply was modified 2 months, 1 week ago by acwporg. Reason: added extra info
    • This reply was modified 2 months, 1 week ago by acwporg.
    Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello alprio,

    Thank you for contacting Woo support.

    The warning you’re seeing indicates that a piece of code is using the register_post_type function, which is deprecated as of WooCommerce 9.3 and will be removed in 9.4. This isn’t directly caused by WooCommerce but comes from a plugin or theme using that function.

    I recommend checking with WP All Import to see if their plugin is referencing this deprecated function. They may have an update or patch to resolve it.

    If it’s not from their plugin, it could be from another plugin or custom code, so it might be worth reviewing your other plugins or contacting the developers.

    For kattouf and acwporg, thank you for your messages.
    I suggest you create separate new topics so we can investigate the issue individually.

    Best regards.

    For my client, this is being caused by the Store Credit for WooCommerce by Kestrel plugin. It is only Woo version 8 compatible (as at v4.5.4). They’ve done very few updates (tut tut).

    To find out which plugin was causing the issue, I ran this command from the /wp-content/plugins/ folder on my Linux backend CLI..

    grep -r "add_plugin_item"
    grep -r "add_plugin_category"

    This will list all references to this code and you can open the file names shown to see if there is any code to manage versions.
    Ignore this file: woocommerce/src/Admin/Features/Navigation/Menu.php

    • This reply was modified 2 months, 1 week ago by acwporg.
    Plugin Support ckadenge (woo-hc)

    (@ckadenge)

    Hi @acwporg,

    Glad to know you were able to find what was causing the issue. Have you already had the chance to reach out to the plugin’s support team?

    Also, you might want to consider updating the plugin to a version compatible with your client’s WooCommerce version, or disabling the plugin entirely if it’s not essential for your client’s store.

    supertomate

    (@supertomate)

    Hello
    Following the last Woocommerce update I got the same error in the logs. On my site it is automatewoo which is not up to date that is causing this error. I saw in the includes/Post_Types.php file that the call to Automattic\WooCommerce\Admin\Features\Navigation\Screen had disappeared as well as the code block

    if ( class_exists( Screen::class ) ) {
    Screen::register_post_type( 'aw_workflow' );
    }

    supertomate

    (@supertomate)

    AutomateWoo has since corrected the code in the latest version 6.1.0 but now the error is still in subscription which is not yet up to date.

    Plugin Support RK a11n

    (@riaanknoetze)

    Hey @supertomate

    Just to say that there’s an open bug report for WooCommerce Subscriptions linked to this deprecated warning logs ??

    Thread Starter alprio

    (@alprio)

    For me was an outdated automate woo plugin.
    thanks everyone for your suggestions !


    • This reply was modified 2 months ago by alprio.
Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.