84% advanced-comments

Code Review | Comments

WordPress plugin Comments scored84%from 54 tests.

About plugin

  • Plugin page: advanced-comments
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.8
  • WordPress version: 6.3.1
  • First release: Jul 10, 2014
  • Latest release: Dec 9, 2016
  • Number of updates: 4
  • Update frequency: every 266.0 days
  • Top authors: webzunft (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /9,334 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.02ms] Passed 4 tests

A check of server-side resources used by Comments
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.63 ▼4.78
Dashboard /wp-admin3.33 ▲0.0345.87 ▲0.86
Posts /wp-admin/edit.php3.38 ▲0.0344.44 ▼3.45
Add New Post /wp-admin/post-new.php5.91 ▲0.0392.40 ▼8.69
Media Library /wp-admin/upload.php3.26 ▲0.0337.87 ▲1.52
Settings /wp-admin/edit-comments.php?page=comments-customizer3.2732.88
All Comments /wp-admin/edit-comments.php3.3239.79

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Comments
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲6014.47 ▲0.101.66 ▼0.5541.71 ▼8.33
Dashboard /wp-admin2,226 ▲384.88 ▼0.98109.90 ▲10.8839.80 ▼2.64
Posts /wp-admin/edit.php2,109 ▲202.01 ▼0.0237.25 ▲0.1934.60 ▼1.84
Add New Post /wp-admin/post-new.php1,549 ▲1623.16 ▲0.17663.34 ▲37.4454.11 ▼1.38
Media Library /wp-admin/upload.php1,405 ▲174.15 ▼0.0494.22 ▼2.3640.74 ▲0.17
Settings /wp-admin/edit-comments.php?page=comments-customizer8062.0427.1425.66
All Comments /wp-admin/edit-comments.php1,8132.2738.9832.38

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'Comments_Main' not found in wp-content/plugins/advanced-comments/admin/comments_admin.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Comments_Main' not found in wp-content/plugins/advanced-comments/frontend/comments_frontend.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: comment form, comments, comment, commenting

advanced-comments/comments.php 92% from 13 tests

The main PHP script in "Comments" version 1.0.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("advanced-comments.php" instead of "comments.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin117 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP443101117

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.36
Average class complexity3.67
▷ Minimum class complexity3.00
▷ Maximum class complexity5.00
Average method complexity1.67
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG images were found in this plugin