73% search-for-custom-fields

Code Review | Search For Custom Fields

WordPress plugin Search For Custom Fields scored73%from 54 tests.

About plugin

  • Plugin page: search-for-custom...
  • Plugin version: 1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 4.1-6.3
  • WordPress version: 6.3.1
  • First release: Aug 31, 2017
  • Latest release: Aug 11, 2023
  • Number of updates: 12
  • Update frequency: every 181.3 days
  • Top authors: stephanelion (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /678 total downloads

Benchmarks

Plugin footprint 65% 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.02MB] [CPU: ▼4.65ms] Passed 4 tests

A check of server-side resources used by Search For Custom Fields
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0238.06 ▼16.85
Dashboard /wp-admin3.32 ▲0.0250.15 ▼1.34
Posts /wp-admin/edit.php3.38 ▲0.0249.55 ▼0.37
Add New Post /wp-admin/post-new.php5.91 ▲0.0298.00 ▲1.02
Media Library /wp-admin/upload.php3.25 ▲0.0239.24 ▼0.05

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 9 new files
Database: 2 new tables, 7 new options
New tables
wp_sfcf_fields
wp_sfcf_options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
widget_sfcf_widget

Browser metrics Passed 4 tests

A check of browser resources used by Search For Custom Fields
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,805 ▲4414.71 ▲0.391.90 ▲0.3242.48 ▲4.48
Dashboard /wp-admin2,208 ▲345.64 ▲0.0595.54 ▲0.2542.48 ▲3.48
Posts /wp-admin/edit.php2,119 ▲221.99 ▼0.0239.19 ▲0.3836.64 ▲2.79
Add New Post /wp-admin/post-new.php1,539 ▲1123.28 ▲0.07651.31 ▲27.4249.98 ▼3.06
Media Library /wp-admin/upload.php1,410 ▲104.15 ▼0.0396.15 ▼7.3844.27 ▲0.22

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_sfcf_fields
    • wp_sfcf_options
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • can_compress_scripts
    • widget_sfcf_widget
    • widget_theysaidso_widget
    • db_upgraded
    • theysaidso_admin_options
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/search-for-custom-fields/sfcf_widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/search-for-custom-fields/sfcf.php:13

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
Attributes that require attention:
  • Screenshots: Add images for these screenshots: #1 (Plugin administration), #2 (Your visitors can search for posts or pages via your custom fields), #3 (Display your custom fields in your posts and pages.)
Please take inspiration from this readme.txt

search-for-custom-fields/sfcf.php 85% from 13 tests

The main PHP file in "Search For Custom Fields" ver. 1.2 adds more information about the plugin and also serves as the entry point for this plugin
The following require your attention:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("search-for-custom-fields.php" instead of "sfcf.php")

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
Success! There were no dangerous files found in this plugin656 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP24822512
PO File14343144

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.52
Average class complexity33.00
▷ Minimum class complexity33.00
▷ Maximum class complexity33.00
Average method complexity9.00
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods4
▷ Static methods00.00%
▷ Public methods4100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions15
▷ Named functions15100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
3 PNG files occupy 0.09MB with 0.04MB in potential savings
Potential savings
Compression of 3 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-3.png14.27KB7.78KB▼ 45.48%
screenshot-1.png60.75KB28.18KB▼ 53.62%
screenshot-2.png14.86KB6.93KB▼ 53.34%