84% visibility-logic-elementor

Code Review | Visibility Logic for Elementor

WordPress plugin Visibility Logic for Elementor scored84%from 54 tests.

About plugin

  • Plugin page: visibility-logic-...
  • Plugin version: 2.3.5.1
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.2
  • WordPress version: 6.3.1
  • First release: Dec 30, 2018
  • Latest release: Jul 7, 2023
  • Number of updates: 75
  • Update frequency: every 22.1 days
  • Top authors: staxwp (62.67%)seventhqueen (38.67%)

Code review

54 tests

User reviews

57 reviews

Install metrics

40,000+ active /340,367 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.39MB] [CPU: ▼1.59ms] Passed 4 tests

Analyzing server-side resources used by Visibility Logic for Elementor
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.89 ▲0.4341.19 ▲3.92
Dashboard /wp-admin3.73 ▲0.4246.92 ▼4.17
Posts /wp-admin/edit.php3.78 ▲0.4249.97 ▲0.54
Add New Post /wp-admin/post-new.php6.25 ▲0.3695.41 ▼4.00
Media Library /wp-admin/upload.php3.59 ▲0.3637.17 ▲1.29

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Visibility Logic for Elementor
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,813 ▲7813.59 ▼0.791.56 ▼0.0238.63 ▼2.08
Dashboard /wp-admin2,216 ▲255.83 ▲0.0297.54 ▼5.4137.70 ▼8.92
Posts /wp-admin/edit.php2,101 ▲121.99 ▼0.0040.25 ▲5.4636.14 ▲3.24
Add New Post /wp-admin/post-new.php1,546 ▲1323.31 ▲0.23656.66 ▲62.4861.93 ▲3.98
Media Library /wp-admin/upload.php1,401 ▲104.24 ▲0.0296.44 ▲1.0542.31 ▲1.56

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
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means 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
The following issues need your attention
  • 5× PHP files trigger server errors when accessed directly:
    • > PHP Warning
      require_once(wp-content/plugins/visibility-logic-elementor/vendor/appsero/client/vendor/tareq1988/wp-php-cs-fixer/loader.php): failed to open stream: No such file or directory in wp-content/plugins/visibility-logic-elementor/vendor/appsero/client/.php-cs-fixer.dist.php on line 3
    • > PHP Fatal error
      require_once(): Failed opening required 'wp-content/plugins/visibility-logic-elementor/vendor/appsero/client/vendor/tareq1988/wp-php-cs-fixer/loader.php' (include_path='.:/usr/share/php') in wp-content/plugins/visibility-logic-elementor/vendor/appsero/client/.php-cs-fixer.dist.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'Stax\\VisibilityLogic\\Plugin' not found in wp-content/plugins/visibility-logic-elementor/core/admin/actions.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'Stax\\VisibilityLogic\\Plugin' not found in wp-content/plugins/visibility-logic-elementor/core/admin/pages/templates/options.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/visibility-logic-elementor/core/admin/layout.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser issues were found

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
6 plugin tags: widget conditions, visibility logic, elementor conditions, elementor, elementor widgets...

visibility-logic-elementor/conditional.php 92% from 13 tests

The primary PHP file in "Visibility Logic for Elementor" version 2.3.5.1 is used by WordPress to initiate all plugin functionality
The following require your attention:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("visibility-logic-elementor.php" instead of "conditional.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin7,034 lines of code in 108 files:
LanguageFilesBlank linesComment linesLines of code
PHP411,1261,7634,829
CSS415217805
JSON200729
JavaScript589367289
Markdown1820255
XML161195
YAML16032

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.50
Average class complexity22.67
▷ Minimum class complexity1.00
▷ Maximum class complexity95.00
Average method complexity3.65
▷ Minimum method complexity1.00
▷ Maximum method complexity52.00
Code structure
Namespaces6
Interfaces0
Traits2
Classes28
▷ Abstract classes00.00%
▷ Concrete classes28100.00%
▷ Final classes27.14%
Methods248
▷ Static methods3313.31%
▷ Public methods17972.18%
▷ Protected methods2811.29%
▷ Private methods4116.53%
Functions6
▷ Named functions233.33%
▷ Anonymous functions466.67%
Constants13
▷ Global constants1184.62%
▷ Class constants215.38%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 compressed PNG files occupy 0.00MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/libs/select2/select2x2.png0.83KB0.77KB▼ 6.15%
assets/libs/select2/select2.png0.60KB0.99KB0.00%