78% ultimate-gutenberg

Code Review | Ultimate Gutenberg - Custom Block Templates

WordPress plugin Ultimate Gutenberg - Custom Block Templates scored 78% from 54 tests.

About plugin

  • Plugin page: ultimate-gutenberg
  • Plugin version: 2.5.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.3
  • WordPress version: 5.9.2
  • First release: Sep 23, 2018
  • Latest release: Nov 23, 2019
  • Number of updates: 43
  • Update frequency: every 10.0 days
  • Top authors: kkikuchi1220 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 3,094 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲4.18MB] [CPU: ▼285.20ms] Passed 4 tests

This is a short check of server-side resources used by Ultimate Gutenberg - Custom Block Templates
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /8.26 ▲4.7473.12 ▲23.50
Dashboard /wp-admin8.28 ▲4.8756.65 ▲23.65
Posts /wp-admin/edit.php8.28 ▲4.6357.16 ▲17.14
Add New Post /wp-admin/post-new.php9.46 ▲2.4877.06 ▼1,198.38
Media Library /wp-admin/upload.php8.28 ▲4.9841.78 ▲16.93
Freemius Debug [v.2.3.1] /wp-admin/admin.php?page=freemius8.2841.24

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 1,895 new files
Database: no new tables, 4 new options
New WordPress options
fs_debug_mode
fs_gdpr
fs_active_plugins
fs_accounts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ultimate Gutenberg - Custom Block Templates
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,996 ▲27416.83 ▲0.859.72 ▲3.912.85 ▲0.30
Dashboard /wp-admin2,969 ▲1116.42 ▲0.03122.00 ▼11.86174.02 ▲12.55
Posts /wp-admin/edit.php2,767 ▲763.47 ▲0.0466.77 ▲4.95159.43 ▲16.91
Add New Post /wp-admin/post-new.php1,701 ▲1117.13 ▼3.66438.31 ▼5.15159.74 ▲0.18
Media Library /wp-admin/upload.php1,771 ▲735.80 ▲0.06137.83 ▲10.70211.98 ▲24.24
Freemius Debug [v.2.3.1] /wp-admin/admin.php?page=freemius1,4942.7056.84132.44

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 4 options in the database
    • fs_active_plugins
    • fs_gdpr
    • fs_debug_mode
    • fs_accounts

Smoke tests 50% 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 0% 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
Please fix the following items
  • 3× PHP files output text when accessed directly:
    • > /wp-content/plugins/ultimate-gutenberg/freemius/templates/ajax-loader.php
    • > /wp-content/plugins/ultimate-gutenberg/admin/partials/ultimate-gutenberg-admin-display.php
    • > /wp-content/plugins/ultimate-gutenberg/public/partials/ultimate-gutenberg-public-display.php
  • 12× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/ultimate-gutenberg/freemius/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/ultimate-gutenberg/freemius/templates/account/partials/addon.php on line 8
    • > PHP Fatal error
      require(): Failed opening required 'ULTIMATE_GUTENBERG_PATH/admin/plugin-info.php' (include_path='.:/usr/share/php') in wp-content/plugins/ultimate-gutenberg/admin/class-ultimate-gutenberg-admin.php on line 255
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ultimate-gutenberg/freemius/templates/account/partials/addon.php on line 7
    • > PHP Warning
      require(ULTIMATE_GUTENBERG_PATH/admin/plugin-info.php): failed to open stream: No such file or directory in wp-content/plugins/ultimate-gutenberg/admin/class-ultimate-gutenberg-admin.php on line 255
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/ultimate-gutenberg/freemius/templates/account/partials/addon.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ultimate-gutenberg/admin/plugin-info.php:8
    • > PHP Warning
      Use of undefined constant ULTIMATE_GUTENBERG_PATH - assumed 'ULTIMATE_GUTENBERG_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ultimate-gutenberg/admin/class-ultimate-gutenberg-admin.php on line 255
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/ultimate-gutenberg/freemius/templates/partials/network-activation.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/ultimate-gutenberg/freemius/templates/account/partials/addon.php on line 6

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 Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: classic editor, gutenberg, custom block

ultimate-gutenberg/ultimate-gutenberg.php Passed 13 tests

The main PHP file in "Ultimate Gutenberg - Custom Block Templates" ver. 2.5.1 adds more information about the plugin and also serves as the entry point for this plugin
72 characters long description:
Improve defalut Gutenberg Blocks and add tons of beatiful custom blocks.

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin167,682 lines of code in 1,827 files:
LanguageFilesBlank linesComment linesLines of code
JSON20057,600
PHP1196,98416,26929,599
YAML40023,764
PO File137,16810,95215,785
SVG1,60202415,346
JavaScript209725498,596
CSS313,511627,781
Sass18505344,626
LESS18502554,585

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
Please fix the following
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 2,710)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity72.89
▷ Minimum class complexity1.00
▷ Maximum class complexity2,710.00
Average method complexity4.43
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes53
▷ Abstract classes23.77%
▷ Concrete classes5196.23%
▷ Final classes00.00%
Methods1,145
▷ Static methods18015.72%
▷ Public methods80370.13%
▷ Protected methods151.31%
▷ Private methods32728.56%
Functions101
▷ Named functions10099.01%
▷ Anonymous functions10.99%
Constants128
▷ Global constants10178.91%
▷ Class constants2721.09%
▷ Public constants27100.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
3 PNG files occupy 0.14MB with 0.07MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/imgs/blocks/speak/ug-speak-sample.png118.64KB48.00KB▼ 59.54%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%