yo35 / rpb-chessboard

A WordPress plugin to display chess games and diagrams (using the standard FEN and PGN notations).
https://wordpress.org/plugins/rpb-chessboard/
GNU General Public License v3.0
35 stars 16 forks source link

RPB Chessboard dependent on jQuery ? #288

Open HEXALIX opened 4 months ago

HEXALIX commented 4 months ago

On my site, when i remove jquery script from the front-end, the chessboards are no longer visible.

add_filter( 'wp_enqueue_scripts', 'remove_default_jquery_script' );
function remove_default_jquery_script( ){
    wp_dequeue_script( 'jquery');
    wp_deregister_script( 'jquery');   
}

I'd like to remove the jquery script to improve my site's performance as much as possible. Is the plugin really dependent on jquery ?

yo35 commented 4 months ago

jQuery is used:

  1. for the popup navigation board (see example on https://rpb-chessboard.yo35.org/examples/chess-game/),
  2. for some components in the plugin admin pages,
  3. to query some DOM elements when rendering the chessboard and chessgame blocks.

It should be possible to get rid of jQuery for 2 and 3, but point 1 is blocking.

tissatussa commented 4 months ago

..to improve my site's performance as much as possible..

being a webdeveloper for many years (but retired now) i know loading jQuery is hardly a bottleneck in performance .. maybe you can use an older jQuery version which is less Kb but still has needed functionality ?