93% wp-image-importer

Code Review | WP Image Importer

WordPress plugin WP Image Importer scored 93% from 54 tests.

About plugin

  • Plugin page: wp-image-importer
  • Plugin version: 1.0.5
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4-5.6
  • WordPress version: 5.8.1
  • First release: Apr 2, 2016
  • Latest release: Jun 29, 2021
  • Number of updates: 35
  • Update frequency: every 54.7 days
  • Top authors: cedcommerce (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active / 3,848 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▼0.01MB] [CPU: ▼187.78ms] Passed 4 tests

An overview of server-side resources used by WP Image Importer
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.03 ▲0.2037.09 ▲1.35
Dashboard /wp-admin3.10 ▲0.0529.24 ▼16.49
Posts /wp-admin/edit.php3.16 ▲0.0533.68 ▼15.24
Add New Post /wp-admin/post-new.php5.16 ▼0.2774.97 ▼713.82
Media Library /wp-admin/upload.php3.12 ▲0.1228.17 ▼5.56

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 112 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

An overview of browser requirements for WP Image Importer
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,768 ▲17216.08 ▲0.2910.28 ▲1.0845.86 ▲1.08
Dashboard /wp-admin3,059 ▲1286.23 ▲0.28142.57 ▼5.46110.36 ▲3.15
Posts /wp-admin/edit.php2,841 ▲1022.62 ▼0.0883.07 ▲15.8097.23 ▲10.49
Add New Post /wp-admin/post-new.php1,667 ▲5218.86 ▼2.52380.53 ▲81.16105.14 ▼1.54
Media Library /wp-admin/upload.php1,847 ▲405.07 ▲0.01157.05 ▼3.02119.12 ▲2.24

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
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 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | SRP (Single-Responsibility Principle) - PHP files must act as libraries and never output text or perform any action when accessed directly in a browser
Almost there! Just fix the following items
  • 41× PHP files trigger errors when accessed directly with GET requests (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNode' not found in wp-content/plugins/wp-image-importer/Facebook/GraphNodes/GraphObject.php:34
    • > PHP Fatal error
      Uncaught Error: Interface 'Facebook\\Url\\UrlDetectionInterface' not found in wp-content/plugins/wp-image-importer/Facebook/Url/FacebookUrlDetectionHandler.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNode' not found in wp-content/plugins/wp-image-importer/Facebook/GraphNodes/GraphPicture.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\FileUpload\\FacebookFile' not found in wp-content/plugins/wp-image-importer/Facebook/FileUpload/FacebookVideo.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\Helpers\\FacebookSignedRequestFromInputHelper' not found in wp-content/plugins/wp-image-importer/Facebook/Helpers/FacebookCanvasHelper.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNode' not found in wp-content/plugins/wp-image-importer/Facebook/GraphNodes/GraphAchievement.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNode' not found in wp-content/plugins/wp-image-importer/Facebook/GraphNodes/GraphSessionInfo.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNode' not found in wp-content/plugins/wp-image-importer/Facebook/GraphNodes/GraphLocation.php:31
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\GraphNode' not found in wp-content/plugins/wp-image-importer/Facebook/GraphNodes/GraphApplication.php:32
    • > PHP Fatal error
      Uncaught Error: Class 'Facebook\\GraphNodes\\Collection' not found in wp-content/plugins/wp-image-importer/Facebook/GraphNodes/GraphEdge.php:35

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 81% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
Attributes that need to be fixed:
  • Screenshots: Please add an image for screenshot #1 (Setting page)
  • Tags: You are using too many tags: 17 tag instead of maximum 10
  • Screenshots: Add a description for screenshot #0 in wp-image-importer/assets to your readme.txt
You can take inspiration from this readme.txt

wp-image-importer/wp-image-importer.php Passed 13 tests

The main file in "WP Image Importer" v. 1.0.5 serves as a complement to information provided in readme.txt and as the entry point to the plugin
66 characters long description:
WP Image Importer Plugin allows to easily import Images into Posts

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
No dangerous file extensions were detected8,040 lines of code in 93 files:
LanguageFilesBlank linesComment linesLines of code
PHP841,1605,6346,263
CSS22518740
JavaScript67578740
PO File1136164297

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.27
Average class complexity6.55
▷ Minimum class complexity1.00
▷ Maximum class complexity63.00
Average method complexity1.81
▷ Minimum method complexity1.00
▷ Maximum method complexity32.00
Code structure
Namespaces11
Interfaces5
Traits1
Classes69
▷ Abstract classes11.45%
▷ Concrete classes6898.55%
▷ Final classes00.00%
Methods518
▷ Static methods173.28%
▷ Public methods47491.51%
▷ Protected methods254.83%
▷ Private methods193.67%
Functions5
▷ Named functions240.00%
▷ Anonymous functions360.00%
Constants31
▷ Global constants825.81%
▷ Class constants2374.19%
▷ Public constants23100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
9 compressed PNG files occupy 0.01MB
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/album.png0.59KB0.66KB0.00%
assets/images/settings.png0.65KB0.76KB0.00%
assets/images/pictures.png2.80KB2.27KB▼ 19.00%
assets/images/wordpress.png1.97KB2.19KB0.00%
assets/images/picture.png0.63KB0.56KB▼ 10.78%