78% super-simple-post-page-restricor

Code Review | Super Simple Post / Page Restrictor

WordPress plugin Super Simple Post / Page Restrictor scored78%from 54 tests.

About plugin

  • Plugin page: super-simple-post...
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.5
  • WordPress version: 6.3.1
  • First release: Jul 19, 2014
  • Latest release: Apr 21, 2016
  • Number of updates: 14
  • Update frequency: every 46.1 days
  • Top authors: arippberger (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

60+ active /3,284 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.31MB] [CPU: ▼19.53ms] Passed 4 tests

This is a short check of server-side resources used by Super Simple Post / Page Restrictor
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.44 ▼0.0230.82 ▼7.68
Dashboard /wp-admin3.31 ▲0.0037.87 ▼11.26
Posts /wp-admin/edit.php3.35 ▼0.0038.04 ▼12.59
Add New Post /wp-admin/post-new.php4.67 ▼1.2140.96 ▼46.58
Media Library /wp-admin/upload.php3.31 ▲0.0836.39 ▲2.91
Super Simple Post / Page Restrictor /wp-admin/options-general.php?page=ss_pp_restrictor3.2532.30

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

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

Browser metrics Passed 4 tests

Super Simple Post / Page Restrictor: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,835 ▲7813.22 ▼1.561.73 ▼0.2441.76 ▼0.55
Dashboard /wp-admin2,210 ▲225.91 ▲1.04101.04 ▼7.3640.96 ▼5.83
Posts /wp-admin/edit.php2,102 ▲132.05 ▲0.0534.49 ▼7.2030.44 ▼5.55
Add New Post /wp-admin/post-new.php1,524 ▲1023.16 ▲5.36617.30 ▼58.2252.82 ▼1.26
Media Library /wp-admin/upload.php1,395 ▲104.20 ▼0.0199.06 ▼0.3242.49 ▲0.42
Super Simple Post / Page Restrictor /wp-admin/options-general.php?page=ss_pp_restrictor9532.0032.1728.37

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=ss_pp_restrictor
    • > Notice in wp-content/plugins/super-simple-post-page-restricor/super-simple-post-page-restrictor-options.php+300
    Trying to access array offset on value of type bool

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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/super-simple-post-page-restricor/super-simple-post-page-restrictor.php:58

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

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
6 plugin tags: login, user login, restrict, restrictor, restrict content...

super-simple-post-page-restricor/super-simple-post-page-restrictor.php 92% from 13 tests

The principal PHP file in "Super Simple Post / Page Restrictor" v. 1.2.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("super-simple-post-page-restricor.php" instead of "super-simple-post-page-restrictor.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
There were no executable files found in this plugin374 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP2127164334
Markdown118034
JavaScript2025
CSS1111

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.59
Average class complexity34.50
▷ Minimum class complexity32.00
▷ Maximum class complexity37.00
Average method complexity3.68
▷ Minimum method complexity1.00
▷ Maximum method complexity23.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods25
▷ Static methods00.00%
▷ Public methods2392.00%
▷ Protected methods00.00%
▷ Private methods28.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/css/chosen-sprite.png0.63KB0.88KB0.00%
assets/css/chosen-sprite@2x.png0.85KB0.83KB▼ 3.10%