10% wordpress-plugin-for-1shoppingcart

Code Review | Free Wordpress Plugin For 1ShoppingCart.com

WordPress plugin Free Wordpress Plugin For 1ShoppingCart.com scored 10% from 54 tests.

About plugin

  • Plugin page: wordpress-plugin-...
  • Plugin version: 0.9.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.9.1
  • WordPress version: 5.8.1
  • First release: Nov 17, 2011
  • Latest release: Jan 10, 2018
  • Number of updates: 36
  • Update frequency: every 62.4 days
  • Top authors: equalserving (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active / 4,312 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • This plugin did not install gracefully
    • > Deprecated in wp-content/plugins/wordpress-plugin-for-1shoppingcart/include/OneShopAPI.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; esOneShopAPI has a deprecated constructor

Server metrics [RAM: ▼1.67MB] [CPU: ▼204.81ms] Passed 4 tests

An overview of server-side resources used by Free Wordpress Plugin For 1ShoppingCart.com
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /1.96 ▼0.875.99 ▼29.02
Dashboard /wp-admin1.98 ▼1.0713.57 ▼34.68
Posts /wp-admin/edit.php1.98 ▼1.129.29 ▼35.57
Add New Post /wp-admin/post-new.php1.98 ▼3.455.98 ▼719.97
Media Library /wp-admin/upload.php1.98 ▼1.026.19 ▼28.32
1SC Settings /wp-admin/options-general.php?page=wordpress-plugin-for-1shoppingcart/es1sc-free.php1.987.86

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: no new tables, 8 new options
New WordPress options
es1sc_mid
es1sc_merchant_key
es1sc_buynow_url
es1sc_api_uri
es1sc_product_list_item_format
es1sc_no_image
es1sc_cart_image
es1sc_merchant_id

Browser metrics Passed 4 tests

Checking browser requirements for Free Wordpress Plugin For 1ShoppingCart.com
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲11215.77 ▲0.149.17 ▼2.3250.29 ▼4.78
Dashboard /wp-admin2,978 ▲485.88 ▼0.03142.96 ▼10.40130.39 ▲8.84
Posts /wp-admin/edit.php2,744 ▲52.69 ▼0.0066.83 ▼2.5793.28 ▼4.19
Add New Post /wp-admin/post-new.php1,686 ▲318.74 ▲0.42380.89 ▼13.88113.56 ▼0.56
Media Library /wp-admin/upload.php1,830 ▲235.02 ▼0.03157.93 ▼11.46121.58 ▼0.30
1SC Settings /wp-admin/options-general.php?page=wordpress-plugin-for-1shoppingcart/es1sc-free.php1,4742.0969.3794.08

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/wordpress-plugin-for-1shoppingcart/include/OneShopAPI.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; esOneShopAPI has a deprecated constructor
  • The uninstall procedure has failed, leaving 1 option in the database
    • es1sc_mid

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 server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=wordpress-plugin-for-1shoppingcart/es1sc-free.php
    • > Deprecated in wp-content/plugins/wordpress-plugin-for-1shoppingcart/include/OneShopAPI.php+5
    Methods with the same name as their class will not be constructors in a future version of PHP; esOneShopAPI has a deprecated constructor

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
Please fix the following items
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Class 'OneShopAPI' not found in wp-content/plugins/wordpress-plugin-for-1shoppingcart/include/OneShopNotificationListener.php:5
    • > PHP Warning
      include(../Library/OneShopAPI.php): failed to open stream: No such file or directory in wp-content/plugins/wordpress-plugin-for-1shoppingcart/include/OneShopNotificationListener.php on line 2
    • > PHP Warning
      include(): Failed opening '../Library/OneShopAPI.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/wordpress-plugin-for-1shoppingcart/include/OneShopNotificationListener.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wordpress-plugin-for-1shoppingcart/es1sc-free.php:19

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (1SC Setting page. screenshot-1.png.), #2 (Example of the product listing on a page. screenshot-2.png.)
The official readme.txt might help

wordpress-plugin-for-1shoppingcart/es1sc-free.php 85% from 13 tests

The main file in "Free Wordpress Plugin For 1ShoppingCart.com" v. 0.9.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("wordpress-plugin-for-1shoppingcart.php" instead of "es1sc-free.php")
  • Description: Please don't use more than 140 characters for the plugin description (currently 539 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected616 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP48956616

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity7.00
▷ Minimum class complexity7.00
▷ Maximum class complexity7.00
Average method complexity1.38
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods16
▷ Static methods00.00%
▷ Public methods16100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
10 PNG files occupy 0.25MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/add-to-cart-green.png2.63KB1.09KB▼ 58.42%
images/add-to-cart-black.png2.31KB1.09KB▼ 52.62%
screenshot-1.png127.70KB37.97KB▼ 70.26%
images/add-to-cart-white.png2.36KB1.09KB▼ 53.60%
screenshot-2.png99.08KB35.47KB▼ 64.20%