78% ad-widget

Code Review | Wordpress Ad Widget

WordPress plugin Wordpress Ad Widget scored 78% from 54 tests.

About plugin

  • Plugin page: ad-widget
  • Plugin version: 2.20.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.8
  • WordPress version: 5.9.2
  • First release: Mar 10, 2013
  • Latest release: Oct 6, 2021
  • Number of updates: 40
  • Update frequency: every 78.3 days
  • Top authors: broadstreetads (100%)

Code review

54 tests

User reviews

16 reviews

Install metrics

9,000+ active / 292,103 total downloads


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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.18MB] [CPU: ▼297.50ms] Passed 4 tests

A check of server-side resources used by Wordpress Ad Widget
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2354.28 ▲5.18
Dashboard /wp-admin3.59 ▲0.1833.80 ▼0.57
Posts /wp-admin/edit.php3.81 ▲0.1737.74 ▲2.17
Add New Post /wp-admin/post-new.php7.11 ▲0.1490.70 ▼1,191.60
Media Library /wp-admin/upload.php3.53 ▲0.2324.72 ▼0.00

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 7 new files
Database: no new tables, 3 new options
New WordPress options

Browser metrics Passed 4 tests

An overview of browser requirements for Wordpress Ad Widget
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲1415.93 ▲0.015.79 ▼0.782.11 ▼0.39
Dashboard /wp-admin2,897 ▲366.08 ▼0.09115.28 ▼15.39162.53 ▼1.73
Posts /wp-admin/edit.php2,696 ▲53.23 ▼0.0163.40 ▼0.80139.08 ▼3.15
Add New Post /wp-admin/post-new.php1,664 ▲315.27 ▼0.42409.52 ▲16.30151.36 ▲1.63
Media Library /wp-admin/upload.php1,706 ▲85.54 ▲0.07142.68 ▼3.71189.19 ▼1.79
Ad Widget /wp-admin/adwidget.php260.940.0320.87

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 3 options in the database
    • widget_adwidget_htmlwidget
    • widget_adwidget_parkavewidget
    • widget_adwidget_imagewidget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/ad-widget/views/admin.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/adwidget.php
    • > Network (severe)
    wp-admin/adwidget.php - Failed to load resource: the server responded with a status of 404 (Not Found)


Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Plugin Name: Please specify the plugin name on the first line ( === ad-widget === )
The official readme.txt might help

ad-widget/adwidget.php 92% from 13 tests

The main file in "Wordpress Ad Widget" v. 2.20.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("ad-widget.php" instead of "adwidget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
There were no executable files found in this plugin857 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity8.50
▷ Minimum class complexity1.00
▷ Maximum class complexity26.00
Average method complexity2.12
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
▷ Static methods2740.30%
▷ Public methods6292.54%
▷ Protected methods57.46%
▷ Private methods00.00%
▷ Named functions8100.00%
▷ Anonymous functions00.00%
▷ Global constants535.71%
▷ Class constants964.29%
▷ Public constants9100.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.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/sample-ad.png11.38KB4.30KB▼ 62.20%