78% ns-product-brand

Code Review | Product Brand

WordPress plugin Product Brand scored78%from 54 tests.

About plugin

  • Plugin page: ns-product-brand
  • Plugin version: 1.1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5-5.9
  • WordPress version: 6.3.1
  • First release: Mar 9, 2017
  • Latest release: Feb 7, 2022
  • Number of updates: 33
  • Update frequency: every 54.2 days
  • Top authors: nsthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

40+ active /2,140 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.13MB] [CPU: ▼0.51ms] Passed 4 tests

This is a short check of server-side resources used by Product Brand
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1137.25 ▼3.18
Dashboard /wp-admin3.48 ▲0.1750.94 ▲6.39
Posts /wp-admin/edit.php3.56 ▲0.2053.94 ▲5.81
Add New Post /wp-admin/post-new.php6.02 ▲0.1482.32 ▼11.07
Media Library /wp-admin/upload.php3.34 ▲0.1244.85 ▲7.80
/wp-admin/admin.php?page=plugineye2753.3436.05
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version3.3131.53
Product Brand /wp-admin/admin.php?page=ns-product-brand/ns-admin-options/ns_admin_option_dashboard.php3.3435.93

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
widget_theysaidso_widget
widget_recent-posts
db_upgraded
theysaidso_admin_options
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Product Brand
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,992 ▲25714.77 ▲0.391.87 ▲0.0841.54 ▼9.34
Dashboard /wp-admin2,358 ▲1676.54 ▲1.59130.69 ▲30.4396.56 ▲59.30
Posts /wp-admin/edit.php2,279 ▲1873.42 ▲1.3953.52 ▲12.1475.24 ▲40.92
Add New Post /wp-admin/post-new.php1,541 ▲1317.52 ▼5.51667.97 ▲56.4136.55 ▼14.57
Media Library /wp-admin/upload.php1,421 ▲334.18 ▼0.0596.27 ▼0.6183.93 ▲42.56
/wp-admin/admin.php?page=plugineye2751,0803.0342.4576.80
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version6941.729.6317.65
Product Brand /wp-admin/admin.php?page=ns-product-brand/ns-admin-options/ns_admin_option_dashboard.php1,1083.1538.1265.47

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-posts

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
These server-side errors were triggered
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=how-to-install-premium-version
    • > Warning in wp-includes/pluggable.php+1438
    Cannot modify header information - headers already sent by (output started at wp-includes/script-loader.php:2838)

SRP 50% 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
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-product-brand/plugineye/plugineye-ajax/plugineye_on_deactivation_function.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Please add images for these screenshots: #1 (Settings Product Brand.), #2 (View single product page with brand.), #3 (View page brand.)
You can look at the official readme.txt

ns-product-brand/ns-product-brand.php Passed 13 tests

The principal PHP file in "Product Brand" v. 1.1.4 is loaded by WordPress automatically on each request
44 characters long description:
This plugin allow to add a Brand to Products

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
Good job! No executable or dangerous file extensions detected1,117 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
PHP11117183686
CSS3228276
PO File1323280
JavaScript214175

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.20
Average class complexity20.00
▷ Minimum class complexity20.00
▷ Maximum class complexity20.00
Average method complexity2.23
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods19
▷ Static methods00.00%
▷ Public methods526.32%
▷ Protected methods00.00%
▷ Private methods1473.68%
Functions24
▷ Named functions1458.33%
▷ Anonymous functions1041.67%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
7 PNG files occupy 0.54MB with 0.30MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
ns-admin-options/img/productbrand-01-guide.png41.33KB12.29KB▼ 70.27%
screenshot-2.png120.31KB38.26KB▼ 68.20%
ns-admin-options/img/ns-theme-promo.png29.37KB8.96KB▼ 69.50%
ns-admin-options/img/ns_banner_membership-500.png24.95KB26.27KB0.00%
screenshot-3.png170.35KB58.43KB▼ 65.70%