55% indiebooking

Code Review | Indiebooking

WordPress plugin Indiebooking scored 55% from 54 tests.

About plugin

  • Plugin page: indiebooking
  • Plugin version: 1.3.5
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Dec 14, 2016
  • Latest release: Nov 14, 2018
  • Number of updates: 48
  • Update frequency: every 15.0 days
  • Top authors: cschmitt91 (97.92%)jjdenig (4.17%)

Code review

54 tests

User reviews

4 reviews

Install metrics

10+ active / 2,431 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.59MB] [CPU: ▼5.35ms] Passed 4 tests

A check of server-side resources used by Indiebooking
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.22 ▲0.7640.74 ▲1.21
Dashboard /wp-admin3.92 ▲0.6154.09 ▲1.52
Posts /wp-admin/edit.php3.97 ▲0.6151.34 ▼16.26
Add New Post /wp-admin/post-new.php6.47 ▲0.5888.98 ▼7.88
Media Library /wp-admin/upload.php3.77 ▲0.5438.86 ▲1.85
Settings /wp-admin/admin.php?page=rs_einstellungen4.1140.07
Apartment booking /wp-admin/edit.php?post_type=rsappartment_buchung3.8639.39
Categories /wp-admin/edit-tags.php?taxonomy=rsappartmentcategories&post_type=rsappartment3.8034.57
Apartments /wp-admin/edit.php?post_type=rsappartment3.8637.70

Server storage [IO: ▲27.57MB] [DB: ▲0.02MB] 67% from 3 tests

Analyzing filesystem and database footprints of this plugin
Just a few items left to fix
  • Filesystem usage must be lower than 25MB (currently using 27.57MB)
Filesystem: 937 new files
Database: 13 new tables, 23 new options
New tables
wp_rs_indiebooking_buchungskopf
wp_rs_indiebooking_buchung_rabatt
wp_rs_indiebooking_apartment_saison
wp_rewabp_termmeta
wp_rewabp_appartment_buchungszeitraum
wp_rs_indiebooking_mailprintjob
wp_rs_indiebooking_buchung_zahlungen
wp_rs_indiebooking_apartment_gesperrter_zeitraum
wp_rs_indiebooking_buchung_mwst
wp_rs_indiebooking_errorlog
...
New WordPress options
rs_indiebooking_settings_mail_booking_confirmation_txt
rs_indiebooking_settings_mwst
rs_indiebooking_version
rs_indiebooking_settings_show_welcome_kz
rs_indiebooking_settings_mail_storno_confirmation_txt
rs_indiebooking_settings_mail_storno_subject
rs_indiebooking_settings_mwst_nextId
rs_indiebooking_settings_mail_confirm_subject
rs_indiebooking_settings_mail_deposit_reminder_txt
widget_recent-posts
...

Browser metrics Passed 4 tests

A check of browser resources used by Indiebooking
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,086 ▲31515.42 ▲0.6719.48 ▲17.3437.05 ▼5.06
Dashboard /wp-admin2,279 ▲915.71 ▲0.84118.26 ▲9.2078.72 ▲35.31
Posts /wp-admin/edit.php2,184 ▲912.56 ▲0.5545.53 ▲4.5763.38 ▲26.61
Add New Post /wp-admin/post-new.php1,600 ▲6523.67 ▲0.39685.41 ▲84.0937.63 ▼22.13
Media Library /wp-admin/upload.php1,467 ▲765.01 ▲0.80100.89 ▼1.3282.77 ▲39.98
Settings /wp-admin/admin.php?page=rs_einstellungen5,37314.05456.39203.71
Apartment booking /wp-admin/edit.php?post_type=rsappartment_buchung1,3253.4558.4073.30
Categories /wp-admin/edit-tags.php?taxonomy=rsappartmentcategories&post_type=rsappartment1,5203.0058.2944.80
Apartments /wp-admin/edit.php?post_type=rsappartment1,2503.4149.2138.98

Uninstaller [IO: ▲0.00MB] [DB: ▲0.02MB] 50% 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
  • Zombie tables were found after uninstall: 13 tables
    • wp_rs_indiebooking_teilbuchungskopf
    • wp_rs_indiebooking_errorlog
    • wp_rs_indiebooking_apartment_gesperrter_zeitraum
    • wp_rs_indiebooking_apartment_saison
    • wp_rs_indiebooking_buchung_mwst
    • wp_rs_indiebooking_buchungposition
    • wp_rs_indiebooking_apartment_degression
    • wp_rs_indiebooking_mailprintjob
    • wp_rewabp_termmeta
    • wp_rs_indiebooking_buchungskopf
    • ...
  • This plugin did not uninstall successfully, leaving 23 options in the database
    • widget_recent-posts
    • rs_indiebooking_version
    • widget_recent-comments
    • rs_indiebooking_settings_filter
    • rs_indiebooking_settings_allow_statistics_kz
    • rs_indiebooking_settings_mail_deposit_reminder_subject
    • rs_indiebooking_settings_mail_invoice_subject
    • rs_indiebooking_settings_mail_deposit_reminder_txt
    • theysaidso_admin_options
    • widget_rs_indiebooking_fast_link_widget
    • ...

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=rs_einstellungen
    • > Notice in wp-content/plugins/indiebooking/includes/admin/view/settings_tabs/RS_IB_Settings_View_Company_Tab.php+126
    Undefined variable: companyOrPrivate
    • > GET request to /wp-admin/admin.php?page=rs_einstellungen
    • > Notice in wp-content/plugins/indiebooking/includes/admin/view/settings_tabs/RS_IB_Settings_View_Print_Tab.php+37
    Trying to access array offset on value of type bool
    • > GET request to /wp-admin/admin.php?page=rs_einstellungen
    • > POST request to /wp-admin/admin-ajax.php
    • > Notice in wp-content/plugins/indiebooking/includes/controller/rs_ib_backend_controller_wp_ajax.php+77
    file_get_contents(): read of 8192 bytes failed with errno=21 Is a directory

SRP 0% 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
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/indiebooking/mpdf7/vendor/mpdf/mpdf/qrcode/index.php
    • > /wp-content/plugins/indiebooking/mpdf7/vendor/mpdf/mpdf/qrcode/image.php
    • > /wp-content/plugins/indiebooking/templates/appartment_suche/appartment_suche_box_parts/appartment_suche_box_category.php
    • > /wp-content/plugins/indiebooking/mpdf7/vendor/mpdf/mpdf/compress.php
    • > /wp-content/plugins/indiebooking/templates/appartment_suche/appartment_suche_box_parts/appartment_suche_box_features.php
  • 83× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/indiebooking/templates/appartment_suche/appartment_suche_box_parts/appartment_suche_box_features.php on line 9
    • > PHP Notice
      Undefined variable: apavailabledates in wp-content/plugins/indiebooking/templates/appartment_suche/appartment_suche_box.php on line 66
    • > PHP Notice
      Undefined variable: fullyBookedDays in wp-content/plugins/indiebooking/templates/appartment_suche/appartment_suche_box.php on line 17
    • > PHP Notice
      Undefined variable: fullyBookedDays in wp-content/plugins/indiebooking/templates/appartment_suche/appartment_suche_box_small.php on line 17
    • > PHP Notice
      Undefined variable: freeBookingRanges in wp-content/plugins/indiebooking/templates/appartment_suche/appartment_suche_box_small.php on line 18
    • > PHP Warning
      Use of undefined constant _MPDF_PATH - assumed '_MPDF_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/indiebooking/mpdf7/vendor/mpdf/mpdf/graph.php on line 12
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/indiebooking/mpdf7/vendor/mpdf/mpdf/config_fonts-distr-without-OTL.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/indiebooking/templates/appartment_suche/appartment_suche_box.php:74
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/indiebooking/includes/widgets/rs_indiebooking_widget_controller.php:13
    • > PHP Notice
      Undefined variable: minnaechte in wp-content/plugins/indiebooking/templates/single-appartment-buchung/appartment_from_to_dates.php on line 20

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/admin.php?page=rs_einstellungen
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=rs_einstellungen 0:0 Uncaught SyntaxError: Unexpected end of JSON input

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Tags: Too many tags (19 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Requires at least: Version not formatted correctly
Please take inspiration from this readme.txt

indiebooking/rewasoft_indiebooking.php 92% from 13 tests

The main PHP file in "Indiebooking" ver. 1.3.5 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("indiebooking.php" instead of "rewasoft_indiebooking.php")

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin128,293 lines of code in 389 files:
LanguageFilesBlank linesComment linesLines of code
PHP32510,57218,249119,813
CSS258895815,848
JavaScript213364251,559
Markdown101560435
SVG200423
JSON4120181
XML23034

PHP code 0% from 2 tests

An overview of cyclomatic complexity and code structure
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 8,314)
  • Cyclomatic complexity of methods should be reduced to less than 100 (currently 1,542)
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity152.27
▷ Minimum class complexity1.00
▷ Maximum class complexity8,314.00
Average method complexity10.14
▷ Minimum method complexity1.00
▷ Maximum method complexity1,542.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes134
▷ Abstract classes53.73%
▷ Concrete classes12996.27%
▷ Final classes00.00%
Methods2,217
▷ Static methods26612.00%
▷ Public methods2,09494.45%
▷ Protected methods482.17%
▷ Private methods753.38%
Functions154
▷ Named functions15198.05%
▷ Anonymous functions31.95%
Constants693
▷ Global constants507.22%
▷ Class constants64392.78%
▷ Public constants643100.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
84 PNG files occupy 0.29MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon_check.png0.53KB0.59KB0.00%
assets/slider_control_images/b02.png2.60KB1.35KB▼ 47.95%
assets/images/icon_xmark.png0.51KB0.51KB0.00%
assets/slider_control_images/a16.png2.90KB2.12KB▼ 26.83%
images/paypal_btn.png4.21KB2.39KB▼ 43.37%