84% th-advance-product-search

Code Review | Advance WordPress Search Plugin

WordPress plugin Advance WordPress Search Plugin scored84%from 54 tests.

About plugin

  • Plugin page: th-advance-produc...
  • Plugin version: 1.1.9
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.3
  • WordPress version: 6.3.1
  • First release: Sep 18, 2021
  • Latest release: Nov 3, 2023
  • Number of updates: 29
  • Update frequency: every 26.8 days
  • Top authors: themehunk (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10,000+ active /134,980 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲0.22MB] [CPU: ▼5.99ms] Passed 4 tests

Server-side resources used by Advance WordPress Search Plugin
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.65 ▲0.1935.27 ▼6.53
Dashboard /wp-admin3.58 ▲0.2846.21 ▼4.03
Posts /wp-admin/edit.php3.63 ▲0.2841.69 ▼5.27
Add New Post /wp-admin/post-new.php6.10 ▲0.2182.91 ▼8.14
Media Library /wp-admin/upload.php3.44 ▲0.2132.20 ▼0.05
ThemeHunk /wp-admin/admin.php?page=themehunk-plugins3.4931.59
Advance Search /wp-admin/admin.php?page=th-advance-product-search3.4131.66

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 49 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget
widget_thaps-widget
widget_recent-comments
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Advance WordPress Search Plugin
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,928 ▲16613.54 ▼0.819.15 ▲7.4438.51 ▼3.67
Dashboard /wp-admin2,214 ▲365.57 ▼0.1489.14 ▼24.0182.54 ▲36.37
Posts /wp-admin/edit.php2,125 ▲461.95 ▼0.0437.32 ▼2.9332.53 ▼6.35
Add New Post /wp-admin/post-new.php1,559 ▲3023.22 ▲0.05668.92 ▼9.45184.25 ▲133.61
Media Library /wp-admin/upload.php1,425 ▲254.12 ▼0.0799.10 ▲3.8868.60 ▲27.08
ThemeHunk /wp-admin/admin.php?page=themehunk-plugins1,2492.2430.8751.43
Advance Search /wp-admin/admin.php?page=th-advance-product-search3,4313.10150.6053.35

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 were found after uninstall: 7 options
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_thaps-widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 12× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Warning
      include_once(): Failed opening 'THEMEHUNK_PDIRth-option/header.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/th-advance-product-search/inc/themehunk-menu/th-option/tab-html.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/th-advance-product-search/inc/themehunk-menu/th-option/tab-html.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/th-advance-product-search/inc/themehunk-menu/th-option/header.php:8
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/th-advance-product-search/inc/themehunk-menu/admin-menu.php on line 3
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/th-advance-product-search/inc/widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html__() in wp-content/plugins/th-advance-product-search/inc/themehunk-menu/plugins-list.php:4
    • > PHP Warning
      include_once(): Failed opening 'ABSPATHwp-admin/includes/plugin-install.php' for inclusion (include_path='.:/usr/share/php') in wp-content/plugins/th-advance-product-search/inc/themehunk-menu/admin-menu.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/th-advance-product-search/inc/themehunk-menu/th-option/sidebar.php:4
    • > PHP Warning
      include_once(THEMEHUNK_PDIRth-option/header.php): failed to open stream: No such file or directory in wp-content/plugins/th-advance-product-search/inc/themehunk-menu/th-option/tab-html.php on line 9
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/th-advance-product-search/inc/themehunk-menu/admin-menu.php:4

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% 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
These attributes need to be fixed: The official readme.txt is a good inspiration

th-advance-product-search/th-advance-product-search.php 92% from 13 tests

The main file in "Advance WordPress Search Plugin" v. 1.1.9 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please take the time to fix the following:
  • Description: Please keep the plugin description shorter than 140 characters (currently 529 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected5,660 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP151,0271912,338
JavaScript43583271,596
CSS4104211,453
PO File1115120273

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity33.43
▷ Minimum class complexity4.00
▷ Maximum class complexity117.00
Average method complexity3.31
▷ Minimum method complexity1.00
▷ Maximum method complexity42.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods97
▷ Static methods44.12%
▷ Public methods8890.72%
▷ Protected methods00.00%
▷ Private methods99.28%
Functions11
▷ Named functions872.73%
▷ Anonymous functions327.27%
Constants10
▷ Global constants990.00%
▷ Class constants110.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
20 PNG files occupy 0.45MB with 0.28MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/search-autocomplete.png13.97KB5.13KB▼ 63.29%
images/search-2.png10.09KB1.53KB▼ 84.80%
images/search-voice.png6.29KB3.09KB▼ 50.82%
inc/themehunk-menu/th-option/assets/images/th-shop-mania.png34.78KB11.98KB▼ 65.56%
inc/themehunk-menu/th-option/assets/images/icon.png14.32KB7.45KB▼ 47.95%