57% ad-box

Code Review | Ad Box

WordPress plugin Ad Box scored57%from 54 tests.

About plugin

  • Plugin page: ad-box
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7-5.2
  • WordPress version: 6.3.1
  • First release: Aug 15, 2015
  • Latest release: Jun 1, 2019
  • Number of updates: 4
  • Update frequency: every 346.8 days
  • Top authors: medust (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /3,654 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: ▼0.89MB] [CPU: ▼34.27ms] Passed 4 tests

An overview of server-side resources used by Ad Box
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0641.35 ▼0.90
Dashboard /wp-admin3.05 ▼0.2524.57 ▼29.31
Posts /wp-admin/edit.php3.05 ▼0.3024.45 ▼24.51
Add New Post /wp-admin/post-new.php3.05 ▼2.8322.45 ▼71.75
Media Library /wp-admin/upload.php3.05 ▼0.1724.11 ▼11.50
Ad Box /wp-admin/options-general.php?page=ad-box/ad-box.php3.0624.14

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 14 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
widget_recent-posts
widget_adboxwidget
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Ad Box
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲11913.50 ▼1.1210.37 ▲8.3343.68 ▼0.92
Dashboard /wp-admin2,208 ▲315.59 ▼0.0586.56 ▼8.1741.15 ▼0.67
Posts /wp-admin/edit.php2,110 ▲72.01 ▼0.1436.41 ▼1.5434.16 ▼0.28
Add New Post /wp-admin/post-new.php6,303 ▲4,77726.03 ▲2.34949.08 ▲253.3662.36 ▲12.79
Media Library /wp-admin/upload.php1,413 ▲134.15 ▼0.07107.80 ▼2.6146.22 ▼1.39
Ad Box /wp-admin/options-general.php?page=ad-box/ad-box.php1,1845.41106.0863.02

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > 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.
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_adboxwidget
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ad-box/ad-box.php
    • > 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.

SRP 0% 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
  • 4× PHP files output text when accessed directly:
    • > /wp-content/plugins/ad-box/includes/setting-page/medust-right-panel2.php
    • > /wp-content/plugins/ad-box/includes/setting-page/medust-right-panel1.php
    • > /wp-content/plugins/ad-box/includes/setting-page/medust-right-column.php
    • > /wp-content/plugins/ad-box/includes/setting-page/medust-footer.php
  • 3× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/ad-box/includes/settings-page.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ad-box/ad-box.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/ad-box/includes/setting-page/medust-left-column.php:26

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=ad-box/ad-box.php
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'ambient-light-sensor'.
    • > GET request to /wp-admin/options-general.php?page=ad-box/ad-box.php
    • > Security (warning) in unknown
    security - Error with Permissions-Policy header: Unrecognized feature: 'bluetooth'.
    • > GET request to /wp-admin/options-general.php?page=ad-box/ad-box.php
    • > Network (severe)
    https://larnr.com/template/images/courses/android-training.jpg - Failed to load resource: the server responded with a status of 404 ()

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need to be fixed:
  • Tags: There are too many tags (11 tag instead of maximum 10)
The official readme.txt is a good inspiration

ad-box/ad-box.php Passed 13 tests

This is the main PHP file of "Ad Box" version 1.1, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
87 characters long description:
Add an advertising widget to your sidebar that gives you lots of customization options.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Success! There were no dangerous files found in this plugin1,880 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
CSS2365471,472
PHP7110102374
JavaScript28034

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity12.00
▷ Minimum class complexity4.00
▷ Maximum class complexity20.00
Average method complexity6.50
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods4
▷ Static methods125.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions8
▷ Named functions8100.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
There were not PNG files found in your plugin