83% nginx-cache-optimizer

Code Review | NGINX Cache Optimizer

WordPress plugin NGINX Cache Optimizer scored83%from 54 tests.

About plugin

  • Plugin page: nginx-cache-optim...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1.1
  • WordPress version: 6.3.1
  • First release: Aug 19, 2014
  • Latest release: Feb 27, 2015
  • Number of updates: 18
  • Update frequency: every 10.7 days
  • Top authors: getclouder (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /5,528 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

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

Analyzing server-side resources used by NGINX Cache Optimizer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1440.30 ▼3.84
Dashboard /wp-admin3.44 ▲0.0951.40 ▼12.71
Posts /wp-admin/edit.php3.55 ▲0.2051.23 ▼4.71
Add New Post /wp-admin/post-new.php6.02 ▲0.1397.42 ▼12.27
Media Library /wp-admin/upload.php3.36 ▲0.1335.62 ▼2.03

Server storage [IO: ▲0.08MB] [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: 20 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
nginxcacheoptimizer
db_upgraded
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

NGINX Cache Optimizer: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,815 ▲6514.37 ▼0.001.69 ▼0.6341.84 ▼0.83
Dashboard /wp-admin2,224 ▲445.67 ▲0.0284.98 ▼4.1970.86 ▲20.85
Posts /wp-admin/edit.php2,129 ▲291.98 ▲0.0138.04 ▼3.7435.44 ▼4.80
Add New Post /wp-admin/post-new.php1,546 ▲1417.51 ▼5.59689.80 ▲1.0362.51 ▲9.92
Media Library /wp-admin/upload.php1,429 ▲294.19 ▼0.0799.34 ▼13.3479.74 ▲29.70

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • nginxcacheoptimizer

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/nginx-cache-optimizer/views/nginxcacheoptimizer.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: speed, nginx, caching, memcached, performance...

nginx-cache-optimizer/nginxcacheoptimizer.php 77% from 13 tests

The entry point to "NGINX Cache Optimizer" version 1.1 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 178 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("nginx-cache-optimizer.php" instead of "nginxcacheoptimizer.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected894 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP8186661644
JavaScript1655115
SVG60476
CSS111459

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity22.17
▷ Minimum class complexity6.00
▷ Maximum class complexity65.00
Average method complexity2.95
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods65
▷ Static methods710.77%
▷ Public methods5686.15%
▷ Protected methods69.23%
▷ Private methods34.62%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

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