84% elasticpress

Code Review | ElasticPress

WordPress plugin ElasticPress scored84%from 54 tests.

About plugin

  • Plugin page: elasticpress
  • Plugin version: 5.0.0
  • PHP compatiblity: 7.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.3
  • WordPress version: 6.3.1
  • First release: Oct 20, 2014
  • Latest release: Nov 1, 2023
  • Number of updates: 123
  • Update frequency: every 26.8 days
  • Top authors: tlovett1 (43.09%)10upbot (29.27%)10up (16.26%)collinsinternet (13.01%)felipeelia (1.63%)

Code review

54 tests

User reviews

29 reviews

Install metrics

7,000+ active /564,405 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Install script ran successfully

Server metrics [RAM: ▲4.09MB] [CPU: ▲29.27ms] 75% from 4 tests

Server-side resources used by ElasticPress
It is recommended to improve the following
  • CPU: Try to keep total CPU usage under 500.00ms (currently 570.78ms on /wp-admin/admin.php?page=elasticpress-settings)
PageMemory (MB)CPU Time (ms)
Home /7.53 ▲4.0672.93 ▲30.85
Dashboard /wp-admin7.44 ▲4.1482.57 ▲33.98
Posts /wp-admin/edit.php7.50 ▲4.1477.78 ▲28.66
Add New Post /wp-admin/post-new.php9.94 ▲4.04117.08 ▲23.57
Media Library /wp-admin/upload.php7.38 ▲4.1573.84 ▲37.60
Synonyms /wp-admin/admin.php?page=elasticpress-synonyms7.4370.09
Search Fields & Weighting /wp-admin/admin.php?page=elasticpress-weighting7.3562.01
Sync /wp-admin/admin.php?page=elasticpress-sync7.3563.75
Custom Results /wp-admin/edit.php?post_type=ep-pointer7.4267.62
Features /wp-admin/admin.php?page=elasticpress7.3565.77
Index Health /wp-admin/admin.php?page=elasticpress-health7.3560.97
Status Report /wp-admin/admin.php?page=elasticpress-status-report7.3562.77
Settings /wp-admin/admin.php?page=elasticpress-settings7.82570.78

Server storage [IO: ▲2.70MB] [DB: ▲0.05MB] Passed 3 tests

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 511 new files
Database: no new tables, 12 new options
New WordPress options
db_upgraded
ep_feature_settings
ep_version
can_compress_scripts
widget_theysaidso_widget
widget_ep-related-posts
widget_ep-facet
theysaidso_admin_options
ep_feature_requirement_statuses
ep_feature_settings_draft
...

Browser metrics Passed 4 tests

This is an overview of browser requirements for ElasticPress
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,885 ▲12414.58 ▲0.231.74 ▼0.0539.72 ▼4.10
Dashboard /wp-admin2,283 ▲1065.53 ▼0.1589.57 ▼3.1141.69 ▲3.04
Posts /wp-admin/edit.php2,194 ▲912.07 ▲0.1338.08 ▼3.6834.68 ▼3.22
Add New Post /wp-admin/post-new.php1,581 ▲5522.51 ▼0.45670.58 ▼17.6741.19 ▼12.92
Media Library /wp-admin/upload.php1,497 ▲974.33 ▲0.2198.52 ▼9.9541.62 ▼3.01
Synonyms /wp-admin/admin.php?page=elasticpress-synonyms1,4057.72211.9381.10
Search Fields & Weighting /wp-admin/admin.php?page=elasticpress-weighting9241.9033.5825.80
Sync /wp-admin/admin.php?page=elasticpress-sync1,0041.8928.2039.63
Custom Results /wp-admin/edit.php?post_type=ep-pointer1,1582.0235.0432.45
Features /wp-admin/admin.php?page=elasticpress1,0111.8726.1137.29
Index Health /wp-admin/admin.php?page=elasticpress-health1,0071.8926.7135.46
Status Report /wp-admin/admin.php?page=elasticpress-status-report1,0071.8825.9835.53
Settings /wp-admin/admin.php?page=elasticpress-settings1,4071.7327.6146.22

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 8 options
    • widget_recent-comments
    • db_upgraded
    • widget_ep-related-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_ep-facet
    • can_compress_scripts

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
Almost there! Just fix the following items
  • 105× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'ElasticPress\\Vendor_Prefixed\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/elasticpress/vendor-prefixed/composer/installers/src/Composer/Installers/PuppetInstaller.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'ElasticPress\\Vendor_Prefixed\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/elasticpress/vendor-prefixed/composer/installers/src/Composer/Installers/ClanCatsFrameworkInstaller.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'ElasticPress\\Vendor_Prefixed\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/elasticpress/vendor-prefixed/composer/installers/src/Composer/Installers/KnownInstaller.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'ElasticPress\\Vendor_Prefixed\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/elasticpress/vendor-prefixed/composer/installers/src/Composer/Installers/BitrixInstaller.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'ElasticPress\\Vendor_Prefixed\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/elasticpress/vendor-prefixed/composer/installers/src/Composer/Installers/MayaInstaller.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'ElasticPress\\Vendor_Prefixed\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/elasticpress/vendor-prefixed/composer/installers/src/Composer/Installers/Concrete5Installer.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'ElasticPress\\Vendor_Prefixed\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/elasticpress/vendor-prefixed/composer/installers/src/Composer/Installers/OxidInstaller.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'ElasticPress\\Vendor_Prefixed\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/elasticpress/vendor-prefixed/composer/installers/src/Composer/Installers/SilverStripeInstaller.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'ElasticPress\\Vendor_Prefixed\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/elasticpress/vendor-prefixed/composer/installers/src/Composer/Installers/PhiftyInstaller.php:11
    • > PHP Fatal error
      Uncaught Error: Class 'ElasticPress\\Vendor_Prefixed\\Composer\\Installers\\BaseInstaller' not found in wp-content/plugins/elasticpress/vendor-prefixed/composer/installers/src/Composer/Installers/RadPHPInstaller.php:11

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 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
These attributes need to be fixed:
  • Tags: There are too many tags (14 tag instead of maximum 10)
You can look at the official readme.txt

elasticpress/elasticpress.php Passed 13 tests

The main PHP file in "ElasticPress" ver. 5.0.0 adds more information about the plugin and also serves as the entry point for this plugin
58 characters long description:
A fast and flexible search and query engine for WordPress.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected35,137 lines of code in 504 files:
LanguageFilesBlank linesComment linesLines of code
PHP2596,21916,78624,991
JavaScript1731,3333,7717,603
CSS61445272,163
JSON700350
SVG40030

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity15.62
▷ Minimum class complexity1.00
▷ Maximum class complexity251.00
Average method complexity3.47
▷ Minimum method complexity1.00
▷ Maximum method complexity68.00
Code structure
Namespaces32
Interfaces3
Traits1
Classes197
▷ Abstract classes105.08%
▷ Concrete classes18794.92%
▷ Final classes10.53%
Methods1,201
▷ Static methods242.00%
▷ Public methods94578.68%
▷ Protected methods23619.65%
▷ Private methods201.67%
Functions105
▷ Named functions6460.95%
▷ Anonymous functions4139.05%
Constants21
▷ Global constants1152.38%
▷ Class constants1047.62%
▷ Public constants10100.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
3 PNG files occupy 0.30MB with 0.14MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/features-screenshot.png86.04KB27.39KB▼ 68.16%
images/setup-screenshot.png220.89KB93.67KB▼ 57.60%
images/sync-in-progress.png1.39KB1.21KB▼ 12.78%