10% adrotate

Code Review | AdRotate - Ad manager & AdSense Ads

WordPress plugin AdRotate - Ad manager & AdSense Ads scored 10% from 54 tests.

About plugin

  • Plugin page: adrotate
  • Plugin version: 5.8.22
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.9
  • WordPress version: 5.9.2
  • First release: Jul 1, 2008
  • Latest release: Feb 5, 2022
  • Number of updates: 465
  • Update frequency: every 10.7 days
  • Top authors: adegans (73.12%)SHRIKEE (27.1%)

Code review

54 tests

User reviews

631 reviews

Install metrics

40,000+ active / 3,078,332 total downloads

Benchmarks

Plugin footprint 22% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/adrotate/adrotate.php+66
    Trying to access array offset on value of type bool

Server metrics [RAM: ▲0.86MB] [CPU: ▼286.44ms] Passed 4 tests

Analyzing server-side resources used by AdRotate - Ad manager & AdSense Ads
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.41 ▲0.8959.38 ▲9.75
Dashboard /wp-admin4.26 ▲0.8639.99 ▲7.62
Posts /wp-admin/edit.php4.49 ▲0.8543.89 ▲7.66
Add New Post /wp-admin/post-new.php7.80 ▲0.8398.72 ▼1,163.56
Media Library /wp-admin/upload.php4.21 ▲0.9227.08 ▲2.51
Manage Media /wp-admin/admin.php?page=adrotate-media4.1727.17
Statistics /wp-admin/admin.php?page=adrotate-statistics4.1531.32
Manage Schedules /wp-admin/admin.php?page=adrotate-schedules4.1728.81
Settings /wp-admin/admin.php?page=adrotate-settings4.1726.62
Get AdRotate Pro /wp-admin/admin.php?page=adrotate-pro4.1627.90
Support /wp-admin/admin.php?page=adrotate-support4.1528.90
Manage Groups /wp-admin/admin.php?page=adrotate-groups4.1734.65
Manage Adverts /wp-admin/admin.php?page=adrotate4.1730.35

Server storage [IO: ▲2.30MB] [DB: ▲0.02MB] 67% from 3 tests

Input-output and database impact of this plugin
These are issues you should consider
  • You have illegally modified 2 files (0.00KB) outside of "wp-content/plugins/adrotate/" and "wp-content/uploads/"
    • (new file) wp-content/reports/.empty
    • (new file) wp-content/banners/.empty
Filesystem: 86 new files
Database: 7 new tables, 13 new options
New tables
wp_adrotate_schedule
wp_adrotate
wp_adrotate_groups
wp_adrotate_tracker
wp_adrotate_stats
wp_adrotate_stats_archive
wp_adrotate_linkmeta
New WordPress options
adrotate_version
adrotate_dynamic_required
adrotate_hide_getpro
adrotate_advert_status
widget_adrotate_widgets
adrotate_hide_review
adrotate_config
adrotate_geo_required
adrotate_hide_birthday
adrotate_db_version
...

Browser metrics Passed 4 tests

AdRotate - Ad manager & AdSense Ads: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,949 ▲19516.05 ▲0.107.26 ▲0.612.33 ▼0.40
Dashboard /wp-admin3,034 ▲1766.27 ▲0.09124.43 ▼9.43176.48 ▲13.00
Posts /wp-admin/edit.php2,805 ▲1203.59 ▲0.3471.32 ▲6.13142.68 ▼10.31
Add New Post /wp-admin/post-new.php1,720 ▼3216.43 ▼4.48419.93 ▼42.97186.81 ▲28.58
Media Library /wp-admin/upload.php1,847 ▲1555.67 ▲0.12136.67 ▼6.75216.90 ▲32.32
Manage Media /wp-admin/admin.php?page=adrotate-media1,5643.2272.34187.84
Statistics /wp-admin/admin.php?page=adrotate-statistics1,7213.2269.25218.68
Manage Schedules /wp-admin/admin.php?page=adrotate-schedules1,7413.2365.29181.52
Settings /wp-admin/admin.php?page=adrotate-settings1,7473.5972.98158.23
Get AdRotate Pro /wp-admin/admin.php?page=adrotate-pro1,6663.1867.58184.76
Support /wp-admin/admin.php?page=adrotate-support1,5643.2168.04193.43
Manage Groups /wp-admin/admin.php?page=adrotate-groups1,5803.5168.57164.96
Manage Adverts /wp-admin/admin.php?page=adrotate1,7423.5070.09163.80

Uninstaller [IO: ▲0.00MB] [DB: ▲0.02MB] 25% from 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/adrotate/adrotate-setup.php+227
    Undefined variable: pfunction
  • Zombie tables detected upon uninstall: 7 tables
    • wp_adrotate
    • wp_adrotate_schedule
    • wp_adrotate_groups
    • wp_adrotate_tracker
    • wp_adrotate_stats
    • wp_adrotate_linkmeta
    • wp_adrotate_stats_archive
  • This plugin does not fully uninstall, leaving 13 options in the database
    • adrotate_version
    • adrotate_notifications
    • adrotate_config
    • adrotate_db_version
    • adrotate_crawlers
    • widget_adrotate_widgets
    • adrotate_geo_requests
    • adrotate_geo_required
    • adrotate_advert_status
    • adrotate_hide_getpro
    • ...

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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 take a closer look at the following
  • 32× 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 _e() in wp-content/plugins/adrotate/dashboard/publisher/adverts-main.php:12
    • > PHP Notice
      Undefined variable: wpdb in wp-content/plugins/adrotate/dashboard/publisher/groups-edit.php on line 14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/adrotate/dashboard/publisher/adverts-disabled.php:13
    • > PHP Notice
      Undefined variable: ad_edit_id in wp-content/plugins/adrotate/dashboard/publisher/adverts-generator.php on line 12
    • > PHP Notice
      Undefined variable: wpdb in wp-content/plugins/adrotate/dashboard/publisher/adverts-edit.php on line 13
    • > PHP Notice
      Undefined variable: wpdb in wp-content/plugins/adrotate/dashboard/support.php on line 13
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_var() on null in wp-content/plugins/adrotate/dashboard/publisher/adverts-generator.php:13
    • > PHP Notice
      Undefined variable: wpdb in wp-content/plugins/adrotate/dashboard/publisher/statistics-advert.php on line 12
    • > PHP Notice
      Undefined variable: group_edit_id in wp-content/plugins/adrotate/dashboard/publisher/groups-edit.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_var() on null in wp-content/plugins/adrotate/dashboard/support.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 97% 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: There are too many tags (17 tag instead of maximum 10)
The official readme.txt is a good inspiration

adrotate/adrotate.php Passed 13 tests

"AdRotate - Ad manager & AdSense Ads" version 5.8.22's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
89 characters long description:
Monetize your website with adverts while keeping things simple. Start making money today!

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin17,715 lines of code in 47 files:
LanguageFilesBlank linesComment linesLines of code
PO File67,37616,36111,948
PHP309759835,519
JavaScript101270160
CSS1141088

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity6.00
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions104
▷ Named functions104100.00%
▷ Anonymous functions00.00%
Constants9
▷ Global constants9100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
19 PNG files occupy 0.08MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/cross.png0.39KB0.28KB▼ 28.36%
images/pro/demo-mobile.png1.46KB0.79KB▼ 45.93%
images/birthday.png4.24KB2.05KB▼ 51.49%
images/logo-60x60.png5.52KB2.89KB▼ 47.58%
images/pro/demo-support.png4.58KB2.40KB▼ 47.70%