94% wp-cookies-enabler

Code Review | WP Cookies Enabler

WordPress plugin WP Cookies Enabler scored 94% from 54 tests.

About plugin

  • Plugin page: wp-cookies-enabler
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.4.1
  • WordPress version: 5.8.1
  • First release: Oct 10, 2015
  • Latest release: Jan 12, 2016
  • Number of updates: 7
  • Update frequency: every 13.4 days
  • Top authors: filipp8 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

70+ active / 1,387 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼0.02MB] [CPU: ▼186.37ms] Passed 4 tests

A check of server-side resources used by WP Cookies Enabler
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.69 ▼0.1427.84 ▼13.42
Dashboard /wp-admin3.15 ▲0.1039.66 ▼13.17
Posts /wp-admin/edit.php3.21 ▲0.1045.36 ▼14.86
Add New Post /wp-admin/post-new.php5.28 ▼0.1583.69 ▼704.04
Media Library /wp-admin/upload.php3.18 ▲0.1838.20 ▼13.01
Aspect /wp-admin/admin.php?page=wpce-aspect-options3.7443.66
General Settings /wp-admin/admin.php?page=wpce-main-options3.7451.85
Info /wp-admin/admin.php?page=wpce-info3.2444.28

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 355 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by WP Cookies Enabler
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,748 ▲17616.31 ▲0.3515.44 ▲4.3252.35 ▲1.01
Dashboard /wp-admin3,000 ▲635.94 ▼0.08156.62 ▼6.10146.48 ▲20.98
Posts /wp-admin/edit.php2,797 ▲582.73 ▼0.0092.29 ▲6.77102.40 ▲8.68
Add New Post /wp-admin/post-new.php1,710 ▲12918.79 ▲1.31431.88 ▼43.69116.79 ▼56.24
Media Library /wp-admin/upload.php1,791 ▼164.98 ▼0.05148.30 ▼47.97147.29 ▲17.81
Aspect /wp-admin/admin.php?page=wpce-aspect-options1,8074.01121.20179.46
General Settings /wp-admin/admin.php?page=wpce-main-options2,8619.24248.03217.96
Info /wp-admin/admin.php?page=wpce-info1,3263.3384.05124.34

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% 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 items
  • 19× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-cookies-enabler/inc/CMB2/example-functions.php:68
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/wp-cookies-enabler/inc/CMB2/tests/cmb-tests-base.php:10
    • > PHP Fatal error
      require_once(): Failed opening required '/includes/functions.php' (include_path='.:/usr/share/php') in wp-content/plugins/wp-cookies-enabler/inc/CMB2/tests/bootstrap.php on line 24
    • > PHP Notice
      Undefined index: page in wp-content/plugins/wp-cookies-enabler/templates/index.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/wp-cookies-enabler/inc/CMB2/bootstrap.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'WP_UnitTestCase' not found in wp-content/plugins/wp-cookies-enabler/inc/CMB2/tests/cmb-tests-base.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-cookies-enabler/templates/index.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/wp-cookies-enabler/admin-options.php:41
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-cookies-enabler/templates/wpce-doc.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wp-cookies-enabler/templates/wpce-credits.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
10 plugin tags: postscribe, law, js, javascript, cookies...

wp-cookies-enabler/wp-cookies-enabler.php Passed 13 tests

Analyzing the main PHP file in "WP Cookies Enabler" version 1.0.1
125 characters long description:
Easy and lightweight solution to preventively block third-party cookies installed by js and to comply with the EU cookie law.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin89,642 lines of code in 191 files:
LanguageFilesBlank linesComment linesLines of code
XML20047,741
PO File12012,71516,31129,303
PHP301,3992,4465,152
CSS61,0091,0223,934
JavaScript124923121,594
Sass11168231,116
Markdown41640458
YAML290152
JSON300121
Bourne Shell119771

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity26.36
▷ Minimum class complexity1.00
▷ Maximum class complexity113.00
Average method complexity2.74
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes22
▷ Abstract classes14.55%
▷ Concrete classes2195.45%
▷ Final classes00.00%
Methods321
▷ Static methods237.17%
▷ Public methods30795.64%
▷ Protected methods92.80%
▷ Private methods51.56%
Functions37
▷ Named functions37100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants466.67%
▷ Class constants233.33%
▷ Public constants2100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
28 PNG files occupy 0.10MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
inc/CMB2/images/ui-bg_glass_75_e6e6e6_1x400.png0.11KB0.14KB0.00%
inc/CMB2/images/ui-bg_highlight-soft_75_cccccc_1x100.png0.10KB0.17KB0.00%
templates/assets/wpce-script.png2.01KB0.61KB▼ 69.71%
templates/assets/wpce-iframe.png2.01KB0.61KB▼ 69.72%
inc/CMB2/images/ico-delete.png0.70KB0.72KB0.00%