84% legalblink-policy

Code Review | LegalBlink Policy

WordPress plugin LegalBlink Policy scored 84% from 53 tests.

About plugin

  • Plugin page: legalblink-policy
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9-5.7
  • WordPress version: 5.8.1
  • First release: Aug 21, 2020
  • Latest release: Mar 19, 2021
  • Number of updates: 6
  • Update frequency: every 36.3 days
  • Top authors: legalblink (100%)

Code review

53 tests

User reviews

1 review

Install metrics

100+ active / 482 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: ▲1.65MB] [CPU: ▼269.47ms] Passed 4 tests

A check of server-side resources used by LegalBlink Policy
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /4.12 ▲1.4025.97 ▲4.18
Dashboard /wp-admin4.82 ▲1.7653.33 ▲9.11
Posts /wp-admin/edit.php4.86 ▲1.7653.82 ▲13.39
Add New Post /wp-admin/post-new.php7.12 ▲1.69100.95 ▼1,090.00
Media Library /wp-admin/upload.php4.76 ▲1.7538.43 ▼1.18
Privacy Policy /wp-admin/admin.php?page=lbp_tab_privacy_policy8.8467.15
Cache /wp-admin/admin.php?page=lbp_tab_cache_settings8.6760.33
GCS Policy /wp-admin/admin.php?page=lbp_tab_gcs_policy8.8264.91
Advanced Settings /wp-admin/admin.php?page=lbp_tab_advanced_settings8.7865.19
Banner Cookie /wp-admin/admin.php?page=lbp_tab_banner_cookie9.2573.19
Cookie Policy /wp-admin/admin.php?page=lbp_tab_cookie_policy8.8266.37

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 261 new files
Database: no new tables, 2 new options
New WordPress options
LegalblinkPolicy_Plugin__version
LegalblinkPolicy_Plugin__installed

Browser metrics Passed 4 tests

Checking browser requirements for LegalBlink Policy
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,834 ▲25216.42 ▲0.8819.20 ▲11.5551.54 ▲5.40
Dashboard /wp-admin2,981 ▲1315.97 ▲0.09133.94 ▼1.27129.31 ▲28.21
Posts /wp-admin/edit.php2,768 ▲622.70 ▲0.0161.17 ▼7.0887.76 ▼2.81
Add New Post /wp-admin/post-new.php1,629 ▼2821.50 ▲2.70273.41 ▼95.87103.86 ▼12.88
Media Library /wp-admin/upload.php1,772 ▼05.04 ▲0.02130.36 ▼18.34130.68 ▲9.22
Privacy Policy /wp-admin/admin.php?page=lbp_tab_privacy_policy1,6072.7159.98128.35
Cache /wp-admin/admin.php?page=lbp_tab_cache_settings1,2892.7964.9990.65
GCS Policy /wp-admin/admin.php?page=lbp_tab_gcs_policy1,5422.8365.06121.41
Advanced Settings /wp-admin/admin.php?page=lbp_tab_advanced_settings1,4532.8261.26120.10
Banner Cookie /wp-admin/admin.php?page=lbp_tab_banner_cookie3,5814.04105.54207.68
Cookie Policy /wp-admin/admin.php?page=lbp_tab_cookie_policy1,5442.8261.25131.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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 2 options in the database
    • LegalblinkPolicy_Plugin__version
    • LegalblinkPolicy_Plugin__installed

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 215× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Input_Base' not found in wp-content/plugins/legalblink-policy/library/apf/factory/_common/form/input/AdminPageFramework_Input_select.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_FrameworkUtility' not found in wp-content/plugins/legalblink-policy/library/apf/factory/_common/_abstract/_view/AdminPageFramework_TabNavigationBar.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_FrameworkUtility' not found in wp-content/plugins/legalblink-policy/library/apf/factory/_common/_abstract/_model/AdminPageFramework_Property_Base.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_FrameworkUtility' not found in wp-content/plugins/legalblink-policy/library/apf/factory/_common/_abstract/_model/AdminPageFramework_Format_Base.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Form' not found in wp-content/plugins/legalblink-policy/library/apf/factory/post_type/form/AdminPageFramework_Form_post_type.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Form_Utility' not found in wp-content/plugins/legalblink-policy/library/apf/factory/admin_page/_model/delegate/AdminPageFramework_Model__FormSubmission.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_FrameworkUtility' not found in wp-content/plugins/legalblink-policy/library/apf/factory/_common/_abstract/_controller/AdminPageFramework_Resource_Base.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Link_Base' not found in wp-content/plugins/legalblink-policy/library/apf/factory/admin_page/_controller/AdminPageFramework_Link_admin_page.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_FieldType' not found in wp-content/plugins/legalblink-policy/library/apf/factory/_common/form/field_type/AdminPageFramework_FieldType_textarea.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'AdminPageFramework_Form_View___Generate_FlatFieldName' not found in wp-content/plugins/legalblink-policy/library/apf/factory/_common/form/_view/generator/field/AdminPageFramework_Form_View___Generate_FlatFieldInputName.php:7

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Donate link: Invalid URI ("")
  • Tags: The plugin tags were not defined
The official readme.txt is a good inspiration

legalblink-policy/legalblink-policy.php Passed 13 tests

The main PHP script in "LegalBlink Policy" version 1.0.2 is automatically included on every request by WordPress
41 characters long description:
Install LegalBlink services in your site.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin17,773 lines of code in 248 files:
LanguageFilesBlank linesComment linesLines of code
PHP2371,1183,07916,991
PO File1138154386
JavaScript46515353
CSS46728
JSON20015

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity7.24
▷ Minimum class complexity1.00
▷ Maximum class complexity159.00
Average method complexity2.17
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes339
▷ Abstract classes9528.02%
▷ Concrete classes24471.98%
▷ Final classes20.82%
Methods1,806
▷ Static methods25113.90%
▷ Public methods1,02656.81%
▷ Protected methods30216.72%
▷ Private methods47826.47%
Functions6
▷ Named functions583.33%
▷ Anonymous functions116.67%
Constants24
▷ Global constants729.17%
▷ Class constants1770.83%
▷ Public constants17100.00%

Plugin size Passed 1 test

Image compression Passed 1 test

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.05MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/img/logo_c_menu_24.png1.22KB1.32KB0.00%
assets/img/logo_c_menu_16.png0.59KB0.70KB0.00%
assets/img/logo_menu.png3.35KB0.69KB▼ 79.31%
assets/img/logo_main_128.png27.32KB10.38KB▼ 62.02%
assets/img/logo_main_96.png17.17KB6.94KB▼ 59.57%