84% block-admin

Code Review | Block Admin

WordPress plugin Block Admin scored84%from 54 tests.

About plugin

  • Plugin page: block-admin
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.2
  • WordPress version: 6.3.1
  • First release: Sep 22, 2012
  • Latest release: May 31, 2016
  • Number of updates: 5
  • Update frequency: every 269.4 days
  • Top authors: pankajanupam (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /2,184 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
Install script ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.10ms] Passed 4 tests

An overview of server-side resources used by Block Admin
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0036.81 ▼6.83
Dashboard /wp-admin3.31 ▲0.0147.46 ▼6.79
Posts /wp-admin/edit.php3.36 ▲0.0052.94 ▲1.77
Add New Post /wp-admin/post-new.php5.89 ▲0.0084.62 ▼11.28
Media Library /wp-admin/upload.php3.23 ▲0.0033.11 ▲0.52

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
db_upgraded
widget_theysaidso_widget
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for Block Admin
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.26 ▼1.381.68 ▼0.4341.96 ▼2.83
Dashboard /wp-admin2,206 ▲184.83 ▼0.07108.69 ▼8.9140.29 ▼8.69
Posts /wp-admin/edit.php2,089 ▼01.97 ▼0.0538.55 ▲1.4233.84 ▲0.87
Add New Post /wp-admin/post-new.php1,533 ▼023.20 ▼0.08601.00 ▼75.6759.04 ▲3.59
Media Library /wp-admin/upload.php1,388 ▲34.16 ▼0.0499.29 ▼1.8142.77 ▼4.11

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
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% 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)
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/block-admin/block-admin.php:38

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
3 plugin tags: wp-admin, restrict access, admin

block-admin/block-admin.php Passed 13 tests

The main PHP script in "Block Admin" version 1.2 is automatically included on every request by WordPress
66 characters long description:
Allow you to restrict access to the defualt WordPress admin panel.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin10 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP182210

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code1.50
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.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

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected