89% allow-only-last-item-in-cart

Code Review | Allow Only Last Item In Cart

WordPress plugin Allow Only Last Item In Cart scored89%from 54 tests.

About plugin

  • Plugin page: allow-only-last-i...
  • Plugin version: 1.0.0
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.7-5.7
  • WordPress version: 6.3.1
  • First release: Jul 13, 2021
  • Latest release: Nov 8, 2021
  • Number of updates: 17
  • Update frequency: every 7.2 days
  • Top authors: savan91 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /421 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
Installer ran successfully

Server metrics [RAM: ▲0.01MB] [CPU: ▼4.21ms] Passed 4 tests

This is a short check of server-side resources used by Allow Only Last Item In Cart
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.34 ▲1.13
Dashboard /wp-admin3.31 ▲0.0148.79 ▼0.19
Posts /wp-admin/edit.php3.36 ▲0.0149.62 ▼1.98
Add New Post /wp-admin/post-new.php5.89 ▲0.0191.03 ▼15.80
Media Library /wp-admin/upload.php3.24 ▲0.0138.85 ▲1.96

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Allow Only Last Item In Cart
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.34 ▲0.071.75 ▲0.0745.48 ▲3.97
Dashboard /wp-admin2,198 ▲215.62 ▼0.0586.71 ▼1.8439.54 ▲1.39
Posts /wp-admin/edit.php2,100 ▼32.02 ▼0.0035.29 ▼7.8533.66 ▼4.28
Add New Post /wp-admin/post-new.php1,526 ▼022.98 ▼0.06593.12 ▼89.5858.84 ▲3.72
Media Library /wp-admin/upload.php1,400 ▼04.23 ▲0.1296.98 ▼12.2439.95 ▼7.17

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
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts
    • theysaidso_admin_options

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
Congratulations! This plugin passed the SRP test

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: These screenshots do not have images: #1 (This screen shot description corresponds to screenshot-1.(png|jpg|jpeg|gif). Note that the screenshot is stored in the /assets directory.), #2 (This is the second screen shot)
You can look at the official readme.txt

allow-only-last-item-in-cart/allow_only_last_item_in_cart.php 77% from 13 tests

Analyzing the main PHP file in "Allow Only Last Item In Cart" version 1.0.0
Please take the time to fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("allow-only-last-item-in-cart.php" instead of "allow_only_last_item_in_cart.php")
  • Text Domain: The text domain name must use dashes instead of underscores, and it must be lowercase
  • Domain Path: The domain path points to a folder that does not exist ("/languages")

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 plugin26 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP345124
Markdown1002

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.67
Average class complexity5.00
▷ Minimum class complexity5.00
▷ Maximum class complexity5.00
Average method complexity3.00
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods2
▷ Static methods00.00%
▷ Public methods2100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected