74% s2member-secure-file-browser

Code Review | s2member Secure File Browser

WordPress plugin s2member Secure File Browser scored74%from 54 tests.

About plugin

  • Plugin page: s2member-secure-f...
  • Plugin version: 0.4.19
  • PHP version: 7.4.16
  • WordPress compatibility: 3.3-4.2.7
  • WordPress version: 6.3.1
  • First release: Dec 29, 2012
  • Latest release: Apr 8, 2016
  • Number of updates: 54
  • Update frequency: every 22.2 days
  • Top authors: Potsky (100%)

Code review

54 tests

User reviews

15 reviews

Install metrics

100+ active /14,357 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

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

An overview of server-side resources used by s2member Secure File Browser
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.46 ▲0.0037.87 ▲1.24
Dashboard /wp-admin3.31 ▲0.0048.23 ▼0.43
Posts /wp-admin/edit.php3.36 ▲0.0040.95 ▼6.81
Add New Post /wp-admin/post-new.php5.89 ▲0.0088.44 ▼7.92
Media Library /wp-admin/upload.php3.23 ▲0.0033.83 ▲3.80

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

Filesystem and database footprint
No storage issues were detected
Filesystem: 137 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
can_compress_scripts

Browser metrics Passed 4 tests

This is an overview of browser requirements for s2member Secure File Browser
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,800 ▲5413.75 ▼0.531.95 ▲0.2345.31 ▲5.03
Dashboard /wp-admin2,209 ▲185.92 ▲0.9598.56 ▼7.3240.74 ▼3.97
Posts /wp-admin/edit.php2,089 ▼02.00 ▼0.0236.47 ▼0.3831.45 ▼4.02
Add New Post /wp-admin/post-new.php1,542 ▲2318.66 ▼4.36652.28 ▲16.9669.91 ▲17.23
Media Library /wp-admin/upload.php1,388 ▼04.17 ▼0.0096.87 ▼1.8042.87 ▼4.20

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/s2member-secure-file-browser/class/psk_s2msfb.class.php+160
    Function create_function() is deprecated
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

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
The following issues need your attention
  • 6× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/s2member-secure-file-browser/uninstall.php:8
    • > PHP Warning
      Use of undefined constant WP_PLUGIN_DIR - assumed 'WP_PLUGIN_DIR' (this will throw an Error in a future version of PHP) in wp-content/plugins/s2member-secure-file-browser/inc/define.php on line 54
    • > PHP Warning
      Use of undefined constant PSK_S2MSFB_PLUGIN_FILE - assumed 'PSK_S2MSFB_PLUGIN_FILE' (this will throw an Error in a future version of PHP) in wp-content/plugins/s2member-secure-file-browser/inc/define.php on line 58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/s2member-secure-file-browser/inc/tools.class.php:19
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_url() in wp-content/plugins/s2member-secure-file-browser/inc/define.php:66
    • > PHP Fatal error
      Uncaught Error: Call to undefined function status_header() in wp-content/plugins/s2member-secure-file-browser/s2member-secure-file-browser.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
7 plugin tags: file, s2member, upload, files, manager...

s2member-secure-file-browser/s2member-secure-file-browser.php Passed 13 tests

The primary PHP file in "s2member Secure File Browser" version 0.4.19 is used by WordPress to initiate all plugin functionality
103 characters long description:
A plugin for browsing files from the secure-files location of the s2member WordPress Membership plugin.

Code Analysis 97% from 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 detected24,130 lines of code in 44 files:
LanguageFilesBlank linesComment linesLines of code
CSS112,0135010,242
JavaScript178195766,293
PHP128641,0644,673
PO File31,1681,5942,918
Markdown1304

PHP code 50% from 2 tests

Analyzing cyclomatic complexity and code structure
These items need your attention
  • Please reduce cyclomatic complexity of methods to less than 100 (currently 110)
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity73.40
▷ Minimum class complexity1.00
▷ Maximum class complexity299.00
Average method complexity7.58
▷ Minimum method complexity1.00
▷ Maximum method complexity110.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes10
▷ Abstract classes00.00%
▷ Concrete classes10100.00%
▷ Final classes00.00%
Methods110
▷ Static methods9990.00%
▷ Public methods9788.18%
▷ Protected methods00.00%
▷ Private methods1311.82%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants75
▷ Global constants75100.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
62 compressed PNG files occupy 0.07MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
img/prettyPhoto/facebook/contentPatternBottom.png0.12KB0.11KB▼ 10.40%
img/prettyPhoto/facebook/contentPatternTop.png0.12KB0.11KB▼ 10.40%
img/xls.png0.65KB0.63KB▼ 2.41%
img/directory.png0.52KB0.68KB0.00%
img/code.png0.59KB0.59KB0.50%