94% image-viewer-made-easy

Code Review | Image Viewer Made Easy

WordPress plugin Image Viewer Made Easy scored 94% from 54 tests.

About plugin

  • Plugin page: image-viewer-made...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3.1-4.4
  • WordPress version: 5.8.1
  • First release: Dec 29, 2015
  • Latest release: Dec 28, 2015
  • Number of updates: 2
  • Update frequency: every 0.5 days
  • Top authors: nimeshrmr (100%)

Code review

54 tests

User reviews

1 review

Install metrics

90+ active / 2,970 total downloads

Benchmarks

Plugin footprint Passed 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Install script ran successfully

Server metrics [RAM: ▲0.11MB] [CPU: ▼149.73ms] Passed 4 tests

Analyzing server-side resources used by Image Viewer Made Easy
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /2.93 ▲0.2152.60 ▲28.21
Dashboard /wp-admin3.15 ▲0.1057.34 ▲10.42
Posts /wp-admin/edit.php3.26 ▲0.1652.99 ▲2.51
Add New Post /wp-admin/post-new.php5.52 ▲0.0898.73 ▼605.84
Media Library /wp-admin/upload.php3.10 ▲0.0937.00 ▼6.02
Image Viewers /wp-admin/edit.php?post_type=wivme_image_viewer3.1443.04
Add New /wp-admin/post-new.php?post_type=wivme_image_viewer3.2254.77
Getting Started /wp-admin/edit.php?post_type=wivme_image_viewer&page=wivme-help3.1034.63

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

A short overview of filesystem and database impact
The plugin installed successfully
Filesystem: 23 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Image Viewer Made Easy
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,828 ▲23216.59 ▲0.7015.42 ▲5.9749.93 ▼7.58
Dashboard /wp-admin3,003 ▲725.92 ▼0.15153.84 ▼46.89126.39 ▼0.67
Posts /wp-admin/edit.php2,792 ▲532.73 ▲0.0581.82 ▲2.9597.84 ▲2.54
Add New Post /wp-admin/post-new.php1,708 ▲12718.49 ▲0.39408.29 ▼18.36119.10 ▼4.14
Media Library /wp-admin/upload.php1,857 ▲505.06 ▲0.05169.73 ▼11.61122.25 ▼6.89
Image Viewers /wp-admin/edit.php?post_type=wivme_image_viewer1,4682.6884.9882.18
Add New /wp-admin/post-new.php?post_type=wivme_image_viewer2,7814.61123.06124.07
Getting Started /wp-admin/edit.php?post_type=wivme_image_viewer&page=wivme-help1,1892.3565.04124.29

Uninstaller [IO: ▲0.00MB] [DB: ▲0.00MB] Passed 4 tests

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
The plugin uninstalled completely, with no zombie files or tables

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Everything seems fine, however this is by no means an exhaustive test

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
Please take a closer look at the following
  • 9× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/image-viewer-made-easy/templates/manage-viewer-images.php on line 3
    • > PHP Notice
      Undefined variable: plugins in wp-content/plugins/image-viewer-made-easy/templates/plugins-feed.php on line 5
    • > PHP Warning
      Invalid argument supplied for foreach() in wp-content/plugins/image-viewer-made-easy/templates/plugins-feed.php on line 5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function __() in wp-content/plugins/image-viewer-made-easy/templates/plugin-help.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/image-viewer-made-easy/templates/manage-viewer-settings.php:5
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/image-viewer-made-easy/functions.php:13
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/image-viewer-made-easy/templates/plugins-feed.php on line 3
    • > PHP Warning
      extract() expects parameter 1 to be array, null given in wp-content/plugins/image-viewer-made-easy/templates/manage-viewer-settings.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_post_meta() in wp-content/plugins/image-viewer-made-easy/templates/manage-viewer-images.php:6

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 Passed 29 tests

readme.txt Passed 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
8 plugin tags: images, zooming, gallery slider, image gallery, transition...

image-viewer-made-easy/image-viewer-made-easy.php Passed 13 tests

The main file in "Image Viewer Made Easy" v. 1.0 serves as a complement to information provided in readme.txt and as the entry point to the plugin
111 characters long description:
Create aweosome Image Viewer for WordPress with image sliding, gallery, zooimng, rotating and sclaing features.

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is a short overview of programming languages used in this plugin, detecting executable files
Good job! No executable or dangerous file extensions detected2,906 lines of code in 17 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript43781641,390
PHP820049607
CSS412621495
Markdown13260414

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.28
Average class complexity17.67
▷ Minimum class complexity8.00
▷ Maximum class complexity35.00
Average method complexity3.38
▷ Minimum method complexity1.00
▷ Maximum method complexity15.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes3
▷ Abstract classes00.00%
▷ Concrete classes3100.00%
▷ Final classes00.00%
Methods21
▷ Static methods14.76%
▷ Public methods1990.48%
▷ Protected methods00.00%
▷ Private methods29.52%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
2 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/viewer-edit.png0.70KB0.52KB▼ 25.00%
images/viewer-delete.png0.29KB0.20KB▼ 29.59%