73% wp-ad-guru

Code Review | WP Ad Guru - Banner ad, Responsive popup, Popup maker, Ad rotator & More

WordPress plugin WP Ad Guru - Banner ad, Responsive popup, Popup maker, Ad rotator & More scored73%from 54 tests.

About plugin

  • Plugin page: wp-ad-guru
  • Plugin version: 2.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 9, 2019
  • Latest release: Mar 5, 2023
  • Number of updates: 38
  • Update frequency: every 39.1 days
  • Top authors: onetarek (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

600+ active /11,039 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
Install script ran successfully

Server metrics [RAM: ▲1.69MB] [CPU: ▲5.61ms] Passed 4 tests

Analyzing server-side resources used by WP Ad Guru - Banner ad, Responsive popup, Popup maker, Ad rotator & More
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.59 ▲1.1352.63 ▲12.19
Dashboard /wp-admin5.18 ▲1.8864.90 ▲15.78
Posts /wp-admin/edit.php5.29 ▲1.9456.04 ▲8.78
Add New Post /wp-admin/post-new.php7.78 ▲1.9090.36 ▼14.31
Media Library /wp-admin/upload.php5.08 ▲1.8553.08 ▲18.86
Banners /wp-admin/admin.php?page=adguru_ad_banner5.1948.52
Settings /wp-admin/admin.php?page=adguru_settings5.0844.79
Setup Ads /wp-admin/admin.php?page=adguru_setup_ads5.1143.99
Window Popups /wp-admin/admin.php?page=adguru_ad_window_popup5.1945.06
Zones /wp-admin/admin.php?page=adguru_zone5.1447.48
Modal Popups /wp-admin/admin.php?page=adguru_ad_modal_popup5.1946.88
Ad Guru /wp-admin/admin.php?page=adguru5.1043.62

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 249 new files
Database: 1 new table, 11 new options
New tables
wp_adguru_ad_links
New WordPress options
adguru_mp_default_theme_id
widget_theysaidso_widget
widget_adguru-zone-widget
adguru_mp_builtin_theme_id_list
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts
theysaidso_admin_options
adguru_version
...

Browser metrics Passed 4 tests

An overview of browser requirements for WP Ad Guru - Banner ad, Responsive popup, Popup maker, Ad rotator & More
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,079 ▲31815.34 ▲1.055.78 ▲4.2242.56 ▲1.60
Dashboard /wp-admin2,395 ▲2186.37 ▲0.59120.08 ▲34.3698.01 ▲55.21
Posts /wp-admin/edit.php2,326 ▲2263.59 ▲1.6249.06 ▲7.9372.17 ▲34.46
Add New Post /wp-admin/post-new.php6,243 ▲4,71723.51 ▲0.43908.33 ▲234.5294.83 ▲38.77
Media Library /wp-admin/upload.php1,457 ▲604.36 ▲0.1886.66 ▼20.2879.88 ▲33.83
Banners /wp-admin/admin.php?page=adguru_ad_banner1,3923.6755.6781.56
Settings /wp-admin/admin.php?page=adguru_settings1,0823.5142.3367.01
Setup Ads /wp-admin/admin.php?page=adguru_setup_ads1,0963.6438.3972.72
Window Popups /wp-admin/admin.php?page=adguru_ad_window_popup1,3923.6458.4968.72
Zones /wp-admin/admin.php?page=adguru_zone1,3213.6354.5188.84
Modal Popups /wp-admin/admin.php?page=adguru_ad_modal_popup1,4013.5455.0575.83
Ad Guru /wp-admin/admin.php?page=adguru1,4173.8850.36131.22

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure failed, leaving 1 table in the database
    • wp_adguru_ad_links
  • This plugin did not uninstall successfully, leaving 11 options in the database
    • widget_recent-comments
    • adguru_version
    • widget_adguru-zone-widget
    • can_compress_scripts
    • adguru_mp_default_theme_id
    • adguru_mp_builtin_theme_id_list
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • adguru_settings
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following items
  • 65× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function adguru() in wp-content/plugins/wp-ad-guru/includes/admin/ad-setup-manager/ad-setup-manager-page.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/wp-ad-guru/libs/geoip/GeoIP2-php/vendor/geoip2/geoip2/src/Model/AnonymousIp.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-ad-guru/modules/modal_popup/editor/form-closing.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'ADGURU_Helper' not found in wp-content/plugins/wp-ad-guru/includes/admin/zone-manager/editor/form-inserter.php:228
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_themes() on null in wp-content/plugins/wp-ad-guru/modules/modal_popup/editor/edit_form_after_content.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'MaxMind\\Exception\\WebServiceException' not found in wp-content/plugins/wp-ad-guru/libs/geoip/GeoIP2-php/vendor/maxmind/web-service-common/src/Exception/HttpException.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-ad-guru/modules/window_popup/editor/edit_form_after_content.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Exception\\GeoIp2Exception' not found in wp-content/plugins/wp-ad-guru/libs/geoip/GeoIP2-php/vendor/geoip2/geoip2/src/Exception/OutOfQueriesException.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'GeoIp2\\Model\\AbstractModel' not found in wp-content/plugins/wp-ad-guru/libs/geoip/GeoIP2-php/vendor/geoip2/geoip2/src/Model/Country.php:30
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-ad-guru/modules/window_popup/editor/form-popup-options.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that need to be fixed:
  • Tags: There are too many tags (13 tag instead of maximum 10)
The official readme.txt is a good inspiration

wp-ad-guru/wp_ad_guru.php 85% from 13 tests

The main file in "WP Ad Guru - Banner ad, Responsive popup, Popup maker, Ad rotator & More" v. 2.5.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: Please don't use more than 140 characters for the plugin description (currently 218 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-ad-guru.php" instead of "wp_ad_guru.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin28,204 lines of code in 197 files:
LanguageFilesBlank linesComment linesLines of code
PHP1533,9005,12717,441
CSS10691774,743
JavaScript125962263,109
Markdown943501,146
HTML1591781
C18614523
JSON600374
Bourne Shell120040
m418032
C/C++ Header14128
SVG2007

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 180)
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity21.78
▷ Minimum class complexity1.00
▷ Maximum class complexity429.00
Average method complexity4.37
▷ Minimum method complexity1.00
▷ Maximum method complexity180.00
Code structure
Namespaces13
Interfaces2
Traits0
Classes95
▷ Abstract classes44.21%
▷ Concrete classes9195.79%
▷ Final classes33.30%
Methods602
▷ Static methods284.65%
▷ Public methods47378.57%
▷ Protected methods274.49%
▷ Private methods10216.94%
Functions97
▷ Named functions9395.88%
▷ Anonymous functions44.12%
Constants34
▷ Global constants1647.06%
▷ Class constants1852.94%
▷ Public constants18100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
32 PNG files occupy 0.26MB with 0.14MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/jquery-ui-themes/smoothness/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
assets/css/jquery-ui-themes/smoothness/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.27KB0.18KB▼ 35.00%
assets/images/close-icons/close-cross-double-white-red.png15.77KB6.02KB▼ 61.81%
assets/images/close-icons/close-cross-fancy-1-red.png15.62KB5.71KB▼ 63.41%
assets/images/close-icons/close-default.png10.92KB5.23KB▼ 52.07%