62% teams-of-tennis

Code Review | Teams of Tennis

WordPress plugin Teams of Tennis scored62%from 54 tests.

About plugin

  • Plugin page: teams-of-tennis
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-4.9.4
  • WordPress version: 6.3.1
  • First release: Apr 10, 2018
  • Latest release: Apr 14, 2018
  • Number of updates: 32
  • Update frequency: every 0.2 days
  • Top authors: vrriecke (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /740 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 gracefully, with no errors

Server metrics [RAM: ▼0.88MB] [CPU: ▼35.57ms] Passed 4 tests

Analyzing server-side resources used by Teams of Tennis
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0839.87 ▼0.61
Dashboard /wp-admin3.06 ▼0.2427.45 ▼32.84
Posts /wp-admin/edit.php3.06 ▼0.3024.76 ▼24.60
Add New Post /wp-admin/post-new.php3.06 ▼2.8326.55 ▼70.70
Media Library /wp-admin/upload.php3.06 ▼0.1722.57 ▼14.14
Teams of Tennis /wp-admin/options-general.php?page=Teams-of-Tennis3.0626.05

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 21 new files
Database: no new tables, 9 new options
New WordPress options
vr_tennisballmodus_link
vr_tennisclub_link
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
vr_tennisteam_link
db_upgraded
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Teams of Tennis
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.34 ▲0.111.92 ▲0.3643.39 ▼2.37
Dashboard /wp-admin2,202 ▲255.57 ▼0.0094.59 ▼2.6342.32 ▼9.04
Posts /wp-admin/edit.php2,104 ▲42.04 ▲0.0034.17 ▼3.8232.94 ▼3.09
Add New Post /wp-admin/post-new.php1,529 ▲323.19 ▼0.48676.07 ▲10.5162.75 ▲12.01
Media Library /wp-admin/upload.php1,407 ▲134.15 ▼0.02112.12 ▲4.8346.60 ▼2.23
Teams of Tennis /wp-admin/options-general.php?page=Teams-of-Tennis8301.9922.5728.05

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method VR_TennisOptions::register_options_page() should not be called statically
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=Teams-of-Tennis
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method VR_TennisOptions::register_options_page() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=Teams-of-Tennis
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method VR_TennisOptions::register_settings() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=Teams-of-Tennis
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method VR_TennisOptions::options_page() should not be called statically
    • > GET request to /wp-admin/options-general.php?page=Teams-of-Tennis
    • > 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=Teams-of-Tennis
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

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
Please fix the following
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/teams-of-tennis/templates/teamlink.php
    • > /wp-content/plugins/teams-of-tennis/templates/clublink.php
  • 24× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/teams-of-tennis/templates/available.php on line 11
    • > PHP Notice
      Undefined variable: player_ids in wp-content/plugins/teams-of-tennis/templates/available.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/teams-of-tennis/includes/teamlink.php:7
    • > PHP Notice
      Undefined variable: teamPortraitLink in wp-content/plugins/teams-of-tennis/templates/teamlink.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/teams-of-tennis/includes/install.php:7
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/teams-of-tennis/templates/available.php on line 21
    • > PHP Notice
      Undefined variable: height in wp-content/plugins/teams-of-tennis/templates/clublink.php on line 1
    • > PHP Notice
      Undefined variable: scores in wp-content/plugins/teams-of-tennis/templates/livescore.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/teams-of-tennis/templates/livescore.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/teams-of-tennis/includes/livescore.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Donate link: Please fix this invalid url: ""
Please take inspiration from this readme.txt

teams-of-tennis/teams-of-tennis.php Passed 13 tests

The principal PHP file in "Teams of Tennis" v. 1.0.3 is loaded by WordPress automatically on each request
43 characters long description:
manage tennis teams and clubs from BTV page

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin1,875 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP152942791,875

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity39.00
▷ Minimum class complexity1.00
▷ Maximum class complexity198.00
Average method complexity3.97
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods115
▷ Static methods86.96%
▷ Public methods9280.00%
▷ Protected methods1613.91%
▷ Private methods76.09%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants26
▷ Global constants2596.15%
▷ Class constants13.85%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
5 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/unknown.png3.11KB0.59KB▼ 81.05%
public/images/yes.png3.16KB0.56KB▼ 82.39%
public/images/ifneeded.png3.44KB0.85KB▼ 75.42%
public/images/trash.png1.48KB1.17KB▼ 20.84%
public/images/no.png3.27KB0.75KB▼ 77.10%