68% paypal-cart

Code Review | PayPal Cart by Human80

WordPress plugin PayPal Cart by Human80 scored68%from 54 tests.

About plugin

  • Plugin page: paypal-cart
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.4
  • WordPress version: 6.3.1
  • First release: Sep 19, 2014
  • Latest release: Sep 22, 2014
  • Number of updates: 5
  • Update frequency: every 3.2 days
  • Top authors: michaelgrover (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /761 total downloads

Benchmarks

Plugin footprint 65% 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.65MB] [CPU: ▼21.26ms] Passed 4 tests

A check of server-side resources used by PayPal Cart by Human80
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.55 ▲0.0442.73 ▼2.62
Dashboard /wp-admin3.39 ▲0.0148.80 ▼17.01
Posts /wp-admin/edit.php3.51 ▲0.1150.74 ▼1.71
Add New Post /wp-admin/post-new.php3.24 ▼2.6936.64 ▼62.69
Media Library /wp-admin/upload.php3.32 ▲0.0537.16 ▼2.73
PayPal Cart /wp-admin/options-general.php?page=paypal-cart3.2632.66

Server storage [IO: ▲0.26MB] [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: 6 new files
Database: 1 new table, 7 new options
New tables
wp_H80cart_data
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_recent-comments
H80cart_version
widget_theysaidso_widget

Browser metrics Passed 4 tests

PayPal Cart by Human80: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,821 ▲6014.23 ▼0.421.85 ▼0.0845.17 ▲1.19
Dashboard /wp-admin2,202 ▲255.60 ▼0.0784.54 ▼7.3438.85 ▼6.44
Posts /wp-admin/edit.php2,101 ▲12.03 ▲0.0538.61 ▲4.5533.34 ▼4.67
Add New Post /wp-admin/post-new.php6,267 ▲4,73025.94 ▲7.75907.77 ▲251.3063.32 ▼9.40
Media Library /wp-admin/upload.php1,407 ▲134.18 ▲0.0196.48 ▼5.4545.03 ▲0.63
PayPal Cart /wp-admin/options-general.php?page=paypal-cart9591.9624.0625.28

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 50% 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
  • Zombie tables were found after uninstall: 1 table
    • wp_H80cart_data
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • H80cart_version
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 19 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=paypal-cart
    • > Notice in wp-content/plugins/paypal-cart/h80_cart.php+79
    Trying to access array offset on value of type null

SRP 50% 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
  • 1× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/paypal-cart/h80_cart.php:10

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% 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:
  • Plugin Name: You should set the name of your plugin on the first line ( === paypal-cart === )
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (This is a shot that includes both the main setting screen -- where you enter your Paypal email address, choose a local currency, or modify the css -- and shows an inset of the metabox available when authoring a post.), #2 (This is how the default Paypal Cart shows up in a blog post.)
The official readme.txt is a good inspiration

paypal-cart/h80_cart.php 92% from 13 tests

The main PHP file in "PayPal Cart by Human80" ver. 1.3 adds more information about the plugin and also serves as the entry point for this plugin
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("paypal-cart.php" instead of "h80_cart.php")

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
Good job! No executable or dangerous file extensions detected297 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP11656258
CSS10039

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.44
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%
Functions9
▷ Named functions9100.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
2 PNG files occupy 0.24MB with 0.15MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
blog-post.png154.88KB50.97KB▼ 67.09%
admin-screen.png89.13KB33.13KB▼ 62.83%