84% smart-varnish

Code Review | Smart Varnish

WordPress plugin Smart Varnish scored 84% from 54 tests.

About plugin

  • Plugin page: smart-varnish
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.6.0
  • WordPress version: 6.3.1
  • First release: Oct 15, 2014
  • Latest release: Aug 30, 2016
  • Number of updates: 10
  • Update frequency: every 68.6 days
  • Top authors: smartpixels (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active / 1,309 total downloads

Benchmarks

Plugin footprint 83% 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 gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼1.68ms] Passed 4 tests

This is a short check of server-side resources used by Smart Varnish
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0137.14 ▼2.28
Dashboard /wp-admin3.31 ▲0.0143.44 ▼4.62
Posts /wp-admin/edit.php3.36 ▲0.0046.51 ▲1.37
Add New Post /wp-admin/post-new.php5.89 ▲0.0097.84 ▲0.99
Media Library /wp-admin/upload.php3.23 ▲0.0032.66 ▼0.80

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 3 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Smart Varnish
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.26 ▼1.381.70 ▼0.0243.10 ▲4.36
Dashboard /wp-admin2,206 ▲185.78 ▼0.1294.67 ▼8.8637.99 ▼5.12
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0339.23 ▼3.5132.59 ▼4.77
Add New Post /wp-admin/post-new.php1,540 ▲723.43 ▲0.14591.67 ▼76.2949.51 ▼9.16
Media Library /wp-admin/upload.php1,385 ▼04.14 ▼0.0891.91 ▼8.3342.08 ▼1.69

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/smart-varnish/smart_varnish.php:34

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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
4 plugin tags: varnish bypass, varnish, varnish caching, varnish cache

smart-varnish/smart_varnish.php 85% from 13 tests

The main PHP file in "Smart Varnish" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Text Domain: Please use dashes and lowercase characters for text domains
  • Main file name: Name the main plugin file the same as the plugin slug ("smart-varnish.php" instead of "smart_varnish.php")

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
No dangerous file extensions were detected23 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1114223

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
No PNG files were detected