47% wp-file-search

Code Review | WP FILE SEARCH

WordPress plugin WP FILE SEARCH scored47%from 54 tests.

About plugin

  • Plugin page: wp-file-search
  • Plugin version: 1.0.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.2.5-4.3.1
  • WordPress version: 6.3.1
  • First release: Sep 29, 2015
  • Latest release: Oct 4, 2015
  • Number of updates: 14
  • Update frequency: every 0.9 days
  • Top authors: MariaOik (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /5,688 total downloads

Benchmarks

Plugin footprint 47% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.17MB] [CPU: ▼4.07ms] Passed 4 tests

Analyzing server-side resources used by WP FILE SEARCH
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.62 ▲0.1536.02 ▼4.90
Dashboard /wp-admin3.51 ▲0.2146.41 ▼0.29
Posts /wp-admin/edit.php3.57 ▲0.2143.51 ▼7.92
Add New Post /wp-admin/post-new.php6.05 ▲0.1784.86 ▼3.16
Media Library /wp-admin/upload.php3.37 ▲0.1535.61 ▲1.78
WP File Search /wp-admin/options-general.php?page=wp-file-search-admin3.3531.55

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

Input-output and database impact of this plugin
These are issues you should consider
  • The filesystem usage should be lower than 25MB (currently using 30.91MB)
Filesystem: 474 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
db_upgraded
wp_file_search_wfs_file_search
theysaidso_admin_options
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

An overview of browser requirements for WP FILE SEARCH
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,880 ▲11913.62 ▼0.735.24 ▲3.6236.35 ▼7.33
Dashboard /wp-admin2,200 ▲235.51 ▼0.0783.56 ▼8.2038.96 ▼2.66
Posts /wp-admin/edit.php2,111 ▲112.02 ▼0.0135.51 ▼5.8229.89 ▼9.78
Add New Post /wp-admin/post-new.php1,535 ▼023.18 ▼2.15602.60 ▼38.4047.11 ▼42.49
Media Library /wp-admin/upload.php1,408 ▲54.15 ▼0.04100.06 ▼4.9641.18 ▼2.08
WP File Search /wp-admin/options-general.php?page=wp-file-search-admin8682.0022.0429.89

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
Please fix the following items
  • The plugin did not uninstall gracefully
    • > Notice in wp-content/plugins/wp-file-search/uninstall.php+39
    Undefined index: checked
  • The plugin did not uninstall successfully, leaving 474 files (30.91MB) in the plugin directory
    • (new file) admin/partials/wp-file-search-admin-display.php
    • (new file) README.txt
    • (new file) admin/css/wp-file-search-admin.css
    • (new file) admin/class-wp-file-search-admin.php
    • (new file) admin/index.php
    • (new file) composer.json
    • (new file) admin/js/wp-file-search-admin.js
    • (new file) composer.lock
    • (new file) assets/screenshot-1.png
    • (new file) LICENSE.txt
    • ...
  • The uninstall procedure has failed, leaving 7 options in the database
    • wp_file_search_wfs_file_search
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments
    • can_compress_scripts
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

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

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 78× PHP files output text when accessed directly (only 10 are shown):
    • > /wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/examples/example_045.php
    • > /wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/examples/example_003.php
    • > /wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/examples/example_049.php
    • > /wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/examples/barcodes/example_2d_datamatrix_html.php
    • > /wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/examples/example_051.php
    • > /wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/examples/barcodes/example_2d_datamatrix_svgi.php
    • > /wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/examples/example_023.php
    • > /wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/examples/example_035.php
    • > /wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/examples/example_011.php
    • > /wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/examples/example_009.php
  • 225× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Warning
      chr() expects parameter 1 to be int, string given in wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/include/tcpdf_fonts.php on line 1506
    • > PHP Warning
      Illegal string offset 'url' in wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/tcpdf.php on line 18807
    • > PHP Fatal error
      Uncaught Error: Class 'mageekguy\\atoum\\test' not found in wp-content/plugins/wp-file-search/vendor/smalot/pdfparser/src/Smalot/PdfParser/Tests/Units/Element/ElementXRef.php:40
    • > PHP Warning
      chr() expects parameter 1 to be int, string given in wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/include/tcpdf_fonts.php on line 1506
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/tcpdf.php on line 17778
    • > PHP Warning
      chr() expects parameter 1 to be int, string given in wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/include/tcpdf_fonts.php on line 1506
    • > PHP Notice
      Trying to access array offset on value of type int in wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/tcpdf.php on line 12320
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/tcpdf.php on line 17778
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/tcpdf.php on line 17778
    • > PHP Warning
      "continue" targeting switch is equivalent to "break". Did you mean to use "continue 2"? in wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/tcpdf.php on line 17778

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
There were no browser issues found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
5 plugin tags: file, odt, search, pdf, docx

wp-file-search/wp-file-search.php Passed 13 tests

This is the main PHP file of "WP FILE SEARCH" version 1.0.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
121 characters long description:
WP File Search extends the default WP search to lookup on pdf, docx and odt files you have uploaded to the media library.

Code Analysis 0% from 3 tests

File types 0% from 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Please fix the following items
  • For security reasons, never distribute binary or executable files with your plugin
    • .crt - Security Certificate in Firefox, IE, Chrome, Safari
      • wp-content/plugins/wp-file-search/vendor/tecnick.com/tcpdf/examples/data/cert/tcpdf.crt
58,278 lines of code in 316 files:
LanguageFilesBlank linesComment linesLines of code
PHP3014,97220,77056,097
SVG3111,882
JSON400189
PO File1141854
Markdown216028
YAML14015
CSS2087
JavaScript24546

PHP code 0% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
It is recommended to fix the following
  • Cyclomatic complexity of classes should be reduced 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.34
Average class complexity83.11
▷ Minimum class complexity1.00
▷ Maximum class complexity4,349.00
Average method complexity8.02
▷ Minimum method complexity1.00
▷ Maximum method complexity499.00
Code structure
Namespaces8
Interfaces1
Traits0
Classes82
▷ Abstract classes00.00%
▷ Concrete classes82100.00%
▷ Final classes00.00%
Methods973
▷ Static methods13413.77%
▷ Public methods67669.48%
▷ Protected methods28729.50%
▷ Private methods101.03%
Functions8
▷ Named functions787.50%
▷ Anonymous functions112.50%
Constants158
▷ Global constants13887.34%
▷ Class constants2012.66%
▷ Public constants20100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.60MB with 0.21MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/tecnick.com/tcpdf/examples/images/image_with_alpha.png238.49KB61.71KB▼ 74.12%
vendor/tecnick.com/tcpdf/examples/images/_blank.png0.13KB0.09KB▼ 30.66%
vendor/tecnick.com/tcpdf/examples/images/alpha.png23.33KB30.34KB0.00%
vendor/tecnick.com/tcpdf/examples/images/logo_example.png18.96KB17.68KB▼ 6.71%
vendor/tecnick.com/tcpdf/examples/images/img.png190.57KB64.69KB▼ 66.06%