89% switcher

Code Review | Switcher

WordPress plugin Switcher scored 89% from 54 tests.

About plugin

  • Plugin page: switcher
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.9.1
  • WordPress version: 6.3.1
  • First release: Nov 24, 2017
  • Latest release: Dec 8, 2017
  • Number of updates: 10
  • Update frequency: every 1.5 days
  • Top authors: kostyatereshchuk (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 932 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼0.21ms] Passed 4 tests

An overview of server-side resources used by Switcher
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0140.39 ▼5.51
Dashboard /wp-admin3.32 ▲0.0147.20 ▲0.89
Posts /wp-admin/edit.php3.37 ▲0.0149.93 ▲0.97
Add New Post /wp-admin/post-new.php5.92 ▲0.03102.43 ▲3.22
Media Library /wp-admin/upload.php3.24 ▲0.0137.04 ▲2.80

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Switcher
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲6413.22 ▼0.752.82 ▲0.7962.29 ▲14.44
Dashboard /wp-admin2,212 ▲245.79 ▲0.88103.52 ▼3.5539.18 ▼2.39
Posts /wp-admin/edit.php2,101 ▲122.00 ▼0.0239.62 ▲1.1031.31 ▲0.09
Add New Post /wp-admin/post-new.php1,533 ▲1323.20 ▼0.29626.70 ▲3.8490.54 ▲41.74
Media Library /wp-admin/upload.php1,403 ▲124.17 ▼0.0699.45 ▼4.8940.90 ▼5.02

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
  • Contributors: Plugin contributors not specified
  • Screenshots: These screenshots need descriptions #1, #2 in switcher/assets to your readme.txt
You can take inspiration from this readme.txt

switcher/switcher.php Passed 13 tests

Analyzing the main PHP file in "Switcher" version 1.2
84 characters long description:
Switcher between the recently viewed admin page and the recently viewed public page.

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
Everything looks great! No dangerous files found in this plugin106 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript28864
PHP1164242

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity4.00
▷ Minimum class complexity4.00
▷ Maximum class complexity4.00
Average method complexity1.60
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods120.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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 are no PNG files in this plugin