73% online-lesson-booking-system

Code Review | Online Lesson Booking

WordPress plugin Online Lesson Booking scored73%from 54 tests.

About plugin

  • Plugin page: online-lesson-boo...
  • Plugin version: 0.9.3
  • PHP compatiblity: 5.5+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.4.1
  • WordPress version: 6.3.1
  • First release: Oct 7, 2013
  • Latest release: Dec 3, 2023
  • Number of updates: 143
  • Update frequency: every 25.9 days
  • Top authors: tnomi (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

800+ active /30,915 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
Install script ran successfully

Server metrics [RAM: ▲1.25MB] [CPU: ▲6.49ms] 75% from 4 tests

Server-side resources used by Online Lesson Booking
Please take the time to fix the following items
  • CPU: Try to keep total CPU usage under 500.00ms (currently 5,375.56ms on /wp-admin/admin.php?page=olb-settings)
PageMemory (MB)CPU Time (ms)
Home /4.74 ▲1.2851.02 ▲10.08
Dashboard /wp-admin4.84 ▲1.4991.32 ▲31.96
Posts /wp-admin/edit.php4.60 ▲1.2452.01 ▲1.99
Add New Post /wp-admin/post-new.php7.13 ▲1.24109.01 ▲6.25
Media Library /wp-admin/upload.php4.47 ▲1.2443.79 ▲7.64
Mail /wp-admin/admin.php?page=olb-mail4.4439.35
Special Pages /wp-admin/admin.php?page=olb-specialpages4.4441.21
General /wp-admin/admin.php?page=olb-settings5.755,375.56
Reset /wp-admin/admin.php?page=olb-reset4.4441.66

Server storage [IO: ▲0.85MB] [DB: ▲0.06MB] Passed 3 tests

Filesystem and database footprint
No storage issues were detected
Filesystem: 29 new files
Database: 3 new tables, 11 new options
New tables
wp_olb_history
wp_olb_timetable
wp_olb_logs
New WordPress options
olbversion
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
olbsystem
widget_olbwidgetmembersmenu
theysaidso_admin_options
widget_olbwidgetteachersmenu
widget_olbwidgetadminsmenu
...

Browser metrics Passed 4 tests

An overview of browser requirements for Online Lesson Booking
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,004 ▲25713.40 ▼0.958.52 ▲6.8840.91 ▼6.63
Dashboard /wp-admin2,305 ▲1255.65 ▼0.0082.47 ▼7.0240.41 ▲3.63
Posts /wp-admin/edit.php2,137 ▲372.01 ▲0.0137.83 ▼1.9333.54 ▲1.44
Add New Post /wp-admin/post-new.php1,556 ▲3023.64 ▲0.69637.97 ▼41.6054.50 ▼2.77
Media Library /wp-admin/upload.php1,437 ▲434.18 ▲0.0196.20 ▲0.0642.05 ▲0.84
Mail /wp-admin/admin.php?page=olb-mail1,1112.0026.5227.95
Special Pages /wp-admin/admin.php?page=olb-specialpages1,0212.0024.8427.56
General /wp-admin/admin.php?page=olb-settings1,2712.0123.2630.80
Reset /wp-admin/admin.php?page=olb-reset8712.0025.0426.14

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_olb_timetable
    • wp_olb_history
    • wp_olb_logs
  • The uninstall procedure has failed, leaving 9 options in the database
    • widget_olbwidgetmembersmenu
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_olbwidgetadminsmenu
    • widget_olbwidgetteachersmenu
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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 applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 13× 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/online-lesson-booking-system/class/my-adminpage.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/online-lesson-booking-system/class/my-calendar.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/online-lesson-booking-system/class/my-settings.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'olbPaging' not found in wp-content/plugins/online-lesson-booking-system/class/my-history.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/online-lesson-booking-system/class/my-ticket.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/online-lesson-booking-system/class/my-widget.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/online-lesson-booking-system/class/my-hookactions.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'OLBsystem' not found in wp-content/plugins/online-lesson-booking-system/class/my-timetable.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function load_plugin_textdomain() in wp-content/plugins/online-lesson-booking-system/class/my-settings.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/online-lesson-booking-system/class/my-room.php:5

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 ("Scheduler" page), #2 ("Daily schedule" page), #3 ("Weekly schedule" page), #4 ("Reservation form" page), #5 ("Plugin option" page)
You can look at the official readme.txt

online-lesson-booking-system/olb-system.php 92% from 13 tests

The main file in "Online Lesson Booking" v. 0.9.3 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: The principal plugin file should be the same as the plugin slug ("online-lesson-booking-system.php" instead of "olb-system.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin7,988 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP167381,2526,751
PO File1228274623
CSS34141561
JavaScript12353

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity38.04
▷ Minimum class complexity3.00
▷ Maximum class complexity203.00
Average method complexity4.84
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes23
▷ Abstract classes00.00%
▷ Concrete classes23100.00%
▷ Final classes00.00%
Methods223
▷ Static methods15368.61%
▷ Public methods223100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions3
▷ Named functions00.00%
▷ Anonymous functions3100.00%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.51MB with 0.40MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-5.png195.84KB36.33KB▼ 81.45%
screenshot-3.png105.58KB15.85KB▼ 84.99%
screenshot-2.png91.88KB20.38KB▼ 77.82%
screenshot-4.png22.89KB6.46KB▼ 71.80%
screenshot-1.png106.91KB22.30KB▼ 79.14%