How to Delay The Execution of JavaScript to Boost Page Speed

How to Delay JavaScript to Boost Page Speed

In recent years, approaching users on multiple channels such as advertising websites, social networks, or live chat services has become more and more popular. And then, using scripts to insert those services into a website is the most important technique. However, using too many 3rd party scripts will cause a slower loading speed of the website and its Page Speed scores may be worse. At that time, you often have just 2 options: accept the slow loading or remove some scripts. After a while of researching, we found a way to have one more option. It’s delaying the execution or loading of JavaScript. Let's see how!

Continue reading "How to Delay JavaScript to Boost Page Speed"

Top Must-Read Blogs for Developers - P3 - JavaScript

Top Must-Read Blogs for Developers - P3 - JavaScript

Over the past 20 years, JavaScript has been the most popular programming language in the world. You can learn it quickly and apply it to various purposes, thus creating more opportunities for your career. That’s why we have selected the five best blogs about JavaScript in this series of top must-read blogs for developers. Maybe there will be at least an appropriate blog for you no matter what level you are at.

Continue reading "Top Must-Read Blogs for Developers - P3 - JavaScript"

How to Send GET and POST Requests with JavaScript Fetch API

How to Send GET and POST Requests with JavaScript Fetch API

It's a common task for JavaScript developers to send GET and POST requests to retrieve or submit data. There are libraries like Axios that help you do that with beautiful syntax. However, you can achieve the same result with a very similar syntax with Fetch API, which is supported in all modern browsers.

In this post, we'll use the Fetch API to create get() and post() function with a beautiful syntax, much better than the default syntax provided in the Fetch API. We also improve the request performance with a simple caching and we'll take a look at how to use fetch requests with the WordPress REST API. Let's dive in!

Continue reading "How to Send GET and POST Requests with JavaScript Fetch API"

How to Remove Unused CSS and JavaScript Files in WordPress

How to Remove Unused CSS and JavaScript Files in WordPress

Website owners and developers as well usually care about improving the website’s loading speed. One of the most effective techniques to do that is removing the unused CSS and Javascript files. This execution is quite simple. We are going to show you how to find unused CSS and JS files, and then clean up CSS and JS with a dedicated plugin or a self-created plugin in WordPress.

Continue reading "How to Remove Unused CSS and JavaScript Files in WordPress"

How to Add Custom JavaScript Actions Using Button Field with Meta Box

How to Add Custom JavaScript Actions Using Button Field with Meta Box

In WordPress, there are only default functional buttons on the backend to do some actions like submitting posts or adding categories. Do you want to add other custom functional buttons to make your management much easier? Today, we’ll find a way to add custom JavaScript actions using the Button field with Meta Box in the most convenient way.

Continue reading "How to Add Custom JavaScript Actions Using Button Field with Meta Box"

Modernizing JavaScript Code in WordPress

Modernizing JavaScript Code in WordPress

I’ve just had a nice experience improving and modernizing a large JavaScript codebase in a WordPress plugin. The original code was written in an old-fashioned way with jQuery in a single large file. Using modern EcmaScript and tools like Webpack, I was able to split it into modules and improve the code structure. The new code is much more readable and maintainable, and of course, fewer bugs. In this tutorial, I’ll show you how I did that.

Continue reading "Modernizing JavaScript Code in WordPress"

How to disable Gutenberg without using plugins

How To Disable Gutenberg Without Using Plugins

Although Gutenberg is the default editor in WordPress, not everyone wants to use it because of the bad editing experience. And Gutenberg loads CSS files and lots of inline styles on the front end, which will affect your website loading speed. This article will guide you on how to disable Gutenberg with a simple code without using plugins.

Continue reading "How To Disable Gutenberg Without Using Plugins"