77% wplyr-media-block

Code Review | WPlyr Media Block

WordPress plugin WPlyr Media Block scored 77% from 54 tests.

About plugin

  • Plugin page: wplyr-media-block
  • Plugin version: 1.2.0
  • PHP compatiblity: 7.1+
  • PHP version: 7.4.16
  • WordPress compatibility: 5.2.0-6.0
  • WordPress version: 6.3.1
  • First release: Jul 24, 2019
  • Latest release: Jul 1, 2022
  • Number of updates: 7
  • Update frequency: every 153.4 days
  • Top authors: wecodify (100%)

Code review

54 tests

User reviews

4 reviews

Install metrics

100+ active / 2,430 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.31MB] [CPU: ▼5.03ms] Passed 4 tests

This is a short check of server-side resources used by WPlyr Media Block
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /3.96 ▲0.5046.16 ▲3.10
Dashboard /wp-admin4.03 ▲0.7253.67 ▲4.34
Posts /wp-admin/edit.php4.04 ▲0.6959.87 ▲10.14
Add New Post /wp-admin/post-new.php5.32 ▼0.5753.12 ▼35.98
Media Library /wp-admin/upload.php3.85 ▲0.6240.75 ▲8.44
WPlyr /wp-admin/options-general.php?page=wplyr-settings3.8646.66

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

Analyzing filesystem and database footprints of this plugin
There were no storage issued detected upon installing this plugin
Filesystem: 77 new files
Database: no new tables, 6 new options
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
db_upgraded
can_compress_scripts
widget_recent-comments

Browser metrics Passed 4 tests

An overview of browser requirements for WPlyr Media Block
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,165 ▲40819.17 ▲4.594.48 ▲2.5445.96 ▲5.29
Dashboard /wp-admin2,541 ▲3539.49 ▲4.58191.53 ▲86.6841.98 ▼0.86
Posts /wp-admin/edit.php2,462 ▲3736.46 ▲4.4788.10 ▲47.4535.96 ▲1.51
Add New Post /wp-admin/post-new.php6,497 ▲4,96423.84 ▲0.51893.98 ▲251.6347.83 ▼3.83
Media Library /wp-admin/upload.php1,593 ▲2027.03 ▲2.83114.07 ▲16.5043.07 ▲0.21
WPlyr /wp-admin/options-general.php?page=wplyr-settings1,4986.75111.6696.91

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • The uninstall procedure has failed, leaving 6 options in the database
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • widget_recent-posts
    • db_upgraded
    • theysaidso_admin_options

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a short smoke test looking 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 | 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
  • 5× GET requests to PHP files return non-empty strings:
    • > /wp-content/plugins/wplyr-media-block/views/template-video.php
    • > /wp-content/plugins/wplyr-media-block/vendor/htmlburger/carbon-fields/templates/Exception/incorrect-syntax.php
    • > /wp-content/plugins/wplyr-media-block/views/template-audio.php
    • > /wp-content/plugins/wplyr-media-block/views/template-youtube.php
    • > /wp-content/plugins/wplyr-media-block/views/template-vimeo.php
  • 143× PHP files trigger server-side errors or warnings when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Condition' not found in wp-content/plugins/wplyr-media-block/vendor/htmlburger/carbon-fields/core/Container/Condition/Post_Type_Condition.php:8
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Service\\Service' not found in wp-content/plugins/wplyr-media-block/vendor/htmlburger/carbon-fields/core/Service/Legacy_Storage_Service_v_1_5.php:15
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Container' not found in wp-content/plugins/wplyr-media-block/vendor/htmlburger/carbon-fields/core/Container/User_Meta_Container.php:9
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Container' not found in wp-content/plugins/wplyr-media-block/vendor/htmlburger/carbon-fields/core/Container/Comment_Meta_Container.php:13
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Field\\Predefined_Options_Field' not found in wp-content/plugins/wplyr-media-block/vendor/htmlburger/carbon-fields/core/Field/Multiselect_Field.php:13
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/wplyr-media-block/views/admin/template-sidebar.php:3
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Fulfillable\\Translator\\Translator' not found in wp-content/plugins/wplyr-media-block/vendor/htmlburger/carbon-fields/core/Container/Fulfillable/Translator/Array_Translator.php:10
    • > PHP Fatal error
      Uncaught Error: Interface 'Carbon_Fields\\Pimple\\ServiceProviderInterface' not found in wp-content/plugins/wplyr-media-block/vendor/htmlburger/carbon-fields/core/Provider/Container_Condition_Provider.php:10
    • > PHP Fatal error
      Uncaught Error: Class 'Carbon_Fields\\Container\\Condition\\Comparer\\Comparer' not found in wp-content/plugins/wplyr-media-block/vendor/htmlburger/carbon-fields/core/Container/Condition/Comparer/Scalar_Comparer.php:7
    • > PHP Notice
      Undefined variable: data in wp-content/plugins/wplyr-media-block/views/template-vimeo.php on line 12

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 90% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
9 plugin tags: self-hosted, video, gutenberg, youtube, html5...

wplyr-media-block/wplyr.php 77% from 13 tests

The entry point to "WPlyr Media Block" version 1.2.0 is a PHP file that has certain tags in its header comment area
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("wplyr-media-block.php" instead of "wplyr.php")
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug
  • Description: Please keep the plugin description shorter than 140 characters (currently 169 characters long)

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Good job! No executable or dangerous file extensions detected39,092 lines of code in 503 files:
LanguageFilesBlank linesComment linesLines of code
PHP1905,15410,58917,920
JavaScript1755,1918,46812,979
Sass856552413,432
PO File268191,0202,202
CSS123611,1451,838
JSON700551
Markdown6660137
SVG20033

PHP code 50% from 2 tests

A brief analysis of cyclomatic complexity and code structure for this plugin
The following items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 132)
Cyclomatic complexity
Average complexity per logical line of code0.38
Average class complexity17.86
▷ Minimum class complexity1.00
▷ Maximum class complexity961.00
Average method complexity2.97
▷ Minimum method complexity1.00
▷ Maximum method complexity132.00
Code structure
Namespaces30
Interfaces5
Traits0
Classes154
▷ Abstract classes138.44%
▷ Concrete classes14191.56%
▷ Final classes21.42%
Methods1,360
▷ Static methods1188.68%
▷ Public methods86963.90%
▷ Protected methods46033.82%
▷ Private methods312.28%
Functions121
▷ Named functions2621.49%
▷ Anonymous functions9578.51%
Constants99
▷ Global constants77.07%
▷ Class constants9292.93%
▷ Public constants92100.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
1 PNG file occupies 0.01MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
assets/images/plugin-icon.png5.54KB2.96KB▼ 46.67%