84% gravity-forms-business-hours

Code Review | Gravity Forms Business Hours by GravityView

WordPress plugin Gravity Forms Business Hours by GravityView scored84%from 54 tests.

About plugin

  • Plugin page: gravity-forms-bus...
  • Plugin version: 2.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.1.1
  • WordPress version: 6.3.1
  • First release: Dec 18, 2014
  • Latest release: Apr 23, 2019
  • Number of updates: 15
  • Update frequency: every 105.7 days
  • Top authors: katzwebdesign (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

200+ active /6,280 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.00MB] [CPU: ▼4.48ms] Passed 4 tests

Server-side resources used by Gravity Forms Business Hours by GravityView
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.91 ▼7.14
Dashboard /wp-admin3.31 ▲0.0152.01 ▼1.93
Posts /wp-admin/edit.php3.36 ▲0.0051.05 ▼0.77
Add New Post /wp-admin/post-new.php5.89 ▲0.0185.62 ▼8.07
Media Library /wp-admin/upload.php3.23 ▲0.0039.44 ▲2.60

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 19 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Gravity Forms Business Hours by GravityView
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.38 ▼0.251.87 ▲0.0643.84 ▲0.37
Dashboard /wp-admin2,195 ▲255.64 ▼0.0492.83 ▼7.4042.78 ▲4.97
Posts /wp-admin/edit.php2,100 ▼02.03 ▼0.0334.30 ▼4.9139.04 ▲2.93
Add New Post /wp-admin/post-new.php1,526 ▼017.58 ▲0.04677.11 ▲59.5952.44 ▲3.95
Media Library /wp-admin/upload.php1,397 ▼34.22 ▲0.02110.65 ▲0.9848.17 ▲0.58

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% 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 items
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'GFAddOn' not found in wp-content/plugins/gravity-forms-business-hours/class-gf-business-hours.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gravity-forms-business-hours/gravity-forms-business-hours.php:30

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
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
Please fix the following attributes:
  • Screenshots: Add images for these screenshots: #1 (Business Hours in the Gravity Forms View Entry screen), #2 (The Business Hours field), #3 (The Business Hours button in the Form Editor)
Please take inspiration from this readme.txt

gravity-forms-business-hours/gravity-forms-business-hours.php 92% from 13 tests

The main PHP script in "Gravity Forms Business Hours by GravityView" version 2.1.3 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 176 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin720 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
PHP4174269377
JavaScript37178160
Markdown133065
LESS215362
PO File18937
JSON10017
CSS2002

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity13.00
▷ Minimum class complexity3.00
▷ Maximum class complexity23.00
Average method complexity2.20
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods1680.00%
▷ Protected methods00.00%
▷ Private methods420.00%
Functions8
▷ Named functions8100.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
3 PNG files occupy 0.18MB with 0.13MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png61.35KB17.72KB▼ 71.12%
screenshot-2.png68.81KB20.10KB▼ 70.79%
screenshot-3.png55.32KB16.13KB▼ 70.85%