78% add-media-from-url

Code Review | Add Media from URL

WordPress plugin Add Media from URL scored78%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: 6.3.1
  • 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

20+ active /1,699 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
This plugin's installer ran successfully

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

An overview of server-side resources used by Add Media from URL
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0636.79 ▼4.08
Dashboard /wp-admin3.36 ▲0.0144.49 ▼13.94
Posts /wp-admin/edit.php3.41 ▲0.0550.00 ▲7.11
Add New Post /wp-admin/post-new.php5.94 ▲0.0590.39 ▼0.83
Media Library /wp-admin/upload.php3.28 ▲0.0533.95 ▼0.55

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 2 new files
Database: no new tables, 6 new options
New WordPress options
widget_recent-comments
theysaidso_admin_options
can_compress_scripts
db_upgraded
widget_theysaidso_widget
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for Add Media from URL
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.22 ▼1.181.76 ▼0.1541.32 ▼0.09
Dashboard /wp-admin2,210 ▲194.84 ▼0.02100.05 ▼1.1939.49 ▲1.28
Posts /wp-admin/edit.php2,121 ▲352.04 ▲0.0139.34 ▼0.5236.68 ▲2.20
Add New Post /wp-admin/post-new.php1,536 ▼122.93 ▲4.44618.05 ▲7.8958.49 ▲7.40
Media Library /wp-admin/upload.php1,395 ▲44.31 ▲0.0293.56 ▼8.5141.91 ▼5.97
Add from URL /wp-admin/add-media-from-url.php260.440.0715.48

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
The smoke test was a success, however most plugin functionality was not tested

SRP 50% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 1× PHP files trigger errors when accessed directly with GET requests:
    • > 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 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > 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)

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Tags: Too many tags (14 tag instead of maximum 10); only the first 5 tags are used in your directory listing
The official readme.txt is a good inspiration

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

"Add Media from URL" version 1.0.2's main PHP file describes plugin functionality and also serves as the entry point to any WordPress functionality
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 | A short check of programming languages and file extensions; no executable files are allowed
Good job! No executable or dangerous file extensions detected202 lines of code in 1 file:
LanguageFilesBlank linesComment linesLines of code
PHP110660202

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
This plugin has no cyclomatic complexity problems
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
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods880.00%
▷ Protected methods00.00%
▷ Private methods220.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.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