83% currencyconverter

Code Review | CurrencyConverter

WordPress plugin CurrencyConverter scored 83% from 54 tests.

About plugin

  • Plugin page: currencyconverter
  • Plugin version: 0.5.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Dec 26, 2015
  • Latest release: Jul 22, 2023
  • Number of updates: 55
  • Update frequency: every 50.3 days
  • Top authors: LB company (58.18%)korobochkin (43.64%)

Code review

54 tests

User reviews

3 reviews

Install metrics

1,000+ active / 15,070 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 gracefully, with no errors

Server metrics [RAM: ▲0.40MB] [CPU: ▼0.31ms] Passed 4 tests

A check of server-side resources used by CurrencyConverter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.3236.60 ▼5.99
Dashboard /wp-admin3.77 ▲0.4647.88 ▼7.61
Posts /wp-admin/edit.php3.82 ▲0.4650.75 ▲6.61
Add New Post /wp-admin/post-new.php6.30 ▲0.4296.76 ▲7.17
Media Library /wp-admin/upload.php3.62 ▲0.4042.99 ▲5.76
Currency /wp-admin/options-general.php?page=currencyconverter-general4.32191.85

Server storage [IO: ▲23.52MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 3,750 new files
Database: no new tables, 11 new options
New WordPress options
widget_recent-comments
currencyconverter_rates
widget_currencyconverter_table
currencyconverter
db_upgraded
widget_currencyconverter_minimalistic_ver2
widget_theysaidso_widget
can_compress_scripts
widget_currencyconverter_minimalistic
theysaidso_admin_options
...

Browser metrics Passed 4 tests

CurrencyConverter: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲9413.35 ▲0.131.83 ▼0.2740.92 ▼3.24
Dashboard /wp-admin2,210 ▲195.85 ▲0.9798.27 ▼7.9139.93 ▼3.81
Posts /wp-admin/edit.php2,093 ▲42.01 ▲0.0240.11 ▲4.6635.37 ▼0.83
Add New Post /wp-admin/post-new.php1,545 ▲1218.37 ▼5.02606.30 ▼66.5362.24 ▼7.76
Media Library /wp-admin/upload.php1,389 ▲44.18 ▲0.0196.65 ▼21.6340.73 ▼5.34
Currency /wp-admin/options-general.php?page=currencyconverter-general3,4691.7126.86227.98

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
The following items require your attention
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_currencyconverter_table
    • widget_currencyconverter_minimalistic
    • theysaidso_admin_options
    • widget_currencyconverter_minimalistic_ver2
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means 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 items
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/currencyconverter/source/Widgets/CurrencyMinimalistic2/Widget.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/currencyconverter/source/Widgets/CurrencyTable/Currency_Table.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Korobochkin\\CurrencyConverter\\add_action() in wp-content/plugins/currencyconverter/source/Plugin.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/currencyconverter/source/Widgets/CurrencyMinimalistic/Widget.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
The official readme.txt is a good inspiration

currencyconverter/plugin.php 85% from 13 tests

This is the main PHP file of "CurrencyConverter" version 0.5.4, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("currencyconverter.php" instead of "plugin.php")
  • Domain Path: The domain path folder does not exist ("/languages/")

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
Success! There were no dangerous files found in this plugin3,925 lines of code in 55 files:
LanguageFilesBlank linesComment linesLines of code
PHP476005653,532
CSS202265
JavaScript39969
JSON20056
Markdown1103

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity8.85
▷ Minimum class complexity1.00
▷ Maximum class complexity57.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces21
Interfaces0
Traits0
Classes40
▷ Abstract classes00.00%
▷ Concrete classes40100.00%
▷ Final classes00.00%
Methods157
▷ Static methods4931.21%
▷ Public methods13183.44%
▷ Protected methods10.64%
▷ Private methods2515.92%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2635 compressed PNG files occupy 2.32MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
libs/flags/flags-iso/shiny/24/CL.png0.68KB0.77KB0.00%
libs/flags/flags-iso/shiny/16/_british-antarctic-territory.png0.48KB0.55KB0.00%
libs/flags/flags-iso/shiny/32/MX.png1.06KB1.42KB0.00%
libs/flags/flags-iso/flat/24/UG.png0.25KB0.26KB0.00%
libs/flags/flags-iso/shiny/24/AR.png0.61KB0.78KB0.00%