TinyMCE plugin won’t work with jQuery 3.5.1 (testing with “Test jQuery Updates”)

since WordPress seems to be moving towards a long due jQuery update, I began testing a few of my plugins (they’re not published, just stuff I use for a few clients’ websites) with the “Test jQuery Updates”. Everything went smoothly until yesterday, when I ran into the following issue. I have this simple plugin that adds a few buttons to TinyMCE (yes, the theme I made for that client uses Classic Editor) for them to easily add shortcodes and pre-composed HTML snippets to their posts and pages. The code is pretty standard: first the buttons are registered via a function hooked to the ‘mce_buttons’ filter hook, then the scripts with the jQuery code for the buttons are loaded via another function hooked to ‘mce_external_plugins’. When I run this with the default WP 5.5 jQuery the button shows up in TinyMCE, while if I activate jQuery 3.5.1 (both with and without jQuery migrate), nothing appears and the worse part is that I don’t get any errors or warnings in the browser console, so I don’t have the faintest idea about what went wrong.

“The editor has encountered an unexpected error” After add defer tag to java script

I added below script to add defer tag in javascripts. Once it added to function.php
Gets error on create post “The editor has encountered an unexpected error.” I cannot create or edit post.
How can i add defer tag to javascripts without affecting to the editor. I don’t have mush experience in coding. Thanks.

Error – ‘create_function is deprecated’

Our WP Debug is report that ‘Function create_function() is deprecated’. Any idea how to rewrite this code to not include create_function ? self::register_form_init_scripts( $form, $field_values, $ajax ); if ( apply_filters( 'gform_init_scripts_footer', false ) ) { add_action( 'wp_footer', create_function( '', 'GFFormDisplay::footer_init_scripts(' . $form['id'] . ');' ), 20 ); add_action( 'gform_preview_footer', create_function( '', 'GFFormDisplay::footer_init_scripts(' . $form['id'] . … Read more

JS working when used normally but not in wordpress

I have a shortcode that prints a simple form, a button is used to submit the form. The problem is that when it’s pressed, the form gets submitted normally, ignoring the js function. I can’t understand why it’s doing this, since trying this locally on XAMPP works (I needed to change something to adapt the js code to WP, but nothing that should change its behavior.