62% ns-booking-agenda

Code Review | NS Booking Calendar Agenda

WordPress plugin NS Booking Calendar Agenda scored62%from 54 tests.

About plugin

  • Plugin page: ns-booking-agenda
  • Plugin version: 1.3.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.9
  • WordPress version: 6.3.1
  • First release: May 5, 2017
  • Latest release: Feb 7, 2022
  • Number of updates: 40
  • Update frequency: every 43.5 days
  • Top authors: nsthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /3,301 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.83MB] [CPU: ▼40.93ms] Passed 4 tests

This is a short check of server-side resources used by NS Booking Calendar Agenda
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.16 ▼0.3117.10 ▼22.94
Dashboard /wp-admin3.20 ▼0.1520.32 ▼46.16
Posts /wp-admin/edit.php3.20 ▼0.1620.13 ▼21.90
Add New Post /wp-admin/post-new.php3.20 ▼2.6920.09 ▼72.72
Media Library /wp-admin/upload.php3.20 ▼0.0322.60 ▼8.85
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version3.2018.30
Add New /wp-admin/post-new.php?post_type=ns_agenda3.2028.05
Agenda /wp-admin/edit.php?post_type=ns_agenda3.2019.68
/wp-admin/admin.php?page=plugineye2223.2022.16
Booking Agenda /wp-admin/admin.php?page=ns-booking-agenda/ns-admin-options-pro/ns_admin_option_dashboard.php3.2018.93

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 53 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
ns_agenda_is_hourly
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for NS Booking Calendar Agenda
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,981 ▲23513.65 ▼1.0811.42 ▲9.7443.09 ▼0.66
Dashboard /wp-admin2,258 ▲785.69 ▼0.0087.26 ▼0.5370.87 ▲29.53
Posts /wp-admin/edit.php2,172 ▲722.24 ▲0.2433.49 ▼3.1831.47 ▼2.35
Add New Post /wp-admin/post-new.php1,748 ▲21922.26 ▼0.77720.30 ▲127.4765.06 ▲16.90
Media Library /wp-admin/upload.php1,469 ▲754.25 ▼0.03101.41 ▲5.7975.48 ▲34.36
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version3,01813.05438.76189.56
Add New /wp-admin/post-new.php?post_type=ns_agenda1,6462.6748.6053.94
Agenda /wp-admin/edit.php?post_type=ns_agenda1,2402.1832.2330.67
/wp-admin/admin.php?page=plugineye2229631.8426.8326.05
Booking Agenda /wp-admin/admin.php?page=ns-booking-agenda/ns-admin-options-pro/ns_admin_option_dashboard.php1,0071.8423.2829.07

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ns-booking-agenda/ns-admin-options-pro/ns_admin_option_dashboard.php
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.
    • > GET request to /wp-admin/edit.php?post_type=ns_agenda
    • > Notice in wp-content/plugins/ns-booking-agenda/ns-agenda-custom-post.php+231
    Undefined variable: colunns
    • > GET request to /wp-admin/edit.php?post_type=ns_agenda
    • > Notice in wp-content/plugins/ns-booking-agenda/ns-agenda-custom-post.php+231
    Trying to access array offset on value of type null

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 take a closer look at the following
  • 10× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-booking-agenda/ns-agenda-option-struct.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-booking-agenda/outlook-integration/async-outlook-export.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/ns-booking-agenda/ns-agenda-calendar-available-template-page.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-booking-agenda/outlook-integration/async-outlook-import.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-booking-agenda/ns-agenda-custom-post.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/ns-booking-agenda/calendar-template-page.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-booking-agenda/plugineye/plugineye-ajax/plugineye_on_deactivation_function.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/ns-booking-agenda/single-agenda.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ns-booking-agenda/ns-agenda-product-functions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-booking-agenda/ns-agenda-ajax-functions.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=how-to-install-premium-version
    • > Deprecation (warning) in unknown
    https://www.nsthemes.com/wp-content/themes/flatsome/assets/js/flatsome.js?ver=295a0d1d1e8168b25a51f884bffa7b33 0 Listener added for a synchronous 'DOMNodeInserted' DOM Mutation Event. This event type is deprecated (https://w3c.github.io/uievents/#legacy-event-types) and work is underway to remove it from this browser. Usage of this event listener will cause performance issues today, and represents a risk of future incompatibility. Consider using MutationObserver instead.

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Tags: You are using too many tags: 13 tag instead of maximum 10
  • Screenshots: Add images for these screenshots: #1 (View booking agenda.), #2 (View single day booking agenda.), #3 (Settings Ns Booking Agenda.), #4 (Single product bookable.)
The official readme.txt might help

ns-booking-agenda/ns-agenda-page.php 92% from 13 tests

The entry point to "NS Booking Calendar Agenda" version 1.3.5 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("ns-booking-agenda.php" instead of "ns-agenda-page.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected4,061 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP275705042,904
CSS410834833
JavaScript566120324

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity29.33
▷ Minimum class complexity2.00
▷ Maximum class complexity66.00
Average method complexity4.15
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods32
▷ Static methods00.00%
▷ Public methods928.12%
▷ Protected methods00.00%
▷ Private methods2371.88%
Functions75
▷ Named functions6485.33%
▷ Anonymous functions1114.67%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
11 PNG files occupy 0.44MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/large-exclamation-mark-default.png1.27KB1.02KB▼ 19.68%
img/check-symbol.png0.77KB0.53KB▼ 31.53%
screenshot-4.png50.68KB13.52KB▼ 73.32%
ns-admin-options-pro/img/example1.PNG122.71KB48.14KB▼ 60.77%
ns-admin-options-pro/img/example2.PNG89.30KB38.53KB▼ 56.85%