84% rest-api-comment

Code Review | REST API Comment

WordPress plugin REST API Comment scored 84% from 54 tests.

About plugin

  • Plugin page: rest-api-comment
  • Plugin version: 1.0.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.5-5.8.1
  • WordPress version: 6.3.1
  • First release: Oct 22, 2021
  • Latest release: Nov 7, 2021
  • Number of updates: 4
  • Update frequency: every 4.5 days
  • Top authors: joaquiminteresting (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active / 410 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.66MB] [CPU: ▼18.44ms] Passed 4 tests

An overview of server-side resources used by REST API Comment
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0244.26 ▼0.57
Dashboard /wp-admin3.32 ▲0.0142.87 ▼6.23
Posts /wp-admin/edit.php3.43 ▲0.0848.96 ▼2.38
Add New Post /wp-admin/post-new.php3.19 ▼2.6931.66 ▼64.58
Media Library /wp-admin/upload.php3.24 ▲0.0136.05 ▲3.40

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for REST API Comment
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,887 ▲15213.62 ▼0.769.06 ▲7.3035.40 ▼13.93
Dashboard /wp-admin2,213 ▲224.86 ▼1.19111.74 ▼3.2142.36 ▼7.00
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0139.82 ▲2.9835.83 ▲3.07
Add New Post /wp-admin/post-new.php1,518 ▼1523.36 ▼0.04645.13 ▼15.5950.59 ▼5.11
Media Library /wp-admin/upload.php1,392 ▲44.21 ▼0.0295.85 ▼2.0740.65 ▼3.59

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 50% 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 fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/rest-api-comment/public/partials/rest-api-comment-display.php
    • > /wp-content/plugins/rest-api-comment/admin/partials/rest-api-comment-display.php

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

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
These attributes need to be fixed:
  • Tags: Too many tags (11 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

rest-api-comment/rest-api-comment.php Passed 13 tests

The entry point to "REST API Comment" version 1.0.2 is a PHP file that has certain tags in its header comment area
105 characters long description:
Create comments via REST API, this plugin allows comments from mobile, desktop and other web Applications

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected523 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP12175645402
Markdown1490115
JavaScript24546
CSS2080

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.51
Average class complexity10.71
▷ Minimum class complexity1.00
▷ Maximum class complexity66.00
Average method complexity3.43
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods28
▷ Static methods27.14%
▷ Public methods2071.43%
▷ Protected methods310.71%
▷ Private methods517.86%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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 images were found in this plugin