93% hiweb-soft-search

Code Review | hiWeb Soft Search

WordPress plugin hiWeb Soft Search scored 93% from 54 tests.

About plugin

  • Plugin page: hiweb-soft-search
  • Plugin version: 2.0.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.6
  • WordPress version: 5.8.1
  • First release: Sep 22, 2016
  • Latest release: Nov 19, 2017
  • Number of updates: 5
  • Update frequency: every 84.6 days
  • Top authors: Den Media (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 556 total downloads

Benchmarks

Plugin footprint Passed 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.25MB] [CPU: ▼161.02ms] Passed 4 tests

An overview of server-side resources used by hiWeb Soft Search
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.93 ▲0.0939.00 ▼1.84
Dashboard /wp-admin3.15 ▲0.1052.54 ▼10.74
Posts /wp-admin/edit.php3.24 ▲0.1358.20 ▲7.16
Add New Post /wp-admin/post-new.php4.13 ▼1.3055.82 ▼633.40
Media Library /wp-admin/upload.php3.09 ▲0.0942.80 ▲1.91
hiWeb Soft Search /wp-admin/tools.php?page=hw-search-simple3.0636.18

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

A short overview of filesystem and database impact
There were no storage issued detected upon installing this plugin
Filesystem: 26 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

Checking browser requirements for hiWeb Soft Search
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,708 ▲13615.66 ▲0.0211.31 ▲0.4748.96 ▼12.12
Dashboard /wp-admin2,975 ▲415.85 ▼0.25153.25 ▼17.16118.85 ▼4.27
Posts /wp-admin/edit.php2,744 ▲52.71 ▲0.0173.50 ▼17.7396.92 ▼12.22
Add New Post /wp-admin/post-new.php1,656 ▲4120.91 ▼0.56314.43 ▼25.87127.31 ▲6.99
Media Library /wp-admin/upload.php1,812 ▲55.03 ▼0.01177.11 ▲6.75125.78 ▲1.88
hiWeb Soft Search /wp-admin/tools.php?page=hw-search-simple1,1292.3660.6380.77

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Uninstall script ran successfully

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
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 items
  • 20× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Warning
      array_flip() expects parameter 1 to be array, null given in wp-content/plugins/hiweb-soft-search/template/tools_page.php on line 5
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/hiweb-soft-search/inc/define.php on line 12
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/hiweb-soft-search/inc/define.php on line 13
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/hiweb-soft-search/include/define.php on line 13
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/hiweb-soft-search/include/define.php on line 12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/hiweb-soft-search/inc/adminmenu.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function hiweb_soft_search\\meta_box\\add_action() in wp-content/plugins/hiweb-soft-search/include/meta_box.php:12
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/hiweb-soft-search/include/define.php on line 13
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_URL - assumed 'WP_PLUGIN_URL' (this will throw an Error in a future version of PHP) in wp-content/plugins/hiweb-soft-search/include/define.php on line 11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function hiweb_soft_search\\tools\\add_action() in wp-content/plugins/hiweb-soft-search/include/tools.php:12

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 81% 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:
  • Tags: You are using too many tags: 15 tag instead of maximum 10
  • Donate link: Please fix this invalid URI: ""
  • Screenshots: Screenshot #1 (Tool for Re-generate Index Data.) image missing
The official readme.txt is a good inspiration

hiweb-soft-search/hiweb-search-simple.php 92% from 13 tests

Analyzing the main PHP file in "hiWeb Soft Search" version 2.0.0.0
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("hiweb-soft-search.php" instead of "hiweb-search-simple.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected998 lines of code in 22 files:
LanguageFilesBlank linesComment linesLines of code
PHP19137244894
JavaScript114496
CSS1115
Sass1003

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.54
Average class complexity27.33
▷ Minimum class complexity1.00
▷ Maximum class complexity99.00
Average method complexity7.32
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces4
Interfaces0
Traits0
Classes6
▷ Abstract classes116.67%
▷ Concrete classes583.33%
▷ Final classes00.00%
Methods25
▷ Static methods28.00%
▷ Public methods2288.00%
▷ Protected methods00.00%
▷ Private methods312.00%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants36
▷ Global constants36100.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
1 PNG file occupies 0.04MB with 0.02MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png45.88KB22.23KB▼ 51.54%