62% football-leagues-by-anwppro

Code Review | AnWP Football Leagues

WordPress plugin AnWP Football Leagues scored 62% from 54 tests.

About plugin

  • Plugin page: football-leagues-...
  • Plugin version: 0.14.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9.2
  • WordPress version: 5.9.2
  • First release: Feb 12, 2018
  • Latest release: Mar 24, 2022
  • Number of updates: 97
  • Update frequency: every 15.5 days
  • Top authors: anwppro (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

700+ active / 25,998 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: ▲4.67MB] [CPU: ▼268.36ms] 75% from 4 tests

A check of server-side resources used by AnWP Football Leagues
Please have a look at the following items
  • RAM: The total memory usage must be kept under 10MB (currently 11.30MB on /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php)
PageMemory (MB)CPU Time (ms)
Home /8.06 ▲4.5484.74 ▲23.50
Dashboard /wp-admin8.09 ▲4.6878.39 ▲40.58
Posts /wp-admin/edit.php8.34 ▲4.7077.00 ▲32.30
Add New Post /wp-admin/post-new.php11.74 ▲4.77129.53 ▼1,158.19
Media Library /wp-admin/upload.php8.04 ▲4.7555.23 ▲28.94
Documentation /wp-admin/admin.php?page=anwp-football-leagues8.0657.38
Add New Player /wp-admin/post-new.php?post_type=anwp_player8.3890.44
Customize /wp-admin/admin.php?page=anwpfl-plugin-customize8.0660.35
Matches /wp-admin/edit.php?post_type=anwp_match8.2075.10
Shortcodes /wp-admin/admin.php?page=anwpfl-shortcodes8.0781.67
Stadiums /wp-admin/edit.php?post_type=anwp_stadium8.1558.83
Clubs /wp-admin/edit.php?post_type=anwp_club8.1561.54
Add Staff Member /wp-admin/post-new.php?post_type=anwp_staff8.3776.03
Add New Club /wp-admin/post-new.php?post_type=anwp_club8.3784.44
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php11.3085.49

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 406 new files
Database: 4 new tables, 15 new options
New tables
wp_anwpfl_matches
wp_anwpfl_missing_players
wp_anwpfl_players_manual_stats
wp_anwpfl_players
New WordPress options
anwpfl_version
widget_anwpfl-widget-matches
widget_anwpfl-widget-standing
widget_recent-comments
widget_anwpfl-widget-player
widget_anwpfl-widget-video
widget_anwpfl-widget-next-match
widget_anwpfl-widget-cards
widget_anwpfl-widget-clubs
widget_anwpfl-widget-birthday
...

Browser metrics Passed 4 tests

AnWP Football Leagues: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,936 ▲1,19418.30 ▲2.6341.05 ▲35.238.26 ▲5.99
Dashboard /wp-admin3,649 ▲7917.28 ▲1.14131.51 ▼15.87192.63 ▲29.04
Posts /wp-admin/edit.php3,426 ▲7354.29 ▲1.0681.71 ▲18.22158.35 ▲14.13
Add New Post /wp-admin/post-new.php2,257 ▲59623.14 ▲7.31410.45 ▼15.41169.42 ▲17.40
Media Library /wp-admin/upload.php2,454 ▲7566.54 ▲1.02136.37 ▼8.68205.12 ▲15.94
Documentation /wp-admin/admin.php?page=anwp-football-leagues2,0507.10148.28153.20
Add New Player /wp-admin/post-new.php?post_type=anwp_player3,4807.59186.37166.57
Customize /wp-admin/admin.php?page=anwpfl-plugin-customize3,1707.14107.83201.93
Matches /wp-admin/edit.php?post_type=anwp_match2,5597.64115.89155.49
Shortcodes /wp-admin/admin.php?page=anwpfl-shortcodes2,1887.1788.88294.88
Stadiums /wp-admin/edit.php?post_type=anwp_stadium2,1414.0079.57125.66
Clubs /wp-admin/edit.php?post_type=anwp_club2,1904.1069.73142.40
Add Staff Member /wp-admin/post-new.php?post_type=anwp_staff3,4057.37138.36161.10
Add New Club /wp-admin/post-new.php?post_type=anwp_club3,4837.36124.69162.62
Customize /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php11,87117.57438.44129.41

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_players
    • wp_anwpfl_matches
    • wp_anwpfl_missing_players
    • wp_anwpfl_players_manual_stats
  • This plugin does not fully uninstall, leaving 15 options in the database
    • widget_anwpfl-widget-competition-list
    • anwpfl_version
    • widget_anwpfl-widget-matches
    • anwpfl_db_version
    • widget_anwpfl-widget-cards
    • widget_anwpfl-widget-player
    • widget_recent-comments
    • widget_anwpfl-widget-video
    • widget_anwpfl-widget-birthday
    • widget_anwpfl-widget-players
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Smoke test failed, please fix the following
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=anwpfl-shortcodes
    • > request to
    • > Notice in wp-config.php+20
    Undefined index: REQUEST_METHOD
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Notice in wp-includes/class-wp-customize-nav-menus.php+1152
    Trying to get property 'title' of non-object

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
  • 38× 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-match-last.php:29
    • > 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-next.php:29
    • > 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: Call to undefined function add_action() in wp-content/plugins/football-leagues-by-anwppro/includes/shortcodes/class-anwpfl-shortcode-matches.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/football-leagues-by-anwppro/includes/shortcodes/class-anwpfl-shortcode-player-data.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/football-leagues-by-anwppro/includes/shortcodes/class-anwpfl-shortcode-cards.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-cards.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'AnWPFL_Widget' not found in wp-content/plugins/football-leagues-by-anwppro/includes/widgets/class-anwpfl-widget-clubs.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/football-leagues-by-anwppro/includes/cmb2-fields/class-anwp-cmb2-field-ajax-search.php:47
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/football-leagues-by-anwppro/includes/shortcodes/class-anwpfl-shortcode-staff.php:30

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/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,regenerator-runtime,wp-polyfill,wp-hooks,underscore,wp-dom-ready&ver=5.9.2 1:31592 "jQuery.Deferred exception: (intermediate value)(intermediate value).val(...).wpColorPicker is not a function" "TypeError: (intermediate value)(intermediate value).val(...).wpColorPicker is not a function\n at i.ready (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=heartbeat,customize-base,customize-controls,customize-widgets&ver=5.9.2:6:46941)\n at /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=heartbeat,customize-base,customize-controls,customize-widgets&ver=5.9.2:6:40476\n at c (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,regenerator-runtime,wp-polyfill,wp-hooks,underscore,wp-dom-ready&ver=5.9.2:2:28327)\n at Object.add [as done] (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,regenerator-runtime,wp-polyfill,wp-hooks,underscore,wp-dom-ready&ver=5.9.2:2:28605)\n at initialize (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=heartbeat,customize-base,customize-controls,customize-widgets&ver=5.9.2:6:40418)\n at i.o.Class (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=heartbeat,customize-base,customize-controls,customize-widgets&ver=5.9.2:4:571)\n at i [as constructor] (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=heartbeat,customize-base,customize-controls,customize-widgets&ver=5.9.2:4:180)\n at new i (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=heartbeat,customize-base,customize-controls,customize-widgets&ver=5.9.2:4:180)\n at Object.\u003Canonymous> (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=heartbeat,customize-base,customize-controls,customize-widgets&ver=5.9.2:6:93900)\n at Function.each (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,regenerator-runtime,wp-polyfill,wp-hooks,underscore,wp-dom-ready&ver=5.9.2:2:3053)" undefined
    • > GET request to /wp-admin/customize.php?return=%2Fwp-admin%2Fwp-api.php
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,regenerator-runtime,wp-polyfill,wp-hooks,underscore,wp-dom-ready&ver=5.9.2 1:31702 Uncaught TypeError: (intermediate value)(intermediate value).val(...).wpColorPicker is not a function

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: sport, league management, football management, football, football club...

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

"AnWP Football Leagues" version 0.14.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:
  • 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)
  • 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")

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 detected145,932 lines of code in 356 files:
LanguageFilesBlank linesComment linesLines of code
CSS246,40740841,550
JavaScript366,9496,46236,703
PO File1214,52923,37733,991
PHP1766,41411,19432,819
Markdown71780524
SVG9901309
JSON20036

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.46
Average class complexity46.43
▷ Minimum class complexity1.00
▷ Maximum class complexity602.00
Average method complexity4.86
▷ Minimum method complexity1.00
▷ Maximum method complexity71.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes56
▷ Abstract classes11.79%
▷ Concrete classes5598.21%
▷ Final classes11.82%
Methods657
▷ Static methods101.52%
▷ Public methods54883.41%
▷ Protected methods7411.26%
▷ Private methods355.33%
Functions48
▷ Named functions1531.25%
▷ Anonymous functions3368.75%
Constants7
▷ Global constants00.00%
▷ Class constants7100.00%
▷ 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
6 PNG files occupy 0.15MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/img/empty_player.png2.51KB1.84KB▼ 26.74%
vendor/world-flags-sprite/images/flags16.png50.10KB18.91KB▼ 62.26%
vendor/world-flags-sprite/images/flags32.png87.02KB51.06KB▼ 41.32%
admin/img/cmb2-icon.png3.87KB1.77KB▼ 54.30%
public/img/empty_logo.png2.37KB1.68KB▼ 28.95%