10% modern-designs-for-gravity-forms

Code Review | Modern Designs for Gravity Forms

WordPress plugin Modern Designs for Gravity Forms scored 10% from 54 tests.

About plugin

  • Plugin page: modern-designs-fo...
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.5.1
  • WordPress version: 5.9.2
  • First release: Sep 4, 2020
  • Latest release: Dec 28, 2020
  • Number of updates: 9
  • Update frequency: every 12.8 days
  • Top authors: ggedde (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 833 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/modern-designs-for-gravity-forms/incfs/includes/class-freemius.php+7771
    Trying to access array offset on value of type null

Server metrics [RAM: ▲4.85MB] [CPU: ▼274.55ms] Passed 4 tests

This is a short check of server-side resources used by Modern Designs for Gravity Forms
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /8.75 ▲5.2476.49 ▲23.16
Dashboard /wp-admin8.77 ▲5.3656.99 ▲16.95
Posts /wp-admin/edit.php8.77 ▲5.1358.85 ▲20.58
Add New Post /wp-admin/post-new.php10.65 ▲3.68119.23 ▼1,153.54
Media Library /wp-admin/upload.php8.77 ▲5.4842.71 ▲17.81
Upgrade  ➤ /wp-admin/admin.php?page=modern-designs-for-gravity-forms-pricing8.7743.89
Support Forum /wp-admin/admin.php?page=modern-designs-for-gravity-forms-wp-support-forum8.7739.60
Contact Us /wp-admin/admin.php?page=modern-designs-for-gravity-forms-contact8.7743.79
Freemius Debug [v.2.4.1] /wp-admin/admin.php?page=freemius8.7742.01

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 184 new files
Database: no new tables, 4 new options
New WordPress options
fs_active_plugins
fs_accounts
fs_gdpr
fs_debug_mode

Browser metrics Passed 4 tests

A check of browser resources used by Modern Designs for Gravity Forms
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,799 ▲4115.65 ▼0.136.90 ▲0.782.43 ▲0.03
Dashboard /wp-admin2,931 ▲706.09 ▼0.10115.42 ▼16.82169.19 ▲8.70
Posts /wp-admin/edit.php2,724 ▲333.24 ▲0.0063.06 ▼0.77137.07 ▼7.38
Add New Post /wp-admin/post-new.php1,685 ▲1722.34 ▲4.38392.60 ▼2.36154.90 ▼0.18
Media Library /wp-admin/upload.php1,731 ▲335.51 ▲0.05139.50 ▼8.24199.90 ▲16.35
Upgrade  ➤ /wp-admin/admin.php?page=modern-designs-for-gravity-forms-pricing2,3514.7386.86218.65
Support Forum /wp-admin/admin.php?page=modern-designs-for-gravity-forms-wp-support-forum1,3723.1281.44122.12
Contact Us /wp-admin/admin.php?page=modern-designs-for-gravity-forms-contact1,7524.3175.55109.03
Freemius Debug [v.2.4.1] /wp-admin/admin.php?page=freemius1,4302.4553.47114.42

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/modern-designs-for-gravity-forms/incfs/includes/class-freemius.php+8540
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 4 options
    • fs_debug_mode
    • fs_gdpr
    • fs_accounts
    • fs_active_plugins

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% 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 take a closer look at the following
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/modern-designs-for-gravity-forms/incfs/templates/ajax-loader.php
  • 8× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/modern-designs-for-gravity-forms/incfs/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/modern-designs-for-gravity-forms/incfs/templates/account/partials/addon.php on line 6
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/modern-designs-for-gravity-forms/incfs/templates/account/partials/addon.php on line 8
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/modern-designs-for-gravity-forms/incfs/templates/account/partials/addon.php on line 7
    • > PHP Notice
      Undefined variable: VARS in wp-content/plugins/modern-designs-for-gravity-forms/incfs/templates/account/partials/addon.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function freemius() in wp-content/plugins/modern-designs-for-gravity-forms/incfs/templates/partials/network-activation.php:6
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/modern-designs-for-gravity-forms/incfs/templates/account/partials/addon.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_slug() on null in wp-content/plugins/modern-designs-for-gravity-forms/incfs/templates/account/partials/addon.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There were no browser issues found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: modern styles, material design, bootstrap, gravity forms, dark theme

modern-designs-for-gravity-forms/modern-designs-for-gravity-forms.php 92% from 13 tests

"Modern Designs for Gravity Forms" version 1.1.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis 97% from 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
No dangerous file extensions were detected33,419 lines of code in 139 files:
LanguageFilesBlank linesComment linesLines of code
PHP1177,38916,41631,723
Sass24901,274
JavaScript75364321
CSS1316101

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Class cyclomatic complexity has to be reduced to less than 1000 (currently 2,895)
Cyclomatic complexity
Average complexity per logical line of code0.63
Average class complexity84.88
▷ Minimum class complexity1.00
▷ Maximum class complexity2,895.00
Average method complexity4.71
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes50
▷ Abstract classes24.00%
▷ Concrete classes4896.00%
▷ Final classes00.00%
Methods1,164
▷ Static methods17314.86%
▷ Public methods82170.53%
▷ Protected methods151.29%
▷ Private methods32828.18%
Functions96
▷ Named functions9497.92%
▷ Anonymous functions22.08%
Constants122
▷ Global constants9779.51%
▷ Class constants2520.49%
▷ Public constants25100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
incfs/assets/img/gravityforms-modern-designs.png3.15KB2.85KB▼ 9.48%
incfs/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
incfs/assets/img/mdfgf.png9.16KB5.26KB▼ 42.58%
incfs/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%