78% ns-product-marketing-popup-for-woocommerce

Code Review | NS Product Marketing Popup for WooCommerce

WordPress plugin NS Product Marketing Popup for WooCommerce scored78%from 54 tests.

About plugin

  • Plugin page: ns-product-market...
  • Plugin version: 1.7.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-5.9
  • WordPress version: 6.3.1
  • First release: Oct 2, 2016
  • Latest release: Feb 11, 2022
  • Number of updates: 54
  • Update frequency: every 36.3 days
  • Top authors: nsthemes (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,948 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼9.98ms] Passed 4 tests

Analyzing server-side resources used by NS Product Marketing Popup for WooCommerce
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0340.18 ▼2.41
Dashboard /wp-admin3.34 ▼0.0146.50 ▼17.61
Posts /wp-admin/edit.php3.45 ▲0.0944.25 ▼9.69
Add New Post /wp-admin/post-new.php5.94 ▲0.0583.69 ▼8.64
Media Library /wp-admin/upload.php3.26 ▲0.0333.99 ▼3.96
Marketing Popup /wp-admin/admin.php?page=ns-product-marketing-popup-for-woocommerce/ns-admin-options/ns_admin_option_dashboard.php3.2936.30
/wp-admin/admin.php?page=plugineye2433.2232.21
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version3.2030.62

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 36 new files
Database: no new tables, 9 new options
New WordPress options
can_compress_scripts
widget_recent-comments
ns_pmpfw_delay
widget_theysaidso_widget
theysaidso_admin_options
ns_pmpfw_text
db_upgraded
widget_recent-posts
ns_pmpfw_test_mode

Browser metrics Passed 4 tests

This is an overview of browser requirements for NS Product Marketing Popup for WooCommerce
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,080 ▲30913.75 ▼0.6317.04 ▲15.1043.22 ▼4.46
Dashboard /wp-admin2,226 ▲415.10 ▼0.77101.58 ▼18.3176.06 ▲31.90
Posts /wp-admin/edit.php2,121 ▲532.05 ▲0.0034.39 ▲0.2134.85 ▼1.35
Add New Post /wp-admin/post-new.php1,543 ▲1523.19 ▲4.88788.82 ▲148.3952.87 ▲8.21
Media Library /wp-admin/upload.php1,417 ▲324.28 ▲0.13102.03 ▼2.6873.54 ▲28.36
Marketing Popup /wp-admin/admin.php?page=ns-product-marketing-popup-for-woocommerce/ns-admin-options/ns_admin_option_dashboard.php1,7136.91137.98118.92
/wp-admin/admin.php?page=plugineye2439081.7624.5424.37
How to install premium version /wp-admin/admin.php?page=how-to-install-premium-version6861.556.8919.94

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 9 options
    • ns_pmpfw_test_mode
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • ns_pmpfw_delay
    • db_upgraded
    • can_compress_scripts
    • widget_recent-posts
    • ns_pmpfw_text
    • widget_recent-comments

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Please fix the following server-side errors
  • 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 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-product-marketing-popup-for-woocommerce/ns-product-marketing-popup-for-woocommerce-add-tab.php:8
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/ns-product-marketing-popup-for-woocommerce/plugineye/plugineye-ajax/plugineye_on_deactivation_function.php:2

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Add images for these screenshots: #1 (View NS Product Marketing Popup for WooCommerce in site.), #2 (Settings NS Product Marketing Popup for WooCommerce.)
  • Tags: Please reduce the number of tags, currently 17 tag instead of maximum 10
The official readme.txt is a good inspiration

ns-product-marketing-popup-for-woocommerce/ns-product-marketing-popup-for-woocommerce.php Passed 13 tests

The main PHP file in "NS Product Marketing Popup for WooCommerce" ver. 1.7.3 adds more information about the plugin and also serves as the entry point for this plugin
71 characters long description:
Create a Layer the first access to site and add your Highlights product

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin1,316 lines of code in 21 files:
LanguageFilesBlank linesComment linesLines of code
PHP1293197714
CSS53855427
PO File13939100
JavaScript324275

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.18
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%
Functions25
▷ Named functions1560.00%
▷ Anonymous functions1040.00%
Constants2
▷ Global constants2100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
11 PNG files occupy 0.40MB with 0.24MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/banneriiino.png8.91KB3.87KB▼ 56.55%
screenshot-1.png275.81KB91.29KB▼ 66.90%
ns-admin-options/img/NsCusPlaceHolder-bannerone.png22.08KB8.64KB▼ 60.89%
img/bannerooone.png20.45KB8.94KB▼ 56.30%
screenshot-2.png17.68KB8.11KB▼ 54.11%