88% lh-add-media-from-url

Code Review | LH Add Media From Url

WordPress plugin LH Add Media From Url scored 88% from 54 tests.

About plugin

  • Plugin page: lh-add-media-from...
  • Plugin version: 1.22
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-5.7
  • WordPress version: 5.8.1
  • First release: Jul 15, 2015
  • Latest release: Apr 17, 2021
  • Number of updates: 25
  • Update frequency: every 84.1 days
  • Top authors: shawfactor (100%)

Code review

54 tests

User reviews

6 reviews

Install metrics

1,000+ active / 19,672 total downloads

Benchmarks

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
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼144.88ms] Passed 4 tests

A check of server-side resources used by LH Add Media From Url
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▲0.1439.01 ▲19.37
Dashboard /wp-admin3.09 ▲0.0334.85 ▼12.41
Posts /wp-admin/edit.php3.14 ▲0.0344.63 ▼1.29
Add New Post /wp-admin/post-new.php5.44 ▲0.0188.30 ▼567.11
Media Library /wp-admin/upload.php3.03 ▲0.0335.44 ▲1.29

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

How much does this plugin use your filesystem and database?
No storage issues were detected
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for LH Add Media From Url
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,684 ▲8815.93 ▲0.279.64 ▼0.9145.50 ▲0.07
Dashboard /wp-admin2,978 ▲475.92 ▼0.05144.10 ▼1.59108.55 ▼2.81
Posts /wp-admin/edit.php2,744 ▲52.71 ▼0.0067.98 ▼0.4485.25 ▼6.32
Add New Post /wp-admin/post-new.php1,686 ▲7118.80 ▼2.62384.15 ▲88.36104.09 ▼2.94
Media Library /wp-admin/upload.php1,812 ▲24.99 ▼0.04161.95 ▼0.98112.64 ▼2.90
Add from URL /wp-admin/lh-add-media-from-url.php260.900.0611.41

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
Uninstaller ran successfully

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
Even though no errors were found, this is by no means 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
Please take a closer look at the following
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/lh-add-media-from-url/lh-add-media-from-url.php:221
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_create_nonce() in wp-content/plugins/lh-add-media-from-url/partials/upload.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
These are user-side errors you should fix
    • > GET request to /wp-admin/lh-add-media-from-url.php
    • > Network (severe)
    wp-admin/lh-add-media-from-url.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
9 plugin tags: javascript, upload, url, media, images...

lh-add-media-from-url/lh-add-media-from-url.php 92% from 13 tests

"LH Add Media From Url" version 1.22's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes

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
Success! There were no dangerous files found in this plugin261 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP427441261

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.41
Average class complexity24.50
▷ Minimum class complexity15.00
▷ Maximum class complexity34.00
Average method complexity3.76
▷ Minimum method complexity1.00
▷ Maximum method complexity17.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods17
▷ Static methods1270.59%
▷ Public methods1376.47%
▷ Protected methods00.00%
▷ Private methods423.53%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
No PNG files were detected