10% who-can-see

Code Review | Who Can See

WordPress plugin Who Can See scored10%from 54 tests.

About plugin

  • Plugin page: who-can-see
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.5
  • WordPress version: 6.3.1
  • First release: Feb 17, 2017
  • Latest release: Feb 17, 2017
  • Number of updates: 4
  • Update frequency: every 0.5 days
  • Top authors: inanielhoussain (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /458 total downloads

Benchmarks

Plugin footprint 58% 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
These installer errors require your attention
  • The plugin cannot be installed
    • > Warning in wp-content/plugins/who-can-see/filters/ShowFilter.php+4
    require_once(/../RoleManager.php): failed to open stream: No such file or directory

Server metrics [RAM: ▼0.01MB] [CPU: ▼13.64ms] Passed 4 tests

Analyzing server-side resources used by Who Can See
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0038.54 ▼5.38
Dashboard /wp-admin3.31 ▼0.0448.29 ▼19.94
Posts /wp-admin/edit.php3.36 ▲0.0049.78 ▼4.37
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.87 ▼22.00
Media Library /wp-admin/upload.php3.23 ▲0.0031.23 ▼7.25

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by Who Can See
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.24 ▼0.311.67 ▼0.1441.00 ▼3.63
Dashboard /wp-admin2,195 ▲155.53 ▼0.0290.20 ▲0.1137.04 ▼6.84
Posts /wp-admin/edit.php2,097 ▼02.16 ▲0.1839.33 ▲2.1934.74 ▼1.80
Add New Post /wp-admin/post-new.php1,526 ▼023.11 ▼0.07578.55 ▼83.9552.56 ▼8.77
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.03109.52 ▲2.4149.95 ▲2.39

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

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 fix the following items
  • 8× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Warning
      require_once(/../RoleManager.php): failed to open stream: No such file or directory in wp-content/plugins/who-can-see/filters/ShowFilter.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required '/../RoleManager.php' (include_path='.:/usr/share/php') in wp-content/plugins/who-can-see/filters/HideFilter.php on line 4
    • > PHP Warning
      require_once(/../RoleManager.php): failed to open stream: No such file or directory in wp-content/plugins/who-can-see/filters/ShowFilter.php on line 4
    • > PHP Warning
      require_once(/../RoleManager.php): failed to open stream: No such file or directory in wp-content/plugins/who-can-see/filters/HideFilter.php on line 4
    • > PHP Warning
      require_once(/../RoleManager.php): failed to open stream: No such file or directory in wp-content/plugins/who-can-see/filters/ShowFilter.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required '/../RoleManager.php' (include_path='.:/usr/share/php') in wp-content/plugins/who-can-see/filters/ShowFilter.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required '/../RoleManager.php' (include_path='.:/usr/share/php') in wp-content/plugins/who-can-see/filters/ShowFilter.php on line 4
    • > PHP Fatal error
      require_once(): Failed opening required '/../RoleManager.php' (include_path='.:/usr/share/php') in wp-content/plugins/who-can-see/filters/ShowFilter.php on line 4

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 issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This screenshot shows the button to be used to.), #2 (How the page will be displayed for the selected roles.)
You can take inspiration from this readme.txt

who-can-see/who-can-see.php Passed 13 tests

Analyzing the main PHP file in "Who Can See" version 1.0.0
48 characters long description:
This plugin controls the parts that can be seen.

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 plugin184 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP83279169
JavaScript10012
CSS1003

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity3.86
▷ Minimum class complexity1.00
▷ Maximum class complexity8.00
Average method complexity2.43
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes120.00%
Methods15
▷ Static methods533.33%
▷ Public methods1493.33%
▷ Protected methods00.00%
▷ Private methods16.67%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants4
▷ Global constants00.00%
▷ Class constants4100.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot2.png2.94KB1.95KB▼ 33.81%
editor/icon.png0.20KB0.16KB▼ 22.22%
screenshot1.png1.41KB1.06KB▼ 25.21%
screenshot3.png44.55KB24.13KB▼ 45.82%