84% version-switcher

Code Review | Version Switcher

WordPress plugin Version Switcher scored84%from 54 tests.

About plugin

  • Plugin page: version-switcher
  • Plugin version: 1.0.2
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-6.1
  • WordPress version: 6.3.1
  • First release: Oct 6, 2020
  • Latest release: Nov 30, 2022
  • Number of updates: 7
  • Update frequency: every 112.2 days
  • Top authors: iqbalrony (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

30+ active /997 total downloads

Benchmarks

Plugin footprint 83% 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼3.34ms] Passed 4 tests

An overview of server-side resources used by Version Switcher
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0738.00 ▼3.56
Dashboard /wp-admin3.38 ▲0.0848.24 ▼3.03
Posts /wp-admin/edit.php3.49 ▲0.1448.16 ▼2.07
Add New Post /wp-admin/post-new.php5.98 ▲0.1087.95 ▼4.71
Media Library /wp-admin/upload.php3.30 ▲0.0836.55 ▲3.13

Server storage [IO: ▲0.02MB] [DB: ▲0.07MB] Passed 3 tests

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 14 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
can_compress_scripts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Version Switcher
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,848 ▲11313.22 ▼1.364.09 ▲2.4340.06 ▼7.98
Dashboard /wp-admin2,229 ▲385.90 ▲1.00110.33 ▲0.7737.08 ▼7.67
Posts /wp-admin/edit.php2,112 ▲232.04 ▲0.0339.92 ▲4.5034.35 ▼0.73
Add New Post /wp-admin/post-new.php1,534 ▼023.31 ▲0.22660.48 ▼7.1760.48 ▲2.70
Media Library /wp-admin/upload.php1,411 ▲294.26 ▲0.0699.29 ▲0.1841.97 ▲1.90

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/version-switcher/inc/command.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/version-switcher/inc/ajax-handler.php:6

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 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
10 plugin tags: version-switch, rollback, switch-version, wp-version-switcher, version-switcher...

version-switcher/version-switcher.php 92% from 13 tests

The principal PHP file in "Version Switcher" v. 1.0.2 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 227 characters long)

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
There were no executable files found in this plugin546 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP9152129426
CSS112061
JavaScript112546
Markdown18013

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity9.00
▷ Minimum class complexity2.00
▷ Maximum class complexity28.00
Average method complexity2.45
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods22
▷ Static methods940.91%
▷ Public methods1881.82%
▷ Protected methods29.09%
▷ Private methods29.09%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
There were not PNG files found in your plugin