94% gm-contact-form

Code Review | GM Contact Form

WordPress plugin GM Contact Form scored 94% from 54 tests.

About plugin

  • Plugin page: gm-contact-form
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.8.1
  • WordPress version: 5.8.1
  • First release: Aug 19, 2017
  • Latest release: Aug 19, 2017
  • Number of updates: 10
  • Update frequency: every 6.7 days
  • Top authors: gabrielmioni (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 487 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼136.30ms] Passed 4 tests

This is a short check of server-side resources used by GM Contact Form
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.87 ▲0.1527.45 ▲3.59
Dashboard /wp-admin3.09 ▲0.0351.50 ▲16.60
Posts /wp-admin/edit.php3.14 ▲0.0244.59 ▼3.59
Add New Post /wp-admin/post-new.php5.45 ▲0.01120.69 ▼547.67
Media Library /wp-admin/upload.php3.03 ▲0.0340.78 ▲2.48
GM Contact /wp-admin/options-general.php?page=gm_contact3.0035.93

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by GM Contact Form
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,796 ▲15916.25 ▲0.3511.13 ▲2.5754.46 ▲1.69
Dashboard /wp-admin2,972 ▲415.90 ▼0.26155.53 ▼2.43125.03 ▼6.87
Posts /wp-admin/edit.php2,744 ▲52.69 ▼0.0189.01 ▲21.54128.94 ▲33.27
Add New Post /wp-admin/post-new.php1,618 ▲321.56 ▲0.14369.06 ▼23.19157.29 ▼24.50
Media Library /wp-admin/upload.php1,812 ▲55.03 ▲0.01202.48 ▲1.89150.35 ▼4.93
GM Contact /wp-admin/options-general.php?page=gm_contact1,0372.09102.44112.31

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/gm-contact-form/gm-contact-form.php:47
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/gm-contact-form/gm-contact-email.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHWPINC/class-phpmailer.php' (include_path='.:/usr/share/php') in wp-content/plugins/gm-contact-form/gm-contact-email.php on line 3
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/gm-contact-form/gm-contact-email.php on line 3
    • > PHP Warning
      require_once(ABSPATHWPINC/class-phpmailer.php): failed to open stream: No such file or directory in wp-content/plugins/gm-contact-form/gm-contact-email.php on line 3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: contact form, form, email, ajax, javascript

gm-contact-form/gm-contact-form.php Passed 13 tests

The main file in "GM Contact Form" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
70 characters long description:
Simple contact form functionality. Example at gabrielmioni.com/contact

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
No dangerous file extensions were detected631 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP4140203414
JavaScript15288168
CSS17049

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity16.00
▷ Minimum class complexity7.00
▷ Maximum class complexity25.00
Average method complexity2.58
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods421.05%
▷ Protected methods1578.95%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin