84% currency-exchange-for-woocommerce

Code Review | Currency Exchange for WooCommerce

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

About plugin

  • Plugin page: currency-exchange...
  • Plugin version: 3.5.8
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Aug 15, 2016
  • Latest release: Sep 21, 2023
  • Number of updates: 65
  • Update frequency: every 40.0 days
  • Top authors: RazyRx (56.92%)dholovnia (44.62%)

Code review

54 tests

User reviews

23 reviews

Install metrics

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

Server metrics [RAM: ▲0.25MB] [CPU: ▲6.44ms] Passed 4 tests

This is a short check of server-side resources used by Currency Exchange for WooCommerce
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.72 ▲0.2639.87 ▼1.83
Dashboard /wp-admin3.55 ▲0.2558.86 ▲9.63
Posts /wp-admin/edit.php3.66 ▲0.3154.60 ▲5.92
Add New Post /wp-admin/post-new.php6.13 ▲0.25100.93 ▲12.03
Media Library /wp-admin/upload.php3.48 ▲0.2552.50 ▲19.33

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 156 new files
Database: no new tables, 8 new options
New WordPress options
berocket_admin_notices_rate_stars
theysaidso_admin_options
widget_recent-comments
db_upgraded
br_ce_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Currency Exchange for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,861 ▲12613.20 ▼1.181.65 ▼0.1741.27 ▼1.05
Dashboard /wp-admin2,239 ▲514.98 ▲0.06101.80 ▼16.1276.43 ▲34.24
Posts /wp-admin/edit.php2,130 ▲382.07 ▲0.0238.92 ▲1.1534.13 ▲0.71
Add New Post /wp-admin/post-new.php1,711 ▲16724.66 ▲6.57761.32 ▲126.5359.29 ▼0.80
Media Library /wp-admin/upload.php1,418 ▲334.18 ▲0.01111.85 ▲12.6788.42 ▲42.22

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 8 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • berocket_admin_notices_rate_stars
    • can_compress_scripts
    • berocket_key_activated_plugins
    • widget_recent-comments
    • widget_recent-posts

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
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 30× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/currency-exchange-for-woocommerce/berocket/includes/settings_fields.php:5
    • > PHP Notice
      Undefined variable: name in wp-content/plugins/currency-exchange-for-woocommerce/berocket/templates/conditions.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_woocommerce_currencies() in wp-content/plugins/currency-exchange-for-woocommerce/templates/currency_list.php:2
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/currency-exchange-for-woocommerce/berocket/templates/premium.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/currency-exchange-for-woocommerce/berocket/includes/admin_notices.php:797
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/currency-exchange-for-woocommerce/berocket/includes/updater.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/currency-exchange-for-woocommerce/berocket/includes/error_notices.php:5
    • > PHP Notice
      Undefined variable: title in wp-content/plugins/currency-exchange-for-woocommerce/berocket/templates/widget.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/currency-exchange-for-woocommerce/berocket/libraries/tutorial.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'ET_Builder_Module' not found in wp-content/plugins/currency-exchange-for-woocommerce/divi/includes/modules/brcurrencyItem/brcurrencyItem.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 31 tag instead of maximum 10
Please take inspiration from this readme.txt

currency-exchange-for-woocommerce/woocommerce-currency-exchange.php 92% from 13 tests

The entry point to "Currency Exchange for WooCommerce" version 3.5.8 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("currency-exchange-for-woocommerce.php" instead of "woocommerce-currency-exchange.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin21,496 lines of code in 78 files:
LanguageFilesBlank linesComment linesLines of code
CSS152,535779,836
PHP434941,3829,131
JavaScript1471871,939
PO File2194216430
JSX282121
XML20039

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity45.80
▷ Minimum class complexity1.00
▷ Maximum class complexity240.00
Average method complexity4.53
▷ Minimum method complexity1.00
▷ Maximum method complexity98.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes30
▷ Abstract classes00.00%
▷ Concrete classes30100.00%
▷ Final classes00.00%
Methods381
▷ Static methods15039.37%
▷ Public methods381100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions35
▷ Named functions35100.00%
▷ Anonymous functions00.00%
Constants8
▷ Global constants8100.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
57 compressed PNG files occupy 0.03MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
berocket/assets/css/mail.png2.59KB1.92KB▼ 26.02%
images/flag/COP.png0.12KB0.13KB0.00%
images/flag/HKD.png0.61KB0.58KB▼ 4.84%
images/flag/PYG.png0.31KB0.31KB▼ 1.55%
images/flag/MYR.png0.32KB0.31KB▼ 3.65%