84% lottery-number-supplier

Code Review | Lottery Number Supplier

WordPress plugin Lottery Number Supplier scored 84% from 54 tests.

About plugin

  • Plugin page: lottery-number-su...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.6.2
  • WordPress version: 6.3.1
  • First release: Aug 2, 2016
  • Latest release: Mar 31, 2021
  • Number of updates: 19
  • Update frequency: every 89.6 days
  • Top authors: Living Fossil (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 3,071 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.05MB] [CPU: ▼7.40ms] Passed 4 tests

An overview of server-side resources used by Lottery Number Supplier
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0541.06 ▼2.18
Dashboard /wp-admin3.35 ▲0.0545.20 ▼2.68
Posts /wp-admin/edit.php3.40 ▲0.0541.26 ▼6.75
Add New Post /wp-admin/post-new.php5.93 ▲0.0585.84 ▼17.99
Media Library /wp-admin/upload.php3.27 ▲0.0535.53 ▼0.86

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Lottery Number Supplier
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,909 ▲17413.72 ▼0.665.42 ▲3.3547.06 ▼1.29
Dashboard /wp-admin2,206 ▲245.86 ▲0.7694.85 ▼12.6938.13 ▼4.49
Posts /wp-admin/edit.php2,089 ▼01.98 ▼0.0133.56 ▼9.3330.51 ▼5.72
Add New Post /wp-admin/post-new.php1,533 ▼1223.07 ▲4.82658.36 ▲40.8866.92 ▲15.21
Media Library /wp-admin/upload.php1,382 ▼64.20 ▲0.0096.43 ▼8.7042.87 ▼5.79

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/lottery-number-supplier/lib/lns_buildPlayLine.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/lottery-number-supplier/lib/lns_manageLineSupply.php:23
    • > PHP Notice
      Undefined variable: separator in wp-content/plugins/lottery-number-supplier/lib/lns_pickajax.php on line 12
    • > PHP Notice
      Undefined variable: freshround in wp-content/plugins/lottery-number-supplier/lib/lns_pickajax.php on line 14
    • > PHP Notice
      Undefined variable: lineprefix in wp-content/plugins/lottery-number-supplier/lib/lns_pickajax.php on line 13

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
The official readme.txt is a good inspiration

lottery-number-supplier/lottery-number-supplier.php 92% from 13 tests

This is the main PHP file of "Lottery Number Supplier" version 1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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 plugin671 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP941138554
PO File2202074
CSS13743

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity13.40
▷ Minimum class complexity2.00
▷ Maximum class complexity31.00
Average method complexity3.70
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods23
▷ Static methods00.00%
▷ Public methods1878.26%
▷ Protected methods521.74%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected