84% ks-ads-widget

Code Review | KS Ads Widget

WordPress plugin KS Ads Widget scored84%from 54 tests.

About plugin

  • Plugin page: ks-ads-widget
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.7.4
  • WordPress version: 6.3.1
  • First release: Jun 27, 2016
  • Latest release: May 16, 2017
  • Number of updates: 10
  • Update frequency: every 32.3 days
  • Top authors: kingsoftdng (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,047 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

Server-side resources used by KS Ads Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0939.76 ▼5.98
Dashboard /wp-admin3.38 ▲0.0847.69 ▼5.17
Posts /wp-admin/edit.php3.43 ▲0.0851.07 ▼1.99
Add New Post /wp-admin/post-new.php5.96 ▲0.0888.58 ▼9.61
Media Library /wp-admin/upload.php3.31 ▲0.0841.06 ▲1.66

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
widget_widget_sp_image
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

KS Ads Widget: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.71 ▼1.051.59 ▼0.8638.82 ▼8.46
Dashboard /wp-admin2,206 ▲185.06 ▼0.05104.07 ▼14.3940.50 ▼2.86
Posts /wp-admin/edit.php2,089 ▼02.05 ▼0.0934.37 ▼2.1036.42 ▼1.00
Add New Post /wp-admin/post-new.php1,533 ▼023.32 ▲0.04689.24 ▼13.3861.60 ▲6.39
Media Library /wp-admin/upload.php1,388 ▼04.14 ▼0.06110.98 ▲8.5446.97 ▲4.68

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_widget_sp_image
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 4× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ks-ads-widget/views/widget-admin.php
    • > /wp-content/plugins/ks-ads-widget/views/widget-admin.deprecated.php
    • > /wp-content/plugins/ks-ads-widget/ks-ads-widget.php
    • > /wp-content/plugins/ks-ads-widget/views/widget.php

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 Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
2 plugin tags: widget, upload image

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

The main file in "KS Ads Widget" v. 1.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
97 characters long description:
A simple ads widget that uses the native WordPress media manager to add ads widgets to your site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Good job! No executable or dangerous file extensions detected1,035 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP6103186565
CSS11814244
JavaScript35557226

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity41.00
▷ Minimum class complexity30.00
▷ Maximum class complexity52.00
Average method complexity4.08
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods26
▷ Static methods311.54%
▷ Public methods2076.92%
▷ Protected methods00.00%
▷ Private methods623.08%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.26MB with 0.20MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png29.48KB7.25KB▼ 75.42%
screenshot-3.png87.74KB16.55KB▼ 81.14%
screenshot-1.png81.18KB21.66KB▼ 73.31%
screenshot-4.png68.35KB18.86KB▼ 72.41%