84% brickset-api

Code Review | Brickset API

WordPress plugin Brickset API scored84%from 54 tests.

About plugin

  • Plugin page: brickset-api
  • Plugin version: 1.4.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.1
  • WordPress version: 6.3.1
  • First release: Mar 23, 2013
  • Latest release: Dec 26, 2014
  • Number of updates: 28
  • Update frequency: every 23.0 days
  • Top authors: NateJacobs (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,672 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.42MB] [CPU: ▼5.82ms] Passed 4 tests

This is a short check of server-side resources used by Brickset API
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.82 ▲0.3539.54 ▼5.21
Dashboard /wp-admin3.79 ▲0.4851.38 ▼7.22
Posts /wp-admin/edit.php3.84 ▲0.4857.27 ▲10.26
Add New Post /wp-admin/post-new.php6.31 ▲0.42100.44 ▼13.11
Media Library /wp-admin/upload.php3.65 ▲0.4240.95 ▲2.25
Welcome to Brickset API /wp-admin/index.php?page=bs-about3.6135.79
Welcome to Brickset API /wp-admin/index.php?page=bs-credits3.62400.21
Brickset API /wp-admin/options-general.php?page=brickset-api-options3.6132.88

Server storage [IO: ▲0.16MB] [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: 20 new files
Database: no new tables, 12 new options
New WordPress options
can_compress_scripts
widget_brickset_theme_widget
widget_recent-posts
brickset_oembed_key
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_brickset_theme_years_widget
widget_brickset_minifig_owned_widget
widget_brickset_set_widget
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Brickset API
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,807 ▲6113.22 ▼1.215.28 ▲3.5043.84 ▼1.23
Dashboard /wp-admin2,216 ▲284.86 ▼0.09108.31 ▲2.1741.88 ▲4.33
Posts /wp-admin/edit.php2,096 ▲72.03 ▲0.0141.88 ▲1.4737.08 ▲1.71
Add New Post /wp-admin/post-new.php1,520 ▼417.77 ▼5.53647.68 ▲13.9353.27 ▼1.14
Media Library /wp-admin/upload.php1,389 ▲14.19 ▼0.0199.43 ▲4.2243.76 ▲1.52
Welcome to Brickset API /wp-admin/index.php?page=bs-about8472.1427.0645.50
Welcome to Brickset API /wp-admin/index.php?page=bs-credits7802.0326.4332.63
Brickset API /wp-admin/options-general.php?page=brickset-api-options8572.0724.7128.45

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 12 options in the database
    • brickset-api-settings
    • widget_brickset_set_widget
    • widget_theysaidso_widget
    • brickset_oembed_key
    • widget_brickset_theme_years_widget
    • db_upgraded
    • widget_recent-posts
    • widget_brickset_theme_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'BricksetAPIUtilities' not found in wp-content/plugins/brickset-api/inc/class-update-functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/brickset-api/inc/widgets/class-theme-widget.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/brickset-api/inc/widgets/class-set-widget.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'BricksetAPIUtilities' not found in wp-content/plugins/brickset-api/inc/class-search-functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/brickset-api/brickset-api.php:24
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/brickset-api/inc/widgets/class-minifig-owned-widget.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'BricksetAPISearch' not found in wp-content/plugins/brickset-api/inc/class-shortcodes.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'BricksetAPISearch' not found in wp-content/plugins/brickset-api/inc/class-oembed.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/brickset-api/admin/class-settings-page.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/brickset-api/inc/widgets/class-theme-years-widget.php: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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
3 plugin tags: brickset, brick, lego

brickset-api/brickset-api.php 92% from 13 tests

The primary PHP file in "Brickset API" version 1.4.1 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 306 characters long)

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
Success! There were no dangerous files found in this plugin2,646 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP143991,2241,719
JSON100671
PO File1103125256

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity16.31
▷ Minimum class complexity4.00
▷ Maximum class complexity54.00
Average method complexity3.21
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes00.00%
▷ Concrete classes13100.00%
▷ Final classes00.00%
Methods90
▷ Static methods00.00%
▷ Public methods7886.67%
▷ Protected methods1112.22%
▷ Private methods11.11%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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
2 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/theme-years-widget.png18.65KB4.21KB▼ 77.45%
assets/images/owned-minifig-widget.png12.24KB2.91KB▼ 76.23%