78% gltf-media-type

Code Review | GLTF Media Type

WordPress plugin GLTF Media Type scored78%from 54 tests.

About plugin

  • Plugin page: gltf-media-type
  • Plugin version: 1.4
  • PHP version: 7.4.16
  • WordPress compatibility: 4.7-4.7
  • WordPress version: 6.3.1
  • First release: Dec 27, 2016
  • Latest release: Mar 11, 2017
  • Number of updates: 21
  • Update frequency: every 3.7 days
  • Top authors: goldsounds (100%)

Code review

54 tests

User reviews

1 review

Install metrics

50+ active /2,210 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 gracefully, with no errors

Server metrics [RAM: ▲0.12MB] [CPU: ▼3.24ms] Passed 4 tests

Analyzing server-side resources used by GLTF Media Type
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.58 ▲0.1138.35 ▲1.31
Dashboard /wp-admin3.41 ▲0.1143.09 ▼5.75
Posts /wp-admin/edit.php3.53 ▲0.1746.14 ▼0.50
Add New Post /wp-admin/post-new.php6.07 ▲0.1891.08 ▼6.81
Media Library /wp-admin/upload.php3.33 ▲0.1035.65 ▲0.09
Add New /wp-admin/post-new.php?post_type=gltf_scene6.0677.29
Scenes /wp-admin/edit.php?post_type=gltf_scene3.3834.51

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

A short overview of filesystem and database impact
No storage issues were detected
Filesystem: 82 new files
Database: no new tables, 6 new options
New WordPress options
theysaidso_admin_options
widget_theysaidso_widget
db_upgraded
widget_recent-comments
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

A check of browser resources used by GLTF Media Type
This plugin renders optimally with no browser resource issues detected
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,825 ▲6414.69 ▲0.081.86 ▲0.3338.04 ▼3.22
Dashboard /wp-admin2,229 ▲485.56 ▼0.1284.94 ▼19.7137.62 ▼5.48
Posts /wp-admin/edit.php2,131 ▲311.94 ▼0.0439.31 ▲3.9034.15 ▼1.13
Add New Post /wp-admin/post-new.php1,553 ▲2522.84 ▼0.25676.03 ▲16.8864.07 ▲4.52
Media Library /wp-admin/upload.php1,431 ▲344.19 ▲0.0693.03 ▼13.9146.19 ▼0.45
Add New /wp-admin/post-new.php?post_type=gltf_scene6,23723.19894.5031.41
Scenes /wp-admin/edit.php?post_type=gltf_scene1,1041.9733.0227.62

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
These items require your attention
  • This plugin does not fully uninstall, leaving 6 options in the database
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_recent-posts
    • widget_theysaidso_widget

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Good news, no errors were detected

SRP 0% 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
Almost there! Just fix the following items
  • 6× PHP files perform the action of outputting non-empty strings when accessed directly:
    • > /wp-content/plugins/gltf-media-type/trunk/public/templates/single-gltf_scene-notheme.php
    • > /wp-content/plugins/gltf-media-type/public/templates/single-gltf_scene-notheme.php
    • > /wp-content/plugins/gltf-media-type/public/partials/gltf-public-display.php
    • > /wp-content/plugins/gltf-media-type/trunk/admin/partials/gltf-admin-display.php
    • > /wp-content/plugins/gltf-media-type/trunk/public/partials/gltf-public-display.php
    • > /wp-content/plugins/gltf-media-type/admin/partials/gltf-admin-display.php
  • 2× GET requests to PHP files have triggered server-side errors or warnings:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/gltf-media-type/trunk/public/templates/single-gltf_scene.php:33
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/gltf-media-type/public/templates/single-gltf_scene.php:33

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
Attributes that need to be fixed:
  • Plugin Name: Please specify the plugin name on the first line ( === gltf-media-type === )
The official readme.txt might help

gltf-media-type/gltf.php 85% from 13 tests

The primary PHP file in "GLTF Media Type" version 1.4 is used by WordPress to initiate all plugin functionality
You should first fix the following items:
  • Main file name: Name the main plugin file the same as the plugin slug ("gltf-media-type.php" instead of "gltf.php")
  • Text Domain: You no longer need to specify the text domain since WordPress 4.6; it must be the same as the plugin slug

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
No dangerous file extensions were detected107,531 lines of code in 36 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript1877,11014,659107,155
PHP15152544347
JSON10028
CSS2181

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
This plugin has no cyclomatic complexity problems
Cyclomatic complexity
Average complexity per logical line of code0.21
Average class complexity4.00
▷ Minimum class complexity1.00
▷ Maximum class complexity20.00
Average method complexity1.66
▷ Minimum method complexity1.00
▷ Maximum method complexity8.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes16
▷ Abstract classes00.00%
▷ Concrete classes16100.00%
▷ Final classes00.00%
Methods66
▷ Static methods46.06%
▷ Public methods5481.82%
▷ Protected methods00.00%
▷ Private methods1218.18%
Functions10
▷ Named functions880.00%
▷ Anonymous functions220.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.02MB with 0.01MB in potential savings
Potential savings
Compression of 2 random PNG files using pngquant
FileSize - originalSize - compressedSavings
trunk/admin/images/model-icon.png8.00KB2.92KB▼ 63.56%
admin/images/model-icon.png8.00KB2.92KB▼ 63.56%