79% wp-media-stories

Code Review | WP Media Stories

WordPress plugin WP Media Stories scored79%from 54 tests.

About plugin

  • Plugin page: wp-media-stories
  • Plugin version: 0.1.1
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.1-5.9.2
  • WordPress version: 6.3.1
  • First release: Nov 27, 2018
  • Latest release: Mar 16, 2022
  • Number of updates: 8
  • Update frequency: every 150.9 days
  • Top authors: suiteplugins (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,259 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed successfully, without throwing any errors or notices

Server metrics [RAM: ▲0.06MB] [CPU: ▼2.31ms] Passed 4 tests

This is a short check of server-side resources used by WP Media Stories
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.54 ▲0.0734.69 ▼6.88
Dashboard /wp-admin3.36 ▲0.0644.20 ▼2.37
Posts /wp-admin/edit.php3.41 ▲0.0647.53 ▲2.36
Add New Post /wp-admin/post-new.php5.95 ▲0.0695.96 ▼0.22
Media Library /wp-admin/upload.php3.28 ▲0.0632.59 ▲0.24
All Galleries /wp-admin/edit.php?post_type=media_story3.3334.80
Category /wp-admin/edit-tags.php?taxonomy=media_story_category&post_type=media_story3.2832.90
Tags /wp-admin/edit-tags.php?taxonomy=media_story_tag&post_type=media_story3.2836.27
Add New /wp-admin/post-new.php?post_type=media_story3.4249.48

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 29 new files
Database: no new tables, 6 new options
New WordPress options
can_compress_scripts
widget_recent-posts
widget_recent-comments
theysaidso_admin_options
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

Checking browser requirements for WP Media Stories
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,953 ▲18214.61 ▲0.6310.64 ▲8.6436.28 ▼4.72
Dashboard /wp-admin2,244 ▲565.85 ▼0.0597.42 ▼3.9340.18 ▼4.66
Posts /wp-admin/edit.php2,124 ▲322.00 ▲0.0140.02 ▼1.0536.08 ▼2.56
Add New Post /wp-admin/post-new.php1,562 ▲4323.26 ▲0.05587.93 ▼103.9054.83 ▼13.55
Media Library /wp-admin/upload.php1,423 ▲414.25 ▲0.0798.17 ▼1.0543.94 ▼0.25
All Galleries /wp-admin/edit.php?post_type=media_story1,1102.0031.0228.11
Category /wp-admin/edit-tags.php?taxonomy=media_story_category&post_type=media_story1,3002.1328.6527.30
Tags /wp-admin/edit-tags.php?taxonomy=media_story_tag&post_type=media_story1,2662.1326.6626.57
Add New /wp-admin/post-new.php?post_type=media_story2,0085.81101.5435.29

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
You still need to fix the following
  • This plugin did not uninstall successfully, leaving 6 options in the database
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • 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
Even though no errors were found, this is by no means an exhaustive test

SRP 0% from 2 tests

🔹 Tests weight: 20 | It is important to ensure that your PHP files perform no action when accessed directly, respecting the single-responsibility principle
Almost there! Just fix the following items
  • 3× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/wp-media-stories/admin/templates/metabox-shortcode.php
    • > /wp-content/plugins/wp-media-stories/admin/templates/settings.php
    • > /wp-content/plugins/wp-media-stories/templates/content-gallery-item.php
  • 9× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_url() in wp-content/plugins/wp-media-stories/templates/inline-gallery.php:3
    • > PHP Notice
      Undefined variable: post in wp-content/plugins/wp-media-stories/admin/templates/metabox-shortcode.php on line 1
    • > PHP Notice
      Undefined variable: show_image in wp-content/plugins/wp-media-stories/templates/content-gallery-item.php on line 2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/wp-media-stories/includes/editors/gutenberg.php:13
    • > PHP Notice
      Trying to get property 'ID' of non-object in wp-content/plugins/wp-media-stories/admin/templates/metabox-shortcode.php on line 1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/wp-media-stories/admin/templates/metabox-settings.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function trailingslashit() in wp-content/plugins/wp-media-stories/wp-media-stories.php:378
    • > PHP Notice
      Undefined variable: show_title in wp-content/plugins/wp-media-stories/templates/content-gallery-item.php on line 7
    • > PHP Fatal error
      Uncaught Error: Call to undefined function wp_nonce_field() in wp-content/plugins/wp-media-stories/admin/templates/metabox.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Everything seems fine, but this is not an exhaustive test

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
5 plugin tags: wp media stories, gallery, wordpress gallery plugin, image gallery, wordpress gallery

wp-media-stories/wp-media-stories.php Passed 13 tests

The main PHP file in "WP Media Stories" ver. 0.1.1 adds more information about the plugin and also serves as the entry point for this plugin
30 characters long description:
WordPress Media Gallery plugin

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
Success! There were no dangerous files found in this plugin9,239 lines of code in 20 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript42,0676437,395
PHP132495091,150
CSS312965694

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
This plugin has no cyclomatic complexity issues
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity26.80
▷ Minimum class complexity2.00
▷ Maximum class complexity58.00
Average method complexity3.69
▷ Minimum method complexity1.00
▷ Maximum method complexity51.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes5
▷ Abstract classes00.00%
▷ Concrete classes5100.00%
▷ Final classes120.00%
Methods48
▷ Static methods510.42%
▷ Public methods4797.92%
▷ Protected methods12.08%
▷ Private methods00.00%
Functions12
▷ Named functions12100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants00.00%
▷ Class constants1100.00%
▷ Public constants1100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/assets/images/loading_background.png0.16KB0.15KB▼ 6.02%
admin/assets/images/tinymce_button.png0.76KB0.85KB0.00%
assets/images/close.png1.01KB0.19KB▼ 80.89%
assets/images/arrows.png1.69KB0.75KB▼ 55.97%