67% ecommerce-addon

Code Review | eCommerce Addon

WordPress plugin eCommerce Addon scored67%from 54 tests.

About plugin

  • Plugin page: ecommerce-addon
  • Plugin version: 1.4
  • PHP compatiblity: 7.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2
  • WordPress version: 6.3.1
  • First release: Mar 2, 2021
  • Latest release: Jul 6, 2023
  • Number of updates: 9
  • Update frequency: every 95.1 days
  • Top authors: nicheaddons (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /854 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: ▼1.42MB] [CPU: ▼46.82ms] Passed 4 tests

An overview of server-side resources used by eCommerce Addon
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.52 ▼0.957.25 ▼34.26
Dashboard /wp-admin2.61 ▼0.7011.56 ▼36.90
Posts /wp-admin/edit.php2.61 ▼0.7514.80 ▼31.99
Add New Post /wp-admin/post-new.php2.61 ▼3.2810.65 ▼84.11
Media Library /wp-admin/upload.php2.61 ▼0.6211.24 ▼21.40
eCommerce Addon /wp-admin/admin.php?page=naeca_admin_page2.6112.15
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius2.6111.13
Enable & Disable /wp-admin/admin.php?page=naeca_admin_sub_page2.6112.33

Server storage [IO: ▲9.93MB] [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: 337 new files
Database: no new tables, 9 new options
New WordPress options
db_upgraded
fs_active_plugins
widget_recent-posts
fs_debug_mode
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-comments
fs_accounts
can_compress_scripts

Browser metrics Passed 4 tests

eCommerce Addon: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,054 ▲29314.21 ▼0.0827.44 ▲25.7532.04 ▼16.59
Dashboard /wp-admin2,274 ▲945.63 ▼0.0390.81 ▼4.2344.68 ▲0.60
Posts /wp-admin/edit.php2,177 ▲772.13 ▲0.1839.13 ▲1.4840.67 ▲3.49
Add New Post /wp-admin/post-new.php1,578 ▲5023.27 ▲0.22699.29 ▲27.4254.79 ▼8.84
Media Library /wp-admin/upload.php1,479 ▲794.18 ▼0.03101.04 ▼2.9747.10 ▼0.34
eCommerce Addon /wp-admin/admin.php?page=naeca_admin_page9971.6530.7459.03
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1101.6625.2430.36
Enable & Disable /wp-admin/admin.php?page=naeca_admin_sub_page1,2952.0525.7929.57

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
  • The plugin did not uninstall gracefully
    • > Warning in wp-content/plugins/ecommerce-addon/elementor/em-setup.php+65
    Use of undefined constant ELEMENTOR_VERSION - assumed 'ELEMENTOR_VERSION' (this will throw an Error in a future version of PHP)
  • Zombie WordPress options detected upon uninstall: 9 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • fs_debug_mode
    • widget_theysaidso_widget
    • fs_accounts
    • theysaidso_admin_options
    • fs_active_plugins

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Almost there, just fix the following server-side errors
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=naeca_admin_sub_page
    • > Warning in wp-content/plugins/ecommerce-addon/elementor/em-setup.php+65
    Use of undefined constant ELEMENTOR_VERSION - assumed 'ELEMENTOR_VERSION' (this will throw an Error in a future version of PHP)

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please fix the following items
  • 23× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/ecommerce-addon/ecommerce-addon.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Elementor\\get_option() in wp-content/plugins/ecommerce-addon/elementor/widgets/basic/nabasic-subscribe.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Elementor\\get_option() in wp-content/plugins/ecommerce-addon/elementor/widgets/basic/nabasic-products.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Elementor\\get_option() in wp-content/plugins/ecommerce-addon/elementor/widgets/basic/nabasic-banner.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Elementor\\get_option() in wp-content/plugins/ecommerce-addon/elementor/widgets/basic/nabasic-pricing.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Elementor\\get_option() in wp-content/plugins/ecommerce-addon/elementor/widgets/basic/nabasic-counter.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Elementor\\get_option() in wp-content/plugins/ecommerce-addon/elementor/widgets/basic/nabasic-circle-progress.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Elementor\\get_option() in wp-content/plugins/ecommerce-addon/elementor/widgets/basic/nabasic-products-slider.php:9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function Elementor\\get_option() in wp-content/plugins/ecommerce-addon/elementor/widgets/basic/nabasic-testimonials.php:9
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/ecommerce-addon/ecommerce-addon.php on line 12

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 90% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please add descriptions for these screenshots #1, #2, #3, #4 in ecommerce-addon/assets to your readme.txt
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
You can look at the official readme.txt

ecommerce-addon/ecommerce-addon.php 92% from 13 tests

The main PHP script in "eCommerce Addon" version 1.4 is automatically included on every request by WordPress
Please make the necessary changes and fix the following:
  • Description: Please don't use more than 140 characters for the plugin description (currently 196 characters long)

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Everything looks great! No dangerous files found in this plugin89,179 lines of code in 240 files:
LanguageFilesBlank linesComment linesLines of code
PHP1468,72918,00948,276
CSS402,52123516,029
JavaScript363,5614,04213,987
SVG1581310,884
JSON3003

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of classes has to be reduced to less than 1000 (currently 3,073)
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 122)
Cyclomatic complexity
Average complexity per logical line of code0.56
Average class complexity74.32
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.81
▷ Minimum method complexity1.00
▷ Maximum method complexity122.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes71
▷ Abstract classes22.82%
▷ Concrete classes6997.18%
▷ Final classes00.00%
Methods1,395
▷ Static methods20514.70%
▷ Public methods96669.25%
▷ Protected methods574.09%
▷ Private methods37226.67%
Functions152
▷ Named functions15098.68%
▷ Anonymous functions21.32%
Constants147
▷ Global constants9866.67%
▷ Class constants4933.33%
▷ Public constants49100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.03MB with 0.02MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/product-bg.png0.95KB0.11KB▼ 88.89%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/ecommerce-addon.png9.16KB5.26KB▼ 42.58%
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%