84% rest-api-widgets

Code Review | Rest API Widgets

WordPress plugin Rest API Widgets scored84%from 54 tests.

About plugin

  • Plugin page: rest-api-widgets
  • Plugin version: 0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-4.3.1
  • WordPress version: 6.3.1
  • First release: Dec 30, 2015
  • Latest release: May 3, 2016
  • Number of updates: 4
  • Update frequency: every 31.7 days
  • Top authors: hideokamoto (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /882 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
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼1.58ms] Passed 4 tests

This is a short check of server-side resources used by Rest API Widgets
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0638.39 ▲2.36
Dashboard /wp-admin3.36 ▲0.0151.83 ▼7.76
Posts /wp-admin/edit.php3.41 ▲0.0547.34 ▲0.84
Add New Post /wp-admin/post-new.php5.94 ▲0.05103.12 ▼1.77
Media Library /wp-admin/upload.php3.29 ▲0.0538.39 ▲4.20

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 9 new options
New WordPress options
widget_rest_post_list_widget
widget_recent-comments
can_compress_scripts
db_upgraded
widget_recent-posts
widget_rest_comment_form_widget
widget_theysaidso_widget
theysaidso_admin_options
widget_rest_comment_list_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Rest API Widgets
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,802 ▲5613.26 ▼1.184.80 ▲3.1537.47 ▲1.47
Dashboard /wp-admin2,206 ▲174.85 ▼0.09110.06 ▼1.5343.24 ▲0.34
Posts /wp-admin/edit.php2,089 ▼02.01 ▼0.0439.68 ▼1.3435.45 ▲0.41
Add New Post /wp-admin/post-new.php1,533 ▲523.28 ▲5.04652.29 ▲44.6551.61 ▼4.16
Media Library /wp-admin/upload.php1,391 ▼04.27 ▲0.07101.81 ▲1.3141.93 ▼1.44

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_rest_comment_list_widget
    • theysaidso_admin_options
    • widget_rest_post_list_widget
    • db_upgraded
    • widget_rest_comment_form_widget

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
Even though no errors were found, this is by no means an exhaustive test

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
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/rest-api-widgets/includes/class/class.commentlist.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/rest-api-widgets/includes/class/class.postlist.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/rest-api-widgets/includes/class/class.commentform.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/rest-api-widgets/includes/class/class.commentform.php:2

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 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
2 plugin tags: widget, wp-api

rest-api-widgets/rest-api-widgets.php 92% from 13 tests

The main PHP script in "Rest API Widgets" version 0.1 is automatically included on every request by WordPress
You should first fix the following items:
  • Domain Path: The domain path folder does not exist ("/languages")

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 plugin224 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP42610155
JavaScript12369

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.15
Average class complexity5.33
▷ Minimum class complexity4.00
▷ Maximum class complexity6.00
Average method complexity2.08
▷ Minimum method complexity1.00
▷ Maximum method complexity4.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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin