84% reported-comments

Code Review | Reported Comments

WordPress plugin Reported Comments scored84%from 54 tests.

About plugin

  • Plugin page: reported-comments
  • Plugin version: 1.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.4
  • WordPress version: 6.3.1
  • First release: May 12, 2020
  • Latest release: May 13, 2020
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: lebleut (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /398 total downloads

Benchmarks

Plugin footprint 83% 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: ▲0.21MB] [CPU: ▼8.40ms] Passed 4 tests

This is a short check of server-side resources used by Reported Comments
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1627.91 ▼9.94
Dashboard /wp-admin3.59 ▲0.2848.74 ▼1.18
Posts /wp-admin/edit.php3.64 ▲0.2851.83 ▲8.13
Add New Post /wp-admin/post-new.php6.08 ▲0.2080.57 ▼24.04
Media Library /wp-admin/upload.php3.42 ▲0.2035.00 ▲1.56
Reports /wp-admin/edit-comments.php?page=jamel_comment_reporter3.5136.11
All Comments /wp-admin/edit-comments.php3.5142.61

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 7 new options
New WordPress options
lbl_comment_reporter__basics
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Reported Comments
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,082 ▲33615.52 ▲0.876.53 ▲4.8343.91 ▼0.64
Dashboard /wp-admin2,380 ▲1956.65 ▲1.72129.15 ▲25.5541.19 ▼0.25
Posts /wp-admin/edit.php2,283 ▲1943.67 ▲1.6551.69 ▲13.6531.70 ▼1.14
Add New Post /wp-admin/post-new.php1,541 ▼117.81 ▼0.26642.73 ▲52.3136.09 ▼31.29
Media Library /wp-admin/upload.php1,422 ▲314.35 ▲0.1880.85 ▼13.8941.66 ▲1.27
Reports /wp-admin/edit-comments.php?page=jamel_comment_reporter1,6696.90135.5178.03
All Comments /wp-admin/edit-comments.php1,9903.8349.8032.69

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 7 options in the database
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • lbl_comment_reporter__basics
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      require_once(): Failed opening required 'REPORTED_COMMENTS_DIRinc/class-messages.php' (include_path='.:/usr/share/php') in wp-content/plugins/reported-comments/inc/class-comment-report.php on line 4
    • > PHP Warning
      require_once(REPORTED_COMMENTS_DIRlib/wedevs_settings_api/class.settings-api.php): failed to open stream: No such file or directory in wp-content/plugins/reported-comments/inc/class-settings.php on line 4
    • > PHP Warning
      Use of undefined constant REPORTED_COMMENTS_DIR - assumed 'REPORTED_COMMENTS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/reported-comments/inc/class-comment-report.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/reported-comments/comment-reporter.php:18
    • > PHP Fatal error
      require_once(): Failed opening required 'REPORTED_COMMENTS_DIRlib/wedevs_settings_api/class.settings-api.php' (include_path='.:/usr/share/php') in wp-content/plugins/reported-comments/inc/class-settings.php on line 4
    • > PHP Warning
      require_once(REPORTED_COMMENTS_DIRinc/class-messages.php): failed to open stream: No such file or directory in wp-content/plugins/reported-comments/inc/class-comment-report.php on line 4
    • > PHP Warning
      Use of undefined constant REPORTED_COMMENTS_DIR - assumed 'REPORTED_COMMENTS_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/reported-comments/inc/class-settings.php on line 4

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 96% 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
2 plugin tags: report comments, flagging

reported-comments/comment-reporter.php 92% from 13 tests

The entry point to "Reported Comments" version 1.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("reported-comments.php" instead of "comment-reporter.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
Good job! No executable or dangerous file extensions detected872 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP5206313792
JavaScript19541
CSS15139

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity28.25
▷ Minimum class complexity1.00
▷ Maximum class complexity75.00
Average method complexity2.57
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods55
▷ Static methods11.82%
▷ Public methods55100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions00.00%
▷ Anonymous functions5100.00%
Constants4
▷ Global constants4100.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
PNG images were not found in this plugin