Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tab and tab item blocks are loaded where they are not necessary #199

Open
1 task done
YourMark opened this issue Jul 17, 2024 · 1 comment
Open
1 task done

Tab and tab item blocks are loaded where they are not necessary #199

YourMark opened this issue Jul 17, 2024 · 1 comment
Labels
type:bug Something isn't working.

Comments

@YourMark
Copy link

Describe the bug

Since version 1.3.4 the plugin always includes the block assets for tabs and tab items. This causes a chain reaction, because of dependencies, that leads to an GET-request for every visitor on the site.

The tabs and tab item blocks both have wp-block-editor as dependency, which on it's place again has dependencies on wp-preferences and wp-preferences-persistence.

wp-preference has an after script that looks like this:

<script type="text/javascript" id="wp-preferences-js-after">
/* <![CDATA[ */
( function() {
				var serverData = false;
				var userId = "0";
				var persistenceLayer = wp.preferencesPersistence.__unstableCreatePersistenceLayer( serverData, userId );
				var preferencesStore = wp.preferences.store;
				wp.data.dispatch( preferencesStore ).setPersistenceLayer( persistenceLayer );
			} ) ();
/* ]]> */
</script>

which triggers the GET-request. When not logged in, the request fails.

Steps to Reproduce

  1. Go to https://iculture.nl
  2. Check the network tab and see a request to https://www.iculture.nl/wp-json/wp/v2/users/me?context=edit&_locale=user is made.
  3. If you look at the initiator stack, it appears to becoming from the preference-js-after script, which is included af ter preferences-js.

Screenshots, screen recording, code snippet

No response

Environment information

No response

WordPress information

No response

Code of Conduct

  • I agree to follow this project's Code of Conduct
@YourMark YourMark added the type:bug Something isn't working. label Jul 17, 2024
@YourMark
Copy link
Author

FYI: Since we're not using the plugin anymore, we'll be disabling it soon. But we'll leave it there for another week or so, so you can check the site if you need any data.

@jeffpaul jeffpaul added this to the Future Release milestone Aug 5, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
type:bug Something isn't working.
Projects
Status: Incoming
Development

No branches or pull requests

2 participants