90% pwg-cookies

Code Review | Pwg Cookies by Programación Web Galicia

WordPress plugin Pwg Cookies by Programación Web Galicia scored90%from 54 tests.

About plugin

  • Plugin page: pwg-cookies
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.4
  • WordPress version: 6.3.1
  • First release: Jan 8, 2016
  • Latest release: Jan 8, 2016
  • Number of updates: 9
  • Update frequency: every 1.0 days
  • Top authors: PWGalicia (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /824 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.01MB] [CPU: ▼8.70ms] Passed 4 tests

Analyzing server-side resources used by Pwg Cookies by Programación Web Galicia
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0239.15 ▼1.16
Dashboard /wp-admin3.32 ▼0.0247.60 ▼14.73
Posts /wp-admin/edit.php3.37 ▲0.0245.39 ▼0.21
Add New Post /wp-admin/post-new.php5.90 ▲0.0283.00 ▼18.70
Media Library /wp-admin/upload.php3.24 ▲0.0235.76 ▲1.32
Cookies /wp-admin/options-general.php?page=admin-pwg-cookies3.2233.00

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 10 new options
New WordPress options
db_upgraded
pwg-cookies-url-aviso-titulo
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
pwg-cookies-url-aviso
pwg-cookies-texto-boton
pwg-cookies-texto-footer
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Pwg Cookies by Programación Web Galicia
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,810 ▲6413.20 ▼1.182.32 ▲0.4643.95 ▲0.19
Dashboard /wp-admin2,210 ▲195.81 ▲0.92110.11 ▼8.7545.35 ▼0.41
Posts /wp-admin/edit.php2,096 ▲72.02 ▼0.0134.96 ▼14.1232.72 ▼15.68
Add New Post /wp-admin/post-new.php1,536 ▲823.20 ▲5.11637.76 ▼25.7155.83 ▲0.23
Media Library /wp-admin/upload.php1,389 ▲44.28 ▲0.0395.83 ▼4.4341.87 ▲1.40
Cookies /wp-admin/options-general.php?page=admin-pwg-cookies9232.0323.5032.23

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
It is recommended to fix the following
  • Zombie WordPress options were found after uninstall: 10 options
    • pwg-cookies-url-aviso
    • widget_recent-posts
    • theysaidso_admin_options
    • pwg-cookies-texto-footer
    • pwg-cookies-texto-boton
    • pwg-cookies-url-aviso-titulo
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
5 plugin tags: google analytics, notice cookies, page cookies, cookies, lopd

pwg-cookies/pwg_cookies.php 92% from 13 tests

The main PHP script in "Pwg Cookies by Programación Web Galicia" version 1.2 is automatically included on every request by WordPress
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("pwg-cookies.php" instead of "pwg_cookies.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Good job! No executable or dangerous file extensions detected629 lines of code in 7 files:
LanguageFilesBlank linesComment linesLines of code
PHP2129136456
PO File2342100
JavaScript115540
CSS12030
Markdown1303

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity15.50
▷ Minimum class complexity2.00
▷ Maximum class complexity29.00
Average method complexity2.93
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods640.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants14
▷ Global constants1392.86%
▷ Class constants17.14%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/cookies.png0.76KB0.53KB▼ 30.58%
assets/cerrar_pestana.png0.38KB0.44KB0.00%