84% sb-comment

Code Review | SB Comment

WordPress plugin SB Comment scored84%from 54 tests.

About plugin

  • Plugin page: sb-comment
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.1.1
  • WordPress version: 6.3.1
  • First release: Oct 3, 2014
  • Latest release: Apr 9, 2015
  • Number of updates: 18
  • Update frequency: every 10.4 days
  • Top authors: skylarkcob (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,115 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.29ms] Passed 4 tests

Analyzing server-side resources used by SB Comment
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0043.19 ▼0.28
Dashboard /wp-admin3.31 ▲0.0150.42 ▼2.66
Posts /wp-admin/edit.php3.36 ▲0.0050.26 ▼4.19
Add New Post /wp-admin/post-new.php5.89 ▲0.0085.99 ▼14.02
Media Library /wp-admin/upload.php3.23 ▲0.0038.34 ▲0.95

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

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

Browser metrics Passed 4 tests

Checking browser requirements for SB Comment
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.33 ▲0.061.91 ▲0.2048.38 ▲4.01
Dashboard /wp-admin2,195 ▲155.62 ▲0.0185.58 ▼5.9937.18 ▼7.36
Posts /wp-admin/edit.php2,097 ▼32.02 ▲0.0234.91 ▼1.8632.27 ▼3.37
Add New Post /wp-admin/post-new.php1,526 ▼023.39 ▲0.18681.89 ▼29.3459.46 ▲10.43
Media Library /wp-admin/upload.php1,403 ▲34.21 ▲0.00102.99 ▲0.4143.65 ▼1.79

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
Please fix the following items
  • 9× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sb-comment/inc/sb-plugin-ajax.php:12
    • > PHP Fatal error
      require(): Failed opening required 'SB_COMMENT_INC_PATH/sb-plugin-install.php' (include_path='.:/usr/share/php') in wp-content/plugins/sb-comment/inc/sb-plugin-load.php on line 2
    • > PHP Warning
      require(SB_COMMENT_INC_PATH/sb-plugin-install.php): failed to open stream: No such file or directory in wp-content/plugins/sb-comment/inc/sb-plugin-load.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/sb-comment/sb-comment.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function post_password_required() in wp-content/plugins/sb-comment/inc/sb-comment-template.php:2
    • > PHP Warning
      Use of undefined constant SB_COMMENT_INC_PATH - assumed 'SB_COMMENT_INC_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/sb-comment/inc/sb-plugin-load.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sb-comment/inc/sb-plugin-admin.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sb-comment/inc/sb-plugin-hook.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/sb-comment/inc/sb-plugin-install.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 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 to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (The default comment form.), #2 (The default comment list.)
You can look at the official readme.txt

sb-comment/sb-comment.php Passed 13 tests

The primary PHP file in "SB Comment" version 1.1.2 is used by WordPress to initiate all plugin functionality
131 characters long description:
SB Comment is a plugin that allows to check spam comment on your WordPress site, improve the default comment template on your blog.

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
Good job! No executable or dangerous file extensions detected1,299 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP118111741
CSS2350363
PO File14949130
JavaScript21065

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity22.00
▷ Minimum class complexity3.00
▷ Maximum class complexity41.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods35
▷ Static methods35100.00%
▷ Public methods35100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions38
▷ Named functions38100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
9 PNG files occupy 0.18MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/sb-default-avatar-256.png39.57KB28.24KB▼ 28.64%
screenshot-1.png14.32KB7.87KB▼ 45.07%
images/sb-default-avatar-128.png12.14KB8.32KB▼ 31.48%
images/sb-default-avatar-100.png8.66KB5.97KB▼ 31.10%
screenshot-2.png52.36KB22.61KB▼ 56.81%