73% premmerce-search

Code Review | Premmerce Product Search for WooCommerce

WordPress plugin Premmerce Product Search for WooCommerce scored73%from 54 tests.

About plugin

  • Plugin page: premmerce-search
  • Plugin version: 2.2.4
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.0-6.3
  • WordPress version: 6.3.1
  • First release: Nov 6, 2017
  • Latest release: Aug 11, 2023
  • Number of updates: 43
  • Update frequency: every 49.0 days
  • Top authors: premmerce (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

1,000+ active /48,960 total downloads

Benchmarks

Plugin footprint 65% 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.54MB] [CPU: ▼1.90ms] 75% from 4 tests

A check of server-side resources used by Premmerce Product Search for WooCommerce
Please have a look at the following items
  • CPU: The total CPU usage must kept under 500.00ms (currently 1,738.20ms on /wp-admin/admin.php?page=premmerce-search-admin)
PageMemory (MB)CPU Time (ms)
Home /4.06 ▲0.6038.70 ▲0.94
Dashboard /wp-admin3.92 ▲0.5749.33 ▼16.04
Posts /wp-admin/edit.php3.97 ▲0.6152.10 ▲9.05
Add New Post /wp-admin/post-new.php6.43 ▲0.5595.17 ▲0.30
Media Library /wp-admin/upload.php3.68 ▲0.4541.82 ▲7.22
Search settings /wp-admin/admin.php?page=premmerce-search-admin3.921,738.20
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius4.0339.52

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 434 new files
Database: 1 new table, 13 new options
New tables
wp_premmerce_search_words
New WordPress options
widget_recent-posts
fs_accounts
fs_active_plugins
premmerce_search_min_symbols_to_search
fs_debug_mode
premmerce_search_results_num
premmerce_search_autocomplete_fields
can_compress_scripts
theysaidso_admin_options
widget_recent-comments
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for Premmerce Product Search for WooCommerce
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,866 ▲12013.23 ▼1.351.62 ▼0.1532.48 ▼10.30
Dashboard /wp-admin2,269 ▲845.87 ▲0.0195.50 ▼5.4143.09 ▼0.19
Posts /wp-admin/edit.php2,157 ▲682.05 ▲0.0641.97 ▲4.9338.38 ▲5.31
Add New Post /wp-admin/post-new.php1,546 ▲3222.98 ▲5.35576.60 ▼107.1647.60 ▼2.07
Media Library /wp-admin/upload.php1,457 ▲664.26 ▼0.02101.37 ▼0.5342.81 ▼2.56
Search settings /wp-admin/admin.php?page=premmerce-search-admin1,0191.7630.2358.01
Freemius Debug [v.2.5.10] /wp-admin/admin.php?page=freemius1,1231.8423.6927.13

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Notice in wp-content/plugins/premmerce-search/freemius/includes/class-freemius.php+8486
    Undefined property: stdClass::$plugins
  • The uninstall procedure has failed, leaving 9 options in the database
    • fs_active_plugins
    • widget_recent-posts
    • fs_debug_mode
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • fs_accounts
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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 fix the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'Yaoi\\Command' not found in wp-content/plugins/premmerce-search/vendor/behat/transliterator/src/Behat/Transliterator/SyncTool.php:21
    • > PHP Fatal error
      Uncaught Error: Interface 'Premmerce\\SDK\\V2\\Plugin\\PluginInterface' not found in wp-content/plugins/premmerce-search/src/SearchPlugin.php:16

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)
There were no browser issues found

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
4 plugin tags: product search, live product search, ajax product search, woocommerce product search

premmerce-search/premmerce-search.php 85% from 13 tests

"Premmerce Product Search for WooCommerce" version 2.2.4's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 150 characters long)
  • Requires at least: Required version does not match the one declared in readme.txt ("4.8" instead of "3.0.0")

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Everything looks great! No dangerous files found in this plugin40,010 lines of code in 367 files:
LanguageFilesBlank linesComment linesLines of code
PHP3348,43418,20638,580
PO File5193218508
JavaScript56397290
SVG101226
JSON300150
CSS15262141
Markdown4750115

PHP code 50% from 2 tests

A short review of cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 3,073)
Cyclomatic complexity
Average complexity per logical line of code0.61
Average class complexity73.52
▷ Minimum class complexity1.00
▷ Maximum class complexity3,073.00
Average method complexity4.44
▷ Minimum method complexity1.00
▷ Maximum method complexity94.00
Code structure
Namespaces11
Interfaces1
Traits0
Classes63
▷ Abstract classes34.76%
▷ Concrete classes6095.24%
▷ Final classes00.00%
Methods1,389
▷ Static methods22616.27%
▷ Public methods98370.77%
▷ Protected methods181.30%
▷ Private methods38827.93%
Functions111
▷ Named functions9989.19%
▷ Anonymous functions1210.81%
Constants152
▷ Global constants9864.47%
▷ Class constants5435.53%
▷ Public constants54100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
14 PNG files occupy 0.11MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
freemius/assets/img/theme-icon.png10.97KB5.78KB▼ 47.37%
assets/admin/js/pricing-page/fde48e4609a6ddc11d639fc2421f2afd.png10.97KB5.78KB▼ 47.37%
assets/admin/js/pricing-page/fe6924369fdcfe0790df1755f773ff60.png1.21KB0.97KB▼ 19.69%
assets/admin/js/pricing-page/c03f665db27af43971565560adfba594.png6.06KB3.01KB▼ 50.27%
freemius/assets/img/plugin-icon.png9.16KB5.26KB▼ 42.58%