84% template-part-block

Code Review | Template Part Block

WordPress plugin Template Part Block scored84%from 54 tests.

About plugin

  • Plugin page: template-part-block
  • Plugin version: 1.1.1
  • PHP compatiblity: 7.0.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.9.2
  • WordPress version: 6.3.1
  • First release: Apr 6, 2022
  • Latest release: Apr 7, 2022
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: cloudcatch (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /255 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼6.21ms] Passed 4 tests

An overview of server-side resources used by Template Part Block
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0441.38 ▼1.42
Dashboard /wp-admin3.34 ▲0.0452.44 ▼3.87
Posts /wp-admin/edit.php3.40 ▲0.0451.85 ▼5.10
Add New Post /wp-admin/post-new.php5.94 ▲0.0588.28 ▼14.45
Media Library /wp-admin/upload.php3.27 ▲0.0440.32 ▲2.11

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 130 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Template Part Block
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.72 ▲0.191.97 ▲0.1542.04 ▼0.98
Dashboard /wp-admin2,195 ▲155.58 ▼0.0783.79 ▼10.2441.40 ▼6.15
Posts /wp-admin/edit.php2,103 ▲32.03 ▲0.0642.64 ▲2.5338.08 ▲2.20
Add New Post /wp-admin/post-new.php6,193 ▲4,66518.99 ▼4.05927.24 ▲265.3757.93 ▼5.24
Media Library /wp-admin/upload.php1,400 ▲34.28 ▲0.0697.71 ▼16.8843.30 ▼4.96

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not 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
Please fix the following items
  • 87× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/template-part-block/vendor/monolog/monolog/src/Monolog/Processor/WebProcessor.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Formatter\ormalizerFormatter' not found in wp-content/plugins/template-part-block/vendor/monolog/monolog/src/Monolog/Formatter/JsonFormatter.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/template-part-block/vendor/monolog/monolog/src/Monolog/Handler/NullHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Processor\\ProcessorInterface' not found in wp-content/plugins/template-part-block/vendor/monolog/monolog/src/Monolog/Processor/ProcessIdProcessor.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/template-part-block/vendor/monolog/monolog/src/Monolog/Handler/RollbarHandler.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\SocketHandler' not found in wp-content/plugins/template-part-block/vendor/monolog/monolog/src/Monolog/Handler/FleepHookHandler.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractSyslogHandler' not found in wp-content/plugins/template-part-block/vendor/monolog/monolog/src/Monolog/Handler/SyslogHandler.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'Monolog\\Handler\\HandlerInterface' not found in wp-content/plugins/template-part-block/vendor/monolog/monolog/src/Monolog/Handler/AbstractHandler.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractHandler' not found in wp-content/plugins/template-part-block/vendor/monolog/monolog/src/Monolog/Handler/FingersCrossedHandler.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Monolog\\Handler\\AbstractProcessingHandler' not found in wp-content/plugins/template-part-block/vendor/monolog/monolog/src/Monolog/Handler/ChromePHPHandler.php:25

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: block, query, gutenberg

template-part-block/wp-block-template-part.php 85% from 13 tests

"Template Part Block" version 1.1.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("template-part-block.php" instead of "wp-block-template-part.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
No dangerous file extensions were detected7,435 lines of code in 125 files:
LanguageFilesBlank linesComment linesLines of code
PHP1221,8725,0857,262
JSON200172
JavaScript1011

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity9.21
▷ Minimum class complexity1.00
▷ Maximum class complexity47.00
Average method complexity2.49
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces14
Interfaces9
Traits4
Classes99
▷ Abstract classes77.07%
▷ Concrete classes9292.93%
▷ Final classes00.00%
Methods645
▷ Static methods517.91%
▷ Public methods44468.84%
▷ Protected methods14522.48%
▷ Private methods568.68%
Functions29
▷ Named functions1034.48%
▷ Anonymous functions1965.52%
Constants58
▷ Global constants35.17%
▷ Class constants5594.83%
▷ Public constants55100.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