62% brokerswebads

Code Review | BrokersWeb Ads

WordPress plugin BrokersWeb Ads scored62%from 54 tests.

About plugin

  • Plugin page: brokerswebads
  • Plugin version: v2.2.1...
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-3.3.1
  • WordPress version: 6.3.1
  • First release: Jan 18, 2011
  • Latest release: Feb 23, 2012
  • Number of updates: 18
  • Update frequency: every 22.3 days
  • Top authors: crispunk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,186 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▼1.71MB] [CPU: ▼51.33ms] Passed 4 tests

This is a short check of server-side resources used by BrokersWeb Ads
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.29 ▼1.188.90 ▼33.96
Dashboard /wp-admin2.30 ▼1.0110.25 ▼43.22
Posts /wp-admin/edit.php2.30 ▼1.0611.69 ▼44.26
Add New Post /wp-admin/post-new.php2.30 ▼3.5915.05 ▼83.87
Media Library /wp-admin/upload.php2.30 ▼0.9310.02 ▼26.91
BrokersWeb Ads /wp-admin/admin.php?page=brokerswebads2.3010.37
Banner Showcase /wp-admin/admin.php?page=bwads_banners2.3011.61

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 27 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for BrokersWeb Ads
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲6714.26 ▲0.021.68 ▼0.1541.51 ▼0.96
Dashboard /wp-admin2,217 ▲405.60 ▲0.0388.47 ▼2.5790.01 ▲48.32
Posts /wp-admin/edit.php2,143 ▲432.09 ▲0.0636.40 ▼0.6135.00 ▼6.51
Add New Post /wp-admin/post-new.php1,561 ▲3323.10 ▼0.18689.39 ▲15.22162.70 ▲109.15
Media Library /wp-admin/upload.php1,440 ▲434.27 ▲0.1199.61 ▼1.1561.94 ▲19.61
BrokersWeb Ads /wp-admin/admin.php?page=brokerswebads1,6772.1943.0379.95
Banner Showcase /wp-admin/admin.php?page=bwads_banners1,0281.7427.8851.39

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Banners::register() should not be called statically
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=bwads_banners
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method Banners::register() should not be called statically
  • 14 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=bwads_banners
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=bwads_banners
    • > Notice in wp-content/plugins/brokerswebads/bwads.php+17
    Undefined variable: wp_version
    • > GET request to /wp-admin/admin.php?page=brokerswebads
    • > User deprecated in wp-includes/functions.php+5453
    Function get_page_by_title is deprecated since version 6.2.0! Use WP_Query instead.

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
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/brokerswebads/bwadsbannerswidget.php:186
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/brokerswebads/bwads.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/brokerswebads/bwads_banners.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
These are user-side errors you should fix
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=bwads_banners
    • > Network (severe)
    http://../wp-content/plugins/brokerswebads/images/menu_icon.ico - Failed to load resource: net::ERR_NAME_NOT_RESOLVED

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (The BrokersWeb Listings.), #2 (Documented Control Panel.)
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === brokerswebads === )
You can look at the official readme.txt

brokerswebads/bwads.php 85% from 13 tests

The primary PHP file in "BrokersWeb Ads" version v2.2.1... is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Version: The version number should only use digits and periods (ex. "1.0.3" instead of "v2.2.1...")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("brokerswebads.php" instead of "bwads.php")

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
Success! There were no dangerous files found in this plugin1,190 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP36038822
JavaScript1115274
CSS20294

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
10 PNG files occupy 0.22MB with 0.09MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/bwAdsUI_11.png1.12KB0.23KB▼ 79.62%
screenshot-1.png32.86KB31.83KB▼ 3.14%
images/bw-logo.png10.90KB5.09KB▼ 53.32%
images/bullets_03.png1.86KB1.11KB▼ 40.36%
images/bullets_06.png2.06KB1.24KB▼ 39.74%