88% contact-us-for-wp

Code Review | Contact Us for WP

WordPress plugin Contact Us for WP scored 88% from 53 tests.

About plugin

  • Plugin page: contact-us-for-wp
  • Plugin version: 2.3.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.1-5.8
  • WordPress version: 5.8.1
  • First release: Apr 28, 2020
  • Latest release: Oct 23, 2021
  • Number of updates: 104
  • Update frequency: every 5.2 days
  • Top authors: sana.azmeh (100%)

Code review

53 tests

User reviews

3 reviews

Install metrics

20+ active / 1,232 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▼253.69ms] Passed 4 tests

Server-side resources used by Contact Us for WP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.98 ▲0.2633.27 ▲9.39
Dashboard /wp-admin3.28 ▲0.2340.28 ▼0.12
Posts /wp-admin/edit.php3.33 ▲0.2243.93 ▲11.92
Add New Post /wp-admin/post-new.php5.58 ▲0.1587.64 ▼1,019.10
Media Library /wp-admin/upload.php3.16 ▲0.1531.69 ▼4.93
Contact Us for WP /wp-admin/options-general.php?page=contactuswp-options3.1328.63

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 52 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Contact Us for WP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,900 ▲29516.34 ▲0.9513.12 ▲3.9256.87 ▲7.84
Dashboard /wp-admin2,940 ▲875.91 ▲0.04134.96 ▼3.55103.95 ▲5.81
Posts /wp-admin/edit.php2,719 ▲132.69 ▼0.0166.68 ▼3.7988.43 ▼8.78
Add New Post /wp-admin/post-new.php1,670 ▲1718.74 ▼0.22342.73 ▼58.19102.71 ▼12.22
Media Library /wp-admin/upload.php1,782 ▲74.98 ▼0.04144.36 ▼2.01111.82 ▼6.73
Contact Us for WP /wp-admin/options-general.php?page=contactuswp-options1,2472.3260.1977.95

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Uninstall script ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/contact-us-for-wp/admin/partials/contactuswp-admin-display.php
    • > /wp-content/plugins/contact-us-for-wp/public/partials/contactuswp-public-display.php
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-us-for-wp/includes/service.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-us-for-wp/admin/contactuswp-settings.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-us-for-wp/includes/contactuswp-functions.php:61

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: form, contact us, email, get in touch

contact-us-for-wp/contactuswp.php 85% from 13 tests

The main PHP script in "Contact Us for WP" version 2.3.2 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("contact-us-for-wp.php" instead of "contactuswp.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected9,056 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
SVG1044,934
CSS61,531263,289
PHP15221684729
JavaScript22359104

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.14
Average class complexity1.71
▷ Minimum class complexity1.00
▷ Maximum class complexity4.00
Average method complexity1.14
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods24
▷ Static methods28.33%
▷ Public methods1979.17%
▷ Protected methods00.00%
▷ Private methods520.83%
Functions32
▷ Named functions3196.88%
▷ Anonymous functions13.12%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

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