WordPress performance: My Disqus export tool

If you’re here just to find out how to export your Disqus comments and get them back into WordPress, I’ll cut a long story short and direct you to a Google Sheet that will provide you with the tools to do that. Click here.

If you’d like to find out more about how to debug WordPress performance issues, then carry on reading …

A WordPress blog I was maintaining had a serious pagespeed problem recently (we got reports with performance scores in the low 20s). That was a shock, and of course terrible for SEO. This is my story.

How to solve a WordPress performance issue

Step 1: Get some benchmarks

Benchmarks are useful because they level the playing field allowing you to make comparisons and track progress.

  1. Select a popular blog post to be the benchmark page for testing
  2. Run a pagespeed tool such as GTMetrix using this page to get a before benchmark
  3. Disable all the plugins in WordPress, and get another pagespeed metric for the same page

You must use the same blog post for all the pagespeed tests that you do. Every post on your blog could have difference performance problems – for example posts with embedded youtube videos would always score worse than a page that has only no embeds or images. So using the same page eliminates any content variance.

The before benchmark is easy to understand – this tells you how bad the current situation is.

The third benchmark (without any plugins) will give you a benchmark that helps you isolate the performance issues on your website. If it is acceptable to you, then it demonstrates that your performance issues lies with your plugins, and you can then use this metric as your north star metric.

If it is not acceptable, then there are more serious issues with your WordPress blog. The next most likely issue is with your WordPress theme. Some themes are not known for their performance, and other themes (especially with page builders such as Divi) allow novice developers to create heavy pages that load very slowly. Another potential (and common problem) is with your server – especially if you are using shared hosting. If hosting is your issue then GTMetrix will clearly indicate this with advice such as “Improve server response time”. Unfortunately I do not cover any of these issues in this blog post, but GTMetrix is very helpful and offers very explicit advice.

For my blog, we had a pagespeed of 94% without plugins and 54% with, so there was a lot to gain by moving onto the next step.

Step 2: Figure out which plugins are causing your performance issues

Start with your most critical plugins, and follow this process with each plugin

  1. Activate the plugin
  2. Run GTMetrix to get an after metric – record the metric
  3. Compare the metric to your before benchmark, Look at all the numbers to see
    1. Pagespeed & YSlow scores – this is your overall performance as evaluated by these two tools
    2. Fully loaded time – this number can fluctuate a bit, especially depending on your server and the amount of load it is experiencing – so this isn’t the most important number to focus on. GTMetrix says the average loading time is 8s.
    3. Total page size – this number tells you how data the user needs to download in order to see your page. GTMetrix reports average pagesize to be around 3Mb.
    4. Requests – this number tells you how many resources are used on your page. This includes CSS, javascript, images, cookies, etc – anything that is downloaded separately from the HTML. GTMetrix reports the average number of request as 89.
  4. Review the recommendations from Pagespeed and YSlow to see if the plugin is causing any new recommendations to appear (such as blocking resources, new redirects,etc).

Depending on the development of the tool, the metrics could vary significantly. A good tool should not cause the numbers to change dramatically and shouldn’t cause new warning recommendations to appear.

Step 3: Solve the performance problems

Once you have isolated the plugins with performance issues you then need to decide your plan of action.

Here are some options

  • Remove the plugin – if the plugin is not critical to your website, this is your first prize, and of course the easiest route. Generally speaking, the fewer plugins a WordPress site has the better because plugins are often security issues, require updating, and of course sometimes cause performance issues.
  • Replace the plugin – if the functionality of the plugin is important, but you can use another plugin then this is a great option. You are now able to test various plugins and then find one that doesn’t have such a large performance issue.
  • Contact the plugin developer – this is a good option for paid-for plugins. If you are paying for a plugin you should contact the company or developer and ask for their feedback on the performance issues. Send the reports showing your website with the before and after metrics so they can see the impact their plugin is having on your website.
  • Investigate lazy loading – some tools could be lazy loaded, so the tools resources aren’t requested when the page is loaded – they would only be loaded when the user scrolls to that part of the page. This works very well for tools such as Disqus which only need to be loaded when the user scrolls down to the bottom of the page. How to do this would depend on the tool itself, so I recommend searching for some answers.
  • Investigate alternative ways to load the tool – some tools can be embedded into your website without the plugin which may be more efficient. Look at the instructions on how to integrate the tool into your website and see the other options. You could perhaps insert some code into your child theme. This worked for our OptinMonster plugin.

Disqus was one of the worst!

One of the plugins I decided to remove was Disqus – when it was activated, our pagespeed score dropped by 30% and the YSlow score by 23%. When I looked at the resources being loaded with the Disqus plugin I was shocked – over 100 extra requests (which were redirects) and 500Kb. When I looked into the redirects I could see requests coming from websites doing advertising and tracking such as:

  • doubleclick.com
  • adsymptotic.com
  • rlcdn.com
  • krxd.net
  • amazon-adsystem.com
  • … the list goes on and on

This was upsetting because we were supposed to have the paid version of Disqus, without advertising, but they were still tracking our users! And even though we were on a paid tier, they didn’t give us personal support – we were supposed to get help on the forums.

The final nail in the coffin for Disqus is that the blog did not receive very many comments (only a handful every week), so really this plugin was unnecessary.

If you’ve gotten this far, well done … here are the details you’ve been waiting for:

My Disqus Export Tool

The problem I soon discovered with Disqus is that although it’s easy to import your comments it isn’t always easy to export them.

The WordPress plugin has some functionality to sync comments, but unless you’ve had this running all the time, you can only get one years worth of comments. I couldn’t even get that to work. Their documentation mentions that you can export your comments in an XML format, but there seem to be a lot of caveats about the size of the export and requesting them. I also couldn’t find the option as described.

When I searched on sites such as Stackoverflow I found other people asking the same thing – how do I export comments from Disqus back into my WordPress database.

Nobody had any answers, except one person who gave some information about using the Disqus API to access your comments. This gave me the idea to write a script that would scrape all our Disqus comments. Once I had them scraped into a suitable format, it wouldn’t be too difficult to get them into our WP database.

I thought about writing it in Python, but because I’m very familiar with Google Apps Scripts, and I’d need to be working with CSVs anyway, it made sense to use that. It would also be easy to use. Afterwards I realised I could have done it with a WordPress plugin, but my PHP skills are remedial at best.

OKay, so here goes.

https://docs.google.com/spreadsheets/d/1CAdhn0t2tpj-HexEdcMbRnvcYD89wvXVq-5_k2gbAGI/edit?usp=sharing

Please start at the README tab and follow the steps in order, but basically this is what you need to do:

  1. Run a query in your WordPress database to get a list of all your blog posts
  2. Create your Disqus API application
  3. Fill in the details for your API / blog on the Settings sheet
  4. Run the script under the Add-ons menu option ‘Disqus Export’ -> ‘Start/Continue Disqus Export’ (you may need to repeat this a couple times)
  5. Run the query in your WordPress database to get the Disqus comments that are already saved in your WordPress database
  6. Run the script under the Add-ons menu option ‘Disqus Export’ -> ‘Generate WordPress SQL’
  7. Copy the SQL from the ‘Import SQL’ tab and run it in your WordPress database
  8. Update the comment_counts in the WordPress database
  9. Turn off the Disqus plugin and test
  10. Cancel your Disqus subscription.

Well done!!

Let me know if this tool is useful for you.

Save the environment with these 25+ easy tips

Save the environment with these 25+ easy tips

The environment is in trouble, we are drowning in plastic. Every single plastic toothbrush you have ever used in your life is still on this planet. And one million plastic bottles are purchased every minute! A fraction of them are recycled.

Even if you recycle your plastic it could still end up in a landfill or in the ocean because unless someone wants to buy your dirty used plastic it’s worthless. There’s a reason why recycling is at the bottom of the Zero Waste pyramid.

Zero Waste is not recycling more, but less

Bea Johnson

Even worse, we all eat about a credit card of plastic a day – it’s in our food, there is plastic inside all the water you drink – even bottled water.

I am not against plastic, I am against single use plastic. I am also not perfect – I also buy plastic water bottles sometimes.

Nobody has to be perfect, if we all make some small changes, together we will make a difference. But we need to act now because we only have 7 years left to save the planet.

Here are some ideas

  1. Walk or ride a bike if you are making a short journey
  2. Next time you buy a car, consider going electric or buying something that is better for the environment (don’t buy an SUV)
  3. Eat less meat (especially beef) – you don’t need to go vegan – you can also just be vegetarian a couple days during the week and still make a difference
  4. Switch to LED light bulbs (I never realised until recently you can buy LED light bulbs for any light fitting). The CNN Climate Change quiz ranks this as the #1 change with the highest impact in our homes.
  5. Shop local
  6. Prepare food in bulk and freeze it so you can have convenient home-made meals during the week
  7. Take your own containers when you order take-away
  8. Order-in instead of taking out
  9. Buy a re-usable water bottle and coffee cup
  10. Shop at a package free store, or buy in bulk, or buy products packaged in paper, glass or metal
  11. Start composting – if you don’t have a garden donate your compost to a city farm. If you live in an apartment you can use bokashi, or freeze your compost if you can’t drop it off regularly
  12. Try avoid food waste (tough one with kids I know!). If food waste was a country, it would be the third highest emitter of greenhouse gases after the US and China
    1. Buy less food,
    2. Freeze fresh food you may not have time to eat, or
    3. Put items that need to be eaten at the front of the fridge, or out in sight so you don’t forget to eat it
  13. Switch to a bamboo toothbrush
  14. Switch to a shampoo bar
  15. Use a bar of soap instead of liquid soap
  16. Replace household cleaners with an all purpose cleaning product such as Triple Orange Wonder Gel
  17. Choose your beauty products carefully
    1. Avoid micro beads for example,
    2. Try reduce the number of products you are using.
    3. Try DIY recipes or
    4. Buy products in sustainable packaging
  18. Don’t buy new stuff if you don’t need to
    1. Ask friends and family if you can borrow,
    2. See if it’s available second hand,
    3. Mend an item you already own,
    4. Re-purpose something else, or
    5. Try do without
  19. Consider changing how you purchase gifts (birthday or Christmas) …
    1. Buy second hand presents (e.g. books),
    2. Make something,
    3. Choose an experience, or
    4. Buy a voucher or group present instead of buying something the person actually doesn’t want or need
  20. Buy recycled items – especially those made from recycled plastic. If you don’t buy recycled plastic, there’s no market for these products. Clothing, made from recycled plastic, especially active wear, is readily available. Here’s a list of 19 every day products made from recycled materials, and here are some South African companies you can support:
    1. Sealand Gear
    2. Spirit Girl
    3. Bonsela Upcycled products
    4. The Joinery sustainable products
    5. K-Way recycled fleece jacket (from Cape Union Mart)
    6. The North Face recycled beanie (from Shelflife)
    7. Woolworth’s re-usable recycled plastic shopping bag (cotton shopping bags are reported to be less sustainable)
    8. Addis Rough Tote box
    9. L&L recycled lunchboxes
    10. <Contact me to add your product to the list>
  21. Buy good quality items (the best you can afford), especially those that have guarantees – especially those with lifetime guarantees. Patagonia, Sealand and Jansport are some good examples of companies making good quality products.
  22. Buy rechargeable batteries, and dispose of your batteries responsibly.
  23. Use a refillable pen (e.g. Lamy, Parker or Waterman) instead of a disposable one
  24. Refuse free samples
  25. Use less electricity, or if you are able to, choose renewable energy providers
  26. Email companies and ask them what they are doing about climate change
  27. Email companies that have poor packaging and ask them what they are doing to switch to more environmentally friendly packaging. Don’t accept the answer that their plastic is recyclable – unless they are doing the recycling themselves this is not an acceptable solution.
  28. Follow accounts that give you useful eco tips (e.g. on Instagram, Twitter or Facebook)
  29. Educate yourself about environmental issues
  30. Talk to your friends

Follow these accounts to get even more ideas and eco-swaps

Easy Eco Tips logo

Follow Easy Eco Tips on Instagram or subscribe to their newsletter for plenty eco friendly swaps and general knowledge in small easy to digest snippets.

Kathryn Kellogg

Follow Kathryn Kellogg aka Going.Zero.Waste on Instagram for some more zero waste tips and some Friday Good News, or listen to her book, 101 Ways To Go Zero Waste, on Scribd

Follow the Zero Waste Chef (aka Anne-Marie Bonneau) on Instagram tips on baking sour dough, fermenting, cooking and sewing. She regularly hosts Zoom meet-ups.

Cloth napkin folding

I love origami and cloth napkins, which is a match made in heaven. And not only are they zero waste, but they are cost effect and luxurious too. Here are some of my favourite cloth napkin folds. Enjoy!

Starting with the simple fan napkin fold, which can be conveniently placed inside a glass:

Followed by the gorgeous rose napkin, which is also very easy and looks very striking. Perfect for valentine’s day or mother’s day!

The Lotus is a classic fold which is easy once you have practised a couple times – in the beginning it can be hard to pull out the leaves without destroying the base!

I designed this swan napkin fold myself – the usual swan napkin folds only work for paper napkins or require a lot of starching and ironing which I definitely don’t have time for.

Finally the Christmas Tree, the perfect napkin for festive occasions!

Magic Rainbow Unicorns on Scratch

I have been playing with Scratch a bit more recently (I am creating a kids course aimed at 8 and 9 year olds). And I can’t believe I only just signed up for an account on the Scratch website – prior to this I used a desktop client.

I was so surprised to find out how much fun Scratch could be online. Once you create a project, you can share it and you are able to play, view the code and remix other people’s projects – which is fantastic for learning (and very enjoyable – even as an adult). You are also able to share the project with your friends (who don’t need to have a Scratch account to view it) or embed it into a web page.

Here is one of the projects I created: a Magic Rainbow Unicorns memorable password generator.

There is also a studio (a place where others can add their projects) for Magic Rainbow Unicorns fans … https://scratch.mit.edu/studios/27054790/. If you are also on scratch and have created a magic, rainbow or unicorns Scratch program, please add it!