78% deactivate-users

Code Review | Deactivate WordPress Users

WordPress plugin Deactivate WordPress Users scored78%from 54 tests.

About plugin

  • Plugin page: deactivate-users
  • Plugin version: 1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.1
  • WordPress version: 6.3.1
  • First release: May 21, 2014
  • Latest release: Jun 20, 2014
  • Number of updates: 5
  • Update frequency: every 6.0 days
  • Top authors: ebinnion (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,177 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.14MB] [CPU: ▼7.89ms] Passed 4 tests

An overview of server-side resources used by Deactivate WordPress Users
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.60 ▲0.1441.01 ▲0.71
Dashboard /wp-admin3.44 ▲0.1447.71 ▼8.01
Posts /wp-admin/edit.php3.56 ▲0.2047.48 ▼4.67
Add New Post /wp-admin/post-new.php6.02 ▲0.1484.68 ▼19.59
Media Library /wp-admin/upload.php3.37 ▲0.1440.52 ▲7.33

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 40 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Deactivate WordPress Users
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲9013.24 ▼1.132.13 ▲0.1242.86 ▼5.26
Dashboard /wp-admin2,203 ▲125.89 ▲0.9998.18 ▼6.3840.64 ▲0.14
Posts /wp-admin/edit.php2,089 ▼02.05 ▲0.0335.52 ▲0.9030.45 ▼6.51
Add New Post /wp-admin/post-new.php1,534 ▲123.23 ▲0.01717.04 ▲88.7258.79 ▼0.39
Media Library /wp-admin/upload.php1,385 ▼04.19 ▼0.0394.39 ▼4.4542.79 ▼1.13

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 75% 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 did not uninstall successfully, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/deactivate-users/lib/metabox/tests/phpunit/includes/bootstrap.php
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/deactivate-users/lib/metabox/example-functions.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function apply_filters() in wp-content/plugins/deactivate-users/lib/metabox/init.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/deactivate-users/lib/metabox/tests/phpunit/tests/CMB_Core_Test.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/deactivate-users/deactivate-users.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

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:
  • Plugin Name: Please specify the plugin name on the first line ( === deactivate-users === )
The official readme.txt is a good inspiration

deactivate-users/deactivate-users.php Passed 13 tests

The main PHP script in "Deactivate WordPress Users" version 1.1 is automatically included on every request by WordPress
114 characters long description:
Allows admins to deactivate a user as opposed to deleting a user. Works with web and XML-RPC based authentication.

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
No dangerous file extensions were detected5,274 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript53124032,246
PHP105511,1212,075
CSS26121540
Markdown3880288
Bourne Shell115459
JSON10031
YAML15018
XML10117

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity51.38
▷ Minimum class complexity1.00
▷ Maximum class complexity136.00
Average method complexity3.92
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods138
▷ Static methods3424.64%
▷ Public methods13698.55%
▷ Protected methods21.45%
▷ Private methods00.00%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants266.67%
▷ Class constants133.33%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
14 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/metabox/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
lib/metabox/images/ico-delete.png0.70KB0.72KB0.00%
lib/metabox/images/ui-bg_flat_75_ffffff_40x100.png0.17KB0.08KB▼ 51.12%
lib/metabox/images/ui-icons_888888_256x240.png5.23KB4.11KB▼ 21.49%
lib/metabox/images/ui-bg_glass_55_fbf9ee_1x400.png0.12KB0.14KB0.00%