10% cp-reservation-calendar

Code Review | CP Reservation Calendar

WordPress plugin CP Reservation Calendar scored10%from 54 tests.

About plugin

  • Plugin page: cp-reservation-ca...
  • Plugin version: 1.1.39
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.5-6.4
  • WordPress version: 6.3.1
  • First release: Oct 11, 2012
  • Latest release: Nov 6, 2023
  • Number of updates: 148
  • Update frequency: every 27.3 days
  • Top authors: codepeople (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

30+ active /31,729 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/cp-reservation-calendar/dex_reservations.php+45
    Undefined variable: wpdb

Server metrics [RAM: ▲0.17MB] [CPU: ▲0.23ms] Passed 4 tests

An overview of server-side resources used by CP Reservation Calendar
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1634.34 ▼7.01
Dashboard /wp-admin3.47 ▲0.1752.64 ▼0.62
Posts /wp-admin/edit.php3.59 ▲0.2349.68 ▲5.65
Add New Post /wp-admin/post-new.php6.08 ▲0.1997.97 ▲9.40
Media Library /wp-admin/upload.php3.40 ▲0.1735.29 ▲2.91
CP Reservation Calendar /wp-admin/options-general.php?page=dex_reservations3.4833.72

Server storage [IO: ▲0.69MB] [DB: ▲0.01MB] Passed 3 tests

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 43 new files
Database: 4 new tables, 7 new options
New tables
wp_reservation_calendars_data
wp_dex_reservations
wp_reservation_calendars
wp_dex_reservations_discount_codes
New WordPress options
installed_cp-reservation-calendar
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for CP Reservation Calendar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,914 ▲15213.39 ▼0.928.11 ▲6.1541.22 ▼1.74
Dashboard /wp-admin2,218 ▲385.63 ▼0.0392.32 ▲0.9141.15 ▲2.97
Posts /wp-admin/edit.php2,117 ▲202.01 ▼0.0039.24 ▲1.8435.59 ▲0.44
Add New Post /wp-admin/post-new.php1,544 ▲1823.47 ▲0.01631.70 ▼77.6262.69 ▲12.22
Media Library /wp-admin/upload.php1,417 ▲264.22 ▼0.0399.08 ▼2.3742.04 ▼1.39
CP Reservation Calendar /wp-admin/options-general.php?page=dex_reservations1,0622.0524.6242.20

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie tables detected upon uninstall: 4 tables
    • wp_reservation_calendars
    • wp_dex_reservations_discount_codes
    • wp_reservation_calendars_data
    • wp_dex_reservations
  • The uninstall procedure has failed, leaving 7 options in the database
    • db_upgraded
    • widget_recent-comments
    • installed_cp-reservation-calendar
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 0% 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
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/cp-reservation-calendar/TDE_RCalendar/events.php
    • > /wp-content/plugins/cp-reservation-calendar/captcha/captcha.php
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/cp-reservation-calendar/dex_scheduler.inc.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/cp-reservation-calendar/dex_reservations_admin_int.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_site_url() in wp-content/plugins/cp-reservation-calendar/dex_reservations.php:28
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/cp-reservation-calendar/dex_reservations_admin_int_calendar_list.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cp-reservation-calendar/cp-feedback.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (Inserting the reservation calendar into a page.), #2 (Booking form/reservation form.), #3 (Booking calendar configuration and administration.)
The official readme.txt is a good inspiration

cp-reservation-calendar/dex_reservations.php 92% from 13 tests

The principal PHP file in "CP Reservation Calendar" v. 1.1.39 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("cp-reservation-calendar.php" instead of "dex_reservations.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 plugin4,639 lines of code in 19 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript96051,1402,669
PHP7360431,598
CSS28820303
PO File1265869

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions31
▷ Named functions31100.00%
▷ Anonymous functions00.00%
Constants73
▷ Global constants73100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.12MB with 0.06MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png75.79KB39.19KB▼ 48.29%
screenshot-1.png34.95KB14.94KB▼ 57.24%
screenshot-2.png13.14KB7.00KB▼ 46.76%