63% joomsport-prediction

Code Review | Sport Predictions for JoomSport

WordPress plugin Sport Predictions for JoomSport scored63%from 54 tests.

About plugin

  • Plugin page: joomsport-prediction
  • Plugin version: 2.1.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2
  • WordPress version: 6.3.1
  • First release: Jun 28, 2017
  • Latest release: Oct 13, 2023
  • Number of updates: 33
  • Update frequency: every 69.7 days
  • Top authors: beardev (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

100+ active /11,221 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.88MB] [CPU: ▲6.50ms] Passed 4 tests

This is a short check of server-side resources used by Sport Predictions for JoomSport
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.32 ▲0.8548.60 ▲10.60
Dashboard /wp-admin4.22 ▲0.8758.11 ▼2.09
Posts /wp-admin/edit.php4.26 ▲0.9072.93 ▲29.04
Add New Post /wp-admin/post-new.php6.80 ▲0.9095.55 ▲1.51
Media Library /wp-admin/upload.php4.12 ▲0.8848.22 ▲15.96
Leagues /wp-admin/edit.php?post_type=jswprediction_league4.1846.02
Rounds /wp-admin/edit.php?post_type=jswprediction_round4.1850.99
Settings /wp-admin/admin.php?page=joomsport_prediction_settings4.0942.81

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 59 new files
Database: 9 new tables, 9 new options
New tables
wp_jswprediction_round_matches
wp_jswprediction_private_based
wp_jswprediction_round
wp_jswprediction_types
wp_jswprediction_private_league
wp_jswprediction_round_users
wp_jswprediction_league
wp_jswprediction_private_users
wp_jswprediction_scorepredict
New WordPress options
widget_jswp_prediction_user_stat
can_compress_scripts
db_upgraded
widget_theysaidso_widget
recovery_mode_email_last_sent
widget_recent-posts
theysaidso_admin_options
joomsport_prediction_settings
widget_recent-comments

Browser metrics Passed 4 tests

Sport Predictions for JoomSport: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,010 ▲26414.83 ▲0.481.78 ▲0.1738.15 ▼2.54
Dashboard /wp-admin2,407 ▲2276.55 ▲0.90119.59 ▲33.2742.05 ▲0.78
Posts /wp-admin/edit.php2,345 ▲2453.78 ▲1.7659.83 ▲24.0537.43 ▲0.75
Add New Post /wp-admin/post-new.php1,751 ▲22522.53 ▼1.15648.60 ▼11.6229.86 ▼31.21
Media Library /wp-admin/upload.php1,478 ▲844.52 ▲0.3681.78 ▼15.9845.07 ▲1.75
Leagues /wp-admin/edit.php?post_type=jswprediction_league1,3063.8347.7728.69
Rounds /wp-admin/edit.php?post_type=jswprediction_round1,3363.7245.9526.87
Settings /wp-admin/admin.php?page=joomsport_prediction_settings7491.7312.4822.66

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie tables detected upon uninstall: 9 tables
    • wp_jswprediction_round_users
    • wp_jswprediction_private_users
    • wp_jswprediction_private_league
    • wp_jswprediction_types
    • wp_jswprediction_round_matches
    • wp_jswprediction_scorepredict
    • wp_jswprediction_private_based
    • wp_jswprediction_league
    • wp_jswprediction_round
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_theysaidso_widget
    • widget_jswp_prediction_user_stat
    • theysaidso_admin_options
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • joomsport_prediction_settings
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/admin.php?page=joomsport_prediction_settings
    • > Error in wp-content/plugins/joomsport-prediction/includes/pages/joomsport-prediction-page-settings.php+85
    Uncaught Error: Class 'JoomSportHelperSelectBox' not found in wp-content/plugins/joomsport-prediction/includes/pages/joomsport-prediction-page-settings.php:85
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): JoomsportPredictionPageSettings::action()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown

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
The following issues need your attention
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/joomsport-prediction/joomsport-prediction.php
  • 49× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant JOOMSPORT_PREDICTION_PATH_INCLUDES - assumed 'JOOMSPORT_PREDICTION_PATH_INCLUDES' (this will throw an Error in a future version of PHP) in wp-content/plugins/joomsport-prediction/includes/posts/joomsport-prediction-post-league.php on line 8
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/joomsport-prediction/includes/joomsport-prediction-widgets.php:8
    • > PHP Fatal error
      require_once(): Failed opening required 'JOOMSPORT_PATH_MODELSmodel-jsport-player.php' (include_path='.:/usr/share/php') in wp-content/plugins/joomsport-prediction/sportleague/classes/objects/class-jsport-prediction-userleague.php on line 9
    • > PHP Fatal error
      require_once(): Failed opening required 'JOOMSPORT_PREDICTION_PATH_INCLUDESmeta-boxes/joomsport-prediction-meta-league.php' (include_path='.:/usr/share/php') in wp-content/plugins/joomsport-prediction/includes/posts/joomsport-prediction-post-league.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_avatar() in wp-content/plugins/joomsport-prediction/sportleague/views/default/widgets/user-stat.php:7
    • > PHP Warning
      Use of undefined constant JOOMSPORT_PATH_MODELS - assumed 'JOOMSPORT_PATH_MODELS' (this will throw an Error in a future version of PHP) in wp-content/plugins/joomsport-prediction/sportleague/classes/objects/class-jsport-prediction-userleague.php on line 9
    • > PHP Warning
      require_once(JOOMSPORT_PATH_MODELSmodel-jsport-player.php): failed to open stream: No such file or directory in wp-content/plugins/joomsport-prediction/sportleague/classes/objects/class-jsport-prediction-userround.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/joomsport-prediction/includes/joomsport-prediction-delete.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/joomsport-prediction/sportleague/views/default/userleague.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'classJsportUserround' not found in wp-content/plugins/joomsport-prediction/sportleague/views/default/userround.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
6 plugin tags: sport, league predictions, sport predictions, league, game predictions...

joomsport-prediction/joomsport-prediction.php Passed 13 tests

The main PHP script in "Sport Predictions for JoomSport" version 2.1.5 is automatically included on every request by WordPress
51 characters long description:
Create sport predictions for your JoomSport matches

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin7,373 lines of code in 49 files:
LanguageFilesBlank linesComment linesLines of code
PHP401,3354985,913
CSS4166792
JavaScript312631613
HTML13045
SVG11010

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity23.85
▷ Minimum class complexity2.00
▷ Maximum class complexity129.00
Average method complexity4.37
▷ Minimum method complexity1.00
▷ Maximum method complexity84.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes33
▷ Abstract classes00.00%
▷ Concrete classes33100.00%
▷ Final classes00.00%
Methods212
▷ Static methods9846.23%
▷ Public methods20395.75%
▷ Protected methods00.00%
▷ Private methods94.25%
Functions25
▷ Named functions1560.00%
▷ Anonymous functions1040.00%
Constants17
▷ Global constants17100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
3 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
sportleague/assets/images/ystar.png10.93KB5.14KB▼ 53.00%
sportleague/assets/images/jsport-ico-24.png18.82KB7.19KB▼ 61.78%
sportleague/assets/images/jsport-ico-32.png25.19KB9.98KB▼ 60.37%