10% wpcoolform

Code Review | WpCoolForm

WordPress plugin WpCoolForm scored10%from 54 tests.

About plugin

  • Plugin page: wpcoolform
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.0-4.4.2
  • WordPress version: 6.3.1
  • First release: Apr 7, 2016
  • Latest release: Apr 8, 2016
  • Number of updates: 5
  • Update frequency: every 0.4 days
  • Top authors: tklinkert (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,374 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • This plugin did not install gracefully
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'TJC_Init' not found

Server metrics [RAM: ▲1.12MB] [CPU: ▲4.94ms] Passed 4 tests

A check of server-side resources used by WpCoolForm
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.97 ▲1.2454.60 ▲6.93
Dashboard /wp-admin4.69 ▲1.1360.23 ▲1.42
Posts /wp-admin/edit.php4.74 ▲1.0659.61 ▲7.40
Add New Post /wp-admin/post-new.php7.29 ▲1.15110.23 ▲4.00
Media Library /wp-admin/upload.php4.61 ▲1.1349.91 ▲14.00
FAQ /wp-admin/admin.php?page=wcf_faq4.5841.82
WpCoolForm /wp-admin/admin.php?page=wcf_main_menu_item4.5841.41
New formular /wp-admin/admin.php?page=wcf_new_form_menu_item4.5841.15
WpCoolForm /wp-admin/options-general.php?page=my-setting-admin4.5840.79

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for WpCoolForm
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,917 ▲15614.00 ▼0.3518.39 ▲16.5049.76 ▲3.25
Dashboard /wp-admin2,263 ▲895.67 ▲0.0888.90 ▼3.6446.22 ▲4.53
Posts /wp-admin/edit.php2,177 ▲772.06 ▼0.0836.22 ▼2.7141.16 ▲8.66
Add New Post /wp-admin/post-new.php1,613 ▲7322.81 ▼0.38553.04 ▼125.6136.98 ▼17.15
Media Library /wp-admin/upload.php1,474 ▲774.24 ▲0.06101.77 ▼19.1844.50 ▼0.00
FAQ /wp-admin/admin.php?page=wcf_faq8872.0626.4830.19
WpCoolForm /wp-admin/admin.php?page=wcf_main_menu_item8862.0625.1327.91
New formular /wp-admin/admin.php?page=wcf_new_form_menu_item8892.0625.5629.56
WpCoolForm /wp-admin/options-general.php?page=my-setting-admin8902.0727.0128.53

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, class 'TJC_Init' not found
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 50% 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)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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
Almost there! Just fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/wpcoolform/ext/create_img.php
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/upgrade.php): failed to open stream: No such file or directory in wp-content/plugins/wpcoolform/php/wp/wcf_formular_table_handler.php on line 4
    • > PHP Warning
      imagecreatefrompng(.png): failed to open stream: No such file or directory in wp-content/plugins/wpcoolform/php/util/wcf_captcha.php on line 54
    • > PHP Warning
      imagepng() expects parameter 1 to be resource, bool given in wp-content/plugins/wpcoolform/php/util/wcf_captcha.php on line 56
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/wpcoolform/php/wp/wcf_formular_table_handler.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/upgrade.php' (include_path='.:/usr/share/php') in wp-content/plugins/wpcoolform/php/wp/wcf_formular_table_handler.php on line 4
    • > PHP Notice
      Undefined index: captcha in wp-content/plugins/wpcoolform/php/util/wcf_captcha.php on line 11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: These screenshots do not have images: #6 (wpcf_settings3.png shows some more setting options.), #7 (wpcf_settings4.png shows the form builder on the settings page.)
The official readme.txt is a good inspiration

wpcoolform/WpCoolForm.php 92% from 13 tests

"WpCoolForm" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("wpcoolform.php" instead of "WpCoolForm.php")

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
Success! There were no dangerous files found in this plugin11,651 lines of code in 64 files:
LanguageFilesBlank linesComment linesLines of code
PHP267259694,244
CSS492132,574
Sass1328241,560
LESS1328341,550
SVG100655
JavaScript211341601
INI2970278
HTML3285189

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity14.69
▷ Minimum class complexity1.00
▷ Maximum class complexity67.00
Average method complexity1.99
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes26
▷ Abstract classes00.00%
▷ Concrete classes26100.00%
▷ Final classes00.00%
Methods361
▷ Static methods246.65%
▷ Public methods29080.33%
▷ Protected methods82.22%
▷ Private methods6317.45%
Functions56
▷ Named functions56100.00%
▷ Anonymous functions00.00%
Constants24
▷ Global constants24100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
100 PNG files occupy 1.27MB with 0.49MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
php/util/48.png1.68KB1.03KB▼ 38.64%
php/util/33.png1.74KB1.08KB▼ 37.84%
php/util/26.png1.73KB1.04KB▼ 40.00%
php/util/18.png1.75KB1.09KB▼ 37.79%
php/util/72.png1.81KB1.13KB▼ 37.72%