74% user-upgrade-capability

Code Review | User Upgrade Capability

WordPress plugin User Upgrade Capability scored74%from 54 tests.

About plugin

  • Plugin page: user-upgrade-capa...
  • Plugin version: 2.4
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.2.2
  • WordPress version: 6.3.1
  • First release: May 22, 2014
  • Latest release: Jul 6, 2023
  • Number of updates: 97
  • Update frequency: every 34.4 days
  • Top authors: JustinTicktock (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

10+ active /2,637 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.10MB] [CPU: ▲0.68ms] Passed 4 tests

An overview of server-side resources used by User Upgrade Capability
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1035.85 ▼8.00
Dashboard /wp-admin3.40 ▲0.1047.61 ▼6.65
Posts /wp-admin/edit.php3.51 ▲0.1660.83 ▲16.95
Add New Post /wp-admin/post-new.php5.98 ▲0.10108.95 ▲20.57
Media Library /wp-admin/upload.php3.32 ▲0.0937.60 ▲0.43

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for User Upgrade Capability
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲7313.32 ▼1.231.68 ▼0.3739.96 ▼16.73
Dashboard /wp-admin2,214 ▲264.90 ▼0.91119.75 ▲0.3242.76 ▼6.63
Posts /wp-admin/edit.php2,100 ▲111.98 ▼0.0656.02 ▲18.1350.31 ▲17.05
Add New Post /wp-admin/post-new.php1,542 ▲723.24 ▲0.08688.65 ▼24.3056.99 ▲5.84
Media Library /wp-admin/upload.php1,396 ▲84.25 ▼0.05116.55 ▲18.1857.96 ▲15.53

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/user-upgrade-capability/uninstall.php+53
    Undefined variable: meta_value
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

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
The following issues need your attention
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function did_action() in wp-content/plugins/user-upgrade-capability/includes/class-tgm-plugin-activation.php:2130

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: A description for screenshot #4 is required in user-upgrade-capability/assets to your readme.txt
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === user-upgrade-capability === )
You can look at the official readme.txt

user-upgrade-capability/user-upgrade-capability.php Passed 13 tests

Analyzing the main PHP file in "User Upgrade Capability" version 2.4
82 characters long description:
Link multiple network sites/blogs together - Maintain only one site list of users.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin3,216 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP91,0842,2533,216

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity30.65
▷ Minimum class complexity1.00
▷ Maximum class complexity207.00
Average method complexity3.74
▷ Minimum method complexity1.00
▷ Maximum method complexity34.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods184
▷ Static methods2312.50%
▷ Public methods15584.24%
▷ Protected methods2312.50%
▷ Private methods63.26%
Functions9
▷ Named functions9100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants660.00%
▷ Class constants440.00%
▷ Public constants4100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin