87% aco-currency-switcher-for-woocommerce

Code Review | Aco Currency Switcher for WooCommerce

WordPress plugin Aco Currency Switcher for WooCommerce scored 87% from 54 tests.

About plugin

  • Plugin page: aco-currency-swit...
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-5.9.2
  • WordPress version: 5.9.2
  • First release: Sep 9, 2021
  • Latest release: Mar 13, 2022
  • Number of updates: 6
  • Update frequency: every 33.5 days
  • Top authors: acowebscd (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 244 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼293.15ms] Passed 4 tests

Analyzing server-side resources used by Aco Currency Switcher for WooCommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0168.28 ▲3.01
Dashboard /wp-admin3.42 ▲0.0243.12 ▼3.28
Posts /wp-admin/edit.php3.65 ▲0.0141.94 ▼3.84
Add New Post /wp-admin/post-new.php6.90 ▼0.07105.15 ▼1,159.26
Media Library /wp-admin/upload.php3.30 ▲0.0032.20 ▼6.22

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 301 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Aco Currency Switcher for WooCommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,794 ▲5215.96 ▲0.228.24 ▲1.212.67 ▼0.48
Dashboard /wp-admin2,899 ▲416.16 ▲0.06136.06 ▼28.10176.35 ▼10.06
Posts /wp-admin/edit.php2,694 ▲33.23 ▼0.1369.04 ▼9.59156.96 ▼19.34
Add New Post /wp-admin/post-new.php1,673 ▲4820.48 ▼0.43549.70 ▼1.78185.74 ▼0.62
Media Library /wp-admin/upload.php1,706 ▲115.48 ▼0.02185.56 ▲16.11233.70 ▼0.23

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/aco-currency-switcher-for-woocommerce/includes/class-acowcs-fixedamount.php
    • > /wp-content/plugins/aco-currency-switcher-for-woocommerce/includes/class-acowcs-fixeduser.php
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/aco-currency-switcher-for-woocommerce/aco-woo-currency-switcher.php:20
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/aco-currency-switcher-for-woocommerce/view/switcher.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_product() in wp-content/plugins/aco-currency-switcher-for-woocommerce/view/calculator.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_woocommerce_currencies() in wp-content/plugins/aco-currency-switcher-for-woocommerce/view/acowcs_widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/aco-currency-switcher-for-woocommerce/view/variation-metabox.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/aco-currency-switcher-for-woocommerce/includes/class-acowcs-widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_woocommerce_currencies() in wp-content/plugins/aco-currency-switcher-for-woocommerce/view/shortcode.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found


Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
  • Donate link: Please fix this invalid url: ""
You can look at the official readme.txt

aco-currency-switcher-for-woocommerce/aco-woo-currency-switcher.php 92% from 13 tests

The main file in "Aco Currency Switcher for WooCommerce" v. 1.0.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
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 ("aco-currency-switcher-for-woocommerce.php" instead of "aco-woo-currency-switcher.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin5,377 lines of code in 293 files:
LanguageFilesBlank linesComment linesLines of code
PO File2164191356

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 138)
Cyclomatic complexity
Average complexity per logical line of code0.68
Average class complexity86.88
▷ Minimum class complexity2.00
▷ Maximum class complexity346.00
Average method complexity6.50
▷ Minimum method complexity1.00
▷ Maximum method complexity138.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
▷ Static methods54.76%
▷ Public methods9186.67%
▷ Protected methods00.00%
▷ Private methods1413.33%
▷ Named functions720.00%
▷ Anonymous functions2880.00%
▷ Global constants6100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected