84% different-theme-to-logged-in-users

Code Review | KM Different theme to logged in users

WordPress plugin KM Different theme to logged in users scored84%from 54 tests.

About plugin

  • Plugin page: different-theme-t...
  • Plugin version: 1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.6.0
  • WordPress version: 6.3.1
  • First release: Feb 28, 2017
  • Latest release: Mar 9, 2017
  • Number of updates: 25
  • Update frequency: every 0.3 days
  • Top authors: karlosuccess (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /848 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼0.00MB] [CPU: ▼7.84ms] Passed 4 tests

This is a short check of server-side resources used by KM Different theme to logged in users
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0139.31 ▼2.68
Dashboard /wp-admin3.31 ▼0.0347.72 ▼19.58
Posts /wp-admin/edit.php3.36 ▲0.0149.71 ▼2.60
Add New Post /wp-admin/post-new.php5.89 ▲0.0195.40 ▼6.49
Media Library /wp-admin/upload.php3.24 ▲0.0138.30 ▲3.38

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for KM Different theme to logged in users
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7013.25 ▼1.155.19 ▲3.4841.60 ▼2.02
Dashboard /wp-admin2,219 ▲374.84 ▼1.02104.13 ▼4.5141.25 ▼6.98
Posts /wp-admin/edit.php2,105 ▲162.01 ▼0.0039.86 ▲3.9435.08 ▼2.18
Add New Post /wp-admin/post-new.php1,542 ▲2318.64 ▼4.50688.07 ▲4.0465.87 ▲2.04
Media Library /wp-admin/upload.php1,404 ▲164.20 ▼0.0199.93 ▼6.0445.04 ▲0.36

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

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
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/different-theme-to-logged-in-users/km-theme-switch.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/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
3 plugin tags: logged out, theme switch, logged in

different-theme-to-logged-in-users/km-theme-switch.php 92% from 13 tests

The main PHP script in "KM Different theme to logged in users" version 1.9 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("different-theme-to-logged-in-users.php" instead of "km-theme-switch.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin50 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1221650

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.19
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%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin