83% simple-restrict-post-access

Code Review | Restrict post access - Simple

WordPress plugin Restrict post access - Simple scored83%from 54 tests.

About plugin

  • Plugin page: simple-restrict-p...
  • Plugin version: 1.0
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.4.2
  • WordPress version: 6.3.1
  • First release: Jun 21, 2020
  • Latest release: Jun 21, 2020
  • Number of updates: 18
  • Update frequency: every 0.3 days
  • Top authors: sachinwpexp (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /389 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▼0.09MB] [CPU: ▼5.24ms] Passed 4 tests

An overview of server-side resources used by Restrict post access - Simple
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.41 ▲2.80
Dashboard /wp-admin3.33 ▲0.0353.27 ▲6.10
Posts /wp-admin/edit.php3.38 ▲0.0344.51 ▼1.97
Add New Post /wp-admin/post-new.php5.46 ▼0.4270.03 ▼19.55
Media Library /wp-admin/upload.php3.25 ▲0.0234.16 ▼2.24

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Restrict post access - Simple: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.35 ▼0.201.73 ▼0.0244.24 ▲5.26
Dashboard /wp-admin2,198 ▲185.65 ▲0.0596.75 ▲12.5041.92 ▲0.99
Posts /wp-admin/edit.php2,100 ▼02.01 ▲0.0136.57 ▲0.8634.34 ▲0.14
Add New Post /wp-admin/post-new.php6,238 ▲4,71226.03 ▲2.99890.33 ▲262.3863.59 ▲12.03
Media Library /wp-admin/upload.php1,397 ▼04.17 ▼0.0399.12 ▼14.5545.26 ▼5.62

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

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)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/simple-restrict-post-access/index.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Attributes that require attention:
  • Donate link: Invalid URI ("sachinsolanki007@gmail.com")
You can look at the official readme.txt

simple-restrict-post-access/index.php 85% from 13 tests

This is the main PHP file of "Restrict post access - Simple" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Main file name: Name the main plugin file the same as the plugin slug ("simple-restrict-post-access.php" instead of "index.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 320 characters long)

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
Everything looks great! No dangerous files found in this plugin118 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1139118

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.41
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%
Functions6
▷ Named functions6100.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
No PNG images were found in this plugin