83% leartes-try-exchange-rates

Code Review | Leartes TRY Exchange Rates

WordPress plugin Leartes TRY Exchange Rates scored83%from 54 tests.

About plugin

  • Plugin page: leartes-try-excha...
  • Plugin version: 2.1
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Oct 4, 2017
  • Latest release: Oct 10, 2023
  • Number of updates: 22
  • Update frequency: every 100.3 days
  • Top authors: Leartes (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

900+ active /10,408 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.13MB] [CPU: ▼5.30ms] Passed 4 tests

This is a short check of server-side resources used by Leartes TRY Exchange Rates
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1542.44 ▲2.89
Dashboard /wp-admin3.45 ▲0.1053.53 ▼11.70
Posts /wp-admin/edit.php3.56 ▲0.2053.32 ▲0.35
Add New Post /wp-admin/post-new.php6.03 ▲0.1492.25 ▼12.05
Media Library /wp-admin/upload.php3.37 ▲0.1439.04 ▲2.22

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 32 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments
widget_recent-posts
widget_lbi_exch_rates

Browser metrics Passed 4 tests

A check of browser resources used by Leartes TRY Exchange Rates
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲3014.34 ▼0.001.58 ▼0.2942.75 ▼0.21
Dashboard /wp-admin2,192 ▲125.56 ▼0.0995.20 ▲0.5837.20 ▼6.36
Posts /wp-admin/edit.php2,097 ▼01.98 ▲0.0032.80 ▼4.9033.36 ▼5.32
Add New Post /wp-admin/post-new.php1,526 ▼1123.05 ▲4.85694.22 ▲76.4851.66 ▼12.55
Media Library /wp-admin/upload.php1,397 ▼64.22 ▲0.03112.63 ▲12.0346.91 ▲0.77

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
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_lbi_exch_rates

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/leartes-try-exchange-rates/lbi-exchrates.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/leartes-try-exchange-rates/lbi-exchrates-widget.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that require attention:
  • Tags: There are too many tags (14 tag instead of maximum 10)
  • Screenshots: These screenshots lack descriptions #1, #2, #3, #4, #5 in leartes-try-exchange-rates/assets to your readme.txt
You can look at the official readme.txt

leartes-try-exchange-rates/lbi-exchrates.php 85% from 13 tests

The main PHP file in "Leartes TRY Exchange Rates" ver. 2.1 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("leartes-try-exchange-rates.php" instead of "lbi-exchrates.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin1,342 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP611264872
XML1220257
PO File17677170
CSS18343

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity18.40
▷ Minimum class complexity2.00
▷ Maximum class complexity61.00
Average method complexity4.00
▷ Minimum method complexity1.00
▷ Maximum method complexity61.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods29
▷ Static methods13.45%
▷ Public methods2586.21%
▷ Protected methods26.90%
▷ Private methods26.90%
Functions7
▷ Named functions685.71%
▷ Anonymous functions114.29%
Constants8
▷ Global constants787.50%
▷ Class constants112.50%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
19 compressed PNG files occupy 0.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/flags/ru.png0.12KB0.17KB0.00%
assets/flags/no.png0.26KB0.32KB0.00%
assets/flags/gb.png0.39KB0.43KB0.00%
assets/flags/cn.png0.18KB0.25KB0.00%
assets/flags/dk.png0.18KB0.22KB0.00%