79% cookiegenie

Code Review | CookieGenie

WordPress plugin CookieGenie scored79%from 54 tests.

About plugin

  • Plugin page: cookiegenie
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 5.9.3-6.0
  • WordPress version: 6.3.1
  • First release: Apr 26, 2022
  • Latest release: Jun 21, 2022
  • Number of updates: 7
  • Update frequency: every 10.0 days
  • Top authors: graphicgenie (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active /342 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
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.27MB] [CPU: ▼4.52ms] Passed 4 tests

A check of server-side resources used by CookieGenie
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.73 ▲0.2644.25 ▲8.22
Dashboard /wp-admin3.63 ▲0.2848.30 ▼8.82
Posts /wp-admin/edit.php3.68 ▲0.3250.68 ▲5.57
Add New Post /wp-admin/post-new.php6.14 ▲0.2680.18 ▼16.69
Media Library /wp-admin/upload.php3.49 ▲0.2635.83 ▲1.85
CookieGenie /wp-admin/options-general.php?page=cookiegenie_settings3.4633.17

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 53 new files
Database: no new tables, 12 new options
New WordPress options
cg_scn_color
can_compress_scripts
cg_blacklist
cg_cookietext
db_upgraded
theysaidso_admin_options
cg_bck_color
widget_theysaidso_widget
widget_recent-posts
cg_cookietitle
...

Browser metrics Passed 4 tests

CookieGenie: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,906 ▲14513.40 ▼1.168.62 ▲7.0044.29 ▲2.35
Dashboard /wp-admin2,198 ▲235.57 ▼0.0795.75 ▼3.1642.79 ▼1.02
Posts /wp-admin/edit.php2,109 ▲91.96 ▼0.0235.07 ▲0.0131.56 ▼4.78
Add New Post /wp-admin/post-new.php1,536 ▼123.07 ▲4.99664.17 ▲18.1361.18 ▼9.06
Media Library /wp-admin/upload.php1,403 ▼04.19 ▲0.06105.05 ▼5.5944.30 ▼3.30
CookieGenie /wp-admin/options-general.php?page=cookiegenie_settings9672.0844.1629.94

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
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 12 options
    • cookiegenie_version
    • widget_recent-posts
    • cg_cookietext
    • cg_blacklist
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • cg_scn_color
    • cg_bck_color
    • can_compress_scripts
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Everything seems fine, however this is by no means an exhaustive test

SRP 0% 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 perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/cookiegenie/assets/scripts/cookiegenie-script.php
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Notice
      Undefined variable: init_script in wp-content/plugins/cookiegenie/assets/scripts/cookiegenie-script.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: cookies, plugin, wordpress

cookiegenie/cookiegenie.php Passed 13 tests

The main PHP file in "CookieGenie" ver. 1.0.3 adds more information about the plugin and also serves as the entry point for this plugin
82 characters long description:
Ask user for permission before loading analytics and tracking scripts and cookies.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin2,808 lines of code in 43 files:
LanguageFilesBlank linesComment linesLines of code
PHP215301,1192,039
JSON400227
JavaScript92118148
CSS203108
LESS2171107
Markdown3670103
PO File130475
YAML1001

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.46
Average class complexity29.56
▷ Minimum class complexity1.00
▷ Maximum class complexity64.00
Average method complexity3.60
▷ Minimum method complexity1.00
▷ Maximum method complexity44.00
Code structure
Namespaces3
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods100
▷ Static methods2323.00%
▷ Public methods7575.00%
▷ Protected methods2020.00%
▷ Private methods55.00%
Functions3
▷ Named functions266.67%
▷ Anonymous functions133.33%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
No PNG files were detected