10% custom-search-results

Code Review | Custom Search Results

WordPress plugin Custom Search Results scored 10% from 54 tests.

About plugin

  • Plugin page: custom-search-res...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6.1-4.7
  • WordPress version: 6.3.1
  • First release: Nov 9, 2016
  • Latest release: Nov 9, 2016
  • Number of updates: 3
  • Update frequency: N/A
  • Top authors: quodlibet (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 654 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Please fix the following installer errors
  • Install procedure validation failed for this plugin
    • > Notice in wp-content/plugins/custom-search-results/index.php+26
    Constant WP_DEBUG already defined

Server metrics [RAM: ▼1.73MB] [CPU: ▼49.70ms] Passed 4 tests

This is a short check of server-side resources used by Custom Search Results
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.26 ▼1.206.06 ▼35.97
Dashboard /wp-admin2.28 ▼1.037.10 ▼45.99
Posts /wp-admin/edit.php2.28 ▼1.088.47 ▼38.88
Add New Post /wp-admin/post-new.php2.28 ▼3.617.99 ▼77.97
Media Library /wp-admin/upload.php2.28 ▼0.958.44 ▼26.00
Custom Results /wp-admin/admin.php?page=wesp-plugin-customsearches2.286.45
Custom Search Results /wp-admin/admin.php?page=wesp-plugin2.286.54
Custom Post Types /wp-admin/admin.php?page=wesp-plugin-customposttypes2.287.96

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

Filesystem and database footprint
The plugin installed successfully
Filesystem: 9 new files
Database: 3 new tables, 10 new options
New tables
wp_wesp_search_logging
wp_wesp_custom_searches
wp_wesp_custom_results
New WordPress options
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
wesp_db_version
wesp_searchtype_post
recovery_mode_email_last_sent
widget_recent-comments
wesp_searchtype_page
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

Custom Search Results: an overview of browser usage
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,831 ▲9613.31 ▼1.074.24 ▲2.1846.40 ▲1.05
Dashboard /wp-admin2,237 ▲525.85 ▼0.01111.14 ▲3.6841.35 ▼1.34
Posts /wp-admin/edit.php2,120 ▲312.06 ▲0.0639.64 ▼0.1336.19 ▲1.39
Add New Post /wp-admin/post-new.php685 ▼8391.73 ▼21.2722.17 ▼673.865.89 ▼53.71
Media Library /wp-admin/upload.php1,422 ▲434.21 ▲0.0597.44 ▼2.7443.42 ▼3.87
Custom Results /wp-admin/admin.php?page=wesp-plugin-customsearches8682.0221.6224.54
Custom Search Results /wp-admin/admin.php?page=wesp-plugin8653.9545.7543.10
Custom Post Types /wp-admin/admin.php?page=wesp-plugin-customposttypes9622.0523.0324.67

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] 25% 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
  • Uninstall procedure had uncaught errors
    • > Notice in wp-content/plugins/custom-search-results/index.php+26
    Constant WP_DEBUG already defined
  • The uninstall procedure failed, leaving 3 tables in the database
    • wp_wesp_custom_results
    • wp_wesp_search_logging
    • wp_wesp_custom_searches
  • This plugin does not fully uninstall, leaving 10 options in the database
    • wesp_searchtype_page
    • widget_theysaidso_widget
    • widget_recent-posts
    • wesp_searchtype_post
    • db_upgraded
    • can_compress_scripts
    • recovery_mode_email_last_sent
    • widget_recent-comments
    • theysaidso_admin_options
    • wesp_db_version

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Almost there, just fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wesp-plugin-customposttypes
    • > Notice in wp-content/plugins/custom-search-results/index.php+26
    Constant WP_DEBUG already defined
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wesp-plugin-customposttypes
    • > User notice in wp-includes/functions.php+5905
    Function add_submenu_page was called incorrectly. The seventh parameter passed to add_submenu_page() should be numeric representing menu position. Please see Debugging in WordPress for more information. (This message was added in version 5.3.0.)

SRP 50% 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
The following issues need your attention
  • 8× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/custom-search-results/crawl.php
    • > /wp-content/plugins/custom-search-results/post.php
    • > /wp-content/plugins/custom-search-results/index.php
    • > /wp-content/plugins/custom-search-results/init.php
    • > /wp-content/plugins/custom-search-results/admin.php
    • > /wp-content/plugins/custom-search-results/common.php
    • > /wp-content/plugins/custom-search-results/search.php
    • > /wp-content/plugins/custom-search-results/charts.php

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Tags: You are using too many tags: 11 tag instead of maximum 10
Please take inspiration from this readme.txt

custom-search-results/index.php 85% from 13 tests

"Custom Search Results" version 1.0's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please take the time to fix the following:
  • Text Domain: If you choose to specify the text domain, it must be the same as the plugin slug; optional since WordPress version 4.6
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("custom-search-results.php" instead of "index.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
Everything looks great! No dangerous files found in this plugin1,277 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP8812021,277

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.23
Average class complexity5.00
▷ Minimum class complexity4.00
▷ Maximum class complexity6.00
Average method complexity2.00
▷ Minimum method complexity1.00
▷ Maximum method complexity4.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods8
▷ Static methods00.00%
▷ Public methods8100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions40
▷ Named functions40100.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
No PNG files were detected