84% restrict-content-for-wp-bakery

Code Review | Restrict Content for WP Bakery

WordPress plugin Restrict Content for WP Bakery scored84%from 54 tests.

About plugin

  • Plugin page: restrict-content-...
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.0
  • WordPress version: 6.3.1
  • First release: Jun 29, 2022
  • Latest release: Jun 29, 2022
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: mohan9a (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /513 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.01MB] [CPU: ▼9.02ms] Passed 4 tests

This is a short check of server-side resources used by Restrict Content for WP Bakery
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0140.64 ▼2.20
Dashboard /wp-admin3.35 ▼0.0452.18 ▼16.26
Posts /wp-admin/edit.php3.40 ▲0.0047.11 ▼2.71
Add New Post /wp-admin/post-new.php5.93 ▲0.0085.87 ▼14.91
Media Library /wp-admin/upload.php3.27 ▲0.0036.72 ▲2.51

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Restrict Content for WP Bakery: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,816 ▲7014.25 ▼0.101.98 ▲0.2346.58 ▲0.27
Dashboard /wp-admin2,198 ▲185.61 ▼0.0595.72 ▲5.0941.86 ▲0.87
Posts /wp-admin/edit.php2,100 ▼02.11 ▲0.0834.14 ▼3.4933.13 ▼6.03
Add New Post /wp-admin/post-new.php1,536 ▲1023.24 ▲0.20660.78 ▼36.1561.66 ▲10.67
Media Library /wp-admin/upload.php1,403 ▲64.16 ▼0.0495.98 ▼4.6444.36 ▼2.46

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

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

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/restrict-content-for-wp-bakery/vc-restrict-content-element.php
    • > /wp-content/plugins/restrict-content-for-wp-bakery/wpb-restrict-content.php

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
5 plugin tags: wpbakery, wpbakery content restrict, content restriction, restrict content wpbakery, hide content

restrict-content-for-wp-bakery/wpb-restrict-content.php 85% from 13 tests

The main PHP file in "Restrict Content for WP Bakery" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
Please make the necessary changes and fix the following:
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug
  • Main file name: The principal plugin file should be the same as the plugin slug ("restrict-content-for-wp-bakery.php" instead of "wpb-restrict-content.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin210 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP22649206
CSS1004

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.58
Average class complexity24.00
▷ Minimum class complexity24.00
▷ Maximum class complexity24.00
Average method complexity5.60
▷ Minimum method complexity1.00
▷ Maximum method complexity22.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods5
▷ Static methods480.00%
▷ Public methods5100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/note.png24.06KB9.55KB▼ 60.32%