10% phpsword-contact-form

Code Review | PhpSword Contact Form

WordPress plugin PhpSword Contact Form scored 10% from 54 tests.

About plugin

  • Plugin page: phpsword-contact-...
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.0
  • WordPress version: 6.3.1
  • First release: Dec 2, 2014
  • Latest release: Jul 31, 2022
  • Number of updates: 9
  • Update frequency: every 311.0 days
  • Top authors: phpsword (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,583 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/phpsword-contact-form/index.php+10
    Methods with the same name as their class will not be constructors in a future version of PHP; PhpswCF has a deprecated constructor

Server metrics [RAM: ▼0.95MB] [CPU: ▼30.39ms] Passed 4 tests

An overview of server-side resources used by PhpSword Contact Form
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.43 ▼0.0337.51 ▼0.33
Dashboard /wp-admin3.00 ▼0.3122.19 ▼21.98
Posts /wp-admin/edit.php3.00 ▼0.3621.87 ▼22.04
Add New Post /wp-admin/post-new.php3.00 ▼2.8922.97 ▼59.73
Media Library /wp-admin/upload.php3.00 ▼0.2320.88 ▼17.79

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
PhpswCFOptions

Browser metrics Passed 4 tests

A check of browser resources used by PhpSword Contact Form
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲2713.22 ▼1.562.11 ▲0.4447.43 ▲3.33
Dashboard /wp-admin2,219 ▲105.85 ▲1.0199.39 ▼11.2840.16 ▲0.56
Posts /wp-admin/edit.php2,108 ▲162.02 ▲0.0334.75 ▲0.3231.86 ▲1.85
Add New Post /wp-admin/post-new.php1,555 ▲2218.22 ▼4.92634.00 ▼81.3061.18 ▲5.72
Media Library /wp-admin/upload.php1,404 ▲224.27 ▲0.0597.46 ▼6.9642.83 ▼6.88

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • This plugin cannot be uninstalled
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method PhpswCF::PhpswDCNewAdminMenu() should not be called statically
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • db_upgraded
    • theysaidso_admin_options
    • PhpswCFOptions
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however 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 take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/phpsword-contact-form/index.php:294

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 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: contact, phpsword, form, inquiry form, wordpress...

phpsword-contact-form/index.php 92% from 13 tests

The principal PHP file in "PhpSword Contact Form" v. 1.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("phpsword-contact-form.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Everything looks great! No dangerous files found in this plugin218 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP14945218

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity51.00
▷ Minimum class complexity51.00
▷ Maximum class complexity51.00
Average method complexity4.85
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/phpswcf.png1.06KB0.22KB▼ 79.52%