84% search-only-posts

Code Review | Search Only Posts

WordPress plugin Search Only Posts scored84%from 54 tests.

About plugin

  • Plugin page: search-only-posts
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.6.20+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.6-5.7
  • WordPress version: 6.3.1
  • First release: Apr 14, 2021
  • Latest release: Apr 14, 2021
  • Number of updates: 4
  • Update frequency: every 0.3 days
  • Top authors: fafchook (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /1,058 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 gracefully, with no errors

Server metrics [RAM: ▲0.00MB] [CPU: ▼2.57ms] Passed 4 tests

A check of server-side resources used by Search Only Posts
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0038.97 ▼3.31
Dashboard /wp-admin3.31 ▲0.0049.33 ▲0.16
Posts /wp-admin/edit.php3.36 ▲0.0049.88 ▼1.08
Add New Post /wp-admin/post-new.php5.89 ▲0.0094.82 ▼6.04
Media Library /wp-admin/upload.php3.24 ▲0.0040.30 ▲1.63

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 4 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-comments
db_upgraded
theysaidso_admin_options
widget_recent-posts
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Search Only Posts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.27 ▼0.381.56 ▼0.5138.25 ▼3.73
Dashboard /wp-admin2,192 ▲185.49 ▼0.1799.93 ▲9.2646.27 ▲6.52
Posts /wp-admin/edit.php2,100 ▼32.02 ▲0.0139.28 ▼1.9434.77 ▼2.15
Add New Post /wp-admin/post-new.php1,526 ▼023.06 ▲0.02643.60 ▼44.0353.95 ▼7.79
Media Library /wp-admin/upload.php1,400 ▼04.19 ▲0.0794.28 ▼11.8041.63 ▲0.32

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
You still need to fix the following
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts
    • theysaidso_admin_options
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_admin() in wp-content/plugins/search-only-posts/search-only-posts.php:16

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration Passed 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
3 plugin tags: search, search only posts, search posts

search-only-posts/search-only-posts.php Passed 13 tests

"Search Only Posts" version 1.0.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
117 characters long description:
A simple plugin that forces Wordpress default search feature to search only posts and excludes pages from the search.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
No dangerous file extensions were detected10 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP121210

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.67
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
icon-128x128.png11.63KB5.01KB▼ 56.89%