72% custom-ajax-search-results

Code Review | Custom AJAX Search Results (C.A.S.R.)

WordPress plugin Custom AJAX Search Results (C.A.S.R.) scored72%from 54 tests.

About plugin

  • Plugin page: custom-ajax-searc...
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.1.0-6.3.1
  • WordPress version: 6.3.1
  • First release: Jun 15, 2022
  • Latest release: Sep 13, 2023
  • Number of updates: 12
  • Update frequency: every 37.9 days
  • Top authors: jvsan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /282 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.10MB] [CPU: ▼5.16ms] Passed 4 tests

A check of server-side resources used by Custom AJAX Search Results (C.A.S.R.)
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0946.81 ▲2.88
Dashboard /wp-admin3.42 ▲0.1153.79 ▼2.20
Posts /wp-admin/edit.php3.53 ▲0.1749.52 ▲0.17
Add New Post /wp-admin/post-new.php6.00 ▲0.1183.00 ▼18.97
Media Library /wp-admin/upload.php3.34 ▲0.1138.40 ▲0.38
C.A.S.R. /wp-admin/options-general.php?page=custom-ajax-search-results3.2931.88

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

A short overview of filesystem and database impact
This plugin installed successfully
Filesystem: 15 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

Custom AJAX Search Results (C.A.S.R.): an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,872 ▲8613.40 ▼1.028.52 ▲6.1342.49 ▼5.27
Dashboard /wp-admin2,202 ▲255.63 ▲0.0295.82 ▲6.4542.36 ▼1.32
Posts /wp-admin/edit.php2,104 ▲41.95 ▼0.0833.28 ▼3.4135.28 ▼0.29
Add New Post /wp-admin/post-new.php1,531 ▲522.95 ▼0.07628.10 ▼45.8155.46 ▲1.34
Media Library /wp-admin/upload.php1,401 ▲14.20 ▲0.0396.30 ▼7.5644.08 ▼3.92
C.A.S.R. /wp-admin/options-general.php?page=custom-ajax-search-results9232.0126.1127.06

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
These items require your attention
  • The uninstall procedure has failed, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=custom-ajax-search-results
    • > Notice in wp-content/plugins/custom-ajax-search-results/includes/class-casr-settings-page.php+32
    Undefined index: tab

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
Please fix the following items
  • 5× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/custom-ajax-search-results/includes/reusable/casr-ajax-get-settings.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/custom-ajax-search-results/includes/class-casr.php:5
    • > PHP Notice
      Undefined variable: casr_search in wp-content/plugins/custom-ajax-search-results/includes/reusable/casr-content.php on line 6
    • > PHP Fatal error
      Uncaught Error: Call to a member function have_posts() on null in wp-content/plugins/custom-ajax-search-results/includes/reusable/casr-content.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/custom-ajax-search-results/includes/class-casr.php:5

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=custom-ajax-search-results
    • > Network (severe)
    wp-content/plugins/custom-ajax-search-results/admin/js/casr-admin.js?ver=1.0.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
7 plugin tags: seo friendly, lightweight, ajax search, fast, ajax...

custom-ajax-search-results/casr.php 92% from 13 tests

The main file in "Custom AJAX Search Results (C.A.S.R.)" v. 1.0.2 serves as a complement to information provided in readme.txt and as the entry point to the plugin
Please make the necessary changes and fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("custom-ajax-search-results.php" instead of "casr.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
Success! There were no dangerous files found in this plugin451 lines of code in 12 files:
LanguageFilesBlank linesComment linesLines of code
PHP97061388
JavaScript27054
CSS1109

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.16
Average class complexity4.80
▷ Minimum class complexity1.00
▷ Maximum class complexity13.00
Average method complexity1.86
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods22
▷ Static methods00.00%
▷ Public methods1881.82%
▷ Protected methods00.00%
▷ Private methods418.18%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants00.00%
▷ Class constants3100.00%
▷ Public constants3100.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 files were detected