84% hide-content-by-role-for-wpbakery

Code Review | Hide Content by User Role for WPBakery

WordPress plugin Hide Content by User Role for WPBakery scored84%from 54 tests.

About plugin

  • Plugin page: hide-content-by-r...
  • Plugin version: 1.2.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Nov 26, 2019
  • Latest release: Feb 3, 2023
  • Number of updates: 15
  • Update frequency: every 77.9 days
  • Top authors: wpterra (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

1,000+ active /7,891 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by Hide Content by User Role for WPBakery
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0143.48 ▼0.81
Dashboard /wp-admin3.32 ▲0.0248.72 ▼3.10
Posts /wp-admin/edit.php3.37 ▲0.0145.39 ▼5.55
Add New Post /wp-admin/post-new.php5.90 ▲0.0184.46 ▼5.94
Media Library /wp-admin/upload.php3.24 ▲0.0135.77 ▼3.97

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

Hide Content by User Role for WPBakery: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.17 ▼0.551.68 ▼0.0542.87 ▼0.54
Dashboard /wp-admin2,195 ▲255.49 ▼0.1485.87 ▼10.1939.00 ▼6.94
Posts /wp-admin/edit.php2,100 ▼31.97 ▼0.0134.85 ▼6.2034.76 ▼4.11
Add New Post /wp-admin/post-new.php1,526 ▼522.93 ▼0.14644.18 ▼33.9159.15 ▲6.57
Media Library /wp-admin/upload.php1,403 ▲34.22 ▼0.0294.91 ▼16.7345.40 ▼2.01

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
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

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
Almost there! Just fix the following items
  • 4× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/hide-content-by-role-for-wpbakery/hide-content-by-role-for-wpbakery.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/hide-content-by-role-for-wpbakery/include/frontend.php:16
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hide-content-by-role-for-wpbakery/include/admin.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function hcbrwpb\\integrations\\add_action() in wp-content/plugins/hide-content-by-role-for-wpbakery/integrations/salient.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: show, hide, wpbakery, page, post

hide-content-by-role-for-wpbakery/hide-content-by-role-for-wpbakery.php 92% from 13 tests

The main file in "Hide Content by User Role for WPBakery" v. 1.2.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin137 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP56438137

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity4.50
▷ Minimum class complexity2.00
▷ Maximum class complexity8.00
Average method complexity2.56
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods9
▷ Static methods222.22%
▷ Public methods9100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.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
PNG images were not found in this plugin