74% simple-floating-contact-form

Code Review | Simple Floating Contact Form

WordPress plugin Simple Floating Contact Form scored74%from 54 tests.

About plugin

  • Plugin page: simple-floating-c...
  • Plugin version: 1.4.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.4-6.3
  • WordPress version: 6.3.1
  • First release: Dec 22, 2021
  • Latest release: Oct 19, 2023
  • Number of updates: 32
  • Update frequency: every 21.0 days
  • Top authors: wpserved (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /2,194 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.43MB] [CPU: ▲2.06ms] Passed 4 tests

This is a short check of server-side resources used by Simple Floating Contact Form
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.98 ▲0.5241.31 ▲5.75
Dashboard /wp-admin3.76 ▲0.4653.72 ▲6.69
Posts /wp-admin/edit.php3.81 ▲0.4653.32 ▲0.87
Add New Post /wp-admin/post-new.php6.28 ▲0.3983.78 ▲2.78
Media Library /wp-admin/upload.php3.62 ▲0.3935.86 ▼1.15
Simple Floating Contact Form /wp-admin/options-general.php?page=simple-floating-contact-form-general3.7341.85

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 1,677 new files
Database: no new tables, 42 new options
New WordPress options
sfcf-form-toggler
sfcf-form-name-input
sfcf-color-text
sfcf-color-terms-link
sfcf-color-bg
sfcf-display-pages
sfcf-color-success-icon
sfcf-success-button
sfcf-color-input-border
sfcf-corners-square
...

Browser metrics Passed 4 tests

A check of browser resources used by Simple Floating Contact Form
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,249 ▲48816.67 ▲2.1423.59 ▲21.9959.07 ▲18.55
Dashboard /wp-admin2,359 ▲1827.20 ▲1.55149.06 ▲66.0841.09 ▲1.31
Posts /wp-admin/edit.php2,293 ▲1933.98 ▲1.9871.06 ▲36.2232.04 ▼5.25
Add New Post /wp-admin/post-new.php1,558 ▲3222.80 ▼0.36666.25 ▼22.2336.33 ▼30.28
Media Library /wp-admin/upload.php1,430 ▲335.38 ▲1.17103.80 ▲3.5543.31 ▲0.81
Simple Floating Contact Form /wp-admin/options-general.php?page=simple-floating-contact-form-general3,3445.22134.6039.74

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
These items require your attention
  • This plugin did not uninstall successfully, leaving 42 options in the database
    • widget_recent-posts
    • sfcf-display-posts
    • sfcf-success-title
    • sfcf-success-note
    • sfcf-color-input-text-focus
    • sfcf-corners-square
    • sfcf-color-input-text
    • can_compress_scripts
    • sfcf-no-styling-option
    • sfcf-form-icon
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% 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
Please fix the following
  • 334× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/simple-floating-contact-form/vendor/composer/installers/src/Composer/Installers/ZikulaInstaller.php:4
    • > PHP Fatal error
      Trait 'Illuminate\\Support\\Traits\\Macroable' not found in wp-content/plugins/simple-floating-contact-form/vendor/illuminate/support/Str.php on line 12
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Contracts\\Translation\\TranslatorInterface' not found in wp-content/plugins/simple-floating-contact-form/vendor/symfony/translation/IdentityTranslator.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Formatter\\MessageFormatterInterface' not found in wp-content/plugins/simple-floating-contact-form/vendor/symfony/translation/Formatter/MessageFormatter.php:23
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\Translation\\Extractor\\ExtractorInterface' not found in wp-content/plugins/simple-floating-contact-form/vendor/symfony/translation/Extractor/ChainExtractor.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon\\Exceptions\\InvalidArgumentException' not found in wp-content/plugins/simple-floating-contact-form/vendor/nesbot/carbon/src/Carbon/Exceptions/UnitException.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Support\\Facades\\Facade' not found in wp-content/plugins/simple-floating-contact-form/vendor/illuminate/support/Facades/Cache.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'Illuminate\\Support\\Facades\\Facade' not found in wp-content/plugins/simple-floating-contact-form/vendor/illuminate/support/Facades/Date.php:88
    • > PHP Fatal error
      Uncaught Error: Class 'Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/simple-floating-contact-form/vendor/composer/installers/src/Composer/Installers/WinterInstaller.php:4
    • > PHP Fatal error
      Uncaught Error: Interface 'Illuminate\\Contracts\\Support\\Arrayable' not found in wp-content/plugins/simple-floating-contact-form/vendor/illuminate/support/MessageBag.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
6 plugin tags: floating contact form, simple contact form, contact button, contact form, floating form...

simple-floating-contact-form/simple-floating-contact-form.php Passed 13 tests

"Simple Floating Contact Form" version 1.4.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
39 characters long description:
Show the contact popup on your website.

Code Analysis 3% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Please fix the following items
  • Even if your plugin relies on executable files (for example a companion app), never distribute executable files with your plugin
    • .bat - Batch File in Windows
      • wp-content/plugins/simple-floating-contact-form/vendor/nesbot/carbon/bin/carbon.bat
65,273 lines of code in 1,447 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,39110,50536,52553,042
SVG5016,261
XSD392482,803
JSON18001,829
Markdown173711947
PO File17582171
YAML3313123
reStructuredText1747875
Bourne Shell131112
DOS Batch1004
JavaScript4004
CSS2002

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
It is recommended to fix the following
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 140)
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity7.74
▷ Minimum class complexity1.00
▷ Maximum class complexity324.00
Average method complexity2.51
▷ Minimum method complexity1.00
▷ Maximum method complexity140.00
Code structure
Namespaces90
Interfaces129
Traits35
Classes371
▷ Abstract classes215.66%
▷ Concrete classes35094.34%
▷ Final classes3911.14%
Methods3,171
▷ Static methods64320.28%
▷ Public methods2,74386.50%
▷ Protected methods2838.92%
▷ Private methods1454.57%
Functions494
▷ Named functions13026.32%
▷ Anonymous functions36473.68%
Constants202
▷ Global constants157.43%
▷ Class constants18792.57%
▷ Public constants18397.86%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin