84% switch-simple-cookie-notice

Code Review | Switch - Simple Cookie Notice

WordPress plugin Switch - Simple Cookie Notice scored84%from 54 tests.

About plugin

  • Plugin page: switch-simple-coo...
  • Plugin version: 0.1.1
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.0.3
  • WordPress version: 6.3.1
  • First release: Feb 24, 2021
  • Latest release: Oct 31, 2022
  • Number of updates: 8
  • Update frequency: every 111.1 days
  • Top authors: Switchreclamebureau (100%)

Code review

54 tests

User reviews

1 review

Install metrics

60+ active /2,049 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
This plugin's installer ran successfully

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

A check of server-side resources used by Switch - Simple Cookie Notice
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0344.94 ▼0.71
Dashboard /wp-admin3.34 ▲0.0448.89 ▼6.97
Posts /wp-admin/edit.php3.39 ▲0.0445.96 ▼6.20
Add New Post /wp-admin/post-new.php5.92 ▲0.0485.60 ▼7.42
Media Library /wp-admin/upload.php3.26 ▲0.0435.75 ▼0.29

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_recent-posts
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Switch - Simple Cookie Notice
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,886 ▲12513.40 ▼0.959.42 ▲7.4742.63 ▼0.15
Dashboard /wp-admin2,207 ▲335.63 ▲0.0291.65 ▼5.9338.71 ▼6.43
Posts /wp-admin/edit.php2,112 ▲121.97 ▼0.0135.66 ▼2.5933.58 ▼0.80
Add New Post /wp-admin/post-new.php1,538 ▲1223.18 ▼0.46661.79 ▼12.2952.42 ▼5.98
Media Library /wp-admin/upload.php1,415 ▲184.19 ▼0.0399.24 ▼4.3444.69 ▼1.97

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
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments

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
The smoke test was a success, however most plugin functionality was not tested

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 items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/switch-simple-cookie-notice/settings.php:129

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === switch-simple-cookie-notice === )
The official readme.txt might help

switch-simple-cookie-notice/switch-simple-cookie-notice.php Passed 13 tests

The primary PHP file in "Switch - Simple Cookie Notice" version 0.1.1 is used by WordPress to initiate all plugin functionality
71 characters long description:
Simple cookie notice plugin for Wordpress, made by Switch Reclamebureau

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin174 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
PHP33928137
JavaScript14035
Markdown1102

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity4.00
▷ Minimum class complexity1.00
▷ Maximum class complexity7.00
Average method complexity1.43
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.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 Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
No PNG images were found in this plugin