84% safe-cookies

Code Review | Safe Cookies

WordPress plugin Safe Cookies scored 84% from 54 tests.

About plugin

  • Plugin page: safe-cookies
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress version: 6.3.1
  • First release: Jul 10, 2014
  • Latest release: Jul 10, 2014
  • Number of updates: 2
  • Update frequency: N/A
  • Top authors: Subhransu Sekhar (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 894 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
The plugin installed successfully, without throwing any errors or notices

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

An overview of server-side resources used by Safe Cookies
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0240.67 ▲1.43
Dashboard /wp-admin3.32 ▲0.0243.39 ▲1.65
Posts /wp-admin/edit.php3.37 ▲0.0243.68 ▼5.52
Add New Post /wp-admin/post-new.php5.90 ▲0.0283.24 ▼7.64
Media Library /wp-admin/upload.php3.24 ▲0.0233.24 ▲1.89

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

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

Browser metrics Passed 4 tests

Safe Cookies: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲4314.42 ▲0.131.91 ▲0.0144.16 ▲2.36
Dashboard /wp-admin2,206 ▲185.86 ▲0.9995.24 ▼25.0740.60 ▼3.31
Posts /wp-admin/edit.php2,089 ▼31.97 ▼0.0338.65 ▼1.5532.73 ▼2.99
Add New Post /wp-admin/post-new.php1,542 ▲923.26 ▲0.01670.06 ▲52.2750.48 ▼2.68
Media Library /wp-admin/upload.php1,382 ▼34.26 ▲0.0895.80 ▼8.1642.79 ▼2.72

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

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

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check 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
The following issues need your attention
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/safe-cookies/safe_cookies.php:114

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
5 plugin tags: admin, session, cookie, security, login

safe-cookies/safe_cookies.php 92% from 13 tests

The main PHP file in "Safe Cookies" ver. 1.0 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("safe-cookies.php" instead of "safe_cookies.php")

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 plugin99 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP1191099

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
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%
Functions5
▷ Named functions5100.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
There were not PNG files found in your plugin