78% hyper-cache

Code Review | Hyper Cache

WordPress plugin Hyper Cache scored78%from 54 tests.

About plugin

  • Plugin page: hyper-cache
  • Plugin version: 3.4.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3.2
  • WordPress version: 6.3.1
  • First release: Apr 11, 2008
  • Latest release: Oct 28, 2023
  • Number of updates: 237
  • Update frequency: every 24.0 days
  • Top authors: satollo (100%)

Code review

54 tests

User reviews

82 reviews

Install metrics

10,000+ active /1,072,879 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.13MB] [CPU: ▼0.62ms] Passed 4 tests

A check of server-side resources used by Hyper Cache
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1640.48 ▲3.92
Dashboard /wp-admin3.43 ▲0.1347.18 ▲4.85
Posts /wp-admin/edit.php3.54 ▲0.1943.83 ▲0.79
Add New Post /wp-admin/post-new.php6.01 ▲0.1378.66 ▼10.44
Media Library /wp-admin/upload.php3.35 ▲0.1333.68 ▲3.25
Hyper Cache /wp-admin/options-general.php?page=hyper-cache/options.php3.6129.63

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

How much does this plugin use your filesystem and database?
These are issues you should consider
  • The plugin illegally modified 2 files (5.86KB) outside of "wp-content/plugins/hyper-cache/" and "wp-content/uploads/"
    • (new file) wp-content/advanced-cache.php
    • (new file) wp-content/cache/hyper-cache/.empty
Filesystem: 5 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
hyper-cache
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Hyper Cache
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲614.35 ▼0.281.71 ▼0.0042.59 ▲6.29
Dashboard /wp-admin2,193 ▲125.58 ▼0.1496.26 ▼3.8441.86 ▼1.47
Posts /wp-admin/edit.php2,104 ▲41.96 ▼0.0135.36 ▲0.5231.62 ▼5.28
Add New Post /wp-admin/post-new.php1,531 ▲223.40 ▲0.41686.03 ▲34.3155.32 ▲4.59
Media Library /wp-admin/upload.php1,404 ▲44.20 ▲0.0495.02 ▲1.9142.95 ▲2.67
Hyper Cache /wp-admin/options-general.php?page=hyper-cache/options.php1,5392.0935.4153.30

Uninstaller [IO: ▲0.00MB] [DB: ▲0.07MB] 75% 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 does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • hyper-cache
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=hyper-cache/options.php
    • > Warning in wp-content/plugins/hyper-cache/options.php+5
    filemtime(): stat failed for wp-content/advanced-cache.php

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
Please fix the following items
  • 8× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      Use of undefined constant HC_GZIP - assumed 'HC_GZIP' (this will throw an Error in a future version of PHP) in wp-content/plugins/hyper-cache/advanced-cache.php on line 127
    • > PHP Notice
      Undefined index: HTTP_USER_AGENT in wp-content/plugins/hyper-cache/advanced-cache.php on line 12
    • > PHP Warning
      Use of undefined constant HC_MOBILE - assumed 'HC_MOBILE' (this will throw an Error in a future version of PHP) in wp-content/plugins/hyper-cache/advanced-cache.php on line 19
    • > PHP Fatal error
      Uncaught Error: Class 'HyperCache' not found in wp-content/plugins/hyper-cache/options.php:3
    • > PHP Warning
      Use of undefined constant HC_HTTPS - assumed 'HC_HTTPS' (this will throw an Error in a future version of PHP) in wp-content/plugins/hyper-cache/advanced-cache.php on line 116
    • > PHP Warning
      Use of undefined constant HC_HTTPS - assumed 'HC_HTTPS' (this will throw an Error in a future version of PHP) in wp-content/plugins/hyper-cache/advanced-cache.php on line 69
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/hyper-cache/plugin.php:31
    • > PHP Warning
      Use of undefined constant HC_REJECT_AGENTS_ENABLED - assumed 'HC_REJECT_AGENTS_ENABLED' (this will throw an Error in a future version of PHP) in wp-content/plugins/hyper-cache/advanced-cache.php on line 75

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 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
9 plugin tags: tuning, cache, staticizer, bandwidth, speed...

hyper-cache/plugin.php 92% from 13 tests

The entry point to "Hyper Cache" version 3.4.2 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("hyper-cache.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin1,345 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP3250751,345

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity61.00
▷ Minimum class complexity17.00
▷ Maximum class complexity105.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods34
▷ Static methods00.00%
▷ Public methods34100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/donation.png2.68KB1.76KB▼ 34.26%