78% 8-degree-availability-calendar

Code Review | 8 Degree Availability Calendar

WordPress plugin 8 Degree Availability Calendar scored 78% from 54 tests.

About plugin

  • Plugin page: 8-degree-availabi...
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-4.9.4
  • WordPress version: 5.9.2
  • First release: Oct 13, 2015
  • Latest release: Aug 10, 2018
  • Number of updates: 18
  • Update frequency: every 57.9 days
  • Top authors: 8degreethemes (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

600+ active / 26,409 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼301.17ms] Passed 4 tests

A check of server-side resources used by 8 Degree Availability Calendar
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.1449.28 ▼4.24
Dashboard /wp-admin3.49 ▲0.0834.87 ▲1.64
Posts /wp-admin/edit.php3.71 ▲0.0737.66 ▼0.36
Add New Post /wp-admin/post-new.php6.96 ▼0.0292.00 ▼1,200.93
Media Library /wp-admin/upload.php3.37 ▲0.0724.33 ▲0.86

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 47 new files
Database: no new tables, 2 new options
New WordPress options
edac_settings
widget_edac_widget

Browser metrics Passed 4 tests

8 Degree Availability Calendar: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,939 ▲19517.37 ▲1.3317.03 ▲10.992.45 ▲0.42
Dashboard /wp-admin2,914 ▲566.17 ▼0.01119.08 ▼12.62159.17 ▼3.50
Posts /wp-admin/edit.php2,710 ▲163.24 ▲0.0164.29 ▼1.28142.85 ▼0.45
Add New Post /wp-admin/post-new.php1,676 ▼8416.85 ▼0.16395.62 ▼17.66153.65 ▼8.46
Media Library /wp-admin/upload.php1,720 ▲225.53 ▲0.04135.80 ▼1.94185.81 ▼4.84

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 2 options in the database
    • edac_settings
    • widget_edac_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 0% 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
Please fix the following
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/8-degree-availability-calendar/inc/backend/blocks/calendar.php
    • > /wp-content/plugins/8-degree-availability-calendar/inc/frontend/shortcode.php
    • > /wp-content/plugins/8-degree-availability-calendar/8degree-availability-calendar.php
    • > /wp-content/plugins/8-degree-availability-calendar/inc/backend/widget.php
    • > /wp-content/plugins/8-degree-availability-calendar/inc/backend/blocks/settings.php
    • > /wp-content/plugins/8-degree-availability-calendar/inc/backend/save-settings.php
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/8-degree-availability-calendar/inc/backend/blocks/about.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/8-degree-availability-calendar/inc/backend/blocks/how-to-use.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/8-degree-availability-calendar/inc/backend/settings-page.php:9

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
9 plugin tags: calendar, appointment calendar, check availability calendar, booking calendar, book availability...

8-degree-availability-calendar/8degree-availability-calendar.php 85% from 13 tests

The entry point to "8 Degree Availability Calendar" version 1.1.0 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("8-degree-availability-calendar.php" instead of "8degree-availability-calendar.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
There were no executable files found in this plugin7,398 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript71093583,748
CSS51701292,582
SVG100565
PHP1048149503

PHP code Passed 2 tests

An overview 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.42
Average class complexity10.50
▷ Minimum class complexity9.00
▷ Maximum class complexity12.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods19100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
14 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/backend/images/ui-icons_ffffff_256x240.png6.15KB4.17KB▼ 32.13%
css/backend/images/ui-bg_glass_100_fdf5ce_1x400.png0.34KB0.16KB▼ 54.02%
css/backend/images/ui-bg_gloss-wave_35_f6a828_500x100.png5.68KB1.83KB▼ 67.77%
css/backend/images/ui-bg_glass_100_f6f6f6_1x400.png0.26KB0.12KB▼ 53.44%
css/backend/images/ui-bg_diagonals-thick_20_666666_40x40.png0.30KB0.15KB▼ 49.68%