83% pay-with-contact-form-7

Code Review | Pay with Contact Form 7

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

About plugin

  • Plugin page: pay-with-contact-...
  • Plugin version: 1.0.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.1.1
  • WordPress version: 6.3.1
  • First release: Jul 11, 2017
  • Latest release: Mar 24, 2023
  • Number of updates: 38
  • Update frequency: every 54.9 days
  • Top authors: cmsminds (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

200+ active /6,371 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼5.13ms] Passed 4 tests

An overview of server-side resources used by Pay with Contact Form 7
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.72 ▼3.74
Dashboard /wp-admin3.31 ▲0.0047.14 ▼3.81
Posts /wp-admin/edit.php3.36 ▲0.0044.86 ▲2.98
Add New Post /wp-admin/post-new.php5.89 ▲0.0078.90 ▼15.71
Media Library /wp-admin/upload.php3.23 ▲0.0035.12 ▲2.75

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 31 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Pay with Contact Form 7
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5414.15 ▼0.601.72 ▼0.0844.42 ▲1.39
Dashboard /wp-admin2,203 ▲145.79 ▼0.2894.08 ▼16.8438.64 ▼7.13
Posts /wp-admin/edit.php2,086 ▼62.03 ▼0.0237.02 ▲0.5333.47 ▲2.84
Add New Post /wp-admin/post-new.php1,514 ▼2817.49 ▼1.02706.11 ▲24.5960.41 ▲7.45
Media Library /wp-admin/upload.php1,388 ▼34.21 ▲0.0497.20 ▲0.8445.44 ▲1.17

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts

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

SRP 50% 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
Please fix the following
  • 13× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > 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/includes/index.php on line 2
    • > PHP Warning
      Unterminated comment starting line 2 in wp-content/plugins/pay-with-contact-form-7/index.php on line 2
    • > 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 Exception: Missing POST Data in wp-content/plugins/pay-with-contact-form-7/admin/partials/wpcmscf7-paypalipn.php:60
    • > 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 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-Main-List-Table.php on line 4
    • > PHP Warning
      Unterminated comment starting line 2 in wp-content/plugins/pay-with-contact-form-7/admin/index.php on line 2

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 errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Tags: There are too many tags (20 tag instead of maximum 10)
  • Donate link: Invalid url: "www.cmsminds.com"
The official readme.txt is a good inspiration

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

"Pay with Contact Form 7" version 1.0.4's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • 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")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Success! There were no dangerous 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

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued 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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin