• Hello fellow developers ??

    I am one of the developers of Jetpack family of plugins at Automattic, reaching out to you regarding an issue caused by WP Menu Icons.

    We see that WP Menu Icons uses automattic/jetpack-assets package. Thank you for using it ??.

    We develop/maintain that package in our Jetpack monorepo. We recently added some new JS functions to that package via its JS bundle.

    Yesterday, we had reports of at least one site using the WP Menu Icons plugin along with the Jetpack plugin (v14.0-a.11) and the editor showed an error and the Jetpack settings page crashed.

    Steps to reproduce:

    • Install the latest version of WP Menu Icons (v3.2.7)
    • Install the latest alpha of Jetpack – v14.0-a.11
    • Goto /wp-admin/admin.php?page=jetpack#/settings
    • See the page crashed and check the browser console for the error – TypeError: (0 , s.siteHasFeature) is not a function

    The reason for the crash/error was that WP Menu Icons uses the automattic/jetpack-assets package via composer autoloader. Each plugin’s autoloader generally gets pushed into the start of the autoloader list, and WP generally loads plugins in alphabetical order by slug. So “wp-menu-icons” loads later than “jetpack” or “jetpack-social”, meaning its Composer autoloader winds up in the list before Jetpack Autoloader.

    Thus even if Jetpack has the updated version of the automattic/jetpack-assets package, the version with WP Menu Icons gets loaded, which does not contain the functions included in the version that Jetpack plugin bundles/uses.

    However, the recommended way of using automattic/jetpack-assets package in a WordPress plugin is mentioned in its documentation:

    Using this package in your WordPress plugin

    If you plan on using this package in your WordPress plugin, we would recommend that you use Jetpack Autoloader as your autoloader. This will allow for maximum interoperability with other plugins that use this package as well.

    So, we request you to use the recommended way of loading Jetpack packages to avoid such issues in future.

    Feel free to open an issue in the monorepo if you need any help or have questions.

Viewing 1 replies (of 1 total)
  • Thread Starter Manzoor Wani (a11n)

    (@manzoorwanijk)

    As a quick fix, you may update automattic/jetpack-assets to the latest version and do a patch release of the plugin.

    You may then continue working on that recommended solution mentioned above.

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.