78% fv-swiftype

Code Review | FV Swiftype

WordPress plugin FV Swiftype scored78%from 54 tests.

About plugin

  • Plugin page: fv-swiftype
  • Plugin version: 0.3.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.9
  • WordPress version: 6.3.1
  • First release: Apr 24, 2015
  • Latest release: Mar 28, 2022
  • Number of updates: 18
  • Update frequency: every 140.6 days
  • Top authors: FolioVision (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,561 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.20MB] [CPU: ▼0.94ms] Passed 4 tests

A check of server-side resources used by FV Swiftype
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.67 ▲0.2138.93 ▼3.56
Dashboard /wp-admin3.50 ▲0.2046.92 ▼4.98
Posts /wp-admin/edit.php3.62 ▲0.2649.65 ▲0.40
Add New Post /wp-admin/post-new.php6.08 ▲0.2095.72 ▲4.37
Media Library /wp-admin/upload.php3.42 ▲0.2039.39 ▲5.24
FV Swiftype /wp-admin/options-general.php?page=fv_swiftype3.3632.54

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-comments
widget_theysaidso_widget
db_upgraded
widget_recent-posts

Browser metrics Passed 4 tests

FV Swiftype: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,819 ▲6213.19 ▼1.161.57 ▼0.7240.89 ▼4.42
Dashboard /wp-admin2,219 ▲314.85 ▼1.05109.42 ▲4.3342.91 ▼4.72
Posts /wp-admin/edit.php2,101 ▲122.04 ▲0.0439.67 ▲6.2836.24 ▼1.50
Add New Post /wp-admin/post-new.php1,526 ▲617.78 ▼5.23667.23 ▼9.5165.71 ▲8.70
Media Library /wp-admin/upload.php1,401 ▲104.21 ▲0.0297.63 ▼8.6742.41 ▼0.01
FV Swiftype /wp-admin/options-general.php?page=fv_swiftype9142.1623.0031.20

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These server-side errors were triggered
    • > GET request to /wp-admin/options-general.php?page=fv_swiftype
    • > Notice in wp-content/plugins/fv-swiftype/fv-swiftype.php+512
    Undefined index: api_key

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
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/fv-swiftype/fv-swiftype.php:26

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser errors were detected

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
Please fix the following attributes:
  • Screenshots: Screenshot #1 (FV Switftype settings) image missing
The official readme.txt might help

fv-swiftype/fv-swiftype.php Passed 13 tests

The main file in "FV Swiftype" v. 0.3.8 serves as a complement to information provided in readme.txt and as the entry point to the plugin
36 characters long description:
Use Swiftype engine for your search.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Success! There were no dangerous files found in this plugin1,236 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP43992611,236

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity52.50
▷ Minimum class complexity10.00
▷ Maximum class complexity127.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity24.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods87
▷ Static methods00.00%
▷ Public methods7282.76%
▷ Protected methods00.00%
▷ Private methods1517.24%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.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
1 PNG file occupies 0.08MB with 0.05MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png78.17KB27.83KB▼ 64.40%