84% solr-power

Code Review | Solr Search for WordPress

WordPress plugin Solr Search for WordPress scored84%from 54 tests.

About plugin

  • Plugin page: solr-power
  • Plugin version: 2.5.2
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-6.3
  • WordPress version: 6.3.1
  • First release: Nov 20, 2015
  • Latest release: Sep 13, 2023
  • Number of updates: 92
  • Update frequency: every 31.0 days
  • Top authors: danielbachhuber (43.48%)andrew.taylor (40.22%)getpantheon (11.96%)Outlandish Josh (7.61%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /53,297 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.00MB] [CPU: ▼6.63ms] Passed 4 tests

A check of server-side resources used by Solr Search for WordPress
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0039.86 ▼8.14
Dashboard /wp-admin3.31 ▲0.0046.60 ▼0.40
Posts /wp-admin/edit.php3.36 ▲0.0046.87 ▲2.59
Add New Post /wp-admin/post-new.php5.89 ▲0.0087.55 ▼18.59
Media Library /wp-admin/upload.php3.23 ▲0.0032.66 ▲0.60

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

Input-output and database impact of this plugin
The plugin installed successfully
Filesystem: 404 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
can_compress_scripts
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded

Browser metrics Passed 4 tests

An overview of browser requirements for Solr Search for WordPress
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.30 ▼1.001.63 ▼0.1043.69 ▲1.18
Dashboard /wp-admin2,209 ▲215.88 ▲1.02105.50 ▼5.7540.85 ▼4.70
Posts /wp-admin/edit.php2,089 ▼02.06 ▲0.0138.87 ▼1.4635.37 ▲1.89
Add New Post /wp-admin/post-new.php1,534 ▼823.09 ▲4.88654.86 ▲41.6050.01 ▲0.97
Media Library /wp-admin/upload.php1,391 ▲64.23 ▲0.0795.94 ▼9.1343.71 ▼3.27

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-posts
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Please fix the following
  • 249× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Solarium\\QueryType\\Update\\Query\\Command\\AbstractCommand' not found in wp-content/plugins/solr-power/vendor/solarium/solarium/src/QueryType/Update/Query/Command/Delete.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Solarium\\Core\\Query\\AbstractQuery' not found in wp-content/plugins/solr-power/vendor/solarium/solarium/src/QueryType/Terms/Query.php:18
    • > PHP Fatal error
      Uncaught Error: Class 'Solarium\\Core\\Configurable' not found in wp-content/plugins/solr-power/vendor/solarium/solarium/src/Component/DisMax/BoostQuery.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Symfony\\Component\\EventDispatcher\\Event' not found in wp-content/plugins/solr-power/vendor/solarium/solarium/src/Core/Event/PostCreateResult.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Solarium\\Component\\Facet\\AbstractFacet' not found in wp-content/plugins/solr-power/vendor/solarium/solarium/src/Component/Facet/Pivot.php:12
    • > PHP Fatal error
      Uncaught Error: Class 'Solarium\\QueryType\\Server\\CoreAdmin\\Query\\Action\\AbstractCoreAction' not found in wp-content/plugins/solr-power/vendor/solarium/solarium/src/QueryType/Server/CoreAdmin/Query/Action/AbstractAsyncAction.php:5
    • > PHP Fatal error
      Uncaught Error: Interface 'Solarium\\Component\\RequestBuilder\\ComponentRequestBuilderInterface' not found in wp-content/plugins/solr-power/vendor/solarium/solarium/src/Component/RequestBuilder/EdisMax.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_html_e() in wp-content/plugins/solr-power/templates/solr-search-results.php:12
    • > PHP Fatal error
      Uncaught Error: Interface 'Symfony\\Component\\DependencyInjection\\Compiler\\CompilerPassInterface' not found in wp-content/plugins/solr-power/vendor/symfony/event-dispatcher/DependencyInjection/RegisterListenersPass.php:25
    • > PHP Fatal error
      Uncaught Error: Interface 'Solarium\\Core\\ConfigurableInterface' not found in wp-content/plugins/solr-power/vendor/solarium/solarium/src/Core/Query/QueryInterface.php:10

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)
No browser errors were detected

Optimizations

Plugin configuration 96% from 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
1 plugin tags: search

solr-power/solr-power.php 92% from 13 tests

The primary PHP file in "Solr Search for WordPress" version 2.5.2 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6

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
There were no executable files found in this plugin23,423 lines of code in 394 files:
LanguageFilesBlank linesComment linesLines of code
PHP3665,30219,37321,540
CSS6344504
Markdown61460491
JavaScript6484280
JSON300239
Sass2160165
XML2316164
YAML210239
SVG1001

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity5.94
▷ Minimum class complexity1.00
▷ Maximum class complexity235.00
Average method complexity1.83
▷ Minimum method complexity1.00
▷ Maximum method complexity38.00
Code structure
Namespaces84
Interfaces27
Traits24
Classes311
▷ Abstract classes185.79%
▷ Concrete classes29394.21%
▷ Final classes00.00%
Methods2,327
▷ Static methods421.80%
▷ Public methods2,19494.28%
▷ Protected methods954.08%
▷ Private methods381.63%
Functions58
▷ Named functions1118.97%
▷ Anonymous functions4781.03%
Constants149
▷ Global constants53.36%
▷ Class constants14496.64%
▷ Public constants144100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
PNG images were not found in this plugin