78% ns-add-product-frontend

Code Review | NS Add Product Frontend for Woocommerce

WordPress plugin NS Add Product Frontend for Woocommerce scored78%from 54 tests.

About plugin

  • Plugin page: ns-add-product-fr...
  • Plugin version: 2.0.5
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-6.1
  • WordPress version: 6.3.1
  • First release: Dec 16, 2016
  • Latest release: Mar 24, 2023
  • Number of updates: 70
  • Update frequency: every 32.6 days
  • Top authors: nsthemes (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active /11,206 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.19MB] [CPU: ▲0.32ms] Passed 4 tests

Analyzing server-side resources used by NS Add Product Frontend for Woocommerce
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.64 ▲0.1842.42 ▲2.36
Dashboard /wp-admin3.50 ▲0.1946.81 ▼2.84
Posts /wp-admin/edit.php3.61 ▲0.2544.13 ▲0.42
Add New Post /wp-admin/post-new.php6.10 ▲0.2199.48 ▲11.67
Media Library /wp-admin/upload.php3.42 ▲0.1937.71 ▲1.33
/wp-admin/admin.php?page=plugineye2053.3930.53

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

Input-output and database impact of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 58 new files
Database: no new tables, 9 new options
New WordPress options
apf_reviews_installed_on
db_upgraded
can_compress_scripts
widget_recent-comments
apf_plugin_template
apf_plugin_page_id
widget_recent-posts
theysaidso_admin_options
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for NS Add Product Frontend for Woocommerce
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,931 ▲19614.10 ▼0.286.28 ▲4.3346.03 ▼5.92
Dashboard /wp-admin2,226 ▲385.85 ▼0.04101.30 ▼14.2277.43 ▲29.49
Posts /wp-admin/edit.php2,106 ▲201.98 ▼0.0135.22 ▼1.7033.30 ▼2.27
Add New Post /wp-admin/post-new.php1,684 ▲17022.40 ▲4.88725.03 ▲24.6556.03 ▲2.82
Media Library /wp-admin/upload.php1,396 ▲54.22 ▲0.0097.35 ▼9.3367.71 ▲23.81
/wp-admin/admin.php?page=plugineye2058962.1626.5925.34

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
  • This plugin does not fully uninstall, leaving 7 options in the database
    • can_compress_scripts
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • apf_reviews_installed_on

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Please fix the following
  • 6× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/ns-add-product-frontend/templates/apf-wc-standard-template/apf-wc-standard-template.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-add-product-frontend/plugineye/plugineye-ajax/plugineye_on_deactivation_function.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/ns-add-product-frontend/inc/apf-include-template.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-add-product-frontend/async/apf-product-attributes.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/ns-add-product-frontend/inc/apf-activate-deactivate.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-add-product-frontend/async/apf-save-simple-product.php:3

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please take a look at the following user-side issues
    • > GET request to /wp-admin/admin.php?page=plugineye205
    • > Network (severe)
    wp-content/plugins/ns-add-product-frontend/ns-admin-options/js/ns-option-js-page.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 88% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Please fix the following attributes:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
  • Screenshots: Add images for these screenshots: #1 (Settings add product.), #2 (View frontend example.)
The official readme.txt might help

ns-add-product-frontend/ns-apf-home.php 92% from 13 tests

This is the main PHP file of "NS Add Product Frontend for Woocommerce" version 2.0.5, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Main file name: The principal plugin file should be the same as the plugin slug ("ns-add-product-frontend.php" instead of "ns-apf-home.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
There were no executable files found in this plugin10,454 lines of code in 52 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript99521,6064,891
CSS81281042,772
PHP252183291,804
LESS96861740
PO File19595247

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity33.00
▷ Minimum class complexity20.00
▷ Maximum class complexity46.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods34
▷ Static methods1544.12%
▷ Public methods2058.82%
▷ Protected methods00.00%
▷ Private methods1441.18%
Functions23
▷ Named functions1252.17%
▷ Anonymous functions1147.83%
Constants2
▷ Global constants2100.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
2 PNG files occupy 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
ns-admin-options/img/backend-sidebar-icon.png1.48KB0.54KB▼ 63.47%
ns-admin-options/img/icon-128x128.png5.16KB2.52KB▼ 51.14%