83% wp-cookies-alert

Code Review | WP Cookies Alert

WordPress plugin WP Cookies Alert scored83%from 54 tests.

About plugin

  • Plugin page: wp-cookies-alert
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-3.7.1
  • WordPress version: 6.3.1
  • First release: Aug 17, 2013
  • Latest release: Nov 5, 2013
  • Number of updates: 10
  • Update frequency: every 8.0 days
  • Top authors: aleapp (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

500+ active /6,997 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

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

Server-side resources used by WP Cookies Alert
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0138.33 ▼1.70
Dashboard /wp-admin3.31 ▲0.0152.20 ▲1.64
Posts /wp-admin/edit.php3.36 ▲0.0150.68 ▼6.93
Add New Post /wp-admin/post-new.php5.89 ▲0.0195.97 ▼9.80
Media Library /wp-admin/upload.php3.23 ▲0.0139.72 ▼0.16
WP Cookies Alert /wp-admin/options-general.php?page=wpca-options3.2032.33

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 15 new files
Database: no new tables, 7 new options
New WordPress options
db_upgraded
widget_recent-posts
can_compress_scripts
wpca_en
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by WP Cookies Alert
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,930 ▲16913.78 ▼0.758.74 ▲7.1243.29 ▲2.08
Dashboard /wp-admin2,199 ▲195.61 ▼0.0590.72 ▼8.5839.53 ▼2.62
Posts /wp-admin/edit.php2,104 ▲42.03 ▲0.0239.35 ▼1.6137.13 ▼1.75
Add New Post /wp-admin/post-new.php1,529 ▲323.26 ▼0.43646.82 ▼42.8554.08 ▼8.95
Media Library /wp-admin/upload.php1,404 ▲44.21 ▲0.1295.80 ▼14.7245.09 ▼2.28
WP Cookies Alert /wp-admin/options-general.php?page=wpca-options1,0552.0123.1833.26

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • The uninstall procedure has failed, leaving 7 options in the database
    • wpca_en
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following
  • 4× 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/wp-cookies-alert/wpca-admin.php:157
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-cookies-alert/wpca-helpers.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-cookies-alert/wpca-helpers.php:20
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-cookies-alert/wpca-front.php:61

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% 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 require images: #1 (screenshot-1.png WP Cookies Alert administration screen.), #2 (screenshot-2.png Alert box position top.), #3 (screenshot-3.png Alert box position fixed top.), #4 (screenshot-4.png Alert box position bottom.), #5 (screenshot-5.png Alert box position fixed bottom.)
You can take inspiration from this readme.txt

wp-cookies-alert/wpca.php 85% from 13 tests

The main file in "WP Cookies Alert" v. 1.1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("wp-cookies-alert.php" instead of "wpca.php")
  • Description: Keep the plugin description shorter than 140 characters (currently 208 characters long)

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
There were no executable files found in this plugin405 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP41461312
PO File1326783
CSS10010

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.48
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%
Functions12
▷ Named functions12100.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
5 PNG files occupy 0.38MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png119.62KB45.79KB▼ 61.72%
screenshot-5.png78.59KB28.92KB▼ 63.20%
screenshot-3.png68.52KB24.47KB▼ 64.29%
screenshot-2.png78.54KB28.17KB▼ 64.13%
screenshot-4.png39.29KB14.43KB▼ 63.28%