Blog

  • How To Speed Up A WordPress site!

    How To Speed Up A WordPress site!

    In my carrier, I’ve met people that do not care about loading speed and thought that if a site takes up to a minute to load it’s completely fine. I’ve seen sites, with a front-page take 16GB🤯 in size, that were never loading. In this article check why you should be concerned about the site’s loading speed and how you can improve it.

    Why should you speed up a WordPress site

    It is already known that any user will rarely go beyond a 3rd page on the Google Search engine, and these first 3 pages have some limited spots open, where your site could be positioned. Here is why a site’s loading speed is crucial when it comes to Google Rankings. Google’s algorithm will rank first a faster loading site. These sites that require more time to load will be placed and lower rank. A lower rank on Google Search Engine means less traffic on your site.

    With a slow loading site speed, you’re risking increasing sites’ Bouncing Rate. Online customers are the most impatient and expect a site to load as fast as possible.

    If we will look at some mobile site data statistics from Think With Google. For every 2-second delay the bounce rate increases by 32%, so let’s say your site requires 6 seconds to load, this means on average 64% of traffic will not be waiting for your site to load and will leave it before seeing the actual content. That’s serious, especially if you’re making money from your site.

    Faster page load time leads to better user experiences, and ultimately to more revenue.

    How to test loading speed of your site


    It’s simple, you can use Site Test Speed sites, here are my top 3 online tools:

    1. PageSpeed Insights
    2. GTMetrix
    3. WebPageTest

    These tools are free, and they provide useful insight about what and how you can improve a site’s loading speed.

    For more advanced users, Chrome Developers Tools have the Test Speed tools implemented within a browser

    One important facto that often I’ve seen is ignored. Visitors from different geographical locations will have a completely different experience when visiting a site. So keep that in mind!

    Setting up Cloudflare integration for users all over the world it’s my first choice. But’s that’s another story 😊

    If you wondering what’s the perfect speed for a site to load, based on the latest researches, it’s 2 seconds. I know, I know, it’s shocking, and now you’re wondering how can it be done. Well check bellow

    Ways to speed up your site

    Set Up Cloudflare DNS

    Your DNS service matters. To make it simple, websites are just files saved on a computer that is connected through the internet. Every device, including a server, that is connected to the internet has an IP address assigned. So if a server is located, in Berlin Germany, and a visitor’s device locate in Frankfurt. Both devices with an IP address need to make a connection to download file content to the device. So every server with IP address, where your site is hosted is given a domain name, in another world, it has a DNS. DNS stands for Domain Name System. So when a user types a domain in their browser, a DNS lookup occurs to find the IP address of the server. Free DNS services from a domain provider usually are slow to respond. Where Cloudflare, which you may still register for free, has a much faster DNS lookup response. See attached screenshot:

    Source www.dnsperf.com

    If possible, use a premium DNS service.

    Plugins and Themes

    Plugins and themes, even deactivated can use some o your site’s performance. So locate plugins & themes that are not been enabled, or even these plugins that are not being used, and remove them. Make sure to keep everything up to date, this will not only help your performance but security as well.

    Optimize and Clean images

    Images can take a serious amount of space. So clean up your site from unused images with the Media Cleaner plugin.

    Optimize all your images with the Smush plugin. If possible consider updating to Pro, which will optimize images even more. With the Smush Pro version, use CDN, or try an alternative Jetpack solution.

    If you can replace PNG format images with JPEG, JPEG can be compressed much better with almost no effect on image quality.

    All these steps will significantly reduce the total size of a site and front-end pages. The smaller size a front page has, the faster it will load.

    Install a Caching plugin

    Caching is a way to store temporary, copies of files, to deliver these to visitors in a more efficient way. There is a big variety of caching files, here is a list with my favorites:

    1. SG Caching, if you’re site is hosted on Siteground as mine does, this is the nest option.
    2. Hummingbird
    3. WP Super Cache

    The above plugins besides page caching will give you an option to enable Browser Cashing, Minimize/Combine JS and CSS, remove Render Blocking CSS & JS, enable GZIP Compression, even clean up your database tables.

    Limit Content

    If there are very long pages, limit them. Try breaking very long pages into smaller pages. The more content exists on a single page, the heavier it will be in size. Limit posts number on your blog page. Let’s see an example, if 25 posts are loading on a single page, it will load 25 image thumbnails, if change the number of posts loading on a single page to 10, a browser will make fewer media requests. Wil fewer media requests, performance will be increased.

    If there is a comment section, break it into pages. Adding paginations for your comments is pretty simple. Login to your WordPress admin dashboard. Go to Settings > Discussions, tick on the “Break comments into pages” and add the number of comments you want to have per page.

    Remove Animations. Animation can give a fancy look to a site, but it comes with a toll, it affects the loading speed.

    One last tip, do not upload a video to your site. User services like Youtube or Vimeo. Online services are optimizing video based on the visitor’s device and serve an optimized version of a video placed on your site. Plus, it will save your bandwidth.

    Hosting

    Many articles have as a first step is checking your hosting loading speed. But let’s not be hasty and blame your hosting provider yet. Most of the servers I’ve seen are good servers, and it’s usually the site’s architecture that is the main factor of slow loading site. Of course, if your site is heavy, for example with the Woocommerce plugin installed and lots of traffic, in this case, you need a stronger server to manage all jobs running in the background.

    The right way to test how fast is your hosting provider loading speed is to set up an empty site, you may just upload a simple index.html file or even have an empty WordPress site and run it through a website test speed tool.


    There is much more stuff that can be done to improve loading speed, it is for more advanced users. Complete the above steps and you will see a significant change in site’s loading speed. Let me know bellow in the comments about the impact of these steps on your sites.

    [Disclaimer: This is not a paid promotional post, so every WP company/service mentioned in this article, I’ve been using myself]

  • Change the WordPress domain after moving to a new host, using phpMyAdmin

    Change the WordPress domain after moving to a new host, using phpMyAdmin

    After migrating your site to a new host, you might need to replace the site domain name.

    You can do it before the site migration, as WordPress documentation suggest. Or you can do this with SQL query, directly changing the domain in the database. I prefer the last solution, I find it quick and easy

    After you’ve done uploading your site’s directory and database, load the phpMyAdmin from your host.

    Click on the main database first and then on the SQL tab.

    SQL tab in phpMyAdmin

    Use the SQL query shown below, past it inside the field.

    Make sure to replace the database prefix wp_ to the one that matches your database.

    Replace the http://www.oldurl with your old URL and http://www.newurl with your new URL

    UPDATE wp_options SET option_value = replace(option_value, 'http://www.oldurl', 'http://www.newurl') WHERE option_name = 'home' OR option_name = 'siteurl';
    UPDATE wp_posts SET guid = replace(guid, 'http://www.oldurl','http://www.newurl');
    UPDATE wp_posts SET post_content = replace(post_content, 'http://www.oldurl', 'http://www.newurl');
    UPDATE wp_postmeta SET meta_value = replace(meta_value,'http://www.oldurl','http://www.newurl');
    

    For safety reasons, you may click on the Simulate Query button to preview the changes. If all is well, re-add the code and click on the Go button.

    And that’s it! That simple 🙂

    Let me know in the comments below if you have any other suggestions.

  • How to Fix the 500 internal server error on WordPress

    How to Fix the 500 internal server error on WordPress

    The 500 Internal Server error it is the most common and general error, that will be shown when there’s a problem with the server or with the WordPress file system. It is the most unhelpful and nondescript bane of web developers everywhere. It’s a catchall error message that can literally mean anything.

    Let’s have a look how to troubleshoot this error.

    If you are seeing this error from time to time, this most likely means that there is not enough PHP memory on your site. In this case please increase your site’s PHP memory,

    To do so, access your site’s folders via a File Manager or via FTP (see Using FTP client bellow). Locate and edit the wp-config.php file.

    Add the following line:

    define('WP_MEMORY_LIMIT', '256M');

    Make sure it is added right above this line

     /* That's all, stop editing! Happy blogging. */ if it already there changed the 64M to 256, if it is not, place the following line inside the file:

    If this line is already there changed the MB value to a higher one.


    If, on the other hand, the 500 error is showing up all the time, this can be caused by a conflicting PHP code on your site.

    Backup your site

    I am highly recommending to backup your site before proceeding this troubleshooting.  To find the core of the issue we will make changes in the root directory of the site. So if something will go wrong, you can always restore it.

    Deactivate all your plugins

    If you have access to your site from the back end, go to Plugins > All Plugins. Select all your plugins, choose “Deactivate” from Bulk Options and Apply changes.

    Check if the 500 Internal Server error is gone from the front page. If it is gone, activate one plugin at the time to find out which one is causing this error.

    If you don’t have access to the backend of your site, use FTP client of File Manager on your cPanel to access WordPress directory files.

    Using FTP client

    If you are already familiar with the FTP client, please skip this section.

    If you are a PC user, please download FileZilla FTP Client from here.

    For Mac Users try:

    1.  Cyberduck; free FTP software designed for Macs
    2.  Transmit – FTP software you purchase designed for Macs

    Once you install FileZilla, use your domain name, username, and password to access your host’s file manager.

    And you are ready to go!

    Access your site from the cPanel

    First, log into cPanel. In the Files section, click on the File Manager icon.

    Click to expand the public_html folder, nad you will see your WordPress site directory root.

    Deactivate your plugins manually

    Navigate to the /wp-content/plugins folder and rename the plugins folder to plugins.deactivate. All the plugins will be deactivated after this.

    Check your front end if it is working, if it is working, if it is, rename back the plugins.deactivate to plugins. Open the plugins folder and start renaming each plugin folder one by one till the error disappears from your site. This will allow you to reactivate each plugin individually to isolate the offending plugin and resolve the 500 Internal Server Error.

    Check the .htaccess file

    Open your WordPress root directory in FileZilla or your preferred FTP client. This is typically called public_html. Locate the .htaccess file, download it to your computer to have a backup and delete it from your directory. Try to load your site again, if your site is back, congratulations!

    Now, go into your WordPress admin area. Hover over Settings, and select Permalinks. Scroll down to the bottom of the page, and click Save Changes.

    Ask your Hosting Provider

    If nothing works, then you need to get in touch with your hosting provider. By looking at the server logs, they should be able to get to the bottom of things.

  • Getting Ready For WordCamp Thessaloniki 2018

    I am really glad to be accepted as a speaker at this year WordCamp that will take place on December 15th, in Thessaloniki. 

    Some of you already know that I’m working for WPMU DEV, as a support staff. I’ve been with the company for more than 3 years now and have a good experience that I want to share with you. I will speak about how to provide awesome support to leave your client happy, how to manage client’s expectations. Set boundaries about what your support should be about and how to deal crisis cases.

    Please see the full Speakers list:

    https://2018.thessaloniki.wordcamp.org/%CE%BF%CE%BC%CE%B9%CE%BB%CE%B7%CF%84%CE%AD%CF%82/speakers/

    If you will attend the #WCTHESS2018 please feel free to find me and talk to me! I will be happy to meat you. I will be wearing WPMU DEV’s t-shirts and will have some stickers to share 😉


    Update

    Check pictures from WordCamp Thessaloniki 2018 here:

    WordCamp Thessaloniki 2018 – Φωτογραφίες

  • Create New Admin Account With PHP Code

    Hey there! It has been a long long time since my last post! So here is my gem of the day 😉

    Personally, I use this code very frequently and it has saved me from a lot of trouble many times. There are times when I do not have access to a site’s with administrator privileges, nor to the phpMyAdmin to create a new user. In these cases, I use the following PHP code, in the functions.php file, of an active theme:

    function add_admin_acct(){
    	$login = 'mynewusername';
    	$passw = 'mynewpassword';
    	$email = 'my@email.com';
    	if ( !username_exists( $login )  && !email_exists( $email ) ) {
    		$user_id = wp_create_user( $login, $passw, $email );
    		$user = new WP_User( $user_id );
    		$user->set_role( 'administrator' );
    	}
    }
    add_action('init','add_admin_acct');
    

    This piece of code is not mine, I’ve found it on George’s Stephanis website for which I am very grateful.

    After this code is added, simply visit the front end of a site. Please always remember to remove this code once a user is created, for security reasons.

    Do you have any other way to create an administrator with PHP code?

Nastia