84% js-widgets

Code Review | JS Widgets

WordPress plugin JS Widgets scored84%from 54 tests.

About plugin

  • Plugin page: js-widgets
  • Plugin version: 0.4.3
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-4.9.0
  • WordPress version: 6.3.1
  • First release: Aug 25, 2016
  • Latest release: Nov 12, 2017
  • Number of updates: 18
  • Update frequency: every 30.6 days
  • Top authors: westonruter (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,764 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.49MB] [CPU: ▼3.04ms] Passed 4 tests

A check of server-side resources used by JS Widgets
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.98 ▲0.5240.31 ▲1.17
Dashboard /wp-admin3.81 ▲0.4745.02 ▼17.49
Posts /wp-admin/edit.php3.86 ▲0.5145.58 ▼1.18
Add New Post /wp-admin/post-new.php6.63 ▲0.74104.64 ▲9.43
Media Library /wp-admin/upload.php3.67 ▲0.4539.26 ▲5.35

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 44 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

JS Widgets: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲2913.29 ▼1.024.54 ▲2.5542.50 ▼0.13
Dashboard /wp-admin2,203 ▲125.83 ▲0.9797.46 ▼9.3541.60 ▼0.43
Posts /wp-admin/edit.php2,086 ▼62.05 ▼0.0034.52 ▼6.0531.15 ▼3.14
Add New Post /wp-admin/post-new.php1,533 ▼023.28 ▲0.07606.36 ▼16.8361.05 ▲8.17
Media Library /wp-admin/upload.php1,388 ▲34.22 ▼0.0297.43 ▲3.9343.77 ▲3.57

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 18× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Adapter_JS_Widget' not found in wp-content/plugins/js-widgets/core-adapter-widgets/archives/class.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Adapter_JS_Widget' not found in wp-content/plugins/js-widgets/core-adapter-widgets/recent-comments/class.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget_Form_Customize_Control' not found in wp-content/plugins/js-widgets/php/class-wp-customize-js-widget-control.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Adapter_JS_Widget' not found in wp-content/plugins/js-widgets/core-adapter-widgets/recent-posts/class.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Adapter_JS_Widget' not found in wp-content/plugins/js-widgets/core-adapter-widgets/rss/class.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/js-widgets/post-collection-widget.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'WP_JS_Widget' not found in wp-content/plugins/js-widgets/php/class-wp-adapter-js-widget.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Adapter_JS_Widget' not found in wp-content/plugins/js-widgets/core-adapter-widgets/categories/class.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Adapter_JS_Widget' not found in wp-content/plugins/js-widgets/core-adapter-widgets/pages/class.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Adapter_JS_Widget' not found in wp-content/plugins/js-widgets/core-adapter-widgets/search/class.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: widgets, customizer, rest-api

js-widgets/js-widgets.php Passed 13 tests

"JS Widgets" version 0.4.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
94 characters long description:
The next generation of widgets in core, embracing JS for UI and powering the Widgets REST API.

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
Success! There were no dangerous files found in this plugin3,669 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
PHP224691,7832,683
JavaScript18227614868
CSS3161118

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity17.10
▷ Minimum class complexity1.00
▷ Maximum class complexity82.00
Average method complexity2.96
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes210.00%
▷ Concrete classes1890.00%
▷ Final classes00.00%
Methods165
▷ Static methods00.00%
▷ Public methods15593.94%
▷ Protected methods106.06%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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