84% theme-per-user

Code Review | Theme per user

WordPress plugin Theme per user scored84%from 54 tests.

About plugin

  • Plugin page: theme-per-user
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.2
  • WordPress version: 6.3.1
  • First release: Mar 5, 2014
  • Latest release: May 22, 2019
  • Number of updates: 20
  • Update frequency: every 95.3 days
  • Top authors: PressLabs (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

70+ active /3,768 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.04MB] [CPU: ▼5.97ms] Passed 4 tests

Server-side resources used by Theme per user
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0436.58 ▼4.12
Dashboard /wp-admin3.34 ▲0.0451.63 ▼4.84
Posts /wp-admin/edit.php3.39 ▲0.0352.74 ▲3.44
Add New Post /wp-admin/post-new.php5.92 ▲0.0393.40 ▼9.09
Media Library /wp-admin/upload.php3.26 ▲0.0335.09 ▼5.83

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Theme per user
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.22 ▼1.051.63 ▲0.0042.20 ▲3.22
Dashboard /wp-admin2,206 ▲214.84 ▼0.03113.82 ▼2.0543.06 ▲3.15
Posts /wp-admin/edit.php2,089 ▼02.03 ▲0.0239.95 ▼1.0334.61 ▼4.92
Add New Post /wp-admin/post-new.php1,533 ▲1323.35 ▲0.05603.76 ▼61.5962.90 ▲1.54
Media Library /wp-admin/upload.php1,388 ▼04.25 ▼0.00101.69 ▼6.3543.92 ▼6.37

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/theme-per-user/theme-per-user.php:42

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed: You can look at the official readme.txt

theme-per-user/theme-per-user.php Passed 13 tests

"Theme per user" version 1.0.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
131 characters long description:
Load one Theme for a specific user. You must set the theme from `User Profile` then logout and login again in order to take effect.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
There were no executable files found in this plugin94 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP1153491
Markdown1103

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 issues
Cyclomatic complexity
Average complexity per logical line of code0.22
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.09MB with 0.06MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/screenshot-1.png87.09KB29.65KB▼ 65.96%