77% sv-gravity-forms-enhancer

Code Review | SV Gravity Forms Enhancer

WordPress plugin SV Gravity Forms Enhancer scored77%from 54 tests.

About plugin

  • Plugin page: sv-gravity-forms-...
  • Plugin version: 1.9.00
  • PHP compatiblity: 7.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.0.0
  • WordPress version: 6.3.1
  • First release: Mar 7, 2018
  • Latest release: May 31, 2022
  • Number of updates: 16
  • Update frequency: every 96.6 days
  • Top authors: Matthias Reuter (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,571 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲6.03MB] [CPU: ▲29.16ms] 75% from 4 tests

A check of server-side resources used by SV Gravity Forms Enhancer
Please fix the following
  • Extra RAM: The extra memory usage must be under 5MB (currently 6.03MB on /wp-admin/admin.php?page=straightvisions)
PageMemory (MB)CPU Time (ms)
Home /9.71 ▲6.2581.08 ▲33.30
Dashboard /wp-admin9.74 ▲6.4482.36 ▲26.03
Posts /wp-admin/edit.php9.75 ▲6.3987.16 ▲38.41
Add New Post /wp-admin/post-new.php10.93 ▲5.04117.40 ▲18.88
Media Library /wp-admin/upload.php9.74 ▲6.5280.88 ▲43.64
SV Gravity Forms Enhancer /wp-admin/admin.php?page=sv_gravity_forms_enhancer9.7468.81
Info /wp-admin/admin.php?page=straightvisions9.7473.15

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 330 new files
Database: no new tables, 11 new options
New WordPress options
db_upgraded
widget_recent-comments
sv_gravity_forms_enhancer_scripts_settings_sv_core_color_picker_attached
can_compress_scripts
sv_gravity_forms_enhancer_version
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
sv_gravity_forms_enhancer_scripts_settings_flush_css_cache
fs_debug_mode
...

Browser metrics Passed 4 tests

Checking browser requirements for SV Gravity Forms Enhancer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,853 ▲10713.30 ▼1.071.87 ▲0.1138.56 ▼4.56
Dashboard /wp-admin2,220 ▲325.04 ▲0.18101.73 ▼14.8476.99 ▲34.83
Posts /wp-admin/edit.php2,118 ▲292.01 ▼0.0539.74 ▲2.4835.74 ▲3.55
Add New Post /wp-admin/post-new.php1,547 ▲2822.92 ▼0.09702.10 ▲42.1136.74 ▼13.40
Media Library /wp-admin/upload.php1,405 ▲144.12 ▼0.08102.09 ▼2.5548.85 ▲1.36
SV Gravity Forms Enhancer /wp-admin/admin.php?page=sv_gravity_forms_enhancer1,41610.67214.80119.92
Info /wp-admin/admin.php?page=straightvisions1,53810.6282.66294.66

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 11 options in the database
    • sv_gravity_forms_enhancer_version
    • sv_gravity_forms_enhancer_scripts_settings_flush_css_cache
    • db_upgraded
    • sv_gravity_forms_enhancer_scripts_settings_sv_core_color_picker_attached
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options
    • fs_debug_mode
    • fs_active_plugins
    • can_compress_scripts
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/sv-gravity-forms-enhancer/lib/core_plugin/core/settings/tpl/setting_checkbox_field.php
  • 243× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'sv_core\\sv_abstract' not found in wp-content/plugins/sv-gravity-forms-enhancer/lib/core_plugin/core/metabox/metabox.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function sv_core\\__() in wp-content/plugins/sv-gravity-forms-enhancer/lib/core_plugin/core/abstract.php:286
    • > PHP Fatal error
      Uncaught Error: Class 'sv_core\\settings' not found in wp-content/plugins/sv-gravity-forms-enhancer/lib/core_plugin/core/settings/modules/setting_upload/setting_upload.php:5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sv-gravity-forms-enhancer/lib/core_plugin/core/settings/tpl/setting_text.php on line 5
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sv-gravity-forms-enhancer/lib/core_plugin/core/settings/tpl/setting_upload.php on line 21
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/sv-gravity-forms-enhancer/lib/core_plugin/core/settings/tpl/setting_upload.php on line 16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/sv-gravity-forms-enhancer/lib/core_plugin/core/backend/tpl/about.php:1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/sv-gravity-forms-enhancer/lib/core_plugin/core/settings/tpl/setting_checkbox_field.php on line 15
    • > PHP Notice
      Undefined variable: props in wp-content/plugins/sv-gravity-forms-enhancer/lib/core_plugin/core/settings/tpl/setting_text.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/sv-gravity-forms-enhancer/lib/core_plugin/core/settings/tpl/setting_font_tpl/line_height.php:2

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

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need to be fixed:
  • Donate link: Invalid URI ("")
You can take inspiration from this readme.txt

sv-gravity-forms-enhancer/sv_gravity_forms_enhancer.php 77% from 13 tests

The principal PHP file in "SV Gravity Forms Enhancer" v. 1.9.00 is loaded by WordPress automatically on each request
The following require your attention:
  • Domain Path: The domain path folder does not exist ("/languages")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sv-gravity-forms-enhancer.php" instead of "sv_gravity_forms_enhancer.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected40,860 lines of code in 266 files:
LanguageFilesBlank linesComment linesLines of code
PHP2078,30717,55536,134
CSS39288892,850
JavaScript14235180899
PO File1190253395
SVG100339
Markdown3680216
JSON10027

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 2,910)
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity53.68
▷ Minimum class complexity1.00
▷ Maximum class complexity2,910.00
Average method complexity3.98
▷ Minimum method complexity1.00
▷ Maximum method complexity86.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes90
▷ Abstract classes33.33%
▷ Concrete classes8796.67%
▷ Final classes00.00%
Methods1,629
▷ Static methods18111.11%
▷ Public methods1,21374.46%
▷ Protected methods674.11%
▷ Private methods34921.42%
Functions115
▷ Named functions9380.87%
▷ Anonymous functions2219.13%
Constants126
▷ Global constants9877.78%
▷ Class constants2822.22%
▷ Public constants28100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/core_plugin/freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
lib/core_plugin/freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
lib/core_plugin/assets/logo_icon.png1.34KB0.76KB▼ 43.44%