72% wn-flickr-embed

Code Review | WN Flickr Image Downloader

WordPress plugin WN Flickr Image Downloader scored72%from 54 tests.

About plugin

  • Plugin page: wn-flickr-embed
  • Plugin version: 1.0
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.6-5.5.1
  • WordPress version: 6.3.1
  • First release: Sep 26, 2020
  • Latest release: Sep 26, 2020
  • Number of updates: 6
  • Update frequency: every 0.2 days
  • Top authors: yaidier (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /431 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.00MB] [CPU: ▼8.29ms] Passed 4 tests

A check of server-side resources used by WN Flickr Image Downloader
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.47 ▲0.0142.33 ▼1.40
Dashboard /wp-admin3.32 ▼0.0250.22 ▼22.38
Posts /wp-admin/edit.php3.37 ▲0.0151.85 ▲2.59
Add New Post /wp-admin/post-new.php5.90 ▲0.0194.79 ▼10.20
Media Library /wp-admin/upload.php3.24 ▲0.0139.28 ▲0.84
Save Handler /wp-admin/admin.php?page=wn_flickr_embed_db_handler3.2836.39
Create New /wp-admin/admin.php?page=wn_flickr_embed_create_new3.3232.42

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 12 new files
Database: no new tables, 7 new options
New WordPress options
WN_Flickr_Embed
widget_recent-comments
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
db_upgraded
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for WN Flickr Image Downloader
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,839 ▲5314.27 ▼0.331.77 ▼0.1044.86 ▲1.46
Dashboard /wp-admin2,245 ▲655.70 ▲0.1081.58 ▼5.7076.38 ▲33.21
Posts /wp-admin/edit.php2,150 ▲531.98 ▼0.0739.42 ▲3.3835.88 ▼0.36
Add New Post /wp-admin/post-new.php1,571 ▲3123.16 ▲4.81764.77 ▲129.8262.84 ▲9.40
Media Library /wp-admin/upload.php1,453 ▲534.19 ▼0.0797.23 ▼0.0470.84 ▲26.35
Save Handler /wp-admin/admin.php?page=wn_flickr_embed_db_handler7201.419.8319.10
Create New /wp-admin/admin.php?page=wn_flickr_embed_create_new1,0851.7227.9046.83

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
  • The uninstall procedure has failed, leaving 6 options in the database
    • theysaidso_admin_options
    • db_upgraded
    • can_compress_scripts
    • widget_theysaidso_widget
    • widget_recent-comments
    • widget_recent-posts

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
These errors were triggered by the plugin
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_db_handler
    • > Notice in wp-content/plugins/wn-flickr-embed/templates/db_handler.php+204
    Undefined variable: return_to
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Notice in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+9
    Undefined index: estoy_virando
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Notice in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+39
    Undefined index: embeds
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Warning in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+40
    end() expects parameter 1 to be array, null given
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Notice in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+182
    Trying to access array offset on value of type null
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Notice in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+102
    Undefined index: create_as_draft
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Notice in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+108
    Undefined index: create_as_a_page
  • 6 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Notice in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+157
    Undefined index: do_not_create_post
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Notice in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+132
    Undefined index: image_width
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Notice in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+73
    Undefined index: input_urls
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Notice in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+77
    Undefined index: post_title
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Notice in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+81
    Undefined index: photo_prefix
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Notice in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+85
    Undefined index: fetch_log
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Notice in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+400
    Undefined index: flickr_api_key
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Notice in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+400
    Undefined index: flickr_api_secret
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Warning in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+132
    Invalid argument supplied for foreach()
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Notice in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+151
    Undefined index: embed_name
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Notice in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php+182
    Undefined index: data

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
Please take a closer look at the following
  • 4× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wn-flickr-embed/templates/db_handler.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wn-flickr-embed/templates/output.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_cache_flush() in wp-content/plugins/wn-flickr-embed/templates/wn_ih_admin.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wn-flickr-embed/templates/main.php:10

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following user-side errors
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_db_handler
    • > Network (severe)
    wp-admin/admin.php?page= - Failed to load resource: the server responded with a status of 403 (Forbidden)
    • > GET request to /wp-admin/admin.php?page=wn_flickr_embed_create_new
    • > Javascript (severe) in unknown
    /wp-admin/admin.php?page=wn_flickr_embed_create_new 348:47 Uncaught TypeError: Cannot read properties of undefined (reading 'license')

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
4 plugin tags: download, images, embed, flicker

wn-flickr-embed/wn-flickr-embed.php 92% from 13 tests

This is the main PHP file of "WN Flickr Image Downloader" version 1.0, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
The following require your attention:
  • Description: Please keep the plugin description shorter than 140 characters (currently 196 characters long)

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected1,362 lines of code in 11 files:
LanguageFilesBlank linesComment linesLines of code
PHP615066783
CSS111514516
SVG20152
JavaScript216111

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity8.00
▷ Minimum class complexity8.00
▷ Maximum class complexity8.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity3.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods14
▷ Static methods00.00%
▷ Public methods14100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants3
▷ Global constants3100.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
No PNG images were found in this plugin