73% thai-retirement-income-calculator

Code Review | Thailand Retirement Calculator

WordPress plugin Thailand Retirement Calculator scored 73% from 54 tests.

About plugin

  • Plugin page: thai-retirement-i...
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.9.8
  • WordPress version: 6.3.1
  • First release: Nov 19, 2015
  • Latest release: Aug 21, 2018
  • Number of updates: 16
  • Update frequency: every 63.0 days
  • Top authors: thaiexpatservicecenter (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 975 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.03MB] [CPU: ▼8.07ms] Passed 4 tests

A check of server-side resources used by Thailand Retirement Calculator
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.04 ▼3.01
Dashboard /wp-admin3.33 ▲0.0345.22 ▼4.44
Posts /wp-admin/edit.php3.38 ▲0.0350.53 ▲1.26
Add New Post /wp-admin/post-new.php5.91 ▲0.0378.36 ▼25.20
Media Library /wp-admin/upload.php3.25 ▲0.0334.24 ▲0.37
Thai Retirement Visa /wp-admin/options-general.php?page=retirethailand-control-menu3.2327.29

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 14 new files
Database: 3 new tables, 26 new options
New tables
wp_retirethailand_requests
wp_retirethailand_newsletter
wp_retirethailand_exchange
New WordPress options
tr-title-newsletter
db_upgraded
tr-css-head
tr-css-border-style
theysaidso_admin_options
tr-button-newsletter
tr-confirm-newsletter
tr-css-border-color
tr-css-bg
can_compress_scripts
...

Browser metrics Passed 4 tests

An overview of browser requirements for Thailand Retirement Calculator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲19513.80 ▼0.505.43 ▲3.5839.97 ▼5.22
Dashboard /wp-admin2,227 ▲455.00 ▲0.09117.31 ▼15.4441.04 ▼6.88
Posts /wp-admin/edit.php2,112 ▲202.27 ▲0.2736.08 ▲2.1732.58 ▲1.46
Add New Post /wp-admin/post-new.php1,529 ▲1523.41 ▲5.88663.77 ▼16.1636.61 ▼18.23
Media Library /wp-admin/upload.php1,409 ▲244.40 ▲0.1996.07 ▼4.7141.29 ▼4.71
Thai Retirement Visa /wp-admin/options-general.php?page=retirethailand-control-menu1,6232.6363.6532.81

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
The following items require your attention
  • The uninstall procedure failed, leaving 3 tables in the database
    • wp_retirethailand_requests
    • wp_retirethailand_newsletter
    • wp_retirethailand_exchange
  • Zombie WordPress options detected upon uninstall: 26 options
    • tr-button-newsletter
    • tr-tracking-other
    • tr-title-newsletter
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_retirethailand_widget
    • tr-css-border-style
    • tr-css-head
    • tr-css-color
    • tr-css-bg
    • ...

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)
The smoke test was a success, however most plugin functionality was not tested

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 take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/thai-retirement-income-calculator/includes/class-retirethailand-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/thai-retirement-income-calculator/includes/class-retirethailand-phrase-table.php:3

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

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Screenshots: Add an image for screenshot #1 (Plugin layout with all options enabled.)
You can take inspiration from this readme.txt

thai-retirement-income-calculator/retirethailand.php 85% from 13 tests

"Thailand Retirement Calculator" version 1.1.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Requires at least: The required version number must match the one declared in readme.txt ("3.0.1" instead of "4.0")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("thai-retirement-income-calculator.php" instead of "retirethailand.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin997 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP10135150997

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity13.60
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods22
▷ Static methods29.09%
▷ Public methods2090.91%
▷ Protected methods00.00%
▷ Private methods29.09%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
2 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-128x128.png7.88KB3.76KB▼ 52.26%
assets/screenshot-1.png28.91KB11.12KB▼ 61.53%