68% wp-ical-availability

Code Review | WP iCal Availability

WordPress plugin WP iCal Availability scored68%from 54 tests.

About plugin

  • Plugin page: wp-ical-availability
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.7
  • WordPress version: 6.3.1
  • First release: Mar 4, 2016
  • Latest release: Mar 30, 2021
  • Number of updates: 22
  • Update frequency: every 84.2 days
  • Top authors: wpicalavailability (100%)

Code review

54 tests

User reviews

26 reviews

Install metrics

1,000+ active /18,700 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.37MB] [CPU: ▼3.63ms] Passed 4 tests

An overview of server-side resources used by WP iCal Availability
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.85 ▲0.3939.60 ▼1.36
Dashboard /wp-admin3.68 ▲0.3349.69 ▼9.77
Posts /wp-admin/edit.php3.79 ▲0.4449.70 ▲5.60
Add New Post /wp-admin/post-new.php6.26 ▲0.3783.83 ▼7.15
Media Library /wp-admin/upload.php3.60 ▲0.3739.02 ▲3.78
Calendars /wp-admin/admin.php?page=wp-ical-availability3.5733.24
Settings /wp-admin/admin.php?page=wp-ical-availability-settings3.5836.25

Server storage [IO: ▲0.82MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 312 new files
Database: 1 new table, 7 new options
New tables
wp_wpia_calendars
New WordPress options
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_wpia_widget
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for WP iCal Availability
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,978 ▲23214.39 ▼0.341.67 ▲0.0641.47 ▼1.75
Dashboard /wp-admin2,344 ▲1644.92 ▼0.7589.60 ▼3.2685.01 ▲45.43
Posts /wp-admin/edit.php2,263 ▲1662.33 ▲0.3836.57 ▼2.7831.37 ▼3.77
Add New Post /wp-admin/post-new.php1,685 ▲15023.41 ▲5.07589.52 ▼79.7098.16 ▲17.11
Media Library /wp-admin/upload.php1,553 ▲1564.48 ▲0.2692.71 ▼8.6797.10 ▲52.21
Calendars /wp-admin/admin.php?page=wp-ical-availability1,0462.0425.3235.33
Settings /wp-admin/admin.php?page=wp-ical-availability-settings1,2032.0729.9735.14

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie tables were found after uninstall: 1 table
    • wp_wpia_calendars
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_wpia_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/wp-ical-availability/views/calendar/full-version.php
  • 14× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to get property 'prefix' of non-object in wp-content/plugins/wp-ical-availability/views/calendar/calendars.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-ical-availability/include/pluginShortcodeButton.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-ical-availability/views/settings/settings.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-ical-availability/include/createTables.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-ical-availability/views/calendar/edit-calendar.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sanitize_text_field() in wp-content/plugins/wp-ical-availability/controllers/calendar/calendar-save.php:5
    • > PHP Warning
      require_once(ABSPATHwp-load.php): failed to open stream: No such file or directory in wp-content/plugins/wp-ical-availability/controllers/calendar/calendar-delete.php on line 2
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-load.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-ical-availability/controllers/calendar/calendar-delete.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/wp-ical-availability/views/calendar/calendars.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function update_site_option() in wp-content/plugins/wp-ical-availability/controllers/settings/save-settings.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add an image for screenshot #1 (The calendar in a sidebar as a widget)
You can look at the official readme.txt

wp-ical-availability/wp-ical-availability.php Passed 13 tests

"WP iCal Availability" version 1.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
20 characters long description:
WP iCal Availability

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable files found in this plugin2,945 lines of code in 28 files:
LanguageFilesBlank linesComment linesLines of code
PHP194192262,226
JavaScript56111259
PO File1111222241
CSS31041219

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity77.50
▷ Minimum class complexity9.00
▷ Maximum class complexity146.00
Average method complexity5.59
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods18
▷ Static methods00.00%
▷ Public methods18100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions37
▷ Named functions3183.78%
▷ Anonymous functions616.22%
Constants3
▷ Global constants3100.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
277 compressed PNG files occupy 0.22MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/flags/ir.png0.50KB0.68KB0.00%
images/flags/tm.png0.58KB0.67KB0.00%
images/flags/cf.png0.60KB0.72KB0.00%
images/flags/mu.png0.48KB0.73KB0.00%
images/flags/de.png0.53KB0.72KB0.00%