79% incognito-window-detect

Code Review | Incognito Window Detect

WordPress plugin Incognito Window Detect scored79%from 54 tests.

About plugin

  • Plugin page: incognito-window-...
  • Plugin version: 1.3
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.3
  • WordPress version: 6.3.1
  • First release: Jun 7, 2019
  • Latest release: Sep 13, 2023
  • Number of updates: 12
  • Update frequency: every 129.9 days
  • Top authors: samuelsilvapt (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /635 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.65MB] [CPU: ▼6.06ms] Passed 4 tests

Analyzing server-side resources used by Incognito Window Detect
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.77 ▲0.3028.85 ▼15.67
Dashboard /wp-admin4.08 ▲0.7351.92 ▼4.83
Posts /wp-admin/edit.php4.17 ▲0.8152.08 ▲6.51
Add New Post /wp-admin/post-new.php6.67 ▲0.7888.55 ▼10.25
Media Library /wp-admin/upload.php4.01 ▲0.7742.62 ▲9.61

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Incognito Window Detect
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,946 ▲20013.61 ▼1.039.42 ▲7.5036.02 ▼4.48
Dashboard /wp-admin2,237 ▲495.91 ▲1.0298.19 ▼6.8039.88 ▼3.20
Posts /wp-admin/edit.php2,123 ▲342.06 ▲0.0537.67 ▲0.7232.40 ▼3.05
Add New Post /wp-admin/post-new.php1,538 ▲523.40 ▲0.24685.44 ▲6.4257.75 ▲5.55
Media Library /wp-admin/upload.php1,422 ▲314.27 ▲0.0797.95 ▼0.2942.62 ▼0.63

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts

Smoke tests 50% 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 0% 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 fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/incognito-window-detect/admin/partials/incognito-window-detect-admin-display.php
    • > /wp-content/plugins/incognito-window-detect/public/partials/incognito-window-detect-public-display.php
  • 41× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/incognito-window-detect/admin/CMB2/includes/rest-api/CMB2_REST.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/incognito-window-detect/admin/CMB2/includes/types/CMB2_Type_File_Base.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Counter_Base' not found in wp-content/plugins/incognito-window-detect/admin/CMB2/includes/types/CMB2_Type_Text.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/incognito-window-detect/admin/CMB2/cmb2-conditionals/cmb2-conditionals.php:244
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/incognito-window-detect/admin/CMB2/includes/helper-functions.php:131
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/incognito-window-detect/admin/CMB2/includes/types/CMB2_Type_Text_Date.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Picker_Base' not found in wp-content/plugins/incognito-window-detect/admin/CMB2/includes/types/CMB2_Type_Text_Datetime_Timestamp.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Textarea' not found in wp-content/plugins/incognito-window-detect/admin/CMB2/includes/types/CMB2_Type_Textarea_Code.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Base' not found in wp-content/plugins/incognito-window-detect/admin/CMB2/includes/CMB2.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Multicheck' not found in wp-content/plugins/incognito-window-detect/admin/CMB2/includes/types/CMB2_Type_Taxonomy_Multicheck_Hierarchical.php:13

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: private window detect, private mode, incognito window, incognito mode

incognito-window-detect/incognito-window-detect.php Passed 13 tests

The entry point to "Incognito Window Detect" version 1.3 is a PHP file that has certain tags in its header comment area
78 characters long description:
Display a message to users who are accessing the website via a private window.

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
Success! There were no dangerous files found in this plugin54,153 lines of code in 233 files:
LanguageFilesBlank linesComment linesLines of code
PO File12014,31518,50232,323
PHP712,4297,1237,690
JSON1006,435
CSS142531,2104,617
JavaScript104106641,661
Sass17306291,427

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity19.04
▷ Minimum class complexity1.00
▷ Maximum class complexity185.00
Average method complexity3.29
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes77
▷ Abstract classes911.69%
▷ Concrete classes6888.31%
▷ Final classes00.00%
Methods610
▷ Static methods9916.23%
▷ Public methods50883.28%
▷ Protected methods9415.41%
▷ Private methods81.31%
Functions26
▷ Named functions26100.00%
▷ Anonymous functions00.00%
Constants12
▷ Global constants433.33%
▷ Class constants866.67%
▷ Public constants8100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/CMB2/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%
admin/CMB2/images/ui-bg_glass_95_fef1ec_1x400.png0.12KB0.14KB0.00%
admin/CMB2/images/ui-icons_cd0a0a_256x240.png4.27KB4.11KB▼ 3.78%
admin/CMB2/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
admin/CMB2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%