68% football-leagues-by-anwppro

Code Review | AnWP Football Leagues

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

About plugin

  • Plugin page: football-leagues-...
  • Plugin version: 0.13.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.8
  • WordPress version: 5.8.1
  • First release: Feb 12, 2018
  • Latest release: Oct 18, 2021
  • Number of updates: 89
  • Update frequency: every 15.1 days
  • Top authors: anwppro (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

700+ active / 22,724 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.20MB] [CPU: ▼100.89ms] Passed 4 tests

A check of server-side resources used by AnWP Football Leagues
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /6.87 ▲4.0382.36 ▲41.73
Dashboard /wp-admin7.28 ▲4.2293.25 ▲37.53
Posts /wp-admin/edit.php7.42 ▲4.3294.54 ▲40.42
Add New Post /wp-admin/post-new.php9.79 ▲4.36148.13 ▼523.17
Media Library /wp-admin/upload.php7.22 ▲4.2282.69 ▲41.67
Plugin Health /wp-admin/admin.php?page=anwpfl-plugin-health7.2577.61
Matches /wp-admin/edit.php?post_type=anwp_match7.4483.45
Documentation /wp-admin/admin.php?page=anwp-football-leagues7.2577.16
Add New Club /wp-admin/post-new.php?post_type=anwp_club7.4496.65
Players /wp-admin/edit.php?post_type=anwp_player7.3359.97
Add New Player /wp-admin/post-new.php?post_type=anwp_player7.4486.42
Shortcodes /wp-admin/admin.php?page=anwpfl-shortcodes7.2577.03
Support /wp-admin/admin.php?page=anwpfl-support7.2066.21
Go Premium /wp-admin/admin.php?page=redirect_anwpfl_premium6.9154.13
Add Referee /wp-admin/post-new.php?post_type=anwp_referee7.44106.38

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 380 new files
Database: 3 new tables, 13 new options
New tables
wp_anwpfl_missing_players
wp_anwpfl_matches
wp_anwpfl_players
New WordPress options
widget_anwpfl-widget-last-match
widget_anwpfl-widget-standing
widget_anwpfl-widget-player
widget_anwpfl-widget-cards
widget_anwpfl-widget-competition-list
widget_anwpfl-widget-next-match
widget_anwpfl-widget-birthday
widget_anwpfl-widget-matches
anwpfl_db_version
widget_anwpfl-widget-players
...

Browser metrics Passed 4 tests

AnWP Football Leagues: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,811 ▲1,21517.84 ▲2.3331.36 ▲19.7864.53 ▲1.05
Dashboard /wp-admin3,708 ▲7717.26 ▲1.08185.79 ▲14.46150.55 ▲32.16
Posts /wp-admin/edit.php3,485 ▲7463.56 ▲0.85106.18 ▲17.5499.59 ▼0.29
Add New Post /wp-admin/post-new.php2,195 ▲61422.94 ▲4.42386.49 ▼82.12138.07 ▲17.49
Media Library /wp-admin/upload.php2,493 ▲6865.98 ▲0.94173.85 ▼1.80156.33 ▲34.05
Plugin Health /wp-admin/admin.php?page=anwpfl-plugin-health2,1476.44152.18119.17
Matches /wp-admin/edit.php?post_type=anwp_match2,6056.92153.56113.48
Documentation /wp-admin/admin.php?page=anwp-football-leagues2,0966.11129.77108.60
Add New Club /wp-admin/post-new.php?post_type=anwp_club3,5216.17172.96117.53
Players /wp-admin/edit.php?post_type=anwp_player2,2793.35102.99112.18
Add New Player /wp-admin/post-new.php?post_type=anwp_player3,4446.24170.83121.06
Shortcodes /wp-admin/admin.php?page=anwpfl-shortcodes2,2336.34106.34103.69
Support /wp-admin/admin.php?page=anwpfl-support1,9582.9070.6099.39
Go Premium /wp-admin/admin.php?page=redirect_anwpfl_premium8,1827.45239.86193.32
Add Referee /wp-admin/post-new.php?post_type=anwp_referee3,4445.99150.09119.25

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 3 tables in the database
    • wp_anwpfl_matches
    • wp_anwpfl_players
    • wp_anwpfl_missing_players
  • This plugin does not fully uninstall, leaving 13 options in the database
    • widget_anwpfl-widget-birthday
    • anwpfl_db_version
    • widget_anwpfl-widget-cards
    • widget_anwpfl-widget-matches
    • widget_anwpfl-widget-players
    • widget_anwpfl-widget-standing
    • widget_anwpfl-widget-last-match
    • widget_anwpfl-widget-competition-list
    • widget_anwpfl-widget-next-match
    • widget_anwpfl-widget-clubs
    • ...

Smoke tests 50% 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
  • 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-player.php:30
    • > 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-staff.php:30
    • > 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/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-matches.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-next-match.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/football-leagues-by-anwppro/includes/shortcodes/class-anwpfl-shortcode-clubs.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-players.php:29

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/admin.php?page=redirect_anwpfl_premium
    • > Security (warning) in unknown
    https://anwp.pro/football-leagues-premium/ - Mixed Content: The page at 'https://anwp.pro/football-leagues-premium/' was loaded over HTTPS, but requested an insecure element 'http://anwp.pro/wp-content/uploads/2020/05/thomas-serer-r-xKieMqL34-unsplash-scaled-1.jpg'. This request was automatically upgraded to HTTPS, For more information see https://blog.chromium.org/2019/10/no-more-mixed-messages-about-https.html
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=redirect_anwpfl_premium
    • > Security (warning) in unknown
    https://anwp.pro/football-leagues-premium/ - Mixed Content: The page at 'https://anwp.pro/football-leagues-premium/' was loaded over HTTPS, but requested an insecure element 'http://anwp.pro/wp-content/uploads/2020/05/willian-justen-de-vasconcellos-21Cg_fsFBGc-unsplash-scaled-1.jpg'. This request was automatically upgraded to HTTPS, For more information see https://blog.chromium.org/2019/10/no-more-mixed-messages-about-https.html

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

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

"AnWP Football Leagues" version 0.13.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 detected161,338 lines of code in 330 files:
LanguageFilesBlank linesComment linesLines of code
CSS259,29156962,284
JavaScript386,8686,39136,340
PO File1214,27622,57233,491
PHP1495,6129,90227,915
Markdown71780524
Sass2100506
SVG9500242
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.43
Average class complexity39.85
▷ Minimum class complexity1.00
▷ Maximum class complexity359.00
Average method complexity4.36
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes53
▷ Abstract classes11.89%
▷ Concrete classes5298.11%
▷ Final classes11.92%
Methods607
▷ Static methods91.48%
▷ Public methods51384.51%
▷ Protected methods6711.04%
▷ Private methods274.45%
Functions45
▷ Named functions1533.33%
▷ Anonymous functions3066.67%
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
vendor/world-flags-sprite/images/flags32.png87.02KB51.06KB▼ 41.32%
admin/img/anwp-fl-icon.png7.23KB3.64KB▼ 49.68%
vendor/world-flags-sprite/images/flags16.png50.10KB18.91KB▼ 62.26%
public/img/empty_logo.png2.37KB1.68KB▼ 28.95%
public/img/empty_player.png2.51KB1.84KB▼ 26.74%