10% free-ccpa-cookie

Code Review | Free CCPA Cookie

WordPress plugin Free CCPA Cookie scored10%from 54 tests.

About plugin

  • Plugin page: free-ccpa-cookie
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-5.7
  • WordPress version: 6.3.1
  • First release: Mar 17, 2021
  • Latest release: Mar 17, 2021
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: merajali294 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /366 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The following installer errors require your attention
  • This plugin did not install gracefully
    • > Notice in wp-content/plugins/free-ccpa-cookie/ccpa-free-cookie.php+57
    Undefined variable: country

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

Server-side resources used by Free CCPA Cookie
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.38127.57 ▲73.41
Dashboard /wp-admin2.11 ▼1.24130.91 ▲69.19
Posts /wp-admin/edit.php2.11 ▼1.25120.18 ▲65.58
Add New Post /wp-admin/post-new.php2.11 ▼3.78143.18 ▲27.85
Media Library /wp-admin/upload.php2.11 ▼1.12126.38 ▲87.25
CCPA for WP /wp-admin/options-general.php?page=ccpa_for_wp2.11125.98

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Free CCPA Cookie
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲8014.75 ▲0.372.35 ▲0.4044.35 ▲2.95
Dashboard /wp-admin2,213 ▲255.88 ▲1.00101.11 ▼11.9138.55 ▲2.67
Posts /wp-admin/edit.php2,093 ▲72.00 ▼0.1441.10 ▲0.9734.40 ▲0.61
Add New Post /wp-admin/post-new.php1,540 ▲721.00 ▼2.18658.26 ▼32.5361.46 ▲3.22
Media Library /wp-admin/upload.php1,395 ▲104.21 ▲0.05101.44 ▼14.6245.65 ▼7.09
CCPA for WP /wp-admin/options-general.php?page=ccpa_for_wp8222.0223.9527.27

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/free-ccpa-cookie/ccpa-free-cookie.php+57
    Undefined variable: country
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/options-general.php?page=ccpa_for_wp
    • > Notice in wp-content/plugins/free-ccpa-cookie/ccpa-free-cookie.php+57
    Undefined variable: country
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=ccpa_for_wp
    • > Notice in wp-content/plugins/free-ccpa-cookie/ccpa-free-cookie.php+237
    Trying to access array offset on value of type bool

SRP Passed 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
4 plugin tags: consent, cookies, compliance, ccpa

free-ccpa-cookie/ccpa-free-cookie.php 77% from 13 tests

Analyzing the main PHP file in "Free CCPA Cookie" version 1.0
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("free-ccpa-cookie.php" instead of "ccpa-free-cookie.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 184 characters long)
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

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
Good job! No executable or dangerous file extensions detected236 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP13915203
JavaScript14029
CSS1104

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.28
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
Namespaces0
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%
Functions13
▷ Named functions13100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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