84% es-cookie-notice

Code Review | ES Cookie Notice

WordPress plugin ES Cookie Notice scored84%from 54 tests.

About plugin

  • Plugin page: es-cookie-notice
  • Plugin version: 2.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9.5
  • WordPress version: 6.3.1
  • First release: May 9, 2018
  • Latest release: Jul 27, 2018
  • Number of updates: 11
  • Update frequency: every 8.4 days
  • Top authors: Electric Studio (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /800 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼7.30ms] Passed 4 tests

A check of server-side resources used by ES Cookie Notice
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.41 ▼0.0524.92 ▼19.84
Dashboard /wp-admin3.40 ▲0.0946.62 ▼8.79
Posts /wp-admin/edit.php3.52 ▲0.1648.16 ▲0.06
Add New Post /wp-admin/post-new.php5.98 ▲0.0996.52 ▲9.60
Media Library /wp-admin/upload.php3.32 ▲0.0933.81 ▼0.61
ES Cookie Notice Options /wp-admin/options-general.php?page=escn_plugin_options3.3637.97

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

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

Browser metrics Passed 4 tests

A check of browser resources used by ES Cookie Notice
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,029 ▲29413.79 ▼0.5019.88 ▲18.0340.65 ▼8.18
Dashboard /wp-admin2,206 ▲154.88 ▼0.98119.46 ▲15.1844.29 ▲2.00
Posts /wp-admin/edit.php2,095 ▲62.00 ▲0.0139.96 ▼0.5535.37 ▲5.23
Add New Post /wp-admin/post-new.php1,519 ▲517.57 ▼0.19611.04 ▼8.8249.70 ▼2.56
Media Library /wp-admin/upload.php1,394 ▲94.25 ▲0.0698.66 ▼4.0042.17 ▼0.32
ES Cookie Notice Options /wp-admin/options-general.php?page=escn_plugin_options1,7396.87139.2264.45

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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 take a closer look at the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/es-cookie-notice/electric-studio-cookie-notice.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/es-cookie-notice/ajax/escn-ajax.php:84
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/es-cookie-notice/admin/escn-admin.php:9

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
3 plugin tags: cookie, eu cookie law, cookie law

es-cookie-notice/electric-studio-cookie-notice.php 85% from 13 tests

The principal PHP file in "ES Cookie Notice" v. 2.2 is loaded by WordPress automatically on each request
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("es-cookie-notice.php" instead of "electric-studio-cookie-notice.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 335 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Good job! No executable or dangerous file extensions detected809 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP450210452
CSS24814230
JavaScript1924127

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity38.00
▷ Minimum class complexity38.00
▷ Maximum class complexity38.00
Average method complexity3.85
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods13100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/es-logo.png7.48KB3.29KB▼ 56.03%
images/escn-icon-sprite.png1.52KB0.63KB▼ 58.12%