84% cookies-pro

Code Review | Cookies Pro

WordPress plugin Cookies Pro scored84%from 54 tests.

About plugin

  • Plugin page: cookies-pro
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Oct 4, 2013
  • Latest release: Oct 14, 2013
  • Number of updates: 13
  • Update frequency: every 0.8 days
  • Top authors: pixelprocursos (100%)

Code review

54 tests

User reviews

1 review

Install metrics

300+ active /7,694 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼5.15ms] Passed 4 tests

An overview of server-side resources used by Cookies Pro
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0442.90 ▲1.75
Dashboard /wp-admin3.34 ▼0.0046.51 ▼20.16
Posts /wp-admin/edit.php3.39 ▲0.0452.09 ▲1.59
Add New Post /wp-admin/post-new.php5.94 ▲0.0696.98 ▼3.79
Media Library /wp-admin/upload.php3.27 ▲0.0440.05 ▲5.12

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
cookies_pro_options
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Cookies Pro
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,977 ▲19113.61 ▼0.788.39 ▲6.2241.09 ▼3.70
Dashboard /wp-admin2,240 ▲435.90 ▼0.0098.12 ▼23.6179.12 ▲28.42
Posts /wp-admin/edit.php2,125 ▲252.08 ▲0.0639.15 ▲0.6433.74 ▼4.09
Add New Post /wp-admin/post-new.php1,559 ▲3318.23 ▲0.50742.95 ▲120.7563.79 ▼7.62
Media Library /wp-admin/upload.php1,419 ▲164.26 ▲0.01110.76 ▲9.7775.15 ▲30.25

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • cookies_pro_options
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cookies-pro/libs.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cookies-pro/view.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/cookies-pro/libs.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 93% 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
Please fix the following attributes:
  • Screenshots: These screenshots need descriptions #1, #2, #3 in cookies-pro/assets to your readme.txt
You can look at the official readme.txt

cookies-pro/index.php 92% from 13 tests

The main PHP script in "Cookies Pro" version 1.0 is automatically included on every request by WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("cookies-pro.php" instead of "index.php")

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
No dangerous file extensions were detected471 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript310637217
PHP3539137
CSS210117

PHP code Passed 2 tests

This is a short overview 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.08
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%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
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
2 PNG files occupy 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/cookiespro.png1.03KB0.19KB▼ 81.92%
img/banner_galleta.png10.44KB5.11KB▼ 51.06%