84% wp-rest-api-sidebars

Code Review | WP REST API Sidebars

WordPress plugin WP REST API Sidebars scored84%from 54 tests.

About plugin

  • Plugin page: wp-rest-api-sidebars
  • Plugin version: 0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-4.4.1
  • WordPress version: 6.3.1
  • First release: Jan 14, 2016
  • Latest release: Jan 14, 2016
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: njetskive (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /5,830 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.66MB] [CPU: ▼18.56ms] Passed 4 tests

This is a short check of server-side resources used by WP REST API Sidebars
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0136.40 ▼5.07
Dashboard /wp-admin3.31 ▼0.0449.97 ▼9.23
Posts /wp-admin/edit.php3.36 ▲0.0046.72 ▼4.28
Add New Post /wp-admin/post-new.php3.27 ▼2.6133.82 ▼55.66
Media Library /wp-admin/upload.php3.23 ▲0.0033.90 ▲0.13

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

WP REST API Sidebars: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.33 ▼1.041.94 ▲0.1842.07 ▼8.40
Dashboard /wp-admin2,203 ▲185.75 ▼0.06100.76 ▼13.6838.52 ▼3.49
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0539.39 ▼0.1433.96 ▲0.52
Add New Post /wp-admin/post-new.php1,533 ▲1923.11 ▲5.58673.74 ▼3.4954.83 ▲3.42
Media Library /wp-admin/upload.php1,382 ▼64.24 ▲0.0497.47 ▼5.6144.27 ▲1.47

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/wp-rest-api-sidebars/templates/messages/incompatible-environment.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Controller' not found in wp-content/plugins/wp-rest-api-sidebars/src/controllers/class-sidebars-controller.php:43

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
8 plugin tags: rest, sidebars, json, sidebar, widget...

wp-rest-api-sidebars/wp-rest-api-sidebars.php 92% from 13 tests

Analyzing the main PHP file in "WP REST API Sidebars" version 0.1.1
Please take the time to fix the following:
  • Domain Path: The domain path is invalid: folder "/locale" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin277 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP576262230
Markdown19047

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity8.33
▷ Minimum class complexity2.00
▷ Maximum class complexity17.00
Average method complexity2.83
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes133.33%
Methods14
▷ Static methods321.43%
▷ Public methods1392.86%
▷ Protected methods00.00%
▷ Private methods17.14%
Functions4
▷ Named functions250.00%
▷ Anonymous functions250.00%
Constants8
▷ Global constants8100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected