62% nextgen-gallery-voting

Code Review | NextGEN Gallery Voting

WordPress plugin NextGEN Gallery Voting scored62%from 54 tests.

About plugin

  • Plugin page: nextgen-gallery-v...
  • Plugin version: 2.7.6
  • PHP version: 7.4.16
  • WordPress compatibility: 2.9.1-4.0.1
  • WordPress version: 6.3.1
  • First release: Oct 31, 2009
  • Latest release: Apr 23, 2023
  • Number of updates: 92
  • Update frequency: every 53.5 days
  • Top authors: shauno (100%)

Code review

54 tests

User reviews

26 reviews

Install metrics

500+ active /116,687 total downloads

Benchmarks

Plugin footprint 65% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | The install procedure must perform silently
Installer ran successfully

Server metrics [RAM: ▲0.45MB] [CPU: ▼4.51ms] Passed 4 tests

A check of server-side resources used by NextGEN Gallery Voting
This plugin does not affect your website's performance
PageMemory (MB)CPU Time (ms)
Home /3.92 ▲0.4647.27 ▲8.78
Dashboard /wp-admin3.76 ▲0.4247.65 ▼17.21
Posts /wp-admin/edit.php3.87 ▲0.5245.89 ▲0.35
Add New Post /wp-admin/post-new.php6.34 ▲0.4681.05 ▼7.70
Media Library /wp-admin/upload.php3.68 ▲0.4639.38 ▲6.52
Settings /wp-admin/admin.php?page=nextgen-gallery-voting3.6534.86
Top Voted /wp-admin/admin.php?page=nextgen-gallery-voting-top-voted3.6234.58

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

Input-output and database impact of this plugin
This plugin was installed successfully
Filesystem: 28 new files
Database: 2 new tables, 7 new options
New tables
wp_nggv_votes
wp_nggv_settings
New WordPress options
widget_theysaidso_widget
theysaidso_admin_options
widget_recent-posts
can_compress_scripts
db_upgraded
recovery_mode_email_last_sent
widget_recent-comments

Browser metrics Passed 4 tests

NextGEN Gallery Voting: an overview of browser usage
Normal browser usage
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,962 ▲19113.75 ▼0.626.77 ▲4.8344.26 ▲0.95
Dashboard /wp-admin2,252 ▲645.06 ▼0.84117.24 ▲0.5341.72 ▼0.87
Posts /wp-admin/edit.php2,146 ▲572.28 ▲0.2436.79 ▼1.6433.02 ▼0.67
Add New Post /wp-admin/post-new.php1,555 ▲2723.47 ▲0.64662.66 ▲20.1736.26 ▼31.31
Media Library /wp-admin/upload.php1,445 ▲604.27 ▼0.12102.59 ▼2.5741.89 ▼1.76
Settings /wp-admin/admin.php?page=nextgen-gallery-voting1,0031.8826.8635.58
Top Voted /wp-admin/admin.php?page=nextgen-gallery-voting-top-voted7131.239.2415.83

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
It is recommended to fix the following
  • This plugin does not fully uninstall, leaving 2 tables in the database
    • wp_nggv_settings
    • wp_nggv_votes
  • This plugin did not uninstall successfully, leaving 7 options in the database
    • widget_recent-comments
    • widget_recent-posts
    • recovery_mode_email_last_sent
    • theysaidso_admin_options
    • can_compress_scripts
    • widget_theysaidso_widget
    • db_upgraded

Smoke tests 25% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | Just a short smoke test targeting errors on the server (in the Apache logs)
Smoke test failed, please fix the following
    • > GET request to /wp-admin/admin.php?page=nextgen-gallery-voting-top-voted
    • > Error in wp-content/plugins/nextgen-gallery-voting/ngg-voting.php+1158
    Uncaught Error: Call to a member function find_all_galleries() on null in wp-content/plugins/nextgen-gallery-voting/ngg-voting.php:1158
    Stack trace:
    #0 wp-includes/class-wp-hook.php(310): nggVoting->topVoted()
    #1 wp-includes/class-wp-hook.php(334): WP_Hook->apply_filters()
    #2 wp-includes/plugin.php(517): WP_Hook->do_action()
    #3 wp-admin/admin.php(259): do_action()
    #4 {main}
    thrown

SRP 50% from 2 tests

🔹 Tests weight: 20 | A shallow check of the single-responsibility principle; PHP files should perform no action - including output of placeholder text - and trigger no errors when accessed directly
The following issues need your attention
  • 1× PHP files perform the task of outputting text when accessed with GET requests:
    • > /wp-content/plugins/nextgen-gallery-voting/ngg-voting.php

User-side errors 0% from 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Please fix the following browser errors
    • > GET request to /wp-admin/admin.php?page=nextgen-gallery-voting-top-voted
    • > 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(...).datepicker is not a function" "TypeError: jQuery(...).datepicker is not a function\n at HTMLDocument.\u003Canonymous> (/wp-content/plugins/nextgen-gallery-voting/js/top-voted.js?ver=6.3.1:2:44)\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/admin.php?page=nextgen-gallery-voting-top-voted
    • > 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(...).datepicker is not a function

Optimizations

Plugin configuration 96% from 29 tests

readme.txt Passed 16 tests

You should put a lot of thought into formatting readme.txt as it is used by WordPress.org to prepare the public listing of your plugin
7 plugin tags: nextgen, rating, ratings, nextgen-gallery, nextgen-gallery-voting...

nextgen-gallery-voting/ngg-voting.php 92% from 13 tests

The entry point to "NextGEN Gallery Voting" version 2.7.6 is a PHP file that has certain tags in its header comment area
It is important to fix the following:
  • Main file name: Even though not officially enforced, the main plugin file should be the same as the plugin slug ("nextgen-gallery-voting.php" instead of "ngg-voting.php")

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | There should be no dangerous file extensions present in any WordPress plugin
Success! There were no dangerous files found in this plugin2,643 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP23244191,789
CSS32536669
JavaScript43711185

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
All good! No complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.66
Average class complexity271.50
▷ Minimum class complexity76.00
▷ Maximum class complexity467.00
Average method complexity9.20
▷ Minimum method complexity1.00
▷ Maximum method complexity95.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods66
▷ Static methods2131.82%
▷ Public methods66100.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

It is recommended to compress PNG files in your plugin to minimize bandwidth usage
15 PNG files occupy 0.03MB with 0.01MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
css/jquery-ui/images/ui-bg_flat_75_ffffff_40x100.png0.20KB0.08KB▼ 58.17%
css/jquery-ui/images/ui-icons_cd0a0a_256x240.png4.44KB4.17KB▼ 6.02%
css/jquery-ui/images/ui-bg_glass_75_dadada_1x400.png0.26KB0.16KB▼ 38.93%
css/jquery-ui/images/ui-bg_glass_65_ffffff_1x400.png0.20KB0.09KB▼ 57.49%
css/jquery-ui/images/ui-icons_222222_256x240.png6.76KB4.17KB▼ 38.24%