84% jetpack-only-for-admins

Code Review | Admins only Jetpack

WordPress plugin Admins only Jetpack scored84%from 54 tests.

About plugin

  • Plugin page: jetpack-only-for-...
  • Plugin version: 1.2.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7
  • WordPress version: 6.3.1
  • First release: Jan 24, 2013
  • Latest release: Mar 26, 2021
  • Number of updates: 5
  • Update frequency: every 596.6 days
  • Top authors: andrija (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

100+ active /9,552 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼13.27ms] Passed 4 tests

Analyzing server-side resources used by Admins only Jetpack
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0035.88 ▼6.40
Dashboard /wp-admin3.31 ▼0.0447.02 ▼23.46
Posts /wp-admin/edit.php3.36 ▲0.0051.06 ▼4.26
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.72 ▼18.97
Media Library /wp-admin/upload.php3.24 ▲0.0037.31 ▲0.44

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Admins only Jetpack
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.26 ▼0.131.62 ▼0.0041.65 ▲0.50
Dashboard /wp-admin2,195 ▲155.64 ▲0.1092.87 ▼8.6842.94 ▼0.24
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0240.91 ▲0.7037.63 ▲0.12
Add New Post /wp-admin/post-new.php1,526 ▼223.10 ▼0.12661.07 ▼3.6958.30 ▼3.41
Media Library /wp-admin/upload.php1,400 ▼04.25 ▲0.12101.38 ▼10.9343.57 ▼5.46

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

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)
The smoke test was a success, however most plugin functionality was not tested

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 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 add_action() in wp-content/plugins/jetpack-only-for-admins/jetpack-only-for-admins.php:17

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: admin, hide, jetpack, remove

jetpack-only-for-admins/jetpack-only-for-admins.php Passed 13 tests

Analyzing the main PHP file in "Admins only Jetpack" version 1.2.0
46 characters long description:
Hides the Jetpack menu for all non-admin users

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected17 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP151017

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code1.00
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%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
There were not PNG files found in your plugin