78% advanced-ads

Code Review | Advanced Ads – Ad Manager & AdSense

WordPress plugin Advanced Ads – Ad Manager & AdSense scored 78% from 54 tests.

About plugin

  • Plugin page: advanced-ads
  • Plugin version: 1.32.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.9
  • WordPress version: 5.9.2
  • First release: Jun 23, 2014
  • Latest release: Mar 7, 2022
  • Number of updates: 312
  • Update frequency: every 9.0 days
  • Top authors: webzunft (84.29%)advancedads (16.03%)

Code review

54 tests

User reviews

1272 reviews

Install metrics

100,000+ active / 5,916,366 total downloads

Benchmarks

Plugin footprint 83% 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 gracefully, with no errors

Server metrics [RAM: ▲0.41MB] [CPU: ▼287.56ms] Passed 4 tests

Analyzing server-side resources used by Advanced Ads – Ad Manager & AdSense
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.78 ▲0.6657.89 ▲33.07
Dashboard /wp-admin3.81 ▲0.4040.61 ▲6.41
Posts /wp-admin/edit.php4.04 ▲0.4043.59 ▲6.85
Add New Post /wp-admin/post-new.php7.37 ▲0.37105.13 ▼1,165.34
Media Library /wp-admin/upload.php3.76 ▲0.4628.86 ▲1.84
Groups & Rotation /wp-admin/admin.php?page=advanced-ads-groups3.9937.83
Settings /wp-admin/admin.php?page=advanced-ads-settings4.0338.57
Ads /wp-admin/post-new.php?post_type=advanced_ads&new=new4.3459.77
Import & Export /wp-admin/admin.php?page=advanced-ads-import-export4.0929.60
Placements /wp-admin/admin.php?page=advanced-ads-placements3.9436.45
Overview 0 /wp-admin/admin.php?page=advanced-ads3.8030.73

Server storage [IO: ▲1.97MB] [DB: ▲0.03MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 304 new files
Database: no new tables, 5 new options
New WordPress options
advanced-ads-ad-health-notices
widget_advads_ad_widget
GADSENSE_OPT_NAME
advanced-ads-internal
advanced-ads-notices

Browser metrics Passed 4 tests

Advanced Ads – Ad Manager & AdSense: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,203 ▲45916.08 ▲0.586.25 ▲0.552.13 ▼0.09
Dashboard /wp-admin3,239 ▲3786.32 ▲0.04117.92 ▼11.50180.93 ▲21.39
Posts /wp-admin/edit.php2,907 ▲2133.41 ▲0.1865.67 ▲2.47163.03 ▲23.54
Add New Post /wp-admin/post-new.php1,836 ▲17517.32 ▲1.11420.85 ▲19.09177.13 ▲22.54
Media Library /wp-admin/upload.php1,982 ▲2845.57 ▲0.04139.37 ▼3.26213.20 ▲33.35
Groups & Rotation /wp-admin/admin.php?page=advanced-ads-groups1,5353.2174.08129.97
Settings /wp-admin/admin.php?page=advanced-ads-settings3,2953.6776.24181.32
Ads /wp-admin/post-new.php?post_type=advanced_ads&new=new5,23911.80228.41227.03
Import & Export /wp-admin/admin.php?page=advanced-ads-import-export1,5193.2361.64129.26
Placements /wp-admin/admin.php?page=advanced-ads-placements1,9033.3465.81167.55
Overview 0 /wp-admin/admin.php?page=advanced-ads1,7263.2363.30173.81

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • Zombie WordPress options were found after uninstall: 5 options
    • GADSENSE_OPT_NAME
    • widget_advads_ad_widget
    • advanced-ads-internal
    • advanced-ads-ad-health-notices
    • advanced-ads-notices

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

SRP 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 5× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/advanced-ads/admin/views/ad-group-edit.php
    • > /wp-content/plugins/advanced-ads/admin/views/overview-addons-line.php
    • > /wp-content/plugins/advanced-ads/admin/views/notices/error.php
    • > /wp-content/plugins/advanced-ads/admin/views/notices/plugin_error.php
    • > /wp-content/plugins/advanced-ads/public/views/public.php
  • 153× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Notice
      Undefined variable: _notice in wp-content/plugins/advanced-ads/admin/views/notices/subscribe.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/advanced-ads/admin/views/upgrades/tracking.php:2
    • > PHP Notice
      Undefined variable: authors in wp-content/plugins/advanced-ads/admin/views/conditions/condition-author.php on line 34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/advanced-ads/admin/views/placements-inline-css.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_textarea() in wp-content/plugins/advanced-ads/modules/ads-txt/admin/views/setting-additional-content.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/advanced-ads/admin/views/modal.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/advanced-ads/admin/includes/notices.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_x() in wp-content/plugins/advanced-ads/admin/views/conditions/not-selected.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/advanced-ads/admin/views/feedback-disable.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/advanced-ads/admin/views/conditions/conditions-form.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
These attributes need your attention:
  • Tags: Too many tags (12 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

advanced-ads/advanced-ads.php Passed 13 tests

This is the main PHP file of "Advanced Ads – Ad Manager & AdSense" version 1.32.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
41 characters long description:
Manage and optimize your ads in WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin28,942 lines of code in 250 files:
LanguageFilesBlank linesComment linesLines of code
PHP2174,5719,91222,507
JavaScript235409293,888
PO File15626071,469
CSS46794890
Markdown2370104
XML20083
SVG1001

PHP code Passed 2 tests

This is a very shot review 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 complexity46.42
▷ Minimum class complexity1.00
▷ Maximum class complexity252.00
Average method complexity4.74
▷ Minimum method complexity1.00
▷ Maximum method complexity63.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes80
▷ Abstract classes22.50%
▷ Concrete classes7897.50%
▷ Final classes11.28%
Methods976
▷ Static methods23223.77%
▷ Public methods81783.71%
▷ Protected methods343.48%
▷ Private methods12512.81%
Functions40
▷ Named functions1845.00%
▷ Anonymous functions2255.00%
Constants50
▷ Global constants1632.00%
▷ Class constants3468.00%
▷ Public constants34100.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
40 PNG files occupy 0.28MB with 0.19MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/placements/header.png13.54KB4.48KB▼ 66.88%
admin/assets/img/placements/content-before.png10.43KB2.83KB▼ 72.84%
admin/assets/img/placements/content-within.png10.20KB2.84KB▼ 72.19%
admin/assets/img/placements/more.png4.09KB1.43KB▼ 64.99%
admin/assets/jquery-ui/images/ui-bg_glass_55_fbf9ee_1x400.png0.33KB0.12KB▼ 62.09%