72% snipe-nginx-cache

Code Review | Cache Sniper for Nginx

WordPress plugin Cache Sniper for Nginx scored72%from 54 tests.

About plugin

  • Plugin page: snipe-nginx-cache
  • Plugin version: 1.0.4.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-4.9.8
  • WordPress version: 6.3.1
  • First release: Jul 25, 2017
  • Latest release: Sep 27, 2018
  • Number of updates: 23
  • Update frequency: every 18.7 days
  • Top authors: ekaterir (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /4,120 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.06MB] [CPU: ▼16.46ms] Passed 4 tests

This is a short check of server-side resources used by Cache Sniper for Nginx
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0840.34 ▼8.24
Dashboard /wp-admin3.32 ▼0.0333.73 ▼31.17
Posts /wp-admin/edit.php3.38 ▲0.0239.97 ▼4.31
Add New Post /wp-admin/post-new.php5.58 ▼0.3279.88 ▼22.12
Media Library /wp-admin/upload.php3.33 ▲0.0932.67 ▼4.16
Nginx Cache Sniper /wp-admin/tools.php?page=cache-sniper-nginx3.3031.35

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Cache Sniper for Nginx: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,812 ▲6614.37 ▲0.211.78 ▲0.1841.10 ▼2.95
Dashboard /wp-admin2,218 ▲415.64 ▲0.1291.47 ▼2.0635.79 ▼5.01
Posts /wp-admin/edit.php2,127 ▲272.01 ▲0.0639.53 ▲3.3736.14 ▲0.67
Add New Post /wp-admin/post-new.php6,237 ▲4,71126.02 ▲2.94941.78 ▲199.5853.94 ▲0.17
Media Library /wp-admin/upload.php1,423 ▲234.18 ▲0.0199.88 ▼55.6042.53 ▼18.74
Nginx Cache Sniper /wp-admin/tools.php?page=cache-sniper-nginx9192.0222.5133.00

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/tools.php?page=cache-sniper-nginx
    • > Warning in wp-admin/includes/file.php+2197
    fopen(/var/lib/nginx/temp-write-test-652c528ba3a5f4-80424409): failed to open stream: No such file or directory
    • > GET request to /wp-admin/tools.php?page=cache-sniper-nginx
    • > Warning in wp-admin/includes/file.php+2197
    fopen(/var/lib/nginx/cache/8/7c/temp-write-test-652c528ba3cee2-27112399): failed to open stream: No such file or directory

SRP 0% from 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
Please take a closer look at the following
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/snipe-nginx-cache/cache-sniper-nginx.php
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/snipe-nginx-cache/includes/cache-sniper-nginx-comments.php:3
    • > PHP Fatal error
      Trait 'CSNX_Common_Utils' not found in wp-content/plugins/snipe-nginx-cache/includes/render_helper.php on line 3

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Tags: Too many tags (19 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

snipe-nginx-cache/cache-sniper-nginx.php 92% from 13 tests

The main PHP file in "Cache Sniper for Nginx" ver. 1.0.4.2 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: Please rename the main PHP file in this plugin to the plugin slug ("snipe-nginx-cache.php" instead of "cache-sniper-nginx.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
There were no executable files found in this plugin528 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP585131467
JavaScript15061

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity8.40
▷ Minimum class complexity1.00
▷ Maximum class complexity25.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits1
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods43
▷ Static methods24.65%
▷ Public methods4195.35%
▷ Protected methods00.00%
▷ Private methods24.65%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ Public constants7100.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
PNG images were not found in this plugin