72% collect-lead-form

Code Review | Collect Lead Form

WordPress plugin Collect Lead Form scored72%from 54 tests.

About plugin

  • Plugin page: collect-lead-form
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 16, 2023
  • Latest release: Mar 3, 2023
  • Number of updates: 7
  • Update frequency: every 2.1 days
  • Top authors: ferdausalom (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /156 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.36MB] [CPU: ▲2.55ms] Passed 4 tests

This is a short check of server-side resources used by Collect Lead Form
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.84 ▲0.3845.28 ▲5.10
Dashboard /wp-admin3.70 ▲0.3951.58 ▲3.17
Posts /wp-admin/edit.php3.75 ▲0.3956.54 ▲8.77
Add New Post /wp-admin/post-new.php6.24 ▲0.3587.12 ▲0.57
Media Library /wp-admin/upload.php3.53 ▲0.3035.76 ▲1.37
Collected Leads /wp-admin/edit.php?post_type=clcf_leads3.6739.42
Lead Forms /wp-admin/edit.php?post_type=clcf_leads&page=collect-lead-forms3.5738.23

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 602 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Collect Lead Form
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,209 ▲47418.86 ▲4.486.42 ▲4.6642.03 ▼4.82
Dashboard /wp-admin2,511 ▲3239.22 ▲4.23176.03 ▲59.3538.81 ▼4.96
Posts /wp-admin/edit.php2,423 ▲3346.18 ▲4.0473.83 ▲34.7131.73 ▼2.40
Add New Post /wp-admin/post-new.php1,413 ▼10616.74 ▼6.69530.71 ▼128.2830.07 ▼25.60
Media Library /wp-admin/upload.php1,559 ▲1716.64 ▲2.35111.90 ▲12.3840.38 ▼4.05
Collected Leads /wp-admin/edit.php?post_type=clcf_leads1,3966.1974.8525.94
Configure Server /wp-admin/crb_carbon_fields_container_configure_server.php260.440.0714.38
Lead Forms /wp-admin/edit.php?post_type=clcf_leads&page=collect-lead-forms1,3865.9466.50115.68
Form Messages /wp-admin/crb_carbon_fields_container_form_messages.php260.440.126.11

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
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not 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
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/collect-lead-form/views/admin/cl-forms.php
    • > /wp-content/plugins/collect-lead-form/views/email-template.php
    • > /wp-content/plugins/collect-lead-form/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
  • 241× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/collect-lead-form/vendor/composer/installers/src/Composer/Installers/PxcmsInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/collect-lead-form/vendor/composer/installers/src/Composer/Installers/CodeIgniterInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/collect-lead-form/index.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/collect-lead-form/vendor/composer/installers/src/Composer/Installers/MakoInstaller.php:4
    • > PHP Warning
      Use of undefined constant CLCF__PLUGIN_URL - assumed 'CLCF__PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/collect-lead-form/views/admin/cl-forms.php on line 56
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Fulfillable\\Translator\\Array_Translator' not found in wp-content/plugins/collect-lead-form/vendor/htmlburger/carbon-fields/core/Container/Fulfillable/Translator/Json_Translator.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/collect-lead-form/vendor/composer/installers/src/Composer/Installers/PlentymarketsInstaller.php:4
    • > PHP Notice
      Undefined variable: hideErrorsCookieName in wp-content/plugins/collect-lead-form/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php on line 21
    • > PHP Warning
      Use of undefined constant CLCF__PLUGIN_URL - assumed 'CLCF__PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/collect-lead-form/views/admin/cl-forms.php on line 86
    • > PHP Fatal error
      Uncaught Error: Call to undefined function CollectLeadContactForm\\esc_html() in wp-content/plugins/collect-lead-form/CLCFClasses/CLCF_Store.php:6

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please take a look at the following user-side issues
    • > GET request to /wp-admin/crb_carbon_fields_container_configure_server.php
    • > Network (severe)
    wp-admin/crb_carbon_fields_container_configure_server.php - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/crb_carbon_fields_container_form_messages.php
    • > Network (severe)
    wp-admin/crb_carbon_fields_container_form_messages.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed: The official readme.txt is a good inspiration

collect-lead-form/collect-lead-form.php 85% from 13 tests

The main PHP script in "Collect Lead Form" version 1.0.2 is automatically included on every request by WordPress
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 161 characters long)
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin36,407 lines of code in 535 files:
LanguageFilesBlank linesComment linesLines of code
PHP2683,1757,31212,262
JSON80010,343
JavaScript1681,7933,7007,860
PO File268191,0202,202
Sass4934001,794
CSS92787401,748
YAML3313123
Markdown425075

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity5.44
▷ Minimum class complexity1.00
▷ Maximum class complexity50.00
Average method complexity2.04
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces26
Interfaces5
Traits0
Classes236
▷ Abstract classes125.08%
▷ Concrete classes22494.92%
▷ Final classes10.45%
Methods1,044
▷ Static methods10710.25%
▷ Public methods83079.50%
▷ Protected methods19919.06%
▷ Private methods151.44%
Functions112
▷ Named functions2320.54%
▷ Anonymous functions8979.46%
Constants36
▷ Global constants925.00%
▷ Class constants2775.00%
▷ Public constants27100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/forms/touch.png18.99KB4.97KB▼ 73.83%