82% woocommerce-currency-switcher

Code Review | FOX - Currency Switcher Professional for WooCommerce

WordPress plugin FOX - Currency Switcher Professional for WooCommerce scored82%from 54 tests.

About plugin

  • Plugin page: woocommerce-curre...
  • Plugin version: 1.4.1.5
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: WP 4.9.0-6.4
  • WordPress version: 6.3.1
  • First release: Sep 20, 2014
  • Latest release: Nov 6, 2023
  • Number of updates: 596
  • Update frequency: every 5.6 days
  • Top authors: RealMag777 (100%)

Code review

54 tests

User reviews

222 reviews

Install metrics

60,000+ active /1,544,358 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲1.88MB] [CPU: ▲9.96ms] Passed 4 tests

Analyzing server-side resources used by FOX - Currency Switcher Professional for WooCommerce
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /5.38 ▲1.9159.57 ▲18.88
Dashboard /wp-admin5.22 ▲1.8859.02 ▼0.73
Posts /wp-admin/edit.php5.28 ▲1.9268.28 ▲21.51
Add New Post /wp-admin/post-new.php7.75 ▲1.86107.17 ▲0.18
Media Library /wp-admin/upload.php5.08 ▲1.8553.32 ▲22.06

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 210 new files
Database: no new tables, 67 new options
New WordPress options
woocs_customer_price_format
woocs_rate_auto_update_email
woocs_show_money_signs
widget_recent-posts
woocs_show_approximate_amount
woocs_show_approximate_price
woocs_is_fixed_enabled
woocs_auto_switcher_side
woocs_schema_in_current_currency
woocs_force_pay_bygeoip_rules
...

Browser metrics Passed 4 tests

FOX - Currency Switcher Professional for WooCommerce: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,817 ▲7014.16 ▲0.031.96 ▲0.2541.27 ▼1.56
Dashboard /wp-admin2,200 ▲265.58 ▼0.0492.53 ▼6.7938.30 ▼4.77
Posts /wp-admin/edit.php2,126 ▲262.30 ▲0.3642.91 ▲1.0735.59 ▼1.16
Add New Post /wp-admin/post-new.php1,539 ▲1323.19 ▲0.02680.24 ▲1.5060.27 ▼0.91
Media Library /wp-admin/upload.php1,419 ▲164.36 ▲0.2098.17 ▼6.6242.21 ▼2.54

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin does not fully uninstall, leaving 67 options in the database
    • theysaidso_admin_options
    • woocs_drop_down_view
    • woocs_customer_price_format
    • db_upgraded
    • woocs_disable_reset_currency_bots
    • woocs_rate_auto_update_email
    • widget_woocs_rates
    • woocs_schema_in_current_currency
    • widget_theysaidso_widget
    • widget_woocs_converter
    • ...

Smoke tests 75% 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 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 items
  • 39× PHP files perform the task of outputting text when accessed with GET requests (only 10 are shown):
    • > /wp-content/plugins/woocommerce-currency-switcher/views/shortcodes/styles/style-3/index.php
    • > /wp-content/plugins/woocommerce-currency-switcher/classes/widgets/widget-currency-converter.php
    • > /wp-content/plugins/woocommerce-currency-switcher/views/plugin_options_1.php
    • > /wp-content/plugins/woocommerce-currency-switcher/views/widgets/selector.php
    • > /wp-content/plugins/woocommerce-currency-switcher/views/auto_switcher/round_select.php
    • > /wp-content/plugins/woocommerce-currency-switcher/views/widgets/converter_form.php
    • > /wp-content/plugins/woocommerce-currency-switcher/classes/fixed/fixed_shipping.php
    • > /wp-content/plugins/woocommerce-currency-switcher/views/shortcodes/woocs.php
    • > /wp-content/plugins/woocommerce-currency-switcher/views/plugin_options_2.php
    • > /wp-content/plugins/woocommerce-currency-switcher/classes/auto_switcher.php

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots lack descriptions #10, #11, #12, #13, #14, #15, #16, #17, #18, #19, #2, #20, #21, #22, #23, #24, #25, #26, #27, #28, #29, #3, #30, #31, #32, #33, #34, #35, #36, #37, #38, #39, #4, #40, #41, #5, #6, #7, #8, #9 in woocommerce-currency-switcher/assets to your readme.txt
You can take inspiration from this readme.txt

woocommerce-currency-switcher/index.php 77% from 13 tests

Analyzing the main PHP file in "FOX - Currency Switcher Professional for WooCommerce" version 1.4.1.5
It is important to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 175 characters long)
  • Requires at least: Please use periods and digits for the required version (ex. "7.0" instead of "WP 4.9.0")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("woocommerce-currency-switcher.php" instead of "index.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected42,539 lines of code in 146 files:
LanguageFilesBlank linesComment linesLines of code
PHP522,70980615,615
CSS281,47028211,072
JavaScript371,2062538,453
PO File31,3981,2603,642
SVG5001,949
Sass20452981,711
Markdown148097

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 1,163)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 175)
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity63.88
▷ Minimum class complexity1.00
▷ Maximum class complexity1,163.00
Average method complexity5.67
▷ Minimum method complexity1.00
▷ Maximum method complexity175.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes726.92%
Methods329
▷ Static methods00.00%
▷ Public methods31595.74%
▷ Protected methods10.30%
▷ Private methods133.95%
Functions44
▷ Named functions1738.64%
▷ Anonymous functions2761.36%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
50 PNG files occupy 1.13MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/woocs-options-1.png56.07KB20.12KB▼ 64.12%
img/woof_banner_old.png29.91KB12.00KB▼ 59.88%
img/woobe_banner.png46.74KB46.76KB0.00%
js/wselect/img/arrow-down.png0.42KB0.45KB0.00%
img/woocs_banner-old2.png63.08KB63.15KB0.00%