78% blocks-detector-finder

Code Review | Blocks Detector Finder

WordPress plugin Blocks Detector Finder scored78%from 54 tests.

About plugin

  • Plugin page: blocks-detector-f...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-6.0
  • WordPress version: 6.3.1
  • First release: Jul 8, 2022
  • Latest release: Jul 8, 2022
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: elementinvader (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /530 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 successfully, without throwing any errors or notices

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

Analyzing server-side resources used by Blocks Detector Finder
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3842.78 ▼2.07
Dashboard /wp-admin3.75 ▲0.4049.42 ▼20.11
Posts /wp-admin/edit.php3.78 ▲0.4250.91 ▲3.43
Add New Post /wp-admin/post-new.php6.39 ▲0.5181.15 ▼13.60
Media Library /wp-admin/upload.php3.68 ▲0.4637.58 ▲2.86
Installed Blocks /wp-admin/admin.php?page=bpdf3.7246.70
Blocks used /wp-admin/admin.php?page=bpdf_used_widgets3.6640.24
Blocks not in use /wp-admin/admin.php?page=bpdf_not_in_use3.7534.78
Blocks used but deactivated /wp-admin/admin.php?page=bpdf_used_missing3.5835.99

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 58 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
winter_mvc_active_plugins
db_upgraded
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Blocks Detector Finder: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,960 ▲19913.57 ▼0.645.13 ▲3.0538.48 ▼5.97
Dashboard /wp-admin2,258 ▲525.83 ▲0.93100.18 ▼19.3040.93 ▼1.24
Posts /wp-admin/edit.php2,137 ▲372.06 ▲0.0336.49 ▼1.6734.91 ▲0.98
Add New Post /wp-admin/post-new.php1,557 ▲2623.07 ▼0.12667.41 ▼20.7646.85 ▼3.25
Media Library /wp-admin/upload.php1,434 ▲344.25 ▲0.0896.89 ▼8.8347.12 ▲3.61
Installed Blocks /wp-admin/admin.php?page=bpdf2,47611.59219.1734.68
Blocks used /wp-admin/admin.php?page=bpdf_used_widgets9322.0725.4132.12
Blocks not in use /wp-admin/admin.php?page=bpdf_not_in_use2,2122.0523.3130.13
Blocks used but deactivated /wp-admin/admin.php?page=bpdf_used_missing8322.0424.7926.48

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • winter_mvc_active_plugins
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 7× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/blocks-detector-finder/application/controllers/Bpdf_used_widgets.php
    • > /wp-content/plugins/blocks-detector-finder/admin/partials/blocks-plugin-detector-finder-admin-display.php
    • > /wp-content/plugins/blocks-detector-finder/application/controllers/Bpdf_not_in_use.php
    • > /wp-content/plugins/blocks-detector-finder/application/controllers/Bpdf.php
    • > /wp-content/plugins/blocks-detector-finder/application/controllers/Bpdf_used_missing.php
    • > /wp-content/plugins/blocks-detector-finder/public/partials/blocks-plugin-detector-finder-public-display.php
    • > /wp-content/plugins/blocks-detector-finder/application/controllers/Bpdf_used_images.php
  • 33× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to get property 'idfield' of non-object in wp-content/plugins/blocks-detector-finder/application/views/fields_edit/DROPDOWN.php on line 11
    • > PHP Notice
      Undefined variable: field in wp-content/plugins/blocks-detector-finder/application/views/fields_edit/NUMBER.php on line 11
    • > PHP Warning
      Creating default object from empty value in wp-content/plugins/blocks-detector-finder/application/views/fields_edit/TEXTAREA.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/blocks-detector-finder/application/views/bpdf_used_missing/index.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/blocks-detector-finder/application/views/bpdf_used_images/index.php:5
    • > PHP Notice
      Undefined property: stdClass::$field_label in wp-content/plugins/blocks-detector-finder/application/views/fields_edit/INPUTBOX.php on line 18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/blocks-detector-finder/vendor/Winter_MVC/init.php:16
    • > PHP Notice
      Undefined property: stdClass::$field_label in wp-content/plugins/blocks-detector-finder/application/views/fields_edit/DROPDOWN.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/blocks-detector-finder/application/views/bpdf/index.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/blocks-detector-finder/application/views/fields_edit/DROPDOWN.php:28

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === blocks-detector-finder === )
  • Screenshots: Please add images for these screenshots: #1 (Installed Blocks), #2 (Blocks Used Per Page), #3 (Blocks Not in use)
You can look at the official readme.txt

blocks-detector-finder/blocks-detector-finder.php Passed 13 tests

The entry point to "Blocks Detector Finder" version 1.0.0 is a PHP file that has certain tags in its header comment area
112 characters long description:
Detect / Find Gutenberg Blocks used on pages, also detect not used Gutenberg Blocks or Missing Gutenberg Blocks.

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
Good job! No executable or dangerous file extensions detected3,845 lines of code in 48 files:
LanguageFilesBlank linesComment linesLines of code
PHP391,2541,3193,500
JavaScript593110253
CSS310883
HTML1209

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity13.42
▷ Minimum class complexity1.00
▷ Maximum class complexity51.00
Average method complexity3.36
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes19
▷ Abstract classes00.00%
▷ Concrete classes19100.00%
▷ Final classes00.00%
Methods100
▷ Static methods33.00%
▷ Public methods9292.00%
▷ Protected methods11.00%
▷ Private methods77.00%
Functions82
▷ Named functions82100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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 images were found in this plugin