57% ad-box

Code Review | Ad Box

WordPress plugin Ad Box scored 57% 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: 5.9.2
  • 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

20+ active / 3,298 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼1.17MB] [CPU: ▼324.36ms] Passed 4 tests

An overview of server-side resources used by Ad Box
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.61 ▲0.1056.12 ▲9.57
Dashboard /wp-admin3.16 ▼0.2516.66 ▼18.58
Posts /wp-admin/edit.php3.16 ▼0.4818.31 ▼19.29
Add New Post /wp-admin/post-new.php3.16 ▼3.8117.08 ▼1,248.55
Media Library /wp-admin/upload.php3.16 ▼0.1416.01 ▼11.01
Ad Box /wp-admin/options-general.php?page=ad-box/ad-box.php3.1618.32

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, 1 new option
New WordPress options
widget_adboxwidget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Ad Box
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,915 ▲16116.36 ▲0.7310.36 ▲4.652.81 ▲0.03
Dashboard /wp-admin2,904 ▲506.20 ▲0.01114.21 ▼25.73152.79 ▼13.35
Posts /wp-admin/edit.php2,700 ▲63.24 ▲0.0061.92 ▼2.20139.83 ▼4.55
Add New Post /wp-admin/post-new.php1,775 ▲1717.46 ▼4.72416.65 ▼41.76169.64 ▲14.18
Media Library /wp-admin/upload.php1,710 ▲125.57 ▲0.02145.73 ▲4.71184.95 ▲4.72
Ad Box /wp-admin/options-general.php?page=ad-box/ad-box.php9144.21136.99183.37

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • This plugin cannot be uninstalled
    • > User deprecated in wp-includes/functions.php+5600
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_adboxwidget

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just 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+5600
    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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 4× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/ad-box/includes/setting-page/medust-footer.php
    • > /wp-content/plugins/ad-box/includes/setting-page/medust-right-column.php
    • > /wp-content/plugins/ad-box/includes/setting-page/medust-right-panel2.php
    • > /wp-content/plugins/ad-box/includes/setting-page/medust-right-panel1.php
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > 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
    • > 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

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
These are user-side errors you should fix
    • > GET request to /wp-admin/options-general.php?page=ad-box/ad-box.php
    • > Network (severe)
    http://www.larnr.com/template/images/courses/android-training.jpg - Failed to load resource: net::ERR_CONNECTION_REFUSED

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that 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

Analyzing the main PHP file in "Ad Box" version 1.1
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 | There should be no dangerous file extensions present in any WordPress plugin
There were no executable 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

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
PNG images were not found in this plugin