89% cc-disable-users

Code Review | CC-Disable-Users

WordPress plugin CC-Disable-Users scored89%from 54 tests.

About plugin

  • Plugin page: cc-disable-users
  • Plugin version: 1.2.2
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.6-5.9.2
  • WordPress version: 6.3.1
  • First release: Jun 19, 2018
  • Latest release: Mar 14, 2022
  • Number of updates: 6
  • Update frequency: every 227.3 days
  • Top authors: ClearcodeHQ (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /865 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed successfully, without throwing any errors or notices

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

Analyzing server-side resources used by CC-Disable-Users
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1141.33 ▼3.55
Dashboard /wp-admin3.41 ▲0.1057.07 ▲7.95
Posts /wp-admin/edit.php3.52 ▲0.1652.30 ▼1.10
Add New Post /wp-admin/post-new.php5.99 ▲0.1097.02 ▼3.32
Media Library /wp-admin/upload.php3.33 ▲0.1034.33 ▼0.43

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 41 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for CC-Disable-Users
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.75 ▲0.401.78 ▼0.0441.48 ▼3.62
Dashboard /wp-admin2,198 ▲215.65 ▼0.0185.61 ▼3.3438.91 ▼4.85
Posts /wp-admin/edit.php2,103 ▼01.97 ▼0.0239.08 ▲0.3133.16 ▼5.40
Add New Post /wp-admin/post-new.php1,526 ▼023.23 ▲0.12659.73 ▼58.0251.91 ▼12.66
Media Library /wp-admin/upload.php1,400 ▲34.17 ▼0.14105.40 ▼5.2444.61 ▲0.40

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
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Looking good! No server-side errors or output on direct access of PHP files

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

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (**User Profile** - Restrict wp-admin access for selected user.), #2 (**Users List** - See which users have disabled accounts.), #3 (**User Login** - Prevent disabled users to login.)
You can look at the official readme.txt

cc-disable-users/plugin.php 92% from 13 tests

The entry point to "CC-Disable-Users" version 1.2.2 is a PHP file that has certain tags in its header comment area
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("cc-disable-users.php" instead of "plugin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected429 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP13122131326
JSON20064
PO File15728
Markdown1508
CSS1003

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity8.60
▷ Minimum class complexity3.00
▷ Maximum class complexity12.00
Average method complexity2.03
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces3
Interfaces0
Traits1
Classes4
▷ Abstract classes125.00%
▷ Concrete classes375.00%
▷ Final classes00.00%
Methods38
▷ Static methods615.79%
▷ Public methods2668.42%
▷ Protected methods1231.58%
▷ Private methods00.00%
Functions2
▷ Named functions00.00%
▷ Anonymous functions2100.00%
Constants2
▷ Global constants00.00%
▷ Class constants2100.00%
▷ Public constants2100.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
3 PNG files occupy 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png12.98KB5.48KB▼ 57.74%
screenshot-3.png12.87KB6.97KB▼ 45.85%
screenshot-1.png18.38KB6.29KB▼ 65.78%