78% only-admin-access

Code Review | Only Admin Access

WordPress plugin Only Admin Access scored78%from 54 tests.

About plugin

  • Plugin page: only-admin-access
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.5.1
  • WordPress version: 6.3.1
  • First release: Oct 22, 2020
  • Latest release: Oct 22, 2020
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: startnet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /364 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼12.46ms] Passed 4 tests

Server-side resources used by Only Admin Access
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0637.89 ▼7.55
Dashboard /wp-admin3.41 ▲0.0347.19 ▼15.95
Posts /wp-admin/edit.php3.52 ▲0.1347.39 ▼4.19
Add New Post /wp-admin/post-new.php6.01 ▲0.0983.45 ▼22.13
Media Library /wp-admin/upload.php3.33 ▲0.0735.96 ▼3.17
Only Admin Access /wp-admin/options-general.php?page=only_admin_access_settings3.3131.12

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: no files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
only_admin_access_enable
widget_recent-posts
widget_theysaidso_widget
db_upgraded
only_admin_access_homepage
widget_recent-comments
theysaidso_admin_options
only_admin_access_send404s

Browser metrics Passed 4 tests

Checking browser requirements for Only Admin Access
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,833 ▲6213.66 ▼0.721.83 ▼0.1938.52 ▼9.23
Dashboard /wp-admin2,211 ▲294.86 ▼0.97111.99 ▲6.1544.06 ▼2.10
Posts /wp-admin/edit.php2,094 ▲52.02 ▲0.0035.45 ▼2.6433.96 ▲1.38
Add New Post /wp-admin/post-new.php1,529 ▲1023.31 ▲0.25665.40 ▼19.3653.94 ▼5.49
Media Library /wp-admin/upload.php1,390 ▲24.19 ▲0.0194.71 ▼14.8340.21 ▼5.78
Only Admin Access /wp-admin/options-general.php?page=only_admin_access_settings8422.0327.5929.43

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin does not fully uninstall, leaving 9 options in the database
    • only_admin_access_homepage
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts
    • can_compress_scripts
    • only_admin_access_enable
    • theysaidso_admin_options
    • only_admin_access_send404s
    • db_upgraded

Smoke tests 50% 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)
Good news, no errors were detected

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 take a closer look at the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/only-admin-access/admin/partials/only_admin_access-display-options.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please take a look at the following user-side issues
    • > GET request to /wp-admin/options-general.php?page=only_admin_access_settings
    • > Network (severe)
    wp-content/plugins/only-admin-access/admin/css/only_admin_access-admin.css?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/options-general.php?page=only_admin_access_settings
    • > Network (severe)
    wp-content/plugins/only-admin-access/admin/js/only_admin_access-admin.js?ver=1.0.0 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
3 plugin tags: homepage, redirects, admins

only-admin-access/only_admin_access.php 85% from 13 tests

The main file in "Only Admin Access" v. 1.0.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("only-admin-access.php" instead of "only_admin_access.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected258 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP10126426258

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.13
Average class complexity2.83
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.38
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes00.00%
Methods29
▷ Static methods26.90%
▷ Public methods2586.21%
▷ Protected methods00.00%
▷ Private methods413.79%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
There were not PNG files found in your plugin