10% opensearchserver-search

Code Review | OpenSearchServer Search

WordPress plugin OpenSearchServer Search scored10%from 54 tests.

About plugin

  • Plugin page: opensearchserver-...
  • Plugin version: 1.5.10
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.1
  • WordPress version: 6.3.1
  • First release: Jun 9, 2011
  • Latest release: May 5, 2015
  • Number of updates: 216
  • Update frequency: every 6.6 days
  • Top authors: naveenann (43.52%)AlexandreT (37.96%)ekeller (19.44%)

Code review

54 tests

User reviews

5 reviews

Install metrics

10+ active /8,594 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
These installer errors require your attention
  • The plugin cannot be installed
    • > Deprecated in wp-content/plugins/opensearchserver-search/opensearchserver_admin.php+411
    Array and string offset access syntax with curly braces is deprecated

Server metrics [RAM: ▼1.07MB] [CPU: ▼52.71ms] Passed 4 tests

Analyzing server-side resources used by OpenSearchServer Search
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.92 ▼0.548.16 ▼34.03
Dashboard /wp-admin2.94 ▼0.3610.75 ▼45.47
Posts /wp-admin/edit.php2.94 ▼0.4110.82 ▼39.11
Add New Post /wp-admin/post-new.php2.94 ▼2.948.90 ▼92.23
Media Library /wp-admin/upload.php2.94 ▼0.299.87 ▼28.11
OpenSearchServer /wp-admin/plugins.php?page=opensearchserver-search/index.php3.0510.89

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 231 new files
Database: no new tables, 19 new options
New WordPress options
can_compress_scripts
oss_query
oss_spell_algo
db_upgraded
theysaidso_admin_options
widget_recent-comments
oss_display_user
oss_display_type
oss_taxonomy_display
oss_facet_display_count
...

Browser metrics Passed 4 tests

A check of browser resources used by OpenSearchServer Search
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,929 ▲16813.96 ▼0.4311.23 ▲8.5151.19 ▲5.07
Dashboard /wp-admin2,230 ▲244.86 ▼1.16101.38 ▼5.1337.99 ▼6.03
Posts /wp-admin/edit.php2,106 ▲92.03 ▲0.0337.59 ▼0.3039.66 ▼0.87
Add New Post /wp-admin/post-new.php1,545 ▼022.65 ▼0.56608.26 ▼73.1248.14 ▼17.06
Media Library /wp-admin/upload.php1,406 ▲64.24 ▲0.0198.06 ▼14.6547.30 ▼0.04
OpenSearchServer /wp-admin/plugins.php?page=opensearchserver-search/index.php1,9421.5632.1273.59

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/opensearchserver-search/opensearchserver_admin.php+411
    Array and string offset access syntax with curly braces is deprecated
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

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
These server-side errors were triggered
    • > GET request to /wp-admin/plugins.php?page=opensearchserver-search/index.php
    • > Deprecated in wp-content/plugins/opensearchserver-search/opensearchserver_admin.php+411
    Array and string offset access syntax with curly braces is deprecated
    • > GET request to /wp-admin/plugins.php?page=opensearchserver-search/index.php
    • > User warning in wp-content/plugins/opensearchserver-search/lib/oss_abstract.class.php+177
    CURL failed to execute on URL "/services/rest/index//search/template?"
    • > GET request to /wp-admin/plugins.php?page=opensearchserver-search/index.php
    • > Notice in wp-content/plugins/opensearchserver-search/lib/oss_searchtemplate.class.php+205
    Trying to get property 'templates' of non-object
    • > GET request to /wp-admin/plugins.php?page=opensearchserver-search/index.php
    • > Warning in wp-content/plugins/opensearchserver-search/opensearchserver_admin.php+1203
    Invalid argument supplied for foreach()
  • 13 occurences, only the last one shown
    • > GET request to /wp-admin/plugins.php?page=opensearchserver-search/index.php
    • > Warning in wp-content/plugins/opensearchserver-search/opensearchserver_admin.php+1220
    in_array() expects parameter 2 to be array, bool given
    • > GET request to /wp-admin/plugins.php?page=opensearchserver-search/index.php
    • > Warning in wp-content/plugins/opensearchserver-search/opensearchserver_admin.php+1363
    Use of undefined constant oss_advanced_facets - assumed 'oss_advanced_facets' (this will throw an Error in a future version of PHP)

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
The following issues need your attention
  • 2× PHP files output text when accessed directly:
    • > /wp-content/plugins/opensearchserver-search/lib/Buzz/test/server.php
    • > /wp-content/plugins/opensearchserver-search/autocomplete.php
  • 171× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'Buzz\\Listener\\ListenerInterface' not found in wp-content/plugins/opensearchserver-search/lib/Buzz/lib/Buzz/Listener/CallbackListener.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/opensearchserver-search/lib/Buzz/test/Buzz/Test/Message/FormRequestTest.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'PHPUnit_Framework_TestCase' not found in wp-content/plugins/opensearchserver-search/lib/opensearchserver-php-client/tests/TestWrapper.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Buzz\\Message\\MessageInterface' not found in wp-content/plugins/opensearchserver-search/lib/Buzz/lib/Buzz/Message/AbstractMessage.php:5
    • > PHP Fatal error
      Uncaught Error: Class 'OpenSearchServer\\Handler' not found in wp-content/plugins/opensearchserver-search/lib/opensearchserver-php-client/examples/oss_examples.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'OpenSearchServer\\Request' not found in wp-content/plugins/opensearchserver-search/lib/opensearchserver-php-client/src/OpenSearchServer/Synonyms/Exists.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'OpenSearchServer\\RequestJson' not found in wp-content/plugins/opensearchserver-search/lib/opensearchserver-php-client/src/OpenSearchServer/Document/Put.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'OpenSearchServer\\Crawler\\File\\Repository\\Repository' not found in wp-content/plugins/opensearchserver-search/lib/opensearchserver-php-client/src/OpenSearchServer/Crawler/File/Repository/Ftp/Insert.php:6
    • > PHP Fatal error
      Uncaught Error: Class 'OpenSearchServer\\RequestJson' not found in wp-content/plugins/opensearchserver-search/lib/opensearchserver-php-client/src/OpenSearchServer/SearchBatch/SearchBatch.php:7
    • > PHP Fatal error
      Uncaught Error: Class 'OpenSearchServer\\RequestJson' not found in wp-content/plugins/opensearchserver-search/lib/opensearchserver-php-client/src/OpenSearchServer/Document/DeleteByQuery.php:7

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 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
9 plugin tags: full-text, indexation, opensearchserver, search, filter...

opensearchserver-search/index.php 85% from 13 tests

The primary PHP file in "OpenSearchServer Search" version 1.5.10 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: Please keep the plugin description shorter than 140 characters (currently 203 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("opensearchserver-search.php" instead of "index.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
Everything looks great! No dangerous files found in this plugin14,986 lines of code in 221 files:
LanguageFilesBlank linesComment linesLines of code
PHP2082,3754,26412,503
Markdown355801,928
JavaScript12655162
CSS2143155
PO File25414137
JSON20054
XML23227
YAML15020

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity3.95
▷ Minimum class complexity1.00
▷ Maximum class complexity38.00
Average method complexity1.65
▷ Minimum method complexity1.00
▷ Maximum method complexity35.00
Code structure
Namespaces52
Interfaces9
Traits0
Classes211
▷ Abstract classes188.53%
▷ Concrete classes19391.47%
▷ Final classes00.00%
Methods1,006
▷ Static methods161.59%
▷ Public methods96295.63%
▷ Protected methods252.49%
▷ Private methods191.89%
Functions117
▷ Named functions11295.73%
▷ Anonymous functions54.27%
Constants110
▷ Global constants00.00%
▷ Class constants110100.00%
▷ Public constants110100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 compressed PNG file occupies 0.01MB
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
lib/Buzz/test/Buzz/Test/Message/Fixtures/google.png6.84KB6.80KB▼ 0.69%