Code duplication of TOC inline css
-
Hi! I’ve already wrote about the problem a couple years ago: https://ww.wp.xz.cn/support/topic/code-duplication-because-of-toc-plugin/ . But unfortunately, it wasn’t fixed.
So, I’ll try again: when I put [toc] shortcode in any post, then it’s inline css styling from screen.min.css file becomes duplicated: https://imgur.com/gKKj6mK
Please, fix the problem. Thank you.
The page I need help with: [log in to see the link]
-
Hi @giorgos93,
Thanks for reaching out!
Could you please share a screencast along with the steps needed to reproduce this issue? This will help us troubleshoot the problem and assist you further. You can use a tool like Loom (https://www.loom.com/screen-recorder) to create and share screen recordings
I attempted to identify and reproduce the issue on my testing site using the Table of Contents Plus plugin, but was unable to do so, as shown here: https://a.supportally.com/v/6mJkvX. Please let me know if I missed any steps in reproducing the issue.
I also checked your page at https://litfan.ru/eto-interesno-znat/luchshie-prilozhenija-dlja-chtenija-knig-top-10/ but couldn’t pinpoint the issue. However, I noticed that no CSS files are being loaded from the TOC Plus plugin on that page: https://a.supportally.com/i/4OLJBS.
I’m looking forward to hearing you!
Hi, @aurangajeb ! Unfortunately, I can’t share these steps with you, because there aren’t any. I just put a [toc] shortcode in my classic post editor, publish the post, and then the code duplicates.
The screenshot, that I’ve showed you, is from Asset Cleanup Pro plugin (for /table-of-contents-plus/screen.min.css file). I tried to disable css-minification, css-combination, css-inline and critical css options, but it didn’t help – the code still duplicates.
However, if a page doesn’t have [toc] shortcode, then Asset Cleanup Pro doesn’t show a code duplication for /table-of-contents-plus/screen.min.css file. Like here, for example: https://litfan.ru/interesnye-fakty-o-pisatelyah/interesnye-fakty-o-pushkine-dlya-detej/
Hi @giorgos93,
Thank you for your follow-up!
I attempted to replicate the issue using the Asset Cleanup free plugin (https://ww.wp.xz.cn/plugins/wp-asset-clean-up/) but was unable to do so. I found that only two files are being generated from the Table of Contents Plus plugin:
- JavaScript file: /wp-content/plugins/table-of-contents-plus/front.min.js
- CSS file: /wp-content/plugins/table-of-contents-plus/screen.min.css
For reference, here’s a screencast: https://a.supportally.com/v/5I9uFl
Please check to ensure that those inline CSS files are not loading from any cache. Besides, I believe that this small amount of CSS likely won’t pose a major optimization issue for your site or page.
Thanks.
Hi, I have only two files being generated as well. However, in your screencast you don’t have an option to show inline css for screen.min.css file (but I do, for some reason). You have it only for front.min.js file.
And also I noticed, that the code duplicates only in ‘post’ type. On the main page, and on “page” type I don’t have code duplication in the tab. Maybe it’s a conflict with another plugin / code, that is loaded only in posts?
UPD: I’ve just visited this post: https://litfan.ru/poleznye-resursy-dlya-pisatelej/ywriter-programma-dlja-pisatelej/ and there is no code duplication. And here, for example, it does show code duplication: https://litfan.ru/eto-interesno-znat/kak-najti-knigu-po-syuzhetu-ne-znaya-nazvaniya/
So I guess, the problem is with some old cache, that wasn’t purged for some reason? I did clear cached css/js files both in Asset Cleanup Pro, and my WP Fastest cache plugin many times. But it didn’t fully help, I guess.
I tried to search “toc-screen-inline-css” on my web-hosting, and found 22 files with it (all of them are index.html files).
-
This reply was modified 1 year, 4 months ago by
George.
Hi @giorgos93 ,
Thank you for your update!
It seems like the issue might be related to caching. As I mentioned, I tried to replicate this on my local test sites but couldn’t reproduce the problem.
I recommend testing on a different site or environment to see if you can replicate the issue there, and if you’re able to do so, please let me know the steps you took to reproduce it.
Additionally, keep in mind that this small amount of duplicated CSS is unlikely to significantly impact your site’s optimization or overall performance.
For now, I’m marking this topic as resolved.
I hope this helps.
Thanks!
Hi, @aurangajeb ,
Unfortunately, not only [toc] code is duplicated, but sometimes other codes as well. And the duplication happens only on pages, where [toc] shortcode is presented. If it’s not presented, then other code doesn’t duplicate.
For example, I’ve noticed, that it happens with my “custom-script” js. Here it’s duplicated, because [toc] shortcode is presented: https://litfan.ru/poleznye-resursy-dlya-pisatelej/luchshie-sajty-dlya-publikatsii-knig-top-20/ . And here it’s not duplicated, because [toc] shortcode is not presented: https://litfan.ru/poleznye-resursy-dlya-pisatelej/ywriter-programma-dlja-pisatelej/
Hi @giorgos93,
Thank you for your follow-up!
This seems like an issue that would be difficult to troubleshoot without being able to investigate it in more detail.
Would you mind reaching out to us directly via our free Basic Question form here so we can take a closer look?
Please go to our Contact Us page at https://aioseo.com/contact/ and follow these steps:- Click on the “Complete a Form” button under the “I have a basic question” section.
- Fill in all the requested details, describe the issue by referring to this topic, and click Submit. You may use a tool like https://snipboard.io/ or https://www.loom.com/screen-recorder to create and share any related screenshots/screencast if necessary.
Thanks.
The topic ‘Code duplication of TOC inline css’ is closed to new replies.