77% wp-consent-receipt

Code Review | WP Consent Receipt

WordPress plugin WP Consent Receipt scored77%from 54 tests.

About plugin

  • Plugin page: wp-consent-receipt
  • Plugin version: 0.28
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.2.2
  • WordPress version: 6.3.1
  • First release: Jun 21, 2016
  • Latest release: Jul 16, 2019
  • Number of updates: 29
  • Update frequency: every 38.6 days
  • Top authors: olivermaerz (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /657 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲1.57MB] [CPU: ▲5.09ms] Passed 4 tests

Server-side resources used by WP Consent Receipt
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /5.03 ▲1.5750.28 ▲9.96
Dashboard /wp-admin4.87 ▲1.5759.20 ▲11.80
Posts /wp-admin/edit.php4.92 ▲1.5750.66 ▲1.52
Add New Post /wp-admin/post-new.php7.45 ▲1.5791.37 ▲1.70
Media Library /wp-admin/upload.php4.79 ▲1.5740.86 ▲7.16
WP Consent Receipt /wp-admin/options-general.php?page=wp_consent_receipt4.7636.58

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 121 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

Checking browser requirements for WP Consent Receipt
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,861 ▲11513.38 ▼1.102.52 ▲0.8546.70 ▲5.05
Dashboard /wp-admin2,210 ▲195.80 ▲0.9295.44 ▼2.4338.37 ▼3.50
Posts /wp-admin/edit.php2,090 ▲12.01 ▼0.0933.27 ▼7.9532.63 ▼3.11
Add New Post /wp-admin/post-new.php1,536 ▼622.08 ▲3.59689.53 ▲82.8857.37 ▲1.39
Media Library /wp-admin/upload.php1,395 ▲74.21 ▼0.0394.30 ▼2.2240.33 ▼3.20
WP Consent Receipt /wp-admin/options-general.php?page=wp_consent_receipt8022.0723.9330.73

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 50% 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 0% 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
Please fix the following
  • 2× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-consent-receipt/php-jwt/tests/bootstrap.php
    • > /wp-content/plugins/wp-consent-receipt/phpseclib/tests/bootstrap.php
  • 52× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'PhpseclibFunctionalTestCase' not found in wp-content/plugins/wp-consent-receipt/phpseclib/tests/Functional/Net/SSH2AgentTest.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Sami\\Store\\ArrayStore' not found in wp-content/plugins/wp-consent-receipt/phpseclib/build/sami.conf.php:4
    • > PHP Fatal error
      Uncaught Error: Class 'PhpseclibTestCase' not found in wp-content/plugins/wp-consent-receipt/phpseclib/tests/Unit/Crypt/RSA/LoadKeyTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PhpseclibTestCase' not found in wp-content/plugins/wp-consent-receipt/phpseclib/tests/Unit/Crypt/BlowfishTest.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'PhpseclibTestCase' not found in wp-content/plugins/wp-consent-receipt/phpseclib/tests/Unit/Math/BigInteger/TestCase.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/wp-consent-receipt/templates/settings.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\RSA\\PKCS' not found in wp-content/plugins/wp-consent-receipt/phpseclib/phpseclib/Crypt/RSA/PKCS1.php:39
    • > PHP Fatal error
      Uncaught Error: Class 'PhpseclibTestCase' not found in wp-content/plugins/wp-consent-receipt/phpseclib/tests/Unit/Net/SSH1Test.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'phpseclib\\Crypt\\Base' not found in wp-content/plugins/wp-consent-receipt/phpseclib/phpseclib/Crypt/Blowfish.php:50
    • > PHP Fatal error
      Uncaught Error: Class 'PhpseclibFunctionalTestCase' not found in wp-content/plugins/wp-consent-receipt/phpseclib/tests/Functional/Net/SSH2Test.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Donate link: Invalid URI found ("")
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === wp-consent-receipt === )
  • Screenshots: Screenshot #1 (Receipt) image required
The official readme.txt is a good inspiration

wp-consent-receipt/wp-consent-receipt.php Passed 13 tests

"WP Consent Receipt" version 0.28's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
36 characters long description:
Consent Receipt Plugin for WordPress

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected23,531 lines of code in 106 files:
LanguageFilesBlank linesComment linesLines of code
PHP834,05112,42022,646
Markdown4840324
PO File35051158
XML51613139
Bourne Shell62538125
JSON200100
Ant14226
JavaScript1507
CSS1106

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
The following items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 104)
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity40.62
▷ Minimum class complexity1.00
▷ Maximum class complexity550.00
Average method complexity4.68
▷ Minimum method complexity1.00
▷ Maximum method complexity104.00
Code structure
Namespaces11
Interfaces0
Traits0
Classes80
▷ Abstract classes78.75%
▷ Concrete classes7391.25%
▷ Final classes00.00%
Methods864
▷ Static methods718.22%
▷ Public methods83596.64%
▷ Protected methods131.50%
▷ Private methods161.85%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants174
▷ Global constants179.77%
▷ Class constants15790.23%
▷ Public constants157100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
PNG images were not found in this plugin