78% ad-widget

Code Review | Wordpress Ad Widget

WordPress plugin Wordpress Ad Widget scored78%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: 6.3.1
  • 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

5,000+ active /300,553 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.19MB] [CPU: ▼7.02ms] Passed 4 tests

This is a short check of server-side resources used by Wordpress Ad Widget
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.66 ▲0.2039.75 ▼1.42
Dashboard /wp-admin3.53 ▲0.2345.98 ▼5.18
Posts /wp-admin/edit.php3.59 ▲0.2350.70 ▼9.93
Add New Post /wp-admin/post-new.php6.05 ▲0.1781.83 ▼11.56
Media Library /wp-admin/upload.php3.39 ▲0.1734.28 ▼0.02

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
widget_adwidget_htmlwidget
widget_recent-posts
widget_adwidget_parkavewidget
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_adwidget_imagewidget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Wordpress Ad Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.79 ▲0.091.77 ▲0.0544.71 ▲1.29
Dashboard /wp-admin2,196 ▲195.61 ▼0.0694.14 ▼3.2344.90 ▲2.13
Posts /wp-admin/edit.php2,107 ▲72.02 ▲0.0439.84 ▲1.2536.35 ▲1.36
Add New Post /wp-admin/post-new.php1,529 ▲323.33 ▲0.15652.53 ▼35.2250.66 ▼9.98
Media Library /wp-admin/upload.php1,404 ▲44.21 ▲0.0294.74 ▼16.8340.65 ▼5.31
Ad Widget /wp-admin/adwidget.php260.420.0911.51

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 detected upon uninstall: 9 options
    • theysaidso_admin_options
    • db_upgraded
    • widget_adwidget_htmlwidget
    • widget_recent-posts
    • widget_adwidget_parkavewidget
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_adwidget_imagewidget
    • can_compress_scripts

Smoke tests 50% 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 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 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 fix the following browser errors
    • > 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)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that need to be fixed:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === ad-widget === )
Please take inspiration from this readme.txt

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

The main PHP file in "Wordpress Ad Widget" ver. 2.20.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("ad-widget.php" instead of "adwidget.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected857 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP4220391823
JavaScript112234

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
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
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods67
▷ Static methods2740.30%
▷ Public methods6292.54%
▷ Protected methods57.46%
▷ Private methods00.00%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants535.71%
▷ Class constants964.29%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and 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%