73% webhotelier

Code Review | WebHotelier for WordPress

WordPress plugin WebHotelier for WordPress scored73%from 54 tests.

About plugin

  • Plugin page: webhotelier
  • Plugin version: 1.8.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.4
  • WordPress version: 6.3.1
  • First release: Jul 15, 2019
  • Latest release: Nov 8, 2023
  • Number of updates: 69
  • Update frequency: every 22.9 days
  • Top authors: wplugged (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /5,576 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.20MB] [CPU: ▼5.01ms] Passed 4 tests

This is a short check of server-side resources used by WebHotelier for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.68 ▲0.2238.28 ▼2.52
Dashboard /wp-admin3.50 ▲0.2045.06 ▼1.56
Posts /wp-admin/edit.php3.61 ▲0.2649.56 ▼0.45
Add New Post /wp-admin/post-new.php6.08 ▲0.2089.27 ▼15.51
Media Library /wp-admin/upload.php3.42 ▲0.1935.35 ▲4.05
Codestar Framework /wp-admin/tools.php?page=csf-welcome3.4838.86

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 216 new files
Database: no new tables, 8 new options
New WordPress options
theysaidso_admin_options
widget_wp_webhotelier_widget
widget_recent-comments
wp-webhotelier_options
db_upgraded
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Checking browser requirements for WebHotelier for WordPress
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,913 ▲15113.79 ▼0.347.93 ▲6.0739.03 ▼7.45
Dashboard /wp-admin2,226 ▲495.61 ▼0.0595.64 ▼4.7342.76 ▼2.06
Posts /wp-admin/edit.php2,131 ▲312.00 ▼0.0239.04 ▲3.0537.65 ▲4.14
Add New Post /wp-admin/post-new.php6,391 ▲4,86027.65 ▲4.62851.53 ▲256.6935.88 ▼25.78
Media Library /wp-admin/upload.php1,431 ▲344.16 ▼0.0099.51 ▲4.3742.14 ▲1.13
Codestar Framework /wp-admin/tools.php?page=csf-welcome1,4693.6069.5768.50
Form Customization Settings /wp-admin/admin.php?page=wp-webhotelier_options#tab=form-customization-settings1,6484.5379.3665.07
Form Fields Settings /wp-admin/admin.php?page=wp-webhotelier_options#tab=form-fields-settings1,5113.9162.0436.52

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstaller has failed for this plugin, leaving 216 files (1.50MB) in the plugin directory
    • (new file) admin/css/wp-webhotelier-admin.css
    • (new file) admin/images/horizontal-form.png
    • (new file) admin/index.php
    • (new file) admin/class-wp-webhotelier-admin.php
    • (new file) admin/images/vertical-form.png
    • (new file) README.txt
    • (new file) admin/images/fluid-form.png
    • (new file) admin/partials/wp-webhotelier-notice-markup.php
    • (new file) LICENSE.txt
    • (new file) admin/js/wp-webhotelier-admin.js
    • ...
  • Zombie WordPress options were found after uninstall: 8 options
    • can_compress_scripts
    • wp-webhotelier_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_wp_webhotelier_widget

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 6× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/webhotelier/admin/partials/wp-webhotelier-notice-markup.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/webhotelier/admin/partials/wp-webhotelier-paypal-code.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/webhotelier/includes/class-wp-webhotelier-widget.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/webhotelier/admin/partials/wp-webhotelier-widget-backend-form.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/webhotelier/public/partials/wp-webhotelier-form.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/webhotelier/blocks/wp-webhotelier-block.php:89

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (The WebHotelier Availability Form), #2 (Admin Form Field Settings), #3 (Admin Form Customization Settings), #4 (Admin Widget)
You can take inspiration from this readme.txt

webhotelier/wp-webhotelier.php 85% from 13 tests

The main PHP file in "WebHotelier for WordPress" ver. 1.8.1 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("webhotelier.php" instead of "wp-webhotelier.php")
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

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 plugin22,406 lines of code in 183 files:
LanguageFilesBlank linesComment linesLines of code
PHP862,3271,50210,809
PO File213,3023,7926,698
JavaScript65256554,278
Markdown2850379
CSS74441240
SVG2002

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity18.36
▷ Minimum class complexity1.00
▷ Maximum class complexity151.00
Average method complexity5.89
▷ Minimum method complexity1.00
▷ Maximum method complexity57.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes64
▷ Abstract classes23.12%
▷ Concrete classes6296.88%
▷ Final classes00.00%
Methods228
▷ Static methods3716.23%
▷ Public methods22096.49%
▷ Protected methods00.00%
▷ Private methods83.51%
Functions28
▷ Named functions2796.43%
▷ Anonymous functions13.57%
Constants1
▷ Global constants1100.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
4 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/horizontal-form.png10.47KB4.32KB▼ 58.72%
admin/images/vertical-form.png11.66KB4.21KB▼ 63.91%
admin/images/fluid-form.png10.55KB4.40KB▼ 58.29%
includes/codestar-framework/assets/images/checkerboard.png2.29KB2.54KB0.00%