missing JS dependency clipboard.js
-
This issue arose with WordPress 4.6.20, PHP 5.6 (also tested: 7.4) and MySQL 5.6/5.7. And, of course, Visualizer 3.4.11 + Visualizer PRO 1.9.8.
Steps to reproduce:
– Install Visualizer (manually or via plugin repo, doesn’t matter)
– Install Visualizer PRO from the archive that can be downloaded from ThemeIsle
– Try to click on any of the ‘Add New’ or ‘Library’ buttons/links. It won’t do anything. No reload, no white Screen of Death, just an empty javascript call.Things I also tried:
– All kinds of file permissions
– 2 other Managed Hosting webspaces
– reinstalling
– removing all plugins and themes (except for twentysixteen)
– not using PRO
– clearing the license field and then reactivating itWhen looking into the issue, I noticed that WP Query Monitor logs a critical error in the “Scripts” department. Apparently, Visualizer depends on clipboard.js, but doesn’t contain it. This is how I fixed it:
1. Grab clipboard.js from the wp-includes of WordPress 5.6
2. register the script withfunction enqueue_clipboard_js_for_visualizer() { wp_register_script( 'clipboard', get_template_directory_uri() . '/js/clipboard.min.js', array(), $ver = false, $in_footer = false ); } add_action( 'admin_enqueue_scripts', 'enqueue_clipboard_js_for_visualizer', 3, false );When this is done, the Plugin works as expected, it seems.
Question: Would you please confirm whether this is actually the version you intended to pack with your plugin? I can’t deploy a site with a weird hack like this if I didn’t AT LEAST verify this is actually what your plugin is expecting.
edit: I changed my source link for the clipboard.min.js from github user zenorocha to WP 5.6’s own clipboard.min.js (in wp-includes).
The topic ‘missing JS dependency clipboard.js’ is closed to new replies.