78% sara-ajax-search

Code Review | Sara Ajax Search

WordPress plugin Sara Ajax Search scored78%from 54 tests.

About plugin

  • Plugin page: sara-ajax-search
  • Plugin version: 1.0.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.4
  • WordPress version: 6.3.1
  • First release: May 13, 2020
  • Latest release: May 15, 2020
  • Number of updates: 16
  • Update frequency: every 0.1 days
  • Top authors: ravikhadka (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,465 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.09MB] [CPU: ▼9.67ms] Passed 4 tests

Analyzing server-side resources used by Sara Ajax Search
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.1048.88 ▲6.98
Dashboard /wp-admin3.40 ▲0.0645.02 ▼12.43
Posts /wp-admin/edit.php3.52 ▲0.1646.06 ▼1.60
Add New Post /wp-admin/post-new.php5.98 ▲0.1081.47 ▼26.04
Media Library /wp-admin/upload.php3.32 ▲0.1034.28 ▲1.38

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 26 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
widget_recent-posts
db_upgraded
widget_recent-comments
can_compress_scripts
theysaidso_admin_options

Browser metrics Passed 4 tests

An overview of browser requirements for Sara Ajax Search
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,902 ▲15613.62 ▼0.765.73 ▲3.9342.08 ▼1.87
Dashboard /wp-admin2,225 ▲374.87 ▼1.00100.51 ▲0.7939.30 ▼5.18
Posts /wp-admin/edit.php2,108 ▲162.06 ▲0.0539.57 ▼1.7634.16 ▼3.60
Add New Post /wp-admin/post-new.php1,533 ▲1923.24 ▲5.54676.65 ▲59.4051.41 ▲1.91
Media Library /wp-admin/upload.php1,401 ▲164.22 ▲0.07104.94 ▲9.3745.76 ▲2.03

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 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 were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-comments
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded

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 no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please fix the following items
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/sara-ajax-search/public/partials/saraajaxsearch-public-display.php
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sara-ajax-search/admin/sarasearch.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/sara-ajax-search/admin/class-saraajaxsearch-admin.php:123
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/sara-ajax-search/admin/partials/saraajaxsearch-admin-display.php:15
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/sara-ajax-search/admin/partials/saraajaxsearch-form.php:3

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser issues were found

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
4 plugin tags: sara search, ajax, ajax search, live search

sara-ajax-search/saraajaxsearch.php 77% from 13 tests

"Sara Ajax Search" version 1.0.3's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
Please take the time to fix the following:
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 224 characters long)
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("sara-ajax-search.php" instead of "saraajaxsearch.php")

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
Good job! No executable or dangerous file extensions detected670 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
PHP14242548511
CSS32416133
JavaScript3126626

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.24
Average class complexity1.71
▷ Minimum class complexity1.00
▷ Maximum class complexity3.00
Average method complexity1.22
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes7
▷ Abstract classes00.00%
▷ Concrete classes7100.00%
▷ Final classes00.00%
Methods23
▷ Static methods28.70%
▷ Public methods1878.26%
▷ Protected methods00.00%
▷ Private methods521.74%
Functions14
▷ Named functions14100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG images were found in this plugin