10% simple-cache

Code Review | Simple Cache

WordPress plugin Simple Cache scored10%from 54 tests.

About plugin

  • Plugin page: simple-cache
  • Plugin version: 2.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.8
  • WordPress version: 6.3.1
  • First release: Apr 7, 2016
  • Latest release: May 4, 2021
  • Number of updates: 42
  • Update frequency: every 44.1 days
  • Top authors: tlovett1 (100%)

Code review

54 tests

User reviews

57 reviews

Install metrics

3,000+ active /124,126 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • This plugin did not install gracefully
    • > Warning in wp-content/plugins/simple-cache/inc/class-sc-config.php+182
    unlink() expects parameter 2 to be resource, bool given

Server metrics [RAM: ▲0.24MB] [CPU: ▼1.30ms] Passed 4 tests

An overview of server-side resources used by Simple Cache
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.2540.94 ▼0.69
Dashboard /wp-admin3.54 ▲0.2449.69 ▲3.82
Posts /wp-admin/edit.php3.66 ▲0.3044.27 ▼2.71
Add New Post /wp-admin/post-new.php6.13 ▲0.2481.17 ▼5.61
Media Library /wp-admin/upload.php3.47 ▲0.2438.69 ▲4.73
Simple Cache /wp-admin/options-general.php?page=simple-cache3.4435.54

Server storage [IO: ▲0.19MB] [DB: ▲0.07MB] 67% from 3 tests

A short overview of filesystem and database impact
Please try to fix the following items
  • The plugin illegally modified 1 file (0.46KB) outside of "wp-content/plugins/simple-cache/" and "wp-content/uploads/"
    • (new file) wp-content/sc-config/config-wp.com.php
Filesystem: 25 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Simple Cache: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲5614.39 ▼0.261.63 ▲0.1144.42 ▼2.50
Dashboard /wp-admin2,214 ▲405.55 ▲0.0383.74 ▼0.8639.78 ▼1.31
Posts /wp-admin/edit.php2,123 ▲231.96 ▼0.1535.33 ▼2.1234.01 ▼3.95
Add New Post /wp-admin/post-new.php1,543 ▲1722.98 ▼0.36635.45 ▼38.4256.76 ▲6.00
Media Library /wp-admin/upload.php1,422 ▲224.23 ▲0.04110.65 ▲16.7048.91 ▲8.35
Simple Cache /wp-admin/options-general.php?page=simple-cache1,2141.8533.2432.50

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-content/plugins/simple-cache/inc/class-sc-advanced-cache.php+134
    unlink(wp-content/advanced-cache.php): No such file or directory
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: object caching, object cache, memcache, memcached, cache...

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

The main PHP file in "Simple Cache" ver. 2.0.0 adds more information about the plugin and also serves as the entry point for this plugin
40 characters long description:
A simple caching plugin that just works.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin3,247 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP148721,0712,808
PO File292127313
JavaScript214061
CSS29049
Markdown16016

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.51
Average class complexity44.40
▷ Minimum class complexity8.00
▷ Maximum class complexity113.00
Average method complexity4.65
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods119
▷ Static methods65.04%
▷ Public methods10789.92%
▷ Protected methods97.56%
▷ Private methods32.52%
Functions61
▷ Named functions61100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants990.00%
▷ Class constants110.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin