84% adrotate-switch

Code Review | AdRotate Switch

WordPress plugin AdRotate Switch scored84%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: 6.3.1
  • 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

2 reviews

Install metrics

100+ active /12,988 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.12MB] [CPU: ▼1.59ms] Passed 4 tests

This is a short check of server-side resources used by AdRotate Switch
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1036.91 ▼7.18
Dashboard /wp-admin3.43 ▲0.1351.24 ▲0.73
Posts /wp-admin/edit.php3.48 ▲0.1348.78 ▼1.89
Add New Post /wp-admin/post-new.php6.01 ▲0.1395.06 ▲5.88
Media Library /wp-admin/upload.php3.35 ▲0.1338.02 ▲1.99

Server storage [IO: ▲0.24MB] [DB: ▲0.00MB] 67% from 3 tests

Filesystem and database footprint
Please fix the following
  • Illegal file modification detected: 1 file (4.00KB) outside of "wp-content/plugins/adrotate-switch/" and "wp-content/uploads/"
    • (new file) wp-content/mgd_mirror/mgd_maximinodotpy-gitdown-test-repository
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for AdRotate Switch
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,828 ▲6713.25 ▼1.131.76 ▲0.1243.22 ▲0.57
Dashboard /wp-admin2,222 ▲184.89 ▼0.0097.78 ▼16.1277.13 ▲37.33
Posts /wp-admin/edit.php2,110 ▲102.02 ▼0.0034.45 ▼1.9636.64 ▲1.10
Add New Post /wp-admin/post-new.php1,543 ▼223.33 ▲0.35741.90 ▲65.8356.08 ▲3.15
Media Library /wp-admin/upload.php1,410 ▲134.13 ▼0.0998.76 ▼5.2971.81 ▲25.97

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget

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)
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > 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 | 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 uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Tags: Too many tags (16 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt might help

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

The main file in "AdRotate Switch" v. 1.12 serves as a complement to information provided in readme.txt and as the entry point to the plugin
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 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected1,474 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP163202171,450
CSS16324

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
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
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions22
▷ Named functions22100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
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/icon-menu.png4.55KB1.09KB▼ 76.07%
images/logo-60x60.png8.00KB2.55KB▼ 68.12%
images/buttons/2.png7.27KB3.36KB▼ 53.83%
images/buttons/3.png4.08KB2.03KB▼ 50.28%
images/buttons/1.png8.33KB3.44KB▼ 58.73%