78% nice-video-posts

Code Review | Nice Video Posts

WordPress plugin Nice Video Posts scored 78% from 54 tests.

About plugin

  • Plugin page: nice-video-posts
  • Plugin version: 1.00
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.5.2
  • WordPress version: 5.8.1
  • First release: Nov 6, 2013
  • Latest release: Nov 6, 2013
  • Number of updates: 2
  • Update frequency: every 1.0 days
  • Top authors: mjetpax (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active / 2,640 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
Install script ran successfully

Server metrics [RAM: ▼1.03MB] [CPU: ▼173.63ms] Passed 4 tests

Server-side resources used by Nice Video Posts
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /2.58 ▼0.2614.30 ▼22.11
Dashboard /wp-admin2.63 ▼0.4321.85 ▼22.10
Posts /wp-admin/edit.php2.63 ▼0.4816.06 ▼20.48
Add New Post /wp-admin/post-new.php2.63 ▼2.8115.76 ▼629.83
Media Library /wp-admin/upload.php2.63 ▼0.3814.98 ▼17.39
Add New /wp-admin/post-new.php?post_type=video_posts2.6315.64
Video Posts /wp-admin/edit.php?post_type=video_posts2.6315.33

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

Analyzing filesystem and database footprints of this plugin
The plugin installed successfully
Filesystem: 6 new files
Database: no new tables, no new options

Browser metrics Passed 4 tests

A check of browser resources used by Nice Video Posts
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,723 ▲15115.75 ▲0.189.21 ▼1.0146.48 ▲2.78
Dashboard /wp-admin3,002 ▲715.94 ▼0.02133.48 ▼4.79124.68 ▲7.81
Posts /wp-admin/edit.php2,793 ▲572.70 ▼0.0160.57 ▼0.7893.62 ▲8.24
Add New Post /wp-admin/post-new.php1,902 ▲3019.17 ▲0.12374.67 ▲13.99104.83 ▲5.44
Media Library /wp-admin/upload.php1,787 ▼205.04 ▲0.00128.54 ▼17.41129.87 ▲10.95
Add New /wp-admin/post-new.php?post_type=video_posts3,2718.97208.29159.64
Video Posts /wp-admin/edit.php?post_type=video_posts1,5382.6264.9776.51

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

🔸 Tests weight: 35 | Verifying that this plugin uninstalls completely without leaving any traces
Please fix the following items
  • Uninstall procedure validation failed for this plugin
    • > Warning in wp-content/plugins/nice-video-posts/niceVideoPosts.php+53
    Use of undefined constant labels - assumed 'labels' (this will throw an Error in a future version of PHP)

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
These server-side errors were triggered
  • 3 occurences, only the last one shown
    • > GET request to /wp-admin/edit.php?post_type=video_posts
    • > POST request to /wp-admin/admin-ajax.php
    • > Warning in wp-content/plugins/nice-video-posts/niceVideoPosts.php+53
    Use of undefined constant labels - assumed 'labels' (this will throw an Error in a future version of PHP)

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
Please take a closer look at the following
  • 3× PHP files trigger errors when accessed directly with GET requests:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/nice-video-posts/niceVideoPosts.php:519
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/nice-video-posts/single-video-post.php:1
    • > PHP Fatal error
      Uncaught Error: Call to undefined function get_header() in wp-content/plugins/nice-video-posts/archive-video-posts.php:1

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 93% 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
These attributes need your attention:
  • Tags: You are using too many tags: 12 tag instead of maximum 10
The official readme.txt might help

nice-video-posts/niceVideoPosts.php 92% from 13 tests

This is the main PHP file of "Nice Video Posts" version 1.00, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
You should first fix the following items:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("nice-video-posts.php" instead of "niceVideoPosts.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
Good job! No executable or dangerous file extensions detected603 lines of code in 4 files:
LanguageFilesBlank linesComment linesLines of code
PHP384132539
CSS12164

PHP code Passed 2 tests

A short review of cyclomatic complexity and code structure
No complexity issues detected
Cyclomatic complexity
Average complexity per logical line of code0.35
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions17
▷ Named functions17100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.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
1 PNG file occupies 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
img/video-post-16x16.png0.38KB0.29KB▼ 23.33%