10% contactpress

Code Review | ContactPress

WordPress plugin ContactPress scored10%from 54 tests.

About plugin

  • Plugin page: contactpress
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-3.5.1
  • WordPress version: 6.3.1
  • First release: Aug 5, 2013
  • Latest release: Aug 21, 2013
  • Number of updates: 3
  • Update frequency: every 5.7 days
  • Top authors: fantastic plugins (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,119 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method ContactPress::db_install() should not be called statically

Server metrics [RAM: ▼0.94MB] [CPU: ▼39.23ms] Passed 4 tests

Analyzing server-side resources used by ContactPress
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0341.03 ▲0.01
Dashboard /wp-admin3.01 ▼0.3325.74 ▼37.86
Posts /wp-admin/edit.php3.02 ▼0.3423.53 ▼28.86
Add New Post /wp-admin/post-new.php3.01 ▼2.8723.42 ▼77.77
Media Library /wp-admin/upload.php3.01 ▼0.2122.55 ▼12.43
Fantastic Contact Form /wp-admin/admin.php?page=view_contact_form3.0226.35
Fantastic Contact Form /wp-admin/admin.php?page=reply_mail3.0224.64
User Management /wp-admin/admin.php?page=contact_form_a_plus3.0223.63
Add New Contact /wp-admin/admin.php?page=contact_forms-13.0226.89
ContactPress /wp-admin/admin.php?page=contacts3.0222.33
Fantastic Contact Form /wp-admin/admin.php?page=compose_mail3.0228.01

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 7 new files
Database: 1 new table, 28 new options
New tables
wp_contactpress
New WordPress options
db_upgraded
enable_responsiveness
error_empty_captcha
theysaidso_admin_options
can_compress_scripts
label_name
contact_form_db_version
bulk_subject
credits_defaults
credits_name
...

Browser metrics Passed 4 tests

An overview of browser requirements for ContactPress
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲6814.35 ▲0.331.74 ▼0.3349.80 ▲8.69
Dashboard /wp-admin2,226 ▲485.64 ▲0.0187.12 ▼18.5839.67 ▼4.37
Posts /wp-admin/edit.php2,128 ▲282.07 ▲0.0737.84 ▼3.9033.78 ▼2.61
Add New Post /wp-admin/post-new.php1,575 ▲4923.47 ▲5.95706.14 ▲8.1052.47 ▼4.51
Media Library /wp-admin/upload.php1,434 ▲344.23 ▼0.02114.53 ▲11.1646.04 ▼1.06
Fantastic Contact Form /wp-admin/admin.php?page=view_contact_form9302.0323.6224.88
Fantastic Contact Form /wp-admin/admin.php?page=reply_mail1,6446.78146.4453.99
User Management /wp-admin/admin.php?page=contact_form_a_plus1,0842.0622.9230.27
Add New Contact /wp-admin/admin.php?page=contact_forms-19622.1727.1830.72
ContactPress /wp-admin/admin.php?page=contacts1,2991.7625.1546.10
Fantastic Contact Form /wp-admin/admin.php?page=compose_mail1,6246.57125.9340.15

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method ContactPress::contact_form_admin_menu() should not be called statically
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_contactpress
  • This plugin did not uninstall successfully, leaving 28 options in the database
    • credits_nofollow
    • label_comment
    • error_empty_captcha
    • enable_responsiveness
    • label_subject
    • contact_form_db_version
    • credits_name
    • thanks_contact
    • theysaidso_admin_options
    • label_url
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These server-side errors were triggered
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=compose_mail
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method ContactPress::contact_form_admin_menu() should not be called statically
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=compose_mail
    • > Warning in wp-content/plugins/contactpress/contactpress.php+163
    Use of undefined constant IC_MYPLUGIN_PERMISSIONS - assumed 'IC_MYPLUGIN_PERMISSIONS' (this will throw an Error in a future version of PHP)
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=compose_mail
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method ContactPress::update_contact_admin() should not be called statically
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=compose_mail
    • > Notice in wp-content/plugins/contactpress/contactpress.php+951
    Undefined index: nonce
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=compose_mail
    • > Notice in wp-content/plugins/contactpress/contactpress.php+1000
    Undefined index: id
    • > GET request to /wp-admin/admin.php?page=reply_mail
    • > Notice in wp-content/plugins/contactpress/contactpress.php+1195
    Undefined index: name
    • > GET request to /wp-admin/admin.php?page=reply_mail
    • > Notice in wp-content/plugins/contactpress/contactpress.php+1197
    Undefined index: time
    • > GET request to /wp-admin/admin.php?page=reply_mail
    • > Warning in wp-content/plugins/contactpress/contactpress.php+1209
    Use of undefined constant message - assumed 'message' (this will throw an Error in a future version of PHP)

SRP 50% 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
  • 3× PHP files trigger server errors when accessed directly:
    • > 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/contactpress/contactpress.php on line 14
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/contactpress/contactpress.php on line 14
    • > 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/contactpress/contactpress.php on line 14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Plugin Name: Please replace "Plugin Name" with the name of your plugin on the first line ( === contactpress === )
The official readme.txt might help

contactpress/contactpress.php Passed 13 tests

The main PHP file in "ContactPress" ver. 1.1 adds more information about the plugin and also serves as the entry point for this plugin
67 characters long description:
ContactPress is the Ajax Based Responsive Form With User Management

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
There were no executable files found in this plugin1,588 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP2159401,384
CSS1320204

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.18
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity1.90
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/favicon.png19.01KB6.16KB▼ 67.58%