84% wp-approve-user

Code Review | WP Approve User

WordPress plugin WP Approve User scored84%from 54 tests.

About plugin

  • Plugin page: wp-approve-user
  • Plugin version: 10...
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.1
  • WordPress version: 6.3.1
  • First release: Jan 30, 2012
  • Latest release: Nov 3, 2022
  • Number of updates: 57
  • Update frequency: every 69.0 days
  • Top authors: obenland (57.89%)kobenland (43.86%)

Code review

54 tests

User reviews

37 reviews

Install metrics

5,000+ active /88,398 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.23MB] [CPU: ▼34,871.44ms] Passed 4 tests

Analyzing server-side resources used by WP Approve User
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.52 ▼0.9543.91 ▼139,459.77
Dashboard /wp-admin3.36 ▲0.0154.34 ▼2.53
Posts /wp-admin/edit.php3.41 ▲0.0151.55 ▼6.26
Add New Post /wp-admin/post-new.php5.94 ▲0.0189.74 ▼17.21
Media Library /wp-admin/upload.php3.28 ▲0.0138.32 ▲3.93

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

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

Browser metrics Passed 4 tests

Checking browser requirements for WP Approve User
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.38 ▼0.241.98 ▲0.4046.31 ▲6.29
Dashboard /wp-admin2,211 ▲315.62 ▼0.0589.06 ▼0.2140.48 ▼4.42
Posts /wp-admin/edit.php2,117 ▲142.01 ▲0.0336.96 ▼2.0839.55 ▲5.10
Add New Post /wp-admin/post-new.php1,537 ▲1123.33 ▲0.50654.53 ▼33.9961.50 ▲9.51
Media Library /wp-admin/upload.php1,416 ▲134.21 ▼0.02102.93 ▼2.1744.80 ▼0.44

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

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
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Obenland_Wp_Plugins_V4' not found in wp-content/plugins/wp-approve-user/class-obenland-wp-approve-user.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-approve-user/wp-approve-user.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-approve-user/noop.php:34
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_die() in wp-content/plugins/wp-approve-user/uninstall.php:10

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)
There were no browser issues 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
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (Error message when user is not yet approved.), #2 (Row action when user is approved), #3 (Row action when user is not yet approved), #4 (Count notification and row highlight for unapproved users)
You can take inspiration from this readme.txt

wp-approve-user/wp-approve-user.php 92% from 13 tests

The principal PHP file in "WP Approve User" v. 10... is loaded by WordPress automatically on each request
It is important to fix the following:
  • Version: Use periods and digits only for your plugin's version number (ex. "1.0.3" instead of "10...")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected1,580 lines of code in 16 files:
LanguageFilesBlank linesComment linesLines of code
PHP5187610763
PO File7253490752
CSS21057
JavaScript2008

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity39.50
▷ Minimum class complexity9.00
▷ Maximum class complexity70.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity7.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods46
▷ Static methods12.17%
▷ Public methods3678.26%
▷ Protected methods919.57%
▷ Private methods12.17%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
5 PNG files occupy 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/twitter.png0.29KB0.28KB▼ 5.37%
screenshot-2.png10.42KB2.51KB▼ 75.93%
screenshot-3.png10.24KB2.43KB▼ 76.25%
screenshot-4.png31.43KB10.15KB▼ 67.70%
screenshot-1.png32.05KB9.48KB▼ 70.43%