10% policy-genius

Code Review | Privacy Policy Genius

WordPress plugin Privacy Policy Genius scored10%from 54 tests.

About plugin

  • Plugin page: policy-genius
  • Plugin version: 2.0.4
  • PHP compatiblity: 5.6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.4
  • WordPress version: 6.3.1
  • First release: Dec 31, 2016
  • Latest release: Sep 16, 2020
  • Number of updates: 64
  • Update frequency: every 21.1 days
  • Top authors: whassan (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /11,727 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
You still need to fix the following installer errors
  • This plugin did not install gracefully
    • > Warning in wp-includes/class-wp-hook.php+310
    call_user_func_array() expects parameter 1 to be a valid callback, function 'privacy_policy_activate' not found or invalid function name

Server metrics [RAM: ▼1.81MB] [CPU: ▼39.03ms] Passed 4 tests

Analyzing server-side resources used by Privacy Policy Genius
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.15 ▼1.3113.40 ▼27.59
Dashboard /wp-admin2.20 ▼1.1019.05 ▼30.45
Posts /wp-admin/edit.php2.21 ▼1.1520.38 ▼25.31
Add New Post /wp-admin/post-new.php2.20 ▼3.6820.29 ▼72.75
Media Library /wp-admin/upload.php2.21 ▼1.0221.47 ▼12.27
Privacy Guru /wp-admin/options-general.php?page=privacy_guru2.2120.66

Server storage [IO: ▲1.32MB] [DB: ▲0.32MB] Passed 3 tests

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 63 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
can_compress_scripts
db_upgraded
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Privacy Policy Genius
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,928 ▲17113.85 ▼0.443.79 ▲1.3929.99 ▼19.03
Dashboard /wp-admin2,251 ▲604.97 ▼0.93113.59 ▲15.5543.79 ▲4.20
Posts /wp-admin/edit.php2,142 ▲532.34 ▲0.2841.01 ▼0.0238.51 ▲1.84
Add New Post /wp-admin/post-new.php1,549 ▲3517.70 ▲0.08658.75 ▼13.1735.86 ▼27.15
Media Library /wp-admin/upload.php1,439 ▲484.40 ▲0.19103.21 ▲7.1444.89 ▲1.03
Privacy Guru /wp-admin/options-general.php?page=privacy_guru1,4592.6456.7231.96

Uninstaller [IO: ▲0.00MB] [DB: ▲0.32MB] 50% from 4 tests

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/policy-genius/lib/admin/SettingsField.php+20
    Undefined index: value
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=privacy_guru
    • > Notice in wp-content/plugins/policy-genius/lib/admin/SettingsField.php+20
    Undefined index: value
    • > GET request to /wp-admin/options-general.php?page=privacy_guru
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=privacy_guru
    • > Notice in wp-content/plugins/policy-genius/includes/admin/SettingsPage.php+58
    Undefined index: tab

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 fix the following
  • 24× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'smartcat\\admin\\SettingsField' not found in wp-content/plugins/policy-genius/lib/admin/RadioBoxField.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'smartcat\\admin\\SettingsField' not found in wp-content/plugins/policy-genius/includes/admin/CheckBoxGroup.php:8
    • > PHP Fatal error
      Uncaught Error: Interface 'smartcat\\core\\HookSubscriber' not found in wp-content/plugins/policy-genius/lib/admin/SettingsPage.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'privacy_policy_genius\\PrivacyPolicy' not found in wp-content/plugins/policy-genius/templates/template.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'privacy_policy_genius\\admin\\SettingsPage' not found in wp-content/plugins/policy-genius/config/admin_settings.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'smartcat\\core\\AbstractPlugin' not found in wp-content/plugins/policy-genius/includes/PrivacyPolicy.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'smartcat\\admin\\SettingsField' not found in wp-content/plugins/policy-genius/includes/admin/HiddenField.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'smartcat\\admin\\SettingsField' not found in wp-content/plugins/policy-genius/lib/admin/TextField.php:7
    • > PHP Fatal error
      Uncaught Error: Interface 'smartcat\\admin\\ValidationFilter' not found in wp-content/plugins/policy-genius/includes/admin/CharLimitFilter.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'smartcat\\admin\\SettingsField' not found in wp-content/plugins/policy-genius/lib/admin/CheckBoxField.php:7

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=privacy_guru
    • > Network (severe)
    wp-content/plugins/policy-genius/includes//wp-content/plugins/policy-genius/assets/js/admin.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not 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
Attributes that require attention:
  • Tags: There are too many tags (25 tag instead of maximum 10)
You can look at the official readme.txt

policy-genius/plugin.php 85% from 13 tests

The primary PHP file in "Privacy Policy Genius" version 2.0.4 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("policy-genius.php" instead of "plugin.php")
  • Text Domain: The text domain name should consist of only dashes and lowercase characters

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 plugin2,521 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
PHP446413992,107
CSS3240177
JavaScript35133155
JSON20082

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity5.73
▷ Minimum class complexity1.00
▷ Maximum class complexity39.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces8
Interfaces5
Traits0
Classes28
▷ Abstract classes310.71%
▷ Concrete classes2589.29%
▷ Final classes14.00%
Methods129
▷ Static methods1410.85%
▷ Public methods12496.12%
▷ Protected methods21.55%
▷ Private methods32.33%
Functions8
▷ Named functions450.00%
▷ Anonymous functions450.00%
Constants42
▷ Global constants00.00%
▷ Class constants42100.00%
▷ Public constants42100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
6 PNG files occupy 0.44MB with 0.25MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/screenshot-1.PNG31.46KB15.18KB▼ 51.75%
assets/screenshot-3.PNG142.46KB67.03KB▼ 52.95%
assets/banner-772x250.png49.32KB17.86KB▼ 63.79%
assets/screenshot-2.PNG148.59KB68.80KB▼ 53.70%
assets/banner-1544x500.png56.90KB25.17KB▼ 55.77%