84% ks-contact-widget

Code Review | KS Contact Widget

WordPress plugin KS Contact Widget scored84%from 54 tests.

About plugin

  • Plugin page: ks-contact-widget
  • Plugin version: 2.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-4.7
  • WordPress version: 6.3.1
  • First release: Jun 20, 2016
  • Latest release: Nov 22, 2017
  • Number of updates: 15
  • Update frequency: every 34.9 days
  • Top authors: kingsoftdng (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /1,694 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.62ms] Passed 4 tests

Analyzing server-side resources used by KS Contact Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0352.83 ▲12.27
Dashboard /wp-admin3.33 ▲0.0349.36 ▼0.90
Posts /wp-admin/edit.php3.38 ▲0.0246.97 ▼4.23
Add New Post /wp-admin/post-new.php5.91 ▲0.0282.92 ▼17.94
Media Library /wp-admin/upload.php3.25 ▲0.0239.31 ▲4.60

Server storage [IO: ▲0.45MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 19 new files
Database: no new tables, 7 new options
New WordPress options
widget_ks-contact-widget
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

KS Contact Widget: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,796 ▲3514.45 ▲0.101.98 ▲0.2842.08 ▲0.78
Dashboard /wp-admin2,198 ▲185.61 ▲0.0386.62 ▼5.2939.55 ▼4.64
Posts /wp-admin/edit.php2,100 ▼02.01 ▼0.0334.44 ▼3.4034.44 ▼2.99
Add New Post /wp-admin/post-new.php1,528 ▲223.29 ▲0.12678.15 ▲15.4856.70 ▼11.81
Media Library /wp-admin/upload.php1,403 ▲34.18 ▲0.02100.40 ▼2.0645.50 ▲0.64

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 7 options
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_ks-contact-widget
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments

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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at 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/ks-contact-widget/ks-contact-widget.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% 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 require attention:
  • Screenshots: Screenshot #5 (Add Style & Background) image required
Please take inspiration from this readme.txt

ks-contact-widget/ks-contact-widget.php Passed 13 tests

The main PHP script in "KS Contact Widget" version 2.0 is automatically included on every request by WordPress
29 characters long description:
A advance contact for widget.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected1,091 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JSON100498
PHP1111106386
SVG200162
CSS11145

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity35.00
▷ Minimum class complexity35.00
▷ Maximum class complexity35.00
Average method complexity4.78
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods9
▷ Static methods00.00%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.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
No PNG images were found in this plugin