58% search-results-optimizer

Code Review | Search Results Optimizer

WordPress plugin Search Results Optimizer scored 58% from 54 tests.

About plugin

  • Plugin page: search-results-op...
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-3.8.1
  • WordPress version: 5.8.1
  • First release: Mar 9, 2014
  • Latest release: Mar 13, 2014
  • Number of updates: 21
  • Update frequency: every 0.2 days
  • Top authors: chrisgorvan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,637 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼1.64MB] [CPU: ▼196.00ms] Passed 4 tests

An overview of server-side resources used by Search Results Optimizer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.94 ▼0.898.15 ▼38.97
Dashboard /wp-admin2.01 ▼1.048.27 ▼53.17
Posts /wp-admin/edit.php2.01 ▼1.097.41 ▼39.21
Add New Post /wp-admin/post-new.php2.01 ▼3.427.80 ▼652.65
Media Library /wp-admin/upload.php2.01 ▼0.997.39 ▼27.67
Settings /wp-admin/admin.php?page=searchresultsoptimizer_settings2.018.07
Search Results Optimizer /wp-admin/admin.php?page=searchresultsoptimizer2.018.08
Themes /wp-admin/admin.php?page=searchresultsoptimizer_themes2.027.19
Searches /wp-admin/admin.php?page=searchresultsoptimizer_searches2.028.05
Reports /wp-admin/admin.php?page=searchresultsoptimizer_reports2.027.01

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 64 new files
Database: 4 new tables, 14 new options
New tables
wp_sro_clicks
wp_sro_results
wp_sro_themehashes
wp_sro_themes
New WordPress options
searchresultsoptimizer_post_type_page
recovery_mode_email_last_sent
searchresultsoptimizer_metadata_filters_tags
searchresultsoptimizer_result_highlighting_colour
searchresultsoptimizer_metadata_filters_types
searchresultsoptimizer_metadata_filters_categories
searchresultsoptimizer_result_pinning_enabled
searchresultsoptimizer_sorting_secondary
searchresultsoptimizer_include_other_searches
searchresultsoptimizer_sorting_popularity
...

Browser metrics Passed 4 tests

Search Results Optimizer: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,899 ▲32718.74 ▲3.1913.28 ▲2.4849.56 ▼0.50
Dashboard /wp-admin3,059 ▲1258.85 ▲2.91165.73 ▼17.20103.58 ▼26.78
Posts /wp-admin/edit.php2,834 ▲954.94 ▲2.1085.77 ▲18.92105.50 ▲19.01
Add New Post /wp-admin/post-new.php4,107 ▲2,42417.83 ▼0.76503.98 ▲107.13127.43 ▲21.81
Media Library /wp-admin/upload.php1,899 ▲897.03 ▲2.01153.77 ▲2.31112.54 ▲0.06
Settings /wp-admin/admin.php?page=searchresultsoptimizer_settings1,5024.4887.5784.07
Search Results Optimizer /wp-admin/admin.php?page=searchresultsoptimizer1,0032.1333.2165.72
Themes /wp-admin/admin.php?page=searchresultsoptimizer_themes9412.1337.3157.86
Searches /wp-admin/admin.php?page=searchresultsoptimizer_searches9382.1337.0657.11
Reports /wp-admin/admin.php?page=searchresultsoptimizer_reports1,2723.9576.6277.57

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
These items require your attention
  • Uninstall procedure had uncaught errors
    • > User notice in wp-includes/functions.php+5663
    is_search was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
  • Zombie tables detected upon uninstall: 4 tables
    • wp_sro_themes
    • wp_sro_clicks
    • wp_sro_results
    • wp_sro_themehashes
  • This plugin did not uninstall successfully, leaving 14 options in the database
    • searchresultsoptimizer_metadata_filters_tags
    • searchresultsoptimizer_result_highlighting_enabled
    • searchresultsoptimizer_include_other_searches
    • searchresultsoptimizer_metadata_filters_types
    • searchresultsoptimizer_result_pinning_enabled
    • searchresultsoptimizer_result_highlighting_colour
    • recovery_mode_email_last_sent
    • searchresultsoptimizer_metadata_filters_categories
    • searchresultsoptimizer_advanced_search_enabled
    • searchresultsoptimizer_post_type_attachment
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Please fix the following server-side errors
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=searchresultsoptimizer_reports
    • > User notice in wp-includes/functions.php+5663
    is_search was called incorrectly. Conditional query tags do not work before the query is run. Before then, they always return false. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)
    • > GET request to /wp-admin/admin.php?page=searchresultsoptimizer
    • > Error in wp-content/plugins/search-results-optimizer/includes/abstracts/sro-list-table.php+198
    Uncaught Exception: Cannot paginate with non-numeric value. Received boolean in wp-content/plugins/search-results-optimizer/includes/abstracts/sro-list-table.php:198
    Stack trace:
    #0 wp-content/plugins/search-results-optimizer/includes/abstracts/sro-list-table.php(154): SearchResultsOptimizer\includes\abstracts\SROListTable->configurePagination()
    #1 wp-content/plugins/search-results-optimizer/includes/admin/views/sro-admin-dashboard-view.php(24): SearchResultsOptimizer\includes\abstracts\SROListTable->prepare_items()
    #2 wp-content/plugins/search-results-optimizer/includes/abstracts/sro-admin-page.php(54): include('/var/www/wordpr...')
    #3 wp-content/plugins/search-results-optimizer/includes/admin/sro-admin-menus.php(76): SearchResultsOptimizer\includes\abstracts\SROAdminPage->output()
    #4 wp-includes/class-wp-hook.php(303): SearchResultsOptimizer\includes\admin\SROAdminMenus->dashboardPage()
    #5 /var/
    • > GET request to /wp-admin/admin.php?page=searchresultsoptimizer_themes
    • > Error in wp-content/plugins/search-results-optimizer/includes/abstracts/sro-list-table.php+198
    Uncaught Exception: Cannot paginate with non-numeric value. Received boolean in wp-content/plugins/search-results-optimizer/includes/abstracts/sro-list-table.php:198
    Stack trace:
    #0 wp-content/plugins/search-results-optimizer/includes/abstracts/sro-list-table.php(154): SearchResultsOptimizer\includes\abstracts\SROListTable->configurePagination()
    #1 wp-content/plugins/search-results-optimizer/includes/admin/sro-admin-themes.php(109): SearchResultsOptimizer\includes\abstracts\SROListTable->prepare_items()
    #2 wp-content/plugins/search-results-optimizer/includes/admin/views/sro-admin-themes-view.php(4): SearchResultsOptimizer\includes\admin\SROAdminThemes->displayTable()
    #3 wp-content/plugins/search-results-optimizer/includes/abstracts/sro-admin-page.php(54): include('/var/www/wordpr...')
    #4 wp-content/plugins/search-results-optimizer/includes/admin/sro-admin-menus.php(139): SearchResultsOptimizer\inc
    • > GET request to /wp-admin/admin.php?page=searchresultsoptimizer_searches
    • > Error in wp-content/plugins/search-results-optimizer/includes/abstracts/sro-list-table.php+198
    Uncaught Exception: Cannot paginate with non-numeric value. Received boolean in wp-content/plugins/search-results-optimizer/includes/abstracts/sro-list-table.php:198
    Stack trace:
    #0 wp-content/plugins/search-results-optimizer/includes/abstracts/sro-list-table.php(154): SearchResultsOptimizer\includes\abstracts\SROListTable->configurePagination()
    #1 wp-content/plugins/search-results-optimizer/includes/admin/views/sro-admin-searches-view.php(5): SearchResultsOptimizer\includes\abstracts\SROListTable->prepare_items()
    #2 wp-content/plugins/search-results-optimizer/includes/abstracts/sro-admin-page.php(54): include('/var/www/wordpr...')
    #3 wp-content/plugins/search-results-optimizer/includes/admin/sro-admin-menus.php(160): SearchResultsOptimizer\includes\abstracts\SROAdminPage->output()
    #4 wp-includes/class-wp-hook.php(303): SearchResultsOptimizer\includes\admin\SROAdminMenus->searchesPage()
    #5 /var/ww

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
The following issues need your attention
  • 23× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/search-results-optimizer/templates/searchform.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/search-results-optimizer/includes/admin/views/sro-admin-themes-view.php:2
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/search-results-optimizer/includes/admin/views/sro-admin_search_pin.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/search-results-optimizer/includes/admin/views/sro-admin_search_position.php:4
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/search-results-optimizer/includes/admin/views/sro-admin_search.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/search-results-optimizer/includes/admin/views/sro-admin_search.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/search-results-optimizer/includes/admin/views/sro-admin_nosearches.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/search-results-optimizer/includes/admin/views/sro-admin-searches-view.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/search-results-optimizer/includes/admin/views/sro-admin-searches-edit.php:2
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/search-results-optimizer/includes/admin/views/sro-admin_search.php on line 1

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 issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
Attributes that need to be fixed:
  • Tags: Please delete some tags, you are using 12 tag instead of maximum 10
The official readme.txt is a good inspiration

search-results-optimizer/search-results-optimizer.php Passed 13 tests

The main PHP script in "Search Results Optimizer" version 1.0.3 is automatically included on every request by WordPress
118 characters long description:
Search Results Optimizer learns which results users find useful and automatically prioritizes them in future searches.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Everything looks great! No dangerous files found in this plugin7,942 lines of code in 59 files:
LanguageFilesBlank linesComment linesLines of code
PHP515702,9106,721
JavaScript4182551
LESS1871424
PO File195125209
Markdown119036
CSS1001

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity13.52
▷ Minimum class complexity1.00
▷ Maximum class complexity85.00
Average method complexity2.37
▷ Minimum method complexity1.00
▷ Maximum method complexity16.00
Code structure
Namespaces7
Interfaces0
Traits0
Classes27
▷ Abstract classes414.81%
▷ Concrete classes2385.19%
▷ Final classes14.35%
Methods255
▷ Static methods20.78%
▷ Public methods16464.31%
▷ Protected methods8834.51%
▷ Private methods31.18%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/img/multiple-select.png3.26KB0.62KB▼ 80.97%