73% turkish-lottery

Code Review | Lottery

WordPress plugin Lottery scored73%from 54 tests.

About plugin

  • Plugin page: turkish-lottery
  • Plugin version: 20160911...
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Jul 31, 2017
  • Latest release: Jul 31, 2017
  • Number of updates: 5
  • Update frequency: every 0.8 days
  • Top authors: kenni1994 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /884 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
Install script ran successfully

Server metrics [RAM: ▼1.69MB] [CPU: ▼49.11ms] Passed 4 tests

A check of server-side resources used by Lottery
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.30 ▼1.168.86 ▼30.76
Dashboard /wp-admin2.31 ▼0.9910.30 ▼41.51
Posts /wp-admin/edit.php2.31 ▼1.0411.30 ▼34.36
Add New Post /wp-admin/post-new.php2.31 ▼3.5710.74 ▼89.80
Media Library /wp-admin/upload.php2.31 ▼0.9210.09 ▼28.08

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 3 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_kenni_turkish_lottery
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Lottery
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,791 ▲514.67 ▲0.321.72 ▼0.4143.08 ▼4.94
Dashboard /wp-admin2,198 ▲245.62 ▲0.0787.47 ▼5.4738.77 ▼5.90
Posts /wp-admin/edit.php2,100 ▲31.99 ▼0.0434.58 ▼3.4735.14 ▼3.43
Add New Post /wp-admin/post-new.php1,528 ▼723.41 ▲5.08651.62 ▼42.7154.93 ▼16.95
Media Library /wp-admin/upload.php1,403 ▲64.06 ▼0.14103.45 ▲2.2742.72 ▲1.19

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% from 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > User deprecated in wp-includes/functions.php+5546
    The called constructor method for WP_Widget class in kenni_turkish_lottery is deprecated since version 4.3.0! Use __construct() instead.
  • Zombie WordPress options detected upon uninstall: 7 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_kenni_turkish_lottery

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/turkish-lottery/Lottery.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 86% 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 to be fixed:
  • Contributors: Contributors not specified
The official readme.txt might help

turkish-lottery/Lottery.php 77% from 13 tests

The main PHP file in "Lottery" ver. 20160911... adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Version: Use periods and digits only for your plugin's version number (ex. "1.0.3" instead of "20160911...")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Main file name: Name the main plugin file the same as the plugin slug ("turkish-lottery.php" instead of "Lottery.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin107 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP192997
CSS10010

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.08
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity2.50
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.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
There are no PNG files in this plugin