WordPress diagnostics
Six symptoms, one cause. How to diagnose WordPress problems
The list of problems reported by a site owner is not always a list of independent faults. A white screen, save errors, missing thumbnails and a failing plugin can all stem from one exhausted resource or one server configuration change. Below we describe two anonymised cases from our support work. They show why diagnosis should start by measuring the environment, and only then move on to disabling plugins and changing code.
Next step
Several seemingly independent errors can stem from a single limit or server setting. First measure the environment and find a hypothesis that explains all the symptoms.
01
Six symptoms caused by a file limit
The first site had an extensive gallery. The owner reported, one after another:
- white screens on some pages,
- being unable to save changes in the admin panel,
- missing image thumbnails,
- error messages visible to visitors,
- a security plugin malfunctioning,
- a noticeable slowdown of the site.
Each of these symptoms could be fixed separately. Regenerating thumbnails would help with the missing images, disabling the plugin would remove its error, and clearing the cache might briefly improve the site’s responses. None of these actions, however, removes the common cause.
The hosting account had reached its limit on the number of file system entries. The panel still showed free storage space, but the server wouldn’t allow any more files to be created.
In practice, hosting may present this limit as a number of files, file usage or inodes. The exact counting method depends on the provider. Besides the site’s files, it may include directories, email, cache, sessions and backups.
The cascade of problems looked like this:
- The security plugin couldn't save its configuration or a temporary file.
- The unfinished operation caused an error while handling the request.
- WordPress couldn't create new thumbnails.
- Some admin panel operations didn't save changes.
- Further attempts generated more errors and slowed the site's response.
Six visible problems were the result of one exhausted resource.
Where such a large number of files came from
The source wasn’t only the client’s original photos. WordPress creates derivative images in the sizes registered by core, the theme and plugins. The number of versions depends on the configuration and the dimensions of the uploaded file.
With an extensive gallery, one original can therefore correspond to several or a dozen or more files. Extra formats, image optimisation, cache and backups push that number even higher. In the environment we examined, the original photos made up a small fraction of all the files on the account.
You shouldn’t, however, delete derivative images without checking first. WordPress uses them in srcset, and the theme may load different sizes on phones, tablets and desktops. Removing a version that is in use can harm the quality, performance or appearance of the site.
A safe procedure includes:
- Reading the list of sizes registered by WordPress, the theme and plugins.
- Checking which variants appear in the page code and srcset.
- Backing up the database and the media directory.
- Removing only unused derivative sizes.
- Disabling their further generation in a controlled way.
- Regenerating the variants that are needed.
- Testing pages, galleries, search and mobile devices.
In the case described, cutting unnecessary sizes freed up resources, and all six symptoms went away without deleting any original photos.
02
A 500 error after a server configuration change
The second case started after a change of web server software. The site began responding with a 500 code. The natural suspects were PHP, a plugin or an application incompatibility.
An important clue was that the error also appeared when CSS files and images were requested directly. In a typical configuration such files are served without running WordPress. That shifted attention from the application to the server rules.
The configuration file contained a directive added earlier as a security measure. The previous software ignored it, while the new one rejected it in that context. One line made the whole directory unservable.
An error on a static file is not in itself proof of a server configuration fault. A CDN, rewrite rules or unusual routing can also send images and CSS to the application. It is, however, a strong signal to check the server log, the directory rules and how static files are served before analysing PHP.
03
How to measure HTTP responses without jumping to conclusions
Comparing the HEAD and GET methods can reveal differences in how a request is handled:
curl -sS -o /dev/null
-w "GET status=%{http_code} typ=%{content_type} czas=%{time_total}n"
https://domena.pl/podstrona/
curl -sS -I
-o /dev/null
-w "HEAD status=%{http_code} typ=%{content_type} czas=%{time_total}n"
https://domena.pl/podstrona/According to HTTP semantics, a HEAD response should contain the same headers as GET, but without a body. In practice the server, a proxy, the cache or the application may handle the two methods along different paths.
If GET returns 200 and HEAD returns 500, we know there is a method-dependent difference. We don’t yet know whether the cause is a fatal PHP error, a firewall rule, the cache, a plugin or the server configuration. The next step is to compare the full redirect chain, the headers and the logs from the same time.
It’s worth comparing several URLs:
- the home page,
- a WordPress subpage,
- an existing CSS file,
- an existing image,
- a non-existent URL.
The response pattern usually tells you more than a single status code. If all resources fail in the same way, look for the cause higher up than the template of a particular page.
04
How to check limits before debugging code
First, read the indicators in the hosting panel. They decide how the provider counts limits and which directories are included.
You can count the approximate number of entries in the site directory with this command:
find /path/to/site -xdev -print | wc -lThe result doesn’t have to match the hosting counter. It doesn’t include other directories on the account, and hard links and the way inodes are counted can change the interpretation. The command is for comparing directories and finding areas with a very large number of entries.
You can check in a controlled way whether a file can be created:
test_file=$(mktemp /path/to/site/.gotoweb-write-test.XXXXXX)
&& stat "$test_file"
&& rm -- "$test_file"Run the test only in a directory you know and where you are allowed to create a file. It doesn’t replace checking the limits. A write may succeed when only a few entries remain before the limit, and some operations may need to create many files at once.
During diagnosis it’s also worth checking:
- free space and the space limit,
- the number of files or inodes,
- cache and session directories,
- mail directories,
- unpacked backups,
- old installations in subdirectories,
- write access to wp-content, uploads, and the plugin and theme directories.
05
Why a clean scan result doesn’t close the diagnosis
The symptoms of an exhausted limit can look like an infection. The security plugin reports errors, white screens appear and some operations don’t complete. The scanner also runs in the same environment and may not have the resources it needs to finish.
On the other hand, a clean scan result doesn’t confirm the absence of an infection. It only means that a particular tool, within the scope examined, didn’t detect the problems it knows about.
That’s why we start diagnosis with measurements that are independent of the first hypothesis:
- the actual PHP version handling the web request,
- the server software and configuration,
- response codes for several types of resources,
- account limits and write permissions,
- access and error logs,
- changes to files and the database.
A security scan is an important layer, but it shouldn’t replace measuring the environment.
06
Configuration shows intent, measurement shows the actual state
In one of the environments we examined, the configuration file contained an entry pointing to PHP 7.4. The host no longer offered that version, so the rule was ignored, and the site’s requests were handled by the default PHP 8.2.
Just reading the configuration would have led to the wrong conclusion. The hosting panel, the server information in Site Health and a controlled measurement made through a web request showed the version actually running for the site.
You also need to distinguish between the PHP used by the web server and the PHP run in the terminal. WP-CLI may use a different executable and a different configuration from the site opened in the browser.
This principle applies to more than PHP. A configuration file shows what someone wanted to set. Only a measurement shows whether the setting was applied and what result it gives.
07
The key takeaway
A list of symptoms is input material, not a ready-made repair plan. Before you start fixing six things, check whether you are looking at one cause from six sides.
An effective diagnostic sequence looks like this:
- Measure versions, limits, write permissions and HTTP responses.
- Compare the behaviour of several types of resources.
- Read the logs from the moment the problem occurred.
- Build a hypothesis that explains all the symptoms.
- Run the smallest safe test of this hypothesis.
- Only then change the configuration or the code.
- After the repair, repeat the same measurements.
This approach reduces the risk of neatly removing a single symptom while leaving the real cause untouched.
Did several errors appear at the same time?
We’ll check the environment, limits, logs and the relationships between the symptoms. You’ll get the identified cause, the scope of a safe repair and the results of measurements taken after the changes are deployed.
Only 3 required fields · reply within 1 business day · no obligation
