10% flickr-viewer

Code Review | Flickr Viewer

WordPress plugin Flickr Viewer scored10%from 54 tests.

About plugin

  • Plugin page: flickr-viewer
  • Plugin version: 1.1.8
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0.1-5.6
  • WordPress version: 6.3.1
  • First release: Nov 9, 2012
  • Latest release: Jan 31, 2021
  • Number of updates: 59
  • Update frequency: every 51.0 days
  • Top authors: nakunakifi (100%)

Code review

54 tests

User reviews

3 reviews

Install metrics

100+ active /8,211 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
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/flickr-viewer/includes/api-libs/phpFlickr/phpFlickr.php+25
    Methods with the same name as their class will not be constructors in a future version of PHP; phpFlickr has a deprecated constructor

Server metrics [RAM: ▼1.56MB] [CPU: ▼55.85ms] Passed 4 tests

Server-side resources used by Flickr Viewer
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.44 ▼1.035.85 ▼35.74
Dashboard /wp-admin2.46 ▼0.897.22 ▼53.05
Posts /wp-admin/edit.php2.46 ▼0.908.36 ▼39.10
Add New Post /wp-admin/post-new.php2.46 ▼3.439.42 ▼95.51
Media Library /wp-admin/upload.php2.46 ▼0.777.63 ▼29.53
Shortcodes /wp-admin/admin.php?page=cws_sc2.466.55
Settings /wp-admin/admin.php?page=cws_fgp2.468.59
Getting Started /wp-admin/admin.php?page=cws_gs2.468.34

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 157 new files
Database: no new tables, 9 new options
New WordPress options
widget_theysaidso_widget
db_upgraded
widget_displayalbums
widget_recent-comments
theysaidso_admin_options
cws_fgp_options
cws_fgp_installed
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

An overview of browser requirements for Flickr Viewer
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,955 ▲20913.59 ▼0.788.57 ▲6.9037.73 ▼7.17
Dashboard /wp-admin2,244 ▲534.87 ▼1.01107.66 ▲7.7741.57 ▼2.08
Posts /wp-admin/edit.php2,127 ▲412.06 ▲0.0740.70 ▲3.9936.05 ▲3.22
Add New Post /wp-admin/post-new.php1,542 ▲1422.06 ▲3.85614.36 ▲20.0543.08 ▼9.15
Media Library /wp-admin/upload.php1,423 ▲354.21 ▼0.0297.78 ▲1.8042.04 ▼2.28
Shortcodes /wp-admin/admin.php?page=cws_sc8512.0223.9536.48
Settings /wp-admin/admin.php?page=cws_fgp1,0232.0224.4133.99
Getting Started /wp-admin/admin.php?page=cws_gs8522.1725.6930.06

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
It is recommended to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/flickr-viewer/includes/api-libs/phpFlickr/phpFlickr.php+25
    Methods with the same name as their class will not be constructors in a future version of PHP; phpFlickr has a deprecated constructor
  • The uninstall procedure has failed, leaving 7 options in the database
    • widget_displayalbums
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These errors were triggered by the plugin
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cws_gs
    • > Deprecated in wp-content/plugins/flickr-viewer/includes/api-libs/phpFlickr/phpFlickr.php+25
    Methods with the same name as their class will not be constructors in a future version of PHP; phpFlickr has a deprecated constructor
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cws_gs
    • > Deprecated in wp-content/plugins/flickr-viewer/includes/api-libs/tbPhpFlickr/CacheManager.php+8
    Methods with the same name as their class will not be constructors in a future version of PHP; CacheManager has a deprecated constructor
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cws_gs
    • > Deprecated in wp-content/plugins/flickr-viewer/widgets/widget-display-albums.php+27
    Methods with the same name as their class will not be constructors in a future version of PHP; Widget_DisplayAlbums has a deprecated constructor
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cws_gs
    • > Deprecated in wp-content/plugins/flickr-viewer/widgets/widget-init.php+27
    Function create_function() is deprecated
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cws_gs
    • > User deprecated in wp-includes/functions.php+5463
    Function screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cws_gs
    • > User deprecated in wp-includes/functions.php+5463
    Function get_screen_icon is deprecated since version 3.8.0 with no alternative available.
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=cws_gs
    • > Notice in wp-content/plugins/flickr-viewer/admin/class-cws-flickr-gallery-pro-admin.php+255
    Trying to access array offset on value of type bool

SRP 0% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
Almost there! Just fix the following items
  • 2× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/flickr-viewer/admin/partials/cws-flickr-gallery-pro-admin-display.php
    • > /wp-content/plugins/flickr-viewer/public/partials/cws-flickr-gallery-pro-public-display.php
  • 78× GET requests to PHP files have triggered server-side errors or warnings (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Interface 'TimestampService' not found in wp-content/plugins/flickr-viewer/includes/api-libs/tbPhpFlickr/org/scribe/services/TimestampServiceImpl.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'DefaultApi10a' not found in wp-content/plugins/flickr-viewer/includes/api-libs/tbPhpFlickr/org/scribe/builder/api/FlickrApi.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_query_var() in wp-content/plugins/flickr-viewer/shortcodes/partials/results_expander.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_query_var() in wp-content/plugins/flickr-viewer/shortcodes/partials/results_list.php:5
    • > PHP Notice
      Undefined variable: thumb_size in wp-content/plugins/flickr-viewer/shortcodes/partials/grid.php on line 17
    • > PHP Fatal error
      Uncaught Error: Interface 'HttpURLConnection' not found in wp-content/plugins/flickr-viewer/includes/api-libs/tbPhpFlickr/org/scribe/model/HttpURLConnectionCurl.php:32
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_enqueue_script() in wp-content/plugins/flickr-viewer/shortcodes/partials/results_grid.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'DefaultApi10a' not found in wp-content/plugins/flickr-viewer/includes/api-libs/tbPhpFlickr/org/scribe/builder/api/YahooApi.php:29
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/flickr-viewer/shortcodes/shortcode-init.php:33
    • > PHP Fatal error
      Uncaught Error: Class 'DefaultApi10a' not found in wp-content/plugins/flickr-viewer/includes/api-libs/tbPhpFlickr/org/scribe/builder/api/PlurkApi.php:29

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
No browser errors were detected

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
9 plugin tags: flickr, album, image, flickr favourites, photos...

flickr-viewer/cws_flickr_gallery_pro.php 85% from 13 tests

"Flickr Viewer" version 1.1.8's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
The following require your attention:
  • Text Domain: The text domain should only use lowercase characters and dashes
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("flickr-viewer.php" instead of "cws_flickr_gallery_pro.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Good job! No executable or dangerous file extensions detected7,883 lines of code in 134 files:
LanguageFilesBlank linesComment linesLines of code
PHP1091,9984,4226,000
JavaScript142212661,002
CSS914992852
Markdown17016
SVG11013

PHP code Passed 2 tests

Analyzing cyclomatic complexity and code structure
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.26
Average class complexity6.26
▷ Minimum class complexity1.00
▷ Maximum class complexity112.00
Average method complexity1.85
▷ Minimum method complexity1.00
▷ Maximum method complexity21.00
Code structure
Namespaces0
Interfaces10
Traits0
Classes75
▷ Abstract classes22.67%
▷ Concrete classes7397.33%
▷ Final classes11.37%
Methods555
▷ Static methods193.42%
▷ Public methods52895.14%
▷ Protected methods00.00%
▷ Private methods274.86%
Functions16
▷ Named functions16100.00%
▷ Anonymous functions00.00%
Constants110
▷ Global constants10.91%
▷ Class constants10999.09%
▷ Public constants109100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
7 PNG files occupy 0.15MB with 0.02MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/icon-256x256.png21.73KB20.98KB▼ 3.45%
public/css/lightbox/images/next.png1.32KB1.58KB0.00%
public/css/lightbox/images/close.png0.27KB0.29KB0.00%
public/css/lightbox/images/prev.png1.33KB1.59KB0.00%
assets/screenshot-3.png92.25KB23.25KB▼ 74.79%