84% wpftp

Code Review | WPFTP

WordPress plugin WPFTP scored84%from 54 tests.

About plugin

  • Plugin page: wpftp
  • Plugin version: 4.3
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.0-6.2
  • WordPress version: 6.3.1
  • First release: Jul 22, 2019
  • Latest release: May 13, 2023
  • Number of updates: 10
  • Update frequency: every 139.1 days
  • Top authors: laobuluo (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /2,829 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

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

Server metrics [RAM: ▲0.06MB] [CPU: ▼1.64ms] Passed 4 tests

A check of server-side resources used by WPFTP
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.51 ▲0.0542.75 ▼0.30
Dashboard /wp-admin3.37 ▲0.0350.27 ▼16.39
Posts /wp-admin/edit.php3.43 ▲0.0756.11 ▲6.75
Add New Post /wp-admin/post-new.php5.99 ▲0.11128.96 ▲28.38
Media Library /wp-admin/upload.php3.30 ▲0.0740.16 ▲3.39

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

Filesystem and database footprint
This plugin was installed successfully
Filesystem: 33 new files
Database: no new tables, 7 new options
New WordPress options
widget_recent-posts
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts
db_upgraded
wpftp_options
theysaidso_admin_options

Browser metrics Passed 4 tests

Checking browser requirements for WPFTP
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,811 ▲5014.64 ▲0.081.56 ▼0.1540.60 ▼3.01
Dashboard /wp-admin2,217 ▲375.65 ▲0.0291.42 ▼7.1642.86 ▲0.66
Posts /wp-admin/edit.php2,122 ▲222.12 ▲0.1838.40 ▲1.2440.18 ▲5.87
Add New Post /wp-admin/post-new.php1,545 ▲1722.56 ▼0.55628.64 ▼63.3157.31 ▼0.14
Media Library /wp-admin/upload.php1,422 ▲194.23 ▲0.0497.69 ▼8.5341.87 ▼6.80

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
It is recommended to fix the following
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_recent-comments
    • can_compress_scripts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts

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 | 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 take a closer look at the following
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wpftp/actions.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/wpftp/actions.php:6

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)
Everything seems fine on the user side

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
3 plugin tags: ftp, wordpress ftp, wordpress

wpftp/index.php 85% from 13 tests

"WPFTP" version 4.3's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
Please make the necessary changes and fix the following:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wpftp.php" instead of "index.php")
  • Description: Please keep the plugin description shorter than 140 characters (currently 156 characters long)

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 detected660 lines of code in 18 files:
LanguageFilesBlank linesComment linesLines of code
PHP58696450
SVG13563195
JavaScript6059
CSS6046

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity9.00
▷ Minimum class complexity9.00
▷ Maximum class complexity9.00
Average method complexity2.33
▷ Minimum method complexity1.00
▷ Maximum method complexity5.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods6
▷ Static methods00.00%
▷ Public methods583.33%
▷ Protected methods116.67%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
6 PNG files occupy 0.22MB with 0.17MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
layui/css/modules/layer/default/icon.png11.22KB4.36KB▼ 61.19%
layui/css/modules/layer/default/icon-ext.png5.77KB2.91KB▼ 49.62%
layui/images/footer_logo.png24.87KB0.95KB▼ 96.18%
layui/images/qrcode.png72.54KB12.37KB▼ 82.94%
layui/images/logo.png24.44KB0.95KB▼ 96.10%