83% wplegalpages

Code Review | Privacy Policy Generator, Terms & Conditions Generator WordPress Plugin : WPLegalPages

WordPress plugin Privacy Policy Generator, Terms & Conditions Generator WordPress Plugin : WPLegalPages scored83%from 54 tests.

About plugin

  • Plugin page: wplegalpages
  • Plugin version: 2.9.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Mar 7, 2014
  • Latest release: Nov 10, 2023
  • Number of updates: 155
  • Update frequency: every 22.8 days
  • Top authors: WPEka Club (52.9%)ruqeebak (32.26%)sandyr (6.45%)smritichaturvedi (5.16%)dhananjaymayane (5.16%)

Code review

54 tests

User reviews

87 reviews

Install metrics

20,000+ active /602,551 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 successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.14MB] [CPU: ▼2.54ms] Passed 4 tests

An overview of server-side resources used by Privacy Policy Generator, Terms & Conditions Generator WordPress Plugin : WPLegalPages
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1836.79 ▼2.99
Dashboard /wp-admin3.47 ▲0.1745.49 ▼3.80
Posts /wp-admin/edit.php3.52 ▲0.1751.74 ▲5.14
Add New Post /wp-admin/post-new.php6.01 ▲0.1284.44 ▼6.19
Media Library /wp-admin/upload.php3.33 ▲0.1035.89 ▲2.83

Server storage [IO: ▲6.69MB] [DB: ▲0.12MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 230 new files
Database: 2 new tables, 27 new options
New tables
wp_lp_popups
wp_legal_pages
New WordPress options
widget_theysaidso_widget
analytics_activation_redirect_wplegalpages
lp_eu_button_text_color
_lp_effective_date_templates_updated
wplegalpages-usage-setup
wplegalpages_free_version
lp_eu_button_color
lp_eu_box_color
lp_general
_lp_templates_updated
...

Browser metrics Passed 4 tests

An overview of browser requirements for Privacy Policy Generator, Terms & Conditions Generator WordPress Plugin : WPLegalPages
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,908 ▲14613.77 ▼0.417.63 ▲5.9336.75 ▼3.81
Dashboard /wp-admin2,210 ▲325.61 ▼0.0984.14 ▼30.1638.13 ▼7.65
Posts /wp-admin/edit.php2,109 ▲91.94 ▼0.0738.34 ▲0.2135.28 ▲2.63
Add New Post /wp-admin/post-new.php1,541 ▲1023.02 ▲0.28624.99 ▼63.1654.63 ▼8.58
Media Library /wp-admin/upload.php1,412 ▲154.17 ▲0.0197.99 ▼11.6741.19 ▼5.23

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The uninstall procedure has failed, leaving 14 options in the database
    • widget_legal_pages
    • widget_recent-posts
    • widget_theysaidso_widget
    • wplegalpages-usage-setup
    • lp_eu_button_text
    • theysaidso_admin_options
    • _lp_effective_date_templates_updated
    • can_compress_scripts
    • widget_recent-comments
    • lp_eu_theme_css
    • ...

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please take a closer look at the following
  • 2× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/wplegalpages/widgets/class-wp-widget-legal-pages.php:21
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wplegalpages/admin/wplegalpages-admin-settings.php:18

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Tags: Too many tags (42 tag instead of maximum 10); only the first 5 tags are used in your directory listing
  • Screenshots: These screenshots do not have images: #1 (Create Legal Page), #2 (Manage Legal Pages), #3 (Configure Settings), #4 (Advanced Settings), #5 (Shortcodes Tab), #6 (Enable Compliances tab), #7 (Affiliate Disclosure)
The official readme.txt might help

wplegalpages/wplegalpages.php Passed 13 tests

The main PHP script in "Privacy Policy Generator, Terms & Conditions Generator WordPress Plugin : WPLegalPages" version 2.9.4 is automatically included on every request by WordPress
122 characters long description:
WPLegalPages is a simple 1 click legal page management plugin. You can quickly add in legal pages to your WordPress sites.

Code Analysis 97% from 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
No dangerous file extensions were detected30,465 lines of code in 108 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript371,5921,86214,578
PHP317762,0849,484
CSS27158463,701
JSON1001,434
SVG300482
HTML700397
PO File1138191371
XML10018

PHP code 50% from 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
It is recommended to fix the following
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 146)
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity84.07
▷ Minimum class complexity1.00
▷ Maximum class complexity629.00
Average method complexity8.41
▷ Minimum method complexity1.00
▷ Maximum method complexity146.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods157
▷ Static methods1610.19%
▷ Public methods13485.35%
▷ Protected methods63.82%
▷ Private methods1710.83%
Functions32
▷ Named functions32100.00%
▷ Anonymous functions00.00%
Constants21
▷ Global constants1990.48%
▷ Class constants29.52%
▷ Public constants2100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
98 PNG files occupy 1.89MB with 0.88MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/js/vue/images/powerful-yet-simple.png2.32KB1.65KB▼ 28.63%
admin/js/vue/wizard_images/gdpr_cookie_policy.png4.28KB2.06KB▼ 51.83%
admin/js/vue/wizard_images/general_disclaimer.png6.31KB2.75KB▼ 56.40%
admin/js/vue/images/help_center.png30.22KB14.03KB▼ 53.57%
admin/images/tooltip-icon.png0.42KB0.24KB▼ 43.12%