67% audio-and-video-player

Code Review | CP Media Player - Audio Player and Video Player

WordPress plugin CP Media Player - Audio Player and Video Player scored67%from 54 tests.

About plugin

  • Plugin page: audio-and-video-p...
  • Plugin version: 1.1.2
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0.5-6.3
  • WordPress version: 6.3.1
  • First release: Dec 2, 2012
  • Latest release: Jul 23, 2023
  • Number of updates: 171
  • Update frequency: every 22.7 days
  • Top authors: codepeople (100%)

Code review

54 tests

User reviews

41 reviews

Install metrics

4,000+ active /240,709 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
Installer ran successfully

Server metrics [RAM: ▲0.29MB] [CPU: ▼4.11ms] Passed 4 tests

A check of server-side resources used by CP Media Player - Audio Player and Video Player
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.75 ▲0.2939.55 ▲4.13
Dashboard /wp-admin3.59 ▲0.2945.35 ▼0.98
Posts /wp-admin/edit.php3.71 ▲0.3546.58 ▲3.50
Add New Post /wp-admin/post-new.php6.20 ▲0.3182.55 ▼19.44
Media Library /wp-admin/upload.php3.52 ▲0.2934.12 ▲0.47

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

How much does this plugin use your filesystem and database?
This plugin installed successfully
Filesystem: 67 new files
Database: 1 new table, 7 new options
New tables
wp_cpmp_player
New WordPress options
db_upgraded
widget_theysaidso_widget
widget_recent-comments
theysaidso_admin_options
installed_audio-and-video-player
can_compress_scripts
widget_recent-posts

Browser metrics Passed 4 tests

This is an overview of browser requirements for CP Media Player - Audio Player and Video Player
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,820 ▲7413.73 ▼0.661.64 ▼0.1141.58 ▼1.72
Dashboard /wp-admin2,226 ▲385.07 ▲0.1799.34 ▼5.4536.96 ▼5.44
Posts /wp-admin/edit.php2,109 ▲382.04 ▲0.0235.37 ▼1.8631.20 ▼3.80
Add New Post /wp-admin/post-new.php6,218 ▲4,68519.28 ▼3.77880.68 ▲267.6437.46 ▼9.61
Media Library /wp-admin/upload.php1,411 ▲264.22 ▼0.02100.79 ▼0.6543.08 ▲2.62
Audio And Video Player /wp-admin/codepeople-media-player.php260.440.0813.61

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
Please fix the following items
  • The plugin did not uninstall successfully, leaving 1 table in the database
    • wp_cpmp_player
  • This plugin does not fully uninstall, leaving 7 options in the database
    • widget_theysaidso_widget
    • db_upgraded
    • widget_recent-posts
    • widget_recent-comments
    • theysaidso_admin_options
    • can_compress_scripts
    • installed_audio-and-video-player

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for server-side errors
Even though everything seems fine, this is not an exhaustive test

SRP 50% from 2 tests

🔹 Tests weight: 20 | The single-responsibility principle: PHP files have to remain inert when accessed directly, throwing no errors and performing no actions
Almost there! Just fix the following items
  • 3× 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/audio-and-video-player/banner.php:105
    • > PHP Fatal error
      Uncaught Error: Class 'Elementor\\Control_Button' not found in wp-content/plugins/audio-and-video-player/builders/elementor-control.pb.php:4
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/audio-and-video-player/banner.php:105

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is just a short smoke test looking for browser issues
Please fix the following user-side errors
    • > GET request to /wp-admin/codepeople-media-player.php
    • > Network (severe)
    wp-admin/codepeople-media-player.php - Failed to load resource: the server responded with a status of 404 (Not Found)

Optimizations

Plugin configuration 86% from 29 tests

readme.txt 94% from 16 tests

Don't ignore readme.txt as it is the file that instructs WordPress.org on how to present your plugin to the world
Attributes that require attention:
  • Tags: Too many tags (31 tag instead of maximum 10); only the first 5 tags are used in your directory listing
You can take inspiration from this readme.txt

audio-and-video-player/codepeople-media-player.php 77% from 13 tests

The primary PHP file in "CP Media Player - Audio Player and Video Player" version 1.1.2 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 ("audio-and-video-player.php" instead of "codepeople-media-player.php")
  • Text Domain: The text domain must be the same as the plugin slug, although optional since WordPress version 4.6
  • Description: If Twitter did it, so should we! Keep the description under 140 characters (currently 263 characters long)

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
Everything looks great! No dangerous files found in this plugin5,487 lines of code in 39 files:
LanguageFilesBlank linesComment linesLines of code
PHP82361011,849
JavaScript9230781,757
CSS9117281,313
PO File1142144335
HTML100177
INI515550
SVG6006

PHP code Passed 2 tests

This is a very shot review of cyclomatic complexity and code structure
There were no cyclomatic complexity issued detected
Cyclomatic complexity
Average complexity per logical line of code0.44
Average class complexity35.12
▷ Minimum class complexity1.00
▷ Maximum class complexity228.00
Average method complexity5.48
▷ Minimum method complexity1.00
▷ Maximum method complexity78.00
Code structure
Namespaces1
Interfaces0
Traits0
Classes8
▷ Abstract classes00.00%
▷ Concrete classes8100.00%
▷ Final classes00.00%
Methods61
▷ Static methods23.28%
▷ Public methods4777.05%
▷ Protected methods69.84%
▷ Private methods813.11%
Functions5
▷ Named functions5100.00%
▷ Anonymous functions00.00%
Constants6
▷ Global constants6100.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
13 PNG files occupy 0.06MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
skins/classic-skin/controls-classic.png14.61KB5.51KB▼ 62.28%
images/cpmp_video.png0.26KB0.10KB▼ 61.28%
images/cpmp_gallery.png0.29KB0.14KB▼ 52.51%
images/icon-video.png3.50KB1.46KB▼ 58.18%
skins/device-player-skin/thumbnail.png2.91KB1.94KB▼ 33.24%