88% media-with-ftp

Code Review | Media with FTP

WordPress plugin Media with FTP scored 88% from 54 tests.

About plugin

  • Plugin page: media-with-ftp
  • Plugin version: 1.0.0
  • PHP compatiblity: 5.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.6.0-5.2.2
  • WordPress version: 5.9.2
  • First release: Aug 1, 2019
  • Latest release: Aug 1, 2019
  • Number of updates: 10
  • Update frequency: every 0.5 days
  • Top authors: m615926 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

40+ active / 1,152 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
This plugin's installer ran successfully

Server metrics [RAM: ▲0.68MB] [CPU: ▼294.37ms] Passed 4 tests

An overview of server-side resources used by Media with FTP
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.96 ▲0.4457.93 ▲5.87
Dashboard /wp-admin4.20 ▲0.7939.19 ▲3.66
Posts /wp-admin/edit.php4.39 ▲0.7542.56 ▲4.85
Add New Post /wp-admin/post-new.php7.71 ▲0.7499.90 ▼1,187.81
Media Library /wp-admin/upload.php4.14 ▲0.8527.68 ▲1.83
Media with FTP /wp-admin/options-general.php?page=mwf_options4.3728.44

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

Analyzing filesystem and database footprints of this plugin
This plugin was installed successfully
Filesystem: 193 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Media with FTP
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,894 ▲14016.35 ▲0.369.41 ▲3.172.51 ▼0.10
Dashboard /wp-admin2,914 ▲566.19 ▲0.01119.87 ▼11.59151.91 ▼6.82
Posts /wp-admin/edit.php2,713 ▲193.26 ▲0.0365.07 ▲0.32142.66 ▼1.80
Add New Post /wp-admin/post-new.php1,687 ▼2420.20 ▼0.79392.40 ▼83.91157.27 ▲0.88
Media Library /wp-admin/upload.php1,718 ▲265.57 ▲0.06138.76 ▼7.11186.97 ▲3.18
Media with FTP /wp-admin/options-general.php?page=mwf_options1,1682.6559.22100.82

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
This plugin's uninstaller ran successfully

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Good news, no errors were detected

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
Almost there! Just fix the following items
  • 3× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/media-with-ftp/vendor/cmb2/cmb2/apigen/hook-docs.php
    • > /wp-content/plugins/media-with-ftp/public/partials/media-with-ftp-public-display.php
    • > /wp-content/plugins/media-with-ftp/admin/partials/media-with-ftp-admin-display.php
  • 41× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text_Date' not found in wp-content/plugins/media-with-ftp/vendor/cmb2/cmb2/includes/types/CMB2_Type_Text_Time.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Base' not found in wp-content/plugins/media-with-ftp/vendor/cmb2/cmb2/includes/types/CMB2_Type_Title.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Hookup_Base' not found in wp-content/plugins/media-with-ftp/vendor/cmb2/cmb2/includes/rest-api/CMB2_REST.php:19
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Text' not found in wp-content/plugins/media-with-ftp/vendor/cmb2/cmb2/includes/types/CMB2_Type_Colorpicker.php:13
    • > PHP Warning
      file_get_contents(/Users/JT/Sites/wpengine/api/tree.html): failed to open stream: No such file or directory in wp-content/plugins/media-with-ftp/vendor/cmb2/cmb2/apigen/hook-docs.php on line 221
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_REST_Controller' not found in wp-content/plugins/media-with-ftp/vendor/cmb2/cmb2/includes/rest-api/CMB2_REST_Controller_Boxes.php:17
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Radio' not found in wp-content/plugins/media-with-ftp/vendor/cmb2/cmb2/includes/types/CMB2_Type_Multicheck.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_Type_Taxonomy_Base' not found in wp-content/plugins/media-with-ftp/vendor/cmb2/cmb2/includes/types/CMB2_Type_Taxonomy_Radio.php:13
    • > PHP Warning
      file_put_contents(/Users/JT/Sites/wpengine/api/hook-docs.html): failed to open stream: No such file or directory in wp-content/plugins/media-with-ftp/vendor/cmb2/cmb2/apigen/hook-docs.php on line 229
    • > PHP Fatal error
      Uncaught Error: Class 'CMB2_hookup' not found in wp-content/plugins/media-with-ftp/vendor/cmb2/cmb2/includes/CMB2_Options_Hookup.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 88% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === media-with-ftp === )
  • Contributors: Contributors not specified
The official readme.txt is a good inspiration

media-with-ftp/media-with-ftp.php Passed 13 tests

The main PHP file in "Media with FTP" ver. 1.0.0 adds more information about the plugin and also serves as the entry point for this plugin
92 characters long description:
Let's you upload images to ftp-server and remove the uploads in the WordPress Media Library.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Success! There were no dangerous files found in this plugin21,363 lines of code in 130 files:
LanguageFilesBlank linesComment linesLines of code
PHP752,3366,8287,756
CSS161,2721,1725,101
JSON3003,558
JavaScript144737012,437
Sass16300251,379
Markdown42330702
PO File2173226430

PHP code Passed 2 tests

An short overview of logical lines of code, cyclomatic complexity, and other code metrics
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity17.68
▷ Minimum class complexity1.00
▷ Maximum class complexity183.00
Average method complexity3.25
▷ Minimum method complexity1.00
▷ Maximum method complexity31.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes77
▷ Abstract classes810.39%
▷ Concrete classes6989.61%
▷ Final classes00.00%
Methods575
▷ Static methods9516.52%
▷ Public methods47582.61%
▷ Protected methods8915.48%
▷ Private methods111.91%
Functions40
▷ Named functions3997.50%
▷ Anonymous functions12.50%
Constants10
▷ Global constants440.00%
▷ Class constants660.00%
▷ Public constants6100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
22 compressed PNG files occupy 0.02MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
vendor/cmb2/cmb2/images/ui-bg_glass_75_dadada_1x400.png0.11KB0.16KB0.00%
vendor/cmb2/cmb2/images/ui-icons_222222_256x240.png4.27KB4.11KB▼ 3.78%
vendor/cmb2/cmb2/images/ico-delete.png0.70KB0.72KB0.00%
vendor/cmb2/cmb2/images/ui-bg_glass_65_ffffff_1x400.png0.10KB0.10KB▼ 5.71%
vendor/cmb2/cmb2/apigen/theme-bootstrap/src/resources/tree-last.png0.17KB0.11KB▼ 36.05%