78% import-external-attachments

Code Review | Import external attachments

WordPress plugin Import external attachments scored78%from 54 tests.

About plugin

  • Plugin page: import-external-a...
  • Plugin version: 1.5.12
  • PHP version: 7.4.16
  • WordPress compatibility: 3.2-4.4
  • WordPress version: 6.3.1
  • First release: Mar 1, 2016
  • Latest release: Feb 24, 2017
  • Number of updates: 13
  • Update frequency: every 28.8 days
  • Top authors: ryanpcmcquen (100%)

Code review

54 tests

User reviews

25 reviews

Install metrics

2,000+ active /20,933 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.07MB] [CPU: ▼2.54ms] Passed 4 tests

This is a short check of server-side resources used by Import external attachments
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0739.53 ▲1.97
Dashboard /wp-admin3.38 ▲0.0847.21 ▼0.09
Posts /wp-admin/edit.php3.43 ▲0.0742.21 ▼0.13
Add New Post /wp-admin/post-new.php5.96 ▲0.0781.20 ▼10.50
Media Library /wp-admin/upload.php3.30 ▲0.0736.70 ▲0.56
Import attachments /wp-admin/upload.php?page=external_image3.2633.94

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Import external attachments
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,795 ▲4914.51 ▲0.271.71 ▲0.1440.05 ▲3.01
Dashboard /wp-admin2,204 ▲265.62 ▲0.0683.78 ▼19.5536.20 ▼0.95
Posts /wp-admin/edit.php2,106 ▲62.03 ▼0.0241.05 ▲4.2138.44 ▲4.31
Add New Post /wp-admin/post-new.php1,533 ▼322.89 ▼0.09592.55 ▼26.5059.11 ▼4.98
Media Library /wp-admin/upload.php1,406 ▲64.20 ▼0.0599.47 ▼5.9644.56 ▲0.90
Import attachments /wp-admin/upload.php?page=external_image8572.0023.9627.32

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-comments
    • db_upgraded
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • can_compress_scripts

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Smoke test failed, please fix the following
    • > GET request to /wp-admin/upload.php?page=external_image
    • > Notice in wp-content/plugins/import-external-attachments/import-external-attachments.php+501
    Undefined variable: posts_to_fix

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Please take a closer look at the following
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/import-external-attachments/import-external-attachments.php:39
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/import-external-attachments/ajax.php:8

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
There were no browser issues found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file describes your plugin functionality and requirements and it is parsed to prepare the your plugin's listing
These attributes need your attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt is a good inspiration

import-external-attachments/import-external-attachments.php Passed 13 tests

The main file in "Import external attachments" v. 1.5.12 serves as a complement to information provided in readme.txt and as the entry point to the plugin
136 characters long description:
Examines the text of a post and makes local copies of all the images & documents, adding them as gallery attachments on the post itself.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short review of files and their extensions; it is not recommended to include executable files
Success! There were no dangerous files found in this plugin494 lines of code in 3 files:
LanguageFilesBlank linesComment linesLines of code
PHP213971401
JavaScript1302193

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.37
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.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 were not PNG files found in your plugin