10% hnb-multi-currency-for-wpml

Code Review | HNB Multi Currency for WPML

WordPress plugin HNB Multi Currency for WPML scored10%from 54 tests.

About plugin

  • Plugin page: hnb-multi-currenc...
  • Plugin version: 1.1
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.3.2
  • WordPress version: 6.3.1
  • First release: Sep 3, 2019
  • Latest release: Jan 29, 2020
  • Number of updates: 10
  • Update frequency: every 14.8 days
  • Top authors: mariorendic (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /736 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
It is recommended to fix the following installer errors
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/hnb-multi-currency-for-wpml/hnb-multi.php+59
    require_once(wp-content/plugins/woocommerce-multilingual/classes/multi-currency/class-wcml-exchange-rates.php): failed to open stream: No such file or directory

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.94ms] Passed 4 tests

This is a short check of server-side resources used by HNB Multi Currency for WPML
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.69 ▼5.94
Dashboard /wp-admin3.31 ▲0.0047.30 ▼4.12
Posts /wp-admin/edit.php3.36 ▲0.0048.68 ▼4.67
Add New Post /wp-admin/post-new.php5.89 ▲0.0090.40 ▼13.02
Media Library /wp-admin/upload.php3.23 ▲0.0037.43 ▲2.18

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

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

Browser metrics Passed 4 tests

Checking browser requirements for HNB Multi Currency for WPML
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲7913.62 ▼0.661.96 ▲0.0245.08 ▲2.35
Dashboard /wp-admin2,221 ▲154.86 ▼0.04109.06 ▲9.5842.01 ▲0.59
Posts /wp-admin/edit.php2,100 ▼32.00 ▲0.0336.39 ▼5.0431.73 ▼5.56
Add New Post /wp-admin/post-new.php1,526 ▼1417.56 ▼1.13619.72 ▼51.5061.89 ▲5.42
Media Library /wp-admin/upload.php1,394 ▼64.22 ▼0.0498.29 ▼3.4145.28 ▼0.75

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • 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
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/hnb-multi-currency-for-wpml/hnb-multi.php:59
    • > PHP Fatal error
      Uncaught Error: Class 'WCML_Exchange_Rate_Service' not found in wp-content/plugins/hnb-multi-currency-for-wpml/class-hnb-exchange.php:16

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 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
9 plugin tags: currency, teaj, multilingual, hnb, api...

hnb-multi-currency-for-wpml/hnb-multi.php 85% from 13 tests

The main PHP file in "HNB Multi Currency for WPML" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("hnb-multi-currency-for-wpml.php" instead of "hnb-multi.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin67 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP2275467

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.22
Average class complexity4.00
▷ Minimum class complexity2.00
▷ Maximum class complexity6.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin