68% targetbay-product-and-site-reviews

Code Review | TargetBay Product and Site Reviews

WordPress plugin TargetBay Product and Site Reviews scored68%from 54 tests.

About plugin

  • Plugin page: targetbay-product...
  • Plugin version: 1.3.4
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.3
  • WordPress version: 6.3.1
  • First release: Feb 22, 2019
  • Latest release: Oct 6, 2023
  • Number of updates: 33
  • Update frequency: every 51.2 days
  • Top authors: targetbay (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /1,985 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼1.39ms] Passed 4 tests

A check of server-side resources used by TargetBay Product and Site Reviews
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0050.44 ▲7.62
Dashboard /wp-admin3.31 ▲0.0044.59 ▼3.58
Posts /wp-admin/edit.php3.36 ▲0.0045.03 ▼6.90
Add New Post /wp-admin/post-new.php5.89 ▲0.00109.07 ▲16.06
Media Library /wp-admin/upload.php3.23 ▲0.0032.28 ▼2.69

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 1,955 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

TargetBay Product and Site Reviews: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,814 ▲2814.34 ▲0.052.00 ▼0.1544.77 ▼0.90
Dashboard /wp-admin2,195 ▲245.56 ▼0.1187.00 ▼7.9836.95 ▼8.49
Posts /wp-admin/edit.php2,100 ▼01.96 ▼0.0236.46 ▼0.0534.56 ▼2.88
Add New Post /wp-admin/post-new.php1,526 ▼1123.15 ▲4.59619.68 ▼39.7555.33 ▼12.34
Media Library /wp-admin/upload.php1,400 ▲64.15 ▼0.0594.88 ▼7.1842.76 ▲1.45

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

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

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% 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
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/targetbay-product-and-site-reviews/vendor/phpcompatibility/php-compatibility/phpunit-bootstrap.php
  • 830× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PHPCompatibility\\AbstractNewFeatureSniff' not found in wp-content/plugins/targetbay-product-and-site-reviews/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/LanguageConstructs/NewLanguageConstructsSniff.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PHPCompatibility\\Sniff' not found in wp-content/plugins/targetbay-product-and-site-reviews/vendor/phpcompatibility/php-compatibility/PHPCompatibility/Sniffs/FunctionDeclarations/NonStaticMagicMethodsSniff.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Core\\AbstractMethodUnitTest' not found in wp-content/plugins/targetbay-product-and-site-reviews/vendor/squizlabs/php_codesniffer/tests/Core/File/GetMethodPropertiesTest.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/targetbay-product-and-site-reviews/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/PHP/CommentedOutCodeSniff.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Http\\Message\\StreamInterface' not found in wp-content/plugins/targetbay-product-and-site-reviews/vendor/guzzlehttp/psr7/src/BufferStream.php:17
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/targetbay-product-and-site-reviews/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/ControlStructures/SwitchDeclarationSniff.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/targetbay-product-and-site-reviews/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/WhiteSpace/OperatorSpacingSniff.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/targetbay-product-and-site-reviews/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Sniffs/CSS/ColourDefinitionSniff.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'PHP_CodeSniffer\\Tests\\Standards\\AbstractSniffUnitTest' not found in wp-content/plugins/targetbay-product-and-site-reviews/vendor/squizlabs/php_codesniffer/src/Standards/Squiz/Tests/Commenting/ClassCommentUnitTest.php:14
    • > PHP Fatal error
      Uncaught Error: Interface 'PHP_CodeSniffer\\Sniffs\\Sniff' not found in wp-content/plugins/targetbay-product-and-site-reviews/vendor/squizlabs/php_codesniffer/src/Standards/PSR2/Sniffs/Namespaces/NamespaceDeclarationSniff.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that need to be fixed:
  • Screenshots: Please add images for these screenshots: #1 (WooCommerce Product Review - Mobile View), #2 (WooCommerce Product Review - Web View), #3 (WooCommerce Q&A), #4 (WooCommerce Review Widgets), #5 (WooCommerce Rich Snippets)
The official readme.txt is a good inspiration

targetbay-product-and-site-reviews/targetbay-product-and-site-reviews.php 92% from 13 tests

"TargetBay Product and Site Reviews" version 1.3.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Domain Path: The domain path folder does not exist ("/languages")

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Please fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/targetbay-product-and-site-reviews/vendor/squizlabs/php_codesniffer/bin/phpcbf.bat
      • wp-content/plugins/targetbay-product-and-site-reviews/vendor/squizlabs/php_codesniffer/bin/phpcs.bat
152,568 lines of code in 1,538 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,08225,38051,349128,142
Markdown292,02906,874
Pascal1303,2177,0906,548
XML1764267795,986
JavaScript567568592,089
JSON20001,879
CSS3418992671
Bourne Shell2326138
XSD160130
YAML522391
DOS Batch241010
Dockerfile18010

PHP code 50% from 2 tests

This is a very shot review of cyclomatic complexity and code structure
It is recommended to fix the following
  • 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.86
▷ Minimum class complexity1.00
▷ Maximum class complexity721.00
Average method complexity5.53
▷ Minimum method complexity1.00
▷ Maximum method complexity478.00
Code structure
Namespaces205
Interfaces18
Traits3
Classes882
▷ Abstract classes202.27%
▷ Concrete classes86297.73%
▷ Final classes283.25%
Methods3,277
▷ Static methods2397.29%
▷ Public methods2,68181.81%
▷ Protected methods38111.63%
▷ Private methods2156.56%
Functions176
▷ Named functions7643.18%
▷ Anonymous functions10056.82%
Constants345
▷ Global constants19255.65%
▷ Class constants15344.35%
▷ Public constants153100.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
There are no PNG files in this plugin