78% simple-cookies

Code Review | Simple Cookies

WordPress plugin Simple Cookies scored78%from 54 tests.

About plugin

  • Plugin page: simple-cookies
  • Plugin version: 1.0.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.0-5.3
  • WordPress version: 6.3.1
  • First release: Oct 3, 2019
  • Latest release: Mar 28, 2020
  • Number of updates: 66
  • Update frequency: every 2.7 days
  • Top authors: Mortrall (95.45%)azhary (6.06%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /570 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼4.45ms] Passed 4 tests

This is a short check of server-side resources used by Simple Cookies
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0438.66 ▼0.42
Dashboard /wp-admin3.34 ▲0.0445.28 ▼9.11
Posts /wp-admin/edit.php3.46 ▲0.1046.94 ▲3.23
Add New Post /wp-admin/post-new.php5.95 ▲0.0687.48 ▼9.42
Media Library /wp-admin/upload.php3.27 ▲0.0435.02 ▲1.14

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

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

Browser metrics Passed 4 tests

Simple Cookies: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,859 ▲10213.12 ▼1.242.19 ▲0.2142.96 ▼4.69
Dashboard /wp-admin2,240 ▲495.88 ▲1.0097.08 ▼9.5186.77 ▲41.87
Posts /wp-admin/edit.php2,123 ▲342.00 ▼0.0239.48 ▲2.5034.39 ▼0.64
Add New Post /wp-admin/post-new.php1,610 ▲8822.96 ▼0.19662.25 ▼21.0253.61 ▼5.89
Media Library /wp-admin/upload.php1,422 ▲314.20 ▼0.01101.52 ▲3.7073.37 ▲30.15

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-posts

Smoke tests 50% 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 0% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 3× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/simple-cookies/simple-cookies.php
    • > /wp-content/plugins/simple-cookies/templates/admin.php
    • > /wp-content/plugins/simple-cookies/templates/helptab.php
  • 10× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Simple_Cookies\\Shortcodes\\ShortcodeController' not found in wp-content/plugins/simple-cookies/inc/Shortcodes/HideCookieShortcode.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Simple_Cookies\\Base\\BaseController' not found in wp-content/plugins/simple-cookies/inc/Shortcodes/ShortcodeController.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Simple_Cookies\\Shortcodes\\ShortcodeController' not found in wp-content/plugins/simple-cookies/inc/Shortcodes/AddCookieShortcode.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Simple_Cookies\\Base\\BaseController' not found in wp-content/plugins/simple-cookies/inc/Api/Callbacks/AdminCallbacks.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Simple_Cookies\\Base\\BaseController' not found in wp-content/plugins/simple-cookies/inc/Shortcodes/AddButtonController.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Simple_Cookies\\Base\\BaseController' not found in wp-content/plugins/simple-cookies/inc/Pages/Dashboard.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'Simple_Cookies\\Shortcodes\\ShortcodeController' not found in wp-content/plugins/simple-cookies/inc/Shortcodes/RemoveCookieShortcode.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Simple_Cookies\\Base\\BaseController' not found in wp-content/plugins/simple-cookies/inc/Base/SettingsLinks.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Simple_Cookies\\Base\\BaseController' not found in wp-content/plugins/simple-cookies/inc/Base/Enqueue.php:14
    • > PHP Fatal error
      Uncaught Error: Class 'Simple_Cookies\\Shortcodes\\ShortcodeController' not found in wp-content/plugins/simple-cookies/inc/Shortcodes/ShowCookieShortcode.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots require images: #1 (banner-772x250.jpg), #2 (icon-128x128.png)
The official readme.txt might help

simple-cookies/simple-cookies.php 92% from 13 tests

The main file in "Simple Cookies" v. 1.0.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 169 characters long)

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
There were no executable files found in this plugin1,296 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
PHP28237292938
JavaScript71536209
Sass215080
JSON40066
SVG2002
CSS1001

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity6.28
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity18.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes18
▷ Abstract classes00.00%
▷ Concrete classes18100.00%
▷ Final classes15.56%
Methods68
▷ Static methods1116.18%
▷ Public methods6697.06%
▷ Protected methods00.00%
▷ Private methods22.94%
Functions4
▷ Named functions375.00%
▷ Anonymous functions125.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin