74% the-cache-purger

Code Review | The Cache Purger

WordPress plugin The Cache Purger scored74%from 54 tests.

About plugin

  • Plugin page: the-cache-purger
  • Plugin version: 1.7.11
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-6.3
  • WordPress version: 6.3.1
  • First release: Oct 8, 2021
  • Latest release: Jun 20, 2023
  • Number of updates: 46
  • Update frequency: every 13.5 days
  • Top authors: kevp75 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /2,681 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲1.86MB] [CPU: ▲10.92ms] Passed 4 tests

This is a short check of server-side resources used by The Cache Purger
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.35 ▲1.8860.65 ▲15.09
Dashboard /wp-admin5.18 ▲1.8368.76 ▼1.53
Posts /wp-admin/edit.php5.23 ▲1.8772.04 ▲28.60
Add New Post /wp-admin/post-new.php7.77 ▲1.87112.73 ▲7.30
Media Library /wp-admin/upload.php5.12 ▲1.8961.42 ▲22.81

Server storage [IO: ▲1.91MB] [DB: ▲0.00MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 243 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
kpcp_settings
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for The Cache Purger
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,849 ▲8814.35 ▼0.181.77 ▲0.1342.67 ▼1.86
Dashboard /wp-admin2,244 ▲645.67 ▲0.0284.67 ▼10.5840.36 ▲0.67
Posts /wp-admin/edit.php2,152 ▲492.01 ▼0.0640.53 ▼0.8635.42 ▼1.28
Add New Post /wp-admin/post-new.php1,563 ▲2622.18 ▲3.70683.51 ▲42.9366.02 ▼4.91
Media Library /wp-admin/upload.php1,455 ▲554.18 ▲0.02102.47 ▲4.9247.41 ▲4.73
API/Server Settings /wp-admin/admin.php?page=kpcp_settings#tab=api-server-settings2,7523.7465.3249.89
Export/Import Settings /wp-admin/admin.php?page=kpcp_settings#tab=export-import-settings2,7303.7249.6134.79
Settings /wp-admin/admin.php?page=kpcp_settings#tab=settings2,8963.8869.8446.12
Documentation /wp-admin/admin.php?page=kpcp_settings#tab=documentation2,8913.6047.4451.95
CRON Action Settings /wp-admin/admin.php?page=kpcp_settings#tab=cron-action-settings2,7303.5448.0333.28

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-includes/option.php+2520
    Trying to access array offset on value of type null
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 80× GET requests to PHP files return non-empty strings (only 10 are shown):
    • > /wp-content/plugins/the-cache-purger/assets/index.php
    • > /wp-content/plugins/the-cache-purger/work/index.php
    • > /wp-content/plugins/the-cache-purger/work/inc/modules/index.php
    • > /wp-content/plugins/the-cache-purger/vendor/custom-fields/assets/scss/index.php
    • > /wp-content/plugins/the-cache-purger/vendor/custom-fields/fields/gallery/index.php
    • > /wp-content/plugins/the-cache-purger/work/inc/modules/hosting.php
    • > /wp-content/plugins/the-cache-purger/vendor/custom-fields/fields/palette/index.php
    • > /wp-content/plugins/the-cache-purger/the-cache-purger.php
    • > /wp-content/plugins/the-cache-purger/vendor/custom-fields/fields/border/index.php
    • > /wp-content/plugins/the-cache-purger/vendor/custom-fields/fields/text/index.php

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: cache purging, remote cache, caching, purge cache

the-cache-purger/the-cache-purger.php Passed 13 tests

The entry point to "The Cache Purger" version 1.7.11 is a PHP file that has certain tags in its header comment area
65 characters long description:
Plugin attemps to clear all plugin based and server based caches.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin37,176 lines of code in 156 files:
LanguageFilesBlank linesComment linesLines of code
PHP963,7183,5889,747
Sass281,74669,457
JavaScript51,3004976,564
PO File203,1983,5916,500
CSS63765094,903
JSON1005

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity23.20
▷ Minimum class complexity1.00
▷ Maximum class complexity151.00
Average method complexity5.89
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces2
Interfaces0
Traits10
Classes70
▷ Abstract classes22.86%
▷ Concrete classes6897.14%
▷ Final classes00.00%
Methods362
▷ Static methods6618.23%
▷ Public methods29280.66%
▷ Protected methods4512.43%
▷ Private methods256.91%
Functions43
▷ Named functions2148.84%
▷ Anonymous functions2251.16%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
vendor/custom-fields/assets/images/checkerboard.png2.29KB2.54KB0.00%