84% attachment-importer

Code Review | Attachment Importer

WordPress plugin Attachment Importer scored84%from 54 tests.

About plugin

  • Plugin page: attachment-importer
  • Plugin version: 0.6.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-4.0
  • WordPress version: 6.3.1
  • First release: Feb 16, 2014
  • Latest release: Sep 26, 2014
  • Number of updates: 13
  • Update frequency: every 24.2 days
  • Top authors: piontkowski (100%)

Code review

54 tests

User reviews

26 reviews

Install metrics

4,000+ active /42,684 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
This plugin's installer ran successfully

Server metrics [RAM: ▲0.06MB] [CPU: ▼5.99ms] Passed 4 tests

A check of server-side resources used by Attachment Importer
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0640.90 ▼9.09
Dashboard /wp-admin3.37 ▲0.0750.59 ▼1.26
Posts /wp-admin/edit.php3.42 ▲0.0650.23 ▼4.62
Add New Post /wp-admin/post-new.php5.97 ▲0.0892.25 ▼8.97
Media Library /wp-admin/upload.php3.29 ▲0.0643.80 ▲6.30

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

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

Browser metrics Passed 4 tests

Checking browser requirements for Attachment Importer
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,789 ▲314.20 ▼0.381.91 ▼0.1939.52 ▼4.50
Dashboard /wp-admin2,198 ▲215.64 ▲0.0386.24 ▼0.8140.14 ▲0.58
Posts /wp-admin/edit.php2,103 ▲31.98 ▲0.0137.85 ▲0.6037.08 ▲2.31
Add New Post /wp-admin/post-new.php1,526 ▼023.31 ▲0.35660.53 ▼85.7656.48 ▼17.20
Media Library /wp-admin/upload.php1,403 ▼04.26 ▲0.07109.97 ▲10.8846.87 ▲2.36

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
You still need to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • widget_recent-posts
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • db_upgraded

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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/attachment-importer/index.php:76

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 93% 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: images, attachments, wxr, attachment, import...

attachment-importer/index.php 85% from 13 tests

The main file in "Attachment Importer" v. 0.6.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
The following require your attention:
  • Description: The description should be shorter than 140 characters (currently 189 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("attachment-importer.php" instead of "index.php")

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 detected1,552 lines of code in 5 files:
LanguageFilesBlank linesComment linesLines of code
CSS238661,103
PHP17224233
JavaScript13611179
Markdown112037

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.29
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%
Functions10
▷ Named functions10100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.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
PNG images were not found in this plugin