78% shortcodes-knvb-api

Code Review | Shortcodes KNVB API

WordPress plugin Shortcodes KNVB API scored 78% from 54 tests.

About plugin

  • Plugin page: shortcodes-knvb-api
  • Plugin version: 1.14.3.10
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.7.3
  • WordPress version: 5.8.1
  • First release: Apr 29, 2016
  • Latest release: Apr 6, 2017
  • Number of updates: 63
  • Update frequency: every 5.4 days
  • Top authors: wimarschippers (95.24%)archimedict (6.35%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,522 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼1.67MB] [CPU: ▼210.23ms] Passed 4 tests

Server-side resources used by Shortcodes KNVB API
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /1.96 ▼0.757.86 ▼20.74
Dashboard /wp-admin1.98 ▼1.077.09 ▼41.34
Posts /wp-admin/edit.php1.98 ▼1.125.51 ▼44.61
Add New Post /wp-admin/post-new.php1.98 ▼3.457.28 ▼717.27
Media Library /wp-admin/upload.php1.98 ▼1.025.77 ▼37.68
KNVB API /wp-admin/options-general.php?page=knvb-api-menu1.997.98

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 21 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Shortcodes KNVB API: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,690 ▲9415.97 ▲0.059.25 ▼3.8557.56 ▲3.29
Dashboard /wp-admin2,977 ▲465.89 ▼0.06154.27 ▼0.77109.57 ▼1.31
Posts /wp-admin/edit.php2,746 ▲72.72 ▲0.0164.60 ▼3.9090.07 ▲0.22
Add New Post /wp-admin/post-new.php1,688 ▲518.31 ▼0.39408.12 ▲13.50113.87 ▲2.23
Media Library /wp-admin/upload.php1,755 ▼525.02 ▼0.03153.84 ▼6.44127.04 ▲2.26
KNVB API /wp-admin/options-general.php?page=knvb-api-menu1,1842.0962.5684.36

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5663
    wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the knvb-api-style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)

Smoke tests 50% 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)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=knvb-api-menu
    • > User notice in wp-includes/functions.php+5663
    wp_enqueue_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the knvb-api-style handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=knvb-api-menu
    • > Notice in wp-content/plugins/shortcodes-knvb-api/shortcode-knvb-client.php+41
    Undefined property: stdClass::$List
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=knvb-api-menu
    • > Notice in wp-content/plugins/shortcodes-knvb-api/shortcode-knvb-client.php+41
    Trying to access array offset on value of type null
    • > GET request to /wp-admin/options-general.php?page=knvb-api-menu
    • > Notice in wp-content/plugins/shortcodes-knvb-api/shortcode-knvb-client.php+40
    Trying to get property 'PHPSESSID' of non-object
    • > GET request to /wp-admin/options-general.php?page=knvb-api-menu
    • > Notice in wp-content/plugins/shortcodes-knvb-api/shortcode-knvb-client.php+41
    Trying to get property 'clubnaam' of non-object

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/shortcodes-knvb-api/shortcode-knvb-client.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_style() in wp-content/plugins/shortcodes-knvb-api/shortcode-knvb-client.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
5 plugin tags: dutch, voetbal, soccer, api, knvb

shortcodes-knvb-api/shortcode-knvb-api-plugin.php 85% from 13 tests

The principal PHP file in "Shortcodes KNVB API" v. 1.14.3.10 is loaded by WordPress automatically on each request
The following require your attention:
  • Description: Please don't use more than 140 characters for the plugin description (currently 147 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("shortcodes-knvb-api.php" instead of "shortcode-knvb-api-plugin.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin2,710 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
HTML1439671,539
PHP33534661,092
JavaScript19044
CSS23035

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 106)
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity45.20
▷ Minimum class complexity1.00
▷ Maximum class complexity126.00
Average method complexity9.28
▷ Minimum method complexity1.00
▷ Maximum method complexity106.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods26
▷ Static methods13.85%
▷ Public methods1765.38%
▷ Protected methods934.62%
▷ Private methods00.00%
Functions11
▷ Named functions872.73%
▷ Anonymous functions327.27%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected