83% woo-additional-terms

Code Review | Woo Additional Terms

WordPress plugin Woo Additional Terms scored83%from 54 tests.

About plugin

  • Plugin page: woo-additional-terms
  • Plugin version: 1.6.4
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9-6.3
  • WordPress version: 6.3.1
  • First release: Nov 28, 2016
  • Latest release: Aug 31, 2023
  • Number of updates: 51
  • Update frequency: every 48.3 days
  • Top authors: mahdiyazdani (100%)

Code review

54 tests

User reviews

9 reviews

Install metrics

1,000+ active /23,438 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
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▼7.94ms] Passed 4 tests

A check of server-side resources used by Woo Additional Terms
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1034.88 ▼5.18
Dashboard /wp-admin3.40 ▲0.0646.64 ▼13.64
Posts /wp-admin/edit.php3.52 ▲0.1646.99 ▲1.20
Add New Post /wp-admin/post-new.php6.00 ▲0.1287.83 ▼14.15
Media Library /wp-admin/upload.php3.33 ▲0.1039.52 ▲4.32

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 109 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Woo Additional Terms: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲10213.78 ▼0.611.63 ▼0.1332.80 ▼10.56
Dashboard /wp-admin2,251 ▲635.81 ▲0.7597.96 ▼10.6545.33 ▼1.77
Posts /wp-admin/edit.php2,137 ▲482.04 ▲0.0734.07 ▼1.9936.13 ▲4.48
Add New Post /wp-admin/post-new.php1,549 ▲923.26 ▼0.14673.19 ▼5.7156.66 ▼4.40
Media Library /wp-admin/upload.php1,433 ▲454.25 ▲0.0296.49 ▼3.5050.45 ▲5.48

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please fix the following
  • 21× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Woo_Additional_Terms\\Ajax\\Ajax' not found in wp-content/plugins/woo-additional-terms/src/Ajax/Rate.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'WC_Settings_Page' not found in wp-content/plugins/woo-additional-terms/src/Settings/Settings.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'Automattic\\WooCommerce\\Blocks\\Integrations\\IntegrationInterface' not found in wp-content/plugins/woo-additional-terms/src/WooCommerce/Block/Block.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Woo_Additional_Terms\\Ajax\\Ajax' not found in wp-content/plugins/woo-additional-terms/src/Ajax/OnBoarding.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerInterface' not found in wp-content/plugins/woo-additional-terms/src/Vendor/Pimple/Psr11/Container.php:37
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-additional-terms/src/Vendor/Pimple/Tests/ServiceIteratorTest.php:34
    • > PHP Fatal error
      Uncaught Error: Interface 'Psr\\Container\\ContainerInterface' not found in wp-content/plugins/woo-additional-terms/src/Vendor/Pimple/Psr11/ServiceLocator.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-additional-terms/src/Vendor/Pimple/Tests/PimpleTest.php:35
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit\\Framework\\TestCase' not found in wp-content/plugins/woo-additional-terms/src/Vendor/Pimple/Tests/PimpleServiceProviderInterfaceTest.php:35
    • > PHP Fatal error
      Uncaught Error: Interface 'Woo_Additional_Terms\\Vendor\\Pimple\\ServiceProviderInterface' not found in wp-content/plugins/woo-additional-terms/src/Vendor/Pimple/Tests/Fixtures/PimpleServiceProvider.php:32

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: terms of service, age verification, gdpr, i agree, terms and conditions...

woo-additional-terms/woo-additioanl-terms.php 77% from 13 tests

Analyzing the main PHP file in "Woo Additional Terms" version 1.6.4
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("woo-additional-terms.php" instead of "woo-additioanl-terms.php")
  • Description: The description should be shorter than 140 characters (currently 145 characters long)
  • Requires at least: The required version number did not match the one declared in readme.txt ("5.0" instead of "5.9")

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
There were no executable files found in this plugin8,433 lines of code in 100 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript141,2447304,180
PHP729352,9623,129
CSS1017224960
JSON100133
SVG20023
XML1008

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity4.70
▷ Minimum class complexity1.00
▷ Maximum class complexity48.00
Average method complexity1.92
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces21
Interfaces1
Traits0
Classes55
▷ Abstract classes712.73%
▷ Concrete classes4887.27%
▷ Final classes24.17%
Methods256
▷ Static methods3011.72%
▷ Public methods23190.23%
▷ Protected methods62.34%
▷ Private methods197.42%
Functions60
▷ Named functions23.33%
▷ Anonymous functions5896.67%
Constants9
▷ Global constants00.00%
▷ Class constants9100.00%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin