78% terms-block

Code Review | Terms Block

WordPress plugin Terms Block scored78%from 54 tests.

About plugin

  • Plugin page: terms-block
  • Plugin version: 2.1.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 18, 2020
  • Latest release: Sep 6, 2023
  • Number of updates: 12
  • Update frequency: every 90.3 days
  • Top authors: hamworks (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,983 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼5.17ms] Passed 4 tests

Server-side resources used by Terms Block
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1441.02 ▼4.18
Dashboard /wp-admin3.43 ▲0.1352.80 ▲1.64
Posts /wp-admin/edit.php3.55 ▲0.1951.25 ▼5.73
Add New Post /wp-admin/post-new.php6.02 ▲0.13101.20 ▼12.40
Media Library /wp-admin/upload.php3.36 ▲0.1244.20 ▲8.93

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 1,967 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

Terms Block: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲5314.27 ▼0.072.31 ▲0.4540.82 ▼4.42
Dashboard /wp-admin2,195 ▲215.63 ▲0.1194.77 ▼3.3841.70 ▼1.60
Posts /wp-admin/edit.php2,100 ▼02.00 ▲0.0142.69 ▲6.7139.18 ▲0.28
Add New Post /wp-admin/post-new.php1,689 ▲16322.01 ▼0.87619.04 ▼79.0727.68 ▼26.74
Media Library /wp-admin/upload.php1,400 ▲34.20 ▼0.07103.66 ▼15.5848.76 ▼0.11

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 3× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/terms-block/vendor/hamworks/wp-dynamic-block/tests/bootstrap.php
    • > /wp-content/plugins/terms-block/vendor/phpcompatibility/php-compatibility/phpunit-bootstrap.php
    • > /wp-content/plugins/terms-block/src/terms-block/template.php
  • 839× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Standards\\PSR2\\Sniffs\\Classes\\ClassDeclarationSniff' not found in wp-content/plugins/terms-block/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Classes/ClassDeclarationSniff.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPCSUtils\\AbstractSniffs\\AbstractArrayDeclarationSniff' not found in wp-content/plugins/terms-block/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Arrays/DuplicateArrayKeySniff.php:30
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/terms-block/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Core\\AbstractMethodUnitTest' not found in wp-content/plugins/terms-block/vendor/squizlabs/php_codesniffer/tests/Core/Tokenizer/UndoNamespacedNameSingleTokenTest.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'PHPCompatibility\\Sniff' not found in wp-content/plugins/terms-block/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NewNullableTypesSniff.php:29
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/terms-block/vendor/squizlabs/php_codesniffer/src/Standards/PEAR/Sniffs/Commenting/FunctionCommentSniff.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Sniffs\\AbstractVariableSniff' not found in wp-content/plugins/terms-block/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/Commenting/VariableCommentSniff.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'PHPCompatibility\\Sniffs\\InitialValue\ewConstantScalarExpressionsSniff' not found in wp-content/plugins/terms-block/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/InitialValue/NewHeredocSniff.php:37
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/terms-block/vendor/squizlabs/php_codesniffer/src/Standards/Generic/Sniffs/CodeAnalysis/ForLoopWithTestFunctionCallSniff.php:33
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/terms-block/vendor/phpcsstandards/phpcsextra/Universal/Sniffs/Lists/DisallowLongListSyntaxSniff.php:22

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 96% 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: gutenberg, block, term

terms-block/terms-block.php 92% from 13 tests

Analyzing the main PHP file in "Terms Block" version 2.1.0
The following require your attention:
  • Domain Path: The domain path folder was not found ("/languages")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected165,499 lines of code in 1,567 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,06225,18154,794110,417
JSON200031,587
XML2386071,0188,459
Pascal1303,2317,1186,576
Markdown161,50205,273
JavaScript657838982,360
CSS3318992665
XSD160130
Bourne Shell28032

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 478)
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity16.47
▷ Minimum class complexity1.00
▷ Maximum class complexity724.00
Average method complexity5.92
▷ Minimum method complexity1.00
▷ Maximum method complexity478.00
Code structure
Namespaces219
Interfaces3
Traits6
Classes894
▷ Abstract classes222.46%
▷ Concrete classes87297.54%
▷ Final classes15417.66%
Methods2,850
▷ Static methods2819.86%
▷ Public methods2,37583.33%
▷ Protected methods35012.28%
▷ Private methods1254.39%
Functions31
▷ Named functions26.45%
▷ Anonymous functions2993.55%
Constants213
▷ Global constants11855.40%
▷ Class constants9544.60%
▷ Public constants95100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin