62% videos

Code Review | Videos

WordPress plugin Videos scored62%from 54 tests.

About plugin

  • Plugin page: videos
  • Plugin version: 1.0.5
  • PHP compatiblity: 5.2.4+
  • PHP version: 7.4.16
  • WordPress compatibility: 2.0.2-5.9.3
  • WordPress version: 6.3.1
  • First release: Jan 7, 2019
  • Latest release: May 14, 2022
  • Number of updates: 10
  • Update frequency: every 122.4 days
  • Top authors: avi.megladon (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,083 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | Checking the installer triggered no errors
Installer ran successfully

Server metrics [RAM: ▲0.09MB] [CPU: ▲0.14ms] Passed 4 tests

Server-side resources used by Videos
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.57 ▲0.1039.50 ▲0.94
Dashboard /wp-admin3.39 ▲0.0850.01 ▲2.71
Posts /wp-admin/edit.php3.50 ▲0.1448.91 ▼1.28
Add New Post /wp-admin/post-new.php5.99 ▲0.1088.95 ▼1.76
Media Library /wp-admin/upload.php3.31 ▲0.0837.30 ▲2.65
Add New /wp-admin/post-new.php?post_type=video3.4448.08
Category /wp-admin/edit-tags.php?taxonomy=video_category&post_type=video3.3035.16
Tag /wp-admin/edit-tags.php?taxonomy=video_tag&post_type=video3.3031.56
All Videos /wp-admin/edit.php?post_type=video3.3535.39

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 62 new files
Database: 1 new table, 9 new options
New tables
wp_video_files
New WordPress options
widget_video_tag_widget
db_upgraded
widget_recent-comments
theysaidso_admin_options
widget_recent-posts
widget_video_category_widget
widget_theysaidso_widget
widget_video_search_widget
can_compress_scripts

Browser metrics Passed 4 tests

Videos: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,957 ▲19613.37 ▼1.088.50 ▲6.7243.30 ▼2.87
Dashboard /wp-admin2,252 ▲755.60 ▼0.0183.95 ▼2.1038.80 ▼2.81
Posts /wp-admin/edit.php2,157 ▲602.15 ▲0.1535.62 ▼0.2430.24 ▼7.48
Add New Post /wp-admin/post-new.php1,574 ▲3723.15 ▲5.07670.79 ▲40.5338.47 ▼17.25
Media Library /wp-admin/upload.php1,460 ▲604.29 ▲0.1196.82 ▼3.5847.49 ▲2.58
Add New /wp-admin/post-new.php?post_type=video2,0193.9472.5441.93
Category /wp-admin/edit-tags.php?taxonomy=video_category&post_type=video1,3312.2633.5330.82
Tag /wp-admin/edit-tags.php?taxonomy=video_tag&post_type=video1,3062.1728.9929.74
All Videos /wp-admin/edit.php?post_type=video1,1431.9233.6930.50

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

🔸 Tests weight: 35 | It is important to correctly uninstall your plugin, without leaving any traces
These items require your attention
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_video_files
  • This plugin does not fully uninstall, leaving 9 options in the database
    • widget_video_category_widget
    • db_upgraded
    • widget_video_tag_widget
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • widget_video_search_widget
    • can_compress_scripts
    • widget_recent-comments

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Smoke test failed, please fix the following
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/post-new.php?post_type=video
    • > Notice in wp-content/plugins/videos/view/admin/video-data.php+37
    Trying to access array offset on value of type bool

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
Please take a closer look at the following
  • 6× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/videos/view/front/video-size.php
    • > /wp-content/plugins/videos/view/front/video-player-single.php
    • > /wp-content/plugins/videos/view/front/video-duration.php
    • > /wp-content/plugins/videos/view/admin/videos-pro-add.php
    • > /wp-content/plugins/videos/view/front/video-archive-resolution-selection.php
    • > /wp-content/plugins/videos/view/front/video-category-widget.php
  • 38× PHP files trigger server errors when accessed directly (only 10 are shown):
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/videos/actions.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/videos/view/admin/video-data.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/videos/view/front/video-archive-download-link.php:2
    • > PHP Fatal error
      Uncaught Error: Call to undefined function _e() in wp-content/plugins/videos/view/admin/video-duration-field.php:2
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Widget' not found in wp-content/plugins/videos/widgets/video-tag-widget.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugins_url() in wp-content/plugins/videos/view/admin/help-support.php:3
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/videos/templates/archive-video.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function do_action() in wp-content/plugins/videos/view/front/video-download-false.php:2
    • > PHP Notice
      Undefined variable: video_file_duration in wp-content/plugins/videos/view/front/video-duration.php on line 2
    • > PHP Notice
      Undefined variable: video_size in wp-content/plugins/videos/view/front/video-size.php on line 1

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% from 29 tests

readme.txt Passed 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
9 plugin tags: gallery, mp4, mp4 videos, video gallery, download...

videos/video.php 85% from 13 tests

The primary PHP file in "Videos" version 1.0.5 is used by WordPress to initiate all plugin functionality
Please make the necessary changes and fix the following:
  • Description: The description should be shorter than 140 characters (currently 158 characters long)
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("videos.php" instead of "video.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | This is an overview of file extensions present in this plugin and a short test that no dangerous files are bundled with this plugin
There were no executable files found in this plugin1,830 lines of code in 54 files:
LanguageFilesBlank linesComment linesLines of code
PHP482761401,584
CSS2143109
JavaScript32179
PO File128058

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity7.88
▷ Minimum class complexity1.00
▷ Maximum class complexity53.00
Average method complexity3.17
▷ Minimum method complexity1.00
▷ Maximum method complexity14.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes17
▷ Abstract classes00.00%
▷ Concrete classes17100.00%
▷ Final classes00.00%
Methods54
▷ Static methods916.67%
▷ Public methods5398.15%
▷ Protected methods00.00%
▷ Private methods11.85%
Functions42
▷ Named functions3992.86%
▷ Anonymous functions37.14%
Constants5
▷ Global constants5100.00%
▷ Class constants00.00%
▷ Public constants00.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.01MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/download_link.png1.14KB0.28KB▼ 75.66%
images/video_ic.png3.02KB1.91KB▼ 36.67%
images/rss.png0.60KB0.50KB▼ 16.18%
images/default.png1.40KB1.35KB▼ 3.36%