72% ba-book-everything

Code Review | BA Book Everything

WordPress plugin BA Book Everything scored72%from 54 tests.

About plugin

  • Plugin page: ba-book-everything
  • Plugin version: 1.6.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.8-6.3.2
  • WordPress version: 6.3.1
  • First release: Jan 11, 2018
  • Latest release: Oct 19, 2023
  • Number of updates: 1
  • Update frequency: every 365.0 days

Code review

54 tests

User reviews

12 reviews

Install metrics

8,000+ active /110,167 total downloads

Benchmarks

Plugin footprint 64% 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: ▲6.77MB] [CPU: ▲51.07ms] 50% from 4 tests

Analyzing server-side resources used by BA Book Everything
It is recommended to improve the following
  • RAM: You should keep total memory usage under 10MB (currently 13.35MB on /wp-admin/post-new.php?post_type=service)
  • Extra RAM: Try to keep extra memory usage under 5MB (currently 6.77MB on /wp-admin/post-new.php?post_type=service)
PageMemory (MB)CPU Time (ms)
Home /9.53 ▲6.0691.18 ▲45.42
Dashboard /wp-admin10.32 ▲7.0197.90 ▲41.40
Posts /wp-admin/edit.php10.35 ▲6.99110.83 ▲64.21
Add New Post /wp-admin/post-new.php12.99 ▲7.10155.47 ▲56.31
Media Library /wp-admin/upload.php10.25 ▲7.0298.29 ▲61.13
All Services /wp-admin/edit.php?post_type=service10.3089.13
All Booking Objects /wp-admin/edit.php?post_type=to_book10.3184.28
All Fees /wp-admin/edit.php?post_type=fee10.3088.87
Ages /wp-admin/edit-tags.php?taxonomy=ages&post_type=to_book10.5585.97
BA Settings /wp-admin/admin.php?page=babe-settings10.2990.54
All Orders /wp-admin/edit.php?post_type=order10.3090.40
Add Booking Object /wp-admin/post-new.php?post_type=to_book11.05114.18
Addons and Themes /wp-admin/admin.php?page=babe-addons10.2498.86
Taxonomies /wp-admin/edit-tags.php?taxonomy=taxonomies_list&post_type=to_book10.5984.03
Add Service /wp-admin/post-new.php?post_type=service13.35139.54

Server storage [IO: ▲14.18MB] [DB: ▲0.04MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 754 new files
Database: 9 new tables, 14 new options
New tables
wp_babe_payment_tokenmeta
wp_babe_order_itemmeta
wp_babe_rates
wp_babe_order_items
wp_babe_payment_tokens
wp_babe_discount
wp_babe_category_deactivate_schedule
wp_babe_av_cal
wp_babe_booking_rules
New WordPress options
BABE_version
widget_babe_search_filter_price
babe_settings_en
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
BABE_db_version
BABE_roles_version
can_compress_scripts
widget_babe_widget_search_filter_terms
...

Browser metrics Passed 4 tests

BA Book Everything: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,285 ▲52416.46 ▲1.8313.68 ▲11.9439.83 ▼5.08
Dashboard /wp-admin2,508 ▲3316.41 ▲0.74104.39 ▲7.3639.44 ▼4.62
Posts /wp-admin/edit.php2,413 ▲3133.60 ▲1.6554.56 ▲15.6435.24 ▼3.17
Add New Post /wp-admin/post-new.php1,722 ▲19623.40 ▲0.38716.02 ▲61.9334.16 ▼16.27
Media Library /wp-admin/upload.php1,713 ▲3195.91 ▲1.73112.80 ▲19.8744.07 ▲2.96
All Services /wp-admin/edit.php?post_type=service1,3853.6353.8230.30
All Booking Objects /wp-admin/edit.php?post_type=to_book1,4353.6551.9630.84
All Fees /wp-admin/edit.php?post_type=fee1,3673.6447.7927.18
Ages /wp-admin/edit-tags.php?taxonomy=ages&post_type=to_book1,5523.5342.9630.28
BA Settings /wp-admin/admin.php?page=babe-settings4,1755.25104.8663.26
All Orders /wp-admin/edit.php?post_type=order1,4343.6946.2429.36
Add Booking Object /wp-admin/post-new.php?post_type=to_book4,23811.80281.49116.49
Addons and Themes /wp-admin/admin.php?page=babe-addons1,4294.7350.8370.48
Taxonomies /wp-admin/edit-tags.php?taxonomy=taxonomies_list&post_type=to_book1,7283.5644.3829.01
Add Service /wp-admin/post-new.php?post_type=service2,03817.87837.8542.13

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall successfully, leaving 9 tables in the database
    • wp_babe_payment_tokens
    • wp_babe_rates
    • wp_babe_category_deactivate_schedule
    • wp_babe_order_items
    • wp_babe_av_cal
    • wp_babe_payment_tokenmeta
    • wp_babe_discount
    • wp_babe_booking_rules
    • wp_babe_order_itemmeta
  • Zombie WordPress options detected upon uninstall: 14 options
    • widget_babe_search_filter_price
    • widget_babe_widget_booking_form
    • BABE_version
    • BABE_db_version
    • BABE_roles_version
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_babe_widget_search_form
    • babe_settings_en
    • db_upgraded
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 58× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ba-book-everything/includes/vendors/elementor/init.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ba-book-everything/includes/widgets/class-babe-search-filter-price.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Multicheck' not found in wp-content/plugins/ba-book-everything/includes/plugins/cmb2/includes/types/CMB2_Type_Taxonomy_Multicheck_Hierarchical.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/ba-book-everything/includes/plugins/cmb2/includes/types/CMB2_Type_Taxonomy_Select.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/ba-book-everything/includes/plugins/cmb2/includes/types/CMB2_Type_Checkbox.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/ba-book-everything/includes/widgets/class-babe-search-form.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/ba-book-everything/includes/plugins/cmb2/includes/types/CMB2_Type_Wysiwyg.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller_Boxes' not found in wp-content/plugins/ba-book-everything/includes/plugins/cmb2/includes/rest-api/CMB2_REST_Controller_Fields.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/ba-book-everything/includes/plugins/cmb2/includes/types/CMB2_Type_Text_Datetime_Timestamp.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/ba-book-everything/includes/plugins/cmb2/includes/types/CMB2_Type_Textarea_Code.php:13

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)
There were no browser issues found

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 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
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 16 tag instead of maximum 10
  • Screenshots: These screenshots need descriptions #1, #10, #11, #2, #3, #4, #5, #6, #7, #8, #9 in ba-book-everything/assets to your readme.txt
Please take inspiration from this readme.txt

ba-book-everything/babe-bootstrap.php 85% from 13 tests

Analyzing the main PHP file in "BA Book Everything" version 1.6.0
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ba-book-everything.php" instead of "babe-bootstrap.php")
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 141 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin142,346 lines of code in 466 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript16413,8569,69041,630
PHP1119,98613,10333,941
PO File12014,31518,50232,323
CSS585,6511,51124,193
SVG40138,977
Markdown637101,151
XML10052
JSON10051
Sass15028

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
It is recommended to fix the following
  • Method cyclomatic complexity should be reduced to less than 100 (currently 121)
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity40.88
▷ Minimum class complexity1.00
▷ Maximum class complexity748.00
Average method complexity4.26
▷ Minimum method complexity1.00
▷ Maximum method complexity121.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes119
▷ Abstract classes97.56%
▷ Concrete classes11092.44%
▷ Final classes00.00%
Methods1,456
▷ Static methods85558.72%
▷ Public methods1,31290.11%
▷ Protected methods1127.69%
▷ Private methods322.20%
Functions44
▷ Named functions4295.45%
▷ Anonymous functions24.55%
Constants27
▷ Global constants1037.04%
▷ Class constants1762.96%
▷ Public constants17100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
108 PNG files occupy 1.15MB with 0.44MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
includes/plugins/cmb2/images/ui-icons_2e83ff_256x240.png4.27KB4.11KB▼ 3.78%
js/unitegallery/skins/alexis/images/button_zoom_back.png1.54KB0.61KB▼ 60.01%
includes/plugins/cmb2/images/ui-icons_454545_256x240.png4.27KB4.11KB▼ 3.78%
css/img/ba_payments_banners.png104.21KB43.06KB▼ 58.68%
js/unitegallery/images/play-button-square.png4.48KB1.62KB▼ 63.89%