68% resource-calendar

Code Review | Resource Calendar

WordPress plugin Resource Calendar scored 68% from 54 tests.

About plugin

  • Plugin page: resource-calendar
  • Plugin version: 1.5.6
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.8
  • WordPress version: 6.3.1
  • First release: Aug 6, 2015
  • Latest release: Jan 26, 2018
  • Number of updates: 50
  • Update frequency: every 19.8 days
  • Top authors: Tanaka Hisao (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,184 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.60MB] [CPU: ▼30.44ms] Passed 4 tests

This is a short check of server-side resources used by Resource Calendar
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3135.59 ▼6.78
Dashboard /wp-admin3.34 ▲0.0424.62 ▼25.85
Posts /wp-admin/edit.php3.34 ▼0.0126.62 ▼18.04
Add New Post /wp-admin/post-new.php3.34 ▼2.5428.15 ▼71.07
Media Library /wp-admin/upload.php3.34 ▲0.1226.81 ▼3.22
Resource Information /wp-admin/admin.php?page=resource-calendar_resource3.3425.90
Reservations /wp-admin/admin.php?page=resource-calendar_reservation3.3425.02
Environment Setting /wp-admin/admin.php?page=resource-calendar_maintenace3.3424.81
Mail Setting /wp-admin/admin.php?page=resource-calendar_mail3.3425.58
View Log /wp-admin/admin.php?page=resource-calendar_log3.3423.07

Server storage [IO: ▲1.08MB] [DB: ▲0.01MB] Passed 3 tests

Filesystem and database footprint
This plugin installed successfully
Filesystem: 135 new files
Database: 6 new tables, 9 new options
New tables
wp_rcal_repeat
wp_rcal_reservation
wp_rcal_resource
wp_rcal_category
wp_rcal_photo
wp_rcal_log
New WordPress options
rcal_holiday
rcal_installed
widget_theysaidso_widget
widget_recent-comments
rcal_confirm_page_id
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Resource Calendar
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,053 ▲29614.01 ▼0.6712.34 ▲10.3537.35 ▼10.26
Dashboard /wp-admin2,244 ▲535.99 ▲1.1096.83 ▼9.9179.87 ▲36.66
Posts /wp-admin/edit.php2,130 ▲412.03 ▲0.0137.96 ▲4.1934.57 ▲0.67
Add New Post /wp-admin/post-new.php1,563 ▲2118.66 ▲0.39743.65 ▲124.3171.37 ▲14.06
Media Library /wp-admin/upload.php1,420 ▲294.19 ▼0.02104.47 ▲7.0173.47 ▲29.23
Resource Information /wp-admin/admin.php?page=resource-calendar_resource1,8303.0565.7376.52
Reservations /wp-admin/admin.php?page=resource-calendar_reservation2,7182.9174.4257.04
Environment Setting /wp-admin/admin.php?page=resource-calendar_maintenace1,5442.9566.4957.01
Mail Setting /wp-admin/admin.php?page=resource-calendar_mail1,2392.6737.3445.40
View Log /wp-admin/admin.php?page=resource-calendar_log1,0952.7748.5035.45

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/resource-calendar/resource-calendar.php+243
    Trying to access array offset on value of type bool
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Please fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=resource-calendar_log
    • > Notice in wp-content/plugins/resource-calendar/resource-calendar.php+243
    Trying to access array offset on value of type bool

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
Almost there! Just fix the following items
  • 149× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      Use of undefined constant RCAL_PLUGIN_SRC_DIR - assumed 'RCAL_PLUGIN_SRC_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/resource-calendar/src/page/bookingfront-page.php on line 3
    • > PHP Warning
      Use of undefined constant RCAL_PLUGIN_SRC_DIR - assumed 'RCAL_PLUGIN_SRC_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/resource-calendar/src/control/category-control.php on line 3
    • > PHP Warning
      require_once(RCAL_PLUGIN_SRC_DIRpage/resource-calendar-page.php): failed to open stream: No such file or directory in wp-content/plugins/resource-calendar/src/page/config-page.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'RCAL_PLUGIN_SRC_DIRcontrol/resource-calendar-control.php' (include_path='.:/usr/share/php') in wp-content/plugins/resource-calendar/src/control/photo-control.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'RCAL_PLUGIN_SRC_DIRcontrol/resource-calendar-control.php' (include_path='.:/usr/share/php') in wp-content/plugins/resource-calendar/src/control/category-control.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'RCAL_PLUGIN_SRC_DIRcontrol/resource-calendar-control.php' (include_path='.:/usr/share/php') in wp-content/plugins/resource-calendar/src/control/config-control.php on line 3
    • > PHP Warning
      require_once(RCAL_PLUGIN_SRC_DIRcontrol/resource-calendar-control.php): failed to open stream: No such file or directory in wp-content/plugins/resource-calendar/src/control/log-control.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'ResourceCalendar_Component' not found in wp-content/plugins/resource-calendar/src/comp/booking-component.php:3
    • > PHP Fatal error
      require_once(): Failed opening required 'RCAL_PLUGIN_SRC_DIRpage/resource-calendar-page.php' (include_path='.:/usr/share/php') in wp-content/plugins/resource-calendar/src/page/resource-page.php on line 3
    • > PHP Warning
      require_once(RCAL_PLUGIN_SRC_DIRpage/resource-calendar-page.php): failed to open stream: No such file or directory in wp-content/plugins/resource-calendar/src/page/category-edit.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
7 plugin tags: resource, salon, calendar, reservation, booking...

resource-calendar/resource-calendar.php Passed 13 tests

This is the main PHP file of "Resource Calendar" version 1.5.6, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
55 characters long description:
Resource Calendar enables the reservation of resources.

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
Success! There were no dangerous files found in this plugin15,160 lines of code in 80 files:
LanguageFilesBlank linesComment linesLines of code
PHP642,26476410,877
CSS62841371,960
PO File13926051,243
JavaScript91382041,080

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity15.99
▷ Minimum class complexity1.00
▷ Maximum class complexity159.00
Average method complexity3.86
▷ Minimum method complexity1.00
▷ Maximum method complexity74.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes72
▷ Abstract classes22.78%
▷ Concrete classes7097.22%
▷ Final classes00.00%
Methods378
▷ Static methods5414.29%
▷ Public methods36295.77%
▷ Protected methods20.53%
▷ Private methods143.70%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants101
▷ Global constants1514.85%
▷ Class constants8685.15%
▷ Public constants86100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
38 PNG files occupy 0.14MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/images/ui-bg_flat_0_aaaaaa_40x100.png0.18KB0.08KB▼ 51.67%
css/images/magnifier.png0.60KB0.60KB0.00%
images/forward_enabled.png1.35KB0.58KB▼ 56.96%
css/images/loading_background.png0.15KB0.15KB▼ 0.64%
css/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%