89% simple-page-access-restriction

Code Review | Simple Page Access Restriction

WordPress plugin Simple Page Access Restriction scored89%from 54 tests.

About plugin

  • Plugin page: simple-page-acces...
  • Plugin version: 1.0.19
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.9-6.3
  • WordPress version: 6.3.1
  • First release: Aug 25, 2022
  • Latest release: Aug 11, 2023
  • Number of updates: 23
  • Update frequency: every 15.3 days
  • Top authors: pluginsandsnippets (100%)

Code review

54 tests

User reviews

8 reviews

Install metrics

1,000+ active /5,717 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.10MB] [CPU: ▼11.37ms] Passed 4 tests

An overview of server-side resources used by Simple Page Access Restriction
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1044.52 ▼14.68
Dashboard /wp-admin3.40 ▲0.1053.49 ▼32.85
Posts /wp-admin/edit.php3.52 ▲0.1655.67 ▲9.14
Add New Post /wp-admin/post-new.php6.01 ▲0.1297.47 ▼7.08
Media Library /wp-admin/upload.php3.33 ▲0.1047.56 ▲14.05

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 34 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Simple Page Access Restriction
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,857 ▲11113.20 ▼0.992.10 ▼0.6546.27 ▼15.45
Dashboard /wp-admin2,238 ▲534.93 ▼1.12105.98 ▲2.1385.54 ▲37.86
Posts /wp-admin/edit.php2,121 ▲292.06 ▲0.0640.07 ▲3.7938.32 ▲2.69
Add New Post /wp-admin/post-new.php1,697 ▲18321.75 ▲3.86691.06 ▲77.0435.70 ▼20.13
Media Library /wp-admin/upload.php1,411 ▲294.27 ▲0.05112.01 ▲11.0282.18 ▲33.20

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
You still need to fix the following
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP Passed 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
Everything seems fine, however this is by no means an exhaustive test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% 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 need to be fixed: You can take inspiration from this readme.txt

simple-page-access-restriction/simple-page-access-restriction.php 92% from 13 tests

The main PHP script in "Simple Page Access Restriction" version 1.0.19 is automatically included on every request by WordPress
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 164 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin1,260 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP9180267781
CSS5481265
JavaScript8364192
Markdown119019
SVG1003

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity24.00
▷ Minimum class complexity14.00
▷ Maximum class complexity34.00
Average method complexity2.77
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods26
▷ Static methods27.69%
▷ Public methods2180.77%
▷ Protected methods00.00%
▷ Private methods519.23%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants14100.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
6 compressed PNG files occupy 0.38MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/admin/images/promotions/plugin-edd-advanced-shortcodes.png137.51KB137.55KB0.00%
assets/admin/images/promotions/ebook-marketplace-guide.png60.67KB60.67KB0.00%
assets/admin/images/promotions/ebook-upsell-guide.png11.30KB11.50KB0.00%
assets/admin/images/promotions/plugin-freelancer-marketplace.png65.26KB67.78KB0.00%
assets/admin/images/promotions/plugin-psupsellmaster.png20.03KB21.68KB0.00%