68% narnoo-commerce-manager

Code Review | Narnoo Commerce Manager

WordPress plugin Narnoo Commerce Manager scored 68% from 54 tests.

About plugin

  • Plugin page: narnoo-commerce-m...
  • Plugin version: 1.6.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-5.2.2
  • WordPress version: 6.3.1
  • First release: Aug 20, 2018
  • Latest release: Nov 11, 2019
  • Number of updates: 40
  • Update frequency: every 11.5 days
  • Top authors: Narnoo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 969 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.37ms] Passed 4 tests

This is a short check of server-side resources used by Narnoo Commerce Manager
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.30 ▼5.73
Dashboard /wp-admin3.31 ▲0.0047.78 ▼3.13
Posts /wp-admin/edit.php3.36 ▲0.0048.07 ▼5.44
Add New Post /wp-admin/post-new.php5.89 ▲0.0089.61 ▼11.17
Media Library /wp-admin/upload.php3.23 ▲0.0035.47 ▲0.14

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 243 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
db_upgraded
widget_recent-comments

Browser metrics Passed 4 tests

A check of browser resources used by Narnoo Commerce Manager
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲6513.31 ▼1.281.79 ▼0.4246.01 ▼1.47
Dashboard /wp-admin2,209 ▲305.80 ▼0.01103.08 ▼6.7440.25 ▼8.62
Posts /wp-admin/edit.php2,086 ▼61.99 ▼0.0237.26 ▼3.1633.92 ▼4.04
Add New Post /wp-admin/post-new.php1,537 ▼523.15 ▲4.96655.34 ▲36.5652.28 ▲0.70
Media Library /wp-admin/upload.php1,388 ▲34.26 ▲0.0697.72 ▼2.1941.02 ▼0.95

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
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

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
Please fix the following items
  • 15× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/narnoo-commerce-manager/templates/ncm-checkout-payment.php
    • > /wp-content/plugins/narnoo-commerce-manager/templates/ncm_display_availability_calendar.php
    • > /wp-content/plugins/narnoo-commerce-manager/templates/ncm-order-passenger.php
    • > /wp-content/plugins/narnoo-commerce-manager/includes/views/ncm_settings_email_preview.php
    • > /wp-content/plugins/narnoo-commerce-manager/templates/ncm-product-display-availability.php
    • > /wp-content/plugins/narnoo-commerce-manager/templates/ncm-checkout-product.php
    • > /wp-content/plugins/narnoo-commerce-manager/templates/ncm-cart-item.php
    • > /wp-content/plugins/narnoo-commerce-manager/lib/stripe/build.php
    • > /wp-content/plugins/narnoo-commerce-manager/templates/ncm-product-content.php
    • > /wp-content/plugins/narnoo-commerce-manager/lib/stripe/update_certs.php
  • 238× GET requests to PHP files trigger server-side errors or Error 500 responses (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/narnoo-commerce-manager/narnoo-commerce-manager.php on line 213
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/narnoo-commerce-manager/templates/emails/admin-cancelled-order-html.php:1
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/narnoo-commerce-manager/templates/ncm-cart-item.php on line 7
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/narnoo-commerce-manager/templates/ncm-cart-item.php on line 9
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/narnoo-commerce-manager/lib/stripe/lib/SKU.php:25
    • > PHP Fatal error
      Uncaught Error: Call to a member function get_payment_gateways() on null in wp-content/plugins/narnoo-commerce-manager/includes/views/ncm_settings_checkout.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Stripe\\HttpClient\\ClientInterface' not found in wp-content/plugins/narnoo-commerce-manager/lib/stripe/lib/HttpClient/CurlClient.php:25
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/narnoo-commerce-manager/templates/ncm-cart-item.php on line 11
    • > PHP Fatal error
      Uncaught Error: Class 'Stripe\\ApiResource' not found in wp-content/plugins/narnoo-commerce-manager/lib/stripe/lib/FileUpload.php:17
    • > PHP Fatal error
      Uncaught Error: Call to undefined function has_post_thumbnail() in wp-content/plugins/narnoo-commerce-manager/templates/ncm-product-details-gallery.php:4

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Donate link: Invalid url: ""
  • Screenshots: Screenshot #1 (This screenshot show how you can interact with your members through the WordPress admin panel.) image required
Please take inspiration from this readme.txt

narnoo-commerce-manager/narnoo-commerce-manager.php Passed 13 tests

This is the main PHP file of "Narnoo Commerce Manager" version 1.6.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
81 characters long description:
Allows Narnoo distributors to manager their bookings via the Narnooo BYOB system.

Code Analysis 5% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
It is important to fix the following items
  • You should never include executable (binary) or otherwise dangerous files in your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/narnoo-commerce-manager/lib/stripe/data/ca-certificates.crt
41,461 lines of code in 223 files:
LanguageFilesBlank linesComment linesLines of code
PHP18925,0743,84817,836
CSS1510,98043611,771
JavaScript112,2946348,606
SVG1002,671
Markdown22080475
JSON10036
YAML27136
XML20030

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity15.01
▷ Minimum class complexity1.00
▷ Maximum class complexity192.00
Average method complexity3.88
▷ Minimum method complexity1.00
▷ Maximum method complexity45.00
Code structure
Namespaces7
Interfaces2
Traits7
Classes126
▷ Abstract classes75.56%
▷ Concrete classes11994.44%
▷ Final classes00.00%
Methods615
▷ Static methods11318.37%
▷ Public methods56191.22%
▷ Protected methods345.53%
▷ Private methods203.25%
Functions24
▷ Named functions1875.00%
▷ Anonymous functions625.00%
Constants145
▷ Global constants2517.24%
▷ Class constants12082.76%
▷ Public constants120100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
5 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/ncm-arrow.png1.35KB0.43KB▼ 68.07%
assets/images/ncm-top_arr.png1.10KB0.27KB▼ 75.56%
assets/images/ncm-chosen-sprite@2x.png0.72KB0.83KB0.00%
assets/images/controls.png2.19KB0.95KB▼ 56.49%
assets/images/ncm-chosen-sprite.png0.53KB0.88KB0.00%