Post loading
-
Hello,
the plugin loads on every post (js and css) no matter if there is a table or not. Is it possible to fix it?
-
It should not and does not on my sites.
can you send me a link of where that is occurring?
also have you followed the debug instructions in the faq
https://ww.wp.xz.cn/plugins/lh-sortable-tables/ie disable all other plugins and use a standard theme.
in 99% of thee cases it is another plugin causing issues.
-
This reply was modified 5 years, 7 months ago by
shawfactor.
I deactivated all other plugins. Here is my simple basic test post with basic astra theme.
https://qwerty1.space/2020/10/16/hgh-tyrty/”>
and also test with gt metrics where is visible that js and css plugin files still appear
https://gtmetrix.com/reports/qwerty1.space/FjBvRHSR”>
-
This reply was modified 5 years, 7 months ago by
hganev.
What my plugin does is register the css and js, but it only enqueues it if the table with a class of sortable is present. I have checked your page and this is what is being outputted
<link rel=”prefetch” href=”https://qwerty1.space/wp-content/plugins/lh-sortable-tables/scripts/sortable.mega-advanced.js?ver=1602669661″ />
<link rel=”prefetch” href=”https://qwerty1.space/wp-content/plugins/lh-sortable-tables/styles/sortable.css?ver=1602669661″ />So a piece of code (not in my plugin) is seeing that sortable.css and sortable.mega-advanced.js are registered and then adds them as prefetches (but is not enqueueing them). If they were enqueued by my plugin you would see something like this (code is from one of my sites):
<link rel=’stylesheet’ id=’lh_sortable_tables-style-css’ href=’https://localhero.biz/wp-content/plugins/lh-sortable-tables/styles/sortable.css?ver=1601879327′ media=’screen’ />
<script defer=”defer” id=”lh_sortable_tables-script” src=’https://localhero.biz/wp-content/plugins/lh-sortable-tables/scripts/sortable.mega-advanced.js?ver=1601879171′ ></script>As such I can say your problem is definitely not caused by my plugin and it is not caused by core wordpress doing this either. So it has to be something else. Likely your theme or you have not disabled all other plugins.
-
This reply was modified 5 years, 7 months ago by
shawfactor.
-
This reply was modified 5 years, 7 months ago by
shawfactor.
-
This reply was modified 5 years, 7 months ago by
shawfactor.
-
This reply was modified 5 years, 7 months ago by
shawfactor.
Thanks for your time I’ll investigate further. The plugin is much faster and smaller than my old jquery table plugin.
A bit more feedback. It doesn’t work the right way if there is a dollar sign and more than two numbers inside some cells.
<table class="sortable" style="width: 100%;"> <thead> <tr> <th>Firstname</th> <th>Lastname</th> <th>Stars</th> <th>Price</th> </tr> </thead> <tbody> <tr> <td>John</td> <td>Smith</td> <td>6</td> <td>$512</td> </tr> <tr> <td>Harry</td> <td>Doe</td> <td>3</td> <td>$36</td> </tr> <tr> <td>Eve</td> <td>Jackson</td> <td>4</td> <td>$113</td> </tr> </tbody> </table>-
This reply was modified 5 years, 7 months ago by
hganev.
The sorting is handled by Jonas Earendel’s vanilla js table sorting library:
https://github.com/tofsjonas/sortable
(as mentioned in the plugin description)
The library includes many different sorting methods (see the advanced examples) so if one does not work try some of the others.
If you think there is an actual problem with a method though add a bug to his github repository. I’m happy to keep the plugin synchronised with the library, but I’m not going to fork it as it works for me and I’m not overly strong on javascript.
I am resolving this for good order. But will still monitor the thread.
-
This reply was modified 5 years, 7 months ago by
The topic ‘Post loading’ is closed to new replies.