73% advanced-advertising-system

Code Review | Advanced Advertising System

WordPress plugin Advanced Advertising System scored 73% from 54 tests.

About plugin

  • Plugin page: advanced-advertis...
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.8
  • WordPress version: 5.9.2
  • First release: Sep 19, 2014
  • Latest release: Jun 29, 2018
  • Number of updates: 43
  • Update frequency: every 32.1 days
  • Top authors: smartdevth (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

300+ active / 28,287 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.78MB] [CPU: ▼322.23ms] Passed 4 tests

This is a short check of server-side resources used by Advanced Advertising System
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.35 ▲0.8372.43 ▲13.20
Dashboard /wp-admin4.19 ▲0.7837.88 ▲2.53
Posts /wp-admin/edit.php4.42 ▲0.7753.84 ▲14.66
Add New Post /wp-admin/post-new.php7.72 ▲0.7495.91 ▼1,304.86
Media Library /wp-admin/upload.php4.14 ▲0.8433.59 ▲0.21
Banner /wp-admin/edit.php?post_type=ads_banner4.1859.24
Advertiser /wp-admin/edit.php?post_type=advertiser4.1729.88
Zone /wp-admin/edit.php?post_type=zone4.1828.44
Campaign /wp-admin/edit.php?post_type=campaign4.1831.38

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 30 new files
Database: 1 new table, 1 new option
New tables
wp_aas_logged
New WordPress options
widget_aas_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Advanced Advertising System
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,956 ▲21416.56 ▲0.9911.02 ▲5.372.00 ▼0.19
Dashboard /wp-admin2,952 ▲916.22 ▲0.03122.80 ▼9.69162.82 ▼81.19
Posts /wp-admin/edit.php2,748 ▲573.27 ▼0.0965.96 ▲2.00215.31 ▲60.00
Add New Post /wp-admin/post-new.php1,711 ▲1520.51 ▼1.16452.83 ▼6.53186.90 ▼28.28
Media Library /wp-admin/upload.php1,757 ▲595.64 ▲0.21128.32 ▼10.60197.14 ▲3.24
Banner /wp-admin/edit.php?post_type=ads_banner1,5593.2062.19122.67
Advertiser /wp-admin/edit.php?post_type=advertiser1,5153.3491.79117.33
Zone /wp-admin/edit.php?post_type=zone1,5673.2261.63183.50
Campaign /wp-admin/edit.php?post_type=campaign1,5763.2259.81200.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 uninstall procedure failed, leaving 1 table in the database
    • wp_aas_logged
  • Zombie WordPress options were found after uninstall: 1 option
    • widget_aas_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 11× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-advertising-system/includes/class-banner.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-advertising-system/includes/class-campaign.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/advanced-advertising-system/widget.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/advanced-advertising-system/advanced_advertising_system.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-advertising-system/shortcode.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'AbstractProvider' not found in wp-content/plugins/advanced-advertising-system/includes/crawler/Fixtures/Crawlers.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-advertising-system/includes/class-advertiser.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/advanced-advertising-system/includes/class-log.php:301
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/advanced-advertising-system/includes/class-zone.php:16
    • > PHP Fatal error
      Uncaught Error: Class 'AbstractProvider' not found in wp-content/plugins/advanced-advertising-system/includes/crawler/Fixtures/Exclusions.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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:
  • Tags: Too many tags (42 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

advanced-advertising-system/advanced_advertising_system.php 85% from 13 tests

The main PHP file in "Advanced Advertising System" ver. 1.3.1 adds more information about the plugin and also serves as the entry point for this plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("advanced-advertising-system.php" instead of "advanced_advertising_system.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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
Everything looks great! No dangerous files found in this plugin5,395 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP144449263,531
JavaScript5165621,158
PO File1185201410
CSS292296

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.43
Average class complexity26.31
▷ Minimum class complexity1.00
▷ Maximum class complexity123.00
Average method complexity4.16
▷ Minimum method complexity1.00
▷ Maximum method complexity77.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes13
▷ Abstract classes17.69%
▷ Concrete classes1292.31%
▷ Final classes00.00%
Methods104
▷ Static methods1211.54%
▷ Public methods10298.08%
▷ Protected methods21.92%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants535.71%
▷ Class constants964.29%
▷ Public constants9100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
image/default_avatar.png0.50KB0.33KB▼ 33.53%
js/chosen/chosen-sprite.png0.63KB0.88KB0.00%
js/chosen/chosen-sprite@2x.png0.85KB0.83KB▼ 3.10%