84% premium-blocks-for-gutenberg

Code Review | Premium Blocks for Gutenberg

WordPress plugin Premium Blocks for Gutenberg scored84%from 54 tests.

About plugin

  • Plugin page: premium-blocks-fo...
  • Plugin version: 2.1.10
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 6, 2018
  • Latest release: Nov 29, 2023
  • Number of updates: 155
  • Update frequency: every 13.5 days
  • Top authors: leap13 (100%)

Code review

54 tests

User reviews

35 reviews

Install metrics

2,000+ active /246,940 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲4.59MB] [CPU: ▲13.32ms] Passed 4 tests

Server-side resources used by Premium Blocks for Gutenberg
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /8.22 ▲4.7568.79 ▲25.76
Dashboard /wp-admin7.91 ▲4.5668.60 ▲5.56
Posts /wp-admin/edit.php8.02 ▲4.6671.72 ▲24.80
Add New Post /wp-admin/post-new.php10.44 ▲4.5593.79 ▼2.84
Media Library /wp-admin/upload.php7.83 ▲4.6062.04 ▲28.14

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 211 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
category_children
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for Premium Blocks for Gutenberg
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲8814.67 ▲0.282.13 ▲0.4444.79 ▼0.29
Dashboard /wp-admin2,216 ▲385.58 ▼0.1690.15 ▼22.7942.69 ▼4.33
Posts /wp-admin/edit.php2,118 ▲182.01 ▲0.0539.15 ▲3.3036.40 ▲1.50
Add New Post /wp-admin/post-new.php6,230 ▲4,70425.62 ▲2.671,086.31 ▲401.6237.13 ▼15.22
Media Library /wp-admin/upload.php1,415 ▲154.19 ▼0.0799.49 ▲4.5043.31 ▲2.15

Uninstaller [IO: ▲0.37MB] [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
These items require your attention
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • category_children

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
Everything seems fine, however this is by no means an exhaustive test

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
Almost there! Just fix the following items
  • 14× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_block_type() in wp-content/plugins/premium-blocks-for-gutenberg/blocks-config/instagram-feed-header/index.php:120
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_block_type() in wp-content/plugins/premium-blocks-for-gutenberg/blocks-config/price.php:319
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_block_type() in wp-content/plugins/premium-blocks-for-gutenberg/blocks-config/author.php:87
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_block_type() in wp-content/plugins/premium-blocks-for-gutenberg/blocks-config/icon-group.php:289
    • > PHP Warning
      Use of undefined constant PREMIUM_BLOCKS_PATH - assumed 'PREMIUM_BLOCKS_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/premium-blocks-for-gutenberg/admin/includes/pb-panel/class-pb-panel.php on line 9
    • > PHP Warning
      Use of undefined constant PREMIUM_BLOCKS_URL - assumed 'PREMIUM_BLOCKS_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/premium-blocks-for-gutenberg/admin/includes/pb-panel/class-pb-panel.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_block_type() in wp-content/plugins/premium-blocks-for-gutenberg/blocks-config/counter.php:203
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_block_type() in wp-content/plugins/premium-blocks-for-gutenberg/blocks-config/instagram-feed-posts/index.php:525
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_block_type() in wp-content/plugins/premium-blocks-for-gutenberg/blocks-config/image.php:292
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_block_type() in wp-content/plugins/premium-blocks-for-gutenberg/blocks-config/text.php:228

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
Attributes that require attention: The official readme.txt is a good inspiration

premium-blocks-for-gutenberg/premium-blocks-for-gutenberg.php Passed 13 tests

The main file in "Premium Blocks for Gutenberg" v. 2.1.10 serves as a complement to information provided in readme.txt and as the entry point to the plugin
96 characters long description:
Gutenberg blocks that will help you build amazing pages with the new WordPress Gutenberg editor.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin74,261 lines of code in 200 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript364,3055,00548,185
PHP602,5733,01813,124
JSON2725012,689
CSS4556101
SVG3128081
XML10081

PHP code 50% from 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 166)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity75.75
▷ Minimum class complexity4.00
▷ Maximum class complexity277.00
Average method complexity5.19
▷ Minimum method complexity1.00
▷ Maximum method complexity166.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes216.67%
Methods214
▷ Static methods2913.55%
▷ Public methods20495.33%
▷ Protected methods41.87%
▷ Private methods62.80%
Functions109
▷ Named functions10798.17%
▷ Anonymous functions21.83%
Constants15
▷ Global constants1493.33%
▷ Class constants16.67%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
admin/images/premium-blocks-logo.png5.17KB2.48KB▼ 51.99%