90% menu-restrict-for-anonymous-users

Code Review | Menu Restrict for Anonymous users

WordPress plugin Menu Restrict for Anonymous users scored90%from 54 tests.

About plugin

  • Plugin page: menu-restrict-for...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-4.8
  • WordPress version: 6.3.1
  • First release: Jul 19, 2017
  • Latest release: Jul 19, 2017
  • Number of updates: 4
  • Update frequency: every 1.8 days
  • Top authors: mynamevenu24 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /709 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.04MB] [CPU: ▼15.72ms] Passed 4 tests

An overview of server-side resources used by Menu Restrict for Anonymous users
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.40 ▼0.0623.77 ▼18.00
Dashboard /wp-admin3.38 ▲0.0840.74 ▼10.95
Posts /wp-admin/edit.php3.42 ▲0.0646.17 ▲0.91
Add New Post /wp-admin/post-new.php6.06 ▲0.1773.49 ▼34.82
Media Library /wp-admin/upload.php3.32 ▲0.0932.61 ▲1.19

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for Menu Restrict for Anonymous users
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲8213.30 ▼0.951.59 ▼0.4739.25 ▼4.28
Dashboard /wp-admin2,220 ▲294.88 ▼0.99110.60 ▲11.4841.79 ▲3.69
Posts /wp-admin/edit.php2,100 ▲82.06 ▲0.0536.85 ▼3.3033.60 ▼0.72
Add New Post /wp-admin/post-new.php1,526 ▼717.53 ▼3.30635.56 ▲53.7260.57 ▲4.54
Media Library /wp-admin/upload.php1,402 ▲114.18 ▲0.0494.58 ▼4.9641.41 ▲1.41

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though everything seems fine, this is not an exhaustive test

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: menu, anonymous, restrict

menu-restrict-for-anonymous-users/menu-restrict.php 92% from 13 tests

The main PHP file in "Menu Restrict for Anonymous users" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("menu-restrict-for-anonymous-users.php" instead of "menu-restrict.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin114 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP29511295
CSS16219

PHP code Passed 2 tests

This is a very shot review of 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.25
Average class complexity3.00
▷ Minimum class complexity3.00
▷ Maximum class complexity3.00
Average method complexity1.40
▷ Minimum method complexity1.00
▷ Maximum method complexity2.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods00.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
No PNG files were detected