78% do-you-want-cookies

Code Review | DoYouWantCookies

WordPress plugin DoYouWantCookies scored78%from 54 tests.

About plugin

  • Plugin page: do-you-want-cookies
  • Plugin version: 1.1
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.1-5.3
  • WordPress version: 6.3.1
  • First release: Feb 29, 2020
  • Latest release: Mar 2, 2020
  • Number of updates: 5
  • Update frequency: every 0.8 days
  • Top authors: Daschmi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /746 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.99ms] Passed 4 tests

Server-side resources used by DoYouWantCookies
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0538.11 ▲1.68
Dashboard /wp-admin3.31 ▼0.0342.59 ▼15.74
Posts /wp-admin/edit.php3.36 ▲0.0142.93 ▼1.54
Add New Post /wp-admin/post-new.php5.91 ▲0.0385.34 ▼8.11
Media Library /wp-admin/upload.php3.23 ▲0.0132.87 ▼2.55
DoYouWantCookies /wp-admin/options-general.php?page=dywc_settings3.2833.99

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

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

Browser metrics Passed 4 tests

An overview of browser requirements for DoYouWantCookies
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,832 ▲8614.57 ▼0.111.66 ▼0.2242.89 ▼0.59
Dashboard /wp-admin2,231 ▲396.42 ▲1.47123.90 ▲18.7441.25 ▲3.30
Posts /wp-admin/edit.php2,114 ▲253.22 ▲1.2245.88 ▲10.4836.47 ▲4.90
Add New Post /wp-admin/post-new.php1,536 ▲1718.54 ▼4.48659.57 ▼17.6435.60 ▼16.53
Media Library /wp-admin/upload.php1,416 ▲315.64 ▲1.4699.63 ▼1.2442.64 ▼3.10
DoYouWantCookies /wp-admin/options-general.php?page=dywc_settings2,7054.0690.3073.92

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
The following items require your attention
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-posts
    • dywc_json
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Good news, no errors were detected

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× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/do-you-want-cookies/wp_dywc.php:37

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=dywc_settings
    • > Console-api (warning) in wp-content/plugins/do-you-want-cookies//lib/jsoneditor.min.js?ver=6.3.1+16:36373
    Could not find popper jQuery plugin of Bootstrap.
    • > GET request to /wp-admin/options-general.php?page=dywc_settings
    • > Console-api (severe) in wp-content/plugins/do-you-want-cookies//lib/ace.min.js?ver=6.3.1+6:63545
    Unable to infer path to ace from script src," "use ace.config.set('basePath', 'path') to enable dynamic loading of modes and themes" "or with webpack use ace/webpack-resolver
    • > GET request to /wp-admin/options-general.php?page=dywc_settings
    • > Network (severe)
    wp-admin/mode-javascript.js - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 11 tag instead of maximum 10
You can take inspiration from this readme.txt

do-you-want-cookies/wp_dywc.php 92% from 13 tests

"DoYouWantCookies" version 1.1's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: The principal plugin file should be the same as the plugin slug ("do-you-want-cookies.php" instead of "wp_dywc.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
No dangerous file extensions were detected742 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
PHP816245446
CSS141219
Sass14074
JavaScript30233

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.19
Average class complexity3.60
▷ Minimum class complexity1.00
▷ Maximum class complexity12.00
Average method complexity2.62
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes5
▷ Abstract classes5100.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods8
▷ Static methods8100.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions00.00%
▷ Anonymous functions1100.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
4 PNG files occupy 0.23MB with 0.12MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png30.58KB18.66KB▼ 38.99%
screenshot-2.png75.47KB30.60KB▼ 59.46%
screenshot-4.png60.06KB28.72KB▼ 52.19%
screenshot-3.png73.68KB30.54KB▼ 58.55%