10% cookies-privacy-policy

Code Review | Cookies and Policy Privacy

WordPress plugin Cookies and Policy Privacy scored 10% from 54 tests.

About plugin

  • Plugin page: cookies-privacy-p...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jun 30, 2022
  • Latest release: Jun 30, 2022
  • Number of updates: 5
  • Update frequency: N/A
  • Top authors: hamid12 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 180 total downloads

Benchmarks

Plugin footprint 58% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Please fix the following installer errors
  • Install procedure had errors
    • > Warning in wp-includes/class-wp-hook.php+312
    call_user_func_array() expects parameter 1 to be a valid callback, function 'cookies_activation_redirect' not found or invalid function name

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

A check of server-side resources used by Cookies and Policy Privacy
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.86 ▼2.14
Dashboard /wp-admin3.33 ▲0.0247.06 ▼17.85
Posts /wp-admin/edit.php3.38 ▲0.0248.80 ▲0.04
Add New Post /wp-admin/post-new.php5.93 ▲0.0493.92 ▼2.42
Media Library /wp-admin/upload.php3.25 ▲0.0237.26 ▲4.09

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 21 new files
Database: 2 new tables, 6 new options
New tables
wp_cookies_color
wp_cookies_content
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for Cookies and Policy Privacy
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,281 ▲53513.74 ▼0.639.36 ▲7.5445.98 ▲5.79
Dashboard /wp-admin2,221 ▲304.96 ▼1.09113.64 ▲12.7439.21 ▼0.94
Posts /wp-admin/edit.php2,104 ▲122.59 ▲0.5439.10 ▼0.2634.04 ▼5.51
Add New Post /wp-admin/post-new.php1,540 ▲2623.79 ▲5.88718.69 ▲114.8358.69 ▲10.95
Media Library /wp-admin/upload.php1,400 ▲124.40 ▲0.1695.62 ▼1.4143.30 ▼0.32

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • widget_recent-comments
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts

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
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/cookies-privacy-policy/includes/register.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
7 plugin tags: cookie, modal, cookies, cookie bar, cookie compliance...

cookies-privacy-policy/cookies.php 92% from 13 tests

The main PHP script in "Cookies and Policy Privacy" version 1.0.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("cookies-privacy-policy.php" instead of "cookies.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
There were no executable files found in this plugin1,990 lines of code in 14 files:
LanguageFilesBlank linesComment linesLines of code
CSS438181,574
PHP7225357
JavaScript36059

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.29
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
Namespaces1
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%
Functions6
▷ Named functions6100.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
5 PNG files occupy 0.11MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/cookies-3.png22.21KB8.16KB▼ 63.27%
img/cookies-4.png13.87KB5.88KB▼ 57.59%
img/cookies-1.png20.54KB7.53KB▼ 63.34%
img/cookies-2.png22.70KB6.73KB▼ 70.33%
img/cookies.png35.88KB14.36KB▼ 59.97%