84% legalweb-cloud

Code Review | LegalWeb Cloud

WordPress plugin LegalWeb Cloud scored84%from 54 tests.

About plugin

  • Plugin page: legalweb-cloud
  • Plugin version: 1.1.1
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-6.3.1
  • WordPress version: 6.3.1
  • First release: Jul 9, 2020
  • Latest release: Sep 7, 2023
  • Number of updates: 43
  • Update frequency: every 27.1 days
  • Top authors: legalweb (100%)

Code review

54 tests

User reviews

1 review

Install metrics

200+ active /3,049 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.12MB] [CPU: ▼9.77ms] Passed 4 tests

Server-side resources used by LegalWeb Cloud
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1041.84 ▼3.86
Dashboard /wp-admin3.42 ▲0.0751.90 ▼20.65
Posts /wp-admin/edit.php3.52 ▲0.1759.15 ▲5.10
Add New Post /wp-admin/post-new.php6.13 ▲0.2592.05 ▼15.23
Media Library /wp-admin/upload.php3.37 ▲0.1542.80 ▲0.67
Common /wp-admin/admin.php?page=legalweb-cloud3.5937.46

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

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

Browser metrics Passed 4 tests

A check of browser resources used by LegalWeb Cloud
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲8014.38 ▲0.011.77 ▼0.3142.15 ▼2.27
Dashboard /wp-admin2,275 ▲954.93 ▼0.7495.80 ▼1.4537.66 ▼5.59
Posts /wp-admin/edit.php2,177 ▲742.47 ▲0.4640.87 ▲2.9437.14 ▲3.50
Add New Post /wp-admin/post-new.php1,559 ▲3317.68 ▲0.03733.27 ▲63.8837.34 ▼18.93
Media Library /wp-admin/upload.php1,480 ▲834.46 ▲0.22109.49 ▲4.3545.42 ▼1.03
Common /wp-admin/admin.php?page=legalweb-cloud1,0511.9329.2780.79

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • db_upgraded
    • 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)
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 18× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/legalweb-cloud/includes/shortcodes/class-legalweb-cloud-content-block-shortcode.php:63
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/legalweb-cloud/includes/shortcodes/class-legalweb-cloud-privacy-policy-shortcode.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'LegalWebCloudAjaxAction' not found in wp-content/plugins/legalweb-cloud/includes/class-legalweb-cloud-api-action.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'LegalWebCloudCron' not found in wp-content/plugins/legalweb-cloud/includes/cron/class-legalweb-cloud-api-cron.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'LegalWebCloudAdminTab' not found in wp-content/plugins/legalweb-cloud/admin/tabs/common-settings/class-legalweb-cloud-common-settings-tab.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/legalweb-cloud/includes/shortcodes/class-legalweb-cloud-contract-terms-shortcode.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/legalweb-cloud/includes/shortcodes/class-legalweb-cloud-seal-shortcode.php:61
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/legalweb-cloud/admin/tabs/common-settings/page.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'LegalWebCloudAjaxAction' not found in wp-content/plugins/legalweb-cloud/admin/tabs/common-settings/class-legalweb-cloud-common-settings-action.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/legalweb-cloud/includes/shortcodes/class-legalweb-cloud-imprint-shortcode.php:32

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
1 plugin tags: wordpress

legalweb-cloud/legalweb-cloud.php Passed 13 tests

The main PHP file in "LegalWeb Cloud" ver. 1.1.1 adds more information about the plugin and also serves as the entry point for this plugin
122 characters long description:
Wordpress Plugin for GDPR/DSGVO, Imprint & Privacy Policy and other legal texts to use with the legalweb.io cloud service.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin2,358 lines of code in 40 files:
LanguageFilesBlank linesComment linesLines of code
PHP335384041,910
PO File174124245
CSS2141989
SVG20278
JavaScript2171236

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.49
Average class complexity10.61
▷ Minimum class complexity1.00
▷ Maximum class complexity29.00
Average method complexity2.70
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes18
▷ Abstract classes211.11%
▷ Concrete classes1688.89%
▷ Final classes00.00%
Methods103
▷ Static methods2928.16%
▷ Public methods9087.38%
▷ Protected methods98.74%
▷ Private methods43.88%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants10
▷ Global constants550.00%
▷ Class constants550.00%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
4 PNG files occupy 0.05MB with 0.03MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
public/images/legalweb.io-icon.png16.62KB8.51KB▼ 48.78%
public/images/legalweb.io-icon-white.png10.45KB5.20KB▼ 50.25%
public/images/legalwebio-icon-white.png10.45KB5.20KB▼ 50.25%
public/images/legalwebio-icon.png16.62KB8.51KB▼ 48.78%