10% stedb-forms

Code Review | STEdb Forms

WordPress plugin STEdb Forms scored10%from 54 tests.

About plugin

  • Plugin page: stedb-forms
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-5.5.1
  • WordPress version: 6.3.1
  • First release: Jan 20, 2020
  • Latest release: Sep 7, 2020
  • Number of updates: 18
  • Update frequency: every 18.7 days
  • Top authors: stedbcorp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /791 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/stedb-forms/includes/class-stedb-account.php+44
    Trying to get property 'user_id' of non-object

Server metrics [RAM: ▲0.33MB] [CPU: ▲0.28ms] 75% from 4 tests

Server-side resources used by STEdb Forms
Please fix the following
  • CPU: Total CPU usage should be kept under 500.00ms (currently 10,034.74ms on /wp-admin/admin.php?page=ste-report-template)
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3138.55 ▲2.23
Dashboard /wp-admin3.68 ▲0.3850.08 ▲4.30
Posts /wp-admin/edit.php3.73 ▲0.3852.56 ▲3.35
Add New Post /wp-admin/post-new.php6.22 ▲0.3484.53 ▼8.74
Media Library /wp-admin/upload.php3.54 ▲0.3240.20 ▲5.99
Send Email /wp-admin/admin.php?page=ste-send-email-template3.5010,037.15
Settings /wp-admin/admin.php?page=ste-setting3.5010,035.91
Form Builder /wp-admin/admin.php?page=ste-form-builder3.5010,037.47
Forms /wp-admin/admin.php?page=ste-from-data-template3.5010,044.46
Report /wp-admin/admin.php?page=ste-report-template3.5010,034.74

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 191 new files
Database: 4 new tables, 7 new options
New tables
stedb_form_builder_data
stedb_send_email_entries
stedb_form_entries
stedb_form_list
New WordPress options
db_upgraded
widget_recent-posts
stedb_installed
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by STEdb Forms
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,986 ▲24013.94 ▼0.435.22 ▲3.5820.65 ▼21.41
Dashboard /wp-admin2,279 ▲875.30 ▲0.28114.20 ▲3.2046.87 ▲6.03
Posts /wp-admin/edit.php2,194 ▲1052.67 ▲0.6747.92 ▲10.6537.70 ▲4.01
Add New Post /wp-admin/post-new.php1,578 ▲3622.18 ▲3.92628.32 ▲5.9432.83 ▼30.30
Media Library /wp-admin/upload.php1,461 ▲764.62 ▲0.4195.80 ▼8.7841.06 ▼1.38
Send Email /wp-admin/admin.php?page=ste-send-email-template3,1115.51112.79201.20
Settings /wp-admin/admin.php?page=ste-setting2,2662.3029.0052.55
Form Builder /wp-admin/admin.php?page=ste-form-builder1,3422.5744.5469.61
Forms /wp-admin/admin.php?page=ste-from-data-template1,0482.1828.7928.58
Report /wp-admin/admin.php?page=ste-report-template9382.3027.8833.52

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure failed, leaving 4 tables in the database
    • stedb_form_builder_data
    • stedb_send_email_entries
    • stedb_form_list
    • stedb_form_entries
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • stedb_installed
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ste-report-template
    • > Notice in wp-content/plugins/stedb-forms/includes/class-stedb-account.php+44
    Trying to get property 'user_id' of non-object
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ste-report-template
    • > Notice in wp-content/plugins/stedb-forms/includes/class-stedb-account.php+45
    Trying to get property 'secret' of non-object
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ste-report-template
    • > Notice in wp-content/plugins/stedb-forms/includes/class-stedb-account.php+46
    Trying to get property 'base_url' of non-object
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ste-report-template
    • > Notice in wp-content/plugins/stedb-forms/admin/class-stedb-forms-wordpress-admin.php+823
    Trying to get property 'err_code' of non-object
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ste-report-template
    • > Notice in wp-content/plugins/stedb-forms/admin/class-stedb-forms-wordpress-admin.php+827
    Trying to get property 'error' of non-object
  • 241 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=ste-setting
    • > Notice in wp-content/plugins/stedb-forms/admin/template/ste-setting.php+575
    Undefined variable: country

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
  • 74× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressCS\\WordPress\\Sniff' not found in wp-content/plugins/stedb-forms/wpcs/WordPress/Sniffs/WhiteSpace/ControlStructureSpacingSniff.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressCS\\WordPress\\AbstractClassRestrictionsSniff' not found in wp-content/plugins/stedb-forms/wpcs/WordPress/Sniffs/DB/RestrictedClassesSniff.php:29
    • > PHP Fatal error
      Uncaught Error: Class 'WP_List_Table' not found in wp-content/plugins/stedb-forms/admin/template/ste-form-data.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressCS\\WordPress\\AbstractFunctionParameterSniff' not found in wp-content/plugins/stedb-forms/wpcs/WordPress/Sniffs/Utils/I18nTextDomainFixerSniff.php:28
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressCS\\WordPress\\Sniff' not found in wp-content/plugins/stedb-forms/wpcs/WordPress/Sniffs/Arrays/CommaAfterArrayItemSniff.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressCS\\WordPress\\AbstractFunctionParameterSniff' not found in wp-content/plugins/stedb-forms/wpcs/WordPress/Sniffs/NamingConventions/ValidHookNameSniff.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressCS\\WordPress\\AbstractFunctionRestrictionsSniff' not found in wp-content/plugins/stedb-forms/wpcs/WordPress/Sniffs/PHP/DontExtractSniff.php:26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/stedb-forms/admin/template/ste-send-email.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressCS\\WordPress\\AbstractFunctionRestrictionsSniff' not found in wp-content/plugins/stedb-forms/wpcs/WordPress/AbstractClassRestrictionsSniff.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'WordPressCS\\WordPress\\AbstractFunctionRestrictionsSniff' not found in wp-content/plugins/stedb-forms/wpcs/WordPress/Sniffs/WP/TimezoneChangeSniff.php:27

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=ste-send-email-template
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught

Optimizations

Plugin configuration 86% 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:
  • Screenshots: Please add images for these screenshots: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is taken from), #2 (This is the second screen shot)
Please take inspiration from this readme.txt

stedb-forms/stedb-forms-wordpress.php 77% from 13 tests

The primary PHP file in "STEdb Forms" version 1.0.4 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Main file name: Name the main plugin file the same as the plugin slug ("stedb-forms.php" instead of "stedb-forms-wordpress.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 179 characters long)

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Please make sure to remedy the following
  • Do not distribute dangerous files with your plugin
    • .cmd - Command Script in Windows
      • wp-content/plugins/stedb-forms/node_modules/.bin/prettier.cmd
    • .ps1 - Windows PowerShell Cmdlet in Windows
      • wp-content/plugins/stedb-forms/node_modules/.bin/prettier.ps1
138,881 lines of code in 138 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript2324,75013,929105,255
CSS121,88724816,243
PHP862,8657,33812,902
SVG3102,709
Markdown324601,274
XML5159403339
JSON300117
DOS Batch12015
PowerShell11314
Bourne Shell12013

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please tend to the following items
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 114)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity25.46
▷ Minimum class complexity1.00
▷ Maximum class complexity287.00
Average method complexity6.95
▷ Minimum method complexity1.00
▷ Maximum method complexity114.00
Code structure
Namespaces12
Interfaces0
Traits0
Classes74
▷ Abstract classes56.76%
▷ Concrete classes6993.24%
▷ Final classes00.00%
Methods305
▷ Static methods103.28%
▷ Public methods21871.48%
▷ Protected methods7624.92%
▷ Private methods113.61%
Functions9
▷ Named functions777.78%
▷ Anonymous functions222.22%
Constants10
▷ Global constants110.00%
▷ Class constants990.00%
▷ Public constants9100.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
24 PNG files occupy 0.09MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/images/gp.png3.27KB0.99KB▼ 69.68%
admin/images/ln.png3.03KB0.57KB▼ 81.16%
admin/images/vertical_gp.png2.73KB0.09KB▼ 96.85%
admin/images/text-box.png2.17KB0.63KB▼ 70.80%
admin/images/select-box.png3.57KB1.36KB▼ 61.83%