68% youtube-like-rating

Code Review | Youtube Like Rating

WordPress plugin Youtube Like Rating scored68%from 54 tests.

About plugin

  • Plugin page: youtube-like-rating
  • Plugin version: 1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 3.0-3.7
  • WordPress version: 6.3.1
  • First release: Feb 17, 2014
  • Latest release: Jun 30, 2014
  • Number of updates: 5
  • Update frequency: every 26.8 days
  • Top authors: ruchita2808 (100%)

Code review

54 tests

User reviews

2 reviews

Install metrics

10+ active /1,634 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
This plugin's installer ran successfully

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

Server-side resources used by Youtube Like Rating
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.63 ▲0.1751.85 ▲10.12
Dashboard /wp-admin3.33 ▲0.0360.88 ▲7.96
Posts /wp-admin/edit.php3.38 ▲0.0258.16 ▲9.34
Add New Post /wp-admin/post-new.php5.46 ▼0.4378.33 ▼18.27
Media Library /wp-admin/upload.php3.25 ▲0.0248.45 ▲10.26
YoutubeLikeRating /wp-admin/options-general.php?page=YoutubeLikeRating3.2244.94

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

Analyzing filesystem and database footprints of this plugin
This plugin installed successfully
Filesystem: 18 new files
Database: 4 new tables, 6 new options
New tables
wp_post_votes
wp_comment_vote_totals
wp_comment_votes
wp_post_vote_totals
New WordPress options
theysaidso_admin_options
can_compress_scripts
widget_recent-posts
widget_recent-comments
db_upgraded
widget_theysaidso_widget

Browser metrics Passed 4 tests

A check of browser resources used by Youtube Like Rating
There were no issues detected in relation to browser resource usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /3,072 ▲32613.56 ▼1.1010.00 ▲8.2348.62 ▲3.08
Dashboard /wp-admin2,257 ▲694.88 ▼1.03102.17 ▼13.6743.63 ▲3.28
Posts /wp-admin/edit.php2,143 ▲542.02 ▼0.0337.73 ▲0.7343.27 ▲8.45
Add New Post /wp-admin/post-new.php1,615 ▲8623.27 ▲4.93499.20 ▼140.30173.26 ▲117.85
Media Library /wp-admin/upload.php1,430 ▲454.25 ▲0.0499.52 ▲0.5746.68 ▲2.37
YoutubeLikeRating /wp-admin/options-general.php?page=YoutubeLikeRating8641.7127.0432.75

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin does not fully uninstall, leaving 4 tables in the database
    • wp_comment_votes
    • wp_post_votes
    • wp_comment_vote_totals
    • wp_post_vote_totals
  • Zombie WordPress options were found after uninstall: 6 options
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_recent-comments
    • widget_theysaidso_widget
    • widget_recent-posts
    • db_upgraded

Smoke tests 50% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Even though no errors were found, this is by no means an exhaustive test

SRP 50% 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
Almost there! Just fix the following items
  • 2× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function add_action() in wp-content/plugins/youtube-like-rating/YoutubeLikeRating.php:18
    • > PHP Fatal error
      Uncaught Error: Call to undefined function is_user_logged_in() in wp-content/plugins/youtube-like-rating/rating_ajax.php:17

User-side errors 0% from 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Please fix the following user-side errors
    • > GET request to /wp-admin/options-general.php?page=YoutubeLikeRating
    • > Console-api (warning) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28609 "jQuery.Deferred exception: jQuery(...).live is not a function" "TypeError: jQuery(...).live is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/youtube-like-rating/js/YoutubeLikeRating.js?ver=1.0:106:27)\n at e (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:26990)\n at t (/wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1:2:27292)" undefined
    • > GET request to /wp-admin/options-general.php?page=YoutubeLikeRating
    • > Javascript (severe) in unknown
    /wp-admin/load-scripts.php?c=0&load%5Bchunk_0%5D=jquery-core,jquery-migrate,utils&ver=6.3.1 1:28721 Uncaught TypeError: jQuery(...).live is not a function

Optimizations

Plugin configuration 93% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is an important file in your plugin as it is parsed by WordPress.org to prepare the public listing of your plugin
Please fix the following attributes:
  • Screenshots: These screenshots have no corresponding images in /assets: #1 (screenshot-1.png), #2 (screenshot-2.png), #3 (screenshot-3.png)
The official readme.txt might help

youtube-like-rating/YoutubeLikeRating.php 92% from 13 tests

Analyzing the main PHP file in "Youtube Like Rating" version 1.0
The following require your attention:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("youtube-like-rating.php" instead of "YoutubeLikeRating.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | A short glimpse at programming languages used with this plugin and a check that no dangerous files are present
Everything looks great! No dangerous files found in this plugin780 lines of code in 6 files:
LanguageFilesBlank linesComment linesLines of code
PHP212438477
CSS2194193
JavaScript22821110

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.42
Average class complexity40.00
▷ Minimum class complexity40.00
▷ Maximum class complexity40.00
Average method complexity3.60
▷ Minimum method complexity1.00
▷ Maximum method complexity13.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods15
▷ Static methods00.00%
▷ Public methods15100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions2
▷ Named functions2100.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

All PNG images should be compressed to minimize bandwidth usage for end users
10 PNG files occupy 0.05MB with 0.04MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/old-thumb-down-on.png3.20KB0.56KB▼ 82.55%
screenshot-2.PNG9.11KB4.65KB▼ 49.01%
screenshot-1.PNG9.68KB4.62KB▼ 52.29%
images/thumb-down.png3.19KB0.55KB▼ 82.83%
images/up.png2.91KB0.30KB▼ 89.57%