77% salon-booking

Code Review | Salon Booking

WordPress plugin Salon Booking scored77%from 54 tests.

About plugin

  • Plugin page: salon-booking
  • Plugin version: 1.8.18
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.6
  • WordPress version: 6.3.1
  • First release: Jul 6, 2013
  • Latest release: Apr 16, 2022
  • Number of updates: 265
  • Update frequency: every 12.2 days
  • Top authors: Tanaka Hisao (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

900+ active /35,488 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.77MB] [CPU: ▼2.04ms] Passed 4 tests

Analyzing server-side resources used by Salon Booking
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.22 ▲0.7648.92 ▲5.49
Dashboard /wp-admin4.11 ▲0.8158.68 ▲1.14
Posts /wp-admin/edit.php4.16 ▲0.8156.60 ▼0.19
Add New Post /wp-admin/post-new.php6.65 ▲0.7694.53 ▼14.60
Media Library /wp-admin/upload.php3.97 ▲0.7448.74 ▲7.12
Staff Information /wp-admin/admin.php?page=salon_staff6.0662.57
Environment Setting /wp-admin/admin.php?page=salon_config5.9552.43
Promotion /wp-admin/admin.php?page=salon_promotion5.9655.45
Menu Information /wp-admin/admin.php?page=salon_item5.9853.45
Shop Information /wp-admin/admin.php?page=salon_branch5.9751.66
View Log /wp-admin/admin.php?page=salon_log5.9051.48
Time Card /wp-admin/admin.php?page=salon_working5.9851.52
Position Information /wp-admin/admin.php?page=salon_position5.9447.26
Mail Setting /wp-admin/admin.php?page=salon_mail5.9350.79
Reservation Regist /wp-admin/admin.php?page=salon-booking-management5.9953.80

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

How much does this plugin use your filesystem and database?
Please fix the following
  • The plugin illegally modified 2 files (0.00KB) outside of "wp-content/plugins/salon-booking/" and "wp-content/uploads/"
    • (new file) "wp-content/plugins/salon-booking/images/13_\346\223\215\344\275\234.png"
    • (new file) "wp-content/plugins/salon-booking/images/12_\343\203\234\343\202\277\343\203\263.png"
Filesystem: 1,244 new files
Database: 13 new tables, 10 new options
New tables
wp_salon_category
wp_salon_branch
wp_salon_customer
wp_salon_customer_record
wp_salon_position
wp_salon_log
wp_salon_working
wp_salon_reservation
wp_salon_staff
wp_salon_promotion
...
New WordPress options
salon_confirm_page_id
salon_holiday
widget_theysaidso_widget
widget_recent-comments
salon_initial_user
can_compress_scripts
theysaidso_admin_options
db_upgraded
salon_installed
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Salon Booking
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,885 ▲12414.25 ▼0.301.79 ▲0.0243.26 ▼5.45
Dashboard /wp-admin2,291 ▲1115.58 ▼0.0985.99 ▼3.4584.93 ▲45.14
Posts /wp-admin/edit.php2,199 ▲1022.03 ▲0.0336.24 ▼2.8034.24 ▲0.93
Add New Post /wp-admin/post-new.php1,618 ▲9223.16 ▼0.52752.22 ▲35.7056.94 ▼10.20
Media Library /wp-admin/upload.php1,493 ▲934.25 ▲0.04107.60 ▲1.5377.43 ▲30.64
Staff Information /wp-admin/admin.php?page=salon_staff1,8233.3789.4771.63
Environment Setting /wp-admin/admin.php?page=salon_config1,4622.1738.6139.25
Promotion /wp-admin/admin.php?page=salon_promotion1,4052.4355.8047.83
Menu Information /wp-admin/admin.php?page=salon_item1,5762.3960.8950.08
Shop Information /wp-admin/admin.php?page=salon_branch1,8502.4558.1555.35
View Log /wp-admin/admin.php?page=salon_log1,1252.6445.6237.63
Time Card /wp-admin/admin.php?page=salon_working1,8152.6258.0354.00
Position Information /wp-admin/admin.php?page=salon_position1,5192.8150.8247.82
Mail Setting /wp-admin/admin.php?page=salon_mail1,2862.0635.0735.04
Reservation Regist /wp-admin/admin.php?page=salon-booking-management1,5392.4754.5248.52

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=salon_staff
    • > POST request to /wp-admin/admin-ajax.php?action=slstaff
    • > Notice in wp-content/plugins/salon-booking/src/comp/staff-component.php+108
    Undefined index: mobile

SRP 50% 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
  • 369× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant SL_PLUGIN_SRC_DIR - assumed 'SL_PLUGIN_SRC_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/salon-booking/src/control/log-control.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'SL_PLUGIN_SRC_DIRpage/salon-page.php' (include_path='.:/usr/share/php') in wp-content/plugins/salon-booking/src/page/customer-init.php on line 3
    • > PHP Warning
      Use of undefined constant SL_PLUGIN_SRC_DIR - assumed 'SL_PLUGIN_SRC_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/salon-booking/src/page/working-page.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'SL_PLUGIN_SRC_DIRcontrol/salon-control.php' (include_path='.:/usr/share/php') in wp-content/plugins/salon-booking/src/control/booking-control.php on line 3
    • > PHP Warning
      require_once(SL_PLUGIN_SRC_DIRcontrol/salon-control.php): failed to open stream: No such file or directory in wp-content/plugins/salon-booking/src/control/item-control.php on line 3
    • > PHP Warning
      require_once(SL_PLUGIN_SRC_DIRpage/booking-edit.php): failed to open stream: No such file or directory in wp-content/plugins/salon-booking/src/page/booking-mobile-edit.php on line 3
    • > PHP Warning
      Use of undefined constant SL_PLUGIN_SRC_DIR - assumed 'SL_PLUGIN_SRC_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/salon-booking/src/control/record-control.php on line 3
    • > PHP Warning
      Use of undefined constant SL_PLUGIN_SRC_DIR - assumed 'SL_PLUGIN_SRC_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/salon-booking/src/data/checkconfig-data.php on line 3
    • > PHP Warning
      Use of undefined constant SL_PLUGIN_SRC_DIR - assumed 'SL_PLUGIN_SRC_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/salon-booking/src/page/staff-edit.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'SL_PLUGIN_SRC_DIRpage/salon-page.php' (include_path='.:/usr/share/php') in wp-content/plugins/salon-booking/src/page/promotion-edit.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

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:
  • Screenshots: These screenshots lack descriptions #2, #3, #4, #5 in salon-booking/assets to your readme.txt
  • Tags: You are using too many tags: 11 tag instead of maximum 10
You can look at the official readme.txt

salon-booking/salon.php 92% from 13 tests

The main file in "Salon Booking" v. 1.8.18 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("salon-booking.php" instead of "salon.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin34,026 lines of code in 1,134 files:
LanguageFilesBlank linesComment linesLines of code
PHP1585,3361,72226,862
CSS95107282,759
PO File17661,1732,353
JavaScript131182061,099
JSON95300953

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.29
Average class complexity15.64
▷ Minimum class complexity1.00
▷ Maximum class complexity394.00
Average method complexity3.55
▷ Minimum method complexity1.00
▷ Maximum method complexity89.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes173
▷ Abstract classes31.73%
▷ Concrete classes17098.27%
▷ Final classes00.00%
Methods997
▷ Static methods10610.63%
▷ Public methods94194.38%
▷ Protected methods10.10%
▷ Private methods555.52%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants205
▷ Global constants2411.71%
▷ Class constants18188.29%
▷ Public constants181100.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
77 compressed PNG files occupy 0.30MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/12_ボタン.png1.85KB0.95KB▼ 48.36%
css/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
booking/imgs/resize_dots.png0.11KB0.10KB▼ 7.21%
booking/imgs_glossy/blue_tab.png0.24KB0.25KB0.00%
css/images/magnifier.png0.60KB0.60KB0.00%