Mandar Apte

UI/UX Designer from Mumbai, Maharashtra, India.

Category: Tutorials

Free Tutorials

  • How to fix WordPress Automatic Update Error.

    Background:

    When WordPress.Org releases a new update to its WordPress standalone CMS (Content Management System), you may have set your website to get your installation updated automatically, or you may like to do it yourself at your preferred time.

    But because of server load on the part of your web host, you may get an error something like this with a screwed-up blank website with the following error printed on the screen:

    Warning: require(/nfs/domains/your-domain-name.com/html/wp-includes/session.php) [function.require]: failed to open stream: No such file or directory in /nfs/domains/your-domain-name.com/html/wp-settings.php on line 122
    
    Fatal error: require() [function.require]: Failed opening required '/nfs/domains/your-domain-name.com/html/wp-includes/session.php' (include_path='.:/usr/local/php-5.3.27/share/pear') in /nfs/domains/your-domain-name.com/html/wp-settings.php on line 122
    

    The actual cause of the above errors:

    As mentioned, errors are generated because of interrupted WordPress updates, primarily because of heavy load on your web host’s online server. As the update fails, all files mismatch with consistent version numbers, so some old source files remain as it is & only the remaining few get updated with the new version. So, it is a problem of source code version consistency.

    How to fix this:

    Error 01: [function.require]: failed to open stream: No such file or directory in

    Error 02: Fatal error: require() [function.require]: Failed opening required & (include_path=’.:/usr/local/php-5.3.27/share/pear’)

    (more…)
  • What do CTR (click-through rate), CPC (cost per click), and RPM (page revenue per thousand impressions) mean in online advertising?

    In today’s online advertising age, as an online publisher or advertiser, you will always come across jargon or terms like CTR, CPC, and page RPM.

    All the terms mentioned above help you understand the metrics you want to know before you can finalise & execute ‘Online Advertising’ campaigns. It also allows advertisers to make sound decisions on choosing the right publisher & on the other hand, it helps the publisher to know where his blog is heading or if his design decisions are right or wrong. Ad positions & placements are right or wrong, or should he tweak his website to increase CTR, CPC & Page RPM, respectively?

    So here is detailed information about:

    (more…)
  • 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…)
  • Write an iOS/iPadOS app code to transition from one screen to another.

    There are instances when you want to transition or navigate from one UI screen to another by pressing a button.

    Yes, you can link the button visually by control-clicking on it and then linking it to the required UI Screen on the storyboard.

    But I will show you how you can do it programmatically with code defined & working differently for iPad & iPhone Storyboards.

    I have used iOS Conditional coding syntax to differentiate iPhone & iPad Storyboards

    Note: You can read about iOS Conditional Coding Here, How to detect user is using iPad or iPhone for iOS App at run time conditional coding purposes

    (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 hide the ‘Back’ button on the iOS/iPadOS App.

    You want to hide this ‘Back’ button when you transition from one screen to the next, probably the detail view screen, where Xcode automatically puts this for you without asking if you want it.

    You can copy the below code to your ‘viewDidLoad’ method in your respective file:

    Objective-C Code:

    [self.navigationItem setHidesBackButton:YES animated: YES];
    

    Swift Code:

    self.navigationItem.setHidesBackButton(true, animated: true);
    

    Hope it helps,

    Thanks & Regards
    Mandar Apte

  • 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…)
  • How to reset Macintosh’s Finder App Preferences.

    There are times when the OSX Finder starts acting weirdly, won’t obey your command, click, or tap, and you want to reset your Macintosh’s OSX Finder to its default setting to make it work as before, just like when you started your Mac for the first time.

    If you are using the latest Mac OSX or even OSX operating system, here is how to do it

    Delete Finder preferences using Finder

    Step 01:
    Navigate to the Preferences folder in your username’s home library folder.
    Open up the Finder window. Your User Name Home folder > Library > Preferences
    OR there is another way if your ‘Library’ folder is hidden by default
    Option-click on the ‘Go’ menu in the menu bar at the top of your screen. You will see the ‘Library’ folder link. Click or tap on it to open up your ‘Library’ folder.

    (more…)