64% privilege-widget

Code Review | Privilege Widget

WordPress plugin Privilege Widget scored64%from 54 tests.

About plugin

  • Plugin page: privilege-widget
  • Plugin version: 1.7.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-5.0.3
  • WordPress version: 6.3.1
  • First release: May 1, 2014
  • Latest release: Feb 18, 2019
  • Number of updates: 42
  • Update frequency: every 41.8 days
  • Top authors: fuzzguard (100%)

Code review

54 tests

User reviews

1 review

Install metrics

1,000+ active /13,197 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Install script ran successfully

Server metrics [RAM: ▲0.43MB] [CPU: ▼4.39ms] Passed 4 tests

An overview of server-side resources used by Privilege Widget
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.94 ▲0.4843.22 ▲2.56
Dashboard /wp-admin3.78 ▲0.4453.54 ▼15.47
Posts /wp-admin/edit.php3.83 ▲0.4756.03 ▲6.71
Add New Post /wp-admin/post-new.php6.30 ▲0.4192.20 ▼4.79
Media Library /wp-admin/upload.php3.64 ▲0.4140.13 ▲0.16
Install Plugins /wp-admin/plugins.php?page=fuzzguard-plugin-manager3.7135.93

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Privilege Widget
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲5814.28 ▼0.321.87 ▼0.6043.07 ▲1.68
Dashboard /wp-admin2,225 ▲485.64 ▲0.0696.41 ▲2.2841.99 ▼0.49
Posts /wp-admin/edit.php2,142 ▲392.03 ▲0.0340.44 ▲4.3940.13 ▲5.09
Add New Post /wp-admin/post-new.php1,552 ▲2623.63 ▼0.16645.73 ▼49.7258.49 ▲3.72
Media Library /wp-admin/upload.php1,441 ▲414.23 ▲0.04101.27 ▼1.5949.45 ▲1.34
Install Plugins /wp-admin/plugins.php?page=fuzzguard-plugin-manager9742.0525.1730.73

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Compile error in wp-content/plugins/privilege-widget/privWidget.php+42
    Cannot declare class privWidget, because the name is already in use
  • Incomplete uninstall procedure, leaving 10 files (0.15MB) in the plugin directory
    • (new file) lang/privilege-widget-sr_RS.mo
    • (new file) lang/privilege-widget-de_DE.mo
    • (new file) lang/privilege-widget.pot
    • (new file) privWidget.php
    • (new file) lang/privilege-widget-zh_CN.mo
    • (new file) class-tgm-plugin-activation.php
    • (new file) readme.txt
    • (new file) lang/privilege-widget-es_ES.mo
    • (new file) uninstall.php
    • (new file) lang/privilege-widget-fr_FR.mo
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • theysaidso_admin_options
    • 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
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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/privilege-widget/class-tgm-plugin-activation.php:2109

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 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please reduce the number of tags, currently 11 tag instead of maximum 10
You can take inspiration from this readme.txt

privilege-widget/privWidget.php 92% from 13 tests

Analyzing the main PHP file in "Privilege Widget" version 1.7.3
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("privilege-widget.php" instead of "privWidget.php")

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 plugin1,974 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP35531,7511,974

PHP code Passed 2 tests

Analyzing 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.51
Average class complexity46.25
▷ Minimum class complexity1.00
▷ Maximum class complexity206.00
Average method complexity4.42
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods106
▷ Static methods54.72%
▷ Public methods8378.30%
▷ Protected methods2321.70%
▷ Private methods00.00%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There were not PNG files found in your plugin