83% woocommerce-multilingual

Code Review | WooCommerce Multilingual & Multicurrency with WPML

WordPress plugin WooCommerce Multilingual & Multicurrency with WPML scored83%from 54 tests.

About plugin

  • Plugin page: woocommerce-multi...
  • Plugin version: 5.2.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.3.1
  • WordPress version: 6.3.1
  • First release: Feb 6, 2012
  • Latest release: Oct 9, 2023
  • Number of updates: 1
  • Update frequency: every 365.0 days

Code review

54 tests

User reviews

302 reviews

Install metrics

100,000+ active /3,708,061 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
Installer ran successfully

Server metrics [RAM: ▲4.08MB] [CPU: ▲29.85ms] Passed 4 tests

Server-side resources used by WooCommerce Multilingual & Multicurrency with WPML
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.64 ▲2.1858.91 ▲18.97
Dashboard /wp-admin8.06 ▲4.7188.21 ▲24.34
Posts /wp-admin/edit.php8.11 ▲4.75100.19 ▲52.70
Add New Post /wp-admin/post-new.php10.64 ▲4.75121.65 ▲23.39
Media Library /wp-admin/upload.php7.92 ▲4.6892.08 ▲56.33
Installer Support /wp-admin/admin.php?page=otgs-installer-support7.9574.80

Server storage [IO: ▲12.52MB] [DB: ▲0.12MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 2,007 new files
Database: no new tables, 9 new options
New WordPress options
otgs_installer_products_urls_version
theysaidso_admin_options
widget_theysaidso_widget
otgs_installer_products_urls
wcml_currency_switcher_template_objects
widget_recent-comments
widget_recent-posts
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by WooCommerce Multilingual & Multicurrency with WPML
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6414.71 ▲0.521.53 ▼0.1236.74 ▼5.16
Dashboard /wp-admin2,219 ▲415.67 ▼0.0696.25 ▼3.1243.17 ▲3.50
Posts /wp-admin/edit.php2,125 ▲282.18 ▲0.1839.96 ▲5.0035.29 ▼0.09
Add New Post /wp-admin/post-new.php1,549 ▲2321.88 ▼1.05724.12 ▲54.7236.07 ▼17.67
Media Library /wp-admin/upload.php1,421 ▲244.39 ▲0.2198.85 ▲3.2441.01 ▼1.57
Installer Support /wp-admin/admin.php?page=otgs-installer-support1,0382.1029.5333.85

Uninstaller [IO: ▲0.00MB] [DB: ▲0.11MB] 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
  • Zombie WordPress options were found after uninstall: 8 options
    • can_compress_scripts
    • otgs_installer_products_urls
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • otgs_installer_products_urls_version

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
Everything seems fine, however this is by no means 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
The following issues need your attention
  • 626× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'WPML\\Auryn\\Reflector' not found in wp-content/plugins/woocommerce-multilingual/addons/wpml-dependencies/vendor/otgs/auryn/lib/StandardReflector.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'WPML\\Core\\Twig\\Loader\\LoaderInterface' not found in wp-content/plugins/woocommerce-multilingual/addons/wpml-dependencies/lib/lib/twig/lib/Twig/Loader/String.php:34
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woocommerce-multilingual/vendor/composer/installers/src/Composer/Installers/BonefishInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WPML\\Core\\Twig\odeVisitor\\AbstractNodeVisitor' not found in wp-content/plugins/woocommerce-multilingual/addons/wpml-dependencies/lib/lib/twig/src/NodeVisitor/OptimizerNodeVisitor.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/woocommerce-multilingual/inc/missing-php-functions.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'IWPML_Action' not found in wp-content/plugins/woocommerce-multilingual/compatibility/Aurum/MulticurrencyHooks.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WCML\\Compatibility\\ComponentFactory' not found in wp-content/plugins/woocommerce-multilingual/compatibility/Sensei/Factory.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/woocommerce-multilingual/vendor/composer/installers/src/Composer/Installers/CockpitInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WCML\\Compatibility\\ComponentFactory' not found in wp-content/plugins/woocommerce-multilingual/compatibility/WcSwatches/Factory.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'WPML\\Core\\Twig\\Extension\\AbstractExtension' not found in wp-content/plugins/woocommerce-multilingual/addons/wpml-dependencies/lib/lib/twig/src/Extension/SandboxExtension.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

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
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Currency switcher on the front-end), #2 (WooCommerce Multicurrency), #3 (Adding a currency), #4 (Adding currency switchers), #5 (Currency switcher options), #6 (Setting automatic exchange rates), #7 (Setting custom prices in different currencies), #8 (Setting custom shipping rates), #9 (WCML standalone mode)
The official readme.txt might help

woocommerce-multilingual/wpml-woocommerce.php 85% from 13 tests

The main file in "WooCommerce Multilingual & Multicurrency with WPML" v. 5.2.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woocommerce-multilingual.php" instead of "wpml-woocommerce.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 214 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin99,459 lines of code in 1,746 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,19216,72721,26468,415
PO File137,91611,37915,619
JavaScript1029662293,909
Markdown72,35403,185
Twig4823912,064
CSS378511,688
SVG327201,687
HTML230801,367
JSON800965
XML5135293
Handlebars3250178
make2471889

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity9.20
▷ Minimum class complexity1.00
▷ Maximum class complexity575.00
Average method complexity2.85
▷ Minimum method complexity1.00
▷ Maximum method complexity69.00
Code structure
Namespaces165
Interfaces60
Traits14
Classes1,078
▷ Abstract classes292.69%
▷ Concrete classes1,04997.31%
▷ Final classes30.29%
Methods5,195
▷ Static methods67613.01%
▷ Public methods4,29682.69%
▷ Protected methods2394.60%
▷ Private methods66012.70%
Functions659
▷ Named functions15223.07%
▷ Anonymous functions50776.93%
Constants371
▷ Global constants328.63%
▷ Class constants33991.37%
▷ Public constants339100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
133 PNG files occupy 2.45MB with 1.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/otgs/icons/plugin-icons/wpml/bpml/icon-256x256.png24.46KB10.48KB▼ 57.16%
addons/wpml-dependencies/vendor/otgs/icons/plugin-icons/wpml/wcml/icon-256x256.png24.19KB10.57KB▼ 56.30%
addons/wpml-dependencies/vendor/otgs/icons/plugin-icons/toolset/installer/icon-256.png7.59KB4.47KB▼ 41.06%
addons/wpml-dependencies/vendor/otgs/icons/plugin-icons/toolset/support/icon-256x256.png7.16KB4.33KB▼ 39.47%
vendor/otgs/icons/plugin-icons/wpml/bpml/icon-128x128.png10.72KB5.02KB▼ 53.21%