84% user-switching-for-woocommerce

Code Review | User Switching for WooCommerce

WordPress plugin User Switching for WooCommerce scored84%from 54 tests.

About plugin

  • Plugin page: user-switching-fo...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.4.1
  • WordPress version: 6.3.1
  • First release: Jun 3, 2020
  • Latest release: Jun 3, 2020
  • Number of updates: 6
  • Update frequency: every 75.3 days
  • Top authors: pluginterritory (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /428 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

Analyzing server-side resources used by User Switching for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.00 ▲0.86
Dashboard /wp-admin3.31 ▲0.0143.86 ▼4.74
Posts /wp-admin/edit.php3.36 ▲0.0140.31 ▼13.05
Add New Post /wp-admin/post-new.php5.89 ▲0.0180.75 ▼20.75
Media Library /wp-admin/upload.php3.23 ▲0.0132.73 ▼1.21

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
db_upgraded

Browser metrics Passed 4 tests

User Switching for WooCommerce: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.25 ▼1.104.76 ▲3.0943.53 ▼0.77
Dashboard /wp-admin2,206 ▲185.85 ▲0.9798.68 ▼11.5539.93 ▼2.84
Posts /wp-admin/edit.php2,089 ▼32.02 ▲0.0233.30 ▼8.3632.85 ▼5.35
Add New Post /wp-admin/post-new.php1,533 ▼1023.43 ▲5.20702.22 ▲88.4260.73 ▲0.66
Media Library /wp-admin/upload.php1,388 ▼04.21 ▲0.0394.76 ▼4.1541.97 ▼1.40

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

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
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
Almost there! Just fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/user-switching-for-woocommerce/user-switching-for-woocommerce.php:21

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

readme.txt Passed 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
1 plugin tags: user switching for woocommerce

user-switching-for-woocommerce/user-switching-for-woocommerce.php 92% from 13 tests

The primary PHP file in "User Switching for WooCommerce" version 1.0 is used by WordPress to initiate all plugin functionality
It is important to fix the following:
  • Requires at least: The required version number did not match the one declared in readme.txt ("3.7" instead of "3.0")

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 detected14 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1122114

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.14
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
PNG images were not found in this plugin