84% cartograf-cookie-filter

Code Review | Cartograf Cookie filter

WordPress plugin Cartograf Cookie filter scored84%from 54 tests.

About plugin

  • Plugin page: cartograf-cookie-...
  • Plugin version: 1.1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-4.0
  • WordPress version: 6.3.1
  • First release: Jan 12, 2014
  • Latest release: Sep 8, 2014
  • Number of updates: 16
  • Update frequency: every 14.9 days
  • Top authors: versvs (100%)

Code review

54 tests

User reviews

5 reviews

Install metrics

300+ active /6,406 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Install script ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼5.80ms] Passed 4 tests

Analyzing server-side resources used by Cartograf Cookie filter
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0540.65 ▼2.52
Dashboard /wp-admin3.36 ▲0.0151.88 ▼16.68
Posts /wp-admin/edit.php3.47 ▲0.1248.24 ▲0.83
Add New Post /wp-admin/post-new.php5.94 ▲0.05100.18 ▼4.83
Media Library /wp-admin/upload.php3.28 ▲0.0542.39 ▲3.90
Cartograf Cookie-filter Settings /wp-admin/options-general.php?page=cg_cookie_filter3.2534.70

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
cg_cf_accept_scrollout
cg_cf_text
db_upgraded
cg_cf_accept_timeout
widget_recent-posts
can_compress_scripts
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

Cartograf Cookie filter: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,005 ▲24413.45 ▼0.8414.31 ▲12.5650.31 ▲7.25
Dashboard /wp-admin2,199 ▲255.63 ▼0.0484.66 ▼16.5139.24 ▼4.66
Posts /wp-admin/edit.php2,104 ▲72.02 ▲0.0834.55 ▼4.0335.38 ▼0.84
Add New Post /wp-admin/post-new.php1,530 ▼323.31 ▲0.20623.23 ▼49.3252.75 ▼2.09
Media Library /wp-admin/upload.php1,407 ▲74.24 ▲0.04100.52 ▼4.9342.60 ▼6.07
Cartograf Cookie-filter Settings /wp-admin/options-general.php?page=cg_cookie_filter9041.9923.0827.30

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_recent-posts
    • cg_cf_accept_timeout
    • can_compress_scripts
    • cg_cf_accept_scrollout
    • db_upgraded
    • theysaidso_admin_options
    • cg_cf_text
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 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
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cartograf-cookie-filter/settings_page.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cartograf-cookie-filter/settings_page.php:3

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 97% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Screenshots: Add an image for screenshot #1 (Soon to be available screenshot.)
You can look at the official readme.txt

cartograf-cookie-filter/cartograf-cookie-filter.php Passed 13 tests

This is the main PHP file of "Cartograf Cookie filter" version 1.1.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
88 characters long description:
Previene la instalación de cookies previa al consentimiento informado de los visitantes

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
No dangerous file extensions were detected372 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP34225266
JavaScript116180
CSS10026

PHP code Passed 2 tests

A brief analysis 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.11
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%
Functions29
▷ Named functions29100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
logo-cartograf.png20.28KB8.26KB▼ 59.28%