78% block-templates

Code Review | Gutenberg Templates

WordPress plugin Gutenberg Templates scored78%from 54 tests.

About plugin

  • Plugin page: block-templates
  • Plugin version: 1.0.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.0
  • WordPress version: 6.3.1
  • First release: Nov 21, 2018
  • Latest release: Nov 22, 2018
  • Number of updates: 8
  • Update frequency: every 0.1 days
  • Top authors: kmgalanakis (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /7,716 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
Install script ran successfully

Server metrics [RAM: ▼0.08MB] [CPU: ▼9.10ms] Passed 4 tests

An overview of server-side resources used by Gutenberg Templates
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1747.19 ▲4.24
Dashboard /wp-admin3.47 ▲0.1747.66 ▼4.71
Posts /wp-admin/edit.php3.59 ▲0.2351.75 ▲4.63
Add New Post /wp-admin/post-new.php5.06 ▼0.8353.13 ▼37.87
Media Library /wp-admin/upload.php3.40 ▲0.1635.27 ▲1.96
All Gutenberg Templates /wp-admin/edit.php?post_type=gutenberg-template3.4437.04
Add New /wp-admin/post-new.php?post_type=gutenberg-template5.0246.46

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Gutenberg Templates
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,824 ▲8913.29 ▼1.131.68 ▼0.2443.79 ▼0.60
Dashboard /wp-admin2,227 ▲395.91 ▲1.04108.80 ▼3.6239.64 ▼6.83
Posts /wp-admin/edit.php2,110 ▲212.05 ▲0.0439.85 ▲2.2235.13 ▲0.24
Add New Post /wp-admin/post-new.php6,253 ▲4,71121.58 ▲3.36823.69 ▲161.9153.36 ▼5.17
Media Library /wp-admin/upload.php1,415 ▲244.27 ▲0.0299.22 ▲0.4942.54 ▲0.01
All Gutenberg Templates /wp-admin/edit.php?post_type=gutenberg-template1,0932.0032.2829.61
Add New /wp-admin/post-new.php?post_type=gutenberg-template6,23420.73871.2332.40

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=gutenberg-template
    • > User deprecated in wp-includes/functions.php+5828
    Hook block_categories is deprecated since version 5.8.0! Use block_categories_all instead.

SRP 50% from 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
Please fix the following items
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant GBT_PATH - assumed 'GBT_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/block-templates/application/bootstrap.php on line 9
    • > PHP Fatal error
      require_once(): Failed opening required 'GBT_PATH/inc/autoload.php' (include_path='.:/usr/share/php') in wp-content/plugins/block-templates/application/bootstrap.php on line 9
    • > PHP Warning
      require_once(GBT_PATH/inc/autoload.php): failed to open stream: No such file or directory in wp-content/plugins/block-templates/application/bootstrap.php on line 9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
2 plugin tags: templates, gutenberg

block-templates/gutenberg_templates.php 85% from 13 tests

This is the main PHP file of "Gutenberg Templates" version 1.0.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 143 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("block-templates.php" instead of "gutenberg_templates.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin629 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP8179271627
CSS1001
JavaScript1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity19.80
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity4.07
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods29
▷ Static methods00.00%
▷ Public methods2896.55%
▷ Protected methods00.00%
▷ Private methods13.45%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants8
▷ Global constants337.50%
▷ Class constants562.50%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG images were found in this plugin