71% apptivo-ecommerce

Code Review | Apptivo eCommerce

WordPress plugin Apptivo eCommerce scored71%from 54 tests.

About plugin

  • Plugin page: apptivo-ecommerce
  • Plugin version: 2.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1-4.3.1
  • WordPress version: 6.3.1
  • First release: Sep 5, 2012
  • Latest release: Feb 8, 2022
  • Number of updates: 33
  • Update frequency: every 128.3 days
  • Top authors: rmohanasundaram (48.48%)prabhuganapathy (33.33%)apptivo (24.24%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /5,255 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.32MB] [CPU: ▼4.46ms] 75% from 4 tests

Analyzing server-side resources used by Apptivo eCommerce
Please take the time to fix the following items
  • CPU: Total CPU usage should be kept under 500.00ms (currently 865.73ms on /wp-admin/post-new.php?post_type=item)
PageMemory (MB)CPU Time (ms)
Home /3.70 ▲0.2448.95 ▲7.18
Dashboard /wp-admin3.63 ▲0.2952.30 ▼13.95
Posts /wp-admin/edit.php3.73 ▲0.3756.49 ▲8.12
Add New Post /wp-admin/post-new.php6.32 ▲0.4482.31 ▼13.74
Media Library /wp-admin/upload.php3.59 ▲0.3642.93 ▲2.68
Product Categories /wp-admin/edit-tags.php?taxonomy=item_cat&post_type=item3.5439.71
Product Tags /wp-admin/edit-tags.php?taxonomy=item_tag&post_type=item3.5340.55
Products /wp-admin/edit.php?post_type=item3.5940.84
Add Product /wp-admin/post-new.php?post_type=item3.64865.73

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 125 new files
Database: no new tables, 59 new options
New WordPress options
apptivo_ecommerce_print_receipt_logo
apptivo_ecommerce_terms_page_id
widget_theysaidso_widget
apptivo_ecommerce_login_page_id
apptivo_ecommerce_apikey
apptivo_ecommerce_products_slug
apptivo_ecommerce_products_page_title
apptivo_ecommerce_ordernumber_prefix
apptivo_ecommerce_recaptcha_language
apptivo_ecommerce_enable_regular_price
...

Browser metrics Passed 4 tests

Apptivo eCommerce: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,995 ▲24914.08 ▼0.287.08 ▲5.1542.80 ▼3.83
Dashboard /wp-admin2,309 ▲1184.97 ▲0.13105.76 ▼14.7193.88 ▲51.16
Posts /wp-admin/edit.php2,198 ▲1092.03 ▲0.0538.41 ▲1.0433.38 ▼1.80
Add New Post /wp-admin/post-new.php1,598 ▲6522.37 ▼0.70769.19 ▲75.4467.37 ▲12.41
Media Library /wp-admin/upload.php1,488 ▲1004.14 ▼0.13111.96 ▼2.6669.84 ▲25.69
Product Categories /wp-admin/edit-tags.php?taxonomy=item_cat&post_type=item1,3902.1526.3130.24
Product Tags /wp-admin/edit-tags.php?taxonomy=item_tag&post_type=item1,3372.1528.7437.38
Products /wp-admin/edit.php?post_type=item1,3242.0544.3731.55
Add Product /wp-admin/post-new.php?post_type=item2,9129.05213.03139.61

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • Zombie WordPress options detected upon uninstall: 11 options
    • widget_apptivo_recent_products
    • db_upgraded
    • widget_apptivo_product_tags
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_apptivo_product_search
    • widget_recent-comments
    • widget_apptivo_product_categories
    • theysaidso_admin_options
    • widget_apptivo_shopping_cart
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
    • > GET request to /wp-admin/post-new.php?post_type=item
    • > Notice in wp-content/plugins/apptivo-ecommerce/admin/metaboxes/metaboxes-init.php+110
    Undefined property: stdClass::$countOfRecords

SRP 0% 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
Almost there! Just fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/apptivo-ecommerce/paypalredirect.php
    • > /wp-content/plugins/apptivo-ecommerce/captcha_code_file.php
  • 51× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_baginfo() in wp-content/plugins/apptivo-ecommerce/templates/checkout/review_order.php:8
    • > PHP Notice
      Undefined index: cphcacode in wp-content/plugins/apptivo-ecommerce/captcha_code_file.php on line 17
    • > PHP Notice
      Undefined index: token in wp-content/plugins/apptivo-ecommerce/paypalredirect.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/apptivo-ecommerce/templates/register/registerform.php:8
    • > PHP Warning
      imagettfbbox(): Could not find/open font in wp-content/plugins/apptivo-ecommerce/captcha_code_file.php on line 49
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/apptivo-ecommerce/templates/archive-product.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/apptivo-ecommerce/widgets/widget-cart.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function have_posts() in wp-content/plugins/apptivo-ecommerce/templates/custom-products.php:23
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/apptivo-ecommerce/admin/metaboxes/metaboxes-product_data.php:108
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/apptivo-ecommerce/admin/admin-install.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 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
6 plugin tags: paypal, apptivo, ecommerce, integration, registration...

apptivo-ecommerce/apptivo_ecommerce.php 77% from 13 tests

The primary PHP file in "Apptivo eCommerce" version 2.0.3 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Requires at least: Required version must match the one declared in readme.txt ("3.0" instead of "3.1")
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("apptivo-ecommerce.php" instead of "apptivo_ecommerce.php")
  • Description: The description should be shorter than 140 characters (currently 225 characters long)

Code Analysis 97% from 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
Good job! No executable or dangerous file extensions detected12,813 lines of code in 72 files:
LanguageFilesBlank linesComment linesLines of code
PHP661,9691,54410,718
JavaScript32641311,847
CSS320248

PHP code 50% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
These items need your attention
  • Method cyclomatic complexity has to be reduced to less than 100 (currently 106)
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity25.95
▷ Minimum class complexity1.00
▷ Maximum class complexity242.00
Average method complexity5.26
▷ Minimum method complexity1.00
▷ Maximum method complexity106.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes20
▷ Abstract classes00.00%
▷ Concrete classes20100.00%
▷ Final classes00.00%
Methods117
▷ Static methods00.00%
▷ Public methods117100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions233
▷ Named functions233100.00%
▷ Anonymous functions00.00%
Constants27
▷ Global constants27100.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
22 PNG files occupy 0.05MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/btnPrevious.png1.41KB1.19KB▼ 15.74%
admin/template_images/success.png3.26KB0.57KB▼ 82.65%
assets/images/closeme.png1.28KB1.35KB0.00%
assets/images/sprite.png3.42KB2.13KB▼ 37.67%
assets/images/cross_white.png0.14KB0.13KB▼ 4.26%