84% x-currency

Code Review | X-Currency - The Ultimate WooCommerce currency switcher for a smoother shopping experience

WordPress plugin X-Currency - The Ultimate WooCommerce currency switcher for a smoother shopping experience scored84%from 54 tests.

About plugin

  • Plugin page: x-currency
  • Plugin version: 1.4.6
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.2-6.4
  • WordPress version: 6.3.1
  • First release: Mar 31, 2022
  • Latest release: Nov 10, 2023
  • Number of updates: 44
  • Update frequency: every 13.4 days
  • Top authors: doatkolom (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

400+ active /5,994 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.12MB] [CPU: ▼4.18ms] Passed 4 tests

A check of server-side resources used by X-Currency - The Ultimate WooCommerce currency switcher for a smoother shopping experience
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1236.96 ▼3.08
Dashboard /wp-admin3.42 ▲0.1246.00 ▼2.37
Posts /wp-admin/edit.php3.53 ▲0.1848.06 ▲7.26
Add New Post /wp-admin/post-new.php6.00 ▲0.1288.25 ▼9.17
Media Library /wp-admin/upload.php3.34 ▲0.1134.12 ▼2.09

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 238 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by X-Currency - The Ultimate WooCommerce currency switcher for a smoother shopping experience
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲7014.20 ▲0.012.02 ▲0.0741.47 ▼3.67
Dashboard /wp-admin2,215 ▲415.69 ▼0.0187.50 ▼3.9944.12 ▲2.83
Posts /wp-admin/edit.php2,121 ▲212.01 ▲0.0540.93 ▼0.2436.70 ▲1.29
Add New Post /wp-admin/post-new.php1,538 ▲323.13 ▼2.08692.12 ▲50.7058.49 ▼1.38
Media Library /wp-admin/upload.php1,411 ▲174.20 ▲0.02108.52 ▼7.2645.22 ▲1.95

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

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
  • 97× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function x_currency_version() in wp-content/plugins/x-currency/enqueues/frontend-enqueue.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'XCurrency\\WaxFramework\\Database\\Eloquent\\Relations\\Relation' not found in wp-content/plugins/x-currency/vendor/vendor-src/waxframework/database/src/Eloquent/Relations/BelongsToOne.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'XCurrency\\WaxFramework\\Contracts\\Provider' not found in wp-content/plugins/x-currency/app/Providers/ShortCodeServiceProvider.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'XCurrency\\DI\\Definition\\Source\\DefinitionSource' not found in wp-content/plugins/x-currency/vendor/vendor-src/php-di/php-di/src/Definition/Source/SourceCache.php:13
    • > PHP Fatal error
      Uncaught Error: Interface 'XCurrency\\DI\\Definition\\Source\\DefinitionSource' not found in wp-content/plugins/x-currency/vendor/vendor-src/php-di/php-di/src/Definition/Source/ReflectionBasedAutowiring.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'XCurrency\\WaxFramework\\Database\\Eloquent\\Relations\\Relation' not found in wp-content/plugins/x-currency/vendor/vendor-src/waxframework/database/src/Eloquent/Relations/HasOne.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'XCurrency\\Laravel\\SerializableClosure\\Contracts\\Serializable' not found in wp-content/plugins/x-currency/vendor/vendor-src/laravel/serializable-closure/src/Serializers/Native.php:16
    • > PHP Fatal error
      Uncaught Error: Interface 'XCurrency\\DI\\Factory\\RequestedEntry' not found in wp-content/plugins/x-currency/vendor/vendor-src/php-di/php-di/src/Compiler/RequestedEntryHolder.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'XCurrency\\WaxFramework\\Database\\Eloquent\\Model' not found in wp-content/plugins/x-currency/app/Models/UserMeta.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'XCurrency\\DI\\Definition\\Source\\DefinitionSource' not found in wp-content/plugins/x-currency/vendor/vendor-src/php-di/php-di/src/Definition/Source/AnnotationBasedAutowiring.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% 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
Please fix the following attributes:
  • Screenshots: Add descriptions for screenshots #1, #2, #3 in x-currency/assets to your readme.txt
  • Tags: You are using too many tags: 14 tag instead of maximum 10
You can look at the official readme.txt

x-currency/x-currency.php Passed 13 tests

The main PHP file in "X-Currency - The Ultimate WooCommerce currency switcher for a smoother shopping experience" ver. 1.4.6 adds more information about the plugin and also serves as the entry point for this plugin
112 characters long description:
Currency Switcher for WooCommerce custom currency, exchange rates, currency by country, pay in selected currency

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected12,066 lines of code in 213 files:
LanguageFilesBlank linesComment linesLines of code
PHP1921,0854,03511,108
JSON900454
SVG202237
JavaScript640172
CSS34271
HTML11024

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity10.10
▷ Minimum class complexity1.00
▷ Maximum class complexity318.00
Average method complexity2.74
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces51
Interfaces20
Traits0
Classes146
▷ Abstract classes64.11%
▷ Concrete classes14095.89%
▷ Final classes32.14%
Methods761
▷ Static methods7910.38%
▷ Public methods63783.71%
▷ Protected methods638.28%
▷ Private methods618.02%
Functions73
▷ Named functions3142.47%
▷ Anonymous functions4257.53%
Constants17
▷ Global constants529.41%
▷ Class constants1270.59%
▷ Public constants1083.33%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
11 compressed PNG files occupy 0.32MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/blur-bg.4f33a9ac.png105.25KB109.19KB0.00%
media/switchers/2/preview.png6.91KB6.92KB0.00%
media/switchers/4/preview.png8.16KB8.49KB0.00%
media/common/bitmap.png39.96KB10.84KB▼ 72.87%
media/switchers/1/preview.png8.75KB8.93KB0.00%