62% advanced-ads

Code Review | Advanced Ads – Ad Manager & AdSense

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

About plugin

  • Plugin page: advanced-ads
  • Plugin version: 1.47.5
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-6.3
  • WordPress version: 6.3.1
  • First release: Jun 23, 2014
  • Latest release: Nov 13, 2023
  • Number of updates: 358
  • Update frequency: every 9.6 days
  • Top authors: webzunft (74.58%)advancedads (25.7%)

Code review

54 tests

User reviews

1386 reviews

Install metrics

100,000+ active /8,366,363 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲2.87MB] [CPU: ▲25.54ms] Passed 4 tests

An overview of server-side resources used by Advanced Ads – Ad Manager & AdSense
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /5.23 ▲1.7660.99 ▲22.81
Dashboard /wp-admin6.54 ▲3.1979.91 ▲20.92
Posts /wp-admin/edit.php6.66 ▲3.3081.53 ▲37.41
Add New Post /wp-admin/post-new.php9.17 ▲3.28124.42 ▲24.19
Media Library /wp-admin/upload.php6.51 ▲3.2766.08 ▲34.23
Groups & Rotation /wp-admin/admin.php?page=advanced-ads-groups6.5970.00
Placements /wp-admin/admin.php?page=advanced-ads-placements6.6866.53
Dashboard /wp-admin/admin.php?page=advanced-ads6.6361.76
Ads 0 /wp-admin/post-new.php?post_type=advanced_ads&new=new7.1288.73
Settings /wp-admin/admin.php?page=advanced-ads-settings6.7268.99
Import & Export /wp-admin/admin.php?page=advanced-ads-import-export6.6558.77

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 440 new files
Database: no new tables, 12 new options
New WordPress options
widget_recent-posts
advanced_ads_ads_txt
db_upgraded
widget_advads_ad_widget
theysaidso_admin_options
advanced-ads-internal
advanced-ads-ad-health-notices
advanced-ads-notices
widget_recent-comments
widget_theysaidso_widget
...

Browser metrics Passed 4 tests

An overview of browser requirements for Advanced Ads – Ad Manager & AdSense
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,095 ▲34814.18 ▼0.162.94 ▲1.2841.02 ▼0.59
Dashboard /wp-admin2,411 ▲2365.60 ▼0.0199.04 ▼23.4083.69 ▲39.28
Posts /wp-admin/edit.php2,300 ▲2002.17 ▲0.1548.04 ▲9.3240.07 ▲7.80
Add New Post /wp-admin/post-new.php6,244 ▲4,71824.20 ▲0.99929.40 ▲278.2336.94 ▼15.90
Media Library /wp-admin/upload.php1,638 ▲2474.25 ▲0.05105.31 ▲5.4147.83 ▲4.46
Groups & Rotation /wp-admin/admin.php?page=advanced-ads-groups1,5412.3756.3677.29
Placements /wp-admin/admin.php?page=advanced-ads-placements1,7072.3743.6685.72
Dashboard /wp-admin/admin.php?page=advanced-ads1,3922.2031.6436.37
Ads 0 /wp-admin/post-new.php?post_type=advanced_ads&new=new4,4109.45222.17137.61
Settings /wp-admin/admin.php?page=advanced-ads-settings2,5112.3946.8957.72
Import & Export /wp-admin/admin.php?page=advanced-ads-import-export1,2722.1731.6033.02

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, cannot call abstract method AdvancedAds\Framework\Installation\Install::uninstall()
  • The uninstall procedure has failed, leaving 12 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • advanced-ads-ad-health-notices
    • widget_recent-posts
    • can_compress_scripts
    • advanced-ads-adsense
    • widget_advads_ad_widget
    • advanced-ads-internal
    • advanced_ads_ads_txt
    • widget_recent-comments
    • ...

Smoke tests 25% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
The following issues need your attention
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/advanced-ads/admin/views/overview-addons-line.php
    • > /wp-content/plugins/advanced-ads/public/views/public.php
    • > /wp-content/plugins/advanced-ads/admin/views/ad-usage-metabox.php
    • > /wp-content/plugins/advanced-ads/admin/views/notices/error.php
    • > /wp-content/plugins/advanced-ads/admin/views/ad-list/view-list.php
    • > /wp-content/plugins/advanced-ads/packages/mobiledetect/mobiledetectlib/export/exportToJSON.php
  • 182× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Advanced_Ads_Ad_List_Filters' not found in wp-content/plugins/advanced-ads/admin/views/ad-list-filters.php:2
    • > PHP Notice
      Undefined variable: text in wp-content/plugins/advanced-ads/admin/views/notices/error.php on line 1
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/advanced-ads/admin/views/ad-parameters-size.php on line 4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/advanced-ads/admin/views/notices/info.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/advanced-ads/admin/views/ad-list/shortcode.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_advads() in wp-content/plugins/advanced-ads/views/admin/screens/group-form.php:9
    • > PHP Notice
      Undefined variable: post_types in wp-content/plugins/advanced-ads/admin/views/settings/general/disable-post-types.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/advanced-ads/admin/views/upgrades/pro-tab.php:2
    • > PHP Warning
      include(ADVADS_ABSPATHadmin/views/ad-usage.php): failed to open stream: No such file or directory in wp-content/plugins/advanced-ads/admin/views/ad-usage-metabox.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/advanced-ads/admin/views/post-ad-settings-hint-metabox.php:11

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=advanced-ads-import-export
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils,wp-polyfill-inert,regenerator-runtime,wp-polyfill,wp-hooks&ver=6.3.1 1:28721 Uncaught DOMException: Failed to execute 'insertBefore' on 'Node': The new child element contains the parent.

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
You can look at the official readme.txt

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

The main file in "Advanced Ads – Ad Manager & AdSense" v. 1.47.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
41 characters long description:
Manage and optimize your ads in WordPress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected35,703 lines of code in 380 files:
LanguageFilesBlank linesComment linesLines of code
PHP3065,93315,17828,083
JavaScript326611,1064,439
CSS41191161,410
PO File15617011,247
JSON200171
Markdown6530136
SVG2600119
XML20083
YAML11015

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity30.27
▷ Minimum class complexity1.00
▷ Maximum class complexity253.00
Average method complexity4.14
▷ Minimum method complexity1.00
▷ Maximum method complexity78.00
Code structure
Namespaces21
Interfaces5
Traits0
Classes141
▷ Abstract classes64.26%
▷ Concrete classes13595.74%
▷ Final classes10.74%
Methods1,378
▷ Static methods31022.50%
▷ Public methods1,13182.08%
▷ Protected methods473.41%
▷ Private methods20014.51%
Functions74
▷ Named functions2128.38%
▷ Anonymous functions5371.62%
Constants80
▷ Global constants2126.25%
▷ Class constants5973.75%
▷ Public constants59100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
27 PNG files occupy 0.25MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/img/placements/manual.png13.25KB4.31KB▼ 67.47%
admin/assets/img/placements/background.png5.03KB1.63KB▼ 67.60%
admin/assets/img/tinymce-icon.png1.98KB1.30KB▼ 34.22%
admin/assets/img/placements/ads-in-header.png6.85KB2.19KB▼ 68.10%
admin/assets/img/output-left.png6.95KB2.75KB▼ 60.48%