93% only-admins

Code Review | Only Admins

WordPress plugin Only Admins scored 93% from 54 tests.

About plugin

  • Plugin page: only-admins
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.7
  • WordPress version: 5.8.1
  • First release: Jan 4, 2017
  • Latest release: Jan 4, 2017
  • Number of updates: 10
  • Update frequency: every 1.2 days
  • Top authors: pcoitinho (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 449 total downloads

Benchmarks

Plugin footprint Passed 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.00MB] [CPU: ▼132.65ms] Passed 4 tests

This is a short check of server-side resources used by Only Admins
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.0045.59 ▲5.68
Dashboard /wp-admin3.06 ▲0.0165.65 ▲5.50
Posts /wp-admin/edit.php3.11 ▲0.0155.88 ▲8.47
Add New Post /wp-admin/post-new.php5.42 ▼0.01110.94 ▼547.91
Media Library /wp-admin/upload.php3.01 ▲0.0042.61 ▲6.12

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Only Admins
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,703 ▲13116.28 ▲0.6410.40 ▼1.0646.83 ▼1.63
Dashboard /wp-admin2,967 ▲365.92 ▼0.04165.19 ▼0.84125.43 ▲10.51
Posts /wp-admin/edit.php2,739 ▼02.72 ▲0.0183.98 ▲19.0299.96 ▲6.02
Add New Post /wp-admin/post-new.php1,683 ▼018.86 ▲0.08463.16 ▲47.15114.68 ▲0.41
Media Library /wp-admin/upload.php1,807 ▼05.01 ▼0.05181.08 ▲21.88129.52 ▲5.03

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 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 50% from 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
Please fix the following items
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/only-admins/onlyadmins.php

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (Not logged in Error Notice)
The official readme.txt is a good inspiration

only-admins/onlyadmins.php 85% from 13 tests

"Only Admins" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 143 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("only-admins.php" instead of "onlyadmins.php")

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
There were no executable files found in this plugin25 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
Markdown112014
PHP171311

PHP code Passed 2 tests

Analyzing 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 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

PNG files should be compressed to save space and minimize bandwidth usage
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.png12.95KB3.20KB▼ 75.30%