94% adrotate-switch

Code Review | AdRotate Switch

WordPress plugin AdRotate Switch scored 94% from 54 tests.

About plugin

  • Plugin page: adrotate-switch
  • Plugin version: 1.12
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.4
  • WordPress version: 5.9.2
  • First release: Nov 11, 2014
  • Latest release: Mar 13, 2020
  • Number of updates: 42
  • Update frequency: every 46.4 days
  • Top authors: adegans (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 12,138 total downloads


Plugin footprint Passed 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: ▲0.10MB] [CPU: ▼293.93ms] Passed 4 tests

A check of server-side resources used by AdRotate Switch
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1164.62 ▲5.83
Dashboard /wp-admin3.54 ▲0.1337.74 ▼10.30
Posts /wp-admin/edit.php3.77 ▲0.1342.58 ▼1.62
Add New Post /wp-admin/post-new.php7.02 ▲0.0499.16 ▼1,168.90
Media Library /wp-admin/upload.php3.42 ▲0.1330.33 ▲5.09

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 29 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for AdRotate Switch
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,780 ▲5816.13 ▲0.565.87 ▼0.422.32 ▼0.06
Dashboard /wp-admin2,908 ▲506.22 ▲0.06118.86 ▼18.50184.60 ▲22.59
Posts /wp-admin/edit.php2,705 ▲143.12 ▲0.0763.94 ▼6.48138.87 ▼7.52
Add New Post /wp-admin/post-new.php1,723 ▲6220.68 ▲4.17426.34 ▼1.70160.34 ▼4.53
Media Library /wp-admin/upload.php1,715 ▲175.55 ▲0.01127.62 ▼15.25203.63 ▲17.42

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
This plugin's uninstaller ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% 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 items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/adrotate-switch/adrotate-switch.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found


Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Please fix the following attributes:
  • Tags: You are using too many tags: 16 tag instead of maximum 10
You can look at the official readme.txt

adrotate-switch/adrotate-switch.php Passed 13 tests

"AdRotate Switch" version 1.12's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
113 characters long description:
Easily migrate your data from compatible advertising plugins to AdRotate Banner Manager or AdRotate Professional.

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 plugin1,474 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.30
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
▷ Named functions22100.00%
▷ Anonymous functions00.00%
▷ Global constants5100.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
6 PNG files occupy 0.10MB with 0.06MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/buttons/3.png4.08KB2.03KB▼ 50.28%
images/buttons/1.png8.33KB3.44KB▼ 58.73%
images/buttons/2.png7.27KB3.36KB▼ 53.83%
images/logo-60x60.png8.00KB2.55KB▼ 68.12%
images/icon-menu.png4.55KB1.09KB▼ 76.07%