83% sprite-generator

Code Review | Sprite Generator

WordPress plugin Sprite Generator scored83%from 54 tests.

About plugin

  • Plugin page: sprite-generator
  • Plugin version: 1.00
  • PHP compatiblity: 6.0+
  • PHP version: 7.4.16
  • WordPress compatibility: 3.5-6.3
  • WordPress version: 6.3.1
  • First release: Feb 16, 2023
  • Latest release: Jul 31, 2023
  • Number of updates: 4
  • Update frequency: every 41.5 days
  • Top authors: manu225 (100%)

Code review

54 tests

User reviews

1 review

Install metrics

10+ active /157 total downloads

Benchmarks

Plugin footprint 83% from 16 tests

Installer Passed 1 test

🔺 Critical test (weight: 50) | It is important to correctly install your plugin, without throwing errors or notices
The plugin installed gracefully, with no errors

Server metrics [RAM: ▲0.06MB] [CPU: ▼1.28ms] Passed 4 tests

Server-side resources used by Sprite Generator
Server-side resource usage in normal parameters
PageMemory (MB)CPU Time (ms)
Home /3.52 ▲0.0638.78 ▼2.66
Dashboard /wp-admin3.37 ▲0.0646.46 ▲0.11
Posts /wp-admin/edit.php3.42 ▲0.0647.45 ▼2.69
Add New Post /wp-admin/post-new.php5.97 ▲0.0897.99 ▲8.38
Media Library /wp-admin/upload.php3.29 ▲0.0636.02 ▲0.13

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

Input-output and database impact of this plugin
This plugin installed successfully
Filesystem: 16 new files
Database: 2 new tables, 6 new options
New tables
wp_sprite_generator
wp_sprite_generator_image
New WordPress options
widget_recent-posts
theysaidso_admin_options
db_upgraded
widget_recent-comments
widget_theysaidso_widget
can_compress_scripts

Browser metrics Passed 4 tests

Checking browser requirements for Sprite Generator
Minimal impact on browser resources
PageNodesMemory (MB)Script (ms)Layout (ms)
Home /2,840 ▲10513.32 ▼1.102.08 ▲0.4542.28 ▼0.77
Dashboard /wp-admin2,224 ▲394.89 ▼0.01110.69 ▲7.6374.61 ▲31.14
Posts /wp-admin/edit.php2,110 ▲182.01 ▲0.0038.39 ▼5.4334.36 ▼1.26
Add New Post /wp-admin/post-new.php1,547 ▲2818.36 ▼4.75685.28 ▼26.6763.71 ▲4.12
Media Library /wp-admin/upload.php1,406 ▲184.11 ▼0.16115.80 ▲11.4744.92 ▼0.09

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

🔸 Tests weight: 35 | All plugins must uninstall correctly, removing their source code and extra database tables they might have created
The following items require your attention
  • Zombie WordPress options were found after uninstall: 6 options
    • can_compress_scripts
    • widget_recent-posts
    • widget_theysaidso_widget
    • theysaidso_admin_options
    • db_upgraded
    • widget_recent-comments

Smoke tests 75% from 4 tests

Server-side errors Passed 1 test

🔹 Test weight: 20 | A smoke test targeting 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
Almost there! Just fix the following items
  • 1× PHP files trigger server errors when accessed directly:
    • > PHP Fatal error
      Uncaught Error: Call to undefined function register_activation_hook() in wp-content/plugins/sprite-generator/sprite_generator.php:14

User-side errors Passed 1 test

🔹 Test weight: 20 | A shallow check that no browser errors were triggered
Everything seems fine, but this is not an exhaustive test

Optimizations

Plugin configuration 90% from 29 tests

readme.txt Passed 16 tests

Often overlooked, readme.txt is one of the most important files in your plugin
5 plugin tags: multiple image, speed, sprite, optimize image, generator

sprite-generator/sprite_generator.php 77% from 13 tests

The main PHP script in "Sprite Generator" version 1.00 is automatically included on every request by WordPress
You should first fix the following items:
  • Domain Path: The domain path should use only dashes and lowercase characters ("")
  • Domain Path: The domain path should be prefixed with a forward slash character ("/")
  • Main file name: Please rename the main PHP file in this plugin to the plugin slug ("sprite-generator.php" instead of "sprite_generator.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
Good job! No executable or dangerous file extensions detected550 lines of code in 9 files:
LanguageFilesBlank linesComment linesLines of code
PHP67233488
CSS213060
JavaScript1242

PHP code Passed 2 tests

Analyzing logical lines of code, cyclomatic complexity, and other code metrics
There are no cyclomatic complexity problems detected for this plugin
Cyclomatic complexity
Average complexity per logical line of code0.32
Average class complexity0.00
▷ Minimum class complexity0.00
▷ Maximum class complexity0.00
Average method complexity0.00
▷ Minimum method complexity0.00
▷ Maximum method complexity0.00
Code structure
Namespaces0
Interfaces0
Traits0
Classes0
▷ Abstract classes00.00%
▷ Concrete classes00.00%
▷ Final classes00.00%
Methods0
▷ Static methods00.00%
▷ Public methods00.00%
▷ Protected methods00.00%
▷ Private methods00.00%
Functions11
▷ Named functions11100.00%
▷ Anonymous functions00.00%
Constants1
▷ Global constants1100.00%
▷ Class constants00.00%
▷ Public constants00.00%

Plugin size Passed 2 tests

Image compression Passed 2 tests

PNG files should be compressed to save space and minimize bandwidth usage
4 PNG files occupy 0.00MB with 0.00MB in potential savings
Potential savings
Compression of 4 random PNG files using pngquant
FileSize - originalSize - compressedSavings
images/manage.png0.68KB0.22KB▼ 67.05%
images/icon.png0.56KB0.10KB▼ 81.99%
images/remove.png1.27KB1.20KB▼ 5.76%
images/edit.png0.87KB0.87KB0.00%