73% voting-for-a-photo

Code Review | Voting for a Photo

WordPress plugin Voting for a Photo scored73%from 54 tests.

About plugin

  • Plugin page: voting-for-a-photo
  • Plugin version: 1.2
  • PHP compatiblity: 5.6+
  • PHP version: 7.4.16
  • WordPress compatibility: 4.9.8-4.9.8
  • WordPress version: 6.3.1
  • First release: Dec 5, 2018
  • Latest release: Dec 11, 2018
  • Number of updates: 14
  • Update frequency: every 0.5 days
  • Top authors: processby (100%)

Code review

54 tests

User reviews

1 review

Install metrics

100+ active /3,154 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
Install script ran successfully

Server metrics [RAM: ▲0.02MB] [CPU: ▼2.46ms] Passed 4 tests

This is a short check of server-side resources used by Voting for a Photo
This plugin has minimal impact on server resources
PageMemory (MB)CPU Time (ms)
Home /3.48 ▲0.0235.25 ▼3.58
Dashboard /wp-admin3.32 ▲0.0254.13 ▲3.05
Posts /wp-admin/edit.php3.37 ▲0.0253.72 ▲3.43
Add New Post /wp-admin/post-new.php5.91 ▲0.0290.05 ▼6.78
Media Library /wp-admin/upload.php3.25 ▲0.0234.18 ▼2.52

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

Analyzing filesystem and database footprints of this plugin
No storage issues were detected
Filesystem: 40 new files
Database: 1 new table, 6 new options
New tables
wp_galleryvotes
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_recent-posts
widget_theysaidso_widget
widget_recent-comments

Browser metrics Passed 4 tests

Voting for a Photo: an overview of browser usage
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,875 ▲11413.79 ▼0.947.81 ▲6.0137.77 ▼7.19
Dashboard /wp-admin2,198 ▲215.63 ▲0.1084.81 ▼14.8738.38 ▼4.96
Posts /wp-admin/edit.php2,103 ▲32.03 ▲0.0438.08 ▼1.0835.59 ▼1.28
Add New Post /wp-admin/post-new.php1,532 ▲623.57 ▼0.06655.24 ▲0.9858.01 ▲0.07
Media Library /wp-admin/upload.php1,406 ▲64.26 ▼0.0198.48 ▼2.7344.05 ▲0.93

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 uninstall procedure failed, leaving 1 table in the database
    • wp_galleryvotes
  • Zombie WordPress options were found after uninstall: 6 options
    • widget_recent-posts
    • theysaidso_admin_options
    • widget_theysaidso_widget
    • can_compress_scripts
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% 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 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
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Class 'WP_Customize_Control' not found in wp-content/plugins/voting-for-a-photo/src/Admin/Customizer/CustomizeDonate.php:6

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a smoke test targeting browser errors/issues
No browser errors were detected

Optimizations

Plugin configuration 90% from 29 tests

readme.txt 94% from 16 tests

It's important to format your readme.txt file correctly as it is parsed for the public listing of your plugin
These attributes need your attention:
  • Screenshots: Please add images for these screenshots: #1 (Voting settings in WP standart gallery), #2 (How it looks on the site), #3 (Settings)
You can look at the official readme.txt

voting-for-a-photo/voting-for-a-photo.php 85% from 13 tests

This is the main PHP file of "Voting for a Photo" version 1.2, providing information about the plugin in the header fields and serving as the principal entry point to the plugin's functions
Please make the necessary changes and fix the following:
  • Domain Path: The domain path points to an invalid folder, "/languages" does not exist
  • Text Domain: The text domain is optional since WordPress version 4.6; if you do specify it, it must be the same as the plugin slug

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 detected1,651 lines of code in 24 files:
LanguageFilesBlank linesComment linesLines of code
PHP183603431,204
CSS110274
JSON31072
Markdown153070
JavaScript13231

PHP code Passed 2 tests

This plugin's cyclomatic complexity and code structure detailed below
Great job! No cyclomatic complexity issues were detected in this plugin
Cyclomatic complexity
Average complexity per logical line of code0.34
Average class complexity12.58
▷ Minimum class complexity1.00
▷ Maximum class complexity44.00
Average method complexity3.12
▷ Minimum method complexity1.00
▷ Maximum method complexity39.00
Code structure
Namespaces8
Interfaces1
Traits0
Classes11
▷ Abstract classes00.00%
▷ Concrete classes11100.00%
▷ Final classes00.00%
Methods71
▷ Static methods57.04%
▷ Public methods6490.14%
▷ Protected methods45.63%
▷ Private methods34.23%
Functions4
▷ Named functions125.00%
▷ Anonymous functions375.00%
Constants5
▷ Global constants00.00%
▷ Class constants5100.00%
▷ Public constants5100.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.08MB with 0.03MB in potential savings
Potential savings
Compression of 5 random PNG files using pngquant
FileSize - originalSize - compressedSavings
assets/frontend/img/icon-like-stroke-white.png2.46KB1.81KB▼ 26.43%
assets/frontend/img/icon-like-stroke.png2.38KB1.73KB▼ 27.38%
screenshot-1.png33.08KB16.24KB▼ 50.90%
assets/frontend/img/icon-heart-white.png2.55KB1.52KB▼ 40.49%
assets/frontend/img/icon-heart-stroke.png3.43KB2.16KB▼ 36.94%