84% gravity-forms-user-restrictions

Code Review | Gravity Forms User Restrictions

WordPress plugin Gravity Forms User Restrictions scored84%from 54 tests.

About plugin

  • Plugin page: gravity-forms-use...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.7.1
  • WordPress version: 6.3.1
  • First release: Jul 17, 2013
  • Latest release: Nov 5, 2013
  • Number of updates: 10
  • Update frequency: every 11.1 days
  • Top authors: cyrilbatillat (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

60+ active /2,814 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼1.92ms] Passed 4 tests

A check of server-side resources used by Gravity Forms User Restrictions
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0239.83 ▼1.55
Dashboard /wp-admin3.32 ▲0.0248.03 ▼5.75
Posts /wp-admin/edit.php3.37 ▲0.0252.46 ▲2.04
Add New Post /wp-admin/post-new.php5.90 ▲0.0290.56 ▼2.16
Media Library /wp-admin/upload.php3.24 ▲0.0239.62 ▲1.78

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for Gravity Forms User Restrictions
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▼0.011.77 ▼0.2441.16 ▲0.99
Dashboard /wp-admin2,198 ▲245.57 ▼0.0280.47 ▼10.0736.72 ▼5.66
Posts /wp-admin/edit.php2,103 ▲31.95 ▼0.0341.50 ▲6.8336.06 ▲0.24
Add New Post /wp-admin/post-new.php1,526 ▼023.72 ▲0.66675.70 ▲46.1054.38 ▼4.63
Media Library /wp-admin/upload.php1,394 ▼64.23 ▲0.0997.27 ▼17.4441.99 ▼4.88

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

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

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 take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gravity-forms-user-restrictions/index.php:58

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 93% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Donate link: Invalid URI found ("")
Please take inspiration from this readme.txt

gravity-forms-user-restrictions/index.php 92% from 13 tests

The primary PHP file in "Gravity Forms User Restrictions" version 1.0.3 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("gravity-forms-user-restrictions.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin343 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP146107285
PO File1131539
JavaScript12019

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity40.00
▷ Minimum class complexity40.00
▷ Maximum class complexity40.00
Average method complexity3.79
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods17.14%
▷ Public methods1071.43%
▷ Protected methods00.00%
▷ Private methods428.57%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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