73% odds-widgets

Code Review | Odds Widgets

WordPress plugin Odds Widgets scored73%from 54 tests.

About plugin

  • Plugin page: odds-widgets
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8.0-3.3.1
  • WordPress version: 6.3.1
  • First release: Feb 6, 2012
  • Latest release: Feb 10, 2012
  • Number of updates: 8
  • Update frequency: every 0.5 days
  • Top authors: dionesku (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,195 total downloads

Benchmarks

Plugin footprint 83% from 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.02MB] [CPU: ▼1.49ms] Passed 4 tests

An overview of server-side resources used by Odds Widgets
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0238.76 ▼0.04
Dashboard /wp-admin3.33 ▲0.0251.42 ▼0.34
Posts /wp-admin/edit.php3.38 ▲0.0244.12 ▼2.94
Add New Post /wp-admin/post-new.php5.93 ▲0.0481.92 ▼2.65
Media Library /wp-admin/upload.php3.25 ▲0.0232.75 ▲0.31
Odds Widgets /wp-admin/options-general.php?page=odds-widgets3.2532.30

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 15 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_odds_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Odds Widgets
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲10413.15 ▼1.605.53 ▲3.7743.38 ▼4.07
Dashboard /wp-admin2,220 ▲285.86 ▲0.9297.48 ▼13.5336.28 ▼4.76
Posts /wp-admin/edit.php2,112 ▲232.05 ▲0.0437.85 ▲0.9131.11 ▼2.52
Add New Post /wp-admin/post-new.php1,523 ▲623.08 ▲5.57664.68 ▼33.0251.64 ▲0.11
Media Library /wp-admin/upload.php1,402 ▲144.25 ▲0.0896.31 ▲3.6040.84 ▲0.09
Odds Widgets /wp-admin/options-general.php?page=odds-widgets8311.7229.1128.56

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
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_odds_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=odds-widgets
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
    • > GET request to /wp-admin/options-general.php?page=odds-widgets
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
Almost there! Just fix the following items
  • 4× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/odds-widgets/includes/Odds_Widget.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/odds-widgets/includes/Odds_Widget.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/odds-widgets/odds-widgets.php:45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/odds-widgets/includes/admin-page.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/options-general.php?page=odds-widgets
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: $(...).live is not a function" "TypeError: $(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/odds-widgets/js/odds-widgets.js?ver=6.3.1:6:33)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=odds-widgets
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: $(...).live is not a function

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots require images: #1 (Single Tournamnet Odds Widget), #2 (Horseracing Daily Races Odds Widget), #3 (Odds Widget admin form)
The official readme.txt might help

odds-widgets/odds-widgets.php Passed 13 tests

"Odds Widgets" version 1.1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
76 characters long description:
Create and customize live updating sport odds widgets on your wordpress blog

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
Good job! No executable or dangerous file extensions detected992 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP5125146643
JavaScript14619306
CSS17143

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity36.00
▷ Minimum class complexity27.00
▷ Maximum class complexity45.00
Average method complexity3.59
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods27
▷ Static methods2281.48%
▷ Public methods2696.30%
▷ Protected methods00.00%
▷ Private methods13.70%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 compressed PNG files occupy 0.04MB
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png18.09KB17.85KB▼ 1.34%
screenshot-3.png7.29KB7.24KB▼ 0.66%
screenshot-2.png17.27KB17.21KB0.32%
images/trans_bg_50.png0.11KB0.09KB▼ 12.84%