62% ninja-shop

Code Review | Ninja Shop - The Quickest Way to Start Selling

WordPress plugin Ninja Shop - The Quickest Way to Start Selling scored62%from 54 tests.

About plugin

  • Plugin page: ninja-shop
  • Plugin version: 1.1.11
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-5.2
  • WordPress version: 6.3.1
  • First release: Jul 12, 2018
  • Latest release: Dec 12, 2019
  • Number of updates: 37
  • Update frequency: every 14.1 days
  • Top authors: kbjohnson90 (64.86%)mrpritchett (27.03%)kstover (13.51%)

Code review

54 tests

User reviews

5 reviews

Install metrics

40+ active /7,540 total downloads

Benchmarks

Plugin footprint 64% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲10.56MB] [CPU: ▲65.52ms] 50% from 4 tests

This is a short check of server-side resources used by Ninja Shop - The Quickest Way to Start Selling
Please fix the following
  • RAM: Total memory usage should be kept under 10MB (currently 14.16MB on /wp-admin/admin.php?page=it-exchange-help)
  • Extra RAM: The extra memory usage must be under 5MB (currently 10.56MB on /wp-admin/admin.php?page=it-exchange-help)
PageMemory (MB)CPU Time (ms)
Home /14.36 ▲10.90111.23 ▲73.22
Dashboard /wp-admin14.46 ▲11.11209.97 ▲143.90
Posts /wp-admin/edit.php14.34 ▲10.98127.50 ▲82.49
Add New Post /wp-admin/post-new.php15.29 ▲9.40110.34 ▲11.62
Media Library /wp-admin/upload.php14.21 ▲10.97125.96 ▲94.75
Settings /wp-admin/admin.php?page=it-exchange-settings14.58112.99
Payments /wp-admin/edit.php?post_type=it_exchange_tran14.28105.85
Tools /wp-admin/admin.php?page=it-exchange-tools14.4195.59
Features /wp-admin/admin.php?page=it-exchange-addons14.43109.22
Help /wp-admin/admin.php?page=it-exchange-help14.1697.02

Server storage [IO: ▲7.99MB] [DB: ▲0.03MB] Passed 3 tests

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 1,201 new files
Database: 10 new tables, 24 new options
New tables
wp_ninja_shop_refunds
wp_ninja_shop_sessions
wp_ninja_shop_address
wp_ninja_shop_logs
wp_ninja_shop_payment_tokens
wp_ninja_shop_line_items
wp_ninja_shop_payment_tokensmeta
wp_ninja_shop_refundsmeta
wp_ninja_shop_line_itemsmeta
wp_ninja_shop_transactions
New WordPress options
widget_recent-posts
theysaidso_admin_options
can_compress_scripts
it-exchange-versions
wp_ninja_shop_line_items_version
wp_ninja_shop_logs_version
db_upgraded
wp_ninja_shop_address_version
wp_ninja_shop_transactions_version
it-storage-exchange_emails
...

Browser metrics Passed 4 tests

Ninja Shop - The Quickest Way to Start Selling: an overview of browser usage
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,963 ▲21713.67 ▼0.711.62 ▼0.1227.72 ▼14.08
Dashboard /wp-admin2,359 ▲1685.89 ▲1.01114.13 ▼10.7152.84 ▲9.65
Posts /wp-admin/edit.php2,156 ▲672.05 ▲0.0240.57 ▲3.6440.88 ▲6.35
Add New Post /wp-admin/post-new.php1,613 ▲9419.64 ▼3.61701.10 ▲4.9457.96 ▲13.05
Media Library /wp-admin/upload.php1,457 ▲694.27 ▲0.10110.83 ▲12.3151.09 ▲10.68
Settings /wp-admin/admin.php?page=it-exchange-settings4,4637.31164.7992.61
Payments /wp-admin/edit.php?post_type=it_exchange_tran1,1772.0440.4034.48
Tools /wp-admin/admin.php?page=it-exchange-tools8881.8635.4328.49
Features /wp-admin/admin.php?page=it-exchange-addons1,3991.9035.9757.03
Help /wp-admin/admin.php?page=it-exchange-help8831.8738.7431.81

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Zombie tables were found after uninstall: 10 tables
    • wp_ninja_shop_refunds
    • wp_ninja_shop_line_itemsmeta
    • wp_ninja_shop_payment_tokensmeta
    • wp_ninja_shop_line_items
    • wp_ninja_shop_address
    • wp_ninja_shop_transactions
    • wp_ninja_shop_refundsmeta
    • wp_ninja_shop_sessions
    • wp_ninja_shop_logs
    • wp_ninja_shop_payment_tokens
  • This plugin does not fully uninstall, leaving 24 options in the database
    • it-storage-exchange_settings_general
    • wp_ninja_shop_line_items_version
    • widget_recent-comments
    • wp_ninja_shop_logs_version
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options
    • it-exchange-hide-template-update-nag
    • it-exchange-versions
    • wp_ninja_shop_refundsmeta_version
    • ...

Smoke tests 25% 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
    • > GET request to /wp-admin/admin.php?page=it-exchange-settings
    • > Deprecated in wp-content/plugins/ninja-shop/lib/admin/views/settings/general.php+235
    implode(): Passing glue string after array is deprecated. Swap the parameters

SRP 0% 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
  • 1× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/ninja-shop/lib/super-widget/ajax.php
  • 1039× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ninja-shop/core-addons/transaction-methods/paypal-standard/init.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'IronBound\\DB\\Builder' not found in wp-content/plugins/ninja-shop/vendor/ironbound/db/tests/Stub/builder.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'IT_Theme_API' not found in wp-content/plugins/ninja-shop/api/theme/billing.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/ninja-shop/lib/templates/content-registration.php:20
    • > PHP Fatal error
      Uncaught Error: Interface 'IT_Exchange_Email_Middleware' not found in wp-content/plugins/ninja-shop/lib/email-notifications/middleware/class.style-links.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'IronBound\\DB\\Tests\\TestCase' not found in wp-content/plugins/ninja-shop/vendor/ironbound/db/tests/unit/query/tag/test-order.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'IronBound\\DB\\Tests\\TestCase' not found in wp-content/plugins/ninja-shop/vendor/ironbound/db/tests/integration/test-trash.php:23
    • > PHP Fatal error
      Uncaught Error: Class 'Doctrine\\Tests\\DoctrineTestCase' not found in wp-content/plugins/ninja-shop/vendor/doctrine/inflector/tests/Doctrine/Tests/Common/Inflector/InflectorTest.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ninja-shop/core-addons/taxes/taxes-canada/lib/addon-settings.php:145
    • > PHP Fatal error
      Uncaught Error: Class 'JsonSchema\\Constraints\\Constraint' not found in wp-content/plugins/ninja-shop/vendor/justinrainbow/json-schema/src/JsonSchema/Constraints/EnumConstraint.php:20

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

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
5 plugin tags: store, e-commerce, sales, sell, ecommerce

ninja-shop/init.php 85% from 13 tests

The main file in "Ninja Shop - The Quickest Way to Start Selling" v. 1.1.11 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ninja-shop.php" instead of "init.php")
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
There were no executable files found in this plugin115,176 lines of code in 1,468 files:
LanguageFilesBlank linesComment linesLines of code
PHP1,29826,45657,63087,259
JavaScript622,4272,3897,877
PO File23,1713,8447,690
SVG5033,902
Sass624582,748
CSS433871962,677
Markdown1443701,326
JSON1400911
HTML8690353
XML9124248
YAML6428181
Bourne Shell1304

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity13.42
▷ Minimum class complexity1.00
▷ Maximum class complexity378.00
Average method complexity2.60
▷ Minimum method complexity1.00
▷ Maximum method complexity74.00
Code structure
Namespaces86
Interfaces89
Traits6
Classes633
▷ Abstract classes426.64%
▷ Concrete classes59193.36%
▷ Final classes81.35%
Methods5,857
▷ Static methods5028.57%
▷ Public methods5,28890.29%
▷ Protected methods5178.83%
▷ Private methods520.89%
Functions1,049
▷ Named functions78574.83%
▷ Anonymous functions26425.17%
Constants109
▷ Global constants65.50%
▷ Class constants10394.50%
▷ Public constants103100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
47 PNG files occupy 0.30MB with 0.15MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
lib/admin/images/addons64.png0.84KB0.71KB▼ 15.62%
lib/admin/images/failed.png17.64KB2.37KB▼ 86.56%
lib/assets/styles/images/amex.png1.52KB1.47KB▼ 2.71%
lib/admin/images/achievement.png5.62KB1.72KB▼ 69.44%
lib/admin/images/wizard-membership.png3.58KB0.80KB▼ 77.75%