73% football-leagues-by-anwppro

Code Review | AnWP Football Leagues

WordPress plugin AnWP Football Leagues scored73%from 54 tests.

About plugin

  • Plugin page: football-leagues-...
  • Plugin version: 0.15.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.2
  • WordPress version: 6.3.1
  • First release: Feb 12, 2018
  • Latest release: Jul 30, 2023
  • Number of updates: 116
  • Update frequency: every 17.2 days
  • Top authors: anwppro (100%)

Code review

54 tests

User reviews

12 reviews

Install metrics

900+ active /41,217 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲5.07MB] [CPU: ▲33.02ms] 75% from 4 tests

A check of server-side resources used by AnWP Football Leagues
Please have a look at the following items
  • Extra RAM: The extra memory usage must be under 5MB (currently 5.07MB on /wp-admin/edit.php?post_type=anwp_standing)
PageMemory (MB)CPU Time (ms)
Home /8.36 ▲4.9068.54 ▲26.45
Dashboard /wp-admin8.42 ▲5.0894.85 ▲32.92
Posts /wp-admin/edit.php8.51 ▲5.1588.30 ▲36.55
Add New Post /wp-admin/post-new.php11.18 ▲5.30142.08 ▲36.17
Media Library /wp-admin/upload.php8.37 ▲5.1487.33 ▲52.84
Add New Player /wp-admin/post-new.php?post_type=anwp_player8.53105.46
Shortcodes /wp-admin/admin.php?page=anwpfl-shortcodes8.3973.72
Add Referee /wp-admin/post-new.php?post_type=anwp_referee8.5283.34
Matches /wp-admin/edit.php?post_type=anwp_match8.5484.97
Plugin Health /wp-admin/admin.php?page=anwpfl-plugin-health8.3971.59
Players /wp-admin/edit.php?post_type=anwp_player8.4872.65
Support /wp-admin/admin.php?page=anwpfl-support8.2669.25
Staff /wp-admin/edit.php?post_type=anwp_staff8.4869.90
Customize /wp-admin/admin.php?page=anwpfl-plugin-customize8.3970.91
Standing Tables /wp-admin/edit.php?post_type=anwp_standing8.4868.89

Server storage [IO: ▲6.87MB] [DB: ▲0.03MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 404 new files
Database: 4 new tables, 19 new options
New tables
wp_anwpfl_matches
wp_anwpfl_players_manual_stats
wp_anwpfl_missing_players
wp_anwpfl_players
New WordPress options
widget_anwpfl-widget-cards
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
widget_anwpfl-widget-birthday
widget_anwpfl-widget-video
anwpfl_version
can_compress_scripts
widget_anwpfl-widget-next-match
...

Browser metrics Passed 4 tests

AnWP Football Leagues: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,691 ▲94514.47 ▼0.285.43 ▲3.8549.43 ▲12.69
Dashboard /wp-admin2,874 ▲7005.77 ▲0.24100.89 ▲16.9876.25 ▲31.72
Posts /wp-admin/edit.php2,789 ▲6892.85 ▲0.8257.82 ▲16.8542.80 ▲4.88
Add New Post /wp-admin/post-new.php1,977 ▲44018.71 ▲0.47603.84 ▼11.5629.76 ▼38.34
Media Library /wp-admin/upload.php2,067 ▲6645.07 ▲0.86103.73 ▲8.4587.55 ▲43.60
Add New Player /wp-admin/post-new.php?post_type=anwp_player2,7246.13168.4278.08
Shortcodes /wp-admin/admin.php?page=anwpfl-shortcodes1,8515.82111.4764.06
Add Referee /wp-admin/post-new.php?post_type=anwp_referee2,6725.85110.6082.42
Matches /wp-admin/edit.php?post_type=anwp_match2,1316.2381.3768.25
Plugin Health /wp-admin/admin.php?page=anwpfl-plugin-health1,7625.8981.2183.33
Players /wp-admin/edit.php?post_type=anwp_player1,8712.8246.8932.95
Support /wp-admin/admin.php?page=anwpfl-support1,5462.4933.3330.39
Staff /wp-admin/edit.php?post_type=anwp_staff1,8632.7738.0535.02
Customize /wp-admin/admin.php?page=anwpfl-plugin-customize1,8305.6958.4578.51
Standing Tables /wp-admin/edit.php?post_type=anwp_standing1,8032.7437.0031.99

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_anwpfl_missing_players
    • wp_anwpfl_players
    • wp_anwpfl_matches
    • wp_anwpfl_players_manual_stats
  • This plugin does not fully uninstall, leaving 19 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_anwpfl-widget-matches
    • widget_anwpfl-widget-next-match
    • widget_anwpfl-widget-cards
    • widget_recent-comments
    • anwpfl_db_version
    • widget_anwpfl-widget-clubs
    • widget_anwpfl-widget-competition-list
    • ...

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
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following items
  • 43× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/football-leagues-by-anwppro/includes/shortcodes/class-anwpfl-shortcode-standing.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/football-leagues-by-anwppro/includes/shortcodes/class-anwpfl-shortcode-match-last.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/football-leagues-by-anwppro/theme-support/twentysixteen/single.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/football-leagues-by-anwppro/includes/cmb2-fields/class-anwp-fl-cmb2-field-select2.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'AnWPFL_Widget' not found in wp-content/plugins/football-leagues-by-anwppro/includes/widgets/class-anwpfl-widget-video.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/football-leagues-by-anwppro/includes/cmb2-fields/cmb-field-ordering-list.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'AnWPFL_Widget' not found in wp-content/plugins/football-leagues-by-anwppro/includes/widgets/class-anwpfl-widget-birthday.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/football-leagues-by-anwppro/includes/shortcodes/class-anwpfl-shortcode-players.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'AnWPFL_Widget' not found in wp-content/plugins/football-leagues-by-anwppro/includes/widgets/class-anwpfl-widget-standing.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/football-leagues-by-anwppro/includes/shortcodes/class-anwpfl-shortcode-competition-list.php:24

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
8 plugin tags: league management, football club, club management, football, soccer...

football-leagues-by-anwppro/anwp-football-leagues.php 77% from 13 tests

"AnWP Football Leagues" version 0.15.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("football-leagues-by-anwppro.php" instead of "anwp-football-leagues.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 166 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected115,747 lines of code in 353 files:
LanguageFilesBlank linesComment linesLines of code
CSS223,67441042,966
PHP1917,04011,92937,046
JavaScript256,3775,67134,498
Markdown82200613
SVG10001333
JSON700291

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity47.42
▷ Minimum class complexity1.00
▷ Maximum class complexity714.00
Average method complexity5.06
▷ Minimum method complexity1.00
▷ Maximum method complexity82.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes62
▷ Abstract classes11.61%
▷ Concrete classes6198.39%
▷ Final classes11.64%
Methods710
▷ Static methods121.69%
▷ Public methods60084.51%
▷ Protected methods7510.56%
▷ Private methods354.93%
Functions50
▷ Named functions1530.00%
▷ Anonymous functions3570.00%
Constants8
▷ Global constants112.50%
▷ Class constants787.50%
▷ Public constants7100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.18MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/google-maps-placeholder.png32.20KB9.91KB▼ 69.23%
vendor/world-flags-sprite/images/flags32.png87.02KB51.06KB▼ 41.32%
admin/img/cmb2-icon.png3.87KB1.77KB▼ 54.30%
public/img/empty_player.png2.51KB1.84KB▼ 26.74%
admin/img/anwp-fl-icon.png7.23KB3.64KB▼ 49.68%