10% cp-appointment-calendar

Code Review | CP Appointment Calendar

WordPress plugin CP Appointment Calendar scored10%from 54 tests.

About plugin

  • Plugin page: cp-appointment-ca...
  • Plugin version: 1.1.38
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.5-6.4
  • WordPress version: 6.3.1
  • First release: Jun 19, 2012
  • Latest release: Nov 6, 2023
  • Number of updates: 175
  • Update frequency: every 23.8 days
  • Top authors: codepeople (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

200+ active /28,223 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
These installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/cp-appointment-calendar/dex_appointments.php+41
    Undefined variable: wpdb

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

This is a short check of server-side resources used by CP Appointment Calendar
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1542.45 ▲1.42
Dashboard /wp-admin3.48 ▲0.1748.14 ▲1.10
Posts /wp-admin/edit.php3.59 ▲0.2348.50 ▼1.66
Add New Post /wp-admin/post-new.php6.08 ▲0.1985.64 ▼6.87
Media Library /wp-admin/upload.php3.40 ▲0.1734.55 ▲1.77
CP Appointment Calendar /wp-admin/options-general.php?page=dex_appointments3.4938.17

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 36 new files
Database: 3 new tables, 8 new options
New tables
wp_appointment_calendars
wp_appointment_calendars_data
wp_dex_appointments
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_recent-posts
installed_cp-appointment-calendar
dex_appointments_data
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

CP Appointment Calendar: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,794 ▲3214.22 ▼0.082.19 ▲0.4142.93 ▼1.77
Dashboard /wp-admin2,202 ▲255.64 ▼0.0190.83 ▲1.7235.40 ▼9.11
Posts /wp-admin/edit.php2,104 ▲11.99 ▲0.0439.36 ▲1.8436.39 ▲1.36
Add New Post /wp-admin/post-new.php1,531 ▼423.21 ▼2.20638.19 ▼25.7456.93 ▼11.29
Media Library /wp-admin/upload.php1,401 ▼24.14 ▼0.03100.89 ▲1.8341.82 ▼5.37
CP Appointment Calendar /wp-admin/options-general.php?page=dex_appointments5,9503.12100.0552.79

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 3 tables in the database
    • wp_appointment_calendars
    • wp_appointment_calendars_data
    • wp_dex_appointments
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • installed_cp-appointment-calendar
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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 fix the following items
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/cp-appointment-calendar/dex_scheduler.inc.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_site_url() in wp-content/plugins/cp-appointment-calendar/dex_appointments.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/cp-appointment-calendar/dex_appointments_admin_int.inc.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cp-appointment-calendar/cp-feedback.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

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 do not have images: #1 (Inserting the calendar into a page.), #2 (Booking/reservation form.), #3 (Calendar configuration and administration.)
You can look at the official readme.txt

cp-appointment-calendar/dex_appointments.php 92% from 13 tests

"CP Appointment Calendar" version 1.1.38's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("cp-appointment-calendar.php" instead of "dex_appointments.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 detected3,080 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript41621131,256
PHP421725958
CSS815470866

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.23
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%
Functions25
▷ Named functions25100.00%
▷ Anonymous functions00.00%
Constants56
▷ Global constants56100.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
5 PNG files occupy 0.12MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
TDE_AppCalendar/blankimage.png2.26KB2.16KB▼ 4.36%
screenshot-3.png67.34KB34.31KB▼ 49.05%
screenshot-2.png14.69KB7.86KB▼ 46.51%
screenshot-1.png35.10KB15.11KB▼ 56.95%
TDE_AppCalendar/sprite.png3.05KB3.04KB0.22%