83% wc-multi-currency-switcher

Code Review | Woocommerce Currency Converter

WordPress plugin Woocommerce Currency Converter scored83%from 54 tests.

About plugin

  • Plugin page: wc-multi-currency...
  • Plugin version: 0.0.6
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-6.3
  • WordPress version: 6.3.1
  • First release: May 1, 2021
  • Latest release: Aug 11, 2023
  • Number of updates: 16
  • Update frequency: every 52.1 days
  • Top authors: xfinitysoft (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /910 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

Server-side resources used by Woocommerce Currency Converter
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.37 ▲0.60
Dashboard /wp-admin3.31 ▼0.0442.62 ▼28.01
Posts /wp-admin/edit.php3.36 ▲0.0047.17 ▲0.36
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.43 ▼9.44
Media Library /wp-admin/upload.php3.23 ▲0.0033.76 ▼1.44

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 18 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Woocommerce Currency Converter
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.34 ▼0.701.63 ▼0.2940.09 ▼0.38
Dashboard /wp-admin2,206 ▲184.85 ▼0.02108.12 ▼9.1042.26 ▼2.93
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0539.39 ▲1.6433.65 ▼1.75
Add New Post /wp-admin/post-new.php1,547 ▲3318.32 ▲0.51642.76 ▼34.6270.23 ▲20.82
Media Library /wp-admin/upload.php1,391 ▼04.20 ▼0.0197.65 ▲2.2743.14 ▲0.25

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wc-multi-currency-switcher/includes/class.xsmcs-widget.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
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
These attributes need to be fixed:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
You can take inspiration from this readme.txt

wc-multi-currency-switcher/multi-currency-switcher.php 77% from 13 tests

The entry point to "Woocommerce Currency Converter" version 0.0.6 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wc-multi-currency-switcher.php" instead of "multi-currency-switcher.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Requires at least: The required version number must match the one declared in readme.txt ("5.0" instead of "4.4.0")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin3,472 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript33451661,652
PHP111801531,609
CSS2160211

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity25.80
▷ Minimum class complexity8.00
▷ Maximum class complexity37.00
Average method complexity4.26
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods38
▷ Static methods00.00%
▷ Public methods3797.37%
▷ Protected methods00.00%
▷ Private methods12.63%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
No PNG files were detected