68% new-user-approve

Code Review | New User Approve

WordPress plugin New User Approve scored68%from 54 tests.

About plugin

  • Plugin page: new-user-approve
  • Plugin version: 2.5.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Oct 30, 2008
  • Latest release: Oct 4, 2023
  • Number of updates: 317
  • Update frequency: every 17.2 days
  • Top authors: picklewagon (75.71%)wpexpertsio (24.61%)

Code review

54 tests

User reviews

100 reviews

Install metrics

20,000+ active /522,364 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.63MB] [CPU: ▼4.16ms] Passed 4 tests

Analyzing server-side resources used by New User Approve
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /4.14 ▲0.6842.53 ▲1.52
Dashboard /wp-admin4.00 ▲0.6553.85 ▼9.44
Posts /wp-admin/edit.php4.05 ▲0.7050.76 ▲1.72
Add New Post /wp-admin/post-new.php6.54 ▲0.6692.79 ▼9.06
Media Library /wp-admin/upload.php3.76 ▲0.5339.71 ▲0.36
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius4.1340.25

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 270 new files
Database: no new tables, 9 new options
New WordPress options
fs_accounts
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
fs_debug_mode
widget_recent-posts
fs_active_plugins
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by New User Approve
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,863 ▲9213.29 ▼1.081.64 ▼0.3234.59 ▼9.07
Dashboard /wp-admin2,266 ▲754.92 ▲0.04102.20 ▼1.7443.66 ▲0.13
Posts /wp-admin/edit.php2,133 ▲442.05 ▲0.0539.02 ▼7.4439.41 ▼1.30
Add New Post /wp-admin/post-new.php1,543 ▲223.24 ▲4.78677.79 ▲36.1853.13 ▼1.00
Media Library /wp-admin/upload.php1,436 ▲484.23 ▲0.0199.78 ▲0.0945.85 ▲1.12
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,0831.7328.4234.88

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/new-user-approve/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • This plugin does not fully uninstall, leaving 9 options in the database
    • fs_debug_mode
    • fs_active_plugins
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • fs_accounts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 0% 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 fix the following items
  • 1× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/new-user-approve/admin/templates/upgrade.php
  • 12× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      require(../../../includes/bootstrap.php): failed to open stream: No such file or directory in wp-content/plugins/new-user-approve/tests/bootstrap.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function NewUserApproveZapier\\add_action() in wp-content/plugins/new-user-approve/includes/zapier/includes/rest-api.php:29
    • > PHP Fatal error
      require(): Failed opening required '../../../includes/bootstrap.php' (include_path='.:/usr/share/php') in wp-content/plugins/new-user-approve/tests/bootstrap.php on line 21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function NewUserApproveZapier\\plugin_dir_path() in wp-content/plugins/new-user-approve/includes/zapier/zapier.php:36
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/new-user-approve/includes/invitation-code.php:48
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/new-user-approve/tests/test-users.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function NewUserApproveZapier\\add_action() in wp-content/plugins/new-user-approve/includes/zapier/includes/user.php:27
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/new-user-approve/includes/plugins.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/new-user-approve/includes/admin-approve.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/new-user-approve/includes/user-list.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: user management, user registration, user approval, registration, users

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

"New User Approve" version 2.5.2's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 243 characters long)

Code Analysis 97% from 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
There were no executable files found in this plugin58,003 lines of code in 197 files:
LanguageFilesBlank linesComment linesLines of code
PHP1348,64018,05736,844
PO File378,68910,58420,123
JavaScript76297473
CSS14633253
Markdown1680214
Bourne Shell110642
JSON10027
XML10014
YAML14013

PHP code 50% from 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of classes should be reduced to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity83.61
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.47
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes57
▷ Abstract classes23.51%
▷ Concrete classes5596.49%
▷ Final classes00.00%
Methods1,387
▷ Static methods20514.78%
▷ Public methods99271.52%
▷ Protected methods171.23%
▷ Private methods37827.25%
Functions129
▷ Named functions12899.22%
▷ Anonymous functions10.78%
Constants146
▷ Global constants9967.81%
▷ Class constants4732.19%
▷ Public constants47100.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.03MB with 0.01MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/templates/image/new-user-logo.png2.68KB2.78KB0.00%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/new-user-approve.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%