10% responsive-flickr-gallery

Code Review | Responsive Flickr Gallery

WordPress plugin Responsive Flickr Gallery scored10%from 54 tests.

About plugin

  • Plugin page: responsive-flickr...
  • Plugin version: 1.3.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.7.0-4.2.2
  • WordPress version: 6.3.1
  • First release: Nov 27, 2013
  • Latest release: Jun 1, 2015
  • Number of updates: 33
  • Update frequency: every 16.8 days
  • Top authors: larsschenk (100%)

Code review

54 tests

User reviews

7 reviews

Install metrics

200+ active /17,334 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
You still need to fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/responsive-flickr-gallery/afgFlickr/afgFlickr.php+22
    Methods with the same name as their class will not be constructors in a future version of PHP; afgFlickr has a deprecated constructor

Server metrics [RAM: ▼1.13MB] [CPU: ▼47.54ms] Passed 4 tests

A check of server-side resources used by Responsive Flickr Gallery
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /2.86 ▼0.617.89 ▼36.28
Dashboard /wp-admin2.88 ▼0.4313.56 ▼33.82
Posts /wp-admin/edit.php2.88 ▼0.488.12 ▼37.38
Add New Post /wp-admin/post-new.php2.88 ▼3.019.64 ▼82.66
Media Library /wp-admin/upload.php2.88 ▼0.358.05 ▼24.94
Add Gallery /wp-admin/admin.php?page=rfg_add_gallery_page2.887.83
Default Settings /wp-admin/admin.php?page=rfg_plugin_page2.888.36
Edit Galleries /wp-admin/admin.php?page=rfg_edit_galleries_page2.887.80
Saved Galleries /wp-admin/admin.php?page=rfg_view_edit_galleries_page2.889.07

Server storage [IO: ▲0.29MB] [DB: ▲0.07MB] Passed 3 tests

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 39 new files
Database: no new tables, 15 new options
New WordPress options
rfg_sort_order
rfg_descr
widget_recent-comments
db_upgraded
rfg_custom_css
widget_recent-posts
widget_theysaidso_widget
theysaidso_admin_options
rfg_credit_note
rfg_pagination
...

Browser metrics Passed 4 tests

Responsive Flickr Gallery: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,956 ▲21013.61 ▼0.698.38 ▲6.2043.90 ▲0.35
Dashboard /wp-admin2,232 ▲474.91 ▼0.91112.78 ▼7.0583.68 ▲31.50
Posts /wp-admin/edit.php2,127 ▲352.18 ▲0.1639.83 ▲1.5633.06 ▲0.78
Add New Post /wp-admin/post-new.php1,553 ▲1222.21 ▼1.02794.09 ▲193.7954.81 ▲0.88
Media Library /wp-admin/upload.php1,426 ▲354.27 ▲0.01102.92 ▲1.9077.70 ▲34.92
Add Gallery /wp-admin/admin.php?page=rfg_add_gallery_page1,5491.8527.6049.20
Default Settings /wp-admin/admin.php?page=rfg_plugin_page1,5981.8625.5139.25
Edit Galleries /wp-admin/admin.php?page=rfg_edit_galleries_page1,5461.8527.5235.30
Saved Galleries /wp-admin/admin.php?page=rfg_view_edit_galleries_page9101.8426.6232.00

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
It is recommended to fix the following
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/responsive-flickr-gallery/afgFlickr/afgFlickr.php+22
    Methods with the same name as their class will not be constructors in a future version of PHP; afgFlickr has a deprecated constructor
  • Zombie WordPress options were found after uninstall: 15 options
    • rfg_version
    • rfg_custom_css
    • widget_recent-posts
    • can_compress_scripts
    • widget_recent-comments
    • rfg_slideshow_option
    • db_upgraded
    • widget_theysaidso_widget
    • rfg_pagination
    • rfg_galleries
    • ...

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Please fix the following server-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rfg_view_edit_galleries_page
    • > Deprecated in wp-content/plugins/responsive-flickr-gallery/afgFlickr/afgFlickr.php+22
    Methods with the same name as their class will not be constructors in a future version of PHP; afgFlickr has a deprecated constructor
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rfg_view_edit_galleries_page
    • > Deprecated in wp-content/plugins/responsive-flickr-gallery/afgFlickr/afgFlickr.php+1691
    Methods with the same name as their class will not be constructors in a future version of PHP; afgFlickr_pager has a deprecated constructor
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rfg_plugin_page
    • > Notice in wp-content/plugins/responsive-flickr-gallery/index.php+62
    Undefined index: slideshow_option
  • 10 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rfg_edit_galleries_page
    • > Notice in wp-content/plugins/responsive-flickr-gallery/rfg_libs.php+374
    Undefined offset: 0

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle applies for WordPress plugins as well - please make sure your PHP files perform no actions when accessed directly
The following issues need your attention
  • 6× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/responsive-flickr-gallery/rfg_libs.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/responsive-flickr-gallery/rfg_libs.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/responsive-flickr-gallery/rfg_libs.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/responsive-flickr-gallery/rfg_libs.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/responsive-flickr-gallery/rfg_libs.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/responsive-flickr-gallery/rfg_libs.php:18

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rfg_view_edit_galleries_page
    • > Javascript (severe) in unknown
    /wp-content/plugins/responsive-flickr-gallery/colorbox/jquery.colorbox-min.js?ver=6.3.1 3:2656 Uncaught TypeError: Cannot read properties of undefined (reading 'msie')
    • > GET request to /wp-admin/admin.php?page=rfg_add_gallery_page
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of null (reading 'value')" "TypeError: Cannot read properties of null (reading 'value')\n at loadGallerySettings (/wp-content/plugins/responsive-flickr-gallery/js/rfg_edit_galleries.js?ver=6.3.1:158:41)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/responsive-flickr-gallery/js/rfg_edit_galleries.js?ver=6.3.1:4:5)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rfg_view_edit_galleries_page
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).afgcolorbox is not a function" "TypeError: jQuery(...).afgcolorbox is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/responsive-flickr-gallery/colorbox/mycolorbox.js?ver=6.3.1:3:30)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=rfg_add_gallery_page
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of null (reading 'value')
  • 4 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=rfg_view_edit_galleries_page
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).afgcolorbox is not a function
    • > GET request to /wp-admin/admin.php?page=rfg_edit_galleries_page
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: Cannot read properties of undefined (reading 'photo_source')" "TypeError: Cannot read properties of undefined (reading 'photo_source')\n at loadGallerySettings (/wp-content/plugins/responsive-flickr-gallery/js/rfg_edit_galleries.js?ver=6.3.1:161:43)\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/responsive-flickr-gallery/js/rfg_edit_galleries.js?ver=6.3.1:4:5)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/admin.php?page=rfg_edit_galleries_page
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: Cannot read properties of undefined (reading 'photo_source')

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 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
6 plugin tags: gallery, laterpay, flickr, cdn, responsive...

responsive-flickr-gallery/index.php 85% from 13 tests

The principal PHP file in "Responsive Flickr Gallery" v. 1.3.1 is loaded by WordPress automatically on each request
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 238 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("responsive-flickr-gallery.php" instead of "index.php")

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 detected3,499 lines of code in 15 files:
LanguageFilesBlank linesComment linesLines of code
PHP74634292,984
JavaScript5165265
CSS21928174
Markdown133076

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Although this was not an exhaustive test, there were no cyclomatic complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity99.50
▷ Minimum class complexity13.00
▷ Maximum class complexity186.00
Average method complexity1.98
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods201
▷ Static methods00.00%
▷ Public methods201100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions46
▷ Named functions46100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
17 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
colorbox/images/ie6/borderTopLeft.png0.21KB0.20KB▼ 4.63%
colorbox/images/ie6/borderBottomCenter.png0.11KB0.10KB▼ 8.11%
colorbox/images/controls.png2.83KB1.28KB▼ 54.82%
colorbox/images/border.png0.11KB0.10KB▼ 7.14%
images/logo_big.png7.25KB2.37KB▼ 67.32%