58% itp-cookie-saver

Code Review | ITP Cookie Saver - Convert javascript cookies to server cookies

WordPress plugin ITP Cookie Saver - Convert javascript cookies to server cookies scored58%from 54 tests.

About plugin

  • Plugin page: itp-cookie-saver
  • Plugin version: 1.2.1
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-6.1
  • WordPress version: 6.3.1
  • First release: Jun 16, 2019
  • Latest release: Feb 5, 2023
  • Number of updates: 26
  • Update frequency: every 51.2 days
  • Top authors: nikelschubert (100%)

Code review

54 tests

User reviews

1 review

Install metrics

70+ active /978 total downloads

Benchmarks

Plugin footprint 48% 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: ▼7.47ms] Passed 4 tests

This is a short check of server-side resources used by ITP Cookie Saver - Convert javascript cookies to server cookies
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0241.43 ▼9.73
Dashboard /wp-admin3.33 ▼0.0152.35 ▼17.95
Posts /wp-admin/edit.php3.44 ▲0.0962.48 ▲11.61
Add New Post /wp-admin/post-new.php5.91 ▲0.0392.91 ▼6.20
Media Library /wp-admin/upload.php3.25 ▲0.0340.09 ▲4.02
ITP Cookie Saver /wp-admin/options-general.php?page=nsc_ics_settings3.2735.33

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 10 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

This is an overview of browser requirements for ITP Cookie Saver - Convert javascript cookies to server cookies
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲4714.27 ▼0.111.71 ▼0.1741.04 ▼1.55
Dashboard /wp-admin2,202 ▲255.67 ▲0.0792.16 ▲1.4942.61 ▲2.33
Posts /wp-admin/edit.php2,104 ▲42.05 ▲0.0440.93 ▼0.4136.41 ▼2.90
Add New Post /wp-admin/post-new.php1,548 ▲423.33 ▲0.19707.20 ▲15.4353.33 ▼0.32
Media Library /wp-admin/upload.php1,407 ▲74.27 ▲0.09101.99 ▲1.8443.50 ▼3.37
ITP Cookie Saver /wp-admin/options-general.php?page=nsc_ics_settings8882.0523.4926.49

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
These items require your attention
  • This plugin did not uninstall without warnings or errors
    • > Notice in wp-content/plugins/itp-cookie-saver/uninstall.php+7
    Constant NSC_ics_PLUGINPATH already defined
  • Uninstaller has failed for this plugin, leaving 10 files (0.02MB) in the plugin directory
    • (new file) settings.json
    • (new file) class/class-de-nikelschubert-nsc_ics.php
    • (new file) class/class_nsc_ics_backend.php
    • (new file) class/class_nsc_ics.php
    • (new file) readme.txt
    • (new file) class/class_nsc_ics_frontend.php
    • (new file) admin/tpl/admin.php
    • (new file) nsc_itp-cookie-saver.php
    • (new file) frontend/js/nsc_ics_cookiesaver.js
    • (new file) uninstall.php
  • Zombie WordPress options were found after uninstall: 7 options
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • recovery_mode_email_last_sent
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/itp-cookie-saver/uninstall.php
  • 11× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Notice
      Undefined variable: objSettings in wp-content/plugins/itp-cookie-saver/admin/tpl/admin.php on line 15
    • > PHP Notice
      Trying to get property 'setting_page_fields' of non-object in wp-content/plugins/itp-cookie-saver/admin/tpl/admin.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'de_nikelschubert_nsc_ics' not found in wp-content/plugins/itp-cookie-saver/class/class_nsc_ics_backend.php:3
    • > PHP Notice
      Undefined variable: objSettings in wp-content/plugins/itp-cookie-saver/admin/tpl/admin.php on line 8
    • > PHP Notice
      Trying to get property 'tabs' of non-object in wp-content/plugins/itp-cookie-saver/admin/tpl/admin.php on line 8
    • > PHP Notice
      Trying to get property 'active_tab_index' of non-object in wp-content/plugins/itp-cookie-saver/admin/tpl/admin.php on line 15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/itp-cookie-saver/nsc_itp-cookie-saver.php:25
    • > PHP Fatal error
      Uncaught Error: Class 'de_nikelschubert_nsc_ics' not found in wp-content/plugins/itp-cookie-saver/class/class_nsc_ics_frontend.php:3
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/itp-cookie-saver/admin/tpl/admin.php on line 8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function settings_fields() in wp-content/plugins/itp-cookie-saver/admin/tpl/admin.php:21

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)
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
These attributes need your attention:
  • Contributors: Contributors not specified
The official readme.txt is a good inspiration

itp-cookie-saver/nsc_itp-cookie-saver.php 85% from 13 tests

"ITP Cookie Saver - Convert javascript cookies to server cookies" version 1.2.1's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
It is important to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("itp-cookie-saver.php" instead of "nsc_itp-cookie-saver.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 189 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Everything looks great! No dangerous files found in this plugin408 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP76527345
JSON10058
JavaScript1005

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity8.60
▷ Minimum class complexity1.00
▷ Maximum class complexity14.00
Average method complexity2.36
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods28
▷ Static methods00.00%
▷ Public methods1967.86%
▷ Protected methods310.71%
▷ Private methods621.43%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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 are no PNG files in this plugin