52% codeprey-mi-video-popup

Code Review | Codeprey - Mi Video Popup

WordPress plugin Codeprey - Mi Video Popup scored52%from 54 tests.

About plugin

  • Plugin page: codeprey-mi-video...
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 2.6.0-4.6.1
  • WordPress version: 6.3.1
  • First release: Nov 25, 2016
  • Latest release: Jan 6, 2017
  • Number of updates: 6
  • Update frequency: every 8.2 days
  • Top authors: vikasverma091 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /1,020 total downloads

Benchmarks

Plugin footprint 48% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▼1.91MB] [CPU: ▼54.93ms] Passed 4 tests

Analyzing server-side resources used by Codeprey - Mi Video Popup
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.07 ▼1.394.07 ▼36.23
Dashboard /wp-admin2.09 ▼1.216.72 ▼46.37
Posts /wp-admin/edit.php2.09 ▼1.266.65 ▼43.80
Add New Post /wp-admin/post-new.php2.09 ▼3.796.23 ▼93.31
Media Library /wp-admin/upload.php2.09 ▼1.145.06 ▼34.04
List Video Popups /wp-admin/admin.php?page=my-popups2.096.05
Add Video Popups /wp-admin/admin.php?page=video2.096.24

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 31 new files
Database: 1 new table, 7 new options
New tables
wp_videos
New WordPress options
widget_theysaidso_widget
videopopup_version
theysaidso_admin_options
widget_recent-posts
widget_recent-comments
db_upgraded
can_compress_scripts

Browser metrics Passed 4 tests

A check of browser resources used by Codeprey - Mi Video Popup
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,105 ▲34415.19 ▲0.634.94 ▲3.1238.88 ▼2.25
Dashboard /wp-admin2,397 ▲1946.44 ▲1.50124.94 ▼17.4440.88 ▼13.92
Posts /wp-admin/edit.php2,299 ▲1963.34 ▲1.3555.24 ▲9.0937.36 ▼1.05
Add New Post /wp-admin/post-new.php1,561 ▲1623.41 ▲0.46647.07 ▼27.5037.24 ▼20.48
Media Library /wp-admin/upload.php1,439 ▲424.25 ▲0.0982.50 ▼30.5743.45 ▼4.69
List Video Popups /wp-admin/admin.php?page=my-popups9943.0238.5724.92
Add Video Popups /wp-admin/admin.php?page=video1,2053.2037.8823.97

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
You still need to fix the following
  • This plugin cannot be uninstalled
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the placeholder handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • Zombie tables were found after uninstall: 1 table
    • wp_videos
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-posts
    • widget_recent-comments
    • widget_theysaidso_widget
    • can_compress_scripts
    • theysaidso_admin_options
    • db_upgraded
    • videopopup_version

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
These errors were triggered by the plugin
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=video
    • > User notice in wp-includes/functions.php+5905
    Function wp_enqueue_script was called incorrectly. Scripts and styles should not be registered or enqueued until the wp_enqueue_scripts, admin_enqueue_scripts, or login_enqueue_scripts hooks. This notice was triggered by the placeholder handle. Please see Debugging in WordPress for more information. (This message was added in version 3.3.0.)
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=video
    • > Deprecated in wp-includes/class-wp-hook.php+310
    Non-static method mivideopop::mivideopop_uploader_enqueue() should not be called statically
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=video
    • > Deprecated in wp-content/plugins/codeprey-mi-video-popup/mivideopop.php+80
    Non-static method mivideopop::plugin_url() should not be called statically
    • > GET request to /wp-admin/admin.php?page=my-popups
    • > Deprecated in wp-content/plugins/codeprey-mi-video-popup/inc/class-mivideopopup-admin-menus.php+38
    Non-static method Mivideopopup::mivideopopup_listVideos() should not be called statically
    • > GET request to /wp-admin/admin.php?page=my-popups
    • > Notice in wp-content/plugins/codeprey-mi-video-popup/inc/class-mivideopopup.php+305
    Undefined index: paged
    • > GET request to /wp-admin/admin.php?page=video
    • > Deprecated in wp-content/plugins/codeprey-mi-video-popup/inc/class-mivideopopup-admin-menus.php+31
    Non-static method Mivideopopup::mivideopopup_create() should not be called statically
  • 5 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=video
    • > Notice in wp-content/plugins/codeprey-mi-video-popup/inc/class-mivideopopup.php+171
    Undefined variable: videoRow
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=video
    • > Notice in wp-content/plugins/codeprey-mi-video-popup/inc/class-mivideopopup.php+133
    Trying to get property 'popup_link' of non-object
    • > GET request to /wp-admin/admin.php?page=video
    • > Notice in wp-content/plugins/codeprey-mi-video-popup/inc/class-mivideopopup.php+138
    Trying to get property 'popup_autoplay' of non-object
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=video
    • > Notice in wp-content/plugins/codeprey-mi-video-popup/inc/class-mivideopopup.php+171
    Trying to get property 'picture_link' of non-object

SRP 50% 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
The following issues need your attention
  • 1× GET requests to PHP files trigger server-side errors or Error 500 responses:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/codeprey-mi-video-popup/inc/class-mivideopopup.php:18

User-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the browser (console and network errors and warnings)
Please fix the following user-side errors
  • 2 occurences, only the last one shown
    • > GET request to /wp-admin/admin.php?page=video
    • > Network (severe)
    wp-content/plugins/codeprey-mi-video-popup/media-lib-uploader.js?ver=6.3.1 - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
These attributes need to be fixed:
  • Tags: Please reduce the number of tags, currently 19 tag instead of maximum 10
The official readme.txt might help

codeprey-mi-video-popup/mivideopop.php 85% from 13 tests

"Codeprey - Mi Video Popup" version 1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Text Domain: The text domain follows the same naming rules as the plugin slug: lowercase characters and dashes
  • Main file name: Name the main plugin file the same as the plugin slug ("codeprey-mi-video-popup.php" instead of "mivideopop.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are not allowed as they can serve as attack vectors
No dangerous file extensions were detected2,108 lines of code in 13 files:
LanguageFilesBlank linesComment linesLines of code
JavaScript422387894
PHP592111697
CSS412966517

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.55
Average class complexity32.00
▷ Minimum class complexity1.00
▷ Maximum class complexity119.00
Average method complexity6.39
▷ Minimum method complexity1.00
▷ Maximum method complexity66.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes4
▷ Abstract classes00.00%
▷ Concrete classes4100.00%
▷ Final classes125.00%
Methods23
▷ Static methods313.04%
▷ Public methods2191.30%
▷ Protected methods00.00%
▷ Private methods28.70%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Often times overlooked, PNG files can occupy unnecessary space in your plugin
8 PNG files occupy 0.03MB with 0.00MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/images/jplayer.pink.flag.video.play.png17.28KB4.28KB▼ 75.21%
assets/css/images/border.png0.07KB0.10KB0.00%
assets/css/images/controls.png1.23KB1.28KB0.00%
assets/images/fancybox_sprite.png1.33KB1.42KB0.00%
assets/images/fancybox_sprite@2x.png6.40KB5.76KB▼ 9.96%