10% redirect-on-first-login

Code Review | Redirect On First Login

WordPress plugin Redirect On First Login scored10%from 54 tests.

About plugin

  • Plugin page: redirect-on-first...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.7
  • WordPress version: 6.3.1
  • First release: May 8, 2017
  • Latest release: May 8, 2017
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: swadeshswain (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /1,225 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/redirect-on-first-login/lib/rofl-redirect.php+2
    Undefined variable: settings

Server metrics [RAM: ▼1.93MB] [CPU: ▼51.94ms] Passed 4 tests

Analyzing server-side resources used by Redirect On First Login
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.408.81 ▼34.61
Dashboard /wp-admin2.08 ▼1.225.60 ▼43.29
Posts /wp-admin/edit.php2.08 ▼1.285.61 ▼42.68
Add New Post /wp-admin/post-new.php2.08 ▼3.816.93 ▼87.19
Media Library /wp-admin/upload.php2.08 ▼1.155.09 ▼32.37

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 11 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Redirect On First Login
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,801 ▲4014.17 ▼0.181.66 ▼0.4042.24 ▼6.37
Dashboard /wp-admin2,210 ▲425.63 ▲0.0889.49 ▼10.2739.73 ▼5.52
Posts /wp-admin/edit.php2,112 ▲152.02 ▲0.0035.63 ▼1.8837.92 ▲3.01
Add New Post /wp-admin/post-new.php1,538 ▲923.25 ▲0.09669.42 ▼19.1162.97 ▲6.50
Media Library /wp-admin/upload.php1,415 ▲124.22 ▲0.00109.01 ▼4.5351.13 ▲2.86

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/redirect-on-first-login/lib/rofl-redirect.php+2
    Undefined variable: settings
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, 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
Please take a closer look at the following
  • 3× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/redirect-on-first-login/lib/rofl-menu.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/redirect-on-first-login/lib/rofl-setting.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/redirect-on-first-login/lib/rofl-redirect.php:2

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)
No browser errors were detected

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
Attributes that require attention:
  • Tags: There are too many tags (12 tag instead of maximum 10)
You can look at the official readme.txt

redirect-on-first-login/redirect-on-first-login.php Passed 13 tests

The entry point to "Redirect On First Login" version 1.0.0 is a PHP file that has certain tags in its header comment area
84 characters long description:
Standalone functionality to redirect users to a special page on their first login(s)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin105 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP61631105

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.15
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
3 PNG files occupy 0.13MB with 0.06MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/icon.png0.50KB0.50KB0.20%
images/screenshot-1.png65.96KB18.08KB▼ 72.59%
screenshot-1.png65.96KB18.08KB▼ 72.59%