90% custom-post-type-widget-blocks

Code Review | Custom Post Type Widget Blocks

WordPress plugin Custom Post Type Widget Blocks scored90%from 54 tests.

About plugin

  • Plugin page: custom-post-type-...
  • Plugin version: 1.6.2
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8.0-6.4.1
  • WordPress version: 6.3.1
  • First release: May 7, 2020
  • Latest release: Nov 28, 2023
  • Number of updates: 30
  • Update frequency: every 43.3 days
  • Top authors: thingsym (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,124 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.41MB] [CPU: ▼3.17ms] Passed 4 tests

An overview of server-side resources used by Custom Post Type Widget Blocks
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.90 ▲0.4444.13 ▲3.03
Dashboard /wp-admin3.71 ▲0.3650.10 ▼14.51
Posts /wp-admin/edit.php3.82 ▲0.4650.39 ▼0.43
Add New Post /wp-admin/post-new.php6.34 ▲0.4585.94 ▼0.78
Media Library /wp-admin/upload.php3.63 ▲0.4036.96 ▲5.13

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Custom Post Type Widget Blocks
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,792 ▲5614.19 ▼0.161.76 ▼0.0744.35 ▲0.04
Dashboard /wp-admin2,192 ▲185.55 ▼0.0789.80 ▼11.0239.98 ▼7.12
Posts /wp-admin/edit.php2,100 ▼01.94 ▼0.0837.21 ▲1.0934.94 ▼0.48
Add New Post /wp-admin/post-new.php6,194 ▲4,65519.34 ▼3.97860.13 ▲226.9556.74 ▲5.04
Media Library /wp-admin/upload.php1,397 ▼34.20 ▼0.0297.22 ▲0.7438.90 ▼4.33

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: Screenshot #1 (Block category 'Custom Post Type Widget Blocks') image required
You can take inspiration from this readme.txt

custom-post-type-widget-blocks/custom-post-type-widget-blocks.php Passed 13 tests

The principal PHP file in "Custom Post Type Widget Blocks" v. 1.6.2 is loaded by WordPress automatically on each request
58 characters long description:
Custom Post Type Widgets for the Block Editor (Gutenberg).

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected2,533 lines of code in 25 files:
LanguageFilesBlank linesComment linesLines of code
PHP112986191,429
JSON800535
CSS4206292
PO File1117136275
JavaScript1002

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.47
Average class complexity30.88
▷ Minimum class complexity3.00
▷ Maximum class complexity63.00
Average method complexity6.20
▷ Minimum method complexity1.00
▷ Maximum method complexity43.00
Code structure
Namespaces2
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods46
▷ Static methods00.00%
▷ Public methods46100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.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
1 PNG file occupies 0.04MB with 0.03MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png41.04KB12.21KB▼ 70.24%