83% different-home-for-logged-in-logged-out

Code Review | Different Home for Logged IN & Logged OUT

WordPress plugin Different Home for Logged IN & Logged OUT scored83%from 54 tests.

About plugin

  • Plugin page: different-home-fo...
  • Plugin version: 1.3.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-6.3.1
  • WordPress version: 6.3.1
  • First release: Dec 9, 2022
  • Latest release: Oct 6, 2023
  • Number of updates: 17
  • Update frequency: every 17.8 days
  • Top authors: rajinsharwar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /943 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.41MB] [CPU: ▼10.08ms] Passed 4 tests

A check of server-side resources used by Different Home for Logged IN & Logged OUT
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.5640.76 ▼9.81
Dashboard /wp-admin3.90 ▲0.6053.41 ▼1.17
Posts /wp-admin/edit.php3.96 ▲0.1149.59 ▼5.38
Add New Post /wp-admin/post-new.php6.42 ▲0.5382.78 ▼23.96
Media Library /wp-admin/upload.php3.66 ▲0.4335.84 ▲2.11
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius4.0236.12

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 187 new files
Database: no new tables, 10 new options
New WordPress options
fs_debug_mode
can_compress_scripts
widget_theysaidso_widget
fs_active_plugins
db_upgraded
theysaidso_admin_options
fs_accounts
page_for_logged_in
widget_recent-posts
widget_recent-comments

Browser metrics Passed 4 tests

Different Home for Logged IN & Logged OUT: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,847 ▲8614.72 ▲0.711.94 ▲0.4135.85 ▼9.38
Dashboard /wp-admin2,224 ▲465.58 ▼0.0982.58 ▼29.8640.13 ▼1.87
Posts /wp-admin/edit.php2,139 ▲362.00 ▼0.0132.48 ▼6.8036.68 ▼0.56
Add New Post /wp-admin/post-new.php1,541 ▲1023.34 ▲0.49654.47 ▲35.3866.48 ▲3.56
Media Library /wp-admin/upload.php1,432 ▲384.19 ▼0.0196.92 ▼2.7648.32 ▲7.05
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius1,0631.7025.3725.53

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • widget_recent-posts
    • fs_debug_mode
    • db_upgraded
    • widget_recent-comments
    • widget_theysaidso_widget
    • fs_accounts
    • fs_active_plugins
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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 fix the following
  • 2× 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/different-home-for-logged-in-logged-out/inc/admin-menu-render.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/different-home-for-logged-in-logged-out/diff-home-functions.php:20

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% 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
These attributes need your attention:
  • Screenshots: Add an image for screenshot #1 (Admin View)
You can look at the official readme.txt

different-home-for-logged-in-logged-out/diff-home.php 85% from 13 tests

The main PHP script in "Different Home for Logged IN & Logged OUT" version 1.3.4 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("different-home-for-logged-in-logged-out.php" instead of "diff-home.php")
  • Text Domain: The text domain should only use lowercase characters and dashes

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected33,514 lines of code in 141 files:
LanguageFilesBlank linesComment linesLines of code
PHP1238,01317,22533,077
Markdown1680214
JavaScript33459194
XML13016
CSS130013

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
Please fix the following
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity93.38
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.60
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes48
▷ Abstract classes24.17%
▷ Concrete classes4695.83%
▷ Final classes00.00%
Methods1,259
▷ Static methods19815.73%
▷ Public methods86969.02%
▷ Protected methods171.35%
▷ Private methods37329.63%
Functions104
▷ Named functions10399.04%
▷ Anonymous functions10.96%
Constants145
▷ Global constants9867.59%
▷ Class constants4732.41%
▷ Public constants47100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/vendor/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
inc/vendor/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%