10% a-ads

Code Review | A-ADS

WordPress plugin A-ADS scored 10% from 54 tests.

About plugin

  • Plugin page: a-ads
  • Plugin version: 1.1.0
  • PHP compatiblity: 5.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2-5.5.3
  • WordPress version: 5.9.2
  • First release: Dec 2, 2020
  • Latest release: Jan 23, 2021
  • Number of updates: 16
  • Update frequency: every 3.3 days
  • Top authors: uix642 (93.75%)arsenische (12.5%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 1,085 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/a-ads/core.php+46
    Undefined variable: aads_core_functions

Server metrics [RAM: ▼2.53MB] [CPU: ▼349.38ms] Passed 4 tests

An overview of server-side resources used by A-ADS
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.84 ▼1.684.15 ▼55.96
Dashboard /wp-admin1.86 ▼1.553.72 ▼29.75
Posts /wp-admin/edit.php1.86 ▼1.784.50 ▼33.27
Add New Post /wp-admin/post-new.php1.86 ▼5.113.88 ▼1,278.53
Media Library /wp-admin/upload.php1.86 ▼1.443.54 ▼22.08

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 9 new files
Database: no new tables, 1 new option
New WordPress options
widget_aads_ads_widget

Browser metrics Passed 4 tests

A check of browser resources used by A-ADS
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,767 ▲2215.86 ▼0.075.69 ▼0.802.46 ▲0.12
Dashboard /wp-admin2,892 ▲346.17 ▲0.01119.19 ▼18.75154.78 ▼11.88
Posts /wp-admin/edit.php2,688 ▼63.24 ▼0.0164.15 ▲1.68139.46 ▼1.97
Add New Post /wp-admin/post-new.php1,661 ▼016.09 ▼0.13412.97 ▼6.59158.24 ▼1.10
Media Library /wp-admin/upload.php1,698 ▲35.53 ▼0.01138.27 ▼7.02181.34 ▼8.46

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/a-ads/core.php+46
    Undefined variable: aads_core_functions
  • The uninstall procedure has failed, leaving 1 option in the database
    • widget_aads_ads_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/a-ads/A-ADS.php
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'wp_widget' not found in wp-content/plugins/a-ads/widget.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/a-ads/core.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine on the user side

Optimizations

Plugin configuration 83% 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:
  • Plugin Name: Please specify the plugin name on the first line ( === a-ads === )
You can look at the official readme.txt

a-ads/A-ADS.php 69% from 13 tests

The main PHP script in "A-ADS" version 1.1.0 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("a-ads.php" instead of "A-ADS.php")
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Domain Path: The domain path should use only dashes and lowercase characters ("/A-ADS")
  • Requires at least: The required version number did not match the one declared in readme.txt ("3.5" instead of "5.2")

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
No dangerous file extensions were detected263 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP58289263
CSS1010
JavaScript1010

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity21.50
▷ Minimum class complexity1.00
▷ Maximum class complexity42.00
Average method complexity5.10
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods10100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.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