88% add-media-from-url

Code Review | Add Media from URL

WordPress plugin Add Media from URL scored 88% from 54 tests.

About plugin

  • Plugin page: add-media-from-url
  • Plugin version: 1.0.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.7
  • WordPress version: 5.9.2
  • First release: Dec 29, 2016
  • Latest release: Jan 2, 2017
  • Number of updates: 4
  • Update frequency: every 1.8 days
  • Top authors: LordPretender (100%)

Code review

54 tests

User reviews

1 review

Install metrics

30+ active / 1,457 total downloads


Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Installer ran successfully

Server metrics [RAM: ▼0.01MB] [CPU: ▼296.20ms] Passed 4 tests

An overview of server-side resources used by Add Media from URL
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0254.66 ▼0.78
Dashboard /wp-admin3.43 ▲0.0232.04 ▼0.97
Posts /wp-admin/edit.php3.66 ▲0.0234.48 ▼0.56
Add New Post /wp-admin/post-new.php6.90 ▼0.0793.23 ▼1,176.13
Media Library /wp-admin/upload.php3.31 ▲0.0124.14 ▼6.91

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 2 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Add Media from URL
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲4615.82 ▲0.175.88 ▼0.672.34 ▲0.10
Dashboard /wp-admin2,897 ▲366.06 ▼0.11114.95 ▼18.31151.85 ▼11.31
Posts /wp-admin/edit.php2,718 ▲243.23 ▼0.0062.15 ▲0.88138.03 ▼4.36
Add New Post /wp-admin/post-new.php1,755 ▲320.87 ▼0.49466.32 ▲35.56152.44 ▼4.38
Media Library /wp-admin/upload.php1,703 ▲25.49 ▼0.02139.33 ▼15.33184.83 ▼9.28
Add from URL /wp-admin/add-media-from-url.php260.940.0420.33

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% 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
Please fix the following
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/add-media-from-url/add-media-from-url.php:35

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
There are user-side issues you should fix
    • > GET request to /wp-admin/add-media-from-url.php
    • > Network (severe)
    wp-admin/add-media-from-url.php - Failed to load resource: the server responded with a status of 404 (Not Found)


Plugin configuration 97% from 29 tests

readme.txt 94% 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
These attributes need to be fixed:
  • Tags: You are using too many tags: 14 tag instead of maximum 10
The official readme.txt is a good inspiration

add-media-from-url/add-media-from-url.php Passed 13 tests

The main PHP script in "Add Media from URL" version 1.0.2 is automatically included on every request by WordPress
78 characters long description:
Let you add media files into your media library without having to upload them.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected202 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity34.00
▷ Minimum class complexity34.00
▷ Maximum class complexity34.00
Average method complexity4.30
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
▷ Static methods00.00%
▷ Public methods880.00%
▷ Protected methods00.00%
▷ Private methods220.00%
▷ Named functions1100.00%
▷ Anonymous functions00.00%
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
There are no PNG files in this plugin