10% simple-parspal-shopping-cart

Code Review | Simple ParsPal Shopping Cart

WordPress plugin Simple ParsPal Shopping Cart scored10%from 54 tests.

About plugin

  • Plugin page: simple-parspal-sh...
  • Plugin version: v1.0.0...
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6-3.0
  • WordPress version: 6.3.1
  • First release: Aug 29, 2012
  • Latest release: Apr 23, 2013
  • Number of updates: 26
  • Update frequency: every 9.2 days
  • Top authors: mobinco (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /6,551 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Notice in wp-content/plugins/simple-parspal-shopping-cart/wp_shopping_cart.php+71
    Undefined index: merchant_return_link

Server metrics [RAM: ▼1.74MB] [CPU: ▼49.87ms] Passed 4 tests

Analyzing server-side resources used by Simple ParsPal Shopping Cart
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.25 ▼1.214.97 ▼36.01
Dashboard /wp-admin2.27 ▼1.036.90 ▼39.29
Posts /wp-admin/edit.php2.27 ▼1.087.84 ▼39.97
Add New Post /wp-admin/post-new.php2.27 ▼3.626.30 ▼84.22
Media Library /wp-admin/upload.php2.27 ▼0.966.18 ▼34.50
آسان پرداز پارس پال /wp-admin/options-general.php?page=simple-parspal-shopping-cart/wp_shopping_cart.php2.276.61

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 13 new files
Database: no new tables, 9 new options
New WordPress options
cart_return_from_parspal_url
widget_theysaidso_widget
can_compress_scripts
wp_cart_title
widget_recent-comments
db_upgraded
wp_cart_empty_text
widget_recent-posts
theysaidso_admin_options

Browser metrics Passed 4 tests

A check of browser resources used by Simple ParsPal Shopping Cart
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,808 ▲6213.29 ▼1.091.64 ▼0.0842.73 ▲0.31
Dashboard /wp-admin2,210 ▲224.88 ▲0.02100.67 ▼6.3941.47 ▼1.56
Posts /wp-admin/edit.php2,093 ▲42.02 ▼0.0340.58 ▲2.1437.77 ▲5.43
Add New Post /wp-admin/post-new.php1,535 ▲2121.96 ▲4.39645.60 ▼47.4653.36 ▼0.12
Media Library /wp-admin/upload.php1,392 ▲74.23 ▼0.0194.83 ▼14.8642.66 ▼4.16
آسان پرداز پارس پال /wp-admin/options-general.php?page=simple-parspal-shopping-cart/wp_shopping_cart.php9902.0722.8972.50

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/simple-parspal-shopping-cart/wp_shopping_cart.php+71
    Undefined index: merchant_return_link
  • This plugin did not uninstall successfully, leaving 9 options in the database
    • cart_return_from_parspal_url
    • wp_cart_title
    • db_upgraded
    • can_compress_scripts
    • wp_cart_empty_text
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=simple-parspal-shopping-cart/wp_shopping_cart.php
    • > Notice in wp-content/plugins/simple-parspal-shopping-cart/wp_shopping_cart.php+71
    Undefined index: merchant_return_link
    • > GET request to /wp-admin/options-general.php?page=simple-parspal-shopping-cart/wp_shopping_cart.php
    • > Notice in wp-content/plugins/simple-parspal-shopping-cart/wp_shopping_cart.php+76
    Undefined index: mc_gross
    • > GET request to /wp-admin/options-general.php?page=simple-parspal-shopping-cart/wp_shopping_cart.php
    • > Notice in wp-content/plugins/simple-parspal-shopping-cart/wp_shopping_cart.php+93
    Undefined index: addcart
    • > GET request to /wp-admin/options-general.php?page=simple-parspal-shopping-cart/wp_shopping_cart.php
    • > Notice in wp-content/plugins/simple-parspal-shopping-cart/wp_shopping_cart.php+130
    Undefined index: cquantity
    • > GET request to /wp-admin/options-general.php?page=simple-parspal-shopping-cart/wp_shopping_cart.php
    • > Notice in wp-content/plugins/simple-parspal-shopping-cart/wp_shopping_cart.php+147
    Undefined index: delcart

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
Almost there! Just fix the following items
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/simple-parspal-shopping-cart/wp_shopping_cart.php:32

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 on the user side

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Administration interface in WordPress 3.4.1), #2 (Shopping cart user interface)
You can look at the official readme.txt

simple-parspal-shopping-cart/wp_shopping_cart.php 77% from 13 tests

The principal PHP file in "Simple ParsPal Shopping Cart" v. v1.0.0... is loaded by WordPress automatically on each request
Please take the time to fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("simple-parspal-shopping-cart.php" instead of "wp_shopping_cart.php")
  • Version: Use only periods and digits for the version number (ex. "1.0.3" instead of "v1.0.0...")
  • Description: Keep the plugin description shorter than 140 characters (currently 149 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
Success! There were no dangerous files found in this plugin582 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP110539567
CSS13015

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.28
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%
Functions18
▷ Named functions18100.00%
▷ Anonymous functions00.00%
Constants2
▷ Global constants2100.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
6 PNG files occupy 0.02MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/add_to_cart_button.png2.73KB1.93KB▼ 29.33%
images/shopping_cart_icon.png3.07KB1.71KB▼ 44.50%
images/buy.png5.59KB3.14KB▼ 43.89%
images/add_to_cart_button_76.png2.38KB1.04KB▼ 56.44%
images/buy_now_button.png2.67KB1.95KB▼ 26.89%