90% restriction

Code Review | Restriction

WordPress plugin Restriction scored90%from 54 tests.

About plugin

  • Plugin page: restriction
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.7.1
  • WordPress version: 6.3.1
  • First release: Feb 7, 2021
  • Latest release: Jun 25, 2021
  • Number of updates: 4
  • Update frequency: every 35.0 days
  • Top authors: tooltipsorg (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /529 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.10MB] [CPU: ▼6.22ms] Passed 4 tests

An overview of server-side resources used by Restriction
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0742.15 ▼0.83
Dashboard /wp-admin3.42 ▲0.1148.70 ▼0.84
Posts /wp-admin/edit.php3.46 ▲0.1053.50 ▲6.25
Add New Post /wp-admin/post-new.php6.11 ▲0.2277.64 ▼23.50
Media Library /wp-admin/upload.php3.36 ▲0.1332.87 ▲0.31

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Restriction
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.17 ▼0.191.74 ▼0.3743.69 ▼1.62
Dashboard /wp-admin2,211 ▲315.61 ▼0.0396.69 ▲6.8642.52 ▼2.22
Posts /wp-admin/edit.php2,116 ▲132.01 ▲0.0434.53 ▼5.4232.55 ▼1.86
Add New Post /wp-admin/post-new.php1,539 ▲1123.02 ▼0.19630.87 ▼46.8653.45 ▼1.93
Media Library /wp-admin/upload.php1,413 ▲134.17 ▼0.01136.31 ▲28.0261.11 ▲17.75

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
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though no errors were found, this is by no means 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
The SRP test was a success

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 Passed 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
1 plugin tags: restriction

restriction/restriction.php Passed 13 tests

The primary PHP file in "Restriction" version 1.0.5 is used by WordPress to initiate all plugin functionality
49 characters long description:
only logged in user can view your private content

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
No dangerous file extensions were detected436 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP28215436

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.33
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%
Functions10
▷ Named functions10100.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
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/new.png5.78KB1.61KB▼ 72.15%