84% cart-session-time

Code Review | Cart Session Time

WordPress plugin Cart Session Time scored84%from 54 tests.

About plugin

  • Plugin page: cart-session-time
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0.0-6.1.1
  • WordPress version: 6.3.1
  • First release: Feb 15, 2023
  • Latest release: Mar 20, 2023
  • Number of updates: 6
  • Update frequency: every 5.5 days
  • Top authors: andbroinc (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /135 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

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

This is a short check of server-side resources used by Cart Session Time
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0339.10 ▼5.08
Dashboard /wp-admin3.37 ▲0.0250.03 ▼3.52
Posts /wp-admin/edit.php3.48 ▲0.0948.51 ▼3.07
Add New Post /wp-admin/post-new.php5.95 ▲0.0294.34 ▼8.44
Media Library /wp-admin/upload.php3.29 ▲0.0241.06 ▲2.68

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 8 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Cart Session Time: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,826 ▲6514.68 ▲0.332.14 ▲0.2144.08 ▼3.69
Dashboard /wp-admin2,207 ▲335.63 ▼0.0492.36 ▼6.6043.38 ▼2.60
Posts /wp-admin/edit.php2,112 ▲121.94 ▼0.0440.36 ▲3.2134.03 ▼0.65
Add New Post /wp-admin/post-new.php1,538 ▲1223.23 ▲0.02675.91 ▲5.4451.51 ▼1.97
Media Library /wp-admin/upload.php1,415 ▲154.15 ▼0.0495.18 ▼11.3343.78 ▼3.95

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 50% from 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
The following issues need your attention
  • 5× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function current_user_can() in wp-content/plugins/cart-session-time/inc/setting-page.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/cart-session-time/cart-session-time.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/cart-session-time/inc/option.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/cart-session-time/index.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html() in wp-content/plugins/cart-session-time/inc/notice.php:3

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
4 plugin tags: session time setting, session time, cart session, woocommerce

cart-session-time/index.php 92% from 13 tests

Analyzing the main PHP file in "Cart Session Time" version 1.0.0
Please take the time to fix the following:
  • Main file name: Name the main plugin file the same as the plugin slug ("cart-session-time.php" instead of "index.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
Success! There were no dangerous files found in this plugin229 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP53263193
PO File18836

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.27
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%
Functions8
▷ Named functions8100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
No PNG images were found in this plugin