10% cp-contact-form-with-paypal

Code Review | CP Contact Form with PayPal

WordPress plugin CP Contact Form with PayPal scored10%from 54 tests.

About plugin

  • Plugin page: cp-contact-form-w...
  • Plugin version: 1.3.46
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.5-6.4
  • WordPress version: 6.3.1
  • First release: Oct 17, 2012
  • Latest release: Nov 28, 2023
  • Number of updates: 586
  • Update frequency: every 6.9 days
  • Top authors: codepeople (100%)

Code review

54 tests

User reviews

62 reviews

Install metrics

2,000+ active /265,065 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • The plugin did not install without errors
    • > Notice in wp-content/plugins/cp-contact-form-with-paypal/cp_contactformpp.php+86
    Undefined variable: wpdb

Server metrics [RAM: ▲0.40MB] [CPU: ▼5.78ms] Passed 4 tests

This is a short check of server-side resources used by CP Contact Form with PayPal
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.86 ▲0.4041.28 ▲0.01
Dashboard /wp-admin3.70 ▲0.3647.29 ▼22.04
Posts /wp-admin/edit.php3.82 ▲0.4648.83 ▲0.32
Add New Post /wp-admin/post-new.php6.31 ▲0.4393.42 ▼1.39
Media Library /wp-admin/upload.php3.63 ▲0.4039.33 ▲6.07

Server storage [IO: ▲2.56MB] [DB: ▲0.01MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 198 new files
Database: 3 new tables, 8 new options
New tables
wp_cp_contact_form_paypal_posts
wp_cp_contact_form_paypal_discount_codes
wp_cp_contact_form_paypal_settings
New WordPress options
autoptimize_js_exclude
widget_recent-comments
widget_theysaidso_widget
installed_cp-contact-form-with-paypal
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by CP Contact Form with PayPal
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲8614.60 ▲0.281.73 ▲0.0742.60 ▼1.23
Dashboard /wp-admin2,235 ▲635.54 ▼0.0883.73 ▼14.4837.26 ▼3.22
Posts /wp-admin/edit.php2,143 ▲431.94 ▼0.0439.41 ▲3.4636.57 ▲2.94
Add New Post /wp-admin/post-new.php6,244 ▲4,71819.19 ▼3.64846.97 ▲237.3635.48 ▼15.11
Media Library /wp-admin/upload.php1,446 ▲494.20 ▲0.0194.71 ▼0.1440.71 ▼1.33
Help: Documentation /wp-admin/cp_contact_form_paypal.php?page=cp_contact_form_paypal_doc260.410.0813.26
Upgrade /wp-admin/cp_contact_form_paypal.php?page=cp_contact_form_paypal_upgrade260.410.076.50
Add ons /wp-admin/cp_contact_form_paypal.php?page=cp_contact_form_addons260.410.086.10
Help: Online demo /wp-admin/cp_contact_form_paypal.php?page=cp_contact_form_paypal_demo260.410.105.69
Manage Forms /wp-admin/cp_contact_form_paypal.php260.410.115.80

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie tables detected upon uninstall: 3 tables
    • wp_cp_contact_form_paypal_settings
    • wp_cp_contact_form_paypal_discount_codes
    • wp_cp_contact_form_paypal_posts
  • The uninstall procedure has failed, leaving 8 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • installed_cp-contact-form-with-paypal
    • widget_recent-posts
    • autoptimize_js_exclude
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 11× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/cp-contact-form-with-paypal/cp_admin_int_edition.inc.php
    • > /wp-content/plugins/cp-contact-form-with-paypal/banner.php
    • > /wp-content/plugins/cp-contact-form-with-paypal/cp-feedback.php
    • > /wp-content/plugins/cp-contact-form-with-paypal/cp_paypal.express.php
    • > /wp-content/plugins/cp-contact-form-with-paypal/cp_publish_wizard.inc.php
    • > /wp-content/plugins/cp-contact-form-with-paypal/cp_contactformpp_admin_int_list.inc.php
    • > /wp-content/plugins/cp-contact-form-with-paypal/cp_contactformpp_public_int.inc.php
    • > /wp-content/plugins/cp-contact-form-with-paypal/cp_contactformpp-addons.inc.php
    • > /wp-content/plugins/cp-contact-form-with-paypal/cp_contactformpp_admin_int_message_list.inc.php
    • > /wp-content/plugins/cp-contact-form-with-paypal/cp_contactformpp_functions.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Widget_Base' not found in wp-content/plugins/cp-contact-form-with-paypal/controllers/elementor/elementorwidget_class.inc.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cp-contact-form-with-paypal/controllers/elementor/cp-elementor-widget.inc.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/cp-contact-form-with-paypal/cp_contactformpp.php:24

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
These are user-side errors you should fix
    • > GET request to /wp-admin/cp_contact_form_paypal.php?page=cp_contact_form_paypal_doc
    • > Network (severe)
    wp-admin/cp_contact_form_paypal.php?page=cp_contact_form_paypal_doc - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/cp_contact_form_paypal.php?page=cp_contact_form_paypal_upgrade
    • > Network (severe)
    wp-admin/cp_contact_form_paypal.php?page=cp_contact_form_paypal_upgrade - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/cp_contact_form_paypal.php?page=cp_contact_form_addons
    • > Network (severe)
    wp-admin/cp_contact_form_paypal.php?page=cp_contact_form_addons - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/cp_contact_form_paypal.php?page=cp_contact_form_paypal_demo
    • > Network (severe)
    wp-admin/cp_contact_form_paypal.php?page=cp_contact_form_paypal_demo - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/cp_contact_form_paypal.php
    • > Network (severe)
    wp-admin/cp_contact_form_paypal.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
  • Screenshots: A description for screenshot #5 is missing in cp-contact-form-with-paypal/assets to your readme.txt
The official readme.txt is a good inspiration

cp-contact-form-with-paypal/cp_contactformpp.php 92% from 13 tests

The main PHP script in "CP Contact Form with PayPal" version 1.3.46 is automatically included on every request by WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("cp-contact-form-with-paypal.php" instead of "cp_contactformpp.php")

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
Success! There were no dangerous files found in this plugin42,414 lines of code in 87 files:
LanguageFilesBlank linesComment linesLines of code
PO File6216,53917,47036,273
PHP157732133,860
JavaScript632191,571
CSS470154710

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity12.25
▷ Minimum class complexity3.00
▷ Maximum class complexity24.00
Average method complexity3.14
▷ Minimum method complexity1.00
▷ Maximum method complexity9.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods1990.48%
▷ Protected methods29.52%
▷ Private methods00.00%
Functions51
▷ Named functions51100.00%
▷ Anonymous functions00.00%
Constants73
▷ Global constants73100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
36 PNG files occupy 0.14MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/cupertino/images/ui-icons_72a7cf_256x240.png4.27KB4.11KB▼ 3.78%
css/cupertino/images/ui-bg_diagonals-thick_90_eeeeee_40x40.png0.25KB0.15KB▼ 38.25%
css/cupertino/images/ui-bg_glass_50_3baae3_1x400.png0.17KB0.16KB▼ 6.82%
images/colorpicker_hsb_h.png0.99KB0.77KB▼ 21.94%
images/colorpicker_rgb_b.png0.95KB0.76KB▼ 19.48%