73% advanced-advertising-system

Code Review | Advanced Advertising System

WordPress plugin Advanced Advertising System scored73%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: 6.3.1
  • 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

200+ active /29,877 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.79MB] [CPU: ▼6.57ms] Passed 4 tests

A check of server-side resources used by Advanced Advertising System
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.31 ▲0.8543.53 ▼0.80
Dashboard /wp-admin4.13 ▲0.7953.09 ▼13.22
Posts /wp-admin/edit.php4.18 ▲0.8356.64 ▲5.23
Add New Post /wp-admin/post-new.php6.67 ▲0.7891.03 ▼9.47
Media Library /wp-admin/upload.php3.99 ▲0.7639.29 ▼2.77
Campaign /wp-admin/edit.php?post_type=campaign4.1041.33
Advertiser /wp-admin/edit.php?post_type=advertiser4.1044.06
Zone /wp-admin/edit.php?post_type=zone4.1038.44
Banner /wp-admin/edit.php?post_type=ads_banner4.1040.41

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 30 new files
Database: 1 new table, 7 new options
New tables
wp_aas_logged
New WordPress options
can_compress_scripts
widget_aas_widget
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Advanced Advertising System
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,975 ▲21414.16 ▼0.026.52 ▲4.4241.41 ▼1.64
Dashboard /wp-admin2,270 ▲705.00 ▼0.88108.48 ▼5.4144.47 ▲1.76
Posts /wp-admin/edit.php2,152 ▲522.26 ▲0.2034.51 ▼6.1736.01 ▼0.22
Add New Post /wp-admin/post-new.php1,568 ▲4222.77 ▲5.28648.27 ▼22.3356.36 ▲5.57
Media Library /wp-admin/upload.php1,449 ▲494.50 ▲0.3197.23 ▼10.1944.00 ▼4.19
Campaign /wp-admin/edit.php?post_type=campaign1,2902.3633.0130.09
Advertiser /wp-admin/edit.php?post_type=advertiser1,1832.3634.0426.60
Zone /wp-admin/edit.php?post_type=zone1,2822.3532.1731.14
Banner /wp-admin/edit.php?post_type=ads_banner1,2772.2332.5835.03

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
Please fix the following items
  • Zombie tables were found after uninstall: 1 table
    • wp_aas_logged
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_aas_widget
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Please fix the following items
  • 11× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > 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/includes/class-log.php:301
    • > PHP Fatal error
      Uncaught Error: Class 'AbstractProvider' not found in wp-content/plugins/advanced-advertising-system/includes/crawler/Fixtures/Headers.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: Class 'WP_Widget' not found in wp-content/plugins/advanced-advertising-system/widget.php:5
    • > 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 __() 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
    • > 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: Call to undefined function add_action() in wp-content/plugins/advanced-advertising-system/shortcode.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 42 tag instead of maximum 10
The official readme.txt is a good inspiration

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

"Advanced Advertising System" version 1.3.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("advanced-advertising-system.php" instead of "advanced_advertising_system.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; 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
Success! There were 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

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
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

Using a strong compression for your PNG files is a great way to speed-up your plugin
3 compressed PNG files occupy 0.00MB
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
js/chosen/chosen-sprite.png0.63KB0.88KB0.00%
js/chosen/chosen-sprite@2x.png0.85KB0.83KB▼ 3.10%
image/default_avatar.png0.50KB0.33KB▼ 33.53%