94% wp-lottery

Code Review | WordPress Lottery

WordPress plugin WordPress Lottery scored 94% from 54 tests.

About plugin

  • Plugin page: wp-lottery
  • Plugin version: 2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-5.0.3
  • WordPress version: 5.8.1
  • First release: May 29, 2017
  • Latest release: Feb 17, 2019
  • Number of updates: 17
  • Update frequency: every 37.0 days
  • Top authors: czp3009 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,177 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

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

A check of server-side resources used by WordPress Lottery
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.0337.57 ▲5.86
Dashboard /wp-admin3.10 ▲0.0451.27 ▲3.84
Posts /wp-admin/edit.php3.15 ▲0.0451.43 ▲5.95
Add New Post /wp-admin/post-new.php5.46 ▲0.0297.96 ▼567.33
Media Library /wp-admin/upload.php3.04 ▲0.0433.57 ▼1.34

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by WordPress Lottery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,699 ▲10315.79 ▲0.3210.43 ▼0.6151.07 ▼3.09
Dashboard /wp-admin2,990 ▲565.90 ▼0.04144.28 ▼4.10118.65 ▲0.63
Posts /wp-admin/edit.php2,759 ▲202.68 ▼0.0268.06 ▼3.6694.56 ▼3.74
Add New Post /wp-admin/post-new.php1,617 ▼6618.90 ▲0.74378.51 ▼26.03116.29 ▼4.18
Media Library /wp-admin/upload.php1,830 ▲235.01 ▼0.01151.05 ▲4.06128.77 ▼1.09

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled completely, with no zombie files or tables

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wp-lottery/wordpress-lottery.php:30

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

readme.txt 94% 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:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === wp-lottery === )
You can take inspiration from this readme.txt

wp-lottery/wordpress-lottery.php 92% from 13 tests

"WordPress Lottery" version 2.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-lottery.php" instead of "wordpress-lottery.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected249 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP23342182
JavaScript13548
CSS12119

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.23
Average class complexity6.00
▷ Minimum class complexity3.00
▷ Maximum class complexity9.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants7
▷ Global constants228.57%
▷ Class constants571.43%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin