78% flickr-stream

Code Review | Flickr-stream

WordPress plugin Flickr-stream scored78%from 54 tests.

About plugin

  • Plugin page: flickr-stream
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.4.0-4.8
  • WordPress version: 6.3.1
  • First release: Feb 16, 2013
  • Latest release: Jan 12, 2021
  • Number of updates: 27
  • Update frequency: every 106.9 days
  • Top authors: dman25560 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

100+ active /7,325 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.08MB] [CPU: ▼5.12ms] Passed 4 tests

This is a short check of server-side resources used by Flickr-stream
No issues were detected with server-side resource usage
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0741.91 ▼4.93
Dashboard /wp-admin3.38 ▲0.0852.83 ▲2.23
Posts /wp-admin/edit.php3.49 ▲0.1449.48 ▼2.73
Add New Post /wp-admin/post-new.php5.98 ▲0.1089.43 ▼13.18
Media Library /wp-admin/upload.php3.30 ▲0.0838.26 ▲0.37
Setttings /wp-admin/admin.php?page=flickr-stream_settings3.2834.19
Flickr-Stream /wp-admin/admin.php?page=flickr-stream3.5633.56

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 42 new files
Database: no new tables, 8 new options
New WordPress options
widget_flickrstream_widget
theysaidso_admin_options
widget_theysaidso_widget
widget_recent-posts
widget_recent-comments
can_compress_scripts
flickrstream_main_opts
db_upgraded

Browser metrics Passed 4 tests

A check of browser resources used by Flickr-stream
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,940 ▲17913.46 ▼0.8912.81 ▲10.9843.67 ▼5.39
Dashboard /wp-admin2,213 ▲425.58 ▼0.0989.61 ▼10.6976.97 ▲33.51
Posts /wp-admin/edit.php2,133 ▲332.04 ▲0.0337.14 ▲0.5135.41 ▲2.01
Add New Post /wp-admin/post-new.php1,555 ▲2923.50 ▲0.62679.04 ▲7.3862.53 ▲1.26
Media Library /wp-admin/upload.php1,427 ▲274.15 ▼0.0298.16 ▼15.1070.45 ▲18.88
Setttings /wp-admin/admin.php?page=flickr-stream_settings8772.1923.6827.87
Flickr-Stream /wp-admin/admin.php?page=flickr-stream9712.0125.8932.19

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 6 options in the database
    • db_upgraded
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
The smoke test was a success, however most plugin functionality was not tested

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
  • 1× PHP files output text when accessed directly:
    • > /wp-content/plugins/flickr-stream/inc/forms/editShortcode.inc.php
  • 6× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/flickr-stream/photos_widget.php:10
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/flickr-stream/class/fsShortcodeListTable.class.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/flickr-stream/flickrstream.php:42
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/flickr-stream/inc/forms/createShortcode.inc.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_option() in wp-content/plugins/flickr-stream/inc/forms/generalOptions.inc.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_dir_path() in wp-content/plugins/flickr-stream/class/fsShortcodeListTable.class.php:3

User-side errors Passed 1 test

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

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
3 plugin tags: flickr, photos, gallery

flickr-stream/flickrstream.php 85% from 13 tests

The entry point to "Flickr-stream" version 1.3 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 152 characters long)
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("flickr-stream.php" instead of "flickrstream.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
Good job! No executable or dangerous file extensions detected3,244 lines of code in 29 files:
LanguageFilesBlank linesComment linesLines of code
PHP157546741,930
CSS510321489
PO File2186199414
JavaScript74528411

PHP code Passed 2 tests

An overview of cyclomatic complexity and code structure
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity29.67
▷ Minimum class complexity2.00
▷ Maximum class complexity125.00
Average method complexity3.77
▷ Minimum method complexity1.00
▷ Maximum method complexity33.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes9
▷ Abstract classes00.00%
▷ Concrete classes9100.00%
▷ Final classes00.00%
Methods93
▷ Static methods22.15%
▷ Public methods6266.67%
▷ Protected methods2122.58%
▷ Private methods1010.75%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
7 PNG files occupy 0.91MB with 0.49MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
photoswipe/images/icons.png5.84KB3.80KB▼ 35.05%
screenshot-3.png41.77KB16.32KB▼ 60.92%
css/flickrstream_icon.png4.25KB1.64KB▼ 61.51%
screenshot-1.png825.26KB231.81KB▼ 71.91%
photoswipe/images/icons@2x.png9.19KB5.50KB▼ 40.21%