10% wp-flickr-embed

Code Review | Wordpress Flickr Embed

WordPress plugin Wordpress Flickr Embed scored 10% from 54 tests.

About plugin

  • Plugin page: wp-flickr-embed
  • Plugin version: 1.2.3
  • PHP version: 7.4.16
  • WordPress compatibility: 3.4.1-3.9.2
  • WordPress version: 6.3.1
  • First release: Nov 12, 2012
  • Latest release: Aug 28, 2014
  • Number of updates: 25
  • Update frequency: every 26.3 days
  • Top authors: randomaniac (100%)

Code review

54 tests

User reviews

13 reviews

Install metrics

600+ active / 24,588 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
It is recommended to fix the following installer errors
  • The plugin did not install without errors
    • > Deprecated in wp-content/plugins/wp-flickr-embed/wp-flickr-embed.php+34
    Methods with the same name as their class will not be constructors in a future version of PHP; WpFlickrEmbed has a deprecated constructor

Server metrics [RAM: ▼1.84MB] [CPU: ▼54.85ms] Passed 4 tests

Server-side resources used by Wordpress Flickr Embed
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.15 ▼1.325.38 ▼40.76
Dashboard /wp-admin2.17 ▼1.145.41 ▼43.85
Posts /wp-admin/edit.php2.17 ▼1.198.63 ▼41.65
Add New Post /wp-admin/post-new.php2.17 ▼3.726.59 ▼93.12
Media Library /wp-admin/upload.php2.17 ▼1.066.21 ▼35.55
WP Flickr Embed /wp-admin/options-general.php?page=wp-flickr-embed/include/pages/admin.php2.177.25

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 26 new files
Database: no new tables, 7 new options
New WordPress options
can_compress_scripts
db_upgraded
WpFlickrEmbed
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options

Browser metrics Passed 4 tests

This is an overview of browser requirements for Wordpress Flickr Embed
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,829 ▲5814.48 ▼0.272.33 ▲0.0740.72 ▲3.04
Dashboard /wp-admin2,207 ▲195.82 ▲0.8996.18 ▼18.5339.12 ▼9.14
Posts /wp-admin/edit.php2,093 ▲42.00 ▼0.0135.83 ▼3.8833.19 ▼4.04
Add New Post /wp-admin/post-new.php1,516 ▲222.61 ▲5.13582.07 ▼91.0643.26 ▼8.39
Media Library /wp-admin/upload.php1,395 ▲74.18 ▼0.0495.13 ▼18.6442.09 ▼6.68
WP Flickr Embed /wp-admin/options-general.php?page=wp-flickr-embed/include/pages/admin.php1,0544.7549.8540.84

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
It is recommended to fix the following
  • This plugin did not uninstall without warnings or errors
    • > Deprecated in wp-content/plugins/wp-flickr-embed/wp-flickr-embed.php+34
    Methods with the same name as their class will not be constructors in a future version of PHP; WpFlickrEmbed has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_theysaidso_widget
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • WpFlickrEmbed
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
These errors were triggered by the plugin
    • > GET request to /wp-admin/options-general.php?page=wp-flickr-embed/include/pages/admin.php
    • > Deprecated in wp-content/plugins/wp-flickr-embed/wp-flickr-embed.php+34
    Methods with the same name as their class will not be constructors in a future version of PHP; WpFlickrEmbed has a deprecated constructor
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-flickr-embed/include/pages/admin.php
    • > User deprecated in wp-includes/functions.php+5737
    Function has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-flickr-embed/include/pages/admin.php
    • > Notice in wp-content/plugins/wp-flickr-embed/wp-flickr-embed.php+122
    Undefined property: WpFlickrEmbed::$_disabled
    • > GET request to /wp-admin/options-general.php?page=wp-flickr-embed/include/pages/admin.php
    • > Notice in wp-content/plugins/wp-flickr-embed/include/class.admin-page.php+32
    Undefined index: auth_result
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/options-general.php?page=wp-flickr-embed/include/pages/admin.php
    • > Notice in wp-content/plugins/wp-flickr-embed/include/class.admin-page.php+51
    Undefined index: action

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
  • 4× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WpFlickrEmbed_Admin_Page' not found in wp-content/plugins/wp-flickr-embed/include/pages/admin.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_filter() in wp-content/plugins/wp-flickr-embed/wp-flickr-embed-upload-frame.php:6
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/wp-flickr-embed/wp-flickr-embed.php:56
    • > PHP Fatal error
      Uncaught Error: Interface 'WPFlickrEmbed_Constants' not found in wp-content/plugins/wp-flickr-embed/include/class.admin-page.php:7

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
These attributes need to be fixed:
  • Screenshots: Screenshot #1 (The Wordpress Flickr Embed panel that appears on the post insertion screen) image not found
The official readme.txt might help

wp-flickr-embed/wp-flickr-embed.php Passed 13 tests

This is the main PHP file of "Wordpress Flickr Embed" version 1.2.3, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
104 characters long description:
Insert Flickr images into your post using an interactive popup, launched from the visual editor toolbar.

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
Good job! No executable or dangerous file extensions detected1,750 lines of code in 10 files:
LanguageFilesBlank linesComment linesLines of code
PHP6229326935
JavaScript2242202613
CSS2123202

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.25
Average class complexity20.75
▷ Minimum class complexity1.00
▷ Maximum class complexity40.00
Average method complexity2.41
▷ Minimum method complexity1.00
▷ Maximum method complexity10.00
Code structure
Namespaces0
Interfaces1
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods56
▷ Static methods00.00%
▷ Public methods3867.86%
▷ Protected methods00.00%
▷ Private methods1832.14%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants35
▷ Global constants12.86%
▷ Class constants3497.14%
▷ Public constants34100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
12 PNG files occupy 0.12MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/size_square.png0.35KB0.12KB▼ 64.72%
images/size_medium.png0.35KB0.13KB▼ 62.82%
images/alignment_none.png0.31KB0.10KB▼ 66.03%
images/size_large.png0.26KB0.12KB▼ 53.82%
screenshot-1.png117.31KB41.25KB▼ 64.84%