wp-postviews icon indicating copy to clipboard operation
wp-postviews copied to clipboard

FR - Use vanilla JS (not jQuery) loaded in footer

Open JiveDig opened this issue 3 years ago • 6 comments

This plugin seems useful, thanks! However, I can't use it because we don't want jQuery loading on our sites. I'm just making an official feature request if you could switch to fetch in JS instead of ajax in jQuery :)

JiveDig avatar Apr 06 '22 15:04 JiveDig

PR submitted above. Let me know what you think!

JiveDig avatar Apr 07 '22 20:04 JiveDig

Looks ok, can I assume you tested it. I am not using cache on my site, so I will not be testing it anytime soon.

lesterchan avatar Apr 10 '22 13:04 lesterchan

Definitely works. I'm not super advanced with JS and fetch/ajax calls, but I've done it a few times and this was pretty straightforward. I'm not sure what the cache !1 part was for but I left it in there.

JiveDig avatar Apr 10 '22 14:04 JiveDig

false = !1 when it is minify :D

lesterchan avatar Apr 12 '22 03:04 lesterchan

@lesterchan I'm hoping to run this on a live site soon. Do you plan to release an update with this and the other PR that had the bots update in the near future? Otherwise I may run the latest branch just to get some pageviews stored before we need them in our queries.

JiveDig avatar Apr 19 '22 19:04 JiveDig

I don't think I will be releasing an update anytime soon. Feel free to use the latest master branch for now =)

lesterchan avatar Apr 21 '22 04:04 lesterchan

https://github.com/lesterchan/wp-postviews/commit/3cd09cd654026fc5c12e7307733a354fa11f33ec

lesterchan avatar May 05 '23 01:05 lesterchan