10% thai-lottery-widget

Code Review | Thai Lottery Widget

WordPress plugin Thai Lottery Widget scored10%from 54 tests.

About plugin

  • Plugin page: thai-lottery-widget
  • Plugin version: 2.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9
  • WordPress version: 6.3.1
  • First release: Sep 1, 2016
  • Latest release: Mar 11, 2022
  • Number of updates: 44
  • Update frequency: every 45.8 days
  • Top authors: siamlottery (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

60+ active /4,960 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/thai-lottery-widget/thailottery.php+373
    Function create_function() is deprecated

Server metrics [RAM: ▼1.82MB] [CPU: ▼52.90ms] Passed 4 tests

Analyzing server-side resources used by Thai Lottery Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.17 ▼1.305.32 ▼34.93
Dashboard /wp-admin2.19 ▼1.126.62 ▼45.37
Posts /wp-admin/edit.php2.19 ▼1.176.69 ▼40.59
Add New Post /wp-admin/post-new.php2.19 ▼3.706.43 ▼90.69
Media Library /wp-admin/upload.php2.19 ▼1.045.17 ▼29.42

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 10 new options
New WordPress options
can_compress_scripts
widget_wp_thailottery_plugin4
widget_recent-comments
widget_theysaidso_widget
widget_wp_thailottery_plugin3
db_upgraded
widget_wp_thailottery_plugin2
widget_wp_thailottery_plugin
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Thai Lottery Widget
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6514.48 ▲0.101.74 ▼0.2237.05 ▼9.94
Dashboard /wp-admin2,206 ▲184.85 ▼1.06107.44 ▲0.5741.50 ▲4.57
Posts /wp-admin/edit.php2,092 ▼02.01 ▼0.0439.37 ▼1.4133.96 ▼3.02
Add New Post /wp-admin/post-new.php1,528 ▼518.46 ▼4.78606.16 ▼137.0557.35 ▲9.39
Media Library /wp-admin/upload.php1,388 ▼34.24 ▲0.04101.92 ▲3.9644.87 ▲2.12

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
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/thai-lottery-widget/thailottery.php+373
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 10 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • widget_wp_thailottery_plugin
    • widget_wp_thailottery_plugin2
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_wp_thailottery_plugin3
    • widget_wp_thailottery_plugin4
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
The following issues need your attention
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/thai-lottery-widget/thailottery.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
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
5 plugin tags: lottery, lotto, glo, thai lottery, lottery widget

thai-lottery-widget/thailottery.php 85% from 13 tests

The primary PHP file in "Thai Lottery Widget" version 2.3 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("thai-lottery-widget.php" instead of "thailottery.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 1068 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected341 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP11328341

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.10
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
PNG images were not found in this plugin