10% gna-currency-converter

Code Review | GNA Currency Converter

WordPress plugin GNA Currency Converter scored10%from 54 tests.

About plugin

  • Plugin page: gna-currency-conv...
  • Plugin version: 0.9.8
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-4.7
  • WordPress version: 6.3.1
  • First release: May 9, 2016
  • Latest release: Sep 5, 2016
  • Number of updates: 19
  • Update frequency: every 11.5 days
  • Top authors: chris_dev (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,077 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method GNA_CurrencyConverter::activate_handler() should not be called statically

Server metrics [RAM: ▲0.11MB] [CPU: ▲3.43ms] Passed 4 tests

Server-side resources used by GNA Currency Converter
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1145.12 ▲4.52
Dashboard /wp-admin3.42 ▲0.1154.50 ▲1.38
Posts /wp-admin/edit.php3.54 ▲0.1854.54 ▲4.36
Add New Post /wp-admin/post-new.php6.00 ▲0.12101.41 ▲3.45
Media Library /wp-admin/upload.php3.32 ▲0.0945.62 ▲6.84
All Rates /wp-admin/edit.php?post_type=ex_rates3.3944.76
Add New /wp-admin/post-new.php?post_type=ex_rates3.2434.83

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 48 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for GNA Currency Converter
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,077 ▲31615.04 ▲0.695.46 ▲3.5346.72 ▲2.06
Dashboard /wp-admin2,353 ▲1826.16 ▲0.63106.59 ▲0.8270.34 ▲26.81
Posts /wp-admin/edit.php2,292 ▲1893.37 ▲1.3648.03 ▲9.2371.25 ▲36.03
Add New Post /wp-admin/post-new.php1,709 ▲18121.96 ▼1.12618.08 ▼30.4637.00 ▼20.48
Media Library /wp-admin/upload.php1,433 ▲304.21 ▲0.0585.21 ▼21.9080.95 ▲33.92
All Rates /wp-admin/edit.php?post_type=ex_rates1,2963.3345.6670.83
Add New /wp-admin/post-new.php?post_type=ex_rates2,1343.8266.3281.75

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin cannot be uninstalled
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method GNA_CurrencyConverter::deactivate_handler() should not be called statically
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/post-new.php?post_type=ex_rates
    • > Notice in wp-content/plugins/gna-currency-converter/gna-currency-converter-core.php+226
    Undefined index: n_gna_cc_save_meta

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 take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'GNA_CurrencyConverter_Admin_Menu' not found in wp-content/plugins/gna-currency-converter/admin/gna-currency-converter-admin-settings-menu.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/gna-currency-converter/inc/gna-currency-converter-config.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

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
Attributes that require attention:
  • Donate link: Invalid url: "none"
You can take inspiration from this readme.txt

gna-currency-converter/gna-currency-converter.php 92% from 13 tests

The primary PHP file in "GNA Currency Converter" version 0.9.8 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 174 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
No dangerous file extensions were detected6,882 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
CSS322132,314
Sass1434341,648
LESS1434441,638
SVG100685
PHP69052559
JavaScript1161638

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity7.60
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.59
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes120.00%
▷ Concrete classes480.00%
▷ Final classes00.00%
Methods56
▷ Static methods47.14%
▷ Public methods56100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/gna_20x20.png2.98KB0.33KB▼ 88.89%