84% media-from-ftp

Code Review | Media from FTP

WordPress plugin Media from FTP scored 84% from 54 tests.

About plugin

  • Plugin page: media-from-ftp
  • Plugin version: 11.14
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-5.5
  • WordPress version: 5.8.1
  • First release: Aug 15, 2013
  • Latest release: Jul 20, 2020
  • Number of updates: 477
  • Update frequency: every 5.3 days
  • Top authors: Katsushi Kawamori (100%)

Code review

54 tests

User reviews

82 reviews

Install metrics

20,000+ active / 615,308 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.04MB] [CPU: ▼137.66ms] Passed 4 tests

A check of server-side resources used by Media from FTP
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1437.65 ▲15.63
Dashboard /wp-admin3.10 ▲0.0455.09 ▲9.53
Posts /wp-admin/edit.php3.18 ▲0.0844.20 ▲0.26
Add New Post /wp-admin/post-new.php5.46 ▲0.0395.90 ▼554.98
Media Library /wp-admin/upload.php3.04 ▲0.0333.32 ▼5.43
Log /wp-admin/admin.php?page=mediafromftp-log3.0231.67
Media from FTP /wp-admin/admin.php?page=mediafromftp3.0230.57
Add-Ons /wp-admin/admin.php?page=mediafromftp-addons3.0232.33
Settings /wp-admin/admin.php?page=mediafromftp-settings3.0230.30
Search & Register /wp-admin/admin.php?page=mediafromftp-search-register3.0357.86

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 17 new files
Database: 1 new table, 4 new options
New tables
wp_mediafromftp_log
New WordPress options
mediafromftp_add_on_wpcron_events
mediafromftp_log_version
mediafromftp
mediafromftp_notice

Browser metrics Passed 4 tests

This is an overview of browser requirements for Media from FTP
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,728 ▲13215.89 ▲0.448.88 ▼1.2943.87 ▼5.90
Dashboard /wp-admin3,016 ▲856.00 ▲0.07161.16 ▲1.94112.05 ▼0.46
Posts /wp-admin/edit.php2,788 ▲492.81 ▲0.1170.60 ▲2.6586.07 ▼7.07
Add New Post /wp-admin/post-new.php1,714 ▲3118.40 ▼0.02386.65 ▼24.59114.97 ▲1.17
Media Library /wp-admin/upload.php1,859 ▲525.02 ▲0.02163.15 ▲2.07120.39 ▼2.25
Log /wp-admin/admin.php?page=mediafromftp-log1,2942.4464.2039.84
Media from FTP /wp-admin/admin.php?page=mediafromftp1,2522.5565.7035.64
Add-Ons /wp-admin/admin.php?page=mediafromftp-addons1,4312.5666.3531.84
Settings /wp-admin/admin.php?page=mediafromftp-settings3,3262.8893.4446.91
Search & Register /wp-admin/admin.php?page=mediafromftp-search-register2,1212.4664.8641.22

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
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/media-from-ftp/uninstall.php+88
    rmdir(wp-content/uploads/media-from-ftp-tmp): Directory not empty

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)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
Almost there! Just fix the following items
  • 7× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/media-from-ftp/req/class-tt-mediafromftp-list-table.php on line 26
    • > PHP Warning
      require_once(ABSPATHwp-admin/includes/class-wp-screen.php): failed to open stream: No such file or directory in wp-content/plugins/media-from-ftp/req/class-tt-mediafromftp-list-table.php on line 26
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-admin/includes/class-wp-screen.php' (include_path='.:/usr/share/php') in wp-content/plugins/media-from-ftp/req/class-tt-mediafromftp-list-table.php on line 26
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/media-from-ftp/req/class-mediafromftpajax.php:58
    • > PHP Fatal error
      Uncaught Error: Call to undefined function untrailingslashit() in wp-content/plugins/media-from-ftp/req/class-mediafromftpadmin.php:100
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/media-from-ftp/req/class-mediafromftpregist.php:45
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/media-from-ftp/mediafromftp.php:32

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 96% from 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
6 plugin tags: sync, files, ftp, uploads, media...

media-from-ftp/mediafromftp.php 92% from 13 tests

"Media from FTP" version 11.14's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
The following require your attention:
  • Main file name: The principal plugin file should be the same as the plugin slug ("media-from-ftp.php" instead of "mediafromftp.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
No dangerous file extensions were detected5,430 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP74978403,482
JavaScript4194901,548
CSS4272400

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity111.00
▷ Minimum class complexity25.00
▷ Maximum class complexity238.00
Average method complexity9.73
▷ Minimum method complexity1.00
▷ Maximum method complexity83.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes00.00%
Methods64
▷ Static methods00.00%
▷ Public methods5078.12%
▷ Protected methods00.00%
▷ Private methods1421.88%
Functions2
▷ Named functions2100.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
No PNG images were found in this plugin