Monday, May 16, 2022
How to Create a GDPR Modal Popup Using RoarJS
The script below will check for a localStorage variable, which is the explicit user consent. If the variable exists, the…
Wednesday, May 8, 2024
RoarJS – JavaScript Alert/Confirm Replacement
RoarJS is a wonderful, responsive, customisable, accessible (WAI-ARIA), zero-dependency, vanilla JavaScript alert/confirm replacement. RoarJS automatically centers itself on the page…
Monday, September 22, 2025
Google Sans
Updated on July 3d, 2019, and added the Google Fonts API URL. Google Sans (Product Sans) web font Google Sans…
Wednesday, April 30, 2025
How to replace jQuery.ajax() with vanilla JavaScript in WordPress
In an effort to remove all jQuery dependency from one of my plugins, I decided to turn all jQuery.ajax() requests…
Monday, May 19, 2025
Thoughts on WordPress
I need a fresh WordPress. I need a light WordPress. What would it take to fork WordPress and remove all…
Monday, May 16, 2022
Useful JavaScript String Prototypes
This is a function to remove all double whitespaces and preceding line breaks. This is a function to replace all line…
Monday, May 16, 2022
How to Create an Internationalisation System Using JavaScript
Creating an i18n system in JavaScript can be tricky. The most popular option is to use global variables, but it…
Wednesday, November 29, 2023
WordPress SEO
Introduction WordPress is used on ~43% of the sites out there. WordPress is very easy to install and has very…
Monday, September 22, 2025
Client-Side JavaScript Pagination
Server-side pagination is needed when you have to display hundreds of records. You may fetch results from a database using…
Monday, May 16, 2022
truthy and falsy in JavaScript
In JavaScript, any variable can be used in a logical context, such as the condition of an if statement or…
Monday, May 16, 2022
A JSON Overview
JavaScript Object Notation, or JSON, is a plain text data interchange format. It is based on a subset of the third…
Tuesday, June 14, 2022
Native Browser Support for JSON
JavaScript Object Notation, or JSON, is a text format used to represent JavaScript objects as strings. Like other text formats,…
Monday, May 16, 2022
A Quick Introduction to Custom Data Attributes and Vanilla JavaScript
For years, developers have needed a method for adding their own metadata to HTML elements, but no standardized technique existed.…
Monday, May 19, 2025
WordPress Management Checklist
I’ve been using this management checklist for my WordPress clients for more than 10 years, with various additions, changes, and…
Monday, September 22, 2025
Changing or Updating Your Version of PHP for WordPress
If you want to keep your website running smoothly and securely, it’s a good idea to change or update the…
Tuesday, May 10, 2022
JavaScript Selectors API
Dealing with the DOM can be a very tedious process. Traversing the DOM can quickly clutter your code with nested loops. For…
Wednesday, June 15, 2022
Promises in JavaScript
Writing code in an async programming framework like node.js becomes super complex and unbearably ugly, superfast. You are dealing with…
Monday, February 27, 2023
Custom Events in JavaScript MVC
Events are the bread and butter in UI development. They are frequently used to kick off JavaScript to deal with…
Thursday, August 14, 2025
Cutting Loose: Dynamic Namespacing in JavaScript
Most of the JavaScript libraries come wrapped in an easy to refer single object. The object acts as a namespace,…
Tuesday, May 10, 2022
Image Beacons
Using image beacons is one of those popular techniques that you would probably know about without knowing its name. The technique helps…
Tuesday, May 10, 2022
Understanding JavaScript Currying
I recently fully understood the concept of utilizing Currying in JavaScript. The core concept can be grasped from these references: Wikipedia entry on…
Tuesday, May 10, 2022
How and Why to Avoid ‘for’ Loops
Never again use for() for looping. Using for() can be dangerous, especially if you use a library which adds attributes…
Tuesday, May 10, 2022
JavaScript Random String Generator
I needed a random string for various purposes. For example, to provide a unique ID to HTML elements via JavaScript.…
Wednesday, April 30, 2025
John Resig’s Inheritance
John Resig, the creator of jQuery, has created this JavaScript inheritance code. I am still using it now to simplify several…
Tuesday, May 10, 2022
Encapsulation: Private Attribute
In JavaScript OOP there are attributes called private attributes. Knowing if an attribute is private or public, an API user…
Wednesday, April 30, 2025
Encapsulation: Private and Public Methods
When it comes to developing APIs, self-documenting code is very important, as it simplifies the user’s effort in filtering the…
Monday, April 28, 2025
OOP In PHP (Object-Oriented Programming in PHP)
This is a basic introduction on how to use OOP – Object-Oriented Programming in PHP, as requested by a friend.…
Tuesday, May 10, 2022
Giving Object Context to Function Calls
JavaScript has a dynamic object named this. By default, this equals to the global object container, so if we have…
Tuesday, April 29, 2025
Self Documenting Flexible Parameters
When managing function parameters, it’s often more maintainable to use an options object. This allows you to pass a single…
Tuesday, May 10, 2022
Use ‘this’ Keyword with setTimeout()
setTimeout() is a great help to many JavaScript developers. For example, you may wish to add a delay to allow…
Tuesday, May 10, 2022
Load a JavaScript File on the Fly
Similar to my previous article on how to add/inject a CSS stylesheet using Vanilla JavaScript, this is how you load…
Monday, September 22, 2025
Generate HTML List From JavaScript Array
Generate an HTML list based on the contents of a JavaScript array. By modifying the makeList() function to accept parameters…
Tuesday, May 10, 2022
Same-Origin AJAX Request Using Vanilla JavaScript
This JavaScript function will send an AJAX request - GET or POST - with no third-party dependencies. I find it…
Tuesday, May 10, 2022
How to Add a CSS Stylesheet in Vanilla JavaScript
The function below will dynamically inject a CSS stylesheet in the document's using Vanilla JavaScript (no dependencies).
Wednesday, April 30, 2025
How to Make an Iframe Responsive Using JavaScript
Stubborn iframes can be tamed using a simple JavaScript trick and a couple of code tweaks. Use the code below…
Wednesday, June 15, 2022
How I cleaned up my Ubuntu server
This is how I clean up my Ubuntu server with a weekly or monthly frequency. It also applies to Debian…
Friday, September 15, 2017
Search for an element until found using JavaScript
A nice piece of code to use for A/B testing to look for a certain element every 50 milliseconds, execute…
Tuesday, August 22, 2023
Pure JavaScript tabbing functionality with linkable tabs
This script shows you how to create vanilla JavaScript tabs anywhere, physically linkable without any external JavaScript library. 305 bytes…
Wednesday, April 30, 2025
How to dynamically append a CSS file
This code snippet allows you to dynamically append a CSS file to your document's head. It can be used inside…
Wednesday, April 30, 2025
JavaScript String Multiline Trim/Cleanup
This small JavaScript prototypes enhance the trim() function and allow for better trimming and/or replacing line breaks with commas (or…
Friday, September 15, 2017
AJAX Request Using Vanilla JavaScript
This is how you create an AJAX request with optional GET parameters in JavaScript. Note that you need to be…
Wednesday, April 30, 2025
JavaScript Credit Card Validation
This is a collection of JavaScript snippets to validate credit card details without requiring any library. Feel free to customise…
Thursday, August 14, 2025
Plugin Spam, Plugin Adoption, Plugin Takeover
A recent Wordfence investigation brought up the fact that one of my plugins, Finance Calculator, has been taken over by…
Monday, September 22, 2025
PHP/MySQL Tutorials
Our PHP/MySQL tutorials and code snippets allow you to extend the power of your site. Our step by step PHP/MySQL…
Monday, September 22, 2025
WordPress Tutorials
Our WordPress tutorials allow you to extend the power of WordPress. Our step by step WordPress tutorials are easy to…
Monday, September 22, 2025
Ultimate .htaccess Guide
This guide was built to serve as a comprehensive resource to using .htaccess. The .htaccess file is a configuration file…
Tuesday, June 18, 2024
GPG/PGP Tutorial
This documentation provides the basic usage of GPG/PGP, following creation of keys, encryption/decryption, generating files, sending and receiving, uploading to…
Friday, October 16, 2020
Switching from Debian to Ubuntu: Beginner’s Guide
I just switched my development server from Debian to Ubuntu. I decided to use Ubuntu 16.04, nginx 1.10, PHP 7…