84% image-shortcake

Code Review | Image Shortcake

WordPress plugin Image Shortcake scored84%from 54 tests.

About plugin

  • Plugin page: image-shortcake
  • Plugin version: 0.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-4.3
  • WordPress version: 6.3.1
  • First release: May 20, 2015
  • Latest release: Aug 27, 2015
  • Number of updates: 4
  • Update frequency: every 25.3 days
  • Top authors: danielbachhuber (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /2,366 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.12MB] [CPU: ▼17.40ms] Passed 4 tests

Server-side resources used by Image Shortcake
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.53 ▲0.0637.79 ▲0.18
Dashboard /wp-admin3.26 ▼0.0933.24 ▼26.00
Posts /wp-admin/edit.php3.32 ▼0.0337.27 ▼12.36
Add New Post /wp-admin/post-new.php5.50 ▼0.3978.69 ▼27.83
Media Library /wp-admin/upload.php3.26 ▲0.0333.14 ▼3.40

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

How much does this plugin use your filesystem and database?
This plugin was installed successfully
Filesystem: 12 new files
Database: no new tables, 6 new options
New WordPress options
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for Image Shortcake
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,804 ▲5813.68 ▼0.691.60 ▲0.0236.37 ▼5.76
Dashboard /wp-admin2,210 ▲184.84 ▼1.07112.52 ▲5.6039.15 ▼5.12
Posts /wp-admin/edit.php2,092 ▲32.01 ▲0.0240.73 ▼0.8635.23 ▼0.47
Add New Post /wp-admin/post-new.php1,523 ▲423.28 ▼0.06654.64 ▲1.6650.68 ▼12.17
Media Library /wp-admin/upload.php1,395 ▲44.27 ▲0.04108.43 ▲8.1448.03 ▲3.32

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_recent-comments
    • can_compress_scripts
    • db_upgraded
    • widget_theysaidso_widget

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking for server-side errors
Good news, no errors were detected

SRP 50% 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
Please fix the following items
  • 2× PHP files trigger server-side errors or warnings when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_CLI_Command' not found in wp-content/plugins/image-shortcake/inc/class-wp-cli-img-shortcode-command.php:7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/image-shortcake/image-shortcake.php:114

User-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file uses markdown syntax to describe your plugin to the world
Attributes that require attention:
  • Screenshots: These screenshots do not have images: #1 (This is the shortcode UI form as accessed from **Insert Media > Insert Post Element**. (Note that you can also insert images as usual, by inserting them in the Media Library - they will be transparently converted into shortcodes behind the scenes for you.)), #2 (Once inserted into a post, the image preview renders in the editor just as it normally would. The Shortcake plugin's edit/delete buttons are available to modify the shortcode through the provided UI.)
The official readme.txt might help

image-shortcake/image-shortcake.php Passed 13 tests

Analyzing the main PHP file in "Image Shortcake" version 0.1.0
94 characters long description:
Provides a shortcode for image elements. Use with the Shortcake plugin for a preview of images

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short check of programming languages and file extensions; no executable files are allowed
Success! There were no dangerous files found in this plugin592 lines of code in 8 files:
LanguageFilesBlank linesComment linesLines of code
PHP4165208443
Markdown138077
JavaScript2183355
JSON10017

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.39
Average class complexity14.50
▷ Minimum class complexity6.00
▷ Maximum class complexity30.00
Average method complexity3.35
▷ Minimum method complexity1.00
▷ Maximum method complexity12.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes00.00%
Methods23
▷ Static methods1669.57%
▷ Public methods1565.22%
▷ Protected methods00.00%
▷ Private methods834.78%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
2 PNG files occupy 0.21MB with 0.13MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
screenshot-2.png133.09KB51.88KB▼ 61.02%
screenshot-1.png83.47KB31.95KB▼ 61.72%