77% magayo-lottery-results

Code Review | magayo Lottery Results

WordPress plugin magayo Lottery Results scored77%from 54 tests.

About plugin

  • Plugin page: magayo-lottery-re...
  • Plugin version: 2.0.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.1-6.3.1
  • WordPress version: 6.3.1
  • First release: Aug 12, 2016
  • Latest release: Sep 24, 2023
  • Number of updates: 32
  • Update frequency: every 81.2 days
  • Top authors: magayo (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

90+ active /7,993 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.33MB] [CPU: ▼0.51ms] Passed 4 tests

Server-side resources used by magayo Lottery Results
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.79 ▲0.3344.85 ▲5.69
Dashboard /wp-admin3.63 ▲0.3248.08 ▲1.15
Posts /wp-admin/edit.php3.74 ▲0.3852.34 ▲6.31
Add New Post /wp-admin/post-new.php6.22 ▲0.3483.14 ▼9.36
Media Library /wp-admin/upload.php3.55 ▲0.3237.44 ▲0.49
magayo Lottery Results /wp-admin/options-general.php?page=magayo-lottery-results3.6241.81

Server storage [IO: ▲4.02MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
These are issues you should consider
  • You have illegally modified 2 files (0.00KB) outside of "wp-content/plugins/magayo-lottery-results/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/magayo-lottery-results/assets/icon-256\303\227256.png"
    • (new file) "wp-content/plugins/magayo-lottery-results/assets/banner-1544\303\227500.jpg"
Filesystem: 863 new files
Database: no new tables, 8 new options
New WordPress options
widget_theysaidso_widget
magayo-lottery-results
widget_recent-posts
widget_recent-comments
can_compress_scripts
widget_magayo_lottery_results_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by magayo Lottery Results
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,891 ▲14513.57 ▼0.805.89 ▲3.7941.93 ▼4.36
Dashboard /wp-admin2,211 ▲235.88 ▲0.07105.77 ▼4.1837.73 ▼4.91
Posts /wp-admin/edit.php2,100 ▲112.04 ▲0.0140.02 ▲4.1934.86 ▲0.67
Add New Post /wp-admin/post-new.php1,521 ▲217.39 ▼5.93682.84 ▼54.8062.22 ▲2.97
Media Library /wp-admin/upload.php1,396 ▲54.18 ▼0.0396.63 ▼3.1642.10 ▼3.78
magayo Lottery Results /wp-admin/options-general.php?page=magayo-lottery-results1,5451.7426.9426.97

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
Please fix the following items
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_magayo_lottery_results_widget
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/magayo-lottery-results/public/partials/magayo-lottery-results-public-display.php
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/magayo-lottery-results/admin/partials/magayo-lottery-results-display-settings.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/magayo-lottery-results/admin/partials/magayo-lottery-results-getting-started.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/magayo-lottery-results/includes/magayo-lottery-results-widget-admin-display.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/magayo-lottery-results/admin/partials/magayo-lottery-results-admin-display.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/magayo-lottery-results/includes/class-magayo-lottery-results-widget.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/magayo-lottery-results/admin/partials/magayo-lottery-results-games-settings.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% 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
Please fix the following attributes:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === magayo-lottery-results === )
The official readme.txt might help

magayo-lottery-results/magayo-lottery-results.php Passed 13 tests

The primary PHP file in "magayo Lottery Results" version 2.0.9 is used by WordPress to initiate all plugin functionality
72 characters long description:
Display lottery results and jackpots for lottery games across the world.

Code Analysis 97% from 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
There were no executable files found in this plugin2,626 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP175787242,442
JavaScript34250163
CSS251021

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Please fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 110)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity51.50
▷ Minimum class complexity1.00
▷ Maximum class complexity398.00
Average method complexity8.09
▷ Minimum method complexity1.00
▷ Maximum method complexity110.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods57
▷ Static methods23.51%
▷ Public methods3764.91%
▷ Protected methods00.00%
▷ Private methods2035.09%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
818 PNG files occupy 3.67MB with 1.41MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/red/ball_red85.png4.36KB2.81KB▼ 35.44%
assets/images/purple/ball_purple59.png4.97KB2.86KB▼ 42.44%
assets/images/orange/ball_orange21.png4.59KB2.75KB▼ 40.17%
assets/images/purple/ball_purple68.png4.97KB2.98KB▼ 40.03%
assets/images/red/ball_red43.png4.25KB2.83KB▼ 33.56%