74% samurai

Code Review | SAMURAI

WordPress plugin SAMURAI scored74%from 54 tests.

About plugin

  • Plugin page: samurai
  • Plugin version: 1.0.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.8
  • WordPress version: 6.3.1
  • First release: May 9, 2017
  • Latest release: Aug 9, 2021
  • Number of updates: 24
  • Update frequency: every 64.8 days
  • Top authors: neginukide (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /962 total downloads

Benchmarks

Plugin footprint 65% 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.94MB] [CPU: ▼33.63ms] Passed 4 tests

Analyzing server-side resources used by SAMURAI
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.28 ▲0.57
Dashboard /wp-admin3.01 ▼0.3026.15 ▼29.48
Posts /wp-admin/edit.php3.01 ▼0.3525.21 ▼24.94
Add New Post /wp-admin/post-new.php3.01 ▼2.8824.69 ▼69.70
Media Library /wp-admin/upload.php3.01 ▼0.2224.44 ▼10.40
SAMURAI /wp-admin/plugins.php?page=samurai/samurai.php3.0124.19

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 7 new options
New WordPress options
samurai
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for SAMURAI
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.23 ▼0.301.86 ▼0.5444.81 ▼2.46
Dashboard /wp-admin2,199 ▲225.57 ▼0.0893.13 ▼6.7242.12 ▼2.12
Posts /wp-admin/edit.php2,104 ▲41.99 ▼0.0034.34 ▼2.2236.47 ▼1.13
Add New Post /wp-admin/post-new.php1,529 ▲123.12 ▲0.08692.79 ▲26.7468.15 ▲18.08
Media Library /wp-admin/upload.php1,398 ▼24.18 ▲0.0398.07 ▼9.3940.88 ▼4.08
SAMURAI /wp-admin/plugins.php?page=samurai/samurai.php1,0552.0124.7555.60

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=samurai/samurai.php
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were 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:
  • Screenshots: Add images for these screenshots: #1 (Plugin setting.), #2 (Example of HTML code (ukiyoe-0301-1) displayed in comment area on WordPress.), #3 (Example of HTML code (ukiyoe-0201-1) displayed in comment area on WordPress.), #4 (Example of HTML code (ukiyoe-0701-1) displayed in comment area on WordPress.)
The official readme.txt might help

samurai/samurai.php Passed 13 tests

The main PHP script in "SAMURAI" version 1.0.8 is automatically included on every request by WordPress
32 characters long description:
Extend the function of comments.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin246 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP41340158
PO File2253688

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.42
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%
Functions6
▷ Named functions6100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
24 compressed PNG files occupy 0.31MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/ukiyoe-0301-3.png13.87KB13.85KB0.15%
img/ukiyoe-0501-2.png20.17KB20.15KB0.10%
add.png4.23KB1.31KB▼ 69.03%
img/myface-3.png6.69KB6.67KB0.29%
img/ukiyoe-0701-1.png14.56KB14.54KB0.14%