78% contact-us-for-wp

Code Review | Contact Us for WP

WordPress plugin Contact Us for WP scored78%from 54 tests.

About plugin

  • Plugin page: contact-us-for-wp
  • Plugin version: 2.3.3
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.1-6.1
  • WordPress version: 6.3.1
  • First release: Apr 28, 2020
  • Latest release: Dec 18, 2022
  • Number of updates: 112
  • Update frequency: every 8.6 days
  • Top authors: sana.azmeh (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /2,880 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 gracefully, with no errors

Server metrics [RAM: ▲0.17MB] [CPU: ▼0.46ms] Passed 4 tests

An overview of server-side resources used by Contact Us for WP
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1643.90 ▼0.49
Dashboard /wp-admin3.47 ▲0.1643.90 ▼2.41
Posts /wp-admin/edit.php3.59 ▲0.2346.16 ▼1.22
Add New Post /wp-admin/post-new.php6.07 ▲0.1890.87 ▲5.35
Media Library /wp-admin/upload.php3.40 ▲0.1636.14 ▲2.26
Contact Us for WP /wp-admin/options-general.php?page=contactuswp-options3.3632.27

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Contact Us for WP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,983 ▲22213.49 ▼0.859.08 ▲7.1651.09 ▲12.21
Dashboard /wp-admin2,210 ▲305.58 ▼0.0291.80 ▲6.0239.41 ▼5.52
Posts /wp-admin/edit.php2,112 ▲121.99 ▼0.0039.00 ▲3.6536.63 ▲1.87
Add New Post /wp-admin/post-new.php1,546 ▲2018.42 ▼4.58588.57 ▼87.2261.49 ▲4.69
Media Library /wp-admin/upload.php1,406 ▲34.18 ▼0.0495.12 ▼4.5639.66 ▼4.94
Contact Us for WP /wp-admin/options-general.php?page=contactuswp-options1,0142.1222.3827.35

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/contact-us-for-wp/public/partials/contactuswp-public-display.php
    • > /wp-content/plugins/contact-us-for-wp/admin/partials/contactuswp-admin-display.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/contact-us-for-wp/includes/contactuswp-functions.php:67
    • > 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/service.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were 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: contact us, form, get in touch, email

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

"Contact Us for WP" version 2.3.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • 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: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected9,103 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
SVG1044,934
CSS61,531263,289
PHP15225694774
JavaScript22359106

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.15
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%
Functions34
▷ Named functions3397.06%
▷ Anonymous functions12.94%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG files were detected