84% nginx-helper

Code Review | Nginx Helper

WordPress plugin Nginx Helper scored84%from 54 tests.

About plugin

  • Plugin page: nginx-helper
  • Plugin version: 2.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 28, 2012
  • Latest release: Aug 23, 2023
  • Number of updates: 204
  • Update frequency: every 19.5 days
  • Top authors: rtcamp (35.29%)saurabhshukla (31.37%)vaishu.agola27 (14.22%)rahul286 (5.39%)faishal (4.9%)

Code review

54 tests

User reviews

30 reviews

Install metrics

100,000+ active /3,538,524 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.32MB] [CPU: ▼2.44ms] Passed 4 tests

An overview of server-side resources used by Nginx Helper
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3151.76 ▲10.46
Dashboard /wp-admin3.66 ▲0.3650.77 ▼1.33
Posts /wp-admin/edit.php3.72 ▲0.3651.31 ▼1.05
Add New Post /wp-admin/post-new.php6.18 ▲0.3089.82 ▼13.40
Media Library /wp-admin/upload.php3.52 ▲0.3042.10 ▲6.02
Nginx Helper /wp-admin/options-general.php?page=nginx3.6435.94

Server storage [IO: ▲0.59MB] [DB: ▲0.15MB] Passed 3 tests

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 37 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Nginx Helper
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.38 ▲0.201.73 ▼0.0843.59 ▲0.63
Dashboard /wp-admin2,202 ▲255.62 ▼0.0792.12 ▲4.4142.26 ▼5.11
Posts /wp-admin/edit.php2,104 ▲42.04 ▲0.0240.82 ▲4.5736.25 ▲1.51
Add New Post /wp-admin/post-new.php1,548 ▲2223.14 ▲5.43675.44 ▼1.6057.81 ▲2.98
Media Library /wp-admin/upload.php1,401 ▲14.21 ▼0.10102.47 ▲2.0343.99 ▲0.38
Nginx Helper /wp-admin/options-general.php?page=nginx1,6461.8031.0331.71

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/nginx-helper/admin/partials/nginx-helper-admin-display.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Purger' not found in wp-content/plugins/nginx-helper/admin/class-phpredis-purger.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/nginx-helper/admin/partials/nginx-helper-support-options.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_query_arg() in wp-content/plugins/nginx-helper/admin/partials/nginx-helper-sidebar-display.php:13
    • > PHP Fatal error
      Uncaught Error: Call to a member function nginx_helper_settings() on null in wp-content/plugins/nginx-helper/admin/partials/nginx-helper-general-options.php:76
    • > PHP Fatal error
      Uncaught Error: Class 'Purger' not found in wp-content/plugins/nginx-helper/admin/class-predis-purger.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Purger' not found in wp-content/plugins/nginx-helper/admin/class-fastcgi-purger.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Tags: There are too many tags (12 tag instead of maximum 10)
The official readme.txt might help

nginx-helper/nginx-helper.php Passed 13 tests

The main file in "Nginx Helper" v. 2.2.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
113 characters long description:
Cleans nginx's fastcgi/proxy cache or redis-cache whenever a post is edited/published. Also does few more things.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected10,774 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP192,6666,87910,171
PO File1144173301
CSS21123120
JSON20062
JavaScript1214650
XML1111639
YAML14216
SVG10015

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity4.48
▷ Minimum class complexity1.00
▷ Maximum class complexity133.00
Average method complexity2.11
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces22
Interfaces25
Traits0
Classes243
▷ Abstract classes114.53%
▷ Concrete classes23295.47%
▷ Final classes10.43%
Methods936
▷ Static methods252.67%
▷ Public methods72076.92%
▷ Protected methods17018.16%
▷ Private methods464.91%
Functions11
▷ Named functions327.27%
▷ Anonymous functions872.73%
Constants28
▷ Global constants828.57%
▷ Class constants2071.43%
▷ Public constants20100.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
admin/icons/nginx-icon-32x32.png3.85KB1.26KB▼ 67.29%