10% os-html5-shortcodes

Code Review | OS HTML5 Shortcodes

WordPress plugin OS HTML5 Shortcodes scored 10% from 53 tests.

About plugin

  • Plugin page: os-html5-shortcodes
  • Plugin version: 1.3
  • PHP version: 7.4.16
  • WordPress compatibility: 4.3-4.7.4
  • WordPress version: 5.8.1
  • First release: Dec 7, 2015
  • Latest release: Apr 24, 2017
  • Number of updates: 9
  • Update frequency: every 56.1 days
  • Top authors: offshorent (100%)

Code review

53 tests

User reviews

1 review

Install metrics

10+ active / 959 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/os-html5-shortcodes/includes/admin/oshtml5-widget.php+91
    Function create_function() is deprecated

Server metrics [RAM: ▼1.81MB] [CPU: ▼334.05ms] Passed 4 tests

A check of server-side resources used by OS HTML5 Shortcodes
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /1.82 ▼0.906.79 ▼14.78
Dashboard /wp-admin1.84 ▼1.216.11 ▼50.39
Posts /wp-admin/edit.php1.84 ▼1.279.07 ▼38.87
Add New Post /wp-admin/post-new.php1.84 ▼3.596.93 ▼1,209.64
Media Library /wp-admin/upload.php1.84 ▼1.176.82 ▼37.29
Add New /wp-admin/post-new.php?post_type=os-html51.847.74
About /wp-admin/edit.php?post_type=os-html5&page=oshtml5-about-developer1.846.10
OS HTML5 /wp-admin/edit.php?post_type=os-html51.846.66

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

How much does this plugin use your filesystem and database?
There were no storage issued detected upon installing this plugin
Filesystem: 17 new files
Database: no new tables, 1 new option
New WordPress options
widget_oshtml5_widget

Browser metrics Passed 4 tests

A check of browser resources used by OS HTML5 Shortcodes
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,719 ▲13715.80 ▲0.359.26 ▼1.4442.24 ▼5.74
Dashboard /wp-admin2,972 ▲1225.90 ▲0.05144.70 ▼5.39104.07 ▲8.30
Posts /wp-admin/edit.php2,748 ▲422.70 ▼0.1267.57 ▲0.8891.44 ▲2.37
Add New Post /wp-admin/post-new.php1,684 ▲2818.30 ▲0.03388.98 ▼32.02108.83 ▼14.91
Media Library /wp-admin/upload.php1,814 ▲425.02 ▼0.01165.44 ▼4.10117.53 ▼3.37
Add New /wp-admin/post-new.php?post_type=os-html52,9439.21228.25138.35
About /wp-admin/edit.php?post_type=os-html5&page=oshtml5-about-developer1,3422.0961.4459.29
OS HTML5 /wp-admin/edit.php?post_type=os-html51,4142.6269.0365.34

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

🔸 Tests weight: 35 | The uninstall procedure must remove all plugin files and extra database tables
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/os-html5-shortcodes/includes/admin/oshtml5-widget.php+91
    Function create_function() is deprecated
  • This plugin does not fully uninstall, leaving 1 option in the database
    • widget_oshtml5_widget

Smoke tests 50% 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
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=os-html5
    • > POST request to /wp-admin/admin-ajax.php
    • > Deprecated in wp-content/plugins/os-html5-shortcodes/includes/admin/oshtml5-widget.php+91
    Function create_function() is deprecated
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=os-html5
    • > POST request to /wp-admin/admin-ajax.php
    • > User deprecated in wp-includes/functions.php+5304
    The called constructor method for WP_Widget in osHtml5Widget is deprecated since version 4.3.0! Use __construct() instead.
    • > GET request to /wp-admin/post-new.php?post_type=os-html5
    • > User notice in wp-includes/functions.php+5663
    wpdb::prepare was called incorrectly. The query argument of wpdb::prepare() must have a placeholder. Please see Debugging in WordPress for more information. (This message was added in version 3.9.0.)
    • > GET request to /wp-admin/post-new.php?post_type=os-html5
    • > User notice in wp-includes/functions.php+5663
    wpdb::prepare was called incorrectly. The query does not contain the correct number of placeholders (0) for the number of arguments passed (1). Please see Debugging in WordPress for more information. (This message was added in version 4.8.3.)
    • > GET request to /wp-admin/post-new.php?post_type=os-html5
    • > Warning in wp-content/plugins/os-html5-shortcodes/includes/admin/oshtml5-editor.php+12
    Use of undefined constant wp_die - assumed 'wp_die' (this will throw an Error in a future version of PHP)

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 7× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Notice
      Undefined variable: post_id in wp-content/plugins/os-html5-shortcodes/includes/admin/meta-boxes/views/oshtml5.shortcode.php on line 2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/os-html5-shortcodes/includes/admin/oshtml5-widget.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/os-html5-shortcodes/includes/admin/oshtml5-tinymce.php:41
    • > PHP Fatal error
      Uncaught Error: Class 'osHTML5TinyMCE' not found in wp-content/plugins/os-html5-shortcodes/includes/admin/oshtml5-editor.php:6
    • > PHP Notice
      Undefined variable: post_id in wp-content/plugins/os-html5-shortcodes/includes/admin/meta-boxes/views/oshtml5.shortcode.php on line 3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function esc_attr() in wp-content/plugins/os-html5-shortcodes/includes/admin/meta-boxes/views/oshtml5.shortcode.php:8
    • > PHP Notice
      Undefined variable: post_id in wp-content/plugins/os-html5-shortcodes/includes/admin/meta-boxes/views/oshtml5.shortcode.php on line 8

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser issues were found

Optimizations

Plugin configuration 97% from 29 tests

readme.txt 94% from 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
These attributes need to be fixed:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (OS HTML5 Shortcodes admin listing), #2 (OS HTML5 Shortcodes widget area)
The official readme.txt is a good inspiration

os-html5-shortcodes/os-html5-shortcodes.php Passed 13 tests

The main file in "OS HTML5 Shortcodes" v. 1.3 serves as a complement to information provided in readme.txt and as the entry point to the plugin
134 characters long description:
Include HTML codes uch as ad codes, javascript, video embedding, etc to your pages, posts or custom post type easily using shortcodes.

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 plugin453 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP8167239450
CSS1003

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.17
Average class complexity4.17
▷ Minimum class complexity1.00
▷ Maximum class complexity9.00
Average method complexity1.50
▷ Minimum method complexity1.00
▷ Maximum method complexity6.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes6
▷ Abstract classes00.00%
▷ Concrete classes6100.00%
▷ Final classes116.67%
Methods38
▷ Static methods37.89%
▷ Public methods3694.74%
▷ Protected methods00.00%
▷ Private methods25.26%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 1 test

Image compression Passed 1 test

All PNG images should be compressed to minimize bandwidth usage for end users
5 PNG files occupy 0.15MB with 0.07MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/category.png0.48KB0.34KB▼ 28.63%
images/social.png1.61KB1.12KB▼ 30.45%
screenshot-1.png54.73KB21.20KB▼ 61.26%
screenshot-2.png44.63KB17.83KB▼ 60.04%
screenshot-3.png48.61KB20.92KB▼ 56.96%