83% visibility-control-for-learndash

Code Review | Visibility Control for LearnDash

WordPress plugin Visibility Control for LearnDash scored 83% from 54 tests.

About plugin

  • Plugin page: visibility-contro...
  • Plugin version: 1.7
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.2.2
  • WordPress version: 6.3.1
  • First release: Aug 28, 2019
  • Latest release: Jun 5, 2023
  • Number of updates: 35
  • Update frequency: every 39.4 days
  • Top authors: liveaspankaj (100%)

Code review

54 tests

User reviews

10 reviews

Install metrics

1,000+ active / 10,212 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼3.18ms] 75% from 4 tests

This is a short check of server-side resources used by Visibility Control for LearnDash
It is recommended to improve the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 3,812.69ms on /wp-admin/admin.php?page=grassblade-addons)
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.76 ▼1.38
Dashboard /wp-admin3.33 ▲0.0344.61 ▼4.17
Posts /wp-admin/edit.php3.44 ▲0.0947.21 ▼0.24
Add New Post /wp-admin/post-new.php5.91 ▲0.0384.44 ▼6.94
Media Library /wp-admin/upload.php3.25 ▲0.0334.68 ▲3.75
GrassBlade /wp-admin/admin.php?page=grassblade-lrs-settings3.2031.54
Visibility Control for LearnDash /wp-admin/admin.php?page=grassblade-visibility-control-learndash3.2229.00
Add-ons /wp-admin/admin.php?page=grassblade-addons3.443,812.69

Server storage [IO: ▲0.07MB] [DB: ▲0.03MB] Passed 3 tests

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

Browser metrics Passed 4 tests

A check of browser resources used by Visibility Control for LearnDash
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,830 ▲9513.60 ▼0.751.59 ▼0.0440.89 ▼0.12
Dashboard /wp-admin2,236 ▲485.89 ▲1.0298.93 ▼8.0275.95 ▲31.24
Posts /wp-admin/edit.php2,122 ▲332.01 ▼0.0137.39 ▼2.8934.73 ▲0.17
Add New Post /wp-admin/post-new.php1,548 ▲1223.15 ▼0.18713.01 ▲28.5964.56 ▲5.61
Media Library /wp-admin/upload.php1,418 ▲334.09 ▼0.0897.65 ▼4.2775.11 ▲30.89
GrassBlade /wp-admin/admin.php?page=grassblade-lrs-settings8322.0126.0824.66
Visibility Control for LearnDash /wp-admin/admin.php?page=grassblade-visibility-control-learndash7922.0326.8323.41
Add-ons /wp-admin/admin.php?page=grassblade-addons2,8162.1730.1169.71

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The following items require your attention
  • Zombie WordPress options were found after uninstall: 9 options
    • visibility_control_for_learndash
    • widget_recent-comments
    • grassblade_free_addons
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • grassblade_addons
    • widget_recent-posts

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
Good news, no errors were detected

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
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/visibility-control-for-learndash/visibility_control_for_learndash.php:17

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 issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Donate link: Invalid url: ""
Please take inspiration from this readme.txt

visibility-control-for-learndash/visibility_control_for_learndash.php 85% from 13 tests

The main PHP script in "Visibility Control for LearnDash" version 1.7 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 1055 characters long)
  • Main file name: The principal plugin file should be the same as the plugin slug ("visibility-control-for-learndash.php" instead of "visibility_control_for_learndash.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected651 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP212430651

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.76
Average class complexity85.00
▷ Minimum class complexity54.00
▷ Maximum class complexity116.00
Average method complexity9.00
▷ Minimum method complexity1.00
▷ Maximum method complexity47.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods21
▷ Static methods00.00%
▷ Public methods21100.00%
▷ Protected methods00.00%
▷ Private methods00.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

PNG files should be compressed to save space and minimize bandwidth usage
3 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/icon_30x30.png4.58KB1.60KB▼ 65.15%
img/icon-gb.png3.43KB0.84KB▼ 75.48%
img/icon_128x128.png22.67KB6.87KB▼ 69.71%