10% sharetimetable-booking

Code Review | ShareTimetable Booking

WordPress plugin ShareTimetable Booking scored10%from 54 tests.

About plugin

  • Plugin page: sharetimetable-bo...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.7
  • WordPress version: 6.3.1
  • First release: Feb 17, 2014
  • Latest release: Dec 13, 2016
  • Number of updates: 9
  • Update frequency: every 114.6 days
  • Top authors: raz71 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,504 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/sharetimetable-booking/sharetimetable.php+22
    Methods with the same name as their class will not be constructors in a future version of PHP; ShareTimetablePlugIn has a deprecated constructor

Server metrics [RAM: ▼1.72MB] [CPU: ▼50.06ms] Passed 4 tests

A check of server-side resources used by ShareTimetable Booking
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.26 ▼1.205.72 ▼34.31
Dashboard /wp-admin2.28 ▼1.027.38 ▼40.39
Posts /wp-admin/edit.php2.29 ▼1.077.39 ▼39.88
Add New Post /wp-admin/post-new.php2.29 ▼3.606.21 ▼85.64
Media Library /wp-admin/upload.php2.29 ▼0.946.46 ▼27.18
Share Timetable /wp-admin/plugins.php?page=sharetimetable2.296.03

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 10 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
recovery_mode_email_last_sent
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for ShareTimetable Booking
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,842 ▲8114.61 ▲0.441.95 ▲0.4444.49 ▲4.69
Dashboard /wp-admin2,218 ▲385.76 ▲0.1890.00 ▲1.8343.09 ▲0.44
Posts /wp-admin/edit.php2,125 ▲282.27 ▲0.2837.27 ▲3.4033.68 ▲0.27
Add New Post /wp-admin/post-new.php1,547 ▲2123.42 ▼0.28684.86 ▼25.1636.65 ▼17.01
Media Library /wp-admin/upload.php1,417 ▲144.48 ▲0.2496.88 ▼5.9841.34 ▼5.29
Share Timetable /wp-admin/plugins.php?page=sharetimetable6851.516.7520.53

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/sharetimetable-booking/sharetimetable.php+22
    Methods with the same name as their class will not be constructors in a future version of PHP; ShareTimetablePlugIn has a deprecated constructor
  • This plugin does not fully uninstall, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • recovery_mode_email_last_sent
    • can_compress_scripts

Smoke tests 50% 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)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/plugins.php?page=sharetimetable
    • > Deprecated in wp-content/plugins/sharetimetable-booking/sharetimetable.php+22
    Methods with the same name as their class will not be constructors in a future version of PHP; ShareTimetablePlugIn has a deprecated constructor
    • > GET request to /wp-admin/plugins.php?page=sharetimetable
    • > Deprecated in wp-content/plugins/sharetimetable-booking/iam_calendar.php+20
    Methods with the same name as their class will not be constructors in a future version of PHP; IAM_Calendar has a deprecated constructor
    • > GET request to /wp-admin/plugins.php?page=sharetimetable
    • > User notice in wp-includes/functions.php+5905
    Function wp_register_style was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the CalendarStylesheet handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=sharetimetable
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
    • > GET request to /wp-admin/plugins.php?page=sharetimetable
    • > Notice in wp-content/plugins/sharetimetable-booking/sharetimetable.php+566
    Undefined index: public_id_str
    • > GET request to /wp-admin/plugins.php?page=sharetimetable
    • > Warning in wp-content/plugins/sharetimetable-booking/sharetimetable.php+568
    file_get_contents(http://app.sharetimetable.com/api/test//): failed to open stream: HTTP request failed! HTTP/1.1 500 Internal Server Error

    • > GET request to /wp-admin/plugins.php?page=sharetimetable
    • > Error in wp-content/plugins/sharetimetable-booking/sharetimetable.php+569
    Uncaught Exception: String could not be parsed as XML in wp-content/plugins/sharetimetable-booking/sharetimetable.php:569
    Stack trace:
    #0 wp-content/plugins/sharetimetable-booking/sharetimetable.php(569): SimpleXMLElement->__construct()
    #1 wp-includes/class-wp-hook.php(310): ShareTimetablePlugIn->optionsPage()
    #2 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #3 wp-includes/plugin.php(517): WP_Hook->do_action()
    #4 wp-admin/admin.php(259): do_action()
    #5 wp-admin/plugins.php(10): require_once('/var/www/wordpr...')
    #6 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sharetimetable-booking/sharetimetable.php:68

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Invalid URI ("")
  • Screenshots: Please add images for these screenshots: #1 (Idle view with calendar and resources list.), #2 (Timeslots selection for a resource.), #3 (Booking details.), #4 (End screen, Boking was made and saved with details in the Timetable.)
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === sharetimetable-booking === )
You can look at the official readme.txt

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

Analyzing the main PHP file in "ShareTimetable Booking" version 1.2
It is important to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sharetimetable-booking.php" instead of "sharetimetable.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
Everything looks great! No dangerous files found in this plugin1,005 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2152167934
CSS1141068
JavaScript1003

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity68.00
▷ Minimum class complexity45.00
▷ Maximum class complexity91.00
Average method complexity6.36
▷ Minimum method complexity1.00
▷ Maximum method complexity36.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods26
▷ Static methods00.00%
▷ Public methods2596.15%
▷ Protected methods00.00%
▷ Private methods13.85%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
4 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png8.90KB5.07KB▼ 43.06%
screenshot-1.png18.45KB8.72KB▼ 52.74%
screenshot-4.png4.69KB1.88KB▼ 59.85%
screenshot-2.png11.55KB4.23KB▼ 63.35%