62% commentsafe

Code Review | CommentSafe

WordPress plugin CommentSafe scored62%from 54 tests.

About plugin

  • Plugin page: commentsafe
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.8
  • WordPress version: 6.3.1
  • First release: Jun 16, 2017
  • Latest release: Jul 22, 2017
  • Number of updates: 19
  • Update frequency: every 2.0 days
  • Top authors: inviul (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /780 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▼1.90MB] [CPU: ▼48.63ms] Passed 4 tests

A check of server-side resources used by CommentSafe
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.384.83 ▼35.71
Dashboard /wp-admin2.11 ▼1.205.90 ▼41.57
Posts /wp-admin/edit.php2.11 ▼1.255.66 ▼36.40
Add New Post /wp-admin/post-new.php2.11 ▼3.786.39 ▼80.83
Media Library /wp-admin/upload.php2.11 ▼1.134.57 ▼29.49
CommentSafe /wp-admin/options-general.php?page=comment-safe-settings2.115.53

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 17 new files
Database: no new tables, 8 new options
New WordPress options
_wpcar_autotime_limit
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
_wpcar_maxtime_limit

Browser metrics Passed 4 tests

Checking browser requirements for CommentSafe
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,889 ▲14313.50 ▼0.858.62 ▲6.6843.56 ▲0.86
Dashboard /wp-admin2,212 ▲274.87 ▼0.04102.95 ▼7.1240.39 ▼6.33
Posts /wp-admin/edit.php2,092 ▲32.03 ▲0.0336.29 ▼1.1435.89 ▲2.62
Add New Post /wp-admin/post-new.php6,250 ▲4,72926.05 ▲2.97836.65 ▲234.5062.60 ▲9.29
Media Library /wp-admin/upload.php1,394 ▲124.16 ▼0.0394.93 ▼9.2340.07 ▼4.52
CommentSafe /wp-admin/options-general.php?page=comment-safe-settings8022.0825.5827.05

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wpcar handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • The uninstall procedure has failed, leaving 8 options in the database
    • _wpcar_autotime_limit
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • _wpcar_maxtime_limit
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=comment-safe-settings
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wpcar handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
    • > GET request to /wp-admin/options-general.php?page=comment-safe-settings
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the wpcar handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

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
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/commentsafe/1.2/__MACOSX/comment-safe/._comment-safe-admin.php
    • > /wp-content/plugins/commentsafe/1.2/__MACOSX/._comment-safe-admin.php
    • > /wp-content/plugins/commentsafe/1.2/__MACOSX/._comment-safe.php
    • > /wp-content/plugins/commentsafe/__MACOSX/comment-safe/._comment-safe.php
    • > /wp-content/plugins/commentsafe/__MACOSX/comment-safe/._comment-safe-admin.php
    • > /wp-content/plugins/commentsafe/1.2/__MACOSX/comment-safe/._comment-safe.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/commentsafe/1.2/comment-safe-admin.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/commentsafe/comment-safe-admin.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: timer in comments, engagements, time in post comment button, improve bounce rate, stop spam comments...

commentsafe/comment-safe.php 85% from 13 tests

Analyzing the main PHP file in "CommentSafe" version 1.2
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 216 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("commentsafe.php" instead of "comment-safe.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
Everything looks great! No dangerous files found in this plugin262 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP39616239
JavaScript110523

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity9.00
▷ Minimum class complexity7.00
▷ Maximum class complexity11.00
Average method complexity1.73
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods44
▷ Static methods00.00%
▷ Public methods4090.91%
▷ Protected methods00.00%
▷ Private methods49.09%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
No PNG files were detected