94% add-external-media

Code Review | Add External Media

WordPress plugin Add External Media scored 94% from 54 tests.

About plugin

  • Plugin page: add-external-media
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.3+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-5.3
  • WordPress version: 5.9.2
  • First release: Mar 11, 2015
  • Latest release: Nov 13, 2019
  • Number of updates: 36
  • Update frequency: every 47.4 days
  • Top authors: leemon (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

300+ active / 14,857 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

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

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

This is a short check of server-side resources used by Add External Media
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.56 ▲0.0554.85 ▲3.45
Dashboard /wp-admin3.45 ▲0.0532.91 ▼1.88
Posts /wp-admin/edit.php3.68 ▲0.0437.93 ▲0.77
Add New Post /wp-admin/post-new.php6.92 ▼0.0592.47 ▼1,177.03
Media Library /wp-admin/upload.php3.33 ▲0.0426.71 ▲1.35

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

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

Browser metrics Passed 4 tests

A check of browser resources used by Add External Media
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,763 ▲915.91 ▲0.176.79 ▲0.862.28 ▼0.37
Dashboard /wp-admin2,895 ▲346.15 ▼0.07121.16 ▼13.70159.87 ▲0.03
Posts /wp-admin/edit.php2,694 ▲33.23 ▲0.0164.33 ▼3.67143.64 ▲0.69
Add New Post /wp-admin/post-new.php1,757 ▲6721.84 ▲0.51443.24 ▼9.09158.07 ▼1.24
Media Library /wp-admin/upload.php1,705 ▲75.55 ▲0.08147.12 ▲6.73188.56 ▼2.68

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled successfully, without leaving any zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
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
  • 1× 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/add-external-media/add-external-media.php:285

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)
Everything seems fine on the user side

Optimizations

Plugin configuration Passed 29 tests

readme.txt Passed 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
5 plugin tags: external, attachments, oembed, media, admin

add-external-media/add-external-media.php Passed 13 tests

The main PHP script in "Add External Media" version 1.0.5 is automatically included on every request by WordPress
39 characters long description:
Add external media to the media library

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of programming languages used in this plugin; dangerous file extensions are not allowed
There were no executable files found in this plugin385 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript16120189
PHP14897140
PO File36656

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.31
Average class complexity18.00
▷ Minimum class complexity18.00
▷ Maximum class complexity18.00
Average method complexity2.42
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods18.33%
▷ Public methods1191.67%
▷ Protected methods18.33%
▷ Private methods00.00%
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
There are no PNG files in this plugin