84% searchwp-api

Code Review | SearchWP API

WordPress plugin SearchWP API scored84%from 54 tests.

About plugin

  • Plugin page: searchwp-api
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-4.4
  • WordPress version: 6.3.1
  • First release: Jul 6, 2015
  • Latest release: Jan 7, 2016
  • Number of updates: 5
  • Update frequency: every 37.8 days
  • Top authors: Shelob9 (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

300+ active /12,792 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼17.82ms] Passed 4 tests

Server-side resources used by SearchWP API
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0040.18 ▼2.27
Dashboard /wp-admin3.31 ▼0.0454.00 ▼9.98
Posts /wp-admin/edit.php3.36 ▲0.0042.66 ▼15.26
Add New Post /wp-admin/post-new.php5.91 ▲0.0288.51 ▼37.51
Media Library /wp-admin/upload.php3.23 ▲0.0035.36 ▼8.54

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 5 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-posts
widget_recent-comments
db_upgraded
theysaidso_admin_options
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

This is an overview of browser requirements for SearchWP API
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲2814.17 ▼0.101.78 ▲0.2243.53 ▼0.45
Dashboard /wp-admin2,198 ▲215.60 ▲0.0384.18 ▼8.7541.14 ▲2.10
Posts /wp-admin/edit.php2,100 ▼01.98 ▼0.0134.28 ▼1.2135.30 ▼2.65
Add New Post /wp-admin/post-new.php1,526 ▼123.36 ▲0.29675.82 ▼8.7158.20 ▲3.60
Media Library /wp-admin/upload.php1,400 ▼04.03 ▼0.17100.19 ▼19.3447.45 ▼1.48

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Please fix the following
  • 1× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_REST_Posts_Controller' not found in wp-content/plugins/searchwp-api/route.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 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: search, json, searchwp, wp-api, calderawp...

searchwp-api/plugin.php 85% from 13 tests

Analyzing the main PHP file in "SearchWP API" version 1.1.0
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("searchwp-api.php" instead of "plugin.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
No dangerous file extensions were detected337 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP279176241
Markdown125078
JSON11018

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.60
Average class complexity38.00
▷ Minimum class complexity38.00
▷ Maximum class complexity38.00
Average method complexity3.75
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods13
▷ Static methods00.00%
▷ Public methods1184.62%
▷ Protected methods215.38%
▷ Private methods00.00%
Functions2
▷ Named functions150.00%
▷ Anonymous functions150.00%
Constants0
▷ Global constants00.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
There are no PNG files in this plugin