79% protect-admin-account

Code Review | Protect Admin

WordPress plugin Protect Admin scored79%from 54 tests.

About plugin

  • Plugin page: protect-admin-acc...
  • Plugin version: 2.0.5
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-6.4.1
  • WordPress version: 6.3.1
  • First release: Jan 12, 2020
  • Latest release: Nov 17, 2023
  • Number of updates: 64
  • Update frequency: every 22.1 days
  • Top authors: keystrokeclick (54.69%)tentenbiz (46.88%)

Code review

54 tests

User reviews

4 reviews

Install metrics

1,000+ active /12,911 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.55MB] [CPU: ▲1.04ms] Passed 4 tests

Server-side resources used by Protect Admin
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /4.07 ▲0.6145.61 ▲5.64
Dashboard /wp-admin3.92 ▲0.6150.83 ▲1.21
Posts /wp-admin/edit.php3.97 ▲0.6153.47 ▲5.76
Add New Post /wp-admin/post-new.php6.44 ▲0.5592.65 ▼8.45
Media Library /wp-admin/upload.php3.68 ▲0.4547.41 ▲14.37
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius4.0435.52

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 190 new files
Database: no new tables, 10 new options
New WordPress options
fs_debug_mode
db_upgraded
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
widget_recent-comments
thp_paa_options
fs_accounts
theysaidso_admin_options
fs_active_plugins

Browser metrics Passed 4 tests

An overview of browser requirements for Protect Admin
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5614.34 ▲0.061.68 ▼0.1528.51 ▼15.77
Dashboard /wp-admin2,211 ▲375.52 ▼0.1492.00 ▼7.0680.38 ▲33.29
Posts /wp-admin/edit.php2,132 ▲321.99 ▲0.0338.24 ▼0.7935.49 ▼2.98
Add New Post /wp-admin/post-new.php1,695 ▲16922.46 ▼0.64714.28 ▲36.0948.35 ▼8.69
Media Library /wp-admin/upload.php1,422 ▲224.07 ▼0.17118.73 ▲10.0955.16 ▲9.29
Freemius Debug [v.2.5.12] /wp-admin/admin.php?page=freemius1,0801.8125.0027.52

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin cannot be uninstalled
    • > Notice in wp-content/plugins/protect-admin-account/freemius/includes/class-freemius.php+8515
    Undefined property: stdClass::$plugins
  • Zombie WordPress options were found after uninstall: 10 options
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-posts
    • thp_paa_options
    • fs_active_plugins
    • fs_debug_mode
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • fs_accounts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

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

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
6 plugin tags: prevent admin deletion, user account, admin account, prevent user edit, protect...

protect-admin-account/index.php 92% from 13 tests

The entry point to "Protect Admin" version 2.0.5 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("protect-admin-account.php" instead of "index.php")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin34,206 lines of code in 141 files:
LanguageFilesBlank linesComment linesLines of code
PHP1238,18517,23433,769
Markdown1680214
JavaScript33459194
XML13016
CSS130013

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Please tend to the following items
  • Class cyclomatic complexity should be reduced to less than 1000 (currently 3,088)
Cyclomatic complexity
Average complexity per logical line of code0.64
Average class complexity93.38
▷ Minimum class complexity1.00
▷ Maximum class complexity3,088.00
Average method complexity4.60
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes48
▷ Abstract classes24.17%
▷ Concrete classes4695.83%
▷ Final classes00.00%
Methods1,259
▷ Static methods19815.73%
▷ Public methods86969.02%
▷ Protected methods171.35%
▷ Private methods37329.63%
Functions126
▷ Named functions12599.21%
▷ Anonymous functions10.79%
Constants147
▷ Global constants10068.03%
▷ Class constants4731.97%
▷ 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
5 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
assets/img/protectadmin-icon.png2.03KB0.69KB▼ 66.14%
freemius/assets/img/protect-admin-account.png3.12KB2.85KB▼ 8.43%
freemius/assets/img/protect-admin-pro.png3.15KB2.85KB▼ 9.48%