84% currency-switcher-woocommerce

Code Review | Currency Switcher for WooCommerce

WordPress plugin Currency Switcher for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: currency-switcher...
  • Plugin version: 2.15.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-6.2
  • WordPress version: 6.3.1
  • First release: Jul 28, 2016
  • Latest release: Jul 8, 2023
  • Number of updates: 126
  • Update frequency: every 20.1 days
  • Top authors: algoritmika (63.49%)wpwham (37.3%)

Code review

54 tests

User reviews

42 reviews

Install metrics

10,000+ active /208,308 total downloads


Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼4.53ms] Passed 4 tests

An overview of server-side resources used by Currency Switcher for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0440.37 ▼1.76
Dashboard /wp-admin3.35 ▲0.0445.20 ▼4.45
Posts /wp-admin/edit.php3.40 ▲0.0449.68 ▼0.04
Add New Post /wp-admin/post-new.php5.93 ▲0.0488.23 ▼7.23
Media Library /wp-admin/upload.php3.27 ▲0.0435.60 ▼4.68

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 290 new files
Database: no new tables, 6 new options
New WordPress options

Browser metrics Passed 4 tests

An overview of browser requirements for Currency Switcher for WooCommerce
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.24 ▼1.341.77 ▼0.0843.80 ▲0.34
Dashboard /wp-admin2,206 ▲155.86 ▼0.04107.71 ▼7.9038.61 ▼5.86
Posts /wp-admin/edit.php2,089 ▼02.02 ▲0.0241.21 ▲6.2135.48 ▲0.10
Add New Post /wp-admin/post-new.php1,533 ▼022.92 ▼0.45654.80 ▼23.8356.73 ▲3.00
Media Library /wp-admin/upload.php1,391 ▲34.26 ▲0.0298.93 ▼0.2443.71 ▼3.17

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

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
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/currency-switcher-woocommerce/includes/functions/alg-switcher-functions.php:103
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/currency-switcher-woocommerce/includes/functions/alg-switcher-selector-functions.php:179

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test


Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: currency, currency switcher, multi currency, multicurrency, switcher

currency-switcher-woocommerce/currency-switcher-woocommerce.php Passed 13 tests

The main file in "Currency Switcher for WooCommerce" v. 2.15.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
34 characters long description:
Currency Switcher for WooCommerce.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected5,359 lines of code in 32 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.62
Average class complexity23.72
▷ Minimum class complexity2.00
▷ Maximum class complexity128.00
Average method complexity4.41
▷ Minimum method complexity1.00
▷ Maximum method complexity29.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes15.56%
▷ Static methods119.17%
▷ Public methods11898.33%
▷ Protected methods10.83%
▷ Private methods10.83%
▷ Named functions55100.00%
▷ Anonymous functions00.00%
▷ Global constants10100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
256 compressed PNG files occupy 0.13MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/flag-icons/no-flag.png0.56KB0.53KB▼ 5.24%