10% simple-cookie-control

Code Review | Simple Cookie Control

WordPress plugin Simple Cookie Control scored10%from 54 tests.

About plugin

  • Plugin page: simple-cookie-con...
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.3
  • WordPress version: 6.3.1
  • First release: Oct 29, 2018
  • Latest release: Nov 16, 2019
  • Number of updates: 10
  • Update frequency: every 38.3 days
  • Top authors: sumapress (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

200+ active /2,858 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
These installer errors require your attention
  • Install procedure had errors
    • > Notice in wp-content/plugins/simple-cookie-control/core/class-simple-cookie-control.php+203
    Trying to access array offset on value of type bool

Server metrics [RAM: ▼0.05MB] [CPU: ▼14.30ms] Passed 4 tests

A check of server-side resources used by Simple Cookie Control
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.69 ▲0.2243.01 ▼3.34
Dashboard /wp-admin3.52 ▲0.2149.47 ▼0.73
Posts /wp-admin/edit.php3.63 ▲0.2751.46 ▼7.77
Add New Post /wp-admin/post-new.php5.03 ▼0.8656.96 ▼45.35
Media Library /wp-admin/upload.php3.44 ▲0.2139.48 ▲1.65

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 40 new files
Database: no new tables, 8 new options
New WordPress options
analytics_simple_cookie_control
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
customizer_simple_cookie_control
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Simple Cookie Control
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,951 ▲19013.80 ▼0.8213.66 ▲12.0554.02 ▲9.45
Dashboard /wp-admin2,195 ▲185.48 ▼0.1884.16 ▼3.4837.31 ▼7.03
Posts /wp-admin/edit.php2,100 ▼02.03 ▲0.0340.01 ▲3.5434.70 ▼0.76
Add New Post /wp-admin/post-new.php6,367 ▲4,84127.73 ▲4.43890.92 ▲228.5450.58 ▼8.06
Media Library /wp-admin/upload.php1,403 ▲34.15 ▼0.0495.99 ▼13.6644.59 ▲2.65

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
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
Please take a closer look at the following
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/simple-cookie-control/admin/views/simple-cookie-control-display-shortcode-information.php:19
    • > PHP Warning
      Unterminated comment starting line 1 in wp-content/plugins/simple-cookie-control/core/index.php on line 1
    • > PHP Warning
      Unterminated comment starting line 1 in wp-content/plugins/simple-cookie-control/index.php on line 1
    • > PHP Warning
      Unterminated comment starting line 1 in wp-content/plugins/simple-cookie-control/public/index.php on line 1
    • > PHP Warning
      Unterminated comment starting line 1 in wp-content/plugins/simple-cookie-control/admin/index.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/simple-cookie-control/admin/views/simple-cookie-control-display-internal-analytics.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: cookie law, cookie, gutenberg cookie block, cookie consent, gdpr

simple-cookie-control/simple-cookie-control.php Passed 13 tests

"Simple Cookie Control" version 1.0.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
83 characters long description:
Inform users that your site uses cookies and blocks them until the visitor accepts.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Good job! No executable or dangerous file extensions detected3,011 lines of code in 35 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript153262641,800
PHP142548831,113
CSS411483
Sass23015

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity6.33
▷ Minimum class complexity1.00
▷ Maximum class complexity17.00
Average method complexity1.87
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods55
▷ Static methods35.45%
▷ Public methods4581.82%
▷ Protected methods11.82%
▷ Private methods916.36%
Functions3
▷ Named functions3100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
There were not PNG files found in your plugin