94% cookieconsent-io

Code Review | CookieConsent.io

WordPress plugin CookieConsent.io scored 94% from 54 tests.

About plugin

  • Plugin page: cookieconsent-io
  • Plugin version: 1.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.2
  • WordPress version: 5.8.1
  • First release: Jan 28, 2020
  • Latest release: Sep 18, 2020
  • Number of updates: 11
  • Update frequency: every 21.3 days
  • Top authors: cookieconsentsupport (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 360 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼142.16ms] Passed 4 tests

A check of server-side resources used by CookieConsent.io
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.85 ▲0.1336.82 ▲12.40
Dashboard /wp-admin3.08 ▲0.0237.49 ▼6.95
Posts /wp-admin/edit.php3.13 ▲0.0244.86 ▼3.64
Add New Post /wp-admin/post-new.php5.43 ▼0.0093.33 ▼558.96
Media Library /wp-admin/upload.php3.02 ▲0.0133.20 ▲0.91
CookieConsent.io /wp-admin/tools.php?page=cookie-consent-io-settings2.9928.45

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 4 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

CookieConsent.io: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11215.79 ▲0.3010.58 ▲2.5451.96 ▲1.57
Dashboard /wp-admin2,997 ▲666.06 ▼0.09129.78 ▼14.77124.50 ▲0.78
Posts /wp-admin/edit.php2,744 ▲52.69 ▲0.0071.44 ▲3.1597.48 ▲5.42
Add New Post /wp-admin/post-new.php1,686 ▲18818.73 ▼0.09384.57 ▲2.12117.53 ▲2.33
Media Library /wp-admin/upload.php1,815 ▼75.02 ▲0.01154.68 ▼0.28130.06 ▲1.93
CookieConsent.io /wp-admin/tools.php?page=cookie-consent-io-settings1,1532.0853.9870.45

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
The plugin uninstalled successfully, without leaving any zombie files or tables

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
Everything seems fine, however 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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/cookieconsent-io/cookie-consent-io.php:171

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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: You can take inspiration from this readme.txt

cookieconsent-io/cookie-consent-io.php 92% from 13 tests

The main file in "CookieConsent.io" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("cookieconsent-io.php" instead of "cookie-consent-io.php")

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
There were no executable files found in this plugin110 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP13530110

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.12
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
images/cookie-consent-io-logo.png10.17KB6.20KB▼ 38.98%