10% tng-accept-cookies

Code Review | TNG Accept Cookies

WordPress plugin TNG Accept Cookies scored10%from 54 tests.

About plugin

  • Plugin page: tng-accept-cookies
  • Plugin version: 0.3.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8.3-3.9
  • WordPress version: 6.3.1
  • First release: Apr 19, 2014
  • Latest release: Apr 21, 2014
  • Number of updates: 15
  • Update frequency: every 0.2 days
  • Top authors: jontng (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,399 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
It is recommended to fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/tng-accept-cookies/tng-accept-cookies.php+170
    Function create_function() is deprecated

Server metrics [RAM: ▼1.91MB] [CPU: ▼52.98ms] Passed 4 tests

Analyzing server-side resources used by TNG Accept Cookies
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.394.80 ▼39.88
Dashboard /wp-admin2.09 ▼1.217.57 ▼42.98
Posts /wp-admin/edit.php2.10 ▼1.266.54 ▼40.67
Add New Post /wp-admin/post-new.php2.09 ▼3.796.27 ▼88.37
Media Library /wp-admin/upload.php2.09 ▼1.135.45 ▼31.94
Accept Cookies /wp-admin/options-general.php?page=tng-accept-cookies2.106.04

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for TNG Accept Cookies
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,976 ▲19013.50 ▼0.8510.80 ▲8.8752.24 ▲6.86
Dashboard /wp-admin2,202 ▲255.61 ▼0.0686.09 ▼2.7741.35 ▼1.78
Posts /wp-admin/edit.php2,107 ▲41.97 ▲0.0336.05 ▲0.1536.76 ▲1.21
Add New Post /wp-admin/post-new.php1,529 ▼523.85 ▲1.02677.03 ▲67.4953.33 ▲10.19
Media Library /wp-admin/upload.php1,398 ▼24.19 ▼0.0297.05 ▼8.1044.39 ▼2.85
Accept Cookies /wp-admin/options-general.php?page=tng-accept-cookies8832.0326.1729.58

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/tng-accept-cookies/tng-accept-cookies.php+170
    Function create_function() is deprecated
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=tng-accept-cookies
    • > Deprecated in wp-content/plugins/tng-accept-cookies/tng-accept-cookies.php+170
    Function create_function() is deprecated
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=tng-accept-cookies
    • > Notice in wp-content/plugins/tng-accept-cookies/inc/accept-cookies-settings.php+164
    Trying to access array offset on value of type bool

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 fix the following items
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/tng-accept-cookies/inc/accept-cookies-settings.php:14

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)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
9 plugin tags: eu regulations, cookie law, eu cookie directive, cookies, eu cookie law...

tng-accept-cookies/tng-accept-cookies.php Passed 13 tests

The principal PHP file in "TNG Accept Cookies" v. 0.3.2 is loaded by WordPress automatically on each request
59 characters long description:
A plugin adding a cookie accept (requeried by Swedish law).

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Success! There were no dangerous files found in this plugin405 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP24480229
PO File11,0632,182106
JavaScript1232170

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity8.00
▷ Minimum class complexity6.00
▷ Maximum class complexity10.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG files were detected