83% restrict-dates-add-on-for-gravity-forms

Code Review | Restrict Dates Add-On for Gravity Forms

WordPress plugin Restrict Dates Add-On for Gravity Forms scored83%from 54 tests.

About plugin

  • Plugin page: restrict-dates-ad...
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.8
  • WordPress version: 6.3.1
  • First release: Sep 1, 2021
  • Latest release: Jun 18, 2022
  • Number of updates: 6
  • Update frequency: every 48.3 days
  • Top authors: kaisarahmmed (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

200+ active /1,112 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.24ms] Passed 4 tests

This is a short check of server-side resources used by Restrict Dates Add-On for Gravity Forms
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.21 ▼1.89
Dashboard /wp-admin3.31 ▲0.0149.72 ▲0.77
Posts /wp-admin/edit.php3.36 ▲0.0149.90 ▼0.23
Add New Post /wp-admin/post-new.php5.89 ▲0.0183.31 ▼15.61
Media Library /wp-admin/upload.php3.23 ▲0.0139.72 ▲5.92

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Restrict Dates Add-On for Gravity Forms
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲4314.72 ▲0.381.78 ▲0.1242.95 ▲3.63
Dashboard /wp-admin2,198 ▲245.58 ▼0.0580.54 ▼2.0439.40 ▼6.30
Posts /wp-admin/edit.php2,100 ▲32.02 ▲0.0439.06 ▲4.7035.25 ▲2.70
Add New Post /wp-admin/post-new.php1,526 ▼923.14 ▲4.98656.66 ▲39.6853.22 ▼16.99
Media Library /wp-admin/upload.php1,400 ▼04.20 ▲0.0597.36 ▲3.6544.82 ▼0.64

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'GFForms' not found in wp-content/plugins/restrict-dates-add-on-for-gravity-forms/class-gfrestrictdates.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/restrict-dates-add-on-for-gravity-forms/restrict-dates.php:15

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Click to enable restrict date), #2 (You can see all options), #3 (Set options as your requirements)
You can look at the official readme.txt

restrict-dates-add-on-for-gravity-forms/restrict-dates.php 85% from 13 tests

The primary PHP file in "Restrict Dates Add-On for Gravity Forms" version 1.1.0 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("restrict-dates-add-on-for-gravity-forms.php" instead of "restrict-dates.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin292 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP24931199
JavaScript218093

PHP code Passed 2 tests

A short 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.16
Average class complexity5.50
▷ Minimum class complexity2.00
▷ Maximum class complexity9.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods220.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
There were not PNG files found in your plugin