78% empact-eu-uk-vat-automation

Code Review | Empact EU/UK VAT automation

WordPress plugin Empact EU/UK VAT automation scored78%from 54 tests.

About plugin

  • Plugin page: empact-eu-uk-vat-...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.0.1
  • WordPress version: 6.3.1
  • First release: Oct 28, 2022
  • Latest release: Dec 1, 2022
  • Number of updates: 14
  • Update frequency: every 3.1 days
  • Top authors: empactsystem (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /514 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.21MB] [CPU: ▼27.08ms] Passed 4 tests

Analyzing server-side resources used by Empact EU/UK VAT automation
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.11 ▲0.6539.94 ▲2.06
Dashboard /wp-admin3.71 ▲0.3631.27 ▼31.04
Posts /wp-admin/edit.php3.78 ▲0.4236.04 ▼10.53
Add New Post /wp-admin/post-new.php3.77 ▼2.1240.54 ▼57.98
Media Library /wp-admin/upload.php3.73 ▲0.5033.81 ▼8.75

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 47 new files
Database: no new tables, 8 new options
New WordPress options
ec_cron_sync_time
db_upgraded
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
ec_admin_dev_pwd

Browser metrics Passed 4 tests

An overview of browser requirements for Empact EU/UK VAT automation
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,895 ▲14913.59 ▼0.818.54 ▲6.6536.20 ▼9.89
Dashboard /wp-admin2,218 ▲334.86 ▼0.04106.94 ▲0.6538.58 ▼3.69
Posts /wp-admin/edit.php2,101 ▲122.02 ▲0.0139.32 ▲3.6135.58 ▼1.93
Add New Post /wp-admin/post-new.php1,524 ▼917.45 ▼5.60662.39 ▼21.4248.90 ▼3.05
Media Library /wp-admin/upload.php1,403 ▲124.22 ▼0.1998.70 ▼9.7941.79 ▼0.60

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 20 options
    • db_upgraded
    • ec_order_sync_enable
    • can_compress_scripts
    • ec_shop_id
    • widget_recent-comments
    • theysaidso_admin_options
    • ec_product_sync_enable
    • ec_cron_sync_time
    • ec_shop_name
    • widget_theysaidso_widget
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/empact-eu-uk-vat-automation/public/partials/empact-connect-public-display.php
  • 13× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/empact-eu-uk-vat-automation/admin/class-empact-connect-list-table-order.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/empact-eu-uk-vat-automation/admin/partials/Empact-EU-UK-VAT-Automation-admin-display.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/empact-eu-uk-vat-automation/admin/partials/tabs/payment_facilitator.php:1
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/empact-eu-uk-vat-automation/admin/class-empact-connect-list-table-order.php on line 3
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/empact-eu-uk-vat-automation/admin/partials/tabs/empact_connection.php:87
    • > PHP Notice
      Undefined variable: is_shop_verified in wp-content/plugins/empact-eu-uk-vat-automation/admin/partials/tabs/empact_connection.php on line 1
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/empact-eu-uk-vat-automation/admin/class-empact-connect-list-table-product.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/empact-eu-uk-vat-automation/admin/class-empact-connect-list-table-product.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_errors() in wp-content/plugins/empact-eu-uk-vat-automation/admin/partials/tabs/sync_setting.php:1
    • > PHP Fatal error
      Uncaught Error: Class 'Empact_Connect_Order_List_Table' not found in wp-content/plugins/empact-eu-uk-vat-automation/admin/partials/tabs/order_sync.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 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
Attributes that require attention:
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can take inspiration from this readme.txt

empact-eu-uk-vat-automation/Empact-EU-UK-VAT-Automation.php 85% from 13 tests

The entry point to "Empact EU/UK VAT automation" version 1.0.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("empact-eu-uk-vat-automation.php" instead of "Empact-EU-UK-VAT-Automation.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected8,387 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript11788503,958
PHP225579933,213
CSS673241,216

PHP code Passed 2 tests

Analyzing 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.29
Average class complexity28.67
▷ Minimum class complexity1.00
▷ Maximum class complexity144.00
Average method complexity3.37
▷ Minimum method complexity1.00
▷ Maximum method complexity58.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods140
▷ Static methods85.71%
▷ Public methods13395.00%
▷ Protected methods21.43%
▷ Private methods53.57%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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
2 PNG files occupy 0.23MB with 0.15MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/lib/intl-tel-input/img/flags@2x.png170.28KB68.04KB▼ 60.04%
admin/lib/intl-tel-input/img/flags.png69.20KB23.42KB▼ 66.16%