78% jetpack-search

Code Review | Jetpack Search

WordPress plugin Jetpack Search scored78%from 54 tests.

About plugin

  • Plugin page: jetpack-search
  • Plugin version: 1.4.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 6.0-6.2
  • WordPress version: 6.3.1
  • First release: May 30, 2022
  • Latest release: Mar 27, 2023
  • Number of updates: 43
  • Update frequency: every 7.5 days
  • Top authors: jetpackisbestpack (30.23%)kangzj (27.91%)kraftbj (13.95%)wpkaren (11.63%)jeherve (9.3%)

Code review

54 tests

User reviews

6 reviews

Install metrics

3,000+ active /31,857 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲2.99MB] [CPU: ▲13.37ms] 75% from 4 tests

Analyzing server-side resources used by Jetpack Search
Please take the time to fix the following items
  • CPU: You should keep total CPU usage under 500.00ms (currently 574.77ms on /wp-admin/admin.php?page=my-jetpack)
PageMemory (MB)CPU Time (ms)
Home /7.59 ▲4.1343.32 ▼0.11
Dashboard /wp-admin6.21 ▲2.9070.65 ▲19.72
Posts /wp-admin/edit.php6.26 ▲2.9068.41 ▲18.76
Add New Post /wp-admin/post-new.php9.19 ▲3.30107.35 ▲15.09
Media Library /wp-admin/upload.php6.07 ▲2.8468.16 ▲29.11
Search /wp-admin/admin.php?page=jetpack-search6.4265.05
My Jetpack /wp-admin/admin.php?page=my-jetpack6.83574.77

Server storage [IO: ▲4.95MB] [DB: ▲0.07MB] Passed 3 tests

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 368 new files
Database: no new tables, 12 new options
New WordPress options
can_compress_scripts
jetpack_active_modules
db_upgraded
jetpack_sync_https_history_site_url
jetpack_sync_https_history_home_url
widget_theysaidso_widget
jetpack_connection_active_plugins
theysaidso_admin_options
widget_recent-comments
jetpack_options
...

Browser metrics Passed 4 tests

An overview of browser requirements for Jetpack Search
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,850 ▲8913.61 ▼1.142.78 ▲0.6839.76 ▲0.20
Dashboard /wp-admin2,256 ▲564.96 ▲0.03109.82 ▲5.3337.62 ▼2.18
Posts /wp-admin/edit.php2,136 ▲362.20 ▲0.1538.88 ▲1.1934.03 ▼1.68
Add New Post /wp-admin/post-new.php1,567 ▲3523.41 ▲0.30625.96 ▲11.2651.53 ▼19.86
Media Library /wp-admin/upload.php1,432 ▲354.27 ▲0.08102.75 ▼15.6750.37 ▲3.64
Search /wp-admin/admin.php?page=jetpack-search1,2458.17197.3843.18
My Jetpack /wp-admin/admin.php?page=my-jetpack1,6008.70132.2044.45

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • The uninstall procedure has failed, leaving 12 options in the database
    • theysaidso_admin_options
    • jetpack_options
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • db_upgraded
    • can_compress_scripts
    • jetpack_connection_active_plugins
    • jetpack_sync_https_history_site_url
    • jetpack_active_modules
    • ...

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
The following issues need your attention
  • 59× GET requests to PHP files trigger server-side errors or Error 500 responses (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Sync\\Modules\\Module' not found in wp-content/plugins/jetpack-search/jetpack_vendor/automattic/jetpack-sync/src/modules/class-menus.php:13
    • > PHP Warning
      Use of undefined constant WPINC - assumed 'WPINC' (this will throw an Error in a future version of PHP) in wp-content/plugins/jetpack-search/jetpack_vendor/automattic/jetpack-connection/legacy/class-jetpack-ixr-client.php on line 16
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Sync\\Modules\\Module' not found in wp-content/plugins/jetpack-search/jetpack_vendor/automattic/jetpack-sync/src/modules/class-full-sync-immediately.php:21
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\My_Jetpack\\Product' not found in wp-content/plugins/jetpack-search/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-module-product.php:20
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/jetpack-search/jetpack_vendor/automattic/jetpack-search/src/widgets/class-search-widget.php:24
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\My_Jetpack\\Product' not found in wp-content/plugins/jetpack-search/jetpack_vendor/automattic/jetpack-my-jetpack/src/products/class-hybrid-product.php:30
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Sync\\Replicastore\\Table_Checksum' not found in wp-content/plugins/jetpack-search/jetpack_vendor/automattic/jetpack-sync/src/replicastore/class-table-checksum-users.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\Sync\\Modules\\Module' not found in wp-content/plugins/jetpack-search/jetpack_vendor/automattic/jetpack-sync/src/modules/class-callables.php:19
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-upgrader.php' (include_path='.:/usr/share/php') in wp-content/plugins/jetpack-search/jetpack_vendor/automattic/jetpack-plugins-installer/src/class-automatic-install-skin.php on line 15
    • > PHP Fatal error
      Uncaught Error: Class 'Automattic\\Jetpack\\JITMS\\JITM' not found in wp-content/plugins/jetpack-search/jetpack_vendor/automattic/jetpack-jitm/src/class-post-connection-jitm.php:25

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There are user-side issues you should fix
    • > GET request to /wp-admin/admin.php?page=my-jetpack
    • > Network (severe)
    index.php/wp-json/my-jetpack/v1/site/purchases?_locale=user - Failed to load resource: the server responded with a status of 400 (Bad Request)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
6 plugin tags: filter, free cloud-based search, ajax search, product search, woocommerce search...

jetpack-search/jetpack-search.php 92% from 13 tests

Analyzing the main PHP file in "Jetpack Search" version 1.4.1
Please take the time to fix the following:
  • Description: Keep the plugin description shorter than 140 characters (currently 175 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
Success! There were no dangerous files found in this plugin42,772 lines of code in 303 files:
LanguageFilesBlank linesComment linesLines of code
PHP2117,26324,02733,321
Markdown241,83005,873
JSON23002,308
JavaScript179595523
Sass38114422
CSS17357171
SVG726105
JSX16449

PHP code Passed 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity24.86
▷ Minimum class complexity1.00
▷ Maximum class complexity293.00
Average method complexity3.04
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces24
Interfaces3
Traits0
Classes182
▷ Abstract classes42.20%
▷ Concrete classes17897.80%
▷ Final classes00.00%
Methods2,196
▷ Static methods76334.74%
▷ Public methods1,92087.43%
▷ Protected methods1366.19%
▷ Private methods1406.38%
Functions49
▷ Named functions714.29%
▷ Anonymous functions4285.71%
Constants173
▷ Global constants137.51%
▷ Class constants16092.49%
▷ Public constants160100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
10 compressed PNG files occupy 1.00MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
jetpack_vendor/automattic/jetpack-jitm/build/images/background-165b2f00927a762c8cf4.png23.54KB25.93KB0.00%
jetpack_vendor/automattic/jetpack-my-jetpack/build/images/boost-a54137485af36fdffe9c.png144.84KB159.13KB0.00%
jetpack_vendor/automattic/jetpack-my-jetpack/build/images/search-f9756bd9c926d905fe70.png92.66KB101.40KB0.00%
jetpack_vendor/automattic/jetpack-my-jetpack/build/images/jetpack-license-activation-with-success-cad524ede4e793cc0ece.png142.02KB55.29KB▼ 61.07%
jetpack_vendor/automattic/jetpack-my-jetpack/build/images/videopress-9591093a9a238cc48a35.png249.82KB270.27KB0.00%