83% searchable-attachments

Code Review | Searchable Attachments

WordPress plugin Searchable Attachments scored83%from 54 tests.

About plugin

  • Plugin page: searchable-attach...
  • Plugin version: 0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 2.8-4.4
  • WordPress version: 6.3.1
  • First release: Jan 3, 2016
  • Latest release: Jan 3, 2016
  • Number of updates: 5
  • Update frequency: every 2.2 days
  • Top authors: dan.rossiter (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /531 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.78ms] Passed 4 tests

This is a short check of server-side resources used by Searchable Attachments
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0338.26 ▲0.36
Dashboard /wp-admin3.34 ▲0.0345.69 ▼0.33
Posts /wp-admin/edit.php3.45 ▲0.0951.90 ▲5.23
Add New Post /wp-admin/post-new.php5.92 ▲0.0380.19 ▼13.75
Media Library /wp-admin/upload.php3.26 ▲0.0332.50 ▼5.38

Server storage [IO: ▲26.71MB] [DB: ▲0.00MB] 67% from 3 tests

A short overview of filesystem and database impact
Just a few items left to fix
  • Total filesystem usage should be limited to 25MB (currently using 26.71MB)
Filesystem: 236 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_recent-comments
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Searchable Attachments
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲7913.25 ▼1.061.83 ▲0.1942.67 ▲2.67
Dashboard /wp-admin2,209 ▲185.91 ▲0.8396.10 ▼12.2737.82 ▼4.24
Posts /wp-admin/edit.php2,089 ▼01.99 ▼0.0738.35 ▼1.8233.45 ▼1.68
Add New Post /wp-admin/post-new.php1,542 ▲118.34 ▼5.10594.47 ▼56.3156.28 ▼10.03
Media Library /wp-admin/upload.php1,388 ▼04.23 ▲0.06101.43 ▲5.4846.81 ▲4.36

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Good news, no errors were detected

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
  • 26× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\Font' not found in wp-content/plugins/searchable-attachments/inc/tools/pdfparser/Font/FontType0.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\Font' not found in wp-content/plugins/searchable-attachments/inc/tools/pdfparser/Font/FontType1.php:40
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\Element' not found in wp-content/plugins/searchable-attachments/inc/tools/pdfparser/Element/ElementString.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\Element' not found in wp-content/plugins/searchable-attachments/inc/tools/pdfparser/Element/ElementName.php:42
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\Element' not found in wp-content/plugins/searchable-attachments/inc/tools/pdfparser/Element/ElementNull.php:41
    • > PHP Fatal error
      Cannot use Smalot\\PdfParser\\Object as Object because 'Object' is a special class name in wp-content/plugins/searchable-attachments/inc/tools/pdfparser/XObject/Form.php on line 34
    • > PHP Fatal error
      Cannot use 'Object' as class name as it is reserved in wp-content/plugins/searchable-attachments/inc/tools/pdfparser/Object.php on line 41
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\Object' not found in wp-content/plugins/searchable-attachments/inc/tools/pdfparser/Pages.php:38
    • > PHP Fatal error
      Uncaught Error: Class 'Smalot\\PdfParser\\Object' not found in wp-content/plugins/searchable-attachments/inc/tools/pdfparser/Page.php:42
    • > PHP Fatal error
      Cannot use Smalot\\PdfParser\\Object as Object because 'Object' is a special class name in wp-content/plugins/searchable-attachments/inc/tools/pdfparser/XObject/Image.php on line 33

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
3 plugin tags: search, pdf, attachments

searchable-attachments/searchable-attachments.php Passed 13 tests

This is the main PHP file of "Searchable Attachments" version 0.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
70 characters long description:
Extend WordPress searches to include the contents of your attachments.

Code Analysis 95% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Success! There were no dangerous files found in this plugin49,106 lines of code in 128 files:
LanguageFilesBlank linesComment linesLines of code
PHP1271,94013,46749,080
Markdown115026

PHP code 0% from 2 tests

This plugin's cyclomatic complexity and code structure detailed below
It is recommended to fix the following
  • Please reduce cyclomatic complexity of classes to less than 1000 (currently 4,349)
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 499)
Cyclomatic complexity
Average complexity per logical line of code0.43
Average class complexity138.43
▷ Minimum class complexity1.00
▷ Maximum class complexity4,349.00
Average method complexity9.06
▷ Minimum method complexity1.00
▷ Maximum method complexity499.00
Code structure
Namespaces5
Interfaces0
Traits0
Classes49
▷ Abstract classes12.04%
▷ Concrete classes4897.96%
▷ Final classes00.00%
Methods839
▷ Static methods13816.45%
▷ Public methods54364.72%
▷ Protected methods29435.04%
▷ Private methods20.24%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants112
▷ Global constants10795.54%
▷ Class constants54.46%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
No PNG files were detected