10% availability

Code Review | Availability Calendar

WordPress plugin Availability Calendar scored10%from 54 tests.

About plugin

  • Plugin page: availability
  • Plugin version: 0.2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4.2
  • WordPress version: 6.3.1
  • First release: Jan 19, 2010
  • Latest release: Nov 27, 2012
  • Number of updates: 52
  • Update frequency: every 21.0 days
  • Top authors: 36flavours (65.38%)stvwhtly (36.54%)

Code review

54 tests

User reviews

7 reviews

Install metrics

500+ active /25,690 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
These installer errors require your attention
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/availability/index.php+11
    Methods with the same name as their class will not be constructors in a future version of PHP; Availability has a deprecated constructor

Server metrics [RAM: ▼1.83MB] [CPU: ▼64.83ms] Passed 4 tests

This is a short check of server-side resources used by Availability Calendar
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.16 ▼1.315.08 ▼37.51
Dashboard /wp-admin2.18 ▼1.137.73 ▼50.01
Posts /wp-admin/edit.php2.18 ▼1.186.47 ▼55.53
Add New Post /wp-admin/post-new.php2.18 ▼3.716.51 ▼116.28
Media Library /wp-admin/upload.php2.18 ▼1.056.27 ▼33.30
Availability /wp-admin/edit.php?post_type=page&page=availability2.186.75
Availability /wp-admin/plugins.php?page=availability2.285.97

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: 1 new table, 7 new options
New tables
wp_availability
New WordPress options
widget_theysaidso_widget
db_upgraded
can_compress_scripts
availability
widget_recent-comments
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Availability Calendar
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,799 ▲3814.25 ▼0.411.92 ▲0.1442.49 ▼0.07
Dashboard /wp-admin2,206 ▲295.58 ▼0.0994.94 ▼9.7040.16 ▼4.85
Posts /wp-admin/edit.php2,105 ▲22.11 ▲0.0840.12 ▼1.1538.80 ▲3.23
Add New Post /wp-admin/post-new.php1,537 ▲223.27 ▲5.01691.25 ▲24.0753.51 ▼20.89
Media Library /wp-admin/upload.php1,411 ▲114.20 ▼0.01101.49 ▼4.3347.00 ▲2.33
Availability /wp-admin/edit.php?post_type=page&page=availability2,9891.6628.6633.71
Availability /wp-admin/plugins.php?page=availability9552.0126.8030.66

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/availability/index.php+11
    Methods with the same name as their class will not be constructors in a future version of PHP; Availability has a deprecated constructor
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=availability
    • > Deprecated in wp-content/plugins/availability/index.php+11
    Methods with the same name as their class will not be constructors in a future version of PHP; Availability has a deprecated constructor
    • > GET request to /wp-admin/edit.php?post_type=page&page=availability
    • > Notice in wp-content/plugins/availability/index.php+182
    Trying to access array offset on value of type bool
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=page&page=availability
    • > User deprecated in wp-includes/functions.php+5453
    Function wpdb::escape is deprecated since version 3.6.0! Use wpdb::prepare() or esc_sql() instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=availability
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=availability
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.

SRP 50% 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
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/availability/index.php:22
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/availability/settings.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function screen_icon() in wp-content/plugins/availability/manage.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function shortcode_atts() in wp-content/plugins/availability/calendar.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/availability/dropdown.php:3
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/availability/index.php on line 21

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 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (The availability calendar management page.), #2 (Availability calendar with default styles.), #3 (Example showing the addition of shortcodes to a page.), #4 (Multi-calendar management and plugin settings.)
The official readme.txt might help

availability/index.php 92% from 13 tests

The main PHP script in "Availability Calendar" version 0.2.4 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("availability.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin697 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP6321653
CSS10044

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity73.00
▷ Minimum class complexity73.00
▷ Maximum class complexity73.00
Average method complexity7.00
▷ Minimum method complexity1.00
▷ Maximum method complexity20.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.10MB with 0.05MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png12.86KB7.73KB▼ 39.85%
screenshot-3.png29.44KB13.74KB▼ 53.34%
screenshot-1.png27.01KB12.25KB▼ 54.66%
screenshot-4.png28.26KB12.96KB▼ 54.16%