10% redisearch

Code Review | RediSearch

WordPress plugin RediSearch scored10%from 54 tests.

About plugin

  • Plugin page: redisearch
  • Plugin version: 0.3.4
  • PHP compatiblity: 7.2+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7
  • WordPress version: 6.3.1
  • First release: Oct 1, 2018
  • Latest release: May 4, 2021
  • Number of updates: 30
  • Update frequency: every 31.7 days
  • Top authors: foadyousefi (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

10+ active /2,845 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Warning in wp-content/plugins/redisearch/vendor/predis/predis/src/Connection/StreamConnection.php+127
    stream_socket_client(): unable to connect to tcp://127.0.0.1:6379 (Connection refused)

Server metrics [RAM: ▼1.53MB] [CPU: ▼49.00ms] Passed 4 tests

An overview of server-side resources used by RediSearch
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.46 ▼1.0111.31 ▼31.36
Dashboard /wp-admin2.48 ▼0.8320.04 ▼33.45
Posts /wp-admin/edit.php2.48 ▼0.8812.13 ▼38.43
Add New Post /wp-admin/post-new.php2.48 ▼3.4112.71 ▼92.76
Media Library /wp-admin/upload.php2.48 ▼0.7512.66 ▼22.66
Indexing options /wp-admin/admin.php?page=indexing-options2.4812.22
Redis server /wp-admin/admin.php?page=redis-server2.4813.73
Redisearch /wp-admin/admin.php?page=redisearch2.4813.33

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 414 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

This is an overview of browser requirements for RediSearch
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲8014.29 ▲0.061.95 ▲0.2746.05 ▲0.20
Dashboard /wp-admin2,247 ▲705.68 ▲0.1193.22 ▲7.2345.77 ▲2.21
Posts /wp-admin/edit.php2,153 ▲562.19 ▲0.1537.63 ▼1.2741.49 ▲9.46
Add New Post /wp-admin/post-new.php1,568 ▲2823.59 ▲0.45683.80 ▼4.3753.98 ▼2.85
Media Library /wp-admin/upload.php1,455 ▲524.28 ▲0.00100.46 ▼1.8043.81 ▼1.77
Indexing options /wp-admin/admin.php?page=indexing-options1,1432.2127.7643.33
Redis server /wp-admin/admin.php?page=redis-server9662.2123.8130.61
Redisearch /wp-admin/admin.php?page=redisearch8922.0627.4029.67

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
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/redisearch/vendor/predis/predis/src/Connection/StreamConnection.php+127
    stream_socket_client(): unable to connect to tcp://127.0.0.1:6379 (Connection refused)
  • Zombie WordPress options detected upon uninstall: 6 options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=redisearch
    • > Warning in wp-content/plugins/redisearch/vendor/predis/predis/src/Connection/StreamConnection.php+127
    stream_socket_client(): unable to connect to tcp://127.0.0.1:6379 (Connection refused)
    • > GET request to /wp-admin/admin.php?page=indexing-options
    • > Deprecated in wp-content/plugins/redisearch/src/Admin/Admin.php+169
    Non-static method WpRediSearch\Admin::supportedLanguages() should not be called statically

SRP 0% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Please fix the following
  • 16× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/redisearch/vendor/predis/predis/examples/session_handler.php
    • > /wp-content/plugins/redisearch/vendor/predis/predis/examples/key_prefixing.php
    • > /wp-content/plugins/redisearch/vendor/predis/predis/examples/lua_scripting_abstraction.php
    • > /wp-content/plugins/redisearch/vendor/predis/predis/examples/custom_cluster_distributor.php
    • > /wp-content/plugins/redisearch/vendor/predis/predis/examples/redis_collections_iterators.php
    • > /wp-content/plugins/redisearch/vendor/predis/predis/examples/dispatcher_loop.php
    • > /wp-content/plugins/redisearch/vendor/predis/predis/examples/replication_sentinel.php
    • > /wp-content/plugins/redisearch/vendor/predis/predis/examples/monitor_consumer.php
    • > /wp-content/plugins/redisearch/vendor/predis/predis/examples/replication_simple.php
    • > /wp-content/plugins/redisearch/vendor/predis/predis/examples/executing_redis_commands.php
  • 280× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/redisearch/vendor/predis/predis/src/Command/StringBitCount.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Predis\\Configuration\\OptionsInterface' not found in wp-content/plugins/redisearch/vendor/predis/predis/src/Configuration/Options.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/redisearch/vendor/predis/predis/src/Command/ListPopFirst.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/redisearch/vendor/predis/predis/src/Command/SetMembers.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/redisearch/vendor/predis/predis/src/Command/ServerCommand.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Predis\\Cluster\\StrategyInterface' not found in wp-content/plugins/redisearch/vendor/predis/predis/src/Cluster/ClusterStrategy.php:22
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/redisearch/vendor/predis/predis/src/Command/ZSetScore.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/redisearch/vendor/predis/predis/src/Command/StringDecrement.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'Predis\\Command\\Command' not found in wp-content/plugins/redisearch/vendor/predis/predis/src/Command/StringSetRange.php:19
    • > PHP Fatal error
      Uncaught Error: Interface 'Predis\\Connection\\ConnectionInterface' not found in wp-content/plugins/redisearch/vendor/predis/predis/src/Connection/AggregateConnectionInterface.php:22

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

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
10 plugin tags: searching, advanced search, fuzzy, suggest, aggregation...

redisearch/wp-redisearch.php 92% from 13 tests

The primary PHP file in "RediSearch" version 0.3.4 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("redisearch.php" instead of "wp-redisearch.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 detected20,895 lines of code in 398 files:
LanguageFilesBlank linesComment linesLines of code
PHP3674,76212,99417,619
Markdown1078202,308
JSON710503
CSS3104155
XML41312109
JavaScript33191
YAML10048
Bourne Shell29038
INI16624

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.33
Average class complexity5.88
▷ Minimum class complexity1.00
▷ Maximum class complexity100.00
Average method complexity2.16
▷ Minimum method complexity1.00
▷ Maximum method complexity26.00
Code structure
Namespaces41
Interfaces29
Traits2
Classes308
▷ Abstract classes165.19%
▷ Concrete classes29294.81%
▷ Final classes10.34%
Methods1,491
▷ Static methods996.64%
▷ Public methods1,21981.76%
▷ Protected methods21414.35%
▷ Private methods583.89%
Functions39
▷ Named functions37.69%
▷ Anonymous functions3692.31%
Constants36
▷ Global constants1233.33%
▷ Class constants2466.67%
▷ Public constants2187.50%

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
No PNG images were found in this plugin