10% typeahead

Code Review | Typeahead

WordPress plugin Typeahead scored10%from 54 tests.

About plugin

  • Plugin page: typeahead
  • Plugin version: 0.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-3.9.1
  • WordPress version: 6.3.1
  • First release: Jan 22, 2014
  • Latest release: Jul 23, 2014
  • Number of updates: 25
  • Update frequency: every 7.4 days
  • Top authors: binaryoung (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,745 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
You still need to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/typeahead/typeahead.php+42
    __autoload() is deprecated, use spl_autoload_register() instead

Server metrics [RAM: ▼1.94MB] [CPU: ▼59.16ms] Passed 4 tests

Server-side resources used by Typeahead
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.06 ▼1.404.44 ▼36.81
Dashboard /wp-admin2.08 ▼1.276.72 ▼55.45
Posts /wp-admin/edit.php2.08 ▼1.285.23 ▼51.05
Add New Post /wp-admin/post-new.php2.08 ▼3.816.04 ▼93.34
Media Library /wp-admin/upload.php2.08 ▼1.154.88 ▼30.70
Typeahead Settings /wp-admin/options-general.php?page=typeahead2.085.40

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-comments
can_compress_scripts
typeahead
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Typeahead
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,030 ▲29513.78 ▼0.5919.32 ▲17.2342.32 ▼8.32
Dashboard /wp-admin2,210 ▲195.83 ▲0.9498.20 ▼5.6439.37 ▼5.30
Posts /wp-admin/edit.php2,096 ▲42.01 ▼0.0339.29 ▼8.5335.69 ▼7.39
Add New Post /wp-admin/post-new.php1,517 ▼1117.45 ▼1.00632.33 ▲6.5958.65 ▼2.36
Media Library /wp-admin/upload.php1,395 ▲44.25 ▼0.0297.40 ▼3.5243.76 ▼8.90
Typeahead Settings /wp-admin/options-general.php?page=typeahead8002.0624.7732.99

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • Uninstall procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/typeahead/typeahead.php+42
    __autoload() is deprecated, use spl_autoload_register() instead
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • widget_theysaidso_widget
    • typeahead

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=typeahead
    • > Deprecated in wp-content/plugins/typeahead/typeahead.php+42
    __autoload() is deprecated, use spl_autoload_register() instead
    • > GET request to /wp-admin/options-general.php?page=typeahead
    • > User notice in wp-includes/functions.php+5905
    Function register_uninstall_hook was called incorrectly. Only a static class method or function can be used in an uninstall hook. Please see Debugging in WordPress for more information. (This message was added in version 3.1.0.)

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
Almost there! Just fix the following items
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/typeahead/typeahead.php:23

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is undoubtedly the most important file in your plugin, preparing it for public listing on WordPress.org
6 plugin tags: autocomplete, better search, typeahead, suggest, search...

typeahead/typeahead.php Passed 13 tests

The principal PHP file in "Typeahead" v. 0.2.1 is loaded by WordPress automatically on each request
115 characters long description:
Provide autocomplete for search box by typeahead.js.为您的网站搜索框添加搜索下拉词条建议功能。

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
There were no executable files found in this plugin300 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP45215182
PO File2101067
CSS20032
JavaScript31519

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.18
Average class complexity3.33
▷ Minimum class complexity2.00
▷ Maximum class complexity6.00
Average method complexity1.26
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods20
▷ Static methods00.00%
▷ Public methods20100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions4
▷ Named functions4100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
5 PNG files occupy 0.91MB with 0.59MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
banner-772x250.png45.02KB15.92KB▼ 64.64%
screenshot-2.png466.58KB153.99KB▼ 67.00%
screenshot-1.png64.42KB22.11KB▼ 65.67%
screenshot-3.png311.62KB124.78KB▼ 59.96%
screenshot-4.png48.83KB16.02KB▼ 67.19%