10% gallery-voting

Code Review | Tribulant Gallery Voting

WordPress plugin Tribulant Gallery Voting scored 10% from 54 tests.

About plugin

  • Plugin page: gallery-voting
  • Plugin version: 1.2.1
  • PHP version: 7.4.16
  • WordPress compatibility: 3.8-5.1.1
  • WordPress version: 6.3.1
  • First release: May 6, 2014
  • Latest release: Mar 26, 2019
  • Number of updates: 17
  • Update frequency: every 105.0 days
  • Top authors: contrid (100%)

Code review

54 tests

User reviews

11 reviews

Install metrics

500+ active / 16,171 total downloads

Benchmarks

Plugin footprint 23% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | All plugins must install correctly, without throwing any errors, warnings, or notices
Please fix the following installer errors
  • Install procedure had errors
    • > Deprecated in wp-content/plugins/gallery-voting/index.php+15
    Methods with the same name as their class will not be constructors in a future version of PHP; GalleryVoting has a deprecated constructor

Server metrics [RAM: ▼1.82MB] [CPU: ▼53.47ms] Passed 4 tests

A check of server-side resources used by Tribulant Gallery Voting
Normal server usage
PageMemory (MB)CPU Time (ms)
Home /2.17 ▼1.295.61 ▼37.09
Dashboard /wp-admin2.19 ▼1.125.68 ▼42.68
Posts /wp-admin/edit.php2.19 ▼1.177.37 ▼51.67
Add New Post /wp-admin/post-new.php2.19 ▼3.705.80 ▼82.43
Media Library /wp-admin/upload.php2.19 ▼1.046.48 ▼27.58
Gallery Voting /wp-admin/options-general.php?page=gallery-voting2.198.80

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

Filesystem and database footprint
This plugin installed successfully
Filesystem: 5 new files
Database: 1 new table, 11 new options
New tables
wp_galleryvotes
New WordPress options
widget_theysaidso_widget
can_compress_scripts
widget_recent-posts
gallery_voting_max_all
db_upgraded
gallery_voting_max_same
gallery_voting_tracking
theysaidso_admin_options
gallery_voting_css
gallery_voting_usersallowed
...

Browser metrics Passed 4 tests

A check of browser resources used by Tribulant Gallery Voting
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,841 ▲10613.59 ▼0.792.06 ▲0.0742.92 ▼2.58
Dashboard /wp-admin2,213 ▲224.86 ▼0.01109.62 ▲1.6938.49 ▼2.84
Posts /wp-admin/edit.php2,093 ▲12.00 ▲0.0239.37 ▼0.5535.62 ▼2.47
Add New Post /wp-admin/post-new.php1,543 ▲1523.41 ▲4.94668.18 ▲57.6072.88 ▲11.64
Media Library /wp-admin/upload.php1,386 ▼24.19 ▼0.03101.20 ▲3.8740.27 ▼3.12
Gallery Voting /wp-admin/options-general.php?page=gallery-voting8772.0431.4932.19

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

🔸 Tests weight: 35 | Checking the uninstaller removed all traces of the plugin
Please fix the following items
  • This plugin cannot be uninstalled
    • > Deprecated in wp-content/plugins/gallery-voting/index.php+15
    Methods with the same name as their class will not be constructors in a future version of PHP; GalleryVoting has a deprecated constructor
  • This plugin does not fully uninstall, leaving 1 table in the database
    • wp_galleryvotes
  • Zombie WordPress options were found after uninstall: 11 options
    • gallery_voting_usersallowed
    • db_upgraded
    • gallery_voting_tracking
    • widget_recent-comments
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • gallery_voting_max_all
    • widget_recent-posts
    • gallery_voting_css
    • gallery_voting_max_same
    • ...

Smoke tests 50% from 4 tests

Server-side errors 0% from 1 test

🔹 Test weight: 20 | A smoke test targeting server-side errors
Almost there, just fix the following server-side errors
    • > GET request to /wp-admin/options-general.php?page=gallery-voting
    • > Deprecated in wp-content/plugins/gallery-voting/index.php+15
    Methods with the same name as their class will not be constructors in a future version of PHP; GalleryVoting has a deprecated constructor

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
Please take a closer look at the following
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function plugin_basename() in wp-content/plugins/gallery-voting/index.php:533

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
Everything seems fine on the user side

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

The readme.txt file is important because it is parsed by WordPress.org for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Screenshot #1 (Sample of a WordPress image/photo gallery with the vote/like link and vote count below each photo.) image required
You can take inspiration from this readme.txt

gallery-voting/index.php 85% from 13 tests

The main PHP script in "Tribulant Gallery Voting" version 1.2.1 is automatically included on every request by WordPress
Please take the time to fix the following:
  • Main file name: It is recommended to name the main PHP file as the plugin slug ("gallery-voting.php" instead of "index.php")
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist

Code Analysis Passed 3 tests

File types Passed 1 test

🔸 Test weight: 35 | Executable files are considered dangerous and should not be included with any WordPress plugin
Success! There were no dangerous files found in this plugin435 lines of code in 2 files:
LanguageFilesBlank linesComment linesLines of code
PHP17552420
CSS11015

PHP code Passed 2 tests

This is a short overview of cyclomatic complexity and code structure for this plugin
No cyclomatic complexity issues were detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.47
Average class complexity71.00
▷ Minimum class complexity71.00
▷ Maximum class complexity71.00
Average method complexity6.83
▷ Minimum method complexity1.00
▷ Maximum method complexity37.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes1
▷ Abstract classes00.00%
▷ Concrete classes1100.00%
▷ Final classes00.00%
Methods12
▷ Static methods00.00%
▷ Public methods12100.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions0
▷ Named functions00.00%
▷ Anonymous functions00.00%
Constants0
▷ Global constants00.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

Using a strong compression for your PNG files is a great way to speed-up your plugin
1 PNG file occupies 0.31MB with 0.23MB in potential savings
Potential savings
Compression of 1 random PNG file using pngquant
FileSize - originalSize - compressedSavings
screenshot-1.png317.51KB84.96KB▼ 73.24%