84% cpt-contact-form

Code Review | CPT Contact Form

WordPress plugin CPT Contact Form scored84%from 54 tests.

About plugin

  • Plugin page: cpt-contact-form
  • Plugin version: 0.2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.1
  • WordPress version: 6.3.1
  • First release: Mar 25, 2014
  • Latest release: May 12, 2014
  • Number of updates: 9
  • Update frequency: every 5.3 days
  • Top authors: geomagas (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /897 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼6.14ms] Passed 4 tests

Analyzing server-side resources used by CPT Contact Form
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0938.24 ▼5.80
Dashboard /wp-admin3.39 ▲0.0547.39 ▼25.03
Posts /wp-admin/edit.php3.51 ▲0.1555.75 ▲4.21
Add New Post /wp-admin/post-new.php5.98 ▲0.0997.86 ▲2.06
Media Library /wp-admin/upload.php3.32 ▲0.0944.25 ▲4.64
New Contact Message /wp-admin/post-new.php?post_type=contact-message3.3545.33
CPT Contact Form /wp-admin/options-general.php?page=cptcf-options-menu3.2831.15
All Contact Messages /wp-admin/edit.php?post_type=contact-message3.3640.62

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 7 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for CPT Contact Form
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲8713.57 ▼0.811.71 ▼0.1441.22 ▼2.29
Dashboard /wp-admin2,236 ▲514.93 ▼0.9198.11 ▼8.1373.58 ▲27.91
Posts /wp-admin/edit.php2,125 ▲361.99 ▼0.0337.84 ▲0.2435.73 ▼1.72
Add New Post /wp-admin/post-new.php1,693 ▲17922.59 ▲4.83719.19 ▲17.9946.73 ▼7.48
Media Library /wp-admin/upload.php1,412 ▲304.25 ▲0.05109.11 ▼9.0377.20 ▲28.83
New Contact Message /wp-admin/post-new.php?post_type=contact-message1,4452.6050.0358.09
CPT Contact Form /wp-admin/options-general.php?page=cptcf-options-menu8742.0726.9931.11
All Contact Messages /wp-admin/edit.php?post_type=contact-message1,1021.9433.2132.15

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 1× 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/cpt-contact-form/plugin.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: contact form, custom post type, shortcode

cpt-contact-form/plugin.php 85% from 13 tests

"CPT Contact Form" version 0.2.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("cpt-contact-form.php" instead of "plugin.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 153 characters long)

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
Everything looks great! No dangerous files found in this plugin430 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP22617317
PO File13915586
JavaScript15027

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity26.00
▷ Minimum class complexity26.00
▷ Maximum class complexity26.00
Average method complexity2.47
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods17
▷ Static methods00.00%
▷ Public methods17100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
1 compressed PNG file occupies 0.00MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/contact_form.png0.46KB0.49KB0.00%