77% dropbox-upload-form

Code Review | Dropbox Upload Form

WordPress plugin Dropbox Upload Form scored77%from 54 tests.

About plugin

  • Plugin page: dropbox-upload-form
  • Plugin version: 0.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5.0-3.6.0
  • WordPress version: 6.3.1
  • First release: Mar 29, 2010
  • Latest release: May 9, 2013
  • Number of updates: 27
  • Update frequency: every 55.6 days
  • Top authors: ostlund (100%)

Code review

54 tests

User reviews

1 review

Install metrics

20+ active /11,435 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.05MB] [CPU: ▼6.36ms] Passed 4 tests

This is a short check of server-side resources used by Dropbox Upload Form
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.50 ▲0.0436.19 ▼0.43
Dashboard /wp-admin3.35 ▲0.0543.41 ▼4.70
Posts /wp-admin/edit.php3.40 ▲0.0547.09 ▲0.04
Add New Post /wp-admin/post-new.php5.93 ▲0.0584.30 ▼20.34
Media Library /wp-admin/upload.php3.28 ▲0.0535.09 ▲5.87
WP-Dropbox /wp-admin/options-general.php?page=dropbox-upload-form/wp-dropbox.php3.2227.54

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

How much does this plugin use your filesystem and database?
The plugin installed successfully
Filesystem: 7 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
theysaidso_admin_options
widget_recent-posts
recovery_mode_email_last_sent
widget_recent-comments
widget_theysaidso_widget

Browser metrics Passed 4 tests

An overview of browser requirements for Dropbox Upload Form
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲5813.29 ▼1.081.90 ▲0.1139.32 ▼1.19
Dashboard /wp-admin2,210 ▲274.79 ▼0.15109.67 ▼0.9838.05 ▼6.25
Posts /wp-admin/edit.php2,093 ▲42.04 ▲0.0138.83 ▼6.3636.47 ▼1.74
Add New Post /wp-admin/post-new.php1,536 ▲123.18 ▼0.15629.21 ▲30.2654.71 ▲2.44
Media Library /wp-admin/upload.php1,395 ▲104.16 ▼0.0396.58 ▼3.8543.61 ▼0.22
WP-Dropbox /wp-admin/options-general.php?page=dropbox-upload-form/wp-dropbox.php7921.537.2824.98

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • can_compress_scripts
    • widget_theysaidso_widget
    • recovery_mode_email_last_sent
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=dropbox-upload-form/wp-dropbox.php
    • > Notice in wp-content/plugins/dropbox-upload-form/wp-dropbox.php+165
    Undefined index: wp_db_submit_hidden
    • > GET request to /wp-admin/options-general.php?page=dropbox-upload-form/wp-dropbox.php
    • > Warning in wp-content/plugins/dropbox-upload-form/wp-dropbox.php+219
    Use of undefined constant wpdbUploadForm - assumed 'wpdbUploadForm' (this will throw an Error in a future version of PHP)
    • > GET request to /wp-admin/options-general.php?page=dropbox-upload-form/wp-dropbox.php
    • > Error in wp-content/plugins/dropbox-upload-form/inc/dropbox.php+437
    Uncaught Error: Class 'TijsVerkoyen\Dropbox\Exception' not found in wp-content/plugins/dropbox-upload-form/inc/dropbox.php:437
    Stack trace:
    #0 wp-content/plugins/dropbox-upload-form/inc/dropbox.php(685): TijsVerkoyen\Dropbox\Dropbox->doCall()
    #1 wp-content/plugins/dropbox-upload-form/wp-dropbox.php(234): TijsVerkoyen\Dropbox\Dropbox->accountInfo()
    #2 wp-includes/class-wp-hook.php(310): wp_dropbox_settings_page()
    #3 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #4 wp-includes/plugin.php(517): WP_Hook->do_action()
    #5 wp-admin/admin.php(259): do_action()
    #6 wp-admin/options-general.php(10): require_once('/var/www/wordpr...')
    #7 {main}
    thrown

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
The following issues need your attention
  • 3× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      require_once(): Failed opening required 'ABSPATHwp-includes/pluggable.php' (include_path='.:/usr/share/php') in wp-content/plugins/dropbox-upload-form/wp-dropbox.php on line 31
    • > PHP Warning
      Use of undefined constant ABSPATH - assumed 'ABSPATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/dropbox-upload-form/wp-dropbox.php on line 31
    • > PHP Warning
      require_once(ABSPATHwp-includes/pluggable.php): failed to open stream: No such file or directory in wp-content/plugins/dropbox-upload-form/wp-dropbox.php on line 31

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 errors were detected

Optimizations

Plugin configuration 87% from 29 tests

readme.txt 88% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that require attention:
  • Donate link: Invalid URI ("")
  • Plugin Name: Write the name of your plugin instead of "Plugin Name" on the first line ( === dropbox-upload-form === )
Please take inspiration from this readme.txt

dropbox-upload-form/wp-dropbox.php 85% from 13 tests

The primary PHP file in "Dropbox Upload Form" version 0.2.1 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Description: Keep the plugin description shorter than 140 characters (currently 247 characters long)
  • Main file name: Name the main plugin file the same as the plugin slug ("dropbox-upload-form.php" instead of "wp-dropbox.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected714 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP2203493663
PO File1141442
CSS1209

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity84.00
▷ Minimum class complexity84.00
▷ Maximum class complexity84.00
Average method complexity3.18
▷ Minimum method complexity1.00
▷ Maximum method complexity25.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods38
▷ Static methods12.63%
▷ Public methods2771.05%
▷ Protected methods00.00%
▷ Private methods1128.95%
Functions7
▷ Named functions7100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants00.00%
▷ Class constants6100.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
1 PNG file occupies 0.01MB with 0.01MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png8.51KB2.82KB▼ 66.82%