MC.today: Adapting a WordPress website for handling high traffic
MC.today is an online media publication designed for those who want to be active and creative, as well as for people interested in innovative business, development, and modern lifestyle.
MC.today aims to help Ukrainians live in a country where people are passionate about their work, set goals and achieve them, think creatively, and see the glass as half full rather than half empty. They are people who derive pleasure from life but do not waste it. Through their work, they strive to make the world a better place and firmly believe that the impossible is possible.
MC.today aims to make Ukrainians the most active, enterprising, satisfied with life, and successful nation in the world. That’s why they support them on this path: inspire with examples of success, warn about mistakes, suggest new ways, and help take the next level of development.
While MC. today had up to 500,000 users per month, the standard WordPress configuration was managing fairly well, but above this threshold, the number of problems began to increase. The site could “crash” under load for a certain amount of time, and publishing articles became more difficult, as even the administrator panel could be unavailable. It became clear that the CMS needed to be optimized.
Our task was to understand the main obstacles to WordPress functioning optimally under higher loads.
Here are the WordPress problems we discovered at MC. today in SOLAR Digital and how we fixed them:
Slimstat Analytic plugin was used on MC. today to count page views, but it collected a large amount of unnecessary information along with the data on user visits, such as session time, device type, and viewing duration. All of this excess information was stored in the main database of the site, taking up 1.5 GB of space. This not only slowed down the work in the editorial administrator panel but also “slowed down” the display of the site in the browsers of visitors.
To solve the problem, developers removed the installed plugin and instead connected an external program of their own development, written in PHP language and Laravel framework. It counts views by recording data on a separate hosting server. At the same time, the polling of the counter is carried out directly in the browsers of site visitors, completely freeing WordPress engine from the load of counting visits, which it previously did on its own. The blogger rating was developed on the same principle.
The standard caching system was replaced with a more advanced one by installing the W3 Total Cache + Memcached package.
W3 Total Cache is one of the best plugins for resource optimization today, providing caching of pages, objects, and data on both server and client side (browser).
Memcached is a special service that caches data in its own memory (a hash table-based cache) bypassing the server’s database. After its integration, pages loaded into the cache service begin to load noticeably faster. If a page has not been requested before and is not in the cache, Memcached quickly adds it to the database to deliver it just as quickly to the user on the next request.
The website’s database was slowing down the web server when it was hosted on the same computer. It was moved to a physically separated computer from the web server, which positively impacted the loading speed.
Performance according to Google PageSpeed
Loading the speed of web pages is important not only for user experience but also for search engine rankings. Here’s what was done to optimize loading speed:
- minification and concatenation of code, removal of unnecessary style and script files;
- even distribution of the web page load through background loading of images while scrolling;
- optimization of image size for faster loading.
Absence of CDN service
Unnecessary plugins for the website
We removed all unnecessary plugins for the website and implemented all functionality on our own code, which works noticeably faster.
Outdated version of WordPress
We updated the outdated version of WordPress to fix problematic areas and vulnerabilities that existed in older versions. We also installed the latest version of PHP 8.3, which works much more stably.
Recommendations for creating a website on WordPress from Solar Digital:
Here are some general tips that are available for implementation by almost everyone, including beginners working with WordPress:
- Any WordPress developer needs to study the CMS code in detail. If you want to be friends with WordPress, it’s hard to do without the code.
- Configure caching. Understanding it thoroughly is important so as not to make the user nervous about long page loading times. Caching can be different, study and choose the one that is most suitable for you.
- Install templates and plugins wisely. Don’t overload the resource with functionality, and it will work stably for a long time.
- Don’t forget to update WordPress and PHP. Remember about security as new system vulnerabilities constantly appear.
- Make the site more visible to search engines using an SEO-friendly concept.
Common Weaknesses of WordPress
WordPress is an open-source platform that attracts hackers from all over the world. They find vulnerabilities in the system and use them for malicious purposes such as spam, zombie networks, phishing, SEO manipulation, and more. The solution is to systematically update WordPress and its plugins, as developers try to fix all vulnerabilities found in each new update.
The PHP code of WordPress is sometimes called outdated, but it can be effectively used if you study the WordPress Codex, which was mentioned above. If you follow it, there should be no problematic situations.
Taxonomies are attributes of posts on a website. They are properties of products, posts, or other content on your site. Taxonomies are attached to a post in one table, and to view the value of a particular attribute, the system goes through the entire table. If you have 20 posts on your site, there should be no problems. But if there are 25,000 items, each with 50 attributes, this is a total of 1,250,000 taxonomies. This negatively affects performance, and this is the main limitation of using WordPress for large sites (such as an online store with 25,000 products with different properties).
Too many plugins and templates
Indeed, installing too many plugins and templates can become a problem for the speed and performance of a WordPress site. Each plugin or template increases the number of server requests, which can cause the site to crash or slow down its loading speed. In addition, some plugins may be incompatible with other plugins or templates, which can lead to problems with the functionality of the site. Therefore, before installing any plugin or template, it is worth making sure of its necessity and compatibility with other elements of the site.
User feedback allowed us to identify and solve some issues that were hindering the normal functioning of the website. We paid attention to several problematic areas, including security, database processing and queries, taxonomy, and the overloading of templates and plugins.
To address these issues, we implemented the following strategies: systematic updating of WordPress and its plugins, optimization of database queries and data caching, reorganization of taxonomy, removal of unnecessary plugins and templates, and a switch to high-speed and reliable hosting.
As a result of these strategies, the site works very well and has high productivity, capable of handling over 1 million users per month without any problems. We continue to improve and optimize the site to ensure its best performance and meet the needs of our users.