56% wp-blocks-hub

Code Review | WP Blocks Hub

WordPress plugin WP Blocks Hub scored 56% from 54 tests.

About plugin

  • Plugin page: wp-blocks-hub
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.0-5.3.0
  • WordPress version: 6.3.1
  • First release: Nov 17, 2019
  • Latest release: Jan 3, 2020
  • Number of updates: 4
  • Update frequency: every 13.5 days
  • Top authors: wpblockshub (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

60+ active / 1,938 total downloads

Benchmarks

Plugin footprint 82% 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.25MB] [CPU: ▼12.24ms] 75% from 4 tests

A check of server-side resources used by WP Blocks Hub
Please fix the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 5,046.09ms on /wp-admin/admin.php?page=wp-blocks-hub-settings)
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4738.59 ▲0.34
Dashboard /wp-admin3.78 ▲0.4849.53 ▼2.67
Posts /wp-admin/edit.php3.83 ▲0.4848.47 ▲3.79
Add New Post /wp-admin/post-new.php5.51 ▼0.3850.88 ▼50.40
Media Library /wp-admin/upload.php3.64 ▲0.4238.87 ▲4.20
All Posts /wp-admin/edit.php?post_type=testimonial_post3.7941.83
My Blocks /wp-admin/admin.php?page=wp-blocks-hub-my-blocks3.6437.05
Add Benefit /wp-admin/post-new.php?post_type=benefit_post4.1656.62
All People /wp-admin/edit.php?post_type=person_post3.7537.89
Categories /wp-admin/edit-tags.php?taxonomy=testimonial_cat&post_type=testimonial_post3.6437.15
Categories /wp-admin/edit-tags.php?taxonomy=portfolio_cat&post_type=portfolio_post3.6439.61
Settings /wp-admin/admin.php?page=wp-blocks-hub-settings3.795,046.09
Hub /wp-admin/admin.php?page=wp-blocks-hub3.6534.81
Add Post /wp-admin/post-new.php?post_type=testimonial_post3.8655.72
Add Post /wp-admin/post-new.php?post_type=portfolio_post3.8757.33

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 367 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for WP Blocks Hub
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,033 ▲29813.41 ▼0.891.77 ▼0.0641.35 ▼1.19
Dashboard /wp-admin2,415 ▲2275.97 ▲0.07101.73 ▲4.5644.47 ▲3.32
Posts /wp-admin/edit.php2,308 ▲2162.44 ▲0.4441.56 ▲5.2135.79 ▲6.79
Add New Post /wp-admin/post-new.php1,667 ▲13823.37 ▲5.05686.75 ▲65.4855.50 ▲2.66
Media Library /wp-admin/upload.php1,606 ▲2214.42 ▲0.23102.44 ▲7.5245.54 ▲2.31
All Posts /wp-admin/edit.php?post_type=testimonial_post1,3452.4339.8433.73
My Blocks /wp-admin/admin.php?page=wp-blocks-hub-my-blocks1,1872.4944.3537.74
Add Benefit /wp-admin/post-new.php?post_type=benefit_post2,7787.97190.6172.30
All People /wp-admin/edit.php?post_type=person_post1,3452.4139.0732.45
Categories /wp-admin/edit-tags.php?taxonomy=testimonial_cat&post_type=testimonial_post1,5242.3441.3931.82
Categories /wp-admin/edit-tags.php?taxonomy=portfolio_cat&post_type=portfolio_post1,5242.3340.0831.96
Settings /wp-admin/admin.php?page=wp-blocks-hub-settings4,8574.89357.01190.38
Hub /wp-admin/admin.php?page=wp-blocks-hub1,1912.3144.4431.33
Add Post /wp-admin/post-new.php?post_type=testimonial_post2,6377.89172.3066.69
Add Post /wp-admin/post-new.php?post_type=portfolio_post2,7978.13167.6072.01

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=wp-blocks-hub-settings
    • > Notice in wp-content/plugins/wp-blocks-hub/App/Helper/Utils.php+26
    Trying to access array offset on value of type int
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-blocks-hub-settings
    • > Deprecated in wp-content/plugins/wp-blocks-hub/App/Helper/Utils.php+79
    implode(): Passing glue string after array is deprecated. Swap the parameters

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
Please take a closer look at the following
  • 5× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-blocks-hub/App/View/Backend/Settings/Pages/Hub/Tags.php
    • > /wp-content/plugins/wp-blocks-hub/App/View/Backend/Popup.php
    • > /wp-content/plugins/wp-blocks-hub/App/View/Backend/Settings/Pages/Hub/Categories.php
    • > /wp-content/plugins/wp-blocks-hub/App/View/Backend/Settings/Pages/Hub/Compatibility.php
    • > /wp-content/plugins/wp-blocks-hub/App/View/Backend/Settings/Footer.php
  • 81× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/wp-blocks-hub/App/View/Backend/CPT/Col_Id.php on line 7
    • > PHP Fatal error
      Uncaught Error: Class 'WPBlocksHub\\Model\\Database' not found in wp-content/plugins/wp-blocks-hub/App/Model/Cache.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-blocks-hub/App/View/Backend/Pointers/WelcomePointer.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function WPBH() in wp-content/plugins/wp-blocks-hub/App/View/Backend/Settings/Pages/My_Blocks.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-blocks-hub/App/View/Backend/Pointers/Tour/Step2.php:1
    • > PHP Notice
      Trying to get property 'tags' of non-object in wp-content/plugins/wp-blocks-hub/App/View/Backend/Settings/Pages/Hub/Tags.php on line 10
    • > PHP Notice
      Trying to get property 'blocks' of non-object in wp-content/plugins/wp-blocks-hub/App/View/Backend/Settings/Pages/Hub/Blocks.php on line 5
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/wp-blocks-hub/vendor/scssphp/scssphp/src/Formatter/Debug.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-blocks-hub/App/View/Backend/Settings/Pages/Settings/Custom_Code.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'ScssPhp\\ScssPhp\\Formatter' not found in wp-content/plugins/wp-blocks-hub/vendor/scssphp/scssphp/src/Formatter/Expanded.php:22

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There are user-side issues you should fix
  • 23 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-blocks-hub-settings
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.defaultLabel is deprecated since version 5.5.0! Use wp.i18n instead.
  • 23 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-blocks-hub-settings
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.pick is deprecated since version 5.5.0! Use wp.i18n instead.
  • 23 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-blocks-hub-settings
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.clear is deprecated since version 5.5.0! Use wp.i18n instead.
  • 23 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wp-blocks-hub-settings
    • > Console-api (warning) in wp-admin/js/common.min.js?ver=6.3.1+1:283
    wpColorPickerL10n.clearAriaLabel is deprecated since version 5.5.0! Use wp.i18n instead.
    • > GET request to /wp-admin/admin.php?page=wp-blocks-hub-settings
    • > Network (severe)
    https://fonts.googleapis.com/css?family= - Failed to load resource: the server responded with a status of 400 ()

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: gutenberg-blocks, block, elementor, shortcode, blocks

wp-blocks-hub/wp-blocks-hub.php 92% from 13 tests

The main PHP file in "WP Blocks Hub" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 510 characters long)

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Please fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/wp-blocks-hub/vendor/bin/pscss.bat
37,526 lines of code in 310 files:
LanguageFilesBlank linesComment linesLines of code
PHP1364,4854,93114,642
CSS373,82011712,849
SVG1712134,601
PO File11,04510,2802,413
JavaScript955962861,623
Sass84561,016
JSON500213
Markdown6550115
XML22123
YAML10017
Bourne Shell13110
DOS Batch1004

PHP code 0% from 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Please fix the following
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 1,083)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 155)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity31.99
▷ Minimum class complexity1.00
▷ Maximum class complexity1,083.00
Average method complexity4.40
▷ Minimum method complexity1.00
▷ Maximum method complexity155.00
Code structure
Namespaces16
Interfaces0
Traits0
Classes77
▷ Abstract classes33.90%
▷ Concrete classes7496.10%
▷ Final classes00.00%
Methods683
▷ Static methods629.08%
▷ Public methods36653.59%
▷ Protected methods28341.43%
▷ Private methods344.98%
Functions34
▷ Named functions38.82%
▷ Anonymous functions3191.18%
Constants70
▷ Global constants11.43%
▷ Class constants6998.57%
▷ Public constants69100.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
6 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/libs/leaflet/images/layers-2x.png1.23KB1.67KB0.00%
assets/libs/leaflet/images/marker-icon-2x.png2.41KB2.52KB0.00%
assets/libs/leaflet/images/marker-shadow.png0.60KB1.16KB0.00%
assets/libs/leaflet/images/layers.png0.68KB1.05KB0.00%
assets/libs/swipebox/icons.png0.71KB0.43KB▼ 39.64%