10% wp-protect-admin-login

Code Review | Wordpress Protect Admin

WordPress plugin Wordpress Protect Admin scored10%from 54 tests.

About plugin

  • Plugin page: wp-protect-admin-...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.1
  • WordPress version: 6.3.1
  • First release: Jul 1, 2014
  • Latest release: Jul 1, 2014
  • Number of updates: 3
  • Update frequency: every 1.0 days
  • Top authors: anshulsojatia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,021 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/wp-protect-admin-login/protectadmin.php+14
    Methods with the same name as their class will not be constructors in a future version of PHP; WordpressProtectAdmin has a deprecated constructor

Server metrics [RAM: ▼1.92MB] [CPU: ▼60.77ms] Passed 4 tests

A check of server-side resources used by Wordpress Protect Admin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.08 ▼1.395.78 ▼37.43
Dashboard /wp-admin2.10 ▼1.255.88 ▼57.68
Posts /wp-admin/edit.php2.10 ▼1.265.86 ▼43.94
Add New Post /wp-admin/post-new.php2.10 ▼3.795.55 ▼104.01
Media Library /wp-admin/upload.php2.10 ▼1.136.12 ▼31.67
Protect Admin /wp-admin/options-general.php?page=wordpress-protect-admin2.105.23

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Wordpress Protect Admin
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,818 ▲5714.37 ▲0.092.40 ▲0.3244.38 ▲1.17
Dashboard /wp-admin2,199 ▲195.60 ▼0.0795.96 ▲6.4143.69 ▲7.53
Posts /wp-admin/edit.php2,104 ▲42.03 ▲0.0236.13 ▼8.1934.27 ▼3.48
Add New Post /wp-admin/post-new.php1,548 ▲2223.23 ▲5.54696.53 ▲64.4352.96 ▲3.14
Media Library /wp-admin/upload.php1,404 ▲44.15 ▼0.05111.37 ▲0.3645.20 ▲1.54
Protect Admin /wp-admin/options-general.php?page=wordpress-protect-admin9212.0123.2828.91

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure had uncaught errors
    • > Deprecated in wp-content/plugins/wp-protect-admin-login/protectadmin.php+14
    Methods with the same name as their class will not be constructors in a future version of PHP; WordpressProtectAdmin has a deprecated constructor
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=wordpress-protect-admin
    • > Deprecated in wp-content/plugins/wp-protect-admin-login/protectadmin.php+14
    Methods with the same name as their class will not be constructors in a future version of PHP; WordpressProtectAdmin has a deprecated constructor
    • > GET request to /wp-admin/options-general.php?page=wordpress-protect-admin
    • > Notice in wp-content/plugins/wp-protect-admin-login/settings.php+41
    Undefined variable: msg

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-protect-admin-login/protectadmin.php:104
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/wp-protect-admin-login/settings.php:2

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Plugin Name: "Plugin Name" should be replaced with the name of your plugin on the first line ( === wp-protect-admin-login === )
The official readme.txt might help

wp-protect-admin-login/protectadmin.php 92% from 13 tests

The entry point to "Wordpress Protect Admin" version 1.0 is a PHP file that has certain tags in its header comment area
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("wp-protect-admin-login.php" instead of "protectadmin.php")

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
No dangerous file extensions were detected168 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP22910168

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity4.17
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods6100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There were not PNG files found in your plugin