74% occupancy-plan

Code Review | Occupancy Plan

WordPress plugin Occupancy Plan scored 74% from 54 tests.

About plugin

  • Plugin page: occupancy-plan
  • Plugin version: 1.3.18
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3.1
  • WordPress version: 6.3.1
  • First release: Jul 28, 2020
  • Latest release: Sep 26, 2023
  • Number of updates: 106
  • Update frequency: every 10.9 days
  • Top authors: tharkun69 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active / 5,089 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.11MB] [CPU: ▼7.79ms] Passed 4 tests

An overview of server-side resources used by Occupancy Plan
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0935.61 ▼8.32
Dashboard /wp-admin3.41 ▲0.1144.14 ▼6.06
Posts /wp-admin/edit.php3.53 ▲0.1750.22 ▲4.88
Add New Post /wp-admin/post-new.php6.01 ▲0.1384.05 ▼15.18
Media Library /wp-admin/upload.php3.33 ▲0.1037.43 ▼1.61
Prepared Booking /wp-admin/admin.php?page=occupancy-plan-prepared-blocks3.3637.32
New Time Slot /wp-admin/admin.php?page=occupancy-plan-time-slot3.3635.15
Provisional Bookings /wp-admin/admin.php?page=occupancy-plan-provisional-blocks3.3635.25
New Court Name /wp-admin/admin.php?page=occupancy-plan-court-name3.3732.69
Bookings /wp-admin/admin.php?page=occupancy-plan-blocks3.3635.01
New Booking /wp-admin/admin.php?page=occupancy-plan-block3.5635.71
Time Slots /wp-admin/admin.php?page=occupancy-plan-time-slots3.3635.74
New Prepared Booking /wp-admin/admin.php?page=occupancy-plan-prepared-block3.3833.33
Court Names /wp-admin/admin.php?page=occupancy-plan-court-names3.3635.24
New Occupancy Schedule /wp-admin/admin.php?page=occupancy-plan-plan3.5732.18

Server storage [IO: ▲0.73MB] [DB: ▲0.01MB] Passed 3 tests

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 58 new files
Database: 6 new tables, 7 new options
New tables
wp_occupancy_plan_court_name
wp_occupancy_plan_time_slot
wp_occupancy_plan_block
wp_occupancy_plan_prepared_block
wp_occupancy_plan_approval_process
wp_occupancy_plan
New WordPress options
widget_theysaidso_widget
occupancy_plan_db_version
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Occupancy Plan
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,889 ▲15413.62 ▼0.751.53 ▼0.3240.58 ▼3.88
Dashboard /wp-admin2,292 ▲1075.38 ▼0.50116.64 ▲16.3644.12 ▲2.82
Posts /wp-admin/edit.php2,122 ▲332.53 ▲0.5140.56 ▲4.6733.78 ▼0.62
Add New Post /wp-admin/post-new.php1,563 ▲2017.92 ▼5.22669.98 ▼1.8035.34 ▼25.18
Media Library /wp-admin/upload.php1,444 ▲564.59 ▲0.3689.80 ▼5.5538.09 ▼8.04
Prepared Booking /wp-admin/admin.php?page=occupancy-plan-prepared-blocks1,1402.1833.3832.68
New Time Slot /wp-admin/admin.php?page=occupancy-plan-time-slot9502.3027.9623.53
Provisional Bookings /wp-admin/admin.php?page=occupancy-plan-provisional-blocks1,2692.1728.8829.29
New Court Name /wp-admin/admin.php?page=occupancy-plan-court-name9532.1927.9426.53
Bookings /wp-admin/admin.php?page=occupancy-plan-blocks1,2942.1929.1734.36
New Booking /wp-admin/admin.php?page=occupancy-plan-block1,6402.6249.3529.68
Time Slots /wp-admin/admin.php?page=occupancy-plan-time-slots1,0242.1828.5927.13
New Prepared Booking /wp-admin/admin.php?page=occupancy-plan-prepared-block1,1702.6348.7226.74
Court Names /wp-admin/admin.php?page=occupancy-plan-court-names1,0922.1728.2427.33
New Occupancy Schedule /wp-admin/admin.php?page=occupancy-plan-plan2,3853.2463.9235.48

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie tables were found after uninstall: 2 tables
    • wp_occupancy_plan
    • wp_occupancy_plan_approval_process
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • occupancy_plan_db_version
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following
  • 27× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: atts in wp-content/plugins/occupancy-plan/public/partials/occupancy-plan-public-display.php on line 22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/occupancy-plan/admin/partials/occupancy-plan-plans.php:17
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/occupancy-plan/admin/class-occupancy-plan-court-names.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/occupancy-plan/public/partials/occupancy-plan-public-display.php:25
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/occupancy-plan/admin/class-occupancy-plan-time-slots.php on line 20
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/occupancy-plan/admin/class-occupancy-plan-prepared-blocks.php on line 20
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/occupancy-plan/admin/class-occupancy-plan-prepared-blocks.php on line 20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/occupancy-plan/admin/partials/occupancy-plan-provisional-blocks.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/occupancy-plan/admin/partials/occupancy-plan-time-slots.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/occupancy-plan/admin/partials/occupancy-plan-prepared-blocks.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
6 plugin tags: belegungsplan, occupancy plan, hallenbelegung, buchungen, reservierung...

occupancy-plan/occupancy-plan.php Passed 13 tests

The main file in "Occupancy Plan" v. 1.3.18 serves as a complement to information provided in readme.txt and as the entry point to the plugin
29 characters long description:
Management of Occupancy Plans

Code Analysis Passed 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
Good job! No executable or dangerous file extensions detected10,110 lines of code in 37 files:
LanguageFilesBlank linesComment linesLines of code
PHP267901,8517,703
JavaScript31871561,433
PO File1307767620
CSS68972340
HTML10114

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.53
Average class complexity72.60
▷ Minimum class complexity1.00
▷ Maximum class complexity303.00
Average method complexity5.31
▷ Minimum method complexity1.00
▷ Maximum method complexity65.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods166
▷ Static methods42.41%
▷ Public methods11569.28%
▷ Protected methods00.00%
▷ Private methods5130.72%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
12 PNG files occupy 0.07MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/css/images/ui-icons_777620_256x240.png4.44KB4.17KB▼ 6.02%
admin/css/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
public/css/images/ui-icons_444444_256x240.png6.83KB4.17KB▼ 38.86%
admin/css/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
admin/css/images/ui-icons_777777_256x240.png6.83KB4.17KB▼ 38.92%