84% first-contact-form

Code Review | First Contact Form

WordPress plugin First Contact Form scored84%from 54 tests.

About plugin

  • Plugin page: first-contact-form
  • Plugin version: 1.0.7
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.1
  • WordPress version: 6.3.1
  • First release: May 12, 2014
  • Latest release: Nov 22, 2014
  • Number of updates: 34
  • Update frequency: every 5.7 days
  • Top authors: capripio (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /2,662 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.16MB] [CPU: ▼0.40ms] Passed 4 tests

An overview of server-side resources used by First Contact Form
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1635.05 ▼8.13
Dashboard /wp-admin3.48 ▲0.1358.15 ▼3.87
Posts /wp-admin/edit.php3.60 ▲0.2453.58 ▲7.39
Add New Post /wp-admin/post-new.php6.07 ▲0.1995.76 ▲3.03
Media Library /wp-admin/upload.php3.38 ▲0.1543.36 ▲9.09
All Contact Forms /wp-admin/edit.php?post_type=first_contact3.4537.29
Add New /wp-admin/post-new.php?post_type=first_contact3.5362.52

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 147 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by First Contact Form
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,418 ▲64717.68 ▲3.2943.46 ▲41.5338.34 ▼3.83
Dashboard /wp-admin2,433 ▲2456.92 ▲1.06140.94 ▲23.3638.43 ▼5.14
Posts /wp-admin/edit.php2,337 ▲2484.04 ▲2.0455.11 ▲16.2930.37 ▼3.07
Add New Post /wp-admin/post-new.php6,465 ▲4,94628.71 ▲5.28833.88 ▲175.6734.03 ▼16.61
Media Library /wp-admin/upload.php1,489 ▲1074.75 ▲0.5285.91 ▼15.4642.19 ▼5.00
All Contact Forms /wp-admin/edit.php?post_type=first_contact1,3013.9652.1729.33
Add New /wp-admin/post-new.php?post_type=first_contact3,0309.49203.41105.17

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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 take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/first-contact-form/fcf.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === first-contact-form === )
You can take inspiration from this readme.txt

first-contact-form/fcf.php 92% from 13 tests

The entry point to "First Contact Form" version 1.0.7 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("first-contact-form.php" instead of "fcf.php")

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
There were no executable files found in this plugin12,546 lines of code in 117 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1042,3492,36011,206
PHP34627815
SVG200450
CSS80375

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity32.50
▷ Minimum class complexity18.00
▷ Maximum class complexity47.00
Average method complexity2.91
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods33
▷ Static methods515.15%
▷ Public methods2163.64%
▷ Protected methods00.00%
▷ Private methods1236.36%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 compressed PNG files occupy 0.10MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
resources/js-webshim/shims/jpicker/images/preview-opacity.png0.13KB0.09KB▼ 31.85%
resources/js-webshim/shims/jpicker/images/Bars.png1.47KB11.70KB0.00%
resources/js-webshim/shims/styles/forms.png3.33KB2.19KB▼ 34.16%
resources/js-webshim/shims/jpicker/images/NoColor.png0.54KB0.60KB0.00%
resources/js-webshim/shims/jpicker/images/Maps.png89.86KB138.29KB0.00%