The changes I make to an external JS file of my WP plugin are only applied after I clear my browser’s cache

Use function filemtime($path), where $path is a path to your script, in wp_enqueue_script call, as fourth parameter (version). Every time you modify the script, the cache will be bypassed. Update Calls to wp_register_script and wp_enqueue_script: wp_register_script(‘DynamicMapScript’, plugins_url(‘DynamicMap.js’, __FILE__), array(‘jquery’), filemtime(dirname(__FILE__) . ‘/DynamicMap.js’)); wp_enqueue_script(‘DynamicMapScript’);

Limit the Excerpt field in WP-Admin in words

You can use something like jQuery Simply Countable plugin and attach it to excerpt input. Limit_Excerpt_Words::on_load(); class Limit_Excerpt_Words { static function on_load() { add_action( ‘admin_enqueue_scripts’, array( __CLASS__, ‘admin_enqueue_scripts’ ) ); } static function admin_enqueue_scripts() { global $hook_suffix; if ( ‘post.php’ == $hook_suffix || ‘post-new.php’ == $hook_suffix ) { wp_enqueue_script( ‘jquery-simply-countable’, plugins_url( ‘/jquery.simplyCountable.js’, __FILE__ ), array( … Read more

How to solve ‘Eliminate render-blocking JavaScript and CSS in above-the-fold’ content for multiple files?

put this code at the end of functions.php add_action(‘customize_register’, ‘customizer’); function defer_parsing_of_js ( $url ) { if ( FALSE === strpos( $url, ‘.js’ ) ) return $url; if ( strpos( $url, ‘jquery.js’ ) ) return $url; return “$url’ defer “; } add_filter( ‘clean_url’, ‘defer_parsing_of_js’, 11, 1 );

How to use WordPress (PHP) functions in AngularJS partials files?

What works is calling WP’s Ajax endpoint. Note that it is not the address of your partial, but the fixed WP address for all AJAX calls wp_localize_script(‘handle’, ‘myLocalized’, array( ‘ajaxUrl’ => admin_url( ‘admin-ajax.php’ ) ) ); provides the endpoint adress in the JS object myLocalized. You send all requests to that page and refer to … Read more