84% availability-calendar

Code Review | Availability Calendar

WordPress plugin Availability Calendar scored84%from 54 tests.

About plugin

  • Plugin page: availability-cale...
  • Plugin version: 1.2.6
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.2
  • WordPress version: 6.3.1
  • First release: Sep 16, 2019
  • Latest release: May 5, 2023
  • Number of updates: 35
  • Update frequency: every 37.9 days
  • Top authors: offshorewebmaster (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

1,000+ active /13,600 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.62MB] [CPU: ▼8.19ms] Passed 4 tests

Analyzing server-side resources used by Availability Calendar
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /4.04 ▲0.5844.40 ▲7.77
Dashboard /wp-admin3.96 ▲0.6149.97 ▼14.74
Posts /wp-admin/edit.php3.99 ▲0.6445.72 ▼1.29
Add New Post /wp-admin/post-new.php6.67 ▲0.7881.13 ▼22.12
Media Library /wp-admin/upload.php3.90 ▲0.6737.30 ▲5.41
Category /wp-admin/admin.php?page=owaccategorylist3.7635.03
Settings /wp-admin/admin.php?page=settings3.7631.40
Category Add /wp-admin/admin.php?page=owaccategory3.7530.67
Availability Calendar /wp-admin/admin.php?page=availabilitycalendar3.7631.45
Availability Add /wp-admin/admin.php?page=availabilityadd3.7532.64

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 58 new files
Database: 2 new tables, 7 new options
New tables
wp_OWAC_event
wp_OWAC_category
New WordPress options
can_compress_scripts
widget_recent-comments
OWAC_settings_option
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Availability Calendar
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,946 ▲16013.80 ▼0.559.65 ▲7.9047.88 ▲7.43
Dashboard /wp-admin2,243 ▲665.65 ▲0.0386.81 ▼1.1737.68 ▼3.05
Posts /wp-admin/edit.php2,145 ▲482.07 ▲0.0835.67 ▲1.3733.68 ▼4.79
Add New Post /wp-admin/post-new.php1,569 ▲4118.40 ▼4.89607.99 ▼47.4068.67 ▲15.79
Media Library /wp-admin/upload.php1,448 ▲484.29 ▲0.04100.64 ▼4.9840.99 ▼4.80
Category /wp-admin/admin.php?page=owaccategorylist1,0151.7226.3528.12
Settings /wp-admin/admin.php?page=settings1,2511.7728.9128.15
Category Add /wp-admin/admin.php?page=owaccategory8501.7624.7722.89
Availability Calendar /wp-admin/admin.php?page=availabilitycalendar1,0281.7224.0025.41
Availability Add /wp-admin/admin.php?page=availabilityadd1,1981.8230.8423.90

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 16× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/availability-calendar/admin/includes/owac-category-add.php:135
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/availability-calendar/admin/class/owac-category-list-table-trash.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/availability-calendar/admin/includes/owac-settings.php:408
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/availability-calendar/public/includes/frontend.php:7
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/availability-calendar/admin/class/owac-category-list-table.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/availability-calendar/admin/includes/owac-add.php:176
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/availability-calendar/admin/class/owac-list-table.php on line 3
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/availability-calendar/admin/class/owac-category-list-table.php on line 3
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/availability-calendar/admin/class/owac-list-table-trash.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/availability-calendar/admin/class/owac-list-table-trash.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: event, availability calendar, working days, holiday, personal calendar

availability-calendar/availabilitycalendar.php 92% from 13 tests

The principal PHP file in "Availability Calendar" v. 1.2.6 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("availability-calendar.php" instead of "availabilitycalendar.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin28,476 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
SVG30416,153
JavaScript57494598,557
PHP227971782,945
CSS5453821

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity20.41
▷ Minimum class complexity1.00
▷ Maximum class complexity95.00
Average method complexity3.13
▷ Minimum method complexity1.00
▷ Maximum method complexity78.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods157
▷ Static methods63.82%
▷ Public methods13585.99%
▷ Protected methods1610.19%
▷ Private methods63.82%
Functions20
▷ Named functions20100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected