62% form-styles-for-contact-form-7

Code Review | Form Styles For Contact Form 7

WordPress plugin Form Styles For Contact Form 7 scored62%from 54 tests.

About plugin

  • Plugin page: form-styles-for-c...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-4.5.2
  • WordPress version: 6.3.1
  • First release: May 25, 2016
  • Latest release: May 25, 2016
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: core37 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /5,477 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼3.53ms] 75% from 4 tests

Server-side resources used by Form Styles For Contact Form 7
The following require your attention
  • CPU: The total CPU usage must kept under 500.00ms (currently 841.66ms on /wp-admin/admin.php?page=form-styles-for-contact-form-7/index.php/update)
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0243.85 ▲2.56
Dashboard /wp-admin3.32 ▲0.0154.92 ▲3.58
Posts /wp-admin/edit.php3.37 ▲0.0150.62 ▼4.97
Add New Post /wp-admin/post-new.php5.90 ▲0.0186.88 ▼15.29
Media Library /wp-admin/upload.php3.24 ▲0.0141.88 ▲5.54
CF7 Styles /wp-admin/admin.php?page=form-styles-for-contact-form-7/index.php3.26857.11
Add Styles /wp-admin/admin.php?page=form-styles-for-contact-form-7/index.php/update3.25841.66

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

A short overview of filesystem and database impact
This plugin was installed successfully
Filesystem: 25 new files
Database: 1 new table, 7 new options
New tables
tbl_core37_formstyle
New WordPress options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments
theysaidso_admin_options
jal_db_version
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Form Styles For Contact Form 7
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲8713.22 ▼1.151.74 ▲0.0342.79 ▼1.52
Dashboard /wp-admin2,238 ▲414.98 ▼0.90113.65 ▲10.5470.58 ▲27.46
Posts /wp-admin/edit.php2,129 ▲292.04 ▼0.0135.73 ▼2.5833.15 ▼2.68
Add New Post /wp-admin/post-new.php1,704 ▲17322.65 ▼0.34757.92 ▲126.8855.30 ▲1.09
Media Library /wp-admin/upload.php1,423 ▲324.25 ▲0.04100.00 ▼8.2071.92 ▲29.87
CF7 Styles /wp-admin/admin.php?page=form-styles-for-contact-form-7/index.php8782.0328.1374.33
Add Styles /wp-admin/admin.php?page=form-styles-for-contact-form-7/index.php/update7951.8530.7731.34

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • tbl_core37_formstyle
  • Zombie WordPress options detected upon uninstall: 7 options
    • widget_theysaidso_widget
    • jal_db_version
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options

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
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/form-styles-for-contact-form-7/ajax-js.php
  • 5× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/form-styles-for-contact-form-7/update.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/form-styles-for-contact-form-7/index.php:12
    • > PHP Warning
      Use of undefined constant STYLE_TABLE_NAME - assumed 'STYLE_TABLE_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/form-styles-for-contact-form-7/update.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_results() on null in wp-content/plugins/form-styles-for-contact-form-7/manager.php:8
    • > PHP Warning
      Use of undefined constant STYLE_TABLE_NAME - assumed 'STYLE_TABLE_NAME' (this will throw an Error in a future version of PHP) in wp-content/plugins/form-styles-for-contact-form-7/manager.php on line 5

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There are user-side issues you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=form-styles-for-contact-form-7/index.php/update
    • > Javascript (severe) in unknown
    /wp-content/plugins/form-styles-for-contact-form-7/js/jquery.fancybox-1.3.4.js?ver=6.3.1 28:20 Uncaught TypeError: Cannot read properties of undefined (reading 'msie')
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=form-styles-for-contact-form-7/index.php/update
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).fancybox is not a function" "TypeError: jQuery(...).fancybox is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/form-styles-for-contact-form-7/js/scripts.js?ver=6.3.1:2:34)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=form-styles-for-contact-form-7/index.php/update
    • > 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 TypeError: jQuery(...).fancybox is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
6 plugin tags: captcha, captcha form, contact form, contact form styles, contact form 7...

form-styles-for-contact-form-7/index.php 92% from 13 tests

The main PHP file in "Form Styles For Contact Form 7" ver. 1.0.2 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("form-styles-for-contact-form-7.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
There were no executable files found in this plugin2,042 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript429430856
CSS5136124763
PHP55548423

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
5 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/fancybox.png14.93KB8.47KB▼ 43.29%
css/fancy_title_over.png0.07KB0.09KB0.00%
css/fancybox-x.png0.20KB0.31KB0.00%
css/fancybox-y.png0.17KB0.24KB0.00%
images/icon.png0.70KB0.78KB0.00%