10% photoroulette

Code Review | PhotoRoulette

WordPress plugin PhotoRoulette scored10%from 54 tests.

About plugin

  • Plugin page: photoroulette
  • Plugin version: 1.1.0
  • PHP version: 7.4.16
  • WordPress compatibility: 4.0-4.3.1
  • WordPress version: 6.3.1
  • First release: Sep 23, 2015
  • Latest release: Sep 25, 2015
  • Number of updates: 31
  • Update frequency: every 0.1 days
  • Top authors: polkan (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /947 total downloads

Benchmarks

Plugin footprint 40% from 16 tests

Installer 0% from 1 test

🔺 Critical test (weight: 50) | Verifying that this plugin installs correctly without errors
These installer errors require your attention
  • Install procedure validation failed for this plugin
    • > Deprecated in wp-content/plugins/photoroulette/widget.php+222
    Function create_function() is deprecated

Server metrics [RAM: ▼1.91MB] [CPU: ▼58.83ms] Passed 4 tests

Server-side resources used by PhotoRoulette
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /2.09 ▼1.375.58 ▼43.90
Dashboard /wp-admin2.11 ▼1.247.95 ▼53.54
Posts /wp-admin/edit.php2.11 ▼1.257.14 ▼45.59
Add New Post /wp-admin/post-new.php2.11 ▼3.788.92 ▼92.27
Media Library /wp-admin/upload.php2.11 ▼1.127.56 ▼29.79

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

Input-output and database impact of this plugin
No storage issues were detected
Filesystem: 19 new files
Database: no new tables, 7 new options
New WordPress options
theysaidso_admin_options
db_upgraded
can_compress_scripts
widget_theysaidso_widget
widget_recent-comments
widget_recent-posts
widget_pwppr

Browser metrics Passed 4 tests

PhotoRoulette: an overview of browser usage
This plugin has a minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,893 ▲13213.55 ▼0.809.47 ▲7.8339.34 ▼7.29
Dashboard /wp-admin2,196 ▲195.58 ▲0.0194.52 ▼7.0442.94 ▲4.60
Posts /wp-admin/edit.php2,113 ▲132.25 ▲0.2438.80 ▼1.1435.77 ▼2.93
Add New Post /wp-admin/post-new.php1,532 ▲423.10 ▼0.14672.89 ▲10.6060.28 ▲8.25
Media Library /wp-admin/upload.php1,409 ▲154.31 ▲0.0898.76 ▼5.0646.29 ▲1.45

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
You still need to fix the following
  • The plugin did not uninstall gracefully
    • > Deprecated in wp-content/plugins/photoroulette/widget.php+222
    Function create_function() is deprecated
  • Zombie WordPress options were found after uninstall: 7 options
    • widget_recent-posts
    • widget_theysaidso_widget
    • widget_pwppr
    • theysaidso_admin_options
    • widget_recent-comments
    • db_upgraded
    • can_compress_scripts

Smoke tests Passed 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no server-side errors were triggered
Everything seems fine, however this is by no means an exhaustive test

SRP Passed 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
No output text or server-side errors detected on direct access of PHP files

User-side errors Passed 1 test

🔹 Test weight: 20 | This is a shallow check for browser errors
No browser errors were detected

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
These attributes need your attention:
  • Tags: Please reduce the number of tags, currently 14 tag instead of maximum 10
Please take inspiration from this readme.txt

photoroulette/index.php 92% from 13 tests

"PhotoRoulette" version 1.1.0's primary PHP file adds more information about the plugin and serves as the entry point for WordPress
You should first fix the following items:
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("photoroulette.php" instead of "index.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 detected550 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP47471310
CSS200127
PO File1202057
JavaScript215356

PHP code Passed 2 tests

Cyclomatic complexity and code structure are the fingerprint of this plugin
Everything seems fine, there were no complexity issues found
Cyclomatic complexity
Average complexity per logical line of code0.22
Average class complexity11.50
▷ Minimum class complexity5.00
▷ Maximum class complexity18.00
Average method complexity3.10
▷ Minimum method complexity1.00
▷ Maximum method complexity11.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes2
▷ Abstract classes00.00%
▷ Concrete classes2100.00%
▷ Final classes00.00%
Methods10
▷ Static methods00.00%
▷ Public methods990.00%
▷ Protected methods00.00%
▷ Private methods110.00%
Functions1
▷ Named functions1100.00%
▷ Anonymous functions00.00%
Constants4
▷ Global constants4100.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
No PNG images were found in this plugin