83% caching-compatible-cookie-optin-and-javascript

Code Review | Caching Compatible Cookie Opt-In and JavaScript

WordPress plugin Caching Compatible Cookie Opt-In and JavaScript scored83%from 54 tests.

About plugin

  • Plugin page: caching-compatibl...
  • Plugin version: 0.0.10
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: May 8, 2020
  • Latest release: Aug 5, 2023
  • Number of updates: 20
  • Update frequency: every 59.2 days
  • Top authors: matthias.wagner (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active /2,445 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.02MB] [CPU: ▼4.43ms] Passed 4 tests

Analyzing server-side resources used by Caching Compatible Cookie Opt-In and JavaScript
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0337.31 ▼0.26
Dashboard /wp-admin3.33 ▼0.0245.47 ▼15.30
Posts /wp-admin/edit.php3.44 ▲0.0848.73 ▲3.69
Add New Post /wp-admin/post-new.php5.93 ▲0.0494.50 ▼4.81
Media Library /wp-admin/upload.php3.25 ▲0.0236.12 ▲2.65
Cookie-Optin & JS /wp-admin/tools.php?page=caching-compatible-cookie-optin-and-javascript/caching-compatible-cookie-optin.php3.1929.63

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-posts
widget_recent-comments
can_compress_scripts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for Caching Compatible Cookie Opt-In and JavaScript
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,951 ▲18013.89 ▼0.696.85 ▲4.9638.04 ▼1.38
Dashboard /wp-admin2,226 ▲355.02 ▼0.88103.19 ▼4.4839.67 ▼1.75
Posts /wp-admin/edit.php2,117 ▲282.30 ▲0.3040.60 ▲3.5733.92 ▲1.35
Add New Post /wp-admin/post-new.php1,531 ▼1323.15 ▲5.02615.96 ▲9.9232.89 ▼29.27
Media Library /wp-admin/upload.php1,411 ▲204.52 ▲0.3797.85 ▲1.9743.81 ▲0.36
Cookie-Optin & JS /wp-admin/tools.php?page=caching-compatible-cookie-optin-and-javascript/caching-compatible-cookie-optin.php8642.0926.6727.22

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options

Smoke tests 75% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=caching-compatible-cookie-optin-and-javascript/caching-compatible-cookie-optin.php
    • > Notice in wp-content/plugins/caching-compatible-cookie-optin-and-javascript/caching-compatible-cookie-optin.php+588
    Undefined index: base
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=caching-compatible-cookie-optin-and-javascript/caching-compatible-cookie-optin.php
    • > Notice in wp-content/plugins/caching-compatible-cookie-optin-and-javascript/caching-compatible-cookie-optin.php+596
    Trying to access array offset on value of type null
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/tools.php?page=caching-compatible-cookie-optin-and-javascript/caching-compatible-cookie-optin.php
    • > Notice in wp-content/plugins/caching-compatible-cookie-optin-and-javascript/caching-compatible-cookie-optin.php+596
    Undefined index: optin

SRP Passed 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
You can take inspiration from this readme.txt

caching-compatible-cookie-optin-and-javascript/caching-compatible-cookie-optin.php 77% from 13 tests

The entry point to "Caching Compatible Cookie Opt-In and JavaScript" version 0.0.10 is a PHP file that has certain tags in its header comment area
Please make the necessary changes and fix the following:
  • Text Domain: The text domain name should consist of only dashes and lowercase characters
  • Domain Path: The domain path is invalid: folder "/languages" does not exist
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("caching-compatible-cookie-optin-and-javascript.php" instead of "caching-compatible-cookie-optin.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin741 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP15763505
JavaScript24551159
CSS16677

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.40
Average class complexity78.00
▷ Minimum class complexity78.00
▷ Maximum class complexity78.00
Average method complexity2.67
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods46
▷ Static methods12.17%
▷ Public methods4291.30%
▷ Protected methods00.00%
▷ Private methods48.70%
Functions1
▷ Named functions1100.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
There were not PNG files found in your plugin