74% purge-varnish

Code Review | Purge Varnish Cache

WordPress plugin Purge Varnish Cache scored74%from 54 tests.

About plugin

  • Plugin page: purge-varnish
  • Plugin version: 2.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.0.2
  • WordPress version: 6.3.1
  • First release: Nov 1, 2016
  • Latest release: Nov 1, 2022
  • Number of updates: 43
  • Update frequency: every 51.1 days
  • Top authors: devavi (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

2,000+ active /43,033 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▼0.83MB] [CPU: ▼30.62ms] Passed 4 tests

An overview of server-side resources used by Purge Varnish Cache
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1442.18 ▼0.82
Dashboard /wp-admin3.12 ▼0.1925.57 ▼23.56
Posts /wp-admin/edit.php3.12 ▼0.2427.23 ▼21.41
Add New Post /wp-admin/post-new.php3.12 ▼2.7723.94 ▼69.93
Media Library /wp-admin/upload.php3.12 ▼0.1125.48 ▼7.59
Purge URLs /wp-admin/admin.php?page=purge-varnish-urls3.1223.75
Purge all /wp-admin/admin.php?page=purge-varnish-all3.1224.54
Terminal /wp-admin/admin.php?page=purge-varnish-settings3.1223.46
Expire /wp-admin/admin.php?page=purge-varnish-expire3.1226.04

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: no new tables, 8 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
purge_varnish_action
purge_varnish_expire

Browser metrics Passed 4 tests

An overview of browser requirements for Purge Varnish Cache
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,838 ▲10313.22 ▼1.364.43 ▲2.4639.32 ▼2.84
Dashboard /wp-admin2,247 ▲624.89 ▼0.9999.18 ▼1.3479.25 ▲36.00
Posts /wp-admin/edit.php2,127 ▲382.04 ▼0.0234.49 ▲1.1034.87 ▼1.45
Add New Post /wp-admin/post-new.php1,552 ▲1023.00 ▲0.05775.82 ▲93.7358.02 ▼3.42
Media Library /wp-admin/upload.php1,423 ▲384.20 ▼0.0498.14 ▼3.0767.53 ▲24.26
Purge URLs /wp-admin/admin.php?page=purge-varnish-urls9312.0424.2129.53
Purge all /wp-admin/admin.php?page=purge-varnish-all8382.0327.5027.57
Terminal /wp-admin/admin.php?page=purge-varnish-settings9892.1622.6840.29
Expire /wp-admin/admin.php?page=purge-varnish-expire1,2882.0523.3531.72

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
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function add_menu_page was called incorrectly. The seventh parameter passed to add_menu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 6.0.0.)
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • 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
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=purge-varnish-expire
    • > User notice in wp-includes/functions.php+5905
    Function add_menu_page was called incorrectly. The seventh parameter passed to add_menu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 6.0.0.)
    • > GET request to /wp-admin/admin.php?page=purge-varnish-settings
    • > Warning in wp-content/plugins/purge-varnish/class_purge_varnish.php+128
    socket_connect(): unable to connect [111]: Connection refused

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: flush, performance, automatic, caching, plugin...

purge-varnish/class_purge_varnish.php 85% from 13 tests

The main PHP file in "Purge Varnish Cache" ver. 2.5 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("purge-varnish.php" instead of "class_purge_varnish.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 334 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin1,280 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP51841781,254
CSS10025
JavaScript1001

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity140.00
▷ Minimum class complexity140.00
▷ Maximum class complexity140.00
Average method complexity4.02
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods46
▷ Static methods00.00%
▷ Public methods46100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/error.png0.76KB0.75KB0.13%
images/ok.png0.76KB0.75KB▼ 0.52%
images/purge16x16.png0.50KB0.29KB▼ 41.52%