66% videoengage

Code Review | VideoEngage

WordPress plugin VideoEngage scored 66% from 54 tests.

About plugin

  • Plugin page: videoengage
  • Plugin version: 1.0.1
  • PHP version: 7.4.16
  • WordPress compatibility: 4.5.2-4.7.4
  • WordPress version: 5.8.1
  • First release: May 3, 2017
  • Latest release: May 7, 2017
  • Number of updates: 8
  • Update frequency: every 0.8 days
  • Top authors: caprine (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 1,049 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
Installer ran successfully

Server metrics [RAM: ▲0.67MB] [CPU: ▼158.61ms] Passed 4 tests

An overview of server-side resources used by VideoEngage
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.71 ▲0.8736.71 ▲1.39
Dashboard /wp-admin3.77 ▲0.7132.71 ▼32.04
Posts /wp-admin/edit.php3.83 ▲0.7244.56 ▼1.37
Add New Post /wp-admin/post-new.php5.89 ▲0.4686.56 ▼598.75
Media Library /wp-admin/upload.php3.79 ▲0.7934.50 ▼2.26
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=branding3.7729.51
Add New /wp-admin/post-new.php?post_type=videnpro_ads3.8642.40
All Items /wp-admin/edit.php?post_type=branding3.8138.20
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=videnpro_ads3.7734.15
All Items /wp-admin/edit.php?post_type=videnpro_ads3.8132.56
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=videnpro_ads3.7732.31
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=branding3.7733.64
Add New /wp-admin/post-new.php?post_type=branding3.8645.06

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 129 new files
Database: no new tables, 2 new options
New WordPress options
widget_videnpro_widget
category_children

Browser metrics Passed 4 tests

An overview of browser requirements for VideoEngage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /4,266 ▲67019.83 ▲4.1024.59 ▲9.1359.51 ▲6.79
Dashboard /wp-admin3,360 ▲4278.85 ▲2.83198.27 ▲28.55124.57 ▲13.50
Posts /wp-admin/edit.php3,167 ▲4285.58 ▲2.86121.36 ▲55.9989.45 ▼0.15
Add New Post /wp-admin/post-new.php1,774 ▲24523.69 ▲9.53280.25 ▼37.88109.84 ▼2.43
Media Library /wp-admin/upload.php1,939 ▲2066.41 ▲1.39150.65 ▼18.39118.38 ▼3.67
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=branding2,2555.15102.7785.08
Add New /wp-admin/post-new.php?post_type=videnpro_ads2,4336.13129.4290.02
All Items /wp-admin/edit.php?post_type=branding1,8915.23109.0981.49
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=videnpro_ads2,3425.18105.2288.18
All Items /wp-admin/edit.php?post_type=videnpro_ads1,8795.18108.6888.82
Tags /wp-admin/edit-tags.php?taxonomy=post_tag&post_type=videnpro_ads2,2585.18103.6490.00
Categories /wp-admin/edit-tags.php?taxonomy=category&post_type=branding2,3605.06105.1897.93
Add New /wp-admin/post-new.php?post_type=branding12,67316.74614.38175.77

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • Zombie WordPress options were found after uninstall: 2 options
    • widget_videnpro_widget
    • category_children

Smoke tests 0% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
These server-side errors were triggered
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=branding
    • > Warning in wp-includes/class-wp-hook.php+303
    call_user_func_array() expects parameter 1 to be a valid callback, class 'Videnpro_Admin' does not have a method 'enqueue_styles'
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=branding
    • > Warning in wp-includes/class-wp-hook.php+303
    call_user_func_array() expects parameter 1 to be a valid callback, class 'Videnpro_Admin' does not have a method 'enqueue_scripts'
    • > GET request to /wp-admin/post-new.php?post_type=branding
    • > Notice in wp-content/plugins/videoengage/includes/class-videnpro-meta-box.php+598
    Uninitialized string offset: 1
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=branding
    • > Warning in wp-content/plugins/videoengage/includes/class-videnpro-meta-box.php+717
    A non-numeric value encountered
    • > GET request to /wp-admin/post-new.php?post_type=branding
    • > Notice in wp-content/plugins/videoengage/includes/class-videnpro-meta-box.php+1458
    Undefined variable: check_video_secure
    • > GET request to /wp-admin/post-new.php?post_type=branding
    • > Notice in wp-content/plugins/videoengage/includes/class-videnpro-meta-box.php+2312
    Undefined variable: cta_effect_slide
    • > GET request to /wp-admin/post-new.php?post_type=branding
    • > Notice in wp-content/plugins/videoengage/includes/class-videnpro-meta-box.php+2327
    Undefined variable: cta_effect_puff

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
Please fix the following items
  • 2× PHP files output non-empty strings when accessed directly via GET requests:
    • > /wp-content/plugins/videoengage/admin/partials/videnpro-admin-display.php
    • > /wp-content/plugins/videoengage/public/partials/videnpro-public-display.php
  • 2× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_shortcode() in wp-content/plugins/videoengage/includes/class-videnpro-shortcodes.php:14
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/videoengage/includes/class-videnpro-widget.php:2

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
  • 8 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=branding
    • > Javascript (severe) in unknown
    /wp-content/plugins/videoengage/admin/js/bootstrap.min.js?ver=5.8.1 5:215 Uncaught Error: Bootstrap's JavaScript requires jQuery version 1.9.1 or higher, but lower than version 3
  • 7 occurences, only the last one shown
    • > GET request to /wp-admin/edit-tags.php?taxonomy=category&post_type=branding
    • > Javascript (severe) in unknown
    https://s.ytimg.com/yts/jsbin/www-widgetapi-vfldTtH0_/www-widgetapi.js 35:0 Uncaught ReferenceError: YTConfig is not defined
    • > GET request to /wp-admin/post-new.php?post_type=branding
    • > Network (severe)
    https://player.vimeo.com/video/?api=1&player_id=video&title=false&byline=false&portrait=false - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=branding
    • > Network (severe)
    wp-content/plugins/videoengage/admin/css/images/ui-bg_highlight-soft_100_eeeeee_1x100.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=branding
    • > Network (severe)
    wp-content/plugins/videoengage/admin/css/images/ui-bg_glass_100_f6f6f6_1x400.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=branding
    • > Network (severe)
    wp-content/plugins/videoengage/admin/css/images/ui-icons_222222_256x240.png - Failed to load resource: the server responded with a status of 404 (Not Found)
    • > GET request to /wp-admin/post-new.php?post_type=branding
    • > Javascript (severe) in unknown
    https://player.vimeo.com/api/player.js?ver=5.8.1 1:10336 Uncaught Error: The embed code for this video is not valid.

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

Perhaps the most important file in your plugin readme.txt gets parsed in order to generate the public listing of your plugin
Attributes that require attention:
  • Screenshots: These screenshots need descriptions #1, #2, #3 in videoengage/assets to your readme.txt
The official readme.txt might help

videoengage/videoengage.php 92% from 13 tests

The principal PHP file in "VideoEngage" v. 1.0.1 is loaded by WordPress automatically on each request
Please make the necessary changes and fix the following:
  • Text Domain: Since WordPress version 4.6 the text domain is optional; if specified, it must be the same as the plugin slug

Code Analysis 97% from 3 tests

File types Passed 1 test

🔸 Test weight: 35 | An overview of files in this plugin; executable files are not allowed
Everything looks great! No dangerous files found in this plugin16,355 lines of code in 88 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript251,2621,6904,268
PHP219168674,241
CSS122101193,425
Sass1434341,656
LESS1434441,646
SVG100685
PO File1174216434

PHP code 50% from 2 tests

An overview of cyclomatic complexity and code structure
These items need your attention
  • Cyclomatic complexity of methods has to be reduced to less than 100 (currently 110)
Cyclomatic complexity
Average complexity per logical line of code0.36
Average class complexity19.00
▷ Minimum class complexity1.00
▷ Maximum class complexity171.00
Average method complexity6.48
▷ Minimum method complexity1.00
▷ Maximum method complexity110.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes14
▷ Abstract classes00.00%
▷ Concrete classes14100.00%
▷ Final classes00.00%
Methods46
▷ Static methods24.35%
▷ Public methods4189.13%
▷ Protected methods00.00%
▷ Private methods510.87%
Functions20
▷ Named functions1995.00%
▷ Anonymous functions15.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size 50% from 2 tests

Image compression 50% from 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
25 PNG files occupy 6.25MB with 3.38MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
admin/img/mockups/icons/_wood1.png2,305.06KB1,635.31KB▼ 29.06%
admin/img/mockups/icons/_samsungb.png287.76KB203.81KB▼ 29.18%
admin/img/mockups/icons/_iwatchg.png147.69KB73.94KB▼ 49.94%
admin/img/mockups/icons/_borderblue1.png27.64KB2.48KB▼ 91.03%
admin/img/mockups/icons/_mbgold.png119.60KB34.40KB▼ 71.24%