74% cache-master

Code Review | Cache Master

WordPress plugin Cache Master scored74%from 54 tests.

About plugin

  • Plugin page: cache-master
  • Plugin version: 2.1.3
  • PHP compatiblity: 7.1.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2.2
  • WordPress version: 6.3.1
  • First release: Oct 2, 2020
  • Latest release: May 28, 2023
  • Number of updates: 43
  • Update frequency: every 22.5 days
  • Top authors: terrylin (100%)

Code review

54 tests

User reviews

17 reviews

Install metrics

500+ active /9,268 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.35MB] [CPU: ▼1.63ms] Passed 4 tests

This is a short check of server-side resources used by Cache Master
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3336.82 ▼2.26
Dashboard /wp-admin3.71 ▲0.4146.04 ▼7.04
Posts /wp-admin/edit.php3.76 ▲0.4049.21 ▲0.97
Add New Post /wp-admin/post-new.php6.23 ▲0.3496.32 ▲1.80
Media Library /wp-admin/upload.php3.57 ▲0.3446.34 ▲12.80
Expert Mode /wp-admin/admin.php?page=cache-master-expert-mode3.5832.63
Statistics /wp-admin/admin.php?page=cache-master-statistics3.5834.81
About /wp-admin/admin.php?page=cache-master-about3.5530.99
Settings /wp-admin/admin.php?page=cache-master-settings3.8750.04

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 166 new files
Database: 1 new table, 39 new options
New tables
cache_data
New WordPress options
scm_option_visibility_guest
scm_last_reset_time
scm_option_html_debug_comment
scm_option_post_archives
scm_option_post_homepage
scm_option_woocommerce_post_types
scm_option_driver
scm_option_excluded_list_filtered
scm_option_excluded_get_variables
scm_option_clear_cache
...

Browser metrics Passed 4 tests

Cache Master: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,956 ▲21013.68 ▼0.916.00 ▲4.3240.89 ▲3.05
Dashboard /wp-admin2,252 ▲605.88 ▲0.90100.91 ▼7.7780.24 ▲40.39
Posts /wp-admin/edit.php2,141 ▲522.01 ▼0.0040.01 ▲0.6936.22 ▲0.72
Add New Post /wp-admin/post-new.php1,720 ▲18724.84 ▲1.79693.24 ▲17.1364.61 ▲9.88
Media Library /wp-admin/upload.php1,428 ▲404.16 ▼0.0694.91 ▼13.9575.33 ▲26.89
Expert Mode /wp-admin/admin.php?page=cache-master-expert-mode1,0302.1437.9244.97
Statistics /wp-admin/admin.php?page=cache-master-statistics9502.1530.2030.03
About /wp-admin/admin.php?page=cache-master-about9122.0828.5748.87
Settings /wp-admin/admin.php?page=cache-master-settings1,3712.2227.9727.39

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie tables detected upon uninstall: 1 table
    • cache_data
  • The uninstall procedure has failed, leaving 13 options in the database
    • scm_dir_hash
    • scm_last_reset_time
    • scm_blog_id
    • db_upgraded
    • scm_version
    • widget_theysaidso_widget
    • widget_recent-posts
    • scm_option_excluded_get_variables
    • theysaidso_admin_options
    • widget_recent-comments
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 30× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\SimpleCache\\InvalidArgumentException' not found in wp-content/plugins/cache-master/vendor/shieldon/simple-cache/src/SimpleCache/Exception/CacheArgumentException.php:18
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\SimpleCache\\CacheInterface' not found in wp-content/plugins/cache-master/vendor/shieldon/simple-cache/src/SimpleCache/CacheProvider.php:27
    • > PHP Fatal error
      Uncaught Error: Class 'Shieldon\\Test\\SimpleCache\\DriverIntegrationTestCase' not found in wp-content/plugins/cache-master/vendor/shieldon/simple-cache/tests/SimpleCache/Driver/FileTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Shieldon\\SimpleCache\\CacheProvider' not found in wp-content/plugins/cache-master/vendor/shieldon/simple-cache/src/SimpleCache/Driver/Mysql.php:26
    • > PHP Fatal error
      Uncaught Error: Class 'Shieldon\\SimpleCache\\CacheProvider' not found in wp-content/plugins/cache-master/vendor/shieldon/simple-cache/src/SimpleCache/Driver/Mongo.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Shieldon\\Test\\SimpleCache\\DriverIntegrationTestCase' not found in wp-content/plugins/cache-master/vendor/shieldon/simple-cache/tests/SimpleCache/Driver/MongoTest.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Shieldon\\Test\\SimpleCache\\DriverIntegrationTestCase' not found in wp-content/plugins/cache-master/vendor/shieldon/simple-cache/tests/SimpleCache/Driver/ApcTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Shieldon\\SimpleCache\\CacheProvider' not found in wp-content/plugins/cache-master/vendor/shieldon/simple-cache/src/SimpleCache/Driver/Apc.php:36
    • > PHP Fatal error
      Uncaught Error: Class 'Shieldon\\Test\\SimpleCache\\DriverIntegrationTestCase' not found in wp-content/plugins/cache-master/vendor/shieldon/simple-cache/tests/SimpleCache/Driver/RedisTest.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'Shieldon\\Test\\SimpleCache\\CacheTestCase' not found in wp-content/plugins/cache-master/vendor/shieldon/simple-cache/tests/SimpleCache/CacheTest.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

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
6 plugin tags: apcu, mongodb, redis, memcached, cache...

cache-master/cache-master.php Passed 13 tests

The entry point to "Cache Master" version 2.1.3 is a PHP file that has certain tags in its header comment area
25 characters long description:
A WordPress cache plugin.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin9,431 lines of code in 121 files:
LanguageFilesBlank linesComment linesLines of code
PHP981,6102,6466,557
PO File34987091,191
Markdown31390420
CSS2448352
Sass1780292
JSON300183
YAML4316170
XML221157
Bourne Shell212056
Dockerfile112443
Ruby17159
JavaScript1051

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity7.33
▷ Minimum class complexity1.00
▷ Maximum class complexity68.00
Average method complexity2.05
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces7
Interfaces3
Traits3
Classes36
▷ Abstract classes25.56%
▷ Concrete classes3494.44%
▷ Final classes00.00%
Methods271
▷ Static methods155.54%
▷ Public methods17263.47%
▷ Protected methods7728.41%
▷ Private methods228.12%
Functions94
▷ Named functions6367.02%
▷ Anonymous functions3132.98%
Constants11
▷ Global constants11100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
32 PNG files occupy 1.23MB with 0.70MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/assets/images/sample-benchmark-widget-1.png7.56KB3.45KB▼ 54.38%
inc/assets/images/screenshots/screenshot-11.png44.14KB20.07KB▼ 54.53%
inc/assets/images/logo.png4.13KB1.83KB▼ 55.73%
inc/assets/images/sample-expert-mode.png19.51KB8.37KB▼ 57.08%
inc/assets/images/icon-256x256.png12.66KB4.66KB▼ 63.17%