83% instant-images

Code Review | Instant Images - One Click Image Uploads from Unsplash, Openverse, Pixabay and Pexels

WordPress plugin Instant Images - One Click Image Uploads from Unsplash, Openverse, Pixabay and Pexels scored83%from 54 tests.

About plugin

  • Plugin page: instant-images
  • Plugin version: 6.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 5.0-6.4
  • WordPress version: 6.3.1
  • First release: Nov 1, 2016
  • Latest release: Nov 13, 2023
  • Number of updates: 143
  • Update frequency: every 18.0 days
  • Top authors: dcooney (100%)

Code review

54 tests

User reviews

49 reviews

Install metrics

100,000+ active /1,648,571 total downloads

Benchmarks

Plugin footprint 82% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
This plugin's installer ran successfully

Server metrics [RAM: ▲0.03MB] [CPU: ▼4.57ms] 75% from 4 tests

A check of server-side resources used by Instant Images - One Click Image Uploads from Unsplash, Openverse, Pixabay and Pexels
Please fix the following
  • CPU: Total CPU usage must kept under 500.00ms (currently 1,832.73ms on /wp-admin/options-general.php?page=instant-images-settings)
PageMemory (MB)CPU Time (ms)
Home /3.49 ▲0.0336.45 ▼5.33
Dashboard /wp-admin3.35 ▲0.0046.76 ▼17.44
Posts /wp-admin/edit.php3.40 ▲0.0448.80 ▲3.48
Add New Post /wp-admin/post-new.php5.96 ▲0.0793.36 ▲3.56
Media Library /wp-admin/upload.php3.27 ▲0.0434.89 ▲1.02
Instant Images /wp-admin/options-general.php?page=instant-images-settings3.581,832.73
Instant Images /wp-admin/upload.php?page=instant-images3.2831.89

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

Filesystem and database footprint
There were no storage issued detected upon installing this plugin
Filesystem: 42 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_recent-posts
can_compress_scripts
theysaidso_admin_options
widget_recent-comments

Browser metrics Passed 4 tests

Checking browser requirements for Instant Images - One Click Image Uploads from Unsplash, Openverse, Pixabay and Pexels
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,798 ▲5114.27 ▼0.441.65 ▲0.0139.06 ▼3.71
Dashboard /wp-admin2,206 ▲295.62 ▲0.0994.24 ▼8.3540.27 ▼2.68
Posts /wp-admin/edit.php2,108 ▲81.96 ▼0.0539.39 ▲4.3636.83 ▲0.50
Add New Post /wp-admin/post-new.php1,550 ▲1924.29 ▲1.39672.05 ▼36.0352.78 ▼9.83
Media Library /wp-admin/upload.php1,405 ▲114.20 ▲0.0097.36 ▼1.2042.82 ▼0.45
Instant Images /wp-admin/options-general.php?page=instant-images-settings1,5341.8427.13134.49
Instant Images /wp-admin/upload.php?page=instant-images2,7865.37124.7891.51

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
The following items require your attention
  • Zombie WordPress options detected upon uninstall: 6 options
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • can_compress_scripts

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 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Please take a closer look at the following
  • 14× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Warning
      Use of undefined constant INSTANT_IMAGES_PATH - assumed 'INSTANT_IMAGES_PATH' (this will throw an Error in a future version of PHP) in wp-content/plugins/instant-images/admin/views/settings.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/instant-images/admin/includes/settings/licenses.php:12
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/instant-images/api/settings.php:10
    • > PHP Fatal error
      require_once(): Failed opening required 'INSTANT_IMAGES_PATHadmin/includes/settings/header.php' (include_path='.:/usr/share/php') in wp-content/plugins/instant-images/admin/views/settings.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/instant-images/api/download.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function submit_button() in wp-content/plugins/instant-images/admin/includes/settings/save.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr_e() in wp-content/plugins/instant-images/admin/includes/settings/whats-new.php:12
    • > PHP Warning
      require_once(INSTANT_IMAGES_PATHadmin/includes/settings/header.php): failed to open stream: No such file or directory in wp-content/plugins/instant-images/admin/views/settings.php on line 10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/instant-images/admin/includes/header.php:11
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/instant-images/api/license.php:10

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

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
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 12 tag instead of maximum 10
  • License uri: Invalid url: ""
  • Donate link: Invalid url: ""
Please take inspiration from this readme.txt

instant-images/instant-images.php Passed 13 tests

The entry point to "Instant Images - One Click Image Uploads from Unsplash, Openverse, Pixabay and Pexels" version 6.1.0 is a PHP file that has certain tags in its header comment area
100 characters long description:
One click image uploads directly to your media library from Unsplash, Openverse, Pixabay and Pexels.

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 plugin2,759 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
PHP253328121,884
CSS250610
JavaScript84948238
JSON10027

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity46.67
▷ Minimum class complexity18.00
▷ Maximum class complexity85.00
Average method complexity4.26
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods42
▷ Static methods1330.95%
▷ Public methods3173.81%
▷ Protected methods00.00%
▷ Private methods1126.19%
Functions42
▷ Named functions3480.95%
▷ Anonymous functions819.05%
Constants17
▷ Global constants17100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
There are no PNG files in this plugin