77% planaday-api

Code Review | Planaday API

WordPress plugin Planaday API scored77%from 54 tests.

About plugin

  • Plugin page: planaday-api
  • Plugin version: 10.5
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Nov 29, 2018
  • Latest release: Nov 21, 2023
  • Number of updates: 125
  • Update frequency: every 14.8 days
  • Top authors: planaday (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /4,255 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲1.41MB] [CPU: ▲17.72ms] Passed 4 tests

A check of server-side resources used by Planaday API
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.99 ▲1.5356.90 ▲15.34
Dashboard /wp-admin4.72 ▲1.42105.39 ▲57.40
Posts /wp-admin/edit.php4.76 ▲1.4065.23 ▲15.96
Add New Post /wp-admin/post-new.php7.30 ▲1.42110.17 ▲18.11
Media Library /wp-admin/upload.php4.63 ▲1.4058.21 ▲21.45
CSS /wp-admin/admin.php?page=planaday-api-css4.5348.33
Welkom /wp-admin/admin.php?page=planaday-api4.5154.51
Instellingen /wp-admin/admin.php?page=planaday-api-general4.6549.79

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 99 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
widget_widget_cursusdetails
can_compress_scripts
widget_widget_search
widget_recent-comments
theysaidso_admin_options
db_upgraded
planaday-api-version
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Planaday API
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,293 ▲53117.77 ▲3.518.48 ▲6.7938.88 ▼4.54
Dashboard /wp-admin2,343 ▲1667.40 ▲1.78155.72 ▲63.8746.92 ▲6.63
Posts /wp-admin/edit.php2,256 ▲1564.80 ▲2.83118.10 ▲78.9746.06 ▲7.53
Add New Post /wp-admin/post-new.php1,668 ▲14221.49 ▼1.54577.38 ▼99.8798.12 ▲45.86
Media Library /wp-admin/upload.php1,551 ▲1516.67 ▲2.47159.36 ▲58.8948.40 ▲8.53
CSS /wp-admin/admin.php?page=planaday-api-css1,1424.7794.0848.98
Welkom /wp-admin/admin.php?page=planaday-api1,0414.3945.8739.53
Instellingen /wp-admin/admin.php?page=planaday-api-general2,0958.64235.00159.31

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_widget_search
    • db_upgraded
    • theysaidso_admin_options
    • planaday-api-version
    • widget_recent-comments
    • widget_widget_cursusdetails

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=planaday-api
    • > Notice in wp-content/plugins/planaday-api/src/api/classes/settings.php+88
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=planaday-api-general
    • > Notice in wp-content/plugins/planaday-api/src/api/classes/settings/settings_general.php+515
    Undefined index: bedankurlmislukt
    • > GET request to /wp-admin/admin.php?page=planaday-api-general
    • > Notice in wp-content/plugins/planaday-api/src/api/classes/settings/settings_general.php+566
    Undefined index: mailcursusaanmelding
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=planaday-api-general
    • > Notice in wp-content/plugins/planaday-api/src/api/classes/settings/settings_general.php+584
    Undefined index: dagdelentekst
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=planaday-api-general
    • > Notice in wp-content/plugins/planaday-api/src/api/classes/settings/settings_general.php+603
    Undefined index: toonomschrijvingcursus
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=planaday-api-general
    • > Notice in wp-content/plugins/planaday-api/src/api/classes/settings/settings_general.php+626
    Undefined index: toondebuginfo
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=planaday-api-general
    • > Notice in wp-content/plugins/planaday-api/src/api/classes/settings/settings_general.php+645
    Undefined index: betalingenactief

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 18× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/planaday-api/src/api/classes/widget/widget_cursusdetails.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'shortcodes' not found in wp-content/plugins/planaday-api/src/api/classes/shortcodes/shortcodes_courselistlist.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'shortcodes' not found in wp-content/plugins/planaday-api/src/api/classes/payment.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/planaday-api/src/includes/widget.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'shortcodes' not found in wp-content/plugins/planaday-api/src/api/classes/shortcodes/shortcodes_courselistblock.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'settings' not found in wp-content/plugins/planaday-api/src/api/classes/settings/settings_support.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/planaday-api/src/api/classes/widget/widget_search.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'shortcodes' not found in wp-content/plugins/planaday-api/src/api/classes/shortcodes/shortcodes_courselisttable.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'shortcodes' not found in wp-content/plugins/planaday-api/src/api/classes/shortcodes/shortcodes_courselistblock2.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'shortcodes' not found in wp-content/plugins/planaday-api/src/api/classes/shortcodes/shortcodes_course.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 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
These attributes need to be fixed:
  • Requires at least: Invalid version format
  • Donate link: Please fix this invalid url: "n/a"
You can take inspiration from this readme.txt

planaday-api/index.php 85% from 13 tests

The main PHP script in "Planaday API" version 10.5 is automatically included on every request by WordPress
It is important to fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 179 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("planaday-api.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin38,772 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript112,8003,60215,217
PHP331,0542718,647
CSS783616,874
LESS18502554,107
SVG3003,927

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Please fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 198)
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity60.22
▷ Minimum class complexity5.00
▷ Maximum class complexity349.00
Average method complexity10.93
▷ Minimum method complexity1.00
▷ Maximum method complexity198.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes27
▷ Abstract classes00.00%
▷ Concrete classes27100.00%
▷ Final classes00.00%
Methods161
▷ Static methods5131.68%
▷ Public methods15495.65%
▷ Protected methods10.62%
▷ Private methods63.73%
Functions24
▷ Named functions24100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants133.33%
▷ Class constants266.67%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
10 PNG files occupy 0.51MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-3.png30.23KB12.00KB▼ 60.32%
assets/plugin.png1.41KB1.21KB▼ 13.80%
assets/check-ok.png8.89KB4.09KB▼ 53.93%
assets/check-info.png1.42KB1.35KB▼ 4.82%
assets/check-nok.png9.66KB4.56KB▼ 52.78%