Mandar Apte

UI/UX Designer from Mumbai, Maharashtra, India.

Category: WordPress

WordPress is a free and open-source content management system (CMS) based on PHP and MySQL. Features include a plugin architecture and a template system.

  • Fix Google PageSpeed Error ‘Eliminate render-blocking JavaScript and CSS in above-the-fold content’ for WordPress Website.

    Here is how you may want to tune up your WordPress website performance, i.e., how long it takes to download your website from the server to your visitors’ computer, mobile or tablet.

    In the era of responsive design, we tend to embed more than one Javascript or CSS file, such as Bootstrap CSS and JS file bundles.

    If you have integrated third-party advertising into your website, vendors like Google add their own Javascript file through their AdSense ad code that you can’t control.

    But here is a simple way out of this problem.

    Important Note:
    Compressing, Minifying, or Deferring Files may harm the website’s functionality because of dependencies, so first, do the following steps on your local server. If everything looks to be working fine, you can update the duplicate files on Live servers—just for safety and security purposes.

    When you ‘Analyse’ your website on Google PageSpeed, you get a warning something like this:
    Your page has 4 blocking script resources and 8 blocking CSS resources. This causes a delay in rendering your page.
    None of the above-the-fold content on your page could be rendered without waiting for the following resources to load. Try to defer or asynchronously load blocking resources or inline the critical portions of those resources directly in the HTML.

    Solution 01:

    The safest way of Deferring JavaScript ‘JS’ would be the following

    Step 01:
    Add the word ‘async’ at the closing tag called ‘</script>’, So your code will not block loading any other resources.

    Step 02:
    Add the same line of code just before closing the footer tag so your code is already asynchronous (async). After moving the same code to the footer, it will load after the website loading.

    (more…)
  • How do you change the color opacity or transparency in CSS?

    There are instances when you think it would be a great idea to change the opacity of the background color of a div without affecting the text, image, and other web properties present inside the same div of HTML and CSS.

    Answer:

    What you usually do is specify background color in CSS using hex, i.e. Hexadecimal values like this:

    .navbar {background-color: #ffffff;}
    

    But if you use RGBA to specify background color in CSS, you can utilise its feature called alpha, i.e. RGBA is a short form for Red – Green – Blue – Alpha

    (more…)
  • How to enable HTTP persistent or HTTP keep-alive connection feature for your WordPress website.

    As Wikipedia explains:

    HTTP persistent connection, also called HTTP keep-alive or HTTP connection reuse, involves using a single TCP connection to send and receive multiple HTTP requests/responses instead of opening a new connection for every request/response pair. The newer SPDY protocol uses the same idea and extends it to allow multiple concurrent requests/responses to be multiplexed over a single connection.

    Note: I assume you have adequate knowledge of handling your server and server settings and are well-versed in your field.

    You can put the following code in your .htaceess file, which is in the root of your server’s html folder.

    (more…)
  • How to enable Gzip Compression for WordPress.

    If you want to increase your website’s performance and speed by reducing its load time on clients’ (i.e., visitors’) machines, then this tutorial will help you.

    Something About WordPress:
    WordPress does not offer a mechanism to compress the blog’s HTML output. The Apache-enabled web server normally provides this feature.

    As the Apache Website Defines, The mod_deflate module provides the DEFLATE output filter that allows output from your server to be compressed before being sent to the client over the network.

    Here is how to enable gzip compression via .htaccess
    If you prefer to allow or fine-tune output compression with the Apache server, then copy and paste the below code into your .htaccess file:

    (more…)
  • How to disable WordPress Pingbacks & Trackbacks.

    Let’s Know What is Pingback?

    A pingback is a type of comment created when you link to another blog post where pingbacks are enabled. The best way to think about pingbacks is as remote comments:

    1. Person A posts something on his blog.
    2. Person B posts on her blog, linking to Person A’s post. This automatically sends a pingback to Person A when both have pingback-enabled blogs.
    3. When Person A’s blog receives the pingback, it automatically goes to Person B’s post to confirm that the pingback originated there.

    Let’s Know What Trackback is.

    Trackbacks are a way to notify legacy blog systems that you’ve linked to them. If you link other WordPress blogs, they’ll be notified automatically using pingbacks; no other action is necessary.

    Think of trackbacks as the equivalent of acknowledgements and references at the end of an academic paper or chapter in a textbook.

    To send a trackback, add the trackback URI from the other blog post to the Send Trackbacks module in your blog post before you publish it. A trackback URI from a WordPress blog will end with /trackback/.

    (more…)
  • Jetpack Related Posts not working or displaying – appearing on WordPress Self Hosted Website Domain or Subdomain, Here is why it is happening & how you can fix it.

    With JetPack for WordPress, Automattic is releasing wordpress.com features for WordPress self-hosted websites.

    One feature in that release is ‘Related Posts,’ where you can activate this inbuilt plugin-like functionality to scan your self-hosted website and display the desired number of related posts under each blog post.

    This feature helps users discover and read related post category content more easily. It also increases the website’s click-through rate, i.e., the Average number of pages visited by each website visitor.

    It sometimes doesn’t show any related posts under any blog post, but there is a reason why it acts up that way.

    (more…)
  • Error while updating your WordPress Installations Automatically or Getting error while uploading file to WordPress blog “Failed to write file to disk.”, Here is a solution for this errors.

    If you are getting an error while uploading a file or image to your WordPress blog or when automatically updating your WordPress installation, then here is the solution for the same.

    All errors are related to something like this:

    Error 01:

    Error while uploading file, image to WordPress blog “Failed to write file to disk.”

    Error 02:

    Automatic update Failed for WordPress 3.8.2

    OR

    Warning: touch() [function.touch]: Unable to create file ~/root-directory/tmp/wordpress-3.tmp because No such file or directory in /nfs/ccc/hhh/ttt/12345/domains/your-domain-name.com/html/wp-admin/includes/file.php on line 155

    Warning: unlink(~/root-directory/tmp/wordpress-3.tmp) [function.unlink]: No such file or directory in /nfs/ccc/hhh/ttt/12345/domains/your-domain-name.com/html/wp-admin/includes/file.php on line 479
    Download failed.: Destination directory for file streaming does not exist or is not writable.

    Here is the Reason & Solution to the problem:

    (more…)
  • How to Fix ‘Warning: require_once() [function.require-once]: Unable to allocate memory for pool.’ Warning thrown at you while you were trying to login in your WordPress admin page.

    Today, I was trying to log in to my website’s Admin page, but I was stopped by following a warning from WordPress’s

    Unable to allocate memory for pool
    

    The full warning summary was something like this:

    Warning: require_once() [function.require-once]: Unable to allocate memory for pool. in /nnn/000/000/mnt/111111/domains/domainname.com/html/wp-includes/pluggable.php on line 1547
    
    Warning: Cannot modify header information - headers already sent by (output started at /nnn/000/000/mnt/111111/domains/domainname.com/html/wp-includes/pluggable.php:1547) in /nnn/000/000/mnt/111111/domains/domainname.com/html/wp-includes/pluggable.php on line 678
    
    Warning: Cannot modify header information - headers already sent by (output started at /nnn/000/000/mnt/111111/domains/domainname.com/html/wp-includes/pluggable.php:1547) in /nnn/000/000/mnt/111111/domains/domainname.com/html/wp-includes/pluggable.php on line 679
    
    Warning: Cannot modify header information - headers already sent by (output started at /nnn/000/000/mnt/111111/domains/domainname.com/html/wp-includes/pluggable.php:1547) in /nnn/000/000/mnt/111111/domains/domainname.com/html/wp-includes/pluggable.php on line 680
    
    Warning: Cannot modify header information - headers already sent by (output started at /nnn/000/000/mnt/111111/domains/domainname.com/html/wp-includes/pluggable.php:1547) in /nnn/000/000/mnt/111111/domains/domainname.com/html/wp-includes/pluggable.php on line 896
    
    (more…)
  • WordPress (WP) Custom Designed Login Logo gets truncated or cropped after WordPress is updated to 3.8+

    Background:

    It seems the custom-designed logo of the login form gets cropped or truncated if you update your WordPress installation to 3.8 or later.

    Just for background & history of the WordPress login form, the logo was something rectangular in shape, as shown below:

    Orginal WordPress Login Logo

    My custom design of my Studio’s logo was the right fit & was working fine, as shown below:

    WordPress Custom Login Logo Fix - Correct Custom Logo after code update
    (more…)
  • Automating WordPress Website Maintenance.

    Assumptions, Prerequisites & Basic Knowledge
    I assume you have decent web design and development knowledge, including HTML and CSS for Ice on Cake, and a working knowledge of PHP. I believe you have deployed your WordPress website on an online live server.

    Introduction to Automated WordPress Maintenance
    This tutorial & my blog post will help you to automate your workflow of updating 100s of WordPress websites without any extra effort. Even when you are sleeping or working on your next big project, your website will do all the work without any from your side. All scripts listed below will help you automate updating WordPress Major & Minor Core Source Code, Themes, Plugins, Database, WordPress site-wide trash cleanup & SPAM Comments removal.

    First Step:
    Towards Automated WordPress Source Code / Core update inclusion of official major & minor releases.

    WordPress.org introduced Automatic Minor Core updates in 3.7. These features remove hassle & extra steps from updating the website to the next dot release of WordPress Website Installation.

    (more…)