83% legalmonster-cookie

Code Review | Legal Monster Cookie Pop-up

WordPress plugin Legal Monster Cookie Pop-up scored83%from 54 tests.

About plugin

  • Plugin page: legalmonster-cookie
  • Plugin version: 1.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.7.2
  • WordPress version: 6.3.1
  • First release: Jul 13, 2021
  • Latest release: Aug 3, 2021
  • Number of updates: 19
  • Update frequency: every 1.4 days
  • Top authors: legalmonster (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active /916 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.04MB] [CPU: ▼2.97ms] Passed 4 tests

An overview of server-side resources used by Legal Monster Cookie Pop-up
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0443.29 ▲4.26
Dashboard /wp-admin3.35 ▲0.0447.77 ▼12.28
Posts /wp-admin/edit.php3.40 ▲0.0453.63 ▲3.80
Add New Post /wp-admin/post-new.php5.93 ▲0.0493.11 ▼6.52
Media Library /wp-admin/upload.php3.27 ▲0.0440.61 ▲3.12

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

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

Browser metrics Passed 4 tests

This is an overview of browser requirements for Legal Monster Cookie Pop-up
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,913 ▲15214.08 ▼0.4561.44 ▲59.6139.70 ▼8.13
Dashboard /wp-admin2,241 ▲615.65 ▼0.0090.36 ▲2.6142.19 ▲2.30
Posts /wp-admin/edit.php2,143 ▲432.03 ▲0.0139.61 ▲5.1334.57 ▼2.47
Add New Post /wp-admin/post-new.php1,539 ▲1123.63 ▲0.87691.48 ▲39.2762.12 ▲10.64
Media Library /wp-admin/upload.php1,447 ▲474.19 ▲0.07107.00 ▼7.2745.37 ▼1.82

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
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts

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 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 3× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/legalmonster-cookie/legalmonster.php:22
    • > PHP Fatal error
      Uncaught Error: Using $this when not in object context in wp-content/plugins/legalmonster-cookie/views/settings.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/legalmonster-cookie/views/sidebar.php:11

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 93% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Contributors: Contributors not specified
The official readme.txt might help

legalmonster-cookie/legalmonster.php 92% from 13 tests

The main file in "Legal Monster Cookie Pop-up" v. 1.1.1 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("legalmonster-cookie.php" instead of "legalmonster.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin395 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP36477235
CSS1285147
JavaScript13413

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity21.00
▷ Minimum class complexity21.00
▷ Maximum class complexity21.00
Average method complexity2.82
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods11
▷ Static methods00.00%
▷ Public methods11100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
2 PNG files occupy 0.63MB with 0.33MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
views/img/customer-support.png14.61KB10.88KB▼ 25.52%
views/img/install.png631.40KB125.96KB▼ 80.05%