73% zimrate

Code Review | ZimRate

WordPress plugin ZimRate scored73%from 54 tests.

About plugin

  • Plugin page: zimrate
  • Plugin version: 1.1.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.8
  • WordPress version: 6.3.1
  • First release: Sep 1, 2020
  • Latest release: Jul 24, 2021
  • Number of updates: 15
  • Update frequency: every 21.7 days
  • Top authors: tygalive (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /577 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

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

This is a short check of server-side resources used by ZimRate
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2041.47 ▲1.73
Dashboard /wp-admin3.58 ▲0.2351.09 ▼10.51
Posts /wp-admin/edit.php3.63 ▲0.2752.66 ▲2.99
Add New Post /wp-admin/post-new.php6.11 ▲0.23101.63 ▲4.80
Media Library /wp-admin/upload.php3.44 ▲0.2142.81 ▲4.18
ZimRate /wp-admin/admin.php?page=zimrate-dashboard3.4234.83
Options /wp-admin/admin.php?page=zimrate-options3.4138.22

Server storage [IO: ▲0.11MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 35 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by ZimRate
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲9514.38 ▼0.171.55 ▼0.0937.02 ▼1.80
Dashboard /wp-admin2,235 ▲575.57 ▼0.0985.75 ▼25.9571.91 ▲31.14
Posts /wp-admin/edit.php2,155 ▲522.00 ▼0.0239.48 ▼7.7735.41 ▲0.63
Add New Post /wp-admin/post-new.php1,727 ▲19922.13 ▼1.12705.58 ▼4.4646.58 ▼8.86
Media Library /wp-admin/upload.php1,449 ▲494.11 ▼0.13104.20 ▼1.4278.97 ▲29.00
ZimRate /wp-admin/admin.php?page=zimrate-dashboard1,1732.0125.2968.72
Options /wp-admin/admin.php?page=zimrate-options9701.9925.6825.69

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=zimrate-dashboard
    • > Notice in wp-content/plugins/zimrate/admin/partials/zimrate-admin-rates.php+56
    Undefined index: USD
    • > GET request to /wp-admin/admin.php?page=zimrate-dashboard
    • > Warning in wp-content/plugins/zimrate/admin/partials/zimrate-admin-rates.php+56
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=zimrate-dashboard
    • > Notice in wp-content/plugins/zimrate/admin/partials/zimrate-admin-rates.php+86
    Undefined index: info

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
Please fix the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/zimrate/admin/partials/zimrate-admin-shortcode.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_plugin_data() in wp-content/plugins/zimrate/admin/partials/zimrate-admin-display.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/zimrate/admin/partials/zimrate-admin-plugins.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function zimrate_get_rates() in wp-content/plugins/zimrate/admin/partials/zimrate-admin-rates.php:16

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=zimrate-dashboard
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'name')" "TypeError: Cannot read properties of undefined (reading 'name')\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/zimrate/admin/js/zimrate-admin.js?ver=1.1.3:7:24)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=zimrate-dashboard
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading 'name')

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
5 plugin tags: zimrate, zimbabwe, currency, tyganeutronics, rate

zimrate/zimrate.php Passed 13 tests

This is the main PHP file of "ZimRate" version 1.1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
124 characters long description:
All Zimbabwean exchange rates from multiple sites in one plugin. No need to scrounge the internet for the current days rate.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin1,678 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP202811,0321,516
Markdown140073
CSS4131655
JavaScript242733
SVG1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity7.30
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity2.15
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods57
▷ Static methods23.51%
▷ Public methods4070.18%
▷ Protected methods00.00%
▷ Private methods1729.82%
Functions23
▷ Named functions1878.26%
▷ Anonymous functions521.74%
Constants1
▷ Global constants1100.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 images were found in this plugin