93% pay-with-contact-form-7

Code Review | Pay with Contact Form 7

WordPress plugin Pay with Contact Form 7 scored 93% from 54 tests.

About plugin

  • Plugin page: pay-with-contact-...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.7.1
  • WordPress version: 5.9.2
  • First release: Jul 11, 2017
  • Latest release: Apr 22, 2021
  • Number of updates: 36
  • Update frequency: every 38.5 days
  • Top authors: cmsminds (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

300+ active / 4,535 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.02MB] [CPU: ▼294.26ms] Passed 4 tests

A check of server-side resources used by Pay with Contact Form 7
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0151.53 ▲2.13
Dashboard /wp-admin3.41 ▲0.0031.98 ▼1.99
Posts /wp-admin/edit.php3.64 ▲0.0036.81 ▲1.01
Add New Post /wp-admin/post-new.php6.89 ▼0.0893.86 ▼1,170.33
Media Library /wp-admin/upload.php3.29 ▼0.0124.04 ▼5.74

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 31 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Pay with Contact Form 7: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,795 ▲5115.86 ▲0.245.66 ▼0.492.59 ▲0.36
Dashboard /wp-admin2,888 ▲306.14 ▼0.03112.82 ▼18.47155.91 ▼2.18
Posts /wp-admin/edit.php2,694 ▲93.23 ▼0.0161.25 ▼2.46141.62 ▼2.68
Add New Post /wp-admin/post-new.php1,711 ▲2120.84 ▼0.28446.08 ▲60.62158.10 ▼0.93
Media Library /wp-admin/upload.php1,698 ▼35.47 ▼0.03142.28 ▲8.70184.92 ▼3.65

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 13× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/pay-with-contact-form-7/admin/partials/wpcmscf7-Main-List-Table.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/pay-with-contact-form-7/admin/partials/WPCMSCF7-List-Table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/pay-with-contact-form-7/admin/partials/wpcmscf7-admin-display.php:40
    • > PHP Warning
      The use statement with non-compound name 'PaypalIPN' has no effect in wp-content/plugins/pay-with-contact-form-7/admin/partials/ipn.php on line 5
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-list-table.php): failed to open stream: No such file or directory in wp-content/plugins/pay-with-contact-form-7/admin/partials/WPCMSCF7-List-Table.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/pay-with-contact-form-7/admin/partials/WPCMSCF7-List-Table.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/pay-with-contact-form-7/admin/partials/wpcmscf7-admin-paypal-redirect.php:9
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-list-table.php' (include_path='.:/usr/share/php') in wp-content/plugins/pay-with-contact-form-7/admin/partials/wpcmscf7-Main-List-Table.php on line 4
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/pay-with-contact-form-7/admin/partials/wpcmscf7-Main-List-Table.php on line 4
    • > PHP Warning
      Unterminated comment starting line 2 in wp-content/plugins/pay-with-contact-form-7/index.php on line 2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 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
Please fix the following attributes:
  • Donate link: Invalid URI found ("")
  • Tags: Please delete some tags, you are using 20 tag instead of maximum 10
You can look at the official readme.txt

pay-with-contact-form-7/wpcmscf7.php 85% from 13 tests

"Pay with Contact Form 7" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("pay-with-contact-form-7.php" instead of "wpcmscf7.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin1,539 lines of code in 23 files:
LanguageFilesBlank linesComment linesLines of code
PHP193797301,498
JavaScript2145431
CSS21810

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity12.00
▷ Minimum class complexity1.00
▷ Maximum class complexity63.00
Average method complexity3.15
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes12
▷ Abstract classes00.00%
▷ Concrete classes12100.00%
▷ Final classes00.00%
Methods62
▷ Static methods23.23%
▷ Public methods5487.10%
▷ Protected methods11.61%
▷ Private methods711.29%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.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
No PNG files were detected