83% light-weight-cookie-popup

Code Review | Light Weight Cookie Popup

WordPress plugin Light Weight Cookie Popup scored83%from 54 tests.

About plugin

  • Plugin page: light-weight-cook...
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6-6.3
  • WordPress version: 6.3.1
  • First release: Jun 27, 2018
  • Latest release: Aug 15, 2023
  • Number of updates: 9
  • Update frequency: every 208.4 days
  • Top authors: tusharkapdi (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /891 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Install script ran successfully

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

A check of server-side resources used by Light Weight Cookie Popup
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0236.36 ▼2.97
Dashboard /wp-admin3.34 ▲0.0450.62 ▼0.99
Posts /wp-admin/edit.php3.39 ▲0.0344.72 ▼4.70
Add New Post /wp-admin/post-new.php5.92 ▲0.0390.08 ▲2.38
Media Library /wp-admin/upload.php3.26 ▲0.0332.38 ▲2.46
Light Weight Cookie Popup /wp-admin/options-general.php?page=lwcp3.2229.52

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Light Weight Cookie Popup
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,902 ▲15613.57 ▼1.019.57 ▲8.0541.51 ▼1.27
Dashboard /wp-admin2,213 ▲224.85 ▼1.05102.71 ▼0.8237.32 ▼4.06
Posts /wp-admin/edit.php2,093 ▲42.01 ▲0.0134.85 ▼7.2630.39 ▼5.86
Add New Post /wp-admin/post-new.php1,531 ▲1223.25 ▼0.03607.69 ▼74.5355.47 ▲1.31
Media Library /wp-admin/upload.php1,389 ▲14.19 ▼0.01102.16 ▼5.4042.67 ▼3.00
Light Weight Cookie Popup /wp-admin/options-general.php?page=lwcp2,5952.8964.3036.19

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=lwcp
    • > Notice in wp-content/plugins/light-weight-cookie-popup/ab-cookie-popup.php+446
    Undefined offset: 0

SRP Passed 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
Looking good! No server-side errors or output on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

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
These attributes need to be fixed:
  • Tags: Please delete some tags, you are using 19 tag instead of maximum 10
The official readme.txt might help

light-weight-cookie-popup/ab-cookie-popup.php 85% from 13 tests

"Light Weight Cookie Popup" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Main file name: Name the main plugin file the same as the plugin slug ("light-weight-cookie-popup.php" instead of "ab-cookie-popup.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin707 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP112897619
JavaScript4252387
CSS1001

PHP code Passed 2 tests

This is a short overview 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.52
Average class complexity98.00
▷ Minimum class complexity98.00
▷ Maximum class complexity98.00
Average method complexity3.94
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods33
▷ Static methods00.00%
▷ Public methods33100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
No PNG images were found in this plugin