10% varnish-wp

Code Review | Varnish WordPress

WordPress plugin Varnish WordPress scored10%from 54 tests.

About plugin

  • Plugin page: varnish-wp
  • Plugin version: 1.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4-4.9
  • WordPress version: 6.3.1
  • First release: Oct 23, 2013
  • Latest release: Feb 20, 2018
  • Number of updates: 7
  • Update frequency: every 227.3 days
  • Top authors: AdminGeekZ (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,530 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • This plugin did not install gracefully
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)

Server metrics [RAM: ▼1.83MB] [CPU: ▼57.49ms] Passed 4 tests

This is a short check of server-side resources used by Varnish WordPress
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.19 ▼1.314.98 ▼36.60
Dashboard /wp-admin2.21 ▼1.136.95 ▼45.61
Posts /wp-admin/edit.php2.22 ▼1.186.38 ▼50.08
Add New Post /wp-admin/post-new.php2.21 ▼3.716.65 ▼97.66
Media Library /wp-admin/upload.php2.21 ▼1.067.53 ▼32.94
Varnish /wp-admin/options-general.php?page=Varnish-WordPress2.227.24

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 14 new options
New WordPress options
varnishwp_version
varnishwp_enabled
varnishwp_purgeall
varnishwp_logging
varnishwp_disablefeeds
theysaidso_admin_options
widget_recent-comments
varnishwp_logname
widget_recent-posts
varnishwp_timeout
...

Browser metrics Passed 4 tests

Checking browser requirements for Varnish WordPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.38 ▲0.031.82 ▼0.0542.46 ▼0.08
Dashboard /wp-admin2,199 ▲195.62 ▲0.0185.53 ▼14.7040.40 ▼6.19
Posts /wp-admin/edit.php2,104 ▲41.97 ▲0.0140.25 ▲4.2239.22 ▲6.26
Add New Post /wp-admin/post-new.php1,531 ▲323.16 ▲0.10631.94 ▼67.4857.95 ▼2.24
Media Library /wp-admin/upload.php1,404 ▲44.18 ▲0.01102.72 ▼14.4743.56 ▼4.86
Varnish /wp-admin/options-general.php?page=Varnish-WordPress9971.9922.0249.99

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Uninstall procedure validation failed for this plugin
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
  • This plugin did not uninstall successfully, leaving 14 options in the database
    • varnishwp_enabled
    • varnishwp_version
    • varnishwp_disablefeeds
    • varnishwp_logging
    • widget_recent-posts
    • widget_recent-comments
    • varnishwp_backends
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • ...

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=Varnish-WordPress
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=Varnish-WordPress
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/options-general.php?page=Varnish-WordPress
    • > Notice in wp-content/plugins/varnish-wp/varnish-wordpress.php+352
    Undefined variable: purgesuccess
    • > GET request to /wp-admin/options-general.php?page=Varnish-WordPress
    • > Notice in wp-content/plugins/varnish-wp/varnish-wordpress.php+357
    Undefined variable: purgeerror
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=Varnish-WordPress
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(): php_network_getaddresses: getaddrinfo failed: Name or service not known
  • 12 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=Varnish-WordPress
    • > Warning in wp-content/plugins/easy-age-verifier/lib/extras/wpApi.php+48
    file_get_contents(http://www.fillyourtaproom.com/wp-json/wp/v2/posts?per_page=10): failed to open stream: php_network_getaddresses: getaddrinfo failed: Name or service not known

SRP Passed 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 SRP test was a success

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots require images: #1 (Screenshot of the performance tests.), #2 (Screenshot of the WordPress plugin.)
The official readme.txt is a good inspiration

varnish-wp/varnish-wordpress.php 92% from 13 tests

The principal PHP file in "Varnish WordPress" v. 1.7 is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("varnish-wp.php" instead of "varnish-wordpress.php")

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
Good job! No executable or dangerous file extensions detected371 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP16033371

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity58.00
▷ Minimum class complexity58.00
▷ Maximum class complexity58.00
Average method complexity4.35
▷ Minimum method complexity1.00
▷ Maximum method complexity30.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There are no PNG files in this plugin