73% xunsearch

Code Review | XunSearch

WordPress plugin XunSearch scored73%from 54 tests.

About plugin

  • Plugin page: xunsearch
  • Plugin version: 0.1.00
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7.3-4.7.3
  • WordPress version: 6.3.1
  • First release: Apr 20, 2017
  • Latest release: Apr 20, 2017
  • Number of updates: 3
  • Update frequency: every 0.3 days
  • Top authors: davinbao (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /625 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
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼4.30ms] Passed 4 tests

An overview of server-side resources used by XunSearch
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1242.16 ▲2.35
Dashboard /wp-admin3.43 ▲0.1358.79 ▲9.75
Posts /wp-admin/edit.php3.48 ▲0.1245.81 ▼5.31
Add New Post /wp-admin/post-new.php6.01 ▲0.1286.11 ▼10.58
Media Library /wp-admin/upload.php3.35 ▲0.1233.78 ▼3.66
XunSearch /wp-admin/plugins.php?page=xunsearch-options3.2635.21

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 138 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_recent-posts
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for XunSearch
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,793 ▲3214.24 ▼0.111.65 ▼0.2244.75 ▲4.37
Dashboard /wp-admin2,202 ▲255.62 ▲0.0493.92 ▲7.5642.00 ▲0.37
Posts /wp-admin/edit.php2,104 ▲72.02 ▲0.0738.20 ▲0.2034.78 ▼5.07
Add New Post /wp-admin/post-new.php1,531 ▲323.51 ▲0.48694.18 ▲2.9361.02 ▲4.07
Media Library /wp-admin/upload.php1,404 ▲74.30 ▲0.0796.48 ▼13.8743.26 ▼3.51
XunSearch /wp-admin/plugins.php?page=xunsearch-options8122.1524.8229.60

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/plugins.php?page=xunsearch-options
    • > Notice in wp-content/plugins/xunsearch/class.xunsearch.php+120
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 7× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/xunsearch/xunsearch-sdk/util/Quest.php
    • > /wp-content/plugins/xunsearch/xunsearch-sdk/util/RequiredCheck.php
    • > /wp-content/plugins/xunsearch/xunsearch-sdk/util/Indexer.php
    • > /wp-content/plugins/xunsearch/xunsearch-sdk/util/SearchSkel.php
    • > /wp-content/plugins/xunsearch/xunsearch-sdk/util/Logger.php
    • > /wp-content/plugins/xunsearch/xunsearch.php
    • > /wp-content/plugins/xunsearch/xunsearch-sdk/util/IniWizzard.php
  • 27× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/xunsearch/xunsearch-sdk/util/Quest.php on line 49
    • > PHP Fatal error
      Cannot use yii\\base\\Object as Object because 'Object' is a special class name in wp-content/plugins/xunsearch/xunsearch-sdk/wrapper/yii2-ext/Database.php on line 13
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/xunsearch/xunsearch-sdk/util/Logger.php on line 50
    • > PHP Notice
      Undefined index: argv in wp-content/plugins/xunsearch/xunsearch-sdk/util/IniWizzard.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'yii\\debug\\Panel' not found in wp-content/plugins/xunsearch/xunsearch-sdk/wrapper/yii2-ext/DebugPanel.php:27
    • > PHP Notice
      Undefined index: argv in wp-content/plugins/xunsearch/xunsearch-sdk/util/SearchSkel.php on line 29
    • > PHP Warning
      Use of undefined constant XUN_SEARCH_PLUGIN_DIR - assumed 'XUN_SEARCH_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/xunsearch/class.xunsearch.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'yii\\base\\Component' not found in wp-content/plugins/xunsearch/xunsearch-sdk/wrapper/yii2-ext/Connection.php:25
    • > PHP Notice
      Undefined index: argv in wp-content/plugins/xunsearch/xunsearch-sdk/util/Quest.php on line 49
    • > PHP Notice
      Trying to access array offset on value of type null in wp-content/plugins/xunsearch/xunsearch-sdk/util/Quest.php on line 91

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 Passed 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
No plugin tags provided

xunsearch/xunsearch.php Passed 13 tests

The principal PHP file in "XunSearch" v. 0.1.00 is loaded by WordPress automatically on each request
23 characters long description:
XunSearch for wordpress

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Everything looks great! No dangerous files found in this plugin37,133 lines of code in 120 files:
LanguageFilesBlank linesComment linesLines of code
HTML863,348918,056
CSS81,02710610,569
PHP203721,3385,930
JavaScript16956562,198
Markdown31110309
INI223071

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.45
Average class complexity20.86
▷ Minimum class complexity1.00
▷ Maximum class complexity212.00
Average method complexity3.50
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces1
Interfaces2
Traits0
Classes42
▷ Abstract classes37.14%
▷ Concrete classes3992.86%
▷ Final classes00.00%
Methods355
▷ Static methods257.04%
▷ Public methods29783.66%
▷ Protected methods359.86%
▷ Private methods236.48%
Functions10
▷ Named functions990.00%
▷ Anonymous functions110.00%
Constants204
▷ Global constants18188.73%
▷ Class constants2311.27%
▷ Public constants23100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 compressed PNG files occupy 0.02MB
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
xunsearch-sdk/util/skel/img/glyphicons-halflings.png12.50KB10.35KB▼ 17.19%
xunsearch-sdk/util/skel/img/glyphicons-halflings-white.png8.57KB9.20KB0.00%