71% post-restrictor

Code Review | Post Restrictor

WordPress plugin Post Restrictor scored 71% from 54 tests.

About plugin

  • Plugin page: post-restrictor
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress version: 5.8.1
  • First release: Nov 14, 2012
  • Latest release: Jan 31, 2013
  • Number of updates: 23
  • Update frequency: every 3.4 days
  • Top authors: CygnusH33L (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,244 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.91MB] [CPU: ▼170.90ms] Passed 4 tests

This is a short check of server-side resources used by Post Restrictor
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.84 ▲0.1236.50 ▲13.59
Dashboard /wp-admin2.74 ▼0.3232.29 ▼14.06
Posts /wp-admin/edit.php2.74 ▼0.3826.36 ▼31.91
Add New Post /wp-admin/post-new.php2.74 ▼2.7025.22 ▼630.35
Media Library /wp-admin/upload.php2.74 ▼0.2630.31 ▼7.29
Post Restrictor /wp-admin/admin.php?page=postRestrictorOptions2.7426.48

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for Post Restrictor
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲7115.89 ▼0.1511.05 ▲2.1653.99 ▲1.42
Dashboard /wp-admin2,975 ▲445.92 ▼0.15147.57 ▲1.23119.49 ▲5.72
Posts /wp-admin/edit.php2,744 ▲52.71 ▼0.0074.07 ▲2.6493.63 ▼9.79
Add New Post /wp-admin/post-new.php1,686 ▲315.75 ▼2.98429.40 ▲37.74127.04 ▲12.72
Media Library /wp-admin/upload.php1,812 ▲55.04 ▼0.00165.73 ▲12.14130.54 ▲4.88
Post Restrictor /wp-admin/admin.php?page=postRestrictorOptions280.900.0714.11

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
The following items require your attention
  • The plugin did not uninstall gracefully
    • > User deprecated in wp-includes/functions.php+5495
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
    • > GET request to /wp-admin/admin.php?page=postRestrictorOptions
    • > User deprecated in wp-includes/functions.php+5495
    has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 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/post-restrictor/PostRestrictor.php:57

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=postRestrictorOptions
    • > Network (severe)
    wp-admin/admin.php?page=postRestrictorOptions - Failed to load resource: the server responded with a status of 403 (Forbidden)

Optimizations

Plugin configuration 79% from 29 tests

readme.txt 75% 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 need to be fixed:
  • Requires at least: Invalid version format
  • Donate link: Invalid url: ""
  • Plugin Name: Please specify the plugin name on the first line ( === post-restrictor === )
  • Tested up to: Invalid version format
You can take inspiration from this readme.txt

post-restrictor/PostRestrictor.php 85% from 13 tests

Analyzing the main PHP file in "Post Restrictor" version 1.2
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("post-restrictor.php" instead of "PostRestrictor.php")
  • Description: The description should be shorter than 140 characters (currently 150 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Good job! No executable or dangerous file extensions detected30 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1492730

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.80
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%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
There are no PNG files in this plugin